@vltpkg/cli-js 1.0.0-rc.32 → 1.0.0-rc.34

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 (85) hide show
  1. package/{access-SQZRJLJA.js → access-SXQICNAN.js} +23 -12
  2. package/{bugs-BMZ5UERM.js → bugs-OOPMFRCI.js} +19 -17
  3. package/{build-LGQI6OGM.js → build-HDXI5OA7.js} +13 -9
  4. package/{cache-JWHNATAX.js → cache-RW4Y4XNQ.js} +19 -14
  5. package/cache-unzip-src-unzip.js +434 -428
  6. package/{chunk-6YXVQ5HC.js → chunk-2PLIV3N3.js} +1 -27
  7. package/{chunk-G6PG3AGN.js → chunk-3SQ5Y324.js} +11 -8
  8. package/{chunk-ZUP6UTME.js → chunk-4RZDJQ5U.js} +42 -61
  9. package/{chunk-M2WD7IBO.js → chunk-4ZXA6RLP.js} +1 -1
  10. package/{chunk-R44FR7BY.js → chunk-7NHXV6AH.js} +439 -433
  11. package/{chunk-SIXXDCBI.js → chunk-CCQYIYTA.js} +7 -7
  12. package/{chunk-FXDRM4ZO.js → chunk-CLVRCGOZ.js} +247 -235
  13. package/{chunk-YCQTLBWF.js → chunk-CNSTFT7U.js} +1 -1
  14. package/{chunk-7XE7OES7.js → chunk-D5CP6O6G.js} +3 -3
  15. package/{chunk-YQXDHMHG.js → chunk-E5YE7UTZ.js} +3167 -2991
  16. package/chunk-E74WGW5C.js +49 -0
  17. package/{chunk-DFNHGGGV.js → chunk-EFWPI6IY.js} +1 -1
  18. package/{chunk-5UXEBLLT.js → chunk-EHEVBLDB.js} +68 -7
  19. package/{chunk-JBVLIV37.js → chunk-EQ633HIM.js} +14 -13
  20. package/{chunk-DM3WGEVB.js → chunk-F2FKLPZD.js} +7 -7
  21. package/chunk-FAG776ZD.js +137 -0
  22. package/{chunk-HQ4US6G3.js → chunk-FWKQ7YDF.js} +1049 -980
  23. package/chunk-HB7CKTYO.js +75 -0
  24. package/{chunk-KRGA5VLT.js → chunk-ICJRCXSG.js} +31 -27
  25. package/{chunk-FBTBHRPG.js → chunk-LCDBW6IT.js} +1 -1
  26. package/{chunk-IAKUGHGT.js → chunk-MT76WHSM.js} +1 -1
  27. package/{chunk-3TVABXAG.js → chunk-MU7Y4R5E.js} +3 -3
  28. package/{chunk-JKAZKVQU.js → chunk-PW6S6AIO.js} +15 -11
  29. package/{chunk-DI2CYYXF.js → chunk-U6DM3ROE.js} +706 -442
  30. package/chunk-UBLFPJHV.js +40 -0
  31. package/{chunk-SDBTQF2Y.js → chunk-UCD3RJYG.js} +5 -5
  32. package/{chunk-XFQ2EH5D.js → chunk-VM2RMMY4.js} +3 -3
  33. package/{chunk-DIKKTUBV.js → chunk-VZ7UNZHR.js} +3 -3
  34. package/{chunk-2V4AQPBR.js → chunk-WP6CYBPM.js} +81 -46
  35. package/{chunk-LEX7YPHR.js → chunk-WXMYKCQW.js} +118 -92
  36. package/{chunk-LRPTCGTW.js → chunk-XA47WS4N.js} +11 -15
  37. package/{chunk-NLFBANVO.js → chunk-Y7CQIZ7Y.js} +106 -150
  38. package/{ci-FQJANSQW.js → ci-MTYU2K2A.js} +14 -10
  39. package/cli-package.json +6 -2
  40. package/{config-4KQTTXJH.js → config-6NXV2BXW.js} +15 -13
  41. package/{config-LRL3N7TN.js → config-TVAXCTQO.js} +13 -11
  42. package/{create-KN6AXEA6.js → create-LXI5DCDW.js} +24 -19
  43. package/{deprecate-P26WHVFB.js → deprecate-2AQBL5XT.js} +22 -14
  44. package/{devtools-6NFQDW4L.js → devtools-HGLF4KAO.js} +82 -28
  45. package/{dist-tag-FA2BT7SA.js → dist-tag-BFSYLRIH.js} +16 -9
  46. package/{docs-OAPIY4SC.js → docs-ADPJ4B4C.js} +19 -17
  47. package/{exec-CVZGHJZS.js → exec-GMS54RAC.js} +24 -19
  48. package/{exec-cache-3AHODVRN.js → exec-cache-R5LVZL5Z.js} +22 -17
  49. package/{exec-local-I4OJX76E.js → exec-local-TVCLZGIM.js} +17 -14
  50. package/{help-QFIQSPNS.js → help-6CECUD6C.js} +5 -4
  51. package/{init-QLADIAP5.js → init-XXFLGYVP.js} +12 -10
  52. package/{install-B7CU2BLC.js → install-6KMXYSF5.js} +27 -12
  53. package/{list-OTFV3LOM.js → list-RUO3SUKY.js} +20 -15
  54. package/{login-LG2ZOIDQ.js → login-6I2CGO7I.js} +23 -9
  55. package/{logout-KUI773AM.js → logout-JTU4BJKH.js} +19 -8
  56. package/{pack-C55TTBIQ.js → pack-NCWH2TUA.js} +17 -13
  57. package/package.json +8 -1
  58. package/{ping-VNUOC26G.js → ping-4MEAC2WD.js} +17 -10
  59. package/{pkg-H4RJEBK5.js → pkg-ENSKG6G7.js} +13 -11
  60. package/{profile-DIJ5JUSE.js → profile-62YHNFSO.js} +16 -8
  61. package/{publish-XF2TRBPH.js → publish-PPY724N2.js} +58 -23
  62. package/{query-BGP5JMJ7.js → query-NLWXKOOT.js} +61 -15
  63. package/registry-QGI44LG4.js +117 -0
  64. package/registry-client-package.json +6 -2
  65. package/registry-client-src-revalidate.js +1245 -977
  66. package/{repo-NCEHK7KB.js → repo-BFRAXIVU.js} +19 -17
  67. package/{reporter-OB6SNHOZ.js → reporter-2XBYWAVU.js} +3 -2
  68. package/{run-ZNJJYEJF.js → run-7O65747G.js} +17 -14
  69. package/{run-exec-F5OV7MVN.js → run-exec-2OYWHL6K.js} +19 -14
  70. package/security-archive-src-update-expired.js +16 -11
  71. package/setup-MMIDAIJI.js +181 -0
  72. package/{src-M3WI7TSB.js → src-OK3KHDYR.js} +25 -17
  73. package/{token-KXCVRJGF.js → token-VLVXUW54.js} +20 -9
  74. package/{uninstall-33SUWR6K.js → uninstall-TAG6QIAG.js} +15 -11
  75. package/{unpublish-7AZPBZF2.js → unpublish-Y4L5J2IA.js} +17 -9
  76. package/{update-2EQF6IKZ.js → update-RYH4RKBS.js} +14 -10
  77. package/{version-HFYI3SEX.js → version-COHB32ON.js} +12 -10
  78. package/{view-C5OT36OB.js → view-P7U4MF43.js} +18 -14
  79. package/vlr.js +1 -1
  80. package/vlrx.js +1 -1
  81. package/vlt.js +1 -1
  82. package/vlx.js +1 -1
  83. package/vlxl.js +1 -1
  84. package/{whoami-KKFV3XR6.js → whoami-47MVFMZC.js} +19 -8
  85. package/chunk-FXIBCUIM.js +0 -73
