@vltpkg/cli-sdk 1.0.0-rc.9 → 1.0.2

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.
Files changed (227) hide show
  1. package/dist/commands/access.d.ts +23 -0
  2. package/dist/commands/access.js +251 -0
  3. package/dist/{esm/commands → commands}/bugs.d.ts +0 -1
  4. package/dist/{esm/commands → commands}/bugs.js +0 -1
  5. package/dist/{esm/commands → commands}/build.d.ts +1 -1
  6. package/dist/{esm/commands → commands}/build.js +1 -1
  7. package/dist/{esm/commands → commands}/cache.d.ts +1 -1
  8. package/dist/{esm/commands → commands}/cache.js +1 -1
  9. package/dist/{esm/commands → commands}/ci.d.ts +1 -1
  10. package/dist/{esm/commands → commands}/ci.js +12 -3
  11. package/dist/{esm/commands → commands}/config.d.ts +0 -1
  12. package/dist/{esm/commands → commands}/config.js +6 -1
  13. package/dist/commands/create.d.ts +9 -0
  14. package/dist/commands/create.js +103 -0
  15. package/dist/commands/deprecate.d.ts +14 -0
  16. package/dist/commands/deprecate.js +142 -0
  17. package/dist/commands/dist-tag.d.ts +22 -0
  18. package/dist/commands/dist-tag.js +179 -0
  19. package/dist/{esm/commands → commands}/docs.d.ts +0 -1
  20. package/dist/{esm/commands → commands}/docs.js +0 -1
  21. package/dist/{esm/commands → commands}/exec-cache.d.ts +1 -1
  22. package/dist/{esm/commands → commands}/exec-cache.js +1 -1
  23. package/dist/{esm/commands/run-exec.d.ts → commands/exec-local.d.ts} +0 -1
  24. package/dist/{esm/commands → commands}/exec-local.js +23 -1
  25. package/dist/{esm/commands → commands}/exec.d.ts +1 -1
  26. package/dist/{esm/commands → commands}/exec.js +85 -10
  27. package/dist/{esm/commands → commands}/help.d.ts +0 -1
  28. package/dist/{esm/commands → commands}/help.js +5 -1
  29. package/dist/{esm/commands → commands}/init.d.ts +0 -1
  30. package/dist/{esm/commands → commands}/init.js +31 -10
  31. package/dist/{esm/commands → commands}/install/reporter.d.ts +0 -1
  32. package/dist/{esm/commands → commands}/install/reporter.js +0 -1
  33. package/dist/{esm/commands → commands}/install.d.ts +22 -3
  34. package/dist/commands/install.js +152 -0
  35. package/dist/{esm/commands → commands}/list.d.ts +5 -2
  36. package/dist/{esm/commands → commands}/list.js +9 -10
  37. package/dist/{esm/commands → commands}/login.d.ts +0 -1
  38. package/dist/commands/login.js +35 -0
  39. package/dist/{esm/commands → commands}/logout.d.ts +1 -1
  40. package/dist/commands/logout.js +27 -0
  41. package/dist/{esm/commands → commands}/pack.d.ts +1 -1
  42. package/dist/{esm/commands → commands}/pack.js +91 -32
  43. package/dist/commands/ping.d.ts +18 -0
  44. package/dist/commands/ping.js +117 -0
  45. package/dist/{esm/commands → commands}/pkg.d.ts +0 -1
  46. package/dist/{esm/commands → commands}/pkg.js +27 -1
  47. package/dist/commands/profile.d.ts +14 -0
  48. package/dist/commands/profile.js +106 -0
  49. package/dist/{esm/commands → commands}/publish.d.ts +2 -2
  50. package/dist/{esm/commands → commands}/publish.js +70 -16
  51. package/dist/{esm/commands → commands}/query.d.ts +5 -2
  52. package/dist/{esm/commands → commands}/query.js +54 -11
  53. package/dist/commands/registry.d.ts +26 -0
  54. package/dist/commands/registry.js +99 -0
  55. package/dist/commands/repo.d.ts +17 -0
  56. package/dist/commands/repo.js +157 -0
  57. package/dist/{esm/commands/exec-local.d.ts → commands/run-exec.d.ts} +1 -1
  58. package/dist/commands/run-exec.js +41 -0
  59. package/dist/{esm/commands → commands}/run.d.ts +0 -1
  60. package/dist/{esm/commands → commands}/run.js +27 -1
  61. package/dist/commands/setup.d.ts +25 -0
  62. package/dist/commands/setup.js +155 -0
  63. package/dist/commands/token.d.ts +32 -0
  64. package/dist/commands/token.js +193 -0
  65. package/dist/{esm/commands → commands}/uninstall.d.ts +1 -1
  66. package/dist/{esm/commands → commands}/uninstall.js +15 -1
  67. package/dist/commands/unpublish.d.ts +16 -0
  68. package/dist/commands/unpublish.js +203 -0
  69. package/dist/{esm/commands → commands}/update.d.ts +1 -1
  70. package/dist/{esm/commands → commands}/update.js +7 -1
  71. package/dist/{esm/commands → commands}/version.d.ts +0 -1
  72. package/dist/{esm/commands → commands}/version.js +27 -1
  73. package/dist/commands/view.d.ts +23 -0
  74. package/dist/commands/view.js +335 -0
  75. package/dist/{esm/commands → commands}/whoami.d.ts +1 -1
  76. package/dist/commands/whoami.js +33 -0
  77. package/dist/{esm/config → config}/definition.d.ts +72 -19
  78. package/dist/{esm/config → config}/definition.js +157 -50
  79. package/dist/{esm/config → config}/index.d.ts +0 -1
  80. package/dist/{esm/config → config}/index.js +43 -2
  81. package/dist/{esm/config → config}/merge.d.ts +0 -1
  82. package/dist/{esm/config → config}/merge.js +0 -1
  83. package/dist/{esm/config → config}/usage.d.ts +0 -1
  84. package/dist/{esm/config → config}/usage.js +0 -1
  85. package/dist/{esm/custom-help.d.ts → custom-help.d.ts} +0 -1
  86. package/dist/{esm/custom-help.js → custom-help.js} +95 -120
  87. package/dist/{esm/exec-command.d.ts → exec-command.d.ts} +0 -1
  88. package/dist/{esm/exec-command.js → exec-command.js} +14 -8
  89. package/dist/{esm/index.d.ts → index.d.ts} +0 -1
  90. package/dist/{esm/index.js → index.js} +5 -2
  91. package/dist/{esm/load-command.d.ts → load-command.d.ts} +6 -1
  92. package/dist/{esm/load-command.js → load-command.js} +0 -1
  93. package/dist/mermaid-image-view.d.ts +18 -0
  94. package/dist/mermaid-image-view.js +36 -0
  95. package/dist/{esm/output.d.ts → output.d.ts} +2 -2
  96. package/dist/{esm/output.js → output.js} +70 -3
  97. package/dist/{esm/pack-tarball.d.ts → pack-tarball.d.ts} +15 -1
  98. package/dist/{esm/pack-tarball.js → pack-tarball.js} +133 -91
  99. package/dist/{esm/parse-add-remove-args.d.ts → parse-add-remove-args.d.ts} +0 -1
  100. package/dist/{esm/parse-add-remove-args.js → parse-add-remove-args.js} +65 -12
  101. package/dist/{esm/print-err.d.ts → print-err.d.ts} +0 -1
  102. package/dist/{esm/print-err.js → print-err.js} +28 -4
  103. package/dist/query-diff-files.d.ts +17 -0
  104. package/dist/query-diff-files.js +63 -0
  105. package/dist/{esm/query-host-contexts.d.ts → query-host-contexts.d.ts} +0 -1
  106. package/dist/{esm/query-host-contexts.js → query-host-contexts.js} +8 -7
  107. package/dist/{esm/read-password.d.ts → read-password.d.ts} +0 -1
  108. package/dist/{esm/read-password.js → read-password.js} +0 -1
  109. package/dist/read-project-folders.d.ts +17 -0
  110. package/dist/read-project-folders.js +100 -0
  111. package/dist/registry-error-message.d.ts +2 -0
  112. package/dist/registry-error-message.js +29 -0
  113. package/dist/reload-config.d.ts +2 -0
  114. package/dist/reload-config.js +11 -0
  115. package/dist/render-mermaid.d.ts +22 -0
  116. package/dist/render-mermaid.js +68 -0
  117. package/dist/require-registry.d.ts +48 -0
  118. package/dist/require-registry.js +122 -0
  119. package/dist/select-registry.d.ts +23 -0
  120. package/dist/select-registry.js +40 -0
  121. package/dist/telemetry.d.ts +58 -0
  122. package/dist/telemetry.js +170 -0
  123. package/dist/verbose-log.d.ts +31 -0
  124. package/dist/verbose-log.js +62 -0
  125. package/dist/{esm/view.d.ts → view.d.ts} +0 -1
  126. package/dist/{esm/view.js → view.js} +1 -2
  127. package/package.json +75 -82
  128. package/dist/esm/commands/bugs.d.ts.map +0 -1
  129. package/dist/esm/commands/bugs.js.map +0 -1
  130. package/dist/esm/commands/build.d.ts.map +0 -1
  131. package/dist/esm/commands/build.js.map +0 -1
  132. package/dist/esm/commands/cache.d.ts.map +0 -1
  133. package/dist/esm/commands/cache.js.map +0 -1
  134. package/dist/esm/commands/ci.d.ts.map +0 -1
  135. package/dist/esm/commands/ci.js.map +0 -1
  136. package/dist/esm/commands/config.d.ts.map +0 -1
  137. package/dist/esm/commands/config.js.map +0 -1
  138. package/dist/esm/commands/docs.d.ts.map +0 -1
  139. package/dist/esm/commands/docs.js.map +0 -1
  140. package/dist/esm/commands/exec-cache.d.ts.map +0 -1
  141. package/dist/esm/commands/exec-cache.js.map +0 -1
  142. package/dist/esm/commands/exec-local.d.ts.map +0 -1
  143. package/dist/esm/commands/exec-local.js.map +0 -1
  144. package/dist/esm/commands/exec.d.ts.map +0 -1
  145. package/dist/esm/commands/exec.js.map +0 -1
  146. package/dist/esm/commands/help.d.ts.map +0 -1
  147. package/dist/esm/commands/help.js.map +0 -1
  148. package/dist/esm/commands/init.d.ts.map +0 -1
  149. package/dist/esm/commands/init.js.map +0 -1
  150. package/dist/esm/commands/install/reporter.d.ts.map +0 -1
  151. package/dist/esm/commands/install/reporter.js.map +0 -1
  152. package/dist/esm/commands/install.d.ts.map +0 -1
  153. package/dist/esm/commands/install.js +0 -46
  154. package/dist/esm/commands/install.js.map +0 -1
  155. package/dist/esm/commands/list.d.ts.map +0 -1
  156. package/dist/esm/commands/list.js.map +0 -1
  157. package/dist/esm/commands/login.d.ts.map +0 -1
  158. package/dist/esm/commands/login.js +0 -13
  159. package/dist/esm/commands/login.js.map +0 -1
  160. package/dist/esm/commands/logout.d.ts.map +0 -1
  161. package/dist/esm/commands/logout.js +0 -13
  162. package/dist/esm/commands/logout.js.map +0 -1
  163. package/dist/esm/commands/pack.d.ts.map +0 -1
  164. package/dist/esm/commands/pack.js.map +0 -1
  165. package/dist/esm/commands/pkg.d.ts.map +0 -1
  166. package/dist/esm/commands/pkg.js.map +0 -1
  167. package/dist/esm/commands/publish.d.ts.map +0 -1
  168. package/dist/esm/commands/publish.js.map +0 -1
  169. package/dist/esm/commands/query.d.ts.map +0 -1
  170. package/dist/esm/commands/query.js.map +0 -1
  171. package/dist/esm/commands/run-exec.d.ts.map +0 -1
  172. package/dist/esm/commands/run-exec.js +0 -14
  173. package/dist/esm/commands/run-exec.js.map +0 -1
  174. package/dist/esm/commands/run.d.ts.map +0 -1
  175. package/dist/esm/commands/run.js.map +0 -1
  176. package/dist/esm/commands/serve.d.ts +0 -14
  177. package/dist/esm/commands/serve.d.ts.map +0 -1
  178. package/dist/esm/commands/serve.js +0 -103
  179. package/dist/esm/commands/serve.js.map +0 -1
  180. package/dist/esm/commands/token.d.ts +0 -4
  181. package/dist/esm/commands/token.d.ts.map +0 -1
  182. package/dist/esm/commands/token.js +0 -30
  183. package/dist/esm/commands/token.js.map +0 -1
  184. package/dist/esm/commands/uninstall.d.ts.map +0 -1
  185. package/dist/esm/commands/uninstall.js.map +0 -1
  186. package/dist/esm/commands/update.d.ts.map +0 -1
  187. package/dist/esm/commands/update.js.map +0 -1
  188. package/dist/esm/commands/version.d.ts.map +0 -1
  189. package/dist/esm/commands/version.js.map +0 -1
  190. package/dist/esm/commands/whoami.d.ts.map +0 -1
  191. package/dist/esm/commands/whoami.js +0 -19
  192. package/dist/esm/commands/whoami.js.map +0 -1
  193. package/dist/esm/config/definition.d.ts.map +0 -1
  194. package/dist/esm/config/definition.js.map +0 -1
  195. package/dist/esm/config/index.d.ts.map +0 -1
  196. package/dist/esm/config/index.js.map +0 -1
  197. package/dist/esm/config/merge.d.ts.map +0 -1
  198. package/dist/esm/config/merge.js.map +0 -1
  199. package/dist/esm/config/usage.d.ts.map +0 -1
  200. package/dist/esm/config/usage.js.map +0 -1
  201. package/dist/esm/custom-help.d.ts.map +0 -1
  202. package/dist/esm/custom-help.js.map +0 -1
  203. package/dist/esm/exec-command.d.ts.map +0 -1
  204. package/dist/esm/exec-command.js.map +0 -1
  205. package/dist/esm/index.d.ts.map +0 -1
  206. package/dist/esm/index.js.map +0 -1
  207. package/dist/esm/load-command.d.ts.map +0 -1
  208. package/dist/esm/load-command.js.map +0 -1
  209. package/dist/esm/output.d.ts.map +0 -1
  210. package/dist/esm/output.js.map +0 -1
  211. package/dist/esm/pack-tarball.d.ts.map +0 -1
  212. package/dist/esm/pack-tarball.js.map +0 -1
  213. package/dist/esm/package.json +0 -3
  214. package/dist/esm/parse-add-remove-args.d.ts.map +0 -1
  215. package/dist/esm/parse-add-remove-args.js.map +0 -1
  216. package/dist/esm/print-err.d.ts.map +0 -1
  217. package/dist/esm/print-err.js.map +0 -1
  218. package/dist/esm/query-host-contexts.d.ts.map +0 -1
  219. package/dist/esm/query-host-contexts.js.map +0 -1
  220. package/dist/esm/read-password.d.ts.map +0 -1
  221. package/dist/esm/read-password.js.map +0 -1
  222. package/dist/esm/start-gui.d.ts +0 -10
  223. package/dist/esm/start-gui.d.ts.map +0 -1
  224. package/dist/esm/start-gui.js +0 -60
  225. package/dist/esm/start-gui.js.map +0 -1
  226. package/dist/esm/view.d.ts.map +0 -1
  227. 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
