forked from lerna/lerna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.js
87 lines (81 loc) · 2.57 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
"use strict";
const { filterOptions } = 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"
)
.parserConfiguration({
"populate--": true,
})
.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-prepublish": {
group: "Command Options:",
describe: "Don't run prepublish lifecycle scripts in bootstrapped packages.",
type: "boolean",
},
"ignore-scripts": {
group: "Command Options:",
describe: "Don't run _any_ 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,
},
strict: {
group: "Command Options:",
describe: "Don't allow warnings when hoisting as it causes longer bootstrap times and other issues.",
type: "boolean",
},
"use-workspaces": {
group: "Command Options:",
describe: "Enable integration with Yarn workspaces.",
type: "boolean",
},
"force-local": {
group: "Command Options:",
describe: "Force local sibling links regardless of version range match",
type: "boolean",
},
contents: {
group: "Command Options:",
describe: "Subdirectory to use as the source of any links. Must apply to ALL packages.",
type: "string",
defaultDescription: ".",
},
});
return filterOptions(yargs);
};
exports.handler = function handler(argv) {
return require(".")(argv);
};