@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
@@ -13,10 +13,10 @@ import {
13
13
  graphRun,
14
14
  graphRunSync,
15
15
  joinDepIDTuple
16
- } from "./chunk-OCJDISSI.js";
16
+ } from "./chunk-3OPNZI6G.js";
17
17
  import {
18
18
  Spec
19
- } from "./chunk-XU5SMHXP.js";
19
+ } from "./chunk-XKVU23NC.js";
20
20
  import {
21
21
  load,
22
22
  parse as parse2,
@@ -41,7 +41,7 @@ import {
41
41
  normalizeManifest,
42
42
  parse,
43
43
  satisfies
44
- } from "./chunk-IITIX4ID.js";
44
+ } from "./chunk-VFBCWAOC.js";
45
45
  import {
46
46
  error
47
47
  } from "./chunk-WZWDS3W4.js";
@@ -1285,7 +1285,7 @@ var range = (a, b, str) => {
1285
1285
  return result;
1286
1286
  };
1287
1287
 
1288
- // ../../node_modules/.vlt/~npm~brace-expansion@5.0.7/node_modules/brace-expansion/dist/esm/index.js
1288
+ // ../../node_modules/.vlt/~npm~brace-expansion@5.0.9/node_modules/brace-expansion/dist/esm/index.js
1289
1289
  var escSlash = "\0SLASH" + Math.random() + "\0";
1290
1290
  var escOpen = "\0OPEN" + Math.random() + "\0";
1291
1291
  var escClose = "\0CLOSE" + Math.random() + "\0";
@@ -1302,6 +1302,7 @@ var closePattern = /\\}/g;
1302
1302
  var commaPattern = /\\,/g;
1303
1303
  var periodPattern = /\\\./g;
1304
1304
  var EXPANSION_MAX = 1e5;
1305
+ var EXPANSION_MAX_LENGTH = 4e6;
1305
1306
  function numeric(str) {
1306
1307
  return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
1307
1308
  }
@@ -1336,11 +1337,11 @@ function expand(str, options = {}) {
1336
1337
  if (!str) {
1337
1338
  return [];
1338
1339
  }
1339
- const { max = EXPANSION_MAX } = options;
1340
+ const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
1340
1341
  if (str.slice(0, 2) === "{}") {
1341
1342
  str = "\\{\\}" + str.slice(2);
1342
1343
  }
1343
- return expand_(escapeBraces(str), max, true).map(unescapeBraces);
1344
+ return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
1344
1345
  }
