Skip to content

Commit

Permalink
Replace dev dependency execa with nano-spawn (smaller, 0 dependencies).
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Sep 18, 2024
1 parent 861a7b3 commit 4099caf
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 517 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"eslint-plugin-jsdoc": "50.2.3",
"eslint-plugin-n": "17.10.2",
"eslint-plugin-unicorn": "55.0.0",
"execa": "9.3.1",
"nano-spawn": "0.1.0",
"markdown-it-emoji": "3.0.0",
"markdown-it-for-inline": "2.0.1",
"markdownlint-cli2-formatter-codequality": "0.0.5",
Expand Down
22 changes: 14 additions & 8 deletions test/markdownlint-cli2-test-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ const testCases = require("./markdownlint-cli2-test-cases");

const invoke = (directory, args, noRequire, env, script) => async () => {
await fs.access(directory);
const { execaNode } = await import("execa");
return execaNode(
path.join(__dirname, "..", script || "markdownlint-cli2.js"),
args,
const { "default": spawn } = await import("nano-spawn");
return spawn(
"node",
[
path.join(__dirname, "..", script || "markdownlint-cli2.js"),
...args
],
{
"cwd": directory,
"env": env || {},
"reject": false,
"stripFinalNewline": false
"env": env || {}
}
);
).
then((subprocess) => ({
...subprocess,
"exitCode": 0
})).
catch((error) => error);
};

const absolute = (rootDir, file) => path.join(rootDir, file);
Expand Down
Loading

0 comments on commit 4099caf

Please sign in to comment.