@vltpkg/cli-js 1.3.8 → 1.5.0

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 (99) hide show
  1. package/{access-WLKANIOE.js → access-QPX4QXV4.js} +13 -12
  2. package/{bugs-5Q3QSTWP.js → bugs-TLOECXEM.js} +28 -25
  3. package/{build-XSFR63AW.js → build-IQOS3LKO.js} +28 -19
  4. package/{cache-UVPK5J5A.js → cache-O5IBYYSB.js} +35 -23
  5. package/cache-unzip-src-unzip.js +56 -12
  6. package/{chunk-NWHKSRO3.js → chunk-2U4PVHP4.js} +5270 -10837
  7. package/{chunk-5KOLUYXH.js → chunk-35EG6T3J.js} +61 -15
  8. package/{chunk-PJJCFMLW.js → chunk-3S3W7QEM.js} +7 -5
  9. package/chunk-43EJ4Q42.js +57 -0
  10. package/{chunk-IHXJVKAE.js → chunk-4TSHLSRK.js} +2 -1
  11. package/chunk-4UH3KMTD.js +6444 -0
  12. package/{chunk-6D54UN4T.js → chunk-5KW6AOTT.js} +1 -1
  13. package/chunk-6IF3RJND.js +81 -0
  14. package/{chunk-IBGFQR23.js → chunk-6LZM3I4Q.js} +56 -11
  15. package/{chunk-FIUUAQGC.js → chunk-6W5XMVIZ.js} +29 -22
  16. package/{chunk-OWMR2EDW.js → chunk-7UWRR6EE.js} +2 -2
  17. package/{chunk-WHLYMMI2.js → chunk-ARE7FKDG.js} +6 -4
  18. package/chunk-B6RIGNEO.js +626 -0
  19. package/{chunk-CB65DPZ2.js → chunk-C6ZVVEFV.js} +239 -1190
  20. package/{chunk-SE2FSMBR.js → chunk-CMLDLZZ3.js} +73 -11
  21. package/{chunk-6P5CFJR7.js → chunk-CS6AYPY5.js} +6 -6
  22. package/{chunk-TLY4VGMH.js → chunk-CW56EJIL.js} +1 -1
  23. package/{chunk-SV4WK3KX.js → chunk-F7NPYSI2.js} +3 -2
  24. package/{chunk-6BQKR2FM.js → chunk-G3FZ2ZJK.js} +1 -1
  25. package/chunk-GUP55DM6.js +59 -0
  26. package/chunk-HOF7LEIC.js +24 -0
  27. package/chunk-IFEZ6BFV.js +1111 -0
  28. package/{chunk-3U6QWN62.js → chunk-IJUVVD7E.js} +1 -1
  29. package/{chunk-H77JYU7F.js → chunk-ISAMD2FE.js} +12 -3
  30. package/{chunk-WKA5UYNA.js → chunk-LH7J5BDU.js} +5 -5
  31. package/{chunk-GZ5MYMBT.js → chunk-LUVDMEW4.js} +1 -1
  32. package/{chunk-OAP2ROTL.js → chunk-MYX4JCIJ.js} +1 -1
  33. package/{chunk-APMYKJI2.js → chunk-QNHBAGXQ.js} +1 -1
  34. package/{chunk-XCDLOQZZ.js → chunk-SMXXFQPI.js} +80 -29
  35. package/chunk-SUU2WETN.js +268 -0
  36. package/chunk-T2VBCUF5.js +77 -0
  37. package/{chunk-EL4GVZK5.js → chunk-T5EP7QEF.js} +2 -2
  38. package/{chunk-A2TSRXZD.js → chunk-UZ6ICZE3.js} +1 -1
  39. package/{chunk-DL3H4EMY.js → chunk-VR7NRWAD.js} +29 -20
  40. package/chunk-W4T5CGCO.js +52 -0
  41. package/{chunk-XDSZO74H.js → chunk-WHWPAYZY.js} +118 -20
  42. package/{chunk-KMOOTBHM.js → chunk-X6JKMIOU.js} +5 -1
  43. package/{chunk-43HNQWPQ.js → chunk-XCQCYB6G.js} +78 -13
  44. package/{chunk-IUL6MPP6.js → chunk-XCSNI6AO.js} +4 -4
  45. package/{chunk-BGA3WB7H.js → chunk-XD5KUDXX.js} +7 -7
  46. package/{chunk-QNDM4DVO.js → chunk-Z5D5KODU.js} +1 -1
  47. package/{ci-EDRETPUF.js → ci-ESVUMOZO.js} +31 -13
  48. package/cli-package.json +1 -1
  49. package/{config-MVNXGEOQ.js → config-TMB2X6DW.js} +12 -9
  50. package/{config-OKBXU7TU.js → config-ZVVLFKR7.js} +16 -13
  51. package/{create-R7BXYJSU.js → create-BLTNKSBQ.js} +28 -25
  52. package/{deprecate-YSUKBKQM.js → deprecate-VA6PGHYL.js} +17 -15
  53. package/{dist-tag-MIGYSR4F.js → dist-tag-OYJREFO2.js} +13 -12
  54. package/{docs-4WVIN75H.js → docs-6OC3OQNM.js} +28 -25
  55. package/{exec-IXHDQLAM.js → exec-AZPGFVRY.js} +28 -25
  56. package/{exec-cache-EA7GHIK7.js → exec-cache-D75UY2WI.js} +24 -22
  57. package/{exec-local-GM4LH56M.js → exec-local-E2JKB4X4.js} +22 -19
  58. package/{help-TCXGBICU.js → help-UPW77X5N.js} +5 -5
  59. package/{init-MWZDWQHM.js → init-SNO6QL7C.js} +14 -11
  60. package/{install-HPI5HU3C.js → install-TEJM2YVX.js} +165 -26
  61. package/{list-2CX6REPJ.js → list-NHCC2RNB.js} +33 -27
  62. package/{login-RAY23CVG.js → login-XNZXCGFD.js} +19 -16
  63. package/{logout-ICB5OMGY.js → logout-YCM7O36Q.js} +13 -12
  64. package/{outdated-FYHPXRMT.js → outdated-4LA7N63W.js} +26 -22
  65. package/{pack-E5MNPQXK.js → pack-RC4CZSWF.js} +25 -18
  66. package/package.json +1 -1
  67. package/{ping-REQ2KSAR.js → ping-RLVAZGDL.js} +13 -12
  68. package/{pkg-YB4GSRII.js → pkg-FED5C6TP.js} +23 -14
  69. package/{profile-GKBW6GRI.js → profile-DJZNLQPG.js} +13 -12
  70. package/{publish-4ZQJYYLF.js → publish-54AMVMTQ.js} +61 -45
  71. package/{query-SKXBF3MJ.js → query-ZQLMSJ7O.js} +35 -29
  72. package/{registry-MQJJCWJY.js → registry-6HKQYSZX.js} +7 -7
  73. package/registry-client-src-revalidate.js +110 -20
  74. package/{repo-ACPTZI2C.js → repo-ITA4BLZ4.js} +28 -25
  75. package/{reporter-4KK2JNGO.js → reporter-UYVR2WMB.js} +73 -14
  76. package/{run-YW3ITX2A.js → run-TP2HTJRN.js} +22 -19
  77. package/{run-exec-7VQX3OFG.js → run-exec-UGCC53DV.js} +22 -19
  78. package/security-archive-src-update-expired.js +88 -28
  79. package/{setup-PLEKCMXN.js → setup-XPAM5U3Z.js} +23 -21
  80. package/skills-LR6GXW3X.js +413 -0
  81. package/skills-YD2TB2VD.js +495 -0
  82. package/{src-XQ7KVUVN.js → src-34D4DOOH.js} +37 -27
  83. package/{src-PXDFMQ6W.js → src-H6DFCAPH.js} +9 -8
  84. package/{src-GP7VLT7P.js → src-LHDC4NJO.js} +58 -9
  85. package/{token-GB7RPE5J.js → token-OF63PFTQ.js} +13 -12
  86. package/{uninstall-RLCECX37.js → uninstall-B54FQ5KQ.js} +20 -15
  87. package/{unpublish-3ZXEAVHF.js → unpublish-CSHIGMDQ.js} +31 -16
  88. package/{update-VDZP6EZN.js → update-HS4VJ5ZG.js} +51 -25
  89. package/{version-MRELJPOK.js → version-L7S3DHUS.js} +24 -14
  90. package/{view-LCXMTGCJ.js → view-NWKKWFVA.js} +17 -15
  91. package/vlr.js +1 -1
  92. package/vlrx.js +1 -1
  93. package/vlt.js +1 -1
  94. package/vlx.js +1 -1
  95. package/vlxl.js +1 -1
  96. package/{whoami-PNRDBS45.js → whoami-65K35VGW.js} +13 -12
  97. package/chunk-4JAZZRKR.js +0 -76
  98. package/chunk-G2YT2GWF.js +0 -120
  99. package/chunk-U7TEQCBN.js +0 -880
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  asError,
14
14
  isObject