1345
1346
  function embrace(str) {
1346
1347
  return "{" + str + "}";
@@ -1354,20 +1355,87 @@ function lte(i, y) {
1354
1355
  function gte(i, y) {
1355
1356
  return i >= y;
1356
1357
  }
1357
- function expand_(str, max, isTop) {
1358
- const expansions = [];
1358
+ function combine(acc, pre, values, max, maxLength, dropEmpties) {
1359
+ const out = [];
1360
+ let length = 0;
1361
+ for (let a = 0; a < acc.length; a++) {
1362
+ for (let v = 0; v < values.length; v++) {
1363
+ if (out.length >= max)
1364
+ return out;
1365
+ const expansion = acc[a] + pre + values[v];
1366
+ if (dropEmpties && !expansion)
1367
+ continue;
1368
+ if (length + expansion.length > maxLength)
1369
+ return out;
1370
+ out.push(expansion);
1371
+ length += expansion.length;
1372
+ }
1373
+ }
1374
+ return out;
1375
+ }
1376
+ function expandSequence(body, isAlphaSequence, max, maxLength) {
1377
+ const n = body.split(/\.\./);
1378
+ const N = [];
1379
+ if (n[0] === void 0 || n[1] === void 0) {
1380
+ return N;
1381
+ }
1382
+ const x = numeric(n[0]);
1383
+ const y = numeric(n[1]);
1384
+ const width = Math.max(n[0].length, n[1].length);
1385
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
1386
+ let test = lte;
1387
+ const reverse = y < x;
1388
+ if (reverse) {
1389
+ incr *= -1;
1390
+ test = gte;
1391
+ }
1392
+ const pad = n.some(isPadded);
1393
+ let length = 0;
1394
+ for (let i = x; test(i, y) && N.length < max; i += incr) {
1395
+ let c;
1396
+ if (isAlphaSequence) {
1397
+ c = String.fromCharCode(i);
1398
+ if (c === "\\") {
1399
+ c = "";
1400
+ }
1401
+ } else {
1402
+ c = String(i);
1403
+ if (pad) {
1404
+ const need = width - c.length;
1405
+ if (need > 0) {
1406
+ const z = new Array(need + 1).join("0");
1407
+ if (i < 0) {
1408
+ c = "-" + z + c.slice(1);
1409
+ } else {
1410
+ c = z + c;
1411
+ }
1412
+ }
1413
+ }
1414
+ }
1415
+ if (length + c.length > maxLength)
1416
+ break;
1417
+ N.push(c);
1418
+ length += c.length;
1419
+ }
1420
+ return N;
1421
+ }
1422
+ function expand_(str, max, maxLength, isTop) {
1423
+ let acc = [""];
1424
+ let dropEmpties = false;
1425
+ let firstGroup = true;
1359
1426
  for (; ; ) {
1360
1427
  const m = balanced("{", "}", str);
1361
- if (!m)
1362
- return [str];
1428
+ if (!m) {
1429
+ return combine(acc, str, [""], max, maxLength, dropEmpties);
1430
+ }
1363
1431
  const pre = m.pre;
1364
- if (/\$$/.test(m.pre)) {
1365
- const post2 = m.post.length ? expand_(m.post, max, false) : [""];
1366
- for (let k = 0; k < post2.length && k < max; k++) {
1367
- const expansion = pre + "{" + m.body + "}" + post2[k];
1368
- expansions.push(expansion);
1369
- }
1370
- return expansions;
1432
+ if (/\$$/.test(pre)) {
1433
+ acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
1434
+ firstGroup = false;
1435
+ if (!m.post.length)
1436
+ break;
1437
+ str = m.post;
1438
+ continue;
1371
1439
  }
1372
1440
  const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
1373
1441
  const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
@@ -1379,77 +1447,58 @@ function expand_(str, max, isTop) {
1379
1447
  isTop = true;
1380
1448
  continue;
1381
1449
  }
1382
- return [str];
1450
+ return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
1383
1451
  }
1384
- const post = m.post.length ? expand_(m.post, max, false) : [""];
1385
- let n;
1452
+ if (firstGroup) {
1453
+ dropEmpties = isTop && !isSequence;
1454
+ firstGroup = false;
1455
+ }
1456
+ let values;
1386
1457
  if (isSequence) {
1387
- n = m.body.split(/\.\./);
1458
+ values = expandSequence(m.body, isAlphaSequence, max, maxLength);
1388
1459
  } else {
1389
- n = parseCommaParts(m.body);
1460
+ let n = parseCommaParts(m.body);
1390
1461
  if (n.length === 1 && n[0] !== void 0) {
1391
- n = expand_(n[0], max, false).map(embrace);
1462
+ n = expand_(n[0], max, maxLength, false).map(embrace);
1392
1463
  if (n.length === 1) {
1393
- return post.map((p) => m.pre + n[0] + p);
1464
+ acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
1465
+ if (!m.post.length)
1466
+ break;
1467
+ str = m.post;
1468
+ continue;
1394
1469
  }
1395
1470
  }
1396
- }
1397
- let N;
1398
- if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
1399
- const x = numeric(n[0]);
1400
- const y = numeric(n[1]);
1401
- const width = Math.max(n[0].length, n[1].length);
1402
- let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
1403
- let test = lte;
1404
- const reverse = y < x;
1405
- if (reverse) {
1406
- incr *= -1;
1407
- test = gte;
1408
- }
1409
- const pad = n.some(isPadded);
1410
- N = [];
1411
- for (let i = x; test(i, y) && N.length < max; i += incr) {
1412
- let c;
1413
- if (isAlphaSequence) {
1414
- c = String.fromCharCode(i);
1415
- if (c === "\\") {
1416
- c = "";
1417
- }
1418
- } else {
1419
- c = String(i);
1420
- if (pad) {
1421
- const need = width - c.length;
1422
- if (need > 0) {
1423
- const z = new Array(need + 1).join("0");
1424
- if (i < 0) {
1425
- c = "-" + z + c.slice(1);
1426
- } else {
1427
- c = z + c;
1428
- }
1429
- }
1430
- }
1471
+ let dropsEmpties = dropEmpties && !m.post.length && !pre;
1472
+ for (let d = 0; dropsEmpties && d < acc.length; d++) {
1473
+ if (acc[d]) {
1474
+ dropsEmpties = false;
1431
1475
  }
1432
- N.push(c);
1433
- }
1434
- } else {
1435
- N = [];
1436
- for (let j = 0; j < n.length; j++) {
1437
- N.push.apply(N, expand_(n[j], max, false));
1438
1476
  }
1439
- }
1440
- for (let j = 0; j < N.length; j++) {
1441
- for (let k = 0; k < post.length && expansions.length < max; k++) {
1442
- const expansion = pre + N[j] + post[k];
1443
- if (!isTop || isSequence || expansion) {
1444
- expansions.push(expansion);
1477
+ values = [];
1478
+ let valuesLength = 0;
1479
+ outer: for (let j = 0; j < n.length; j++) {
1480
+ const expanded = expand_(n[j], max, maxLength, false);
1481
+ for (let k = 0; k < expanded.length; k++) {
1482
+ const v = expanded[k];
1483
+ if (dropsEmpties && !v)
1484
+ continue;
1485
+ if (values.length >= max || valuesLength + v.length > maxLength) {
1486
+ break outer;
1487
+ }
1488
+ values.push(v);
1489
+ valuesLength += v.length;
1445
1490
  }
1446
1491
  }
1447
1492
  }
1448
- return expansions;
1493
+ acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
1494
+ if (!m.post.length)
1495
+ break;
1496
+ str = m.post;
1449
1497
  }
1498
+ return acc;
1450
1499
  }
1451
1500
 
1452
- // ../../node_modules/.vlt/~npm~minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
1501
+ // ../../node_modules/.vlt/~npm~minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js
1453
1502
  var MAX_PATTERN_LENGTH = 1024 * 64;
1454
1503
  var assertValidPattern = (pattern) => {
1455
1504
  if (typeof pattern !== "string") {
@@ -1460,7 +1509,7 @@ var assertValidPattern = (pattern) => {
1460
1509
  }
1461
1510
  };
1462
1511
 
1463
- // ../../node_modules/.vlt/~npm~minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js
1512
+ // ../../node_modules/.vlt/~npm~minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js
1464
1513
  var posixClasses = {
1465
1514
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
1466
1515
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -1569,7 +1618,7 @@ var parseClass = (glob, position) => {
1569
1618
  return [comb, uflag, endPos - pos, true];
1570
1619
  };
1571
1620
 
1572
- // ../../node_modules/.vlt/~npm~minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js
1621
+ // ../../node_modules/.vlt/~npm~minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js
1573
1622
  var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
1574
1623
  if (magicalBraces) {
1575
1624
  return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
@@ -1577,7 +1626,7 @@ var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {})
1577
1626
  return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
1578
1627
  };
1579
1628
 
1580
- // ../../node_modules/.vlt/~npm~minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js
1629
+ // ../../node_modules/.vlt/~npm~minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js
1581
1630
  var _a;
1582
1631
  var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
1583
1632
  var isExtglobType = (c) => types.has(c);
@@ -2221,7 +2270,7 @@ var AST = class {
2221
2270
  };
2222
2271
  _a = AST;
2223
2272
 
2224
- // ../../node_modules/.vlt/~npm~minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js
2273
+ // ../../node_modules/.vlt/~npm~minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js
2225
2274
  var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
2226
2275
  if (magicalBraces) {
2227
2276
  return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
@@ -2229,7 +2278,7 @@ var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) =
2229
2278
  return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
2230
2279
  };
2231
2280
 
2232
- // ../../node_modules/.vlt/~npm~minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js
2281
+ // ../../node_modules/.vlt/~npm~minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js
2233
2282
  var minimatch = (p, pattern, options = {}) => {
2234
2283
  assertValidPattern(pattern);
2235
2284
  if (!options.nocomment && pattern.charAt(0) === "#") {
@@ -14,12 +14,12 @@ import {
14
14
  } from "./chunk-RIYFGX27.js";
15
15
  import {
16
16
  createHostContextsMap
17
- } from "./chunk-TMBNGWXK.js";
17
+ } from "./chunk-YRLO236S.js";
18
18
  import {
19
19
  stderr,
20
20
  stdout,
21
21
  styleTextStdout
22
- } from "./chunk-E737X73P.js";
22
+ } from "./chunk-AL42Z2D3.js";
23
23
  import {
24
24
  require_emoji_regex
25
25
  } from "./chunk-VTEFO2FT.js";
@@ -27,13 +27,13 @@ import {
27
27
  Query,
28
28
  actual,
29
29
  isRunResult
30
- } from "./chunk-LZGKX7JI.js";
30
+ } from "./chunk-3NGV7EC6.js";
31
31
  import {
32
32
  Monorepo
33
- } from "./chunk-FFOXTPQA.js";
33
+ } from "./chunk-SVBEF5PK.js";
34
34
  import {
35
35
  isErrorWithCause
36
- } from "./chunk-IITIX4ID.js";
36
+ } from "./chunk-VFBCWAOC.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -990,13 +990,31 @@ var getOptions = (options) => ({
990
990
  ...options["git-host-archives"]
991
991
  } : defaultGitHostArchives
992
992
  });