@@ -11,40 +11,45 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  packTarball
14
- } from "./chunk-JBVLIV37.js";
14
+ } from "./chunk-EQ633HIM.js";
15
15
  import {
16
16
  prettyBytes
17
- } from "./chunk-LRPTCGTW.js";
17
+ } from "./chunk-XA47WS4N.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-XFQ2EH5D.js";
20
+ } from "./chunk-VM2RMMY4.js";
21
21
  import {
22
22
  Query,
23
23
  actual,
24
24
  run
25
- } from "./chunk-YQXDHMHG.js";
26
- import "./chunk-DM3WGEVB.js";
27
- import "./chunk-HQ4US6G3.js";
25
+ } from "./chunk-E5YE7UTZ.js";
26
+ import "./chunk-F2FKLPZD.js";
27
+ import "./chunk-FWKQ7YDF.js";
28
28
  import {
29
29
  minimatch
30
- } from "./chunk-KRGA5VLT.js";
31
- import "./chunk-IAKUGHGT.js";
32
- import "./chunk-JKAZKVQU.js";
30
+ } from "./chunk-ICJRCXSG.js";
31
+ import "./chunk-MT76WHSM.js";
33
32
  import "./chunk-HTOTG4TS.js";
33
+ import {
34
+ resolveRegistry
35
+ } from "./chunk-FAG776ZD.js";
34
36
  import {
35
37
  commandUsage
36
- } from "./chunk-FBTBHRPG.js";
38
+ } from "./chunk-LCDBW6IT.js";
37
39
  import {
38
40
  RegistryClient,
39
41
  oidc,
40
42
  registryBase
41
- } from "./chunk-DI2CYYXF.js";
42
- import "./chunk-YCQTLBWF.js";
43
- import "./chunk-R44FR7BY.js";
44
- import "./chunk-2V4AQPBR.js";
43
+ } from "./chunk-U6DM3ROE.js";
44
+ import "./chunk-CNSTFT7U.js";
45
+ import "./chunk-7NHXV6AH.js";
46
+ import "./chunk-PW6S6AIO.js";
47
+ import "./chunk-E74WGW5C.js";
48
+ import "./chunk-WP6CYBPM.js";
49
+ import "./chunk-UBLFPJHV.js";
45
50
  import {
46
51
  asError
47
- } from "./chunk-6YXVQ5HC.js";
52
+ } from "./chunk-2PLIV3N3.js";
48
53
  import "./chunk-XNLSTHDK.js";
