Skip to content

Commit

Permalink
chore: replace execa with tinyexec and Node's `child_process.spaw…
Browse files Browse the repository at this point in the history
…nSync` (#4134)

* chore(utils): replace `execa` with `tinyexec`

* chore(commitlint): replace `execa` with `tinyexec`

* chore(read): replace `execa` with `tinyexec`

* chore(travis-cli): replace `execa` with `tinyexec`

* chore(prompt-cli): replace `execa` with `tinyexec`

* chore(cli): replace `execa` with `tinyexec`

* chore(prompt-cli): fix the test

* chore(test): replace `execa` with `tinyexec`

* chore(rules): replace `execa` with a native implementation

* chore: fix the test
  • Loading branch information
ziebam authored Sep 7, 2024
1 parent c10c07f commit 3c4b0fd
Show file tree
Hide file tree
Showing 22 changed files with 417 additions and 329 deletions.
17 changes: 11 additions & 6 deletions @alias/commitlint/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {createRequire} from 'module';
import path from 'path';
import {fileURLToPath} from 'url';

import {execa} from 'execa';
import {x} from 'tinyexec';
import {fix} from '@commitlint/test';

const require = createRequire(import.meta.url);
Expand All @@ -13,12 +13,17 @@ const __dirname = path.resolve(fileURLToPath(import.meta.url), '..');
const bin = require.resolve('./cli.js');

function cli(args, options, input) {
const c = execa(bin, args, {
cwd: options.cwd,
env: options.env,
input: input,
const result = x(bin, args, {
nodeOptions: {
cwd: options.cwd,
env: options.env,
},
});
return c.catch((err) => err);

result.process.stdin.write(input);
result.process.stdin.end();

return result;
}

const fixBootstrap = (fixture) => fix.bootstrap(fixture, __dirname);
Expand Down
2 changes: 1 addition & 1 deletion @alias/commitlint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"devDependencies": {
"@commitlint/test": "^19.0.0",
"@commitlint/utils": "^19.0.0",
"execa": "^8.0.1"
"tinyexec": "^0.3.0"
},
"gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc"
}
2 changes: 1 addition & 1 deletion @commitlint/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@commitlint/load": "^19.4.0",
"@commitlint/read": "^19.4.0",
"@commitlint/types": "^19.0.3",
"execa": "^8.0.1",
"tinyexec": "^0.3.0",
"yargs": "^17.0.0"
},
"gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc"
Expand Down
Loading

0 comments on commit 3c4b0fd

Please sign in to comment.