@vltpkg/cli-js 1.0.3 → 1.0.5

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 (77) hide show
  1. package/{access-5WETTBDZ.js → access-AFFG4IBZ.js} +4 -4
  2. package/{bugs-KONFLIQQ.js → bugs-MCLLEJJP.js} +9 -9
  3. package/{build-S7G2DU7I.js → build-TKUT6V2P.js} +6 -6
  4. package/{cache-Z4OIMLXQ.js → cache-O464JQI4.js} +7 -7
  5. package/cache-unzip-src-unzip.js +26 -2
  6. package/{chunk-UXIRAU5T.js → chunk-34VLICEH.js} +3 -3
  7. package/{chunk-LZGKX7JI.js → chunk-3NGV7EC6.js} +99 -80
  8. package/{chunk-NXEH3NQZ.js → chunk-3NWTVANS.js} +4 -4
  9. package/{chunk-OCJDISSI.js → chunk-3OPNZI6G.js} +2 -2
  10. package/{chunk-DYCF76WI.js → chunk-4LBWNGU6.js} +2 -2
  11. package/{chunk-T4GYDWUJ.js → chunk-5JFRXIK2.js} +17 -2
  12. package/{chunk-E737X73P.js → chunk-AL42Z2D3.js} +12 -5
  13. package/{chunk-5B23EKN4.js → chunk-ED2DDTQT.js} +21 -14
  14. package/{chunk-XQSBCMSC.js → chunk-FBHWUWBW.js} +2 -2
  15. package/{chunk-VB3IWNHX.js → chunk-GDJ7JT2R.js} +1 -1
  16. package/{chunk-5QJEOGEM.js → chunk-JFO2EQA5.js} +1 -1
  17. package/{chunk-5UPPEUG2.js → chunk-K55EFH4U.js} +5 -5
  18. package/{chunk-UAAZW4N6.js → chunk-QWTGTFHN.js} +3 -3
  19. package/{chunk-HNCE3YE5.js → chunk-R32BJAKT.js} +1081 -478
  20. package/{chunk-FFOXTPQA.js → chunk-SVBEF5PK.js} +127 -78
  21. package/{chunk-W2Q5EIMH.js → chunk-UCYLZSZ7.js} +5 -5
  22. package/{chunk-IITIX4ID.js → chunk-VFBCWAOC.js} +37 -1
  23. package/{chunk-XU5SMHXP.js → chunk-XKVU23NC.js} +1 -1
  24. package/{chunk-TMBNGWXK.js → chunk-YRLO236S.js} +3 -3
  25. package/{chunk-G7UPIJAP.js → chunk-YZPRRP7W.js} +6 -6
  26. package/chunk-ZBNPQDQ7.js +75 -0
  27. package/{chunk-FWKQ7YDF.js → chunk-ZWKI5OSF.js} +118 -117
  28. package/{ci-RZZE375O.js → ci-GPZGE4SU.js} +9 -7
  29. package/cli-package.json +1 -1
  30. package/{config-MDFY3ORD.js → config-WDCFW5X7.js} +8 -8
  31. package/{config-LL3RLMZG.js → config-YEEKT7WH.js} +7 -7
  32. package/{create-GVSDTOGQ.js → create-TVVUUIUZ.js} +14 -14
  33. package/{deprecate-T4TQLGXQ.js → deprecate-AH4LOHMI.js} +8 -8
  34. package/{devtools-HGLF4KAO.js → devtools-66MVSNF5.js} +30 -30
  35. package/{dist-tag-GO46UQUN.js → dist-tag-4R6YHSZ7.js} +4 -4
  36. package/{docs-FJME563T.js → docs-7MHXAHGG.js} +9 -9
  37. package/{exec-M22KBPCK.js → exec-FRQOPS5C.js} +16 -14
  38. package/{exec-cache-3UNLDUAP.js → exec-cache-VYVXFKA2.js} +12 -12
  39. package/{exec-local-YHVO5RLU.js → exec-local-MXYOC2AY.js} +11 -11
  40. package/{help-ZEWMLOJX.js → help-J5CYJ7BO.js} +1 -1
  41. package/{init-4HPZY2KN.js → init-7D5MFAP5.js} +7 -7
  42. package/{install-2TZIP4PJ.js → install-T34U5HPS.js} +10 -8
  43. package/{list-NFFXER43.js → list-C2LX6EIY.js} +11 -11
  44. package/{login-KV5YC5Z2.js → login-6JP7WTRM.js} +4 -4
  45. package/{logout-I2VT3NAR.js → logout-JYOBUHP3.js} +4 -4
  46. package/{pack-47ZKFSHI.js → pack-ON6BK2AI.js} +9 -9
  47. package/package.json +1 -1
  48. package/{ping-Q7Y7QV63.js → ping-GUNQJ53P.js} +4 -4
  49. package/{pkg-VTJS2ISJ.js → pkg-GIH3WMUK.js} +8 -8
  50. package/{profile-YXZYVEUX.js → profile-IEIZFNOD.js} +4 -4
  51. package/{publish-CBN67KN2.js → publish-VTRA3MIS.js} +11 -11
  52. package/{query-U3QHF3ZE.js → query-KEXYDRHP.js} +11 -11
  53. package/{registry-CZPFR3OF.js → registry-43SSGAPE.js} +3 -3
  54. package/registry-client-package.json +1 -1
  55. package/registry-client-src-revalidate.js +1348 -720
  56. package/{repo-4UIQRBI7.js → repo-LI5FOP3N.js} +9 -9
  57. package/{reporter-DKZTTACW.js → reporter-Y7RMSVN4.js} +83 -83
  58. package/{run-5DUYI6GL.js → run-LEWQVDWO.js} +11 -11
  59. package/{run-exec-HPNBVAXH.js → run-exec-CLCZ47NU.js} +11 -11
  60. package/security-archive-src-update-expired.js +37 -1
  61. package/{setup-23W5FQVW.js → setup-MPG4UQPT.js} +7 -7
  62. package/{src-2NB67FPG.js → src-ARXB4NH5.js} +12 -12
  63. package/{src-6OKPBJJT.js → src-B4IYFLHG.js} +4 -2
  64. package/{src-M5RRGKUM.js → src-U4EBFPPT.js} +39 -16
  65. package/{token-SRCS5CRU.js → token-UD4AF4I7.js} +4 -4
  66. package/{uninstall-JXHAFXZ2.js → uninstall-MSKFXGAO.js} +10 -8
  67. package/{unpublish-GRYB5KQH.js → unpublish-2RNLXZWP.js} +4 -4
  68. package/{update-GDLL4ER6.js → update-3HXQLP34.js} +9 -7
  69. package/{version-JVG4CI4L.js → version-RBLKW6BQ.js} +7 -7
  70. package/{view-ABQLVL4L.js → view-3XTRGRGJ.js} +12 -12
  71. package/vlr.js +1 -1
  72. package/vlrx.js +1 -1
  73. package/vlt.js +1 -1
  74. package/vlx.js +1 -1
  75. package/vlxl.js +1 -1
  76. package/{whoami-RCCZ7BXI.js → whoami-WSXDPFSQ.js} +4 -4
  77. package/chunk-RNJSI3NZ.js +0 -75