993
+ var protocolRE = /^([a-zA-Z][a-zA-Z0-9+-]+):/;
994
+ var builtinProtocols = /* @__PURE__ */ new Set([
995
+ "catalog",
996
+ "workspace",
997
+ "registry",
998
+ "file",
999
+ "http",
1000
+ "https",
1001
+ "git",
1002
+ "git+ssh",
1003
+ "git+http",
1004
+ "git+https",
1005
+ "git+file"
1006
+ ]);
1007
+ var unknownProtocol = (str, options) => {
1008
+ const p = protocolRE.exec(str)?.[1];
1009
+ return p === void 0 || builtinProtocols.has(p) || p === options["default-registry-alias"] || options.registries[p] !== void 0 || options["git-hosts"][p] !== void 0 || options["jsr-registries"][p] !== void 0 ? void 0 : p;
1010
+ };
993
1011
  var startsWithSpecIdentifier = (spec, options) => spec.startsWith("/") || spec.startsWith("./") || spec.startsWith("../") || spec.startsWith("file:") || spec.startsWith("http:") || spec.startsWith("https:") || spec.startsWith("workspace:") || spec.startsWith("catalog:") || spec.startsWith("git@") || spec.startsWith("git://") || spec.startsWith("git+ssh://") || spec.startsWith("git+http://") || spec.startsWith("git+https://") || spec.startsWith("git+file://") || spec.startsWith("git@github.com") || spec.startsWith("registry:") || spec.startsWith("npm:") || spec.startsWith("jsr:") || spec.startsWith("gh:") || // anything that starts with a known git host key, or a
