Skip to content

chore: replace execa with tinyexec and Node's child_process.spawnSync #4134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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