@@ -10,8 +10,9 @@ globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
- defaultRegistries
14
- } from "./chunk-IITIX4ID.js";
13
+ defaultRegistries,
14
+ defaultRegistryName
15
+ } from "./chunk-VFBCWAOC.js";
15
16
  import {
16
17
  error
17
18
  } from "./chunk-WZWDS3W4.js";
@@ -67,6 +68,17 @@ var missingRegistryError = () => error(
67
68
  ].join("\n"),
68
69
  { code: "ECONFIG" }
69
70
  );
71
+ var missingNpmRegistryError = (alias = defaultRegistryName) => error(
72
+ [
73
+ `Missing ${alias} registry configuration.`,
74
+ "",
75
+ `Install commands require the \`registries.${alias}\` alias.`,
76
+ "Run `vlt setup` to get configured.",
77
+ "",
78
+ "See https://docs.vlt.sh/cli for other ways to set a registry."
79
+ ].join("\n"),
80
+ { code: "ECONFIG" }
81
+ );
70
82
  var ambiguousRegistryError = (candidates) => error(
71
83
  [
72
84
  "Multiple registries are configured; specify which one to use.",
@@ -95,6 +107,7 @@ var gatherCandidates = (conf) => {
95
107
  return Object.entries(conf.options.registries).filter(([alias, url]) => builtins[alias] !== url).map(([alias, url]) => ({ alias, url }));
96
108
  };
97
109
  var hasConfiguredRegistry = (conf) => !!conf.options.registry || gatherCandidates(conf).length > 0;
110
+ var hasNpmRegistry = (conf) => !!conf.options.registries[conf.options["default-registry-alias"]];
98
111
  var requireRegistry = (conf, alias) => {
99
112
  if (alias !== void 0) return resolveRegistryAlias(conf, alias);
100
113
  const { registry } = conf.options;
@@ -131,7 +144,9 @@ var resolveRegistry = async (conf, {
131
144
 
132
145
  export {
133
146
  missingRegistryError,
147
+ missingNpmRegistryError,
134
148
  hasConfiguredRegistry,
149
+ hasNpmRegistry,
135
150
  requireRegistry,
136
151
  resolveRegistry
137
152
  };
@@ -20,15 +20,17 @@ import {
20
20
  } from "./chunk-G2YT2GWF.js";
21
21
  import {
22
22
  parseError
23
- } from "./chunk-VB3IWNHX.js";
23
+ } from "./chunk-GDJ7JT2R.js";
24
24
  import {
25
25
  hasConfiguredRegistry,
26
+ hasNpmRegistry,
27
+ missingNpmRegistryError,
26
28
  missingRegistryError
27
- } from "./chunk-T4GYDWUJ.js";
29
+ } from "./chunk-5JFRXIK2.js";
28
30
  import {
29
31
  isGraphRunError,
30
32
  splitDepID
31
- } from "./chunk-OCJDISSI.js";
33
+ } from "./chunk-3OPNZI6G.js";
32
34
  import {
33
35
  defaultView
34
36
  } from "./chunk-WP6CYBPM.js";
@@ -46,7 +48,7 @@ import {
46
48
  import {
47
49
  isErrorWithCause,
48
50
  isObject
49
- } from "./chunk-IITIX4ID.js";
51
+ } from "./chunk-VFBCWAOC.js";
50
52
 
51
53
  // ../../src/cli-sdk/src/print-err.ts
52
54
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -493,7 +495,7 @@ var startView = async (conf, opts, views, { start } = { start: Date.now() }) =>
493
495
  var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
494
496
  start: Date.now()
495
497
  }) => {
496
- const { usage, views, command, needsRegistry } = cliCommand;
498
+ const { usage, views, command, needsRegistry, needsNpmRegistry } = cliCommand;
497
499
  const stdoutColor = conf.values.color ?? supportsColor2(process.stdout);
498
500
  const stderrColor = conf.values.color ?? supportsColor2(process.stderr);
499
501
  if (conf.values.help) {
@@ -525,6 +527,11 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
525
527
  if (needsRegistry && !hasConfiguredRegistry(conf)) {
526
528
  throw missingRegistryError();
527
529
  }
530
+ if (needsNpmRegistry && !hasNpmRegistry(conf)) {
531
+ throw missingNpmRegistryError(
532
+ conf.options["default-registry-alias"]
533
+ );
534
+ }
528
535
  const output = await onDone(await command(conf));
529
536
  stopRequestLog();
530
537
  const duration_ms = Date.now() - start;
@@ -13,7 +13,7 @@ import {
13
13
  asDepID,
14
14
  baseDepID,
15
15
  splitDepID
16
- } from "./chunk-OCJDISSI.js";
16
+ } from "./chunk-3OPNZI6G.js";
17
17
  import {
18
18
  loadPackageJson
19
19
  } from "./chunk-E74WGW5C.js";
@@ -23,6 +23,9 @@ import {
23
23
  import {
24
24
  XDG
25
25
  } from "./chunk-XNLSTHDK.js";
26
+ import {
27
+ defaultRegistryName
28
+ } from "./chunk-VFBCWAOC.js";
26
29
  import {
27
30
  error
28
31
  } from "./chunk-WZWDS3W4.js";
@@ -250,16 +253,20 @@ var __CODE_SPLIT_SCRIPT_NAME = resolve(import.meta.dirname, "security-archive-sr
250
253
  // ../../src/security-archive/src/index.ts
251
254
  var SOCKET_API_V0_URL = "https://api.socket.dev/v0/purl?alerts=true";
252
255
  var SOCKET_PUBLIC_API_TOKEN = "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api";
253
- var targetSecurityRegisty = "https://registry.npmjs.org/";
254
- var usesTargetRegistry = (node) => {
255
- const depID = node.id;
256
- const specOptions = node.options;
257
- const [nodeType, nodeRegistry] = splitDepID(depID);
258
- if (nodeType !== "registry") {
259
- return false;
260
- }
261
- const reg = specOptions.registries?.[nodeRegistry];
262
- return reg === targetSecurityRegisty;
256
+ var npmRegistryURL = "https://registry.npmjs.org/";
257
+ var normalizeRegistryURL = (url) => url.endsWith("/") ? url : `${url}/`;
258
+ var nodeRegistryURL = (node) => {
259
+ const [type, reg] = splitDepID(node.id);
260
+ if (type !== "registry") return;
261
+ const url = /^https?:\/\//.test(reg) ? reg : node.options.registries?.[reg];
262
+ return url ? normalizeRegistryURL(url) : void 0;
263
+ };
264
+ var usesNpmRegistry = (node) => {
265
+ const origin = nodeRegistryURL(node);
266
+ if (!origin) return false;
267
+ if (origin === npmRegistryURL) return true;
268
+ const npmAlias = node.options.registries?.[defaultRegistryName];
269
+ return !!npmAlias && normalizeRegistryURL(npmAlias) === origin;
263
270
  };
264
271
  var { version } = loadPackageJson(
265
272
  import.meta.filename,
@@ -412,7 +419,7 @@ var SecurityArchive = class _SecurityArchive extends I {
412
419
  const queue = /* @__PURE__ */ new Set();
413
420
  for (const node of this.#nodesByID.values()) {
414
421
  const normalizedId = baseDepID(node.id);
415
- if (usesTargetRegistry(node) && !this.has(normalizedId) && !this.#expired.has(normalizedId)) {
422
+ if (usesNpmRegistry(node) && !this.has(normalizedId) && !this.#expired.has(normalizedId)) {
416
423
  const purl = `pkg:npm/${node.name}@${node.version}`;
417
424
  queue.add({ purl });
418
425
  }
@@ -512,12 +519,12 @@ var SecurityArchive = class _SecurityArchive extends I {
512
519
  }
513
520
  }
514
521
  /**
515
- * Validates that all public-registry packages in the nodes
522
+ * Validates that all npm-ecosystem packages in the nodes
516
523
  * have a valid report data in the current in-memory cache.
517
524
  */
518
525
  #validateReportData() {
519
526
  for (const node of this.#nodesByID.values()) {
520
- if (usesTargetRegistry(node)) {
527
+ if (usesNpmRegistry(node)) {
521
528
  if (!this.has(baseDepID(node.id))) {
522
529
  this.ok = false;
523
530
  return;
@@ -12,12 +12,12 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  init,
14
14
  install
15
- } from "./chunk-LZGKX7JI.js";
15
+ } from "./chunk-3NGV7EC6.js";
16
16
  import {
17
17
  asWSConfig,
18
18
  assertWSConfig,
19
19
  minimatch
20
- } from "./chunk-FFOXTPQA.js";
20
+ } from "./chunk-SVBEF5PK.js";
21
21
  import {
22
22
  commandUsage
23
23
  } from "./chunk-LCDBW6IT.js";
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  isError,
14
14
  isObject
15
- } from "./chunk-IITIX4ID.js";
15
+ } from "./chunk-VFBCWAOC.js";
16
16
 
17
17
  // ../../src/output/src/error.ts
18
18
  var parseError = (err) => {
@@ -19,7 +19,7 @@ var run = async (command) => {
19
19
  if (command) {
20
20
  process.argv.splice(2, 0, command);
21
21
  }
22
- const vlt = await import("./src-2NB67FPG.js");
22
+ const vlt = await import("./src-ARXB4NH5.js");
23
23
  await vlt.default();
24
24
  };
25
25
 
@@ -11,17 +11,17 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  PackageInfoClient
14
- } from "./chunk-G7UPIJAP.js";
14
+ } from "./chunk-YZPRRP7W.js";
15
15
  import {
16
16
  findCmdShimIfExists,
17
17
  install
18
- } from "./chunk-LZGKX7JI.js";
18
+ } from "./chunk-3NGV7EC6.js";
19
19
  import {
20
20
  PathScurry
21
- } from "./chunk-FFOXTPQA.js";
21
+ } from "./chunk-SVBEF5PK.js";
22
22
  import {
23
23
  Spec
24
- } from "./chunk-XU5SMHXP.js";
24
+ } from "./chunk-XKVU23NC.js";
25
25
  import {
26
26
  walkUp
27
27
  } from "./chunk-HTOTG4TS.js";
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-XNLSTHDK.js";
31
31
  import {
32
32
  parseScope
33
- } from "./chunk-IITIX4ID.js";
33
+ } from "./chunk-VFBCWAOC.js";
34
34
  import {
35
35
  error
36
36
  } from "./chunk-WZWDS3W4.js";
@@ -13,13 +13,13 @@ import {
13
13
  Ct,
14
14
  Qn,
15
15
  require_lib
16
- } from "./chunk-FWKQ7YDF.js";
16
+ } from "./chunk-ZWKI5OSF.js";
17
17
  import {
18
18
  minimatch
19
- } from "./chunk-FFOXTPQA.js";
19
+ } from "./chunk-SVBEF5PK.js";
20
20
  import {
21
21
  Spec
22
- } from "./chunk-XU5SMHXP.js";
22
+ } from "./chunk-XKVU23NC.js";
23
23
  import {
24
24
  parse,
25
25
  stringify