@vltpkg/cli-js 1.3.7 → 1.4.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 (87) hide show
  1. package/{access-4W6PMOGC.js → access-422UGEWN.js} +8 -8
  2. package/{bugs-FJHQFPZF.js → bugs-RED7Y33Q.js} +17 -17
  3. package/{build-SPWU3NOH.js → build-IHMPBWRO.js} +9 -9
  4. package/{cache-SBNEPOMQ.js → cache-FJP2RZJX.js} +31 -19
  5. package/cache-unzip-src-unzip.js +21 -1
  6. package/{chunk-SPWJ3X5Y.js → chunk-2AMOC4DN.js} +4 -4
  7. package/{chunk-QYS5MGGM.js → chunk-4UCADW6S.js} +86 -10
  8. package/{chunk-GZ5MYMBT.js → chunk-5IJTPZXP.js} +1 -1
  9. package/{chunk-L3K2ZAOO.js → chunk-5RHABCYI.js} +76 -11
  10. package/{chunk-OWUICQFY.js → chunk-5TNXLRW2.js} +33 -20
  11. package/{chunk-IHXJVKAE.js → chunk-5Y4SYLJ2.js} +2 -1
  12. package/chunk-6IF3RJND.js +81 -0
  13. package/{chunk-3U6QWN62.js → chunk-7T3XAYP4.js} +1 -1
  14. package/{chunk-FKZ5I53D.js → chunk-ASLX43R3.js} +3 -3
  15. package/{chunk-5ZCDGBVU.js → chunk-C23TDXRG.js} +1 -1
  16. package/{chunk-H77JYU7F.js → chunk-DNRR3XMG.js} +12 -3
  17. package/{chunk-IBGFQR23.js → chunk-FLH4YC6W.js} +21 -0
  18. package/{chunk-XDSZO74H.js → chunk-FZUYGJZU.js} +7 -7
  19. package/{chunk-W2ZO5RZL.js → chunk-GIIAODRI.js} +4 -4
  20. package/{chunk-F5D3DVC5.js → chunk-HZXJ423P.js} +7 -3
  21. package/{chunk-CB65DPZ2.js → chunk-I7UMHYZX.js} +151 -27
  22. package/{chunk-2M2O6A4R.js → chunk-ISE4IRHF.js} +4 -4
  23. package/{chunk-TLY4VGMH.js → chunk-LHPEBLOU.js} +1 -1
  24. package/{chunk-EL4GVZK5.js → chunk-MKWPTN3C.js} +2 -2
  25. package/{chunk-QVPNKMUU.js → chunk-OAJ3PO3Z.js} +115 -19
  26. package/{chunk-7BHHCB5C.js → chunk-OVPHE4O7.js} +348 -24
  27. package/{chunk-KOFQTETH.js → chunk-PHJJPY5G.js} +3 -3
  28. package/{chunk-SV4WK3KX.js → chunk-PLG3OYCX.js} +2 -2
  29. package/{chunk-KMOOTBHM.js → chunk-QCSUWACA.js} +1 -1
  30. package/{chunk-6D54UN4T.js → chunk-SR2VOY5J.js} +1 -1
  31. package/chunk-T6FBP4OU.js +76 -0
  32. package/{chunk-A2TSRXZD.js → chunk-THSYN5EK.js} +1 -1
  33. package/{chunk-3D3IB4YN.js → chunk-TO23PR7J.js} +61 -27
  34. package/{chunk-OWMR2EDW.js → chunk-TPRK6IDA.js} +1 -1
  35. package/chunk-UGCKF5ZE.js +57 -0
  36. package/{chunk-SE2FSMBR.js → chunk-WF6KLKRN.js} +26 -10
  37. package/{chunk-I7SCSGUO.js → chunk-X4FVR4R5.js} +23 -18
  38. package/{chunk-VBDNOU76.js → chunk-ZJMJ7MCT.js} +1 -1
  39. package/{ci-76TAJGF5.js → ci-YSKNNO5M.js} +10 -10
  40. package/cli-package.json +1 -1
  41. package/{config-3UQXAYAA.js → config-CSPCDMR3.js} +9 -8
  42. package/{config-AFIHF54I.js → config-HO7GY3QT.js} +11 -10
  43. package/{create-5ADQTH6K.js → create-2TJT3AHJ.js} +19 -18
  44. package/{deprecate-RTQVLJDZ.js → deprecate-7FRJI2RL.js} +11 -11
  45. package/{dist-tag-V4DRDHWA.js → dist-tag-WCFF5OEG.js} +8 -8
  46. package/{docs-RRULRTKQ.js → docs-JMBPTU23.js} +17 -17
  47. package/{exec-NXQUCX3I.js → exec-FBOUKZZ2.js} +27 -18
  48. package/{exec-cache-KVZJHFZD.js → exec-cache-X3ZWM5S3.js} +16 -16
  49. package/{exec-local-53B5IRKG.js → exec-local-Y3KQC22N.js} +16 -15
  50. package/{help-EN4XUTMS.js → help-PUKVH5X7.js} +4 -4
  51. package/{init-4L6CQMIL.js → init-GOKAQXXZ.js} +10 -10
  52. package/{install-MHWLYW3X.js → install-XFN4UFOC.js} +116 -16
  53. package/{list-XZRF7TBW.js → list-43JFFG5D.js} +19 -19
  54. package/{login-6GRRY4H7.js → login-RSTZKNKN.js} +13 -12
  55. package/{logout-KI2AOYRT.js → logout-4576FFXZ.js} +8 -8
  56. package/{outdated-TWUPFRCD.js → outdated-ACQ5A2Y7.js} +31 -29
  57. package/{pack-2ZQLDYFD.js → pack-QQVJ3G25.js} +15 -12
  58. package/package.json +1 -1
  59. package/{ping-ZOTGLOKY.js → ping-QCDQQRO5.js} +8 -8
  60. package/{pkg-HRNOTFXB.js → pkg-CSOJV7UC.js} +17 -12
  61. package/{profile-5V3FFDMG.js → profile-VL4HPW3N.js} +8 -8
  62. package/{publish-7ZXEMWTW.js → publish-2YBO6ZXE.js} +23 -18
  63. package/{query-62UDNMGR.js → query-IHHFMJRT.js} +19 -19
  64. package/{registry-MQJJCWJY.js → registry-W7BRZZZ2.js} +5 -5
  65. package/registry-client-src-revalidate.js +132 -17
  66. package/{repo-HDUGP5PH.js → repo-L3BXAAWS.js} +17 -17
  67. package/{reporter-TGBPLNR5.js → reporter-5NYOHBO7.js} +11 -10
  68. package/{run-6NRDZD4T.js → run-AMUUVLTI.js} +16 -15
  69. package/{run-exec-I4IIXTLW.js → run-exec-5W3XWQZA.js} +16 -15
  70. package/security-archive-src-update-expired.js +46 -12
  71. package/{setup-UVXEFUUJ.js → setup-TFM4GJF7.js} +16 -15
  72. package/{src-QEJ6WZQ7.js → src-4CYCUWZL.js} +29 -24
  73. package/{src-6CJEMSVB.js → src-I3GMULFP.js} +6 -4
  74. package/{src-GP7VLT7P.js → src-LUTN2ODD.js} +58 -9
  75. package/{token-WTN27E7A.js → token-OANOBE3G.js} +8 -8
  76. package/{uninstall-ZJOKXIVQ.js → uninstall-YXTQ4AIZ.js} +12 -12
  77. package/{unpublish-LMUGR7GI.js → unpublish-SZXYMYIU.js} +8 -8
  78. package/{update-WVWMRUYY.js → update-FHLMWGIM.js} +26 -16
  79. package/{version-OJTRHNKV.js → version-ZWFCTU5V.js} +16 -11
  80. package/{view-6Q5B7ZYN.js → view-NFNJXMLV.js} +73 -25
  81. package/vlr.js +1 -1
  82. package/vlrx.js +1 -1
  83. package/vlt.js +1 -1
  84. package/vlx.js +1 -1
  85. package/vlxl.js +1 -1
  86. package/{whoami-SPF34TV6.js → whoami-O7GOSGCI.js} +8 -8
  87. package/chunk-A6FAI65V.js +0 -76
