/
command.js
58 lines (52 loc) · 1.59 KB
/
command.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"use strict";
const filterable = require("@lerna/filter-options");
/**
* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module
*/
exports.command = "bootstrap";
exports.describe = "Link local packages together and install remaining package dependencies";
exports.builder = yargs => {
yargs
.example(
"$0 bootstrap -- --no-optional",
"# execute `npm install --no-optional` in bootstrapped packages"
)
.options({
hoist: {
group: "Command Options:",
describe: "Install external dependencies matching [glob] to the repo root",
defaultDescription: "'**'",
},
nohoist: {
group: "Command Options:",
describe: "Don't hoist external dependencies matching [glob] to the repo root",
type: "string",
requiresArg: true,
},
mutex: {
hidden: true,
// untyped and hidden on purpose
},
"ignore-scripts": {
group: "Command Options:",
describe: "Don't run lifecycle scripts in bootstrapped packages",
type: "boolean",
},
"npm-client": {
group: "Command Options:",
describe: "Executable used to install dependencies (npm, yarn, pnpm, ...)",
type: "string",
requiresArg: true,
},
registry: {
group: "Command Options:",
describe: "Use the specified registry for all npm client operations.",
type: "string",
requiresArg: true,
},
});
return filterable(yargs);
};
exports.handler = function handler(argv) {
return require(".")(argv);
};