994
1012
  // custom registered registry protocol e.g: `github:`, `custom:`
995
1013
  [
996
1014
  ...Object.keys(options["git-hosts"]),
997
1015
  ...Object.keys(options.registries),
998
1016
  ...Object.keys(options["jsr-registries"])
999
- ].some((key) => spec.startsWith(`${key}:`));
1017
+ ].some((key) => spec.startsWith(`${key}:`)) || unknownProtocol(spec, options) !== void 0;
1000
1018
  var findFirstAt = (spec, hasScope) => spec.indexOf("@", hasScope ? 1 : 0);
1001
1019
  var findGitIdentifier = (spec) => spec.indexOf("#") > 2;
1002
1020
  var findFileIdentifier = (spec) => spec.includes("/");
@@ -1117,6 +1135,7 @@ var Spec = class _Spec {
1117
1135
  assertPathSafeName(this.name, this.spec);
1118
1136
  } else {
1119
1137
  this.spec = spec;
1138
+ this.#assertKnownProtocol(spec);
1120
1139
  if (!spec.startsWith("git@") && startsWithSpecIdentifier(spec, this.options) && spec.includes(":") && [
1121
1140
  ...Object.keys(this.options.registries),
1122
1141
  ...Object.keys(defaultRegistries)
@@ -1302,6 +1321,7 @@ var Spec = class _Spec {
1302
1321
  this.spec = `${this.name}@${this.bareSpec}`;
1303
1322
  return;
1304
1323
  }
1324
+ this.#assertKnownProtocol(this.bareSpec);
1305
1325
  if (!this.bareSpec.startsWith("./") && !this.bareSpec.startsWith("../") && this.options["git-hosts"].github) {
1306
1326
  const hash = this.bareSpec.indexOf("#");
1307
1327
  const up = hash === -1 ? this.bareSpec : this.bareSpec.substring(0, hash);
@@ -1449,6 +1469,22 @@ var Spec = class _Spec {
1449
1469
  this.spec = this.name + "@" + this.bareSpec;
1450
1470
  return this.subspec;
1451
1471
  }
1472
+ #assertKnownProtocol(str) {
1473
+ const proto = unknownProtocol(str, this.options);
1474
+ if (proto === void 0) return;
1475
+ throw this.#error(`Protocol ${proto}: is not defined`, {
1476
+ found: `${proto}:`,
1477
+ validOptions: [
1478
+ .../* @__PURE__ */ new Set([
1479
+ ...builtinProtocols,
1480
+ this.options["default-registry-alias"],
1481
+ ...Object.keys(this.options.registries),
1482
+ ...Object.keys(this.options["git-hosts"]),
1483
+ ...Object.keys(this.options["jsr-registries"])
1484
+ ])
1485
+ ].map((p) => `${p}:`)
1486
+ });
1487
+ }
1452
1488
  #error(message, extra = {}) {
1453
1489
  return error(message, { spec: this.spec, ...extra }, this.#error);
1454
1490
  }
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Spec,
14
14
  kCustomInspect
15
- } from "./chunk-IITIX4ID.js";
15
+ } from "./chunk-VFBCWAOC.js";
16
16
 