- serve: 'serve',
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
- 'scope-registries',
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
- stopAtPositionalTest: arg => {
113
- if (stopParsing)
114
- return true;
115
- const a = arg;
116
- // we stop parsing AFTER the thing, so you can do
117
- // vlt run --vlt --configs scriptName --args --for --script
118
- // or
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
- Note that alias specifiers starting with \`npm:\` will
170
- still map to \`https://registry.npmjs.org/\` if this is
171
- changed, unless the a new mapping is created via the
172
- \`--registries\` option.
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 set the
180
- default registry used for non-namespaced specifiers,
181
- use the \`--registry\` option.
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
- By default, the public npm registry is registered to the
190
- \`npm:\` prefix. It is not recommended to change this
191
- mapping in most cases.
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
- 'scope-registries': {
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
- \`--scope-registries @acme=https://registry.acme/\`
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
- 'gui',
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
- port: {
619
- hint: 'number',
620
- description: `Port for the browser-based UI server when using vlt serve command (default: 8000).`,
621
- },
622
- 'registry-port': {
623
- hint: 'number',
624
- description: `Port for the VSR registry when using vlt serve command (default: 1337).`,
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
@@ -216,4 +216,3 @@ export type ParsedConfig = Config & {
216
216
  * A fully loaded {@link Config} object
217
217
  */
218
218
  export type LoadedConfig = ParsedConfig;
219
- //# sourceMappingURL=index.d.ts.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
@@ -1,4 +1,3 @@
1
1
  type MergeableObject = Record<string, unknown>;
2
2
  export declare const merge: <T extends MergeableObject>(base: T, add: T) => T;
3
3
  export {};
4
- //# sourceMappingURL=merge.d.ts.map
@@ -25,4 +25,3 @@ export const merge = (base, add) => Object.fromEntries(Object.entries(base)
25
25
  .concat(
26
26
  // already merged together if existing, so just get new additions
27
27
  Object.entries(add).filter(([k]) => base[k] === undefined)));
28
- //# sourceMappingURL=merge.js.map
@@ -16,4 +16,3 @@ export type CommandUsageDefinition = {
16
16
  }>;
17
17
  };
18
18
  export declare const commandUsage: ({ command, usage, description, subcommands, examples, options, }: CommandUsageDefinition) => ReturnType<CommandUsage>;
19
- //# sourceMappingURL=usage.d.ts.map
@@ -37,4 +37,3 @@ export const commandUsage = ({ command, usage, description, subcommands, example
37
37
  }
38
38
  return j;
39
39
  };
40
- //# sourceMappingURL=usage.js.map
@@ -6,4 +6,3 @@ export declare const generateDefaultHelp: (colors?: boolean) => string;
6
6
  * Generates the full help output with all commands when --all flag is used
7
7
  */
8
8
  export declare const generateFullHelp: (colors?: boolean) => string;
9
- //# sourceMappingURL=custom-help.d.ts.map