49
54
  import {
50
55
  error
@@ -54,6 +59,32 @@ import "./chunk-PZLD7RTK.js";
54
59
  // ../../src/cli-sdk/src/commands/publish.ts
55
60
  import assert from "node:assert";
56
61
  import { dirname, resolve } from "node:path";
62
+
63
+ // ../../src/cli-sdk/src/registry-error-message.ts
64
+ import { STATUS_CODES } from "node:http";
65
+ var registryErrorMessage = (response) => {
66
+ const statusMessage = STATUS_CODES[response.statusCode];
67
+ const status = `${response.statusCode}${statusMessage ? ` ${statusMessage}` : ""}`;
68
+ let text;
69
+ try {
70
+ text = response.text().trim();
71
+ } catch {
72
+ return status;
73
+ }
74
+ if (!text) return status;
75
+ let detail = text;
76
+ try {
77
+ const body = JSON.parse(text);
78
+ if (body && typeof body === "object" && "error" in body && typeof body.error === "string" && body.error) {
79
+ detail = body.error;
80
+ }
81
+ } catch {
82
+ }
83
+ return `${status} \u2014 ${detail}`;
84
+ };
85
+
86
+ // ../../src/cli-sdk/src/commands/publish.ts
87
+ var needsRegistry = true;
57
88
  var usage = () => commandUsage({
58
89
  command: "publish",
59
90
  usage: "",
@@ -206,7 +237,7 @@ var commandSingle = async (location, conf) => {
206
237
  const publishConfig = getPublishConfig(manifest);
207
238
  const tag = publishConfig?.tag ?? conf.options.tag;
208
239
  const access = publishConfig?.access ?? conf.options.access;
209
- const registry = publishConfig?.registry ?? conf.options.registry;
240
+ const registry = publishConfig?.registry ?? await resolveRegistry(conf);
210
241
  const registryUrl = new URL(registryBase(registry));
211
242
  const runOptions = {
212
243
  cwd: manifestDir,
@@ -312,17 +343,20 @@ var commandSingle = async (location, conf) => {
312
343
  });
313
344
  }
314
345
  if (response.statusCode !== 200 && response.statusCode !== 201) {
315
- let extraMsg = "";
346
+ let advice = "";
316
347
  if (response.statusCode === 409) {
317
- extraMsg = `.
348
+ advice = `
318
349
  \u26A0\uFE0F ${name}@${version} already exists in the registry. Bump the version and try again.`;
319
350
  } else if (response.statusCode === 404) {
320
- extraMsg = ".\n\u26A0\uFE0F Make sure you're logged in and have access to publish the package.";
351
+ advice = "\n\u26A0\uFE0F Make sure you're logged in and have access to publish the package.";
321
352
  }
322
- throw error(`Failed to publish package${extraMsg}`, {
323
- url: publishUrl,
324
- response
325
- });
353
+ throw error(
354
+ `Failed to publish package: ${registryErrorMessage(response)}${advice}`,
355
+ {
356
+ url: publishUrl,
357
+ response
358
+ }
359
+ );
326
360
  }
327
361
  }
328
362
  await run({
@@ -345,6 +379,7 @@ var commandSingle = async (location, conf) => {
345
379
  };
346
380
  export {
347
381
  command,
382
+ needsRegistry,
348
383
  usage,
349
384
  views
350
385
  };
@@ -11,16 +11,18 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  MermaidImageView
14
- } from "./chunk-3TVABXAG.js";
14
+ } from "./chunk-MU7Y4R5E.js";
15
15
  import {
16
16
  createDiffFilesProvider
17
17
  } from "./chunk-RIYFGX27.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-XFQ2EH5D.js";
21
- import "./chunk-5UXEBLLT.js";
20
+ } from "./chunk-VM2RMMY4.js";
21
+ import {
22
+ stdout
23
+ } from "./chunk-EHEVBLDB.js";
22
24
  import "./chunk-G2YT2GWF.js";
23
- import "./chunk-NLFBANVO.js";
25
+ import "./chunk-Y7CQIZ7Y.js";
24
26
  import {
25
27
  GraphModifier,
26
28
  Query,
@@ -29,24 +31,27 @@ import {
29
31
  humanReadableOutput,
30
32
  jsonOutput,
31
33
  mermaidOutput
32
- } from "./chunk-YQXDHMHG.js";
34
+ } from "./chunk-E5YE7UTZ.js";
33
35
  import {
34
36
  SecurityArchive
35
- } from "./chunk-DM3WGEVB.js";
37
+ } from "./chunk-F2FKLPZD.js";
36
38
  import "./chunk-RXNA2XCX.js";
37
39
  import "./chunk-WGDTG44V.js";
38
- import "./chunk-DFNHGGGV.js";
39
- import "./chunk-KRGA5VLT.js";
40
- import "./chunk-IAKUGHGT.js";
41
- import "./chunk-JKAZKVQU.js";
40
+ import "./chunk-EFWPI6IY.js";
41
+ import "./chunk-ICJRCXSG.js";
42
+ import "./chunk-MT76WHSM.js";
42
43
  import "./chunk-HTOTG4TS.js";
44
+ import "./chunk-FAG776ZD.js";
43
45
  import {
44
46
  commandUsage
45
- } from "./chunk-FBTBHRPG.js";
46
- import "./chunk-YCQTLBWF.js";
47
- import "./chunk-R44FR7BY.js";
48
- import "./chunk-2V4AQPBR.js";
49
- import "./chunk-6YXVQ5HC.js";
47
+ } from "./chunk-LCDBW6IT.js";
48
+ import "./chunk-CNSTFT7U.js";
49
+ import "./chunk-7NHXV6AH.js";
50
+ import "./chunk-PW6S6AIO.js";
51
+ import "./chunk-E74WGW5C.js";
52
+ import "./chunk-WP6CYBPM.js";
53
+ import "./chunk-UBLFPJHV.js";
54
+ import "./chunk-2PLIV3N3.js";
50
55
  import "./chunk-XNLSTHDK.js";
51
56
  import {
52
57
  error
@@ -54,6 +59,7 @@ import {
54
59
  import "./chunk-PZLD7RTK.js";
55
60
 
56
61
  // ../../src/cli-sdk/src/commands/query.ts
62
+ var needsRegistry = true;
57
63
  var usage = () => commandUsage({
58
64
  command: "query",
59
65
  usage: [
@@ -194,6 +200,21 @@ var command = async (conf) => {
194
200
  }
195
201
  );
196
202
  scopeNodes = resultNodes;
203
+ if (scopeNodes.length === 0) {
204
+ if (conf.values.view === "human") {
205
+ stdout(
206
+ "No packages found matching scope query:",
207
+ scopeQueryString
208
+ );
209
+ }
210
+ return {
211
+ importers: /* @__PURE__ */ new Set(),
212
+ edges: [],
213
+ nodes: [],
214
+ highlightSelection: false,
215
+ queryString: scopeQueryString
216
+ };
217
+ }
197
218
  }
198
219
  if (scopeQueryString && scopeNodes) {
199
220
  for (const queryNode of scopeNodes) {
@@ -209,6 +230,18 @@ var command = async (conf) => {
209
230
  }
210
231
  }
211
232
  }
233
+ if (importers.size === 0) {
234
+ if (conf.values.view === "human") {
235
+ stdout("No matching workspaces found:", conf.values.workspace);
236
+ }
237
+ return {
238
+ importers: /* @__PURE__ */ new Set(),
239
+ edges: [],
240
+ nodes: [],
241
+ highlightSelection: false,
242
+ queryString: queryString ?? ""
243
+ };
244
+ }
212
245
  }
213
246
  const edges_ = graph?.edges ?? /* @__PURE__ */ new Set();
214
247
  const nodes_ = graph?.nodes ? new Set(graph.nodes.values()) : /* @__PURE__ */ new Set();
@@ -236,6 +269,18 @@ var command = async (conf) => {
236
269
  wanted: conf.values["expect-results"]
237
270
  });
238
271
  }
272
+ if (graph && nodes.length === 0 && edges.length === 0 && !conf.values["expect-results"]) {
273
+ if (conf.values.view === "human") {
274
+ stdout("No packages found matching query:", query);
275
+ }
276
+ return {
277
+ importers: /* @__PURE__ */ new Set(),
278
+ edges: [],
279
+ nodes: [],
280
+ highlightSelection: false,
281
+ queryString: query
282
+ };
283
+ }
239
284
  return {
240
285
  importers: importers.size === 0 ? new Set(queryResultImporters) : importers,
241
286
  edges,
@@ -246,6 +291,7 @@ var command = async (conf) => {
246
291
  };
247
292
  export {
248
293
  command,
294
+ needsRegistry,
249
295
  usage,
250
296
  views
251
297
  };
@@ -0,0 +1,117 @@
1
+ var global = globalThis;
2
+ import {Buffer} from "node:buffer";
3
+ import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
+ globalThis.setTimeout = _vlt_setTimeout;
5
+ globalThis.clearTimeout = _vlt_clearTimeout;
6
+ globalThis.setImmediate = _vlt_setImmediate;
7
+ globalThis.clearImmediate = _vlt_clearImmediate;
8
+ globalThis.setInterval = _vlt_setInterval;
9
+ globalThis.clearInterval = _vlt_clearInterval;
10
+ import {createRequire as _vlt_createRequire} from "node:module";
11
+ var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ resolveRegistry
14
+ } from "./chunk-FAG776ZD.js";
15
+ import {
16
+ commandUsage
17
+ } from "./chunk-LCDBW6IT.js";
18
+ import "./chunk-PW6S6AIO.js";
19
+ import {
20
+ getCommand
21
+ } from "./chunk-WP6CYBPM.js";
22
+ import "./chunk-2PLIV3N3.js";
23
+ import "./chunk-XNLSTHDK.js";
24
+ import {
25
+ error
26
+ } from "./chunk-WZWDS3W4.js";
27
+ import "./chunk-PZLD7RTK.js";
28
+
29
+ // ../../src/cli-sdk/src/commands/registry.ts
30
+ var registrySubcommands = [
31
+ "whoami",
32
+ "logout",
33
+ "login",
34
+ "token",
35
+ "access",
36
+ "publish",
37
+ "unpublish",
38
+ "deprecate",
39
+ "dist-tag",
40
+ "profile",
41
+ "ping"
42
+ ];
43
+ var isRegistrySubcommand = (s) => {
44
+ const canonical = getCommand(s);
45
+ return canonical !== void 0 && registrySubcommands.includes(canonical);
46
+ };
47
+ var usage = () => commandUsage({
48
+ command: "registry",
49
+ usage: "<alias> <command> [<args>]",
50
+ description: `Run an account command against a specific configured
51
+ registry, selected by its \`registries\` alias instead
52
+ of a full URL.
53
+
54
+ For example, \`vlt registry main whoami\` runs \`whoami\`
55
+ against the registry configured as \`main\`. Omit the
56
+ alias (e.g. \`vlt registry whoami\`) to be prompted to
57
+ choose from the configured registries, or to fall back
58
+ to \`--default-registry-alias\` when non-interactive.
59
+
60
+ \`<command>\` is one of:
61
+ ${registrySubcommands.join(", ")}.`
62
+ });
63
+ var views = {
64
+ human: () => {
65
+ }
66
+ };
67
+ var dispatchRegistry = async (conf, {
68
+ interactive,
69
+ input,
70
+ output
71
+ } = {}) => {
72
+ if (conf.get("help")) return;
73
+ const [first, ...restArgs] = conf.positionals;
74
+ if (first === void 0) return;
75
+ let alias;
76
+ let subRaw;
77
+ let args;
78
+ if (isRegistrySubcommand(first)) {
79
+ subRaw = first;
80
+ args = restArgs;
81
+ } else {
82
+ alias = first;
83
+ subRaw = restArgs[0];
84
+ args = restArgs.slice(1);
85
+ }
86
+ if (!isRegistrySubcommand(subRaw)) {
87
+ throw error("Unknown registry subcommand", {
88
+ found: subRaw,
89
+ validOptions: [...registrySubcommands],
90
+ code: "EUSAGE"
91
+ });
92
+ }
93
+ const registry = await resolveRegistry(conf, {
94
+ alias,
95
+ interactive,
96
+ input,
97
+ output
98
+ });
99
+ conf.options.registry = registry;
100
+ conf.values.registry = registry;
101
+ conf.command = subRaw;
102
+ conf.positionals = args;
103
+ };
104
+ var command = async (conf) => {
105
+ throw error("Missing registry subcommand", {
106
+ found: conf.positionals[0],
107
+ validOptions: [...registrySubcommands],
108
+ code: "EUSAGE"
109
+ });
110
+ };
111
+ export {
112
+ command,
113
+ dispatchRegistry,
114
+ registrySubcommands,
115
+ usage,
116
+ views
117
+ };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/registry-client",
3
3
  "description": "Fetch package artifacts and metadata from registries",
4
- "version": "1.0.0-rc.32",
4
+ "version": "1.0.0-rc.34",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -67,5 +67,9 @@
67
67
  },
68
68
  "files": [
69
69
  "dist"
70
- ]
70
+ ],
71
+ "bugs": {
72
+ "url": "https://github.com/vltpkg/vltpkg/issues"
73
+ },
74
+ "homepage": "https://github.com/vltpkg/vltpkg/tree/main/src/registry-client#readme"
71
75
  }