@vltpkg/cli-sdk 1.0.0-rc.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/access.d.ts +23 -0
- package/dist/commands/access.js +251 -0
- package/dist/{esm/commands → commands}/bugs.d.ts +0 -1
- package/dist/{esm/commands → commands}/bugs.js +0 -1
- package/dist/{esm/commands → commands}/build.d.ts +1 -1
- package/dist/{esm/commands → commands}/build.js +1 -1
- package/dist/{esm/commands → commands}/cache.d.ts +1 -1
- package/dist/{esm/commands → commands}/cache.js +1 -1
- package/dist/{esm/commands → commands}/ci.d.ts +1 -1
- package/dist/{esm/commands → commands}/ci.js +12 -3
- package/dist/{esm/commands → commands}/config.d.ts +0 -1
- package/dist/{esm/commands → commands}/config.js +6 -1
- package/dist/commands/create.d.ts +9 -0
- package/dist/commands/create.js +103 -0
- package/dist/commands/deprecate.d.ts +14 -0
- package/dist/commands/deprecate.js +142 -0
- package/dist/commands/dist-tag.d.ts +22 -0
- package/dist/commands/dist-tag.js +179 -0
- package/dist/{esm/commands → commands}/docs.d.ts +0 -1
- package/dist/{esm/commands → commands}/docs.js +0 -1
- package/dist/{esm/commands → commands}/exec-cache.d.ts +1 -1
- package/dist/{esm/commands → commands}/exec-cache.js +1 -1
- package/dist/{esm/commands/run-exec.d.ts → commands/exec-local.d.ts} +0 -1
- package/dist/{esm/commands → commands}/exec-local.js +23 -1
- package/dist/{esm/commands → commands}/exec.d.ts +1 -1
- package/dist/{esm/commands → commands}/exec.js +85 -10
- package/dist/{esm/commands → commands}/help.d.ts +0 -1
- package/dist/{esm/commands → commands}/help.js +5 -1
- package/dist/{esm/commands → commands}/init.d.ts +0 -1
- package/dist/{esm/commands → commands}/init.js +31 -10
- package/dist/{esm/commands → commands}/install/reporter.d.ts +0 -1
- package/dist/{esm/commands → commands}/install/reporter.js +0 -1
- package/dist/{esm/commands → commands}/install.d.ts +22 -3
- package/dist/commands/install.js +152 -0
- package/dist/{esm/commands → commands}/list.d.ts +5 -2
- package/dist/{esm/commands → commands}/list.js +9 -10
- package/dist/{esm/commands → commands}/login.d.ts +0 -1
- package/dist/commands/login.js +35 -0
- package/dist/{esm/commands → commands}/logout.d.ts +1 -1
- package/dist/commands/logout.js +27 -0
- package/dist/{esm/commands → commands}/pack.d.ts +1 -1
- package/dist/{esm/commands → commands}/pack.js +91 -32
- package/dist/commands/ping.d.ts +18 -0
- package/dist/commands/ping.js +117 -0
- package/dist/{esm/commands → commands}/pkg.d.ts +0 -1
- package/dist/{esm/commands → commands}/pkg.js +27 -1
- package/dist/commands/profile.d.ts +14 -0
- package/dist/commands/profile.js +106 -0
- package/dist/{esm/commands → commands}/publish.d.ts +2 -2
- package/dist/{esm/commands → commands}/publish.js +70 -16
- package/dist/{esm/commands → commands}/query.d.ts +5 -2
- package/dist/{esm/commands → commands}/query.js +54 -11
- package/dist/commands/registry.d.ts +26 -0
- package/dist/commands/registry.js +99 -0
- package/dist/commands/repo.d.ts +17 -0
- package/dist/commands/repo.js +157 -0
- package/dist/{esm/commands/exec-local.d.ts → commands/run-exec.d.ts} +1 -1
- package/dist/commands/run-exec.js +41 -0
- package/dist/{esm/commands → commands}/run.d.ts +0 -1
- package/dist/{esm/commands → commands}/run.js +27 -1
- package/dist/commands/setup.d.ts +25 -0
- package/dist/commands/setup.js +142 -0
- package/dist/commands/token.d.ts +32 -0
- package/dist/commands/token.js +193 -0
- package/dist/{esm/commands → commands}/uninstall.d.ts +1 -1
- package/dist/{esm/commands → commands}/uninstall.js +15 -1
- package/dist/commands/unpublish.d.ts +16 -0
- package/dist/commands/unpublish.js +203 -0
- package/dist/{esm/commands → commands}/update.d.ts +1 -1
- package/dist/{esm/commands → commands}/update.js +7 -1
- package/dist/{esm/commands → commands}/version.d.ts +0 -1
- package/dist/{esm/commands → commands}/version.js +27 -1
- package/dist/commands/view.d.ts +23 -0
- package/dist/commands/view.js +335 -0
- package/dist/{esm/commands → commands}/whoami.d.ts +1 -1
- package/dist/commands/whoami.js +33 -0
- package/dist/{esm/config → config}/definition.d.ts +72 -19
- package/dist/{esm/config → config}/definition.js +157 -50
- package/dist/{esm/config → config}/index.d.ts +0 -1
- package/dist/{esm/config → config}/index.js +43 -2
- package/dist/{esm/config → config}/merge.d.ts +0 -1
- package/dist/{esm/config → config}/merge.js +0 -1
- package/dist/{esm/config → config}/usage.d.ts +0 -1
- package/dist/{esm/config → config}/usage.js +0 -1
- package/dist/{esm/custom-help.d.ts → custom-help.d.ts} +0 -1
- package/dist/{esm/custom-help.js → custom-help.js} +95 -120
- package/dist/{esm/exec-command.d.ts → exec-command.d.ts} +0 -1
- package/dist/{esm/exec-command.js → exec-command.js} +14 -8
- package/dist/{esm/index.d.ts → index.d.ts} +0 -1
- package/dist/{esm/index.js → index.js} +5 -2
- package/dist/{esm/load-command.d.ts → load-command.d.ts} +6 -1
- package/dist/{esm/load-command.js → load-command.js} +0 -1
- package/dist/mermaid-image-view.d.ts +18 -0
- package/dist/mermaid-image-view.js +36 -0
- package/dist/{esm/output.d.ts → output.d.ts} +2 -2
- package/dist/{esm/output.js → output.js} +70 -3
- package/dist/{esm/pack-tarball.d.ts → pack-tarball.d.ts} +15 -1
- package/dist/{esm/pack-tarball.js → pack-tarball.js} +133 -91
- package/dist/{esm/parse-add-remove-args.d.ts → parse-add-remove-args.d.ts} +0 -1
- package/dist/{esm/parse-add-remove-args.js → parse-add-remove-args.js} +65 -12
- package/dist/{esm/print-err.d.ts → print-err.d.ts} +0 -1
- package/dist/{esm/print-err.js → print-err.js} +28 -4
- package/dist/query-diff-files.d.ts +17 -0
- package/dist/query-diff-files.js +63 -0
- package/dist/{esm/query-host-contexts.d.ts → query-host-contexts.d.ts} +0 -1
- package/dist/{esm/query-host-contexts.js → query-host-contexts.js} +8 -7
- package/dist/{esm/read-password.d.ts → read-password.d.ts} +0 -1
- package/dist/{esm/read-password.js → read-password.js} +0 -1
- package/dist/read-project-folders.d.ts +17 -0
- package/dist/read-project-folders.js +100 -0
- package/dist/registry-error-message.d.ts +2 -0
- package/dist/registry-error-message.js +29 -0
- package/dist/reload-config.d.ts +2 -0
- package/dist/reload-config.js +11 -0
- package/dist/render-mermaid.d.ts +22 -0
- package/dist/render-mermaid.js +68 -0
- package/dist/require-registry.d.ts +48 -0
- package/dist/require-registry.js +122 -0
- package/dist/select-registry.d.ts +23 -0
- package/dist/select-registry.js +40 -0
- package/dist/telemetry.d.ts +58 -0
- package/dist/telemetry.js +170 -0
- package/dist/verbose-log.d.ts +31 -0
- package/dist/verbose-log.js +62 -0
- package/dist/{esm/view.d.ts → view.d.ts} +0 -1
- package/dist/{esm/view.js → view.js} +1 -2
- package/package.json +75 -82
- package/dist/esm/commands/bugs.d.ts.map +0 -1
- package/dist/esm/commands/bugs.js.map +0 -1
- package/dist/esm/commands/build.d.ts.map +0 -1
- package/dist/esm/commands/build.js.map +0 -1
- package/dist/esm/commands/cache.d.ts.map +0 -1
- package/dist/esm/commands/cache.js.map +0 -1
- package/dist/esm/commands/ci.d.ts.map +0 -1
- package/dist/esm/commands/ci.js.map +0 -1
- package/dist/esm/commands/config.d.ts.map +0 -1
- package/dist/esm/commands/config.js.map +0 -1
- package/dist/esm/commands/docs.d.ts.map +0 -1
- package/dist/esm/commands/docs.js.map +0 -1
- package/dist/esm/commands/exec-cache.d.ts.map +0 -1
- package/dist/esm/commands/exec-cache.js.map +0 -1
- package/dist/esm/commands/exec-local.d.ts.map +0 -1
- package/dist/esm/commands/exec-local.js.map +0 -1
- package/dist/esm/commands/exec.d.ts.map +0 -1
- package/dist/esm/commands/exec.js.map +0 -1
- package/dist/esm/commands/help.d.ts.map +0 -1
- package/dist/esm/commands/help.js.map +0 -1
- package/dist/esm/commands/init.d.ts.map +0 -1
- package/dist/esm/commands/init.js.map +0 -1
- package/dist/esm/commands/install/reporter.d.ts.map +0 -1
- package/dist/esm/commands/install/reporter.js.map +0 -1
- package/dist/esm/commands/install.d.ts.map +0 -1
- package/dist/esm/commands/install.js +0 -46
- package/dist/esm/commands/install.js.map +0 -1
- package/dist/esm/commands/list.d.ts.map +0 -1
- package/dist/esm/commands/list.js.map +0 -1
- package/dist/esm/commands/login.d.ts.map +0 -1
- package/dist/esm/commands/login.js +0 -13
- package/dist/esm/commands/login.js.map +0 -1
- package/dist/esm/commands/logout.d.ts.map +0 -1
- package/dist/esm/commands/logout.js +0 -13
- package/dist/esm/commands/logout.js.map +0 -1
- package/dist/esm/commands/pack.d.ts.map +0 -1
- package/dist/esm/commands/pack.js.map +0 -1
- package/dist/esm/commands/pkg.d.ts.map +0 -1
- package/dist/esm/commands/pkg.js.map +0 -1
- package/dist/esm/commands/publish.d.ts.map +0 -1
- package/dist/esm/commands/publish.js.map +0 -1
- package/dist/esm/commands/query.d.ts.map +0 -1
- package/dist/esm/commands/query.js.map +0 -1
- package/dist/esm/commands/run-exec.d.ts.map +0 -1
- package/dist/esm/commands/run-exec.js +0 -14
- package/dist/esm/commands/run-exec.js.map +0 -1
- package/dist/esm/commands/run.d.ts.map +0 -1
- package/dist/esm/commands/run.js.map +0 -1
- package/dist/esm/commands/serve.d.ts +0 -14
- package/dist/esm/commands/serve.d.ts.map +0 -1
- package/dist/esm/commands/serve.js +0 -103
- package/dist/esm/commands/serve.js.map +0 -1
- package/dist/esm/commands/token.d.ts +0 -4
- package/dist/esm/commands/token.d.ts.map +0 -1
- package/dist/esm/commands/token.js +0 -30
- package/dist/esm/commands/token.js.map +0 -1
- package/dist/esm/commands/uninstall.d.ts.map +0 -1
- package/dist/esm/commands/uninstall.js.map +0 -1
- package/dist/esm/commands/update.d.ts.map +0 -1
- package/dist/esm/commands/update.js.map +0 -1
- package/dist/esm/commands/version.d.ts.map +0 -1
- package/dist/esm/commands/version.js.map +0 -1
- package/dist/esm/commands/whoami.d.ts.map +0 -1
- package/dist/esm/commands/whoami.js +0 -19
- package/dist/esm/commands/whoami.js.map +0 -1
- package/dist/esm/config/definition.d.ts.map +0 -1
- package/dist/esm/config/definition.js.map +0 -1
- package/dist/esm/config/index.d.ts.map +0 -1
- package/dist/esm/config/index.js.map +0 -1
- package/dist/esm/config/merge.d.ts.map +0 -1
- package/dist/esm/config/merge.js.map +0 -1
- package/dist/esm/config/usage.d.ts.map +0 -1
- package/dist/esm/config/usage.js.map +0 -1
- package/dist/esm/custom-help.d.ts.map +0 -1
- package/dist/esm/custom-help.js.map +0 -1
- package/dist/esm/exec-command.d.ts.map +0 -1
- package/dist/esm/exec-command.js.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/load-command.d.ts.map +0 -1
- package/dist/esm/load-command.js.map +0 -1
- package/dist/esm/output.d.ts.map +0 -1
- package/dist/esm/output.js.map +0 -1
- package/dist/esm/pack-tarball.d.ts.map +0 -1
- package/dist/esm/pack-tarball.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/parse-add-remove-args.d.ts.map +0 -1
- package/dist/esm/parse-add-remove-args.js.map +0 -1
- package/dist/esm/print-err.d.ts.map +0 -1
- package/dist/esm/print-err.js.map +0 -1
- package/dist/esm/query-host-contexts.d.ts.map +0 -1
- package/dist/esm/query-host-contexts.js.map +0 -1
- package/dist/esm/read-password.d.ts.map +0 -1
- package/dist/esm/read-password.js.map +0 -1
- package/dist/esm/start-gui.d.ts +0 -10
- package/dist/esm/start-gui.d.ts.map +0 -1
- package/dist/esm/start-gui.js +0 -60
- package/dist/esm/start-gui.js.map +0 -1
- package/dist/esm/view.d.ts.map +0 -1
- package/dist/esm/view.js.map +0 -1
|
@@ -15,11 +15,15 @@ export const defaultEditor = () => process.env.EDITOR ||
|
|
|
15
15
|
`${process.env.SYSTEMROOT}\\notepad.exe`
|
|
16
16
|
: 'vi');
|
|
17
17
|
const canonicalCommands = {
|
|
18
|
+
access: 'access',
|
|
18
19
|
bugs: 'bugs',
|
|
19
20
|
build: 'build',
|
|
20
21
|
cache: 'cache',
|
|
21
22
|
ci: 'ci',
|
|
22
23
|
config: 'config',
|
|
24
|
+
create: 'create',
|
|
25
|
+
deprecate: 'deprecate',
|
|
26
|
+
'dist-tag': 'dist-tag',
|
|
23
27
|
docs: 'docs',
|
|
24
28
|
exec: 'exec',
|
|
25
29
|
'exec-local': 'exec-local',
|
|
@@ -31,17 +35,23 @@ const canonicalCommands = {
|
|
|
31
35
|
list: 'list',
|
|
32
36
|
ls: 'ls',
|
|
33
37
|
pack: 'pack',
|
|
38
|
+
ping: 'ping',
|
|
34
39
|
pkg: 'pkg',
|
|
40
|
+
profile: 'profile',
|
|
35
41
|
publish: 'publish',
|
|
36
42
|
query: 'query',
|
|
43
|
+
registry: 'registry',
|
|
44
|
+
repo: 'repo',
|
|
37
45
|
'run-exec': 'run-exec',
|
|
38
46
|
run: 'run',
|
|
39
|
-
|
|
47
|
+
setup: 'setup',
|
|
40
48
|
token: 'token',
|
|
41
49
|
uninstall: 'uninstall',
|
|
50
|
+
unpublish: 'unpublish',
|
|
42
51
|
update: 'update',
|
|
43
52
|
'exec-cache': 'exec-cache',
|
|
44
53
|
version: 'version',
|
|
54
|
+
view: 'view',
|
|
45
55
|
whoami: 'whoami',
|
|
46
56
|
};
|
|
47
57
|
const aliases = {
|
|
@@ -56,12 +66,13 @@ const aliases = {
|
|
|
56
66
|
r: 'run',
|
|
57
67
|
'run-script': 'run',
|
|
58
68
|
rx: 'run-exec',
|
|
59
|
-
s: 'serve',
|
|
60
69
|
x: 'exec',
|
|
61
70
|
xl: 'exec-local',
|
|
62
71
|
h: 'help',
|
|
63
72
|
'?': 'help',
|
|
73
|
+
info: 'view',
|
|
64
74
|
ls: 'list',
|
|
75
|
+
show: 'view',
|
|
65
76
|
xc: 'exec-cache',
|
|
66
77
|
};
|
|
67
78
|
/**
|
|
@@ -94,34 +105,21 @@ export const recordFields = [
|
|
|
94
105
|
'git-hosts',
|
|
95
106
|
'registries',
|
|
96
107
|
'git-host-archives',
|
|
97
|
-
'
|
|
108
|
+
'scoped-registries',
|
|
98
109
|
'jsr-registries',
|
|
99
110
|
];
|
|
100
111
|
export const isRecordField = (s) => recordFields.includes(s);
|
|
101
|
-
const stopParsingCommands = [
|
|
102
|
-
'run',
|
|
103
|
-
'run-exec',
|
|
104
|
-
'exec-local',
|
|
105
|
-
'exec',
|
|
106
|
-
];
|
|
107
|
-
let stopParsing = undefined;
|
|
108
112
|
const j = jack({
|
|
109
113
|
envPrefix: 'VLT',
|
|
110
114
|
allowPositionals: true,
|
|
111
115
|
usage: `vlt [<options>] [<cmd> [<args> ...]]`,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
// vlt exec --vlt --configs command --args --for --command
|
|
120
|
-
if (stopParsingCommands.includes(commands[a])) {
|
|
121
|
-
stopParsing = true;
|
|
122
|
-
}
|
|
123
|
-
return false;
|
|
124
|
-
},
|
|
116
|
+
// vlt options can appear on either side of the command/script
|
|
117
|
+
// name. To forward an argument (especially a flag-like one) to
|
|
118
|
+
// the underlying bin/script without vlt interpreting it, place
|
|
119
|
+
// it after a `--` terminator, e.g.:
|
|
120
|
+
// vlt run scriptName --vlt-flag -- --script-flag --more
|
|
121
|
+
// Node's `parseArgs` natively treats everything following `--`
|
|
122
|
+
// as positional, so no special-casing is needed here.
|
|
125
123
|
})
|
|
126
124
|
.heading('vlt')
|
|
127
125
|
.description(`More documentation available at <https://docs.vlt.sh>`)
|
|
@@ -159,26 +157,46 @@ export const definition = j
|
|
|
159
157
|
.opt({
|
|
160
158
|
registry: {
|
|
161
159
|
hint: 'url',
|
|
162
|
-
default: 'https://registry.npmjs.org/',
|
|
163
160
|
description: `Sets the registry for fetching packages, when no registry
|
|
164
161
|
is explicitly set on a specifier.
|
|
165
162
|
|
|
166
163
|
For example, \`express@latest\` will be resolved by looking
|
|
167
164
|
up the metadata from this registry.
|
|
168
165
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
There is **no default**. When unset, bare specifiers fall
|
|
167
|
+
back to the registry alias named by
|
|
168
|
+
\`--default-registry-alias\` (\`npm\` by default). If that
|
|
169
|
+
alias is also unconfigured, commands that need a registry
|
|
170
|
+
fail with a config error. Run \`vlt setup\` (or
|
|
171
|
+
\`vlt login\`) to configure one.
|
|
172
|
+
|
|
173
|
+
See https://docs.vlt.sh/cli
|
|
174
|
+
`,
|
|
175
|
+
},
|
|
176
|
+
'default-registry-alias': {
|
|
177
|
+
hint: 'name',
|
|
178
|
+
default: 'npm',
|
|
179
|
+
description: `The name of the registry alias (a key in
|
|
180
|
+
\`--registries\`) that bare specifiers (e.g.
|
|
181
|
+
\`express@latest\`) and transitive dependencies without an
|
|
182
|
+
explicit registry protocol resolve through, when neither
|
|
183
|
+
\`--registry\` nor a matching \`--scoped-registries\` entry
|
|
184
|
+
applies.
|
|
185
|
+
|
|
186
|
+
Defaults to \`npm\`. Note that the \`npm\` alias has **no**
|
|
187
|
+
built-in URL -- it must be configured (for example via
|
|
188
|
+
\`vlt setup\`, which points it at your vlt.io registry),
|
|
189
|
+
otherwise bare specifiers will have no registry to resolve
|
|
190
|
+
against.
|
|
173
191
|
`,
|
|
174
192
|
},
|
|
175
193
|
})
|
|
176
194
|
.optList({
|
|
177
195
|
registries: {
|
|
178
196
|
hint: 'name=url',
|
|
179
|
-
description: `Specify named registry hosts by their prefix. To
|
|
180
|
-
|
|
181
|
-
|
|
197
|
+
description: `Specify named registry hosts by their prefix. To choose
|
|
198
|
+
which alias is used for non-namespaced specifiers, use the
|
|
199
|
+
\`--default-registry-alias\` option.
|
|
182
200
|
|
|
183
201
|
Prefixes can be used as a package alias. For example:
|
|
184
202
|
|
|
@@ -186,17 +204,18 @@ export const definition = j
|
|
|
186
204
|
vlt --registries loc=http://reg.local install foo@loc:foo@1.x
|
|
187
205
|
\`\`\`
|
|
188
206
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
207
|
+
There is **no** built-in \`npm\` registry URL; the \`npm\`
|
|
208
|
+
alias must be configured (e.g. via \`vlt setup\`) before it
|
|
209
|
+
can be used. The \`gh\` and \`jsr\` aliases have built-in
|
|
210
|
+
defaults that can be overridden here.
|
|
192
211
|
`,
|
|
193
212
|
},
|
|
194
|
-
'
|
|
213
|
+
'scoped-registries': {
|
|
195
214
|
hint: '@scope=url',
|
|
196
215
|
description: `Map package name scopes to registry URLs.
|
|
197
216
|
|
|
198
217
|
For example,
|
|
199
|
-
\`--
|
|
218
|
+
\`--scoped-registries @acme=https://registry.acme/\`
|
|
200
219
|
would tell vlt to fetch any packages named
|
|
201
220
|
\`@acme/...\` from the \`https://registry.acme/\`
|
|
202
221
|
registry.
|
|
@@ -289,6 +308,11 @@ export const definition = j
|
|
|
289
308
|
packages based on their \`cpu\` value.`,
|
|
290
309
|
default: process.arch,
|
|
291
310
|
},
|
|
311
|
+
libc: {
|
|
312
|
+
description: `Override the libc family to use as the selector when choosing
|
|
313
|
+
packages based on their \`libc\` value (e.g. glibc, musl).
|
|
314
|
+
By default, this is auto-detected on Linux systems.`,
|
|
315
|
+
},
|
|
292
316
|
'node-version': {
|
|
293
317
|
hint: 'version',
|
|
294
318
|
description: `Node version to use when choosing packages based on
|
|
@@ -381,7 +405,6 @@ export const definition = j
|
|
|
381
405
|
supported.`,
|
|
382
406
|
},
|
|
383
407
|
'workspace-group': {
|
|
384
|
-
short: 'g',
|
|
385
408
|
description: `Specify named workspace group names to load and operate on
|
|
386
409
|
when doing recursive operations on workspaces.`,
|
|
387
410
|
},
|
|
@@ -493,6 +516,28 @@ export const definition = j
|
|
|
493
516
|
vlt will interpret the first argument as the package, and
|
|
494
517
|
attempt to run the default executable.`,
|
|
495
518
|
},
|
|
519
|
+
})
|
|
520
|
+
.opt({
|
|
521
|
+
call: {
|
|
522
|
+
hint: 'cmd',
|
|
523
|
+
description: `When running \`vlt exec\`, provide an arbitrary command
|
|
524
|
+
string to execute after installing and adding any specified
|
|
525
|
+
package bins to the PATH.
|
|
526
|
+
|
|
527
|
+
If a package is specified (via positionals or
|
|
528
|
+
\`--package\`), it will be installed and its executables
|
|
529
|
+
added to the PATH before the \`--call\` command runs.
|
|
530
|
+
|
|
531
|
+
The command string is executed via the configured
|
|
532
|
+
\`script-shell\`, or the \`SHELL\` environment variable,
|
|
533
|
+
falling back to \`/bin/sh\` on Unix or \`cmd.exe\` on
|
|
534
|
+
Windows. On Unix, the shell is invoked with \`-c\`; on
|
|
535
|
+
Windows with \`/c\`.
|
|
536
|
+
|
|
537
|
+
Example:
|
|
538
|
+
\`vlt exec create-react-app --call="echo $PWD"\`
|
|
539
|
+
\`vlt exec --call="echo $PWD" --scope=":workspace"\``,
|
|
540
|
+
},
|
|
496
541
|
})
|
|
497
542
|
.opt({
|
|
498
543
|
view: {
|
|
@@ -507,11 +552,14 @@ export const definition = j
|
|
|
507
552
|
consumption.
|
|
508
553
|
- json: Parseable JSON output for machines.
|
|
509
554
|
- inspect: Output results with \`util.inspect\`.
|
|
510
|
-
- gui: Start a local web server and opens a browser to
|
|
511
|
-
explore the results. (Only relevant for certain
|
|
512
|
-
commands.)
|
|
513
555
|
- mermaid: Output mermaid diagramming syntax. (Only
|
|
514
556
|
relevant for certain commands.)
|
|
557
|
+
- svg: Render the dependency graph as an SVG image and
|
|
558
|
+
open it. (Only relevant for certain commands.)
|
|
559
|
+
- png: Render the dependency graph as a PNG image and
|
|
560
|
+
open it. (Only relevant for certain commands.)
|
|
561
|
+
- count: Output the number of dependency relationships in
|
|
562
|
+
the result set.
|
|
515
563
|
- silent: Suppress all output to stdout.
|
|
516
564
|
|
|
517
565
|
If the requested view format is not supported for the
|
|
@@ -522,11 +570,48 @@ export const definition = j
|
|
|
522
570
|
'human',
|
|
523
571
|
'json',
|
|
524
572
|
'mermaid',
|
|
525
|
-
'
|
|
573
|
+
'svg',
|
|
574
|
+
'png',
|
|
575
|
+
'count',
|
|
526
576
|
'inspect',
|
|
527
577
|
'silent',
|
|
528
578
|
],
|
|
529
579
|
},
|
|
580
|
+
})
|
|
581
|
+
.opt({
|
|
582
|
+
loglevel: {
|
|
583
|
+
hint: 'level',
|
|
584
|
+
default: 'info',
|
|
585
|
+
description: `Sets the verbosity of diagnostic logging written to
|
|
586
|
+
stderr (registry requests, warnings, etc). This is
|
|
587
|
+
independent of \`--view\`, which controls a command's
|
|
588
|
+
result output on stdout.
|
|
589
|
+
|
|
590
|
+
- silent: No diagnostic logging.
|
|
591
|
+
- error: Only errors.
|
|
592
|
+
- warn: Errors and warnings.
|
|
593
|
+
- info: Default. High-level progress.
|
|
594
|
+
- verbose: Adds per-request logging (each registry URL
|
|
595
|
+
with its cache/stale/fetch outcome and status code).
|
|
596
|
+
- debug: Everything, including low-level detail.
|
|
597
|
+
|
|
598
|
+
\`--verbose\` is shorthand for \`--loglevel=verbose\`.`,
|
|
599
|
+
validOptions: [
|
|
600
|
+
'silent',
|
|
601
|
+
'error',
|
|
602
|
+
'warn',
|
|
603
|
+
'info',
|
|
604
|
+
'verbose',
|
|
605
|
+
'debug',
|
|
606
|
+
],
|
|
607
|
+
},
|
|
608
|
+
})
|
|
609
|
+
.flag({
|
|
610
|
+
verbose: {
|
|
611
|
+
description: `Shorthand for \`--loglevel=verbose\`. Streams each
|
|
612
|
+
registry request to stderr with its cache/fetch outcome
|
|
613
|
+
and status code, useful for debugging request behavior.`,
|
|
614
|
+
},
|
|
530
615
|
})
|
|
531
616
|
.optList({
|
|
532
617
|
'dashboard-root': {
|
|
@@ -541,6 +626,12 @@ export const definition = j
|
|
|
541
626
|
description: `Save installed packages to a package.json file as
|
|
542
627
|
devDependencies`,
|
|
543
628
|
},
|
|
629
|
+
'save-exact': {
|
|
630
|
+
short: 'E',
|
|
631
|
+
description: `Save installed packages to package.json with an exact
|
|
632
|
+
version rather than using the default semver range
|
|
633
|
+
operator (e.g. \`1.2.3\` instead of \`^1.2.3\`).`,
|
|
634
|
+
},
|
|
544
635
|
'save-optional': {
|
|
545
636
|
short: 'O',
|
|
546
637
|
description: `Save installed packages to a package.json file as
|
|
@@ -557,6 +648,15 @@ export const definition = j
|
|
|
557
648
|
devDependencies or optionalDependencies, but you want to
|
|
558
649
|
move it to be a non-optional production dependency.`,
|
|
559
650
|
},
|
|
651
|
+
})
|
|
652
|
+
.opt({
|
|
653
|
+
'save-prefix': {
|
|
654
|
+
description: `The version prefix to use when saving dependencies to
|
|
655
|
+
package.json (e.g. \`^\`, \`~\`, \`>=\`, or empty string
|
|
656
|
+
for exact versions). Defaults to \`^\`.
|
|
657
|
+
Ignored when \`--save-exact\` is set.`,
|
|
658
|
+
default: '^',
|
|
659
|
+
},
|
|
560
660
|
})
|
|
561
661
|
.opt({
|
|
562
662
|
'expect-results': {
|
|
@@ -576,6 +676,10 @@ export const definition = j
|
|
|
576
676
|
'dry-run': {
|
|
577
677
|
description: 'Run command without making any changes',
|
|
578
678
|
},
|
|
679
|
+
force: {
|
|
680
|
+
short: 'f',
|
|
681
|
+
description: 'Force potentially dangerous operations, such as unpublishing an entire package.',
|
|
682
|
+
},
|
|
579
683
|
'expect-lockfile': {
|
|
580
684
|
description: 'Fail if lockfile is missing or out of date. Used by ci command to enforce lockfile integrity.',
|
|
581
685
|
},
|
|
@@ -603,7 +707,6 @@ export const definition = j
|
|
|
603
707
|
access: {
|
|
604
708
|
description: 'Set the access level of the package',
|
|
605
709
|
validOptions: ['public', 'restricted'],
|
|
606
|
-
default: 'public',
|
|
607
710
|
},
|
|
608
711
|
})
|
|
609
712
|
.opt({
|
|
@@ -615,13 +718,18 @@ export const definition = j
|
|
|
615
718
|
description: `Directory to use for pack and publish operations instead of the current directory.
|
|
616
719
|
The directory must exist and nothing will be copied to it.`,
|
|
617
720
|
},
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
721
|
+
})
|
|
722
|
+
.flag({
|
|
723
|
+
telemetry: {
|
|
724
|
+
description: `Enable anonymous usage telemetry.
|
|
725
|
+
|
|
726
|
+
vlt collects anonymized usage data to help improve
|
|
727
|
+
the tool. No personally identifiable information is
|
|
728
|
+
ever sent.
|
|
729
|
+
|
|
730
|
+
Set \`--no-telemetry\` or \`VLT_TELEMETRY=0\` or
|
|
731
|
+
\`DO_NOT_TRACK=1\` to opt out.`,
|
|
732
|
+
default: true,
|
|
625
733
|
},
|
|
626
734
|
})
|
|
627
735
|
.flag({
|
|
@@ -655,4 +763,3 @@ export const getSortedCliOptions = () => {
|
|
|
655
763
|
});
|
|
656
764
|
};
|
|
657
765
|
export const getSortedKeys = () => Object.keys(definition.toJSON()).sort((a, b) => a.localeCompare(b));
|
|
658
|
-
//# sourceMappingURL=definition.js.map
|
|
@@ -24,6 +24,7 @@ import { error } from '@vltpkg/error-cause';
|
|
|
24
24
|
import { PackageInfoClient } from '@vltpkg/package-info';
|
|
25
25
|
import { PackageJson } from '@vltpkg/package-json';
|
|
26
26
|
import { resetCaches } from '@vltpkg/dep-id';
|
|
27
|
+
import { getOptions } from '@vltpkg/spec';
|
|
27
28
|
import { assertRecordStringString, assertRecordStringT, isRecordStringString, } from '@vltpkg/types';
|
|
28
29
|
import { find, load, reload, save } from '@vltpkg/vlt-json';
|
|
29
30
|
import { Monorepo } from '@vltpkg/workspaces';
|
|
@@ -128,6 +129,10 @@ export class Config {
|
|
|
128
129
|
catalogs: load('catalogs', o => assertRecordStringT(o, isRecordStringString, 'Record<string, Record<string, string>>')),
|
|
129
130
|
};
|
|
130
131
|
const options = Object.assign(asRecords, extras);
|
|
132
|
+
// Ensure spec-related options (registries, jsr-registries, git hosts, etc.)
|
|
133
|
+
// are always filled with defaults. Some downstream libraries (eg. @vltpkg/dep-id)
|
|
134
|
+
// expect these defaults to be present even when the user didn't configure them.
|
|
135
|
+
Object.assign(options, getOptions(options));
|
|
131
136
|
this.#options = Object.assign(options, {
|
|
132
137
|
packageInfo: new PackageInfoClient(options),
|
|
133
138
|
[kCustomInspect]() {
|
|
@@ -207,6 +212,12 @@ export class Config {
|
|
|
207
212
|
else
|
|
208
213
|
this.command = getCommand(p.values['fallback-command']);
|
|
209
214
|
Object.assign(this, p);
|
|
215
|
+
// `--verbose` is shorthand for `--loglevel=verbose`. Only apply it
|
|
216
|
+
// when loglevel is still at its default so an explicit `--loglevel`
|
|
217
|
+
// always wins.
|
|
218
|
+
if (p.values.verbose && p.values.loglevel === 'info') {
|
|
219
|
+
p.values.loglevel = 'verbose';
|
|
220
|
+
}
|
|
210
221
|
/* c8 ignore start - unpossible */
|
|
211
222
|
if (!isParsed(this))
|
|
212
223
|
throw error('failed to parse config');
|
|
@@ -226,6 +237,7 @@ export class Config {
|
|
|
226
237
|
* If the config value is not set at all, an empty object is returned.
|
|
227
238
|
*/
|
|
228
239
|
getRecord(k) {
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
229
241
|
const pairs = this.get(k);
|
|
230
242
|
if (!pairs)
|
|
231
243
|
return {};
|
|
@@ -281,10 +293,40 @@ export class Config {
|
|
|
281
293
|
});
|
|
282
294
|
}
|
|
283
295
|
const { command, ...values } = recordsToPairs(c);
|
|
296
|
+
// Validate registries keys don't contain reserved ~ character
|
|
297
|
+
const registries = c.registries;
|
|
298
|
+
if (registries && typeof registries === 'object') {
|
|
299
|
+
const registriesObj = Array.isArray(registries) ?
|
|
300
|
+
reducePairs(registries)
|
|
301
|
+
: registries;
|
|
302
|
+
for (const key of Object.keys(registriesObj)) {
|
|
303
|
+
if (key === '' || key.includes('~')) {
|
|
304
|
+
throw error('Reserved character found in registries name', {
|
|
305
|
+
path: file,
|
|
306
|
+
found: key,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
284
311
|
if (command) {
|
|
285
312
|
for (const [c, opts] of Object.entries(command)) {
|
|
286
313
|
const cmd = getCommand(c);
|
|
287
|
-
if (cmd) {
|
|
314
|
+
if (cmd && opts && typeof opts === 'object') {
|
|
315
|
+
// Validate registries in command-specific config
|
|
316
|
+
const cmdRegistries = opts.registries;
|
|
317
|
+
if (cmdRegistries && typeof cmdRegistries === 'object') {
|
|
318
|
+
const cmdRegistriesObj = Array.isArray(cmdRegistries) ?
|
|
319
|
+
reducePairs(cmdRegistries)
|
|
320
|
+
: cmdRegistries;
|
|
321
|
+
for (const key of Object.keys(cmdRegistriesObj)) {
|
|
322
|
+
if (key === '' || key.includes('~')) {
|
|
323
|
+
throw error('Reserved character found in registries name', {
|
|
324
|
+
path: file,
|
|
325
|
+
found: key,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
288
330
|
this.commandValues[cmd] = merge(this.commandValues[cmd] ?? {}, opts);
|
|
289
331
|
}
|
|
290
332
|
}
|
|
@@ -451,4 +493,3 @@ export class Config {
|
|
|
451
493
|
}
|
|
452
494
|
}
|
|
453
495
|
const isParsed = (c) => !!(c.values && c.positionals && c.command);
|
|
454
|
-
//# sourceMappingURL=index.js.map
|