@@ -11,12 +11,12 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Spec as Spec2
14
- } from "./chunk-GZ5MYMBT.js";
14
+ } from "./chunk-5IJTPZXP.js";
15
15
  import {
16
16
  Spec,
17
17
  currentDefaultRegistryName,
18
18
  defaultRegistryName
19
- } from "./chunk-IBGFQR23.js";
19
+ } from "./chunk-FLH4YC6W.js";
20
20
  import {
21
21
  error
22
22
  } from "./chunk-WZWDS3W4.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-WGDTG44V.js";
15
15
  import {
16
16
  commandAliases
17
- } from "./chunk-SE2FSMBR.js";
17
+ } from "./chunk-WF6KLKRN.js";
18
18
 
19
19
  // ../../node_modules/.vlt/~npm~package-json-from-dist@1.0.1/node_modules/package-json-from-dist/dist/esm/index.js
20
20
  import { readFileSync } from "node:fs";
@@ -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-FLH4YC6W.js";
16
16
  import {
17
17
  error
18
18
  } from "./chunk-WZWDS3W4.js";
@@ -0,0 +1,76 @@
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-422UGEWN.js"),
22
+ "./commands/bugs.ts": () => import("./bugs-RED7Y33Q.js"),
23
+ "./commands/build.ts": () => import("./build-IHMPBWRO.js"),
24
+ "./commands/cache.ts": () => import("./cache-FJP2RZJX.js"),
25
+ "./commands/ci.ts": () => import("./ci-YSKNNO5M.js"),
26
+ "./commands/config.ts": () => import("./config-HO7GY3QT.js"),
27
+ "./commands/create.ts": () => import("./create-2TJT3AHJ.js"),
28
+ "./commands/deprecate.ts": () => import("./deprecate-7FRJI2RL.js"),
29
+ "./commands/dist-tag.ts": () => import("./dist-tag-WCFF5OEG.js"),
30
+ "./commands/docs.ts": () => import("./docs-JMBPTU23.js"),
31
+ "./commands/exec-cache.ts": () => import("./exec-cache-X3ZWM5S3.js"),
32
+ "./commands/exec-local.ts": () => import("./exec-local-Y3KQC22N.js"),
33
+ "./commands/exec.ts": () => import("./exec-FBOUKZZ2.js"),
34
+ "./commands/help.ts": () => import("./help-PUKVH5X7.js"),
35
+ "./commands/init.ts": () => import("./init-GOKAQXXZ.js"),
36
+ "./commands/install.ts": () => import("./install-XFN4UFOC.js"),
37
+ "./commands/install/reporter.ts": () => import("./reporter-5NYOHBO7.js"),
38
+ "./commands/list.ts": () => import("./list-43JFFG5D.js"),
39
+ "./commands/login.ts": () => import("./login-RSTZKNKN.js"),
40
+ "./commands/logout.ts": () => import("./logout-4576FFXZ.js"),
41
+ "./commands/outdated.ts": () => import("./outdated-ACQ5A2Y7.js"),
42
+ "./commands/pack.ts": () => import("./pack-QQVJ3G25.js"),
43
+ "./commands/ping.ts": () => import("./ping-QCDQQRO5.js"),
44
+ "./commands/pkg.ts": () => import("./pkg-CSOJV7UC.js"),
45
+ "./commands/profile.ts": () => import("./profile-VL4HPW3N.js"),
46
+ "./commands/publish.ts": () => import("./publish-2YBO6ZXE.js"),
47
+ "./commands/query.ts": () => import("./query-IHHFMJRT.js"),
48
+ "./commands/registry.ts": () => import("./registry-W7BRZZZ2.js"),
49
+ "./commands/repo.ts": () => import("./repo-L3BXAAWS.js"),
50
+ "./commands/run-exec.ts": () => import("./run-exec-5W3XWQZA.js"),
51
+ "./commands/run.ts": () => import("./run-AMUUVLTI.js"),
52
+ "./commands/setup.ts": () => import("./setup-TFM4GJF7.js"),
53
+ "./commands/token.ts": () => import("./token-OANOBE3G.js"),
54
+ "./commands/uninstall.ts": () => import("./uninstall-YXTQ4AIZ.js"),
55
+ "./commands/unpublish.ts": () => import("./unpublish-SZXYMYIU.js"),
56
+ "./commands/update.ts": () => import("./update-FHLMWGIM.js"),
57
+ "./commands/version.ts": () => import("./version-ZWFCTU5V.js"),
58
+ "./commands/view.ts": () => import("./view-NFNJXMLV.js"),
59
+ "./commands/whoami.ts": () => import("./whoami-O7GOSGCI.js")
60
+ });
61
+
62
+ // ../../src/cli-sdk/src/load-command.ts
63
+ var loadCommand = async (command) => {
64
+ try {
65
+ return await globImport_commands_ts(`./commands/${command}.ts`);
66
+ } catch (e) {
67
+ throw error("Could not load command", {
68
+ found: command,
69
+ cause: e
70
+ });
71
+ }
72
+ };
73
+
74
+ export {
75
+ loadCommand
76
+ };
@@ -14,7 +14,7 @@ import {
14
14
  defaultRegistryName,
15
15
  isErrorWithCause,
16
16
  isObject
17
- } from "./chunk-IBGFQR23.js";
17
+ } from "./chunk-FLH4YC6W.js";
18
18
  import {
19
19
  error
20
20
  } from "./chunk-WZWDS3W4.js";
