forked from lerna/lerna
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.js
91 lines (86 loc) · 2.58 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
88
89
90
91
"use strict";
/**
* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module
*/
exports.command = "create <name> [loc]";
exports.describe = "Create a new lerna-managed package";
exports.builder = yargs => {
yargs
.positional("name", {
describe: "The package name (including scope), which must be locally unique _and_ publicly available",
type: "string",
})
.positional("loc", {
describe: "A custom package location, defaulting to the first configured package location",
type: "string",
})
.options({
access: {
group: "Command Options:",
defaultDescription: "public",
describe: "When using a scope, set publishConfig.access value",
choices: ["public", "restricted"],
},
bin: {
group: "Command Options:",
defaultDescription: "<name>",
describe: "Package has an executable. Customize with --bin <executableName>",
},
description: {
group: "Command Options:",
describe: "Package description",
type: "string",
},
dependencies: {
group: "Command Options:",
describe: "A list of package dependencies",
type: "array",
},
"es-module": {
group: "Command Options:",
describe: "Initialize a transpiled ES Module",
type: "boolean",
},
homepage: {
group: "Command Options:",
describe: "The package homepage, defaulting to a subpath of the root pkg.homepage",
type: "string",
},
keywords: {
group: "Command Options:",
describe: "A list of package keywords",
type: "array",
},
license: {
group: "Command Options:",
defaultDescription: "ISC",
describe: "The desired package license (SPDX identifier)",
type: "string",
},
private: {
group: "Command Options:",
describe: "Make the new package private, never published to any external registry",
type: "boolean",
},
registry: {
group: "Command Options:",
describe: "Configure the package's publishConfig.registry",
type: "string",
},
tag: {
group: "Command Options:",
describe: "Configure the package's publishConfig.tag",
type: "string",
},
y: {
group: "Command Options:",
describe: "Skip all prompts, accepting default values",
alias: "yes",
type: "boolean",
},
});
return yargs;
};
exports.handler = function handler(argv) {
return require(".")(argv);
};