15
- } from "./chunk-IBGFQR23.js";
15
+ } from "./chunk-6LZM3I4Q.js";
16
16
  import {
17
17
  error
18
18
  } from "./chunk-WZWDS3W4.js";
@@ -0,0 +1,81 @@
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
+
13
+ // ../../src/tar/src/clonefile.ts
14
+ import { isBuiltin } from "node:module";
15
+ var codes = {
16
+ 1: "EPERM",
17
+ 2: "ENOENT",
18
+ 5: "EIO",
19
+ 13: "EACCES",
20
+ 17: "EEXIST",
21
+ 18: "EXDEV",
22
+ 20: "ENOTDIR",
23
+ 22: "EINVAL",
24
+ 28: "ENOSPC",
25
+ 45: "ENOTSUP",
26
+ 62: "ELOOP",
27
+ 63: "ENAMETOOLONG"
28
+ };
29
+ var lib;
30
+ var load = () => {
31
+ if (lib !== void 0) return lib;
32
+ lib = null;
33
+ if (process.platform !== "darwin" || !isBuiltin("node:ffi")) {
34
+ return lib;
35
+ }
36
+ const emitWarning = process.emitWarning;
37
+ process.emitWarning = (warning, ...rest) => {
38
+ const [type] = rest;
39
+ const name = typeof type === "string" ? type : type?.type;
40
+ if (name !== "ExperimentalWarning" || !/\bFFI\b/.test(String(warning))) {
41
+ emitWarning.call(process, warning, ...rest);
42
+ }
43
+ };
44
+ try {
45
+ const ffi = process.getBuiltinModule("node:ffi");
46
+ const system = new ffi.DynamicLibrary("libSystem.B.dylib");
47
+ lib = {
48
+ clonefile: system.getFunction("clonefile", {
49
+ return: "int32",
50
+ arguments: ["string", "string", "uint32"]
51
+ }),
52
+ error: system.getFunction("__error", {
53
+ return: "pointer",
54
+ arguments: []
55
+ }),
56
+ getInt32: ffi.getInt32
57
+ };
58
+ } catch {
59
+ } finally {
60
+ process.emitWarning = emitWarning;
61
+ }
62
+ return lib;
63
+ };
64
+ var cloneAvailable = () => !!load();
65
+ var cloneDir = (src, dst) => {
66
+ const l = load();
67
+ if (!l) return "ENOTSUP";
68
+ try {
69
+ if (l.clonefile(src, dst, 0) === 0) return true;
70
+ const errno = l.getInt32(l.error(), 0);
71
+ return codes[errno] ?? `E${errno}`;
72
+ } catch {
73
+ lib = null;
74
+ return "ENOTSUP";
75
+ }
76
+ };
77
+
78
+ export {
79
+ cloneAvailable,
80
+ cloneDir
81
+ };
@@ -16,7 +16,27 @@ import {
16
16
  } from "./chunk-WZWDS3W4.js";