@@ -19,15 +19,15 @@ import {
19
19
  pickManifest,
20
20
  resolve,
21
21
  revs
22
- } from "./chunk-CB65DPZ2.js";
22
+ } from "./chunk-I7UMHYZX.js";
23
23
  import {
24
24
  Spec
25
- } from "./chunk-GZ5MYMBT.js";
25
+ } from "./chunk-5IJTPZXP.js";
26
26
  import {
27
27
  registryErrorMessage,
28
28
  storeRoot,
29
29
  tokenRefusalAdvice
30
- } from "./chunk-6D54UN4T.js";
30
+ } from "./chunk-SR2VOY5J.js";
31
31
  import {
32
32
  logRequest
33
33
  } from "./chunk-U7TEQCBN.js";
@@ -39,7 +39,7 @@ import {
39
39
  brotliTarballUrl,
40
40
  integrityHex,
41
41
  tarballFormat
42
- } from "./chunk-IBGFQR23.js";
42
+ } from "./chunk-FLH4YC6W.js";
43
43
  import {
44
44
  error
45
45
  } from "./chunk-WZWDS3W4.js";
@@ -226,7 +226,12 @@ var isStableSelector = (f) => {
226
226
  if (!range) return false;
227
227
  return !range.isAny && !range.raw.includes("-");
228
228
  };