17
17
  // ../../src/spec/src/index.ts
18
18
  import { homedir } from "node:os";
@@ -13,10 +13,10 @@ import {
13
13
  actual,
14
14
  callLimit,
15
15
  createVirtualRoot
16
- } from "./chunk-LZGKX7JI.js";
16
+ } from "./chunk-3NGV7EC6.js";
17
17
  import {
18
18
  SecurityArchive
19
- } from "./chunk-5B23EKN4.js";
19
+ } from "./chunk-ED2DDTQT.js";
20
20
  import {
21
21
  error
22
22
  } from "./chunk-WZWDS3W4.js";
@@ -115,7 +115,7 @@ var reloadConfig = async (folder) => {
115
115
  unload("project");
116
116
  } catch {
117
117
  }
118
- const { Config } = await import("./config-LL3RLMZG.js");
118
+ const { Config } = await import("./config-YEEKT7WH.js");
119
119
  return Config.load(folder, process.argv, true);
120
120
  };
121
121
 
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Qn,
14
14
  require_lib
15
- } from "./chunk-FWKQ7YDF.js";
15
+ } from "./chunk-ZWKI5OSF.js";
16
16
  import {
17
17
  Monorepo,
18
18
  PackageJson,
@@ -20,16 +20,16 @@ import {
20
20
  pickManifest,
21
21
  resolve,
22
22
  revs
23
- } from "./chunk-FFOXTPQA.js";
23
+ } from "./chunk-SVBEF5PK.js";
24
24
  import {
25
25
  Spec
26
- } from "./chunk-XU5SMHXP.js";
26
+ } from "./chunk-XKVU23NC.js";
27
27
  import {
28
28
  XDG
29
29
  } from "./chunk-XNLSTHDK.js";
30
30
  import {
31
31
  asPackument
32
- } from "./chunk-IITIX4ID.js";
32
+ } from "./chunk-VFBCWAOC.js";
33
33
  import {
34
34
  error
35
35
  } from "./chunk-WZWDS3W4.js";
@@ -111,7 +111,7 @@ var PackageInfoClient = class {
111
111
  #tarPoolPromise;
112
112
  async getRegistryClient() {
113
113
  if (this.#registryClient) return this.#registryClient;
114
- this.#registryClientPromise ??= import("./src-6OKPBJJT.js").then(({ RegistryClient }) => {
114
+ this.#registryClientPromise ??= import("./src-B4IYFLHG.js").then(({ RegistryClient }) => {
115
115
  this.#registryClient = new RegistryClient(this.options);
116
116
  return this.#registryClient;
117
117
  });
@@ -119,7 +119,7 @@ var PackageInfoClient = class {
119
119
  }
120
120
  async getTarPool() {
121
121
  if (this.#tarPool) return this.#tarPool;
122
- this.#tarPoolPromise ??= import("./src-M5RRGKUM.js").then(
122
+ this.#tarPoolPromise ??= import("./src-U4EBFPPT.js").then(
123
123
  ({ Pool }) => {
124
124
  this.#tarPool = new Pool();
125
125
  return this.#tarPool;
@@ -0,0 +1,75 @@
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
+ error
14
+ } from "./chunk-WZWDS3W4.js";
15
+ import {
16
+ __glob
17
+ } from "./chunk-PZLD7RTK.js";
18
+
19
+ // import("./commands/**/*.ts") in ../../src/cli-sdk/src/load-command.ts
20
+ var globImport_commands_ts = __glob({
21
+ "./commands/access.ts": () => import("./access-AFFG4IBZ.js"),
22
+ "./commands/bugs.ts": () => import("./bugs-MCLLEJJP.js"),
23
+ "./commands/build.ts": () => import("./build-TKUT6V2P.js"),
24
+ "./commands/cache.ts": () => import("./cache-O464JQI4.js"),
25
+ "./commands/ci.ts": () => import("./ci-GPZGE4SU.js"),
26
+ "./commands/config.ts": () => import("./config-WDCFW5X7.js"),
27
+ "./commands/create.ts": () => import("./create-TVVUUIUZ.js"),
28
+ "./commands/deprecate.ts": () => import("./deprecate-AH4LOHMI.js"),
29
+ "./commands/dist-tag.ts": () => import("./dist-tag-4R6YHSZ7.js"),
30
+ "./commands/docs.ts": () => import("./docs-7MHXAHGG.js"),
31
+ "./commands/exec-cache.ts": () => import("./exec-cache-VYVXFKA2.js"),
32
+ "./commands/exec-local.ts": () => import("./exec-local-MXYOC2AY.js"),
33
+ "./commands/exec.ts": () => import("./exec-FRQOPS5C.js"),
34
+ "./commands/help.ts": () => import("./help-J5CYJ7BO.js"),
35
+ "./commands/init.ts": () => import("./init-7D5MFAP5.js"),
36
+ "./commands/install.ts": () => import("./install-T34U5HPS.js"),
37
+ "./commands/install/reporter.ts": () => import("./reporter-Y7RMSVN4.js"),
38
+ "./commands/list.ts": () => import("./list-C2LX6EIY.js"),
39
+ "./commands/login.ts": () => import("./login-6JP7WTRM.js"),
40
+ "./commands/logout.ts": () => import("./logout-JYOBUHP3.js"),
41
+ "./commands/pack.ts": () => import("./pack-ON6BK2AI.js"),
42
+ "./commands/ping.ts": () => import("./ping-GUNQJ53P.js"),
43
+ "./commands/pkg.ts": () => import("./pkg-GIH3WMUK.js"),
44
+ "./commands/profile.ts": () => import("./profile-IEIZFNOD.js"),
45
+ "./commands/publish.ts": () => import("./publish-VTRA3MIS.js"),
46
+ "./commands/query.ts": () => import("./query-KEXYDRHP.js"),
47
+ "./commands/registry.ts": () => import("./registry-43SSGAPE.js"),
48
+ "./commands/repo.ts": () => import("./repo-LI5FOP3N.js"),
49
+ "./commands/run-exec.ts": () => import("./run-exec-CLCZ47NU.js"),
50
+ "./commands/run.ts": () => import("./run-LEWQVDWO.js"),
51
+ "./commands/setup.ts": () => import("./setup-MPG4UQPT.js"),
52
+ "./commands/token.ts": () => import("./token-UD4AF4I7.js"),
53
+ "./commands/uninstall.ts": () => import("./uninstall-MSKFXGAO.js"),
54
+ "./commands/unpublish.ts": () => import("./unpublish-2RNLXZWP.js"),
55
+ "./commands/update.ts": () => import("./update-3HXQLP34.js"),
56
+ "./commands/version.ts": () => import("./version-RBLKW6BQ.js"),
57
+ "./commands/view.ts": () => import("./view-3XTRGRGJ.js"),
58
+ "./commands/whoami.ts": () => import("./whoami-WSXDPFSQ.js")
59
+ });
60
+
61
+ // ../../src/cli-sdk/src/load-command.ts
62
+ var loadCommand = async (command) => {
63
+ try {
64
+ return await globImport_commands_ts(`./commands/${command}.ts`);
65
+ } catch (e) {
66
+ throw error("Could not load command", {
67
+ found: command,
68
+ cause: e
69
+ });
70
+ }
71
+ };
72
+
73
+ export {
74
+ loadCommand
75
+ };