@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.
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 +142 -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
@@ -2,11 +2,26 @@ import { uninstall } from '@vltpkg/graph';
2
2
  import { commandUsage } from "../config/usage.js";
3
3
  import { parseRemoveArgs } from "../parse-add-remove-args.js";
4
4
  import { InstallReporter } from "./install/reporter.js";
5
+ export const needsRegistry = true;
5
6
  export const usage = () => commandUsage({
6
7
  command: 'uninstall',
7
8
  usage: '[package ...]',
8
9
  description: `The opposite of \`vlt install\`. Removes deps and updates
9
10
  vlt-lock.json and package.json appropriately.`,
11
+ options: {
12
+ workspace: {
13
+ value: '<path|glob>',
14
+ description: 'Limit uninstall targets to matching workspaces.',
15
+ },
16
+ 'workspace-group': {
17
+ value: '<name>',
18
+ description: 'Limit uninstall targets to workspace groups.',
19
+ },
20
+ 'allow-scripts': {
21
+ value: '<query>',
22
+ description: 'Filter which packages are allowed to run lifecycle scripts using DSS query syntax.',
23
+ },
24
+ },
10
25
  });
11
26
  export const views = {
12
27
  json: i => i.graph.toJSON(),
@@ -23,4 +38,3 @@ export const command = async (conf) => {
23
38
  const { graph } = await uninstall({ ...conf.options, allowScripts }, remove);
24
39
  return { graph };
25
40
  };
26
- //# sourceMappingURL=uninstall.js.map
@@ -0,0 +1,16 @@
1
+ import type { CommandFn, CommandUsage } from '../index.ts';
2
+ export declare const needsRegistry = true;
3
+ export declare const usage: CommandUsage;
4
+ export type CommandResult = {
5
+ /** The package name */
6
+ name: string;
7
+ /** The version that was unpublished, or undefined for entire package */
8
+ version?: string;
9
+ /** The registry URL */
10
+ registry: string;
11
+ };
12
+ export declare const views: {
13
+ readonly human: (result: CommandResult) => string;
14
+ readonly json: (r: CommandResult) => CommandResult;
15
+ };
16
+ export declare const command: CommandFn<CommandResult>;
@@ -0,0 +1,203 @@
1
+ import { error } from '@vltpkg/error-cause';
2
+ import { RegistryClient } from '@vltpkg/registry-client';
3
+ import { Spec } from '@vltpkg/spec';
4
+ import { asError } from '@vltpkg/types';
5
+ import { commandUsage } from "../config/usage.js";
6
+ import { resolveRegistry } from "../require-registry.js";
7
+ export const needsRegistry = true;
8
+ export const usage = () => commandUsage({
9
+ command: 'unpublish',
10
+ usage: ['<package>@<version>', '<package> --force'],
11
+ description: `Remove a package version from the registry.
12
+
13
+ To unpublish a single version, specify the package name and version.
14
+ To unpublish an entire package, specify the package name and use --force.
15
+
16
+ ⚠️ Unpublishing is a destructive action that cannot be undone.
17
+ Consider using \`vlt deprecate\` instead if you want to discourage
18
+ usage of a package without removing it.`,
19
+ examples: {
20
+ 'my-package@1.0.0': {
21
+ description: 'Unpublish a specific version',
22
+ },
23
+ '@scope/my-package@1.0.0': {
24
+ description: 'Unpublish a specific version of a scoped package',
25
+ },
26
+ 'my-package --force': {
27
+ description: 'Unpublish an entire package (requires --force)',
28
+ },
29
+ },
30
+ options: {
31
+ force: {
32
+ description: 'Required to unpublish an entire package (all versions).',
33
+ },
34
+ otp: {
35
+ description: 'Provide a one-time password for authentication.',
36
+ value: '<otp>',
37
+ },
38
+ },
39
+ });
40
+ export const views = {
41
+ human: (result) => {
42
+ if (result.version) {
43
+ return `⚠️ ${result.name}@${result.version} has been unpublished from ${result.registry}.`;
44
+ }
45
+ return `⚠️ ${result.name} (all versions) has been unpublished from ${result.registry}.`;
46
+ },
47
+ json: (r) => r,
48
+ };
49
+ export const command = async (conf) => {
50
+ const specArg = conf.positionals[0];
51
+ if (!specArg) {
52
+ throw error('unpublish requires a package spec argument (e.g. pkg@version)', { code: 'EUSAGE' });
53
+ }
54
+ const { otp, force } = conf.options;
55
+ const registry = await resolveRegistry(conf);
56
+ const registryUrl = new URL(registry);
57
+ const spec = Spec.parseArgs(specArg, conf.options);
58
+ const name = spec.name;
59
+ /* c8 ignore start - Spec.parseArgs always produces a name for valid input */
60
+ if (!name) {
61
+ throw error('Package name is required', {
62
+ found: specArg,
63
+ });
64
+ }
65
+ /* c8 ignore stop */
66
+ const version = spec.bareSpec;
67
+ // If no version specified, require --force to unpublish the entire package
68
+ if (!version) {
69
+ if (!force) {
70
+ throw error('Refusing to unpublish entire package without --force.\n' +
71
+ 'To unpublish a specific version, use: vlt unpublish <package>@<version>\n' +
72
+ 'To unpublish all versions, use: vlt unpublish <package> --force');
73
+ }
74
+ }
75
+ const rc = new RegistryClient(conf.options);
76
+ const encodedName = name.startsWith('@') ? name.replace('/', '%2F') : name;
77
+ if (version) {
78
+ // Unpublish a specific version:
79
+ // 1. Fetch the packument
80
+ // 2. Remove the version from the packument
81
+ // 3. PUT the updated packument back
82
+ const packumentUrl = new URL(encodedName, registryUrl);
83
+ let packumentResponse;
84
+ try {
85
+ packumentResponse = await rc.request(packumentUrl, {
86
+ useCache: false,
87
+ });
88
+ }
89
+ catch (err) {
90
+ throw error('Failed to fetch package metadata', {
91
+ cause: asError(err),
92
+ });
93
+ }
94
+ if (packumentResponse.statusCode !== 200) {
95
+ throw error('Package not found on the registry', {
96
+ url: packumentUrl,
97
+ response: packumentResponse,
98
+ });
99
+ }
100
+ const packument = packumentResponse.json();
101
+ const versions = packument.versions;
102
+ const distTags = packument['dist-tags'];
103
+ if (!versions?.[version]) {
104
+ throw error(`Version ${version} not found in package ${name}`, {
105
+ found: version,
106
+ wanted: Object.keys(versions ?? {}),
107
+ });
108
+ }
109
+ // Remove the version
110
+ delete versions[version];
111
+ // Remove any dist-tags pointing to this version
112
+ if (distTags) {
113
+ for (const [tag, tagVersion] of Object.entries(distTags)) {
114
+ if (tagVersion === version) {
115
+ delete distTags[tag];
116
+ }
117
+ }
118
+ }
119
+ // Remove the version from the time field if present
120
+ const time = packument.time;
121
+ if (time?.[version]) {
122
+ delete time[version];
123
+ }
124
+ // PUT the updated packument
125
+ const putUrl = new URL(`${encodedName}/-rev/${packument._rev}`, registryUrl);
126
+ let response;
127
+ try {
128
+ response = await rc.request(putUrl, {
129
+ method: 'PUT',
130
+ headers: {
131
+ 'content-type': 'application/json',
132
+ 'npm-auth-type': 'web',
133
+ 'npm-command': 'unpublish',
134
+ },
135
+ body: JSON.stringify(packument),
136
+ otp,
137
+ });
138
+ }
139
+ catch (err) {
140
+ throw error('Failed to unpublish package version', {
141
+ cause: asError(err),
142
+ });
143
+ }
144
+ if (response.statusCode !== 200 && response.statusCode !== 201) {
145
+ throw error('Failed to unpublish package version', {
146
+ url: putUrl,
147
+ response,
148
+ });
149
+ }
150
+ }
151
+ else {
152
+ // Unpublish entire package — DELETE the packument
153
+ // First fetch the packument to get the _rev
154
+ const packumentUrl = new URL(encodedName, registryUrl);
155
+ let packumentResponse;
156
+ try {
157
+ packumentResponse = await rc.request(packumentUrl, {
158
+ useCache: false,
159
+ });
160
+ }
161
+ catch (err) {
162
+ throw error('Failed to fetch package metadata', {
163
+ cause: asError(err),
164
+ });
165
+ }
166
+ if (packumentResponse.statusCode !== 200) {
167
+ throw error('Package not found on the registry', {
168
+ url: packumentUrl,
169
+ response: packumentResponse,
170
+ });
171
+ }
172
+ const packument = packumentResponse.json();
173
+ const deleteUrl = new URL(`${encodedName}/-rev/${packument._rev}`, registryUrl);
174
+ let response;
175
+ try {
176
+ response = await rc.request(deleteUrl, {
177
+ method: 'DELETE',
178
+ headers: {
179
+ 'content-type': 'application/json',
180
+ 'npm-auth-type': 'web',
181
+ 'npm-command': 'unpublish',
182
+ },
183
+ otp,
184
+ });
185
+ }
186
+ catch (err) {
187
+ throw error('Failed to unpublish package', {
188
+ cause: asError(err),
189
+ });
190
+ }
191
+ if (response.statusCode !== 200 && response.statusCode !== 201) {
192
+ throw error('Failed to unpublish package', {
193
+ url: deleteUrl,
194
+ response,
195
+ });
196
+ }
197
+ }
198
+ return {
199
+ name,
200
+ ...(version ? { version } : {}),
201
+ registry: registryUrl.origin,
202
+ };
203
+ };
@@ -1,6 +1,7 @@
1
1
  import type { CommandFn, CommandUsage } from '../index.ts';
2
2
  import { InstallReporter } from './install/reporter.ts';
3
3
  import type { InstallResult } from './install.ts';
4
+ export declare const needsRegistry = true;
4
5
  export declare const usage: CommandUsage;
5
6
  export declare const views: {
6
7
  readonly json: (i: InstallResult) => {
@@ -11,4 +12,3 @@ export declare const views: {
11
12
  readonly human: typeof InstallReporter;
12
13
  };
13
14
  export declare const command: CommandFn<InstallResult>;
14
- //# sourceMappingURL=update.d.ts.map
@@ -2,11 +2,18 @@ import { update } from '@vltpkg/graph';
2
2
  import { error } from '@vltpkg/error-cause';
3
3
  import { commandUsage } from "../config/usage.js";
4
4
  import { InstallReporter } from "./install/reporter.js";
5
+ export const needsRegistry = true;
5
6
  export const usage = () => commandUsage({
6
7
  command: 'update',
7
8
  usage: '',
8
9
  description: `Update dependencies to their latest in-range versions.
9
10
  Discards the lockfile and resolves dependencies from scratch.`,
11
+ options: {
12
+ 'allow-scripts': {
13
+ value: '<query>',
14
+ description: 'Filter which packages are allowed to run lifecycle scripts using DSS query syntax.',
15
+ },
16
+ },
10
17
  });
11
18
  export const views = {
12
19
  json: i => ({
@@ -38,4 +45,3 @@ export const command = async (conf) => {
38
45
  });
39
46
  return { buildQueue, graph };
40
47
  };
41
- //# sourceMappingURL=update.js.map
@@ -23,4 +23,3 @@ export declare const views: {
23
23
  readonly human: (results: CommandResult) => string;
24
24
  };
25
25
  export declare const command: CommandFn<CommandResult>;
26
- //# sourceMappingURL=version.d.ts.map
@@ -8,6 +8,7 @@ import assert from 'node:assert';
8
8
  import { actual } from '@vltpkg/graph';
9
9
  import { Query } from '@vltpkg/query';
10
10
  import { createHostContextsMap } from "../query-host-contexts.js";
11
+ import { minimatch } from 'minimatch';
11
12
  const isValidVersionIncrement = (value) => versionIncrements.includes(value);
12
13
  const version = async (conf, increment, cwd, {
13
14
  // Hardcode happy path options for now.
@@ -146,6 +147,23 @@ export const usage = () => {
146
147
  The \`<newversion>\` argument should be a valid semver string or a valid increment type (one of patch, minor, major, prepatch, preminor, premajor, prerelease).
147
148
 
148
149
  If run in a git repository, it will also create a version commit and tag.`,
150
+ options: {
151
+ scope: {
152
+ value: '<query>',
153
+ description: 'Filter version bump targets using a DSS query.',
154
+ },
155
+ workspace: {
156
+ value: '<path|glob>',
157
+ description: 'Limit version bump targets to matching workspaces.',
158
+ },
159
+ 'workspace-group': {
160
+ value: '<name>',
161
+ description: 'Limit version bump targets to workspace groups.',
162
+ },
163
+ recursive: {
164
+ description: 'Run version bump across all workspaces in the monorepo.',
165
+ },
166
+ },
149
167
  });
150
168
  };
151
169
  export const views = {
@@ -206,6 +224,15 @@ export const command = async (conf) => {
206
224
  }
207
225
  else if (paths?.length || groups?.length || recursive) {
208
226
  for (const workspace of options.monorepo ?? []) {
227
+ if (paths?.length) {
228
+ const matches = paths.some((p) => workspace.path === p ||
229
+ workspace.name === p ||
230
+ workspace.fullpath === p ||
231
+ resolve(projectRoot, p) === workspace.fullpath ||
232
+ minimatch(workspace.path, p));
233
+ if (!matches)
234
+ continue;
235
+ }
209
236
  locations.push(workspace.fullpath);
210
237
  }
211
238
  }
@@ -223,4 +250,3 @@ export const command = async (conf) => {
223
250
  }
224
251
  return results;
225
252
  };
226
- //# sourceMappingURL=version.js.map
@@ -0,0 +1,23 @@
1
+ import type { Manifest, Packument } from '@vltpkg/types';
2
+ import type { PackageReportData } from '@vltpkg/security-archive';
3
+ import type { CommandFn, CommandUsage } from '../index.ts';
4
+ import type { ViewOptions } from '../view.ts';
5
+ export declare const needsRegistry = true;
6
+ export declare const usage: CommandUsage;
7
+ export type ViewResult = {
8
+ /** The full packument data from the registry */
9
+ packument: Packument;
10
+ /** The resolved manifest for the requested version */
11
+ manifest: Manifest;
12
+ /** Security report data, if available */
13
+ security?: PackageReportData;
14
+ /** The specific field value if a field was requested */
15
+ fieldValue?: unknown;
16
+ /** The field path that was requested */
17
+ fieldPath?: string;
18
+ };
19
+ export declare const views: {
20
+ readonly human: (result: ViewResult, _options: ViewOptions, _conf: import("../config/index.ts").ParsedConfig) => string;
21
+ readonly json: (result: ViewResult, _options: ViewOptions, _conf: import("../config/index.ts").ParsedConfig) => unknown;
22
+ };
23
+ export declare const command: CommandFn<ViewResult>;