229
- var storeLinkers = /* @__PURE__ */ new Set(["auto", "hardlink", "copy"]);
229
+ var storeLinkers = /* @__PURE__ */ new Set([
230
+ "auto",
231
+ "hardlink",
232
+ "clone",
233
+ "copy"
234
+ ]);
230
235
  var storedIntegrity = (response) => !response.fromCache ? response.integrityActual : !response.contentType ? void 0 : response.integrity ?? (response.isGzip ? response.integrityActual : void 0);
231
236
  var PackageInfoClient = class {
232
237
  #registryClient;
@@ -243,18 +248,19 @@ var PackageInfoClient = class {
243
248
  #cachePath;
244
249
  #storeRoot;
245
250
  #storeLinker;
246
- #storeHits = { link: 0, copy: 0 };
251
+ #storeHits = { link: 0, clone: 0, copy: 0 };
247
252
  #storeMisses = 0;
248
253
  #storeHitRateLogged = false;
249
254
  #logStoreHitRate = () => {
250
- const { link, copy } = this.#storeHits;
251
- const n = Math.max(1, link + copy + this.#storeMisses);
255
+ const { link, clone: clone2, copy } = this.#storeHits;
256
+ const n = Math.max(1, link + clone2 + copy + this.#storeMisses);
252
257
  debug(
253
- "global store: linked=%d copied=%d missed=%d hit rate=%s%%",
258
+ "global store: linked=%d cloned=%d copied=%d missed=%d hit rate=%s%%",
254
259
  link,
260
+ clone2,
255
261
  copy,
256
262
  this.#storeMisses,
257
- ((link + copy) / n * 100).toFixed(1)
263
+ ((link + clone2 + copy) / n * 100).toFixed(1)
258
264
  );
259
265
  };
260
266
  // In-flight coalescing key is `${registry}${name}` — no representation
@@ -299,9 +305,38 @@ var PackageInfoClient = class {
299
305
  #resolveWaiters = /* @__PURE__ */ new Map();
300
306
  #registryClientPromise;
301
307
  #tarPoolPromise;
308
+ // fire-and-forget work, settled by drain()
309
+ #background = /* @__PURE__ */ new Set();
310
+ #inBackground(p) {
311
+ const done = () => {
312
+ this.#background.delete(tracked);
313
+ };
314
+ const tracked = p.then(done, done);
315
+ this.#background.add(tracked);
316
+ }
317
+ /**
318
+ * Wind the client down: abort open resolve streams, settle background
319
+ * work (manifest cache writes, capabilities, hedges), drain the registry
320
+ * client (in-flight requests, cache writes). Await before removing the
321
+ * cache dir or exiting.
322
+ */
323
+ async drain() {
324
+ for (const [sent, owner] of this.#resolveOwners) {
325
+ this.#resolveOwners.delete(sent);
326
+ this.#resolveSent.delete(sent);
327
+ owner.controller.abort();
328
+ }
329
+ while (this.#background.size) {
330
+ await Promise.all(this.#background);
331
+ }
332
+ if (this.#registryClientPromise) {
333
+ await (await this.#registryClientPromise).drain();
334
+ }
335
+ if (this.#background.size) await this.drain();
336
+ }
302
337
  async getRegistryClient() {
303
338
  if (this.#registryClient) return this.#registryClient;
304
- this.#registryClientPromise ??= import("./src-6CJEMSVB.js").then(({ RegistryClient }) => {
339
+ this.#registryClientPromise ??= import("./src-I3GMULFP.js").then(({ RegistryClient }) => {
305
340
  this.#registryClient = new RegistryClient(this.options);
306
341
  return this.#registryClient;
307
342
  });
@@ -332,8 +367,7 @@ var PackageInfoClient = class {
332
367
  if (!registry || !isStableSelector(f)) return false;
333
368
  const client = this.#registryClient;
334
369
  if (!client) {
335
- void this.capabilities(registry).catch(() => {
336
- });
370
+ this.#inBackground(this.capabilities(registry));
337
371
  return true;
338
372
  }
339
373
  const caps = peekCapabilities(client, registry);
@@ -341,7 +375,7 @@ var PackageInfoClient = class {
341
375
  }
342
376
  async getTarPool() {
343
377
  if (this.#tarPool) return this.#tarPool;
344
- this.#tarPoolPromise ??= import("./src-GP7VLT7P.js").then(
378
+ this.#tarPoolPromise ??= import("./src-LUTN2ODD.js").then(
345
379
  ({ Pool }) => {
346
380
  this.#tarPool = new Pool();
347
381
  return this.#tarPool;
@@ -379,10 +413,6 @@ var PackageInfoClient = class {
379
413
  this.#storeRoot = options.storeRoot ?? storeRoot(this.#cachePath);
380
414
  const linker = options["store-linker"];
381
415
  this.#storeLinker = linker && storeLinkers.has(linker) ? linker : "unpack";
382
- void mkdir(pathResolve(this.#cachePath, "package-info"), {
383
- recursive: true
384
- }).catch(() => {
385
- });
386
416
  }
387
417
  async extract(spec, target, options = {}) {
388
418
  if (typeof spec === "string")
@@ -438,6 +468,7 @@ var PackageInfoClient = class {
438
468
  const format = tarballFormat(r.resolved);
439
469
  const storeOn = f.type === "registry" && this.#storeLinker !== "unpack";
440
470
  const copy = this.#storeLinker === "copy";
471
+ const clone2 = this.#storeLinker === "clone";
441
472
  const hex = !storeOn ? void 0 : r.integrity ? integrityHex(r.integrity) : integrityHex(
442
473
  (await this.getRegistryClient()).cachedIntegrity(
443
474
  r.resolved
@@ -451,12 +482,12 @@ var PackageInfoClient = class {
451
482
  const linked = await pool.linkFromStore(
452
483
  pathResolve(this.#storeRoot, hex),
453
484
  target,
454
- { copy }
485
+ { copy, clone: clone2 }
455
486
  );
456
487
  if (linked) {
457
488
  const { how, index } = linked;
458
489
  this.#storeHits[how]++;
459
- logRequest(r.resolved, how === "link" ? "store" : "cache");
490
+ logRequest(r.resolved, how === "copy" ? "cache" : "store");
460
491
  return {
461
492
  ...r,
462
493
  manifest: index.manifest,
@@ -560,7 +591,7 @@ var PackageInfoClient = class {
560
591
  }
561
592
  case "remote": {
562
593
  const rc = await this.getRegistryClient();
563
- const { CacheEntry: Entry, cacheKey } = await import("./src-6CJEMSVB.js");
594
+ const { CacheEntry: Entry, cacheKey } = await import("./src-I3GMULFP.js");
564
595
  const key = cacheKey("GET", new URL(r.resolved));
565
596
  const unzipped = (entry) => {
566
597
  try {
@@ -934,6 +965,7 @@ var PackageInfoClient = class {
934
965
  inflight
935
966
  );
936
967
  inflight.requests.add(promise);
968
+ this.#inBackground(promise);
937
969
  const clear = () => {
938
970
  inflight.requests.delete(promise);
939
971
  if (this.#resolveOwners.get(sent) === owner)
@@ -1034,6 +1066,7 @@ var PackageInfoClient = class {
1034
1066
  if (early !== graceOver) return early ?? await fetch();
1035
1067
  debug("resolve hedge %s", key);
1036
1068
  const hedge = fetch();
1069
+ this.#inBackground(hedge);
1037
1070
  const outcome = await Promise.race([
1038
1071
  arrival,
1039
1072
  settled,
@@ -1080,8 +1113,7 @@ var PackageInfoClient = class {
1080
1113
  const json = JSON.parse(cached);
1081
1114
  if (st.mtimeMs < this.#manifestCacheMinAge || json.__VLT_MANIFEST_CACHE_TIMESTAMP !== void 0) {
1082
1115
  this.#manifestWritePaths.delete(cachePath);
1083
- void unlink(cachePath).catch(() => {
1084
- });
1116
+ this.#inBackground(unlink(cachePath));
1085
1117
  throw new Error("manifest cache expired");
1086
1118
  }
1087
1119
  if (json.__VLT_PACKUMENT) {
@@ -1104,10 +1136,12 @@ var PackageInfoClient = class {
1104
1136
  const vlt = this.#vltPackuments.has(
1105
1137
  `${f.registry}${f.name}`
1106
1138
  );
1107
- void this.#writeManifestCache(
1108
- cachePath,
1109
- JSON.stringify(
1110
- vlt ? { ...mani, __VLT_PACKUMENT: true } : mani
1139
+ this.#inBackground(
1140
+ this.#writeManifestCache(
1141
+ cachePath,
1142
+ JSON.stringify(
1143
+ vlt ? { ...mani, __VLT_PACKUMENT: true } : mani
1144
+ )
1111
1145
  )
1112
1146
  );
1113
1147
  }
@@ -11,7 +11,7 @@ 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-FZUYGJZU.js";
15
15
  import {
16
16
  urlOpen
17
17
  } from "./chunk-APMYKJI2.js";
@@ -0,0 +1,57 @@
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
+ graphRunSync
14
+ } from "./chunk-PLG3OYCX.js";
15
+
16
+ // ../../src/cli-sdk/src/sort-scope-locations.ts
17
+ import { resolve } from "node:path";
18
+ var sortScopeLocations = (locations, monorepo) => {
19
+ if (!monorepo || locations.length < 2) return locations;
20
+ const wsAt = (loc) => monorepo.get(resolve(monorepo.projectRoot, loc));
21
+ const slots = locations.map((loc) => [loc, wsAt(loc)]);
22
+ const locOf = /* @__PURE__ */ new Map();
23
+ for (const [loc, ws] of slots) {
24
+ if (ws && !locOf.has(ws)) locOf.set(ws, loc);
25
+ }
26
+ const [first, ...rest] = locOf.keys();
27
+ if (!first || !rest.length) return locations;
28
+ const getDeps = (ws) => {
29
+ const found = [];
30
+ const seen = /* @__PURE__ */ new Set([ws]);
31
+ const queue = monorepo.getDeps(ws);
32
+ for (const dep of queue) {
33
+ if (seen.has(dep)) continue;
34
+ seen.add(dep);
35
+ if (locOf.has(dep)) found.push(dep);
36
+ else queue.push(...monorepo.getDeps(dep));
37
+ }
38
+ return found;
39
+ };
40
+ const sorted = graphRunSync({
41
+ graph: [first, ...rest],
42
+ getDeps,
43
+ visit: () => {
44
+ }
45
+ }).keys();
46
+ const placed = /* @__PURE__ */ new Set();
47
+ return slots.map(([loc, ws]) => {
48
+ if (!ws || placed.has(ws)) return loc;
49
+ placed.add(ws);
50
+ const next = sorted.next().value;
51
+ return (next && locOf.get(next)) ?? loc;
52
+ });
53
+ };
54
+
55
+ export {
56
+ sortScopeLocations
57
+ };
@@ -1168,6 +1168,7 @@ var isRecordField = (s) => recordFields.includes(s);
1168
1168
  var storeLinkers = [
1169
1169
  "auto",
1170
1170
  "hardlink",
1171
+ "clone",
1171
1172
  "copy",
1172
1173
  "unpack"
1173
1174
  ];
@@ -1275,8 +1276,11 @@ var definition = j2.heading("Configuration").description(
1275
1276
 
1276
1277
  There is **no** built-in \`npm\` registry URL; the \`npm\`
1277
1278
  alias must be configured (e.g. via \`vlt setup\`) before it
1278
- can be used. The \`gh\` and \`jsr\` aliases have built-in
1279
- defaults that can be overridden here.
1279
+ can be used. The \`gh\` alias has a built-in default
1280
+ that can be overridden here. A name used by
1281
+ \`--jsr-registries\` or \`--git-hosts\` (e.g. \`jsr\`,
1282
+ \`github\`), or a built-in protocol (e.g. \`file\`), is
1283
+ an error.
1280
1284
 
1281
1285
  Aliases given on the command line or in
1282
1286
  \`VLT_REGISTRIES\` (newline-delimited) merge with the
@@ -1365,28 +1369,35 @@ var definition = j2.heading("Configuration").description(
1365
1369
  default: cacheDir
1366
1370
  },
1367
1371
  "store-linker": {
1368
- hint: "auto | hardlink | copy | unpack",
1372
+ hint: "auto | hardlink | clone | copy | unpack",
1369
1373
  description: `How packages are placed in \`node_modules\`. Every
1370
1374
  linker but \`unpack\` fills a global store under
1371
1375
  \`cache\` in the background, then places packages
1372
1376
  from it.
1373
1377
 
1374
1378
  - auto: Default. On Linux, hardlink from the global
1375
- store, copying any file that cannot be linked.
1376
- Elsewhere, same as \`unpack\`: a hardlink is the
1377
- slowest way to place a file on APFS, so macOS and
1378
- Windows unpack by default.
1379
+ store, copying any file that cannot be linked. On
1380
+ macOS, clone from it, on a Node with \`node:ffi\`
1381
+ (26.1 and later, and \`--allow-ffi\` under
1382
+ \`--permission\`); a hardlink is the slowest way
1383
+ to place a file on APFS, so macOS without it, and
1384
+ Windows, unpack by default.
1379
1385
  - hardlink: Hardlink from the global store on every
1380
1386
  platform.
1387
+ - clone: Clone each package directory from the
1388
+ global store copy-on-write (\`clonefile\`, macOS
1389
+ on APFS). Files share storage with the store
1390
+ until edited, so editing in place is safe.
1391
+ Unpacks where cloning fails.
1381
1392
  - copy: Copy from the global store. Use this when
1382
1393
  editing files in \`node_modules\` in place, since
1383
1394
  a hardlink shares its content with every project.
1384
1395
  - unpack: Unpack each package tarball, skipping the
1385
1396
  global store.
1386
1397
 
1387
- A package is copied right before its install
1388
- scripts run, so they don't change its files in the
1389
- store.
1398
+ A hardlinked package is copied right before its
1399
+ install scripts run, so they don't change its files
1400
+ in the store; a cloned one needs no copy.
1390
1401
  An invalid \`VLT_STORE_LINKER\` warns and uses
1391
1402
  \`unpack\`.`,
1392
1403
  validOptions: storeLinkers,
@@ -1735,6 +1746,11 @@ var definition = j2.heading("Configuration").description(
1735
1746
  devDependencies or optionalDependencies, but you want to
1736
1747
  move it to be a non-optional production dependency.`
1737
1748
  },
1749
+ "save-types": {
1750
+ description: `Also save the matching \`@types/*\` package as a
1751
+ devDependency for each added registry package that
1752
+ ships no TypeScript types of its own.`
1753
+ },
1738
1754
  "save-config": {
1739
1755
  description: `Save the registry and git host options given on the
1740
1756
  command line or via \`VLT_*\` env (\`--registry\`,
@@ -9,17 +9,20 @@ 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-UGCKF5ZE.js";
12
15
  import {
13
16
  createDiffFilesProvider
14
17
  } from "./chunk-RIYFGX27.js";
15
18
  import {
16
19
  createHostContextsMap
17
- } from "./chunk-FKZ5I53D.js";
20
+ } from "./chunk-ASLX43R3.js";
18
21
  import {
19
22
  stderr,
20
23
  stdout,
21
24
  styleTextStdout
22
- } from "./chunk-XDSZO74H.js";
25
+ } from "./chunk-FZUYGJZU.js";
23
26
  import {
24
27
  require_emoji_regex
25
28
  } from "./chunk-VTEFO2FT.js";
@@ -27,13 +30,13 @@ import {
27
30
  Query,
28
31
  actual,
29
32
  isRunResult
30
- } from "./chunk-7BHHCB5C.js";
33
+ } from "./chunk-OVPHE4O7.js";
31
34
  import {
32
35
  Monorepo
33
- } from "./chunk-CB65DPZ2.js";
36
+ } from "./chunk-I7UMHYZX.js";
34
37
  import {
35
38
  isErrorWithCause
36
- } from "./chunk-IBGFQR23.js";
39
+ } from "./chunk-FLH4YC6W.js";
37
40
  import {
38
41
  error
39
42
  } from "./chunk-WZWDS3W4.js";
@@ -1046,11 +1049,13 @@ var ExecCommand = class {
1046
1049
  this.projectRoot
1047
1050
  );
1048
1051
  let graph;
1052
+ let monorepo;
1049
1053
  if (mainManifest) {
1054
+ monorepo = Monorepo.load(this.projectRoot);
1050
1055
  graph = actual.load({
1051
1056
  ...conf.options,
1052
1057
  mainManifest,
1053
- monorepo: Monorepo.load(this.projectRoot),
1058
+ monorepo,
1054
1059
  loadManifests: false
1055
1060
  });
1056
1061
  }
@@ -1068,7 +1073,7 @@ var ExecCommand = class {
1068
1073
  const { nodes } = await query.search(queryString, {
1069
1074
  signal: new AbortController().signal
1070
1075
  });
1071
- this.#nodes = [];
1076
+ const locations = [];
1072
1077
  for (const node of nodes) {
1073
1078
  const { location } = node.toJSON();
1074
1079
  assert(
@@ -1077,8 +1082,9 @@ var ExecCommand = class {
1077
1082
  found: node
1078
1083
  })
1079
1084
  );
1080
- this.#nodes.push(location);
1085
+ locations.push(location);
1081
1086
  }
1087
+ this.#nodes = sortScopeLocations(locations, monorepo);
1082
1088
  } else if (paths?.length || groups?.length || recursive) {
1083
1089
  this.#defaultIgnoreMissing = true;
1084
1090
  this.#monorepo = Monorepo.load(this.projectRoot, {
@@ -1110,16 +1116,15 @@ var ExecCommand = class {
1110
1116
  return this.noArgsMulti();
1111
1117
  }
1112
1118
  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;
1119
+ const runInDir = async (cwd, label, signal) => {
1120
+ const arg = { ...this.bgArg(cwd), signal };
1121
+ const result = await this.bg(arg).catch((er) => {
1122
+ if (isErrorWithCause(er) && isRunResult(er.cause)) {
1123
+ this.printResult(label, er.cause);
1121
1124
  }
1122
- );
1125
+ failed = true;
1126
+ throw er;
1127
+ });
1123
1128
  if (!result.command) return null;
1124
1129
  if (!failed) this.printResult(label, result);
1125
1130
  return result;
@@ -1132,7 +1137,7 @@ var ExecCommand = class {
1132
1137
  }
1133
1138
  } else if (this.#monorepo) {
1134
1139
  const wsResultMap = await this.#monorepo.run(
1135
- (ws) => runInDir(ws.fullpath, ws.path)
1140
+ (ws, signal) => runInDir(ws.fullpath, ws.path, signal)
1136
1141
  );
1137
1142
  for (const [ws, result] of wsResultMap) {
1138
1143
  if (result) resultMap.set(ws.path, result);
@@ -14,7 +14,7 @@ var require = _vlt_createRequire(import.meta.filename);
14
14
  var package_default = {
15
15
  name: "@vltpkg/user-agent",
16
16
  description: "The User-Agent string that vlt sends with every outbound request",
17
- version: "1.3.7",
17
+ version: "1.4.0",
18
18
  repository: {
19
19
  type: "git",
20
20
  url: "git+https://github.com/vltpkg/vltpkg.git",
@@ -11,25 +11,25 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  install
14
- } from "./chunk-7BHHCB5C.js";
15
- import "./chunk-OWUICQFY.js";
14
+ } from "./chunk-OVPHE4O7.js";
15
+ import "./chunk-5TNXLRW2.js";
16
16
  import {
17
17
  commandUsage
18
- } from "./chunk-TLY4VGMH.js";
19
- import "./chunk-CB65DPZ2.js";
18
+ } from "./chunk-LHPEBLOU.js";
19
+ import "./chunk-I7UMHYZX.js";
20
20
  import {
21
21
  lazyView
22
22
  } from "./chunk-4KCU2KZL.js";
23
- import "./chunk-SV4WK3KX.js";
24
- import "./chunk-GZ5MYMBT.js";
25
- import "./chunk-SE2FSMBR.js";
23
+ import "./chunk-PLG3OYCX.js";
24
+ import "./chunk-5IJTPZXP.js";
25
+ import "./chunk-WF6KLKRN.js";
26
26
  import "./chunk-HTOTG4TS.js";
27
- import "./chunk-VBDNOU76.js";
27
+ import "./chunk-ZJMJ7MCT.js";
28
28
  import "./chunk-U7TEQCBN.js";
29
29
  import "./chunk-XNLSTHDK.js";
30
30
  import "./chunk-PDWPFR5T.js";
31
31
  import "./chunk-Y5PA7DVK.js";
32
- import "./chunk-IBGFQR23.js";
32
+ import "./chunk-FLH4YC6W.js";
33
33
  import "./chunk-WZWDS3W4.js";
34
34
  import "./chunk-PZLD7RTK.js";
35
35
 
@@ -63,7 +63,7 @@ var usage = () => commandUsage({
63
63
  var views = {
64
64
  json: (i) => i.graph.toJSON(),
65
65
  human: lazyView(
66
- async () => (await import("./reporter-TGBPLNR5.js")).InstallReporter
66
+ async () => (await import("./reporter-5NYOHBO7.js")).InstallReporter
67
67
  )
68
68
  };
69
69
  var command = async (conf) => {
package/cli-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/cli-sdk",
3
3
  "description": "The source for the vlt CLI",
4
- "version": "1.3.7",
4
+ "version": "1.4.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",