17
17
 
18
18
  // ../../src/fast-split/src/index.ts
19
+ var splitTwo = (str, delim) => {
20
+ const a = str.indexOf(delim);
21
+ return a === -1 ? [str] : [str.substring(0, a), str.substring(a + delim.length)];
22
+ };
23
+ var splitThree = (str, delim) => {
24
+ const a = str.indexOf(delim);
25
+ if (a === -1) return [str];
26
+ const l = delim.length;
27
+ const b = str.indexOf(delim, a + l);
28
+ return b === -1 ? [str.substring(0, a), str.substring(a + l)] : [
29
+ str.substring(0, a),
30
+ str.substring(a + l, b),
31
+ str.substring(b + l)
32
+ ];
33
+ };
19
34
  function fastSplit(str, delim, limit = -1, onPart) {
35
+ if (onPart === void 0) {
36
+ if (limit === 2) return splitTwo(str, delim);
37
+ if (limit === 3)
38
+ return splitThree(str, delim);
39
+ }
20
40
  let i = 0;
21
41
  let p = 0;
22
42
  const l = delim.length;
@@ -966,9 +986,10 @@ var defaultScopeRegistries = {
966
986
  "@jsr": "https://npm.jsr.io/"
967
987
  };
968
988
  var getOptions = (options) => ({
969
- catalog: {},
970
989
  catalogs: {},
971
990
  ...options,
991
+ // after spread: explicit `catalog: undefined` gets default too
992
+ catalog: options?.catalog ?? {},
972
993
  // built-in aliases are user/service-overridable: user config wins
973
994
  "jsr-registries": {
974
995
  ...defaultJsrRegistries,
@@ -1157,19 +1178,25 @@ var Spec = class _Spec {
1157
1178
  }
1158
1179
  if (this.bareSpec.startsWith("catalog:")) {
1159
1180
  this.catalog = this.bareSpec.substring("catalog:".length);
1160
- const catalog = this.catalog ? this.options.catalogs?.[this.catalog] : this.options.catalog;
1181
+ const { catalog: defaultCatalog, catalogs = {} } = this.options;
1182
+ const catalog = this.catalog ? Object.hasOwn(catalogs, this.catalog) ? catalogs[this.catalog] : void 0 : Object.keys(defaultCatalog).length ? defaultCatalog : void 0;
1161
1183
  if (!catalog) {
1162
- throw this.#error("Named catalog not found", {
1163
- name: this.catalog,
1164
- validOptions: this.options.catalogs && Object.keys(this.options.catalogs)
1165
- });
1184
+ throw this.#catalogError(
1185
+ this.catalog ? `Catalog "${this.catalog}" not found for ${this.spec}` : `Default catalog not found for ${this.spec}`
1186
+ );
1166
1187
  }
1167
- const sub = catalog[this.name];
1188
+ const catalogName = this.catalog ? `catalog "${this.catalog}"` : "default catalog";
1189
+ const sub = Object.hasOwn(catalog, this.name) ? catalog[this.name] : void 0;
1168
1190
  if (!sub) {
1169
- throw this.#error("Name not found in catalog", {
1170
- name: this.name,
1171
- validOptions: Object.keys(catalog)
1172
- });
1191
+ throw this.#catalogError(
1192
+ `Package "${this.name}" not found in ${catalogName}`
1193
+ );
1194
+ }
1195
+ if (sub.startsWith("catalog:")) {
1196
+ throw this.#error(
1197
+ `Catalog entry "${this.name}" in ${catalogName} cannot be a catalog: spec`,
1198
+ { code: "ECONFIG", found: sub }
1199
+ );
1173
1200
  }
1174
1201
  this.subspec = _Spec.parse(this.name, sub, this.options);
1175
1202
  this.type = "catalog";
@@ -1485,6 +1512,23 @@ var Spec = class _Spec {
1485
1512
  ].map((p) => `${p}:`)
1486
1513
  });
1487
1514
  }
1515
+ /** ECONFIG error listing defined catalogs & ones defining this dep */
1516
+ #catalogError(message) {
1517
+ const { catalog, catalogs = {} } = this.options;
1518
+ const defined = [
1519
+ ...Object.keys(catalog).length ? [["", catalog]] : [],
1520
+ ...Object.entries(catalogs)
1521
+ ];
1522
+ const validOptions = defined.map(([n]) => `catalog:${n}`);
1523
+ const wanted = defined.filter(
1524
+ ([, c]) => Object.hasOwn(c, this.name) && !!c[this.name]
1525
+ ).map(([n]) => `catalog:${n}`);
1526
+ return this.#error(message, {
1527
+ code: "ECONFIG",
1528
+ ...validOptions.length ? { validOptions } : {},
1529
+ ...wanted.length ? { wanted } : {}
1530
+ });
1531
+ }
1488
1532
  #error(message, extra = {}) {
1489
1533
  return error(message, { spec: this.spec, ...extra }, this.#error);
1490
1534
  }
@@ -2551,6 +2595,7 @@ export {
2551
2595
  gitHostWebsites,
2552
2596
  defaultScopeRegistries,
2553
2597
  getOptions,
2598
+ builtinProtocols,
2554
2599
  isSpec,
2555
2600
  currentDefaultRegistryName,
2556
2601
  Spec,
@@ -9,31 +9,36 @@ globalThis.setInterval = _vlt_setInterval;
9
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
+ import {
13
+ sortScopeLocations
14
+ } from "./chunk-43EJ4Q42.js";
12
15
  import {
13
16
  createDiffFilesProvider
14
17
  } from "./chunk-RIYFGX27.js";
15
18
  import {
16
19
  createHostContextsMap
17
- } from "./chunk-WHLYMMI2.js";
20
+ } from "./chunk-ARE7FKDG.js";
21
+ import {
22
+ actual,
23
+ isRunResult
24
+ } from "./chunk-4UH3KMTD.js";
25
+ import {
26
+ Query
27
+ } from "./chunk-2U4PVHP4.js";
18
28
  import {
19
29
  stderr,
20
30
  stdout,
21
31
  styleTextStdout
22
- } from "./chunk-XDSZO74H.js";
32
+ } from "./chunk-WHWPAYZY.js";
23
33
  import {
24
34
  require_emoji_regex
25
35
  } from "./chunk-VTEFO2FT.js";
26
- import {
27
- Query,
28
- actual,
29
- isRunResult
30
- } from "./chunk-NWHKSRO3.js";
31
36
  import {
32
37
  Monorepo
33
- } from "./chunk-CB65DPZ2.js";
38
+ } from "./chunk-C6ZVVEFV.js";
34
39
  import {
35
40
  isErrorWithCause
36
- } from "./chunk-IBGFQR23.js";
41
+ } from "./chunk-6LZM3I4Q.js";
37
42
  import {
38
43
  error
39
44
  } from "./chunk-WZWDS3W4.js";
@@ -1046,11 +1051,13 @@ var ExecCommand = class {
1046
1051
  this.projectRoot
1047
1052
  );
1048
1053
  let graph;
1054
+ let monorepo;
1049
1055
  if (mainManifest) {
1056
+ monorepo = Monorepo.load(this.projectRoot);
1050
1057
  graph = actual.load({
1051
1058
  ...conf.options,
1052
1059
  mainManifest,
1053
- monorepo: Monorepo.load(this.projectRoot),
1060
+ monorepo,
1054
1061
  loadManifests: false
1055
1062
  });
1056
1063
  }
@@ -1068,7 +1075,7 @@ var ExecCommand = class {
1068
1075
  const { nodes } = await query.search(queryString, {
1069
1076
  signal: new AbortController().signal
1070
1077
  });
1071
- this.#nodes = [];
1078
+ const locations = [];
1072
1079
  for (const node of nodes) {
1073
1080
  const { location } = node.toJSON();
1074
1081
  assert(
@@ -1077,8 +1084,9 @@ var ExecCommand = class {
1077
1084
  found: node
1078
1085
  })
1079
1086
  );
1080
- this.#nodes.push(location);
1087
+ locations.push(location);
1081
1088
  }
1089
+ this.#nodes = sortScopeLocations(locations, monorepo);
1082
1090
  } else if (paths?.length || groups?.length || recursive) {
1083
1091
  this.#defaultIgnoreMissing = true;
1084
1092
  this.#monorepo = Monorepo.load(this.projectRoot, {
@@ -1110,16 +1118,15 @@ var ExecCommand = class {
1110
1118
  return this.noArgsMulti();
1111
1119
  }
1112
1120
  let failed = false;
1113
- const runInDir = async (cwd, label) => {
1114
- const result = await this.bg(this.bgArg(cwd)).catch(
1115
- (er) => {
1116
- if (isErrorWithCause(er) && isRunResult(er.cause)) {
1117
- this.printResult(label, er.cause);
1118
- }
1119
- failed = true;
1120
- throw er;
1121
+ const runInDir = async (cwd, label, signal) => {
1122
+ const arg = { ...this.bgArg(cwd), signal };
1123
+ const result = await this.bg(arg).catch((er) => {
1124
+ if (isErrorWithCause(er) && isRunResult(er.cause)) {
1125
+ this.printResult(label, er.cause);
1121
1126
  }
1122
- );
1127
+ failed = true;
1128
+ throw er;
1129
+ });
1123
1130
  if (!result.command) return null;
1124
1131
  if (!failed) this.printResult(label, result);
1125
1132
  return result;
@@ -1132,7 +1139,7 @@ var ExecCommand = class {
1132
1139
  }
1133
1140
  } else if (this.#monorepo) {
1134
1141
  const wsResultMap = await this.#monorepo.run(
1135
- (ws) => runInDir(ws.fullpath, ws.path)
1142
+ (ws, signal) => runInDir(ws.fullpath, ws.path, signal)
1136
1143
  );
1137
1144
  for (const [ws, result] of wsResultMap) {
1138
1145
  if (result) resultMap.set(ws.path, result);
@@ -11,10 +11,10 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  stderr
14
- } from "./chunk-XDSZO74H.js";
14
+ } from "./chunk-WHWPAYZY.js";
15
15
  import {
16
16
  urlOpen
17
- } from "./chunk-APMYKJI2.js";
17
+ } from "./chunk-QNHBAGXQ.js";
18
18
 
19
19
  // ../../src/cli-sdk/src/open-url.ts
20
20
  var openUrl = async (url) => {
@@ -11,12 +11,14 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  actual,
14
- callLimit,
15
14
  createVirtualRoot
16
- } from "./chunk-NWHKSRO3.js";
15
+ } from "./chunk-4UH3KMTD.js";
16
+ import {
17
+ callLimit
18
+ } from "./chunk-2U4PVHP4.js";
17
19
  import {
18
20
  SecurityArchive
19
- } from "./chunk-XCDLOQZZ.js";
21
+ } from "./chunk-SMXXFQPI.js";
20
22
  import {
21
23
  error
22
24
  } from "./chunk-WZWDS3W4.js";
@@ -140,7 +142,7 @@ var reloadConfig = async (folder) => {
140
142
  unload("project");
141
143
  } catch {
142
144
  }
143
- const { Config } = await import("./config-MVNXGEOQ.js");
145
+ const { Config } = await import("./config-TMB2X6DW.js");
144
146
  return Config.load(folder, process.argv, true);
145
147
  };
146
148