Update scripts and docs to use yarn
where appropriate
Most `npm` operations are replaced with `yarn`, which generally has better behavior. However, steps like publish that write to the NPM registry are left to `npm`, which currently handles these tasks best.
This commit is contained in:
parent
13aca0716a
commit
1312ba537a
12 changed files with 89 additions and 107 deletions
22
scripts/yarn-sub.js
Normal file
22
scripts/yarn-sub.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const path = require('path');
|
||||
const child_process = require('child_process');
|
||||
|
||||
const moduleName = process.argv[2];
|
||||
if (!moduleName) {
|
||||
console.error("Expected module name");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const argString = process.argv.length > 3 ? process.argv.slice(3).join(" ") : "";
|
||||
if (!argString) {
|
||||
console.error("Expected an yarn argument string to use");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const modulePath = path.dirname(require.resolve(`${moduleName}/package.json`));
|
||||
|
||||
child_process.execSync("yarn " + argString, {
|
||||
env: process.env,
|
||||
cwd: modulePath,
|
||||
stdio: ['inherit', 'inherit', 'inherit'],
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue