@vltpkg/cli-js 1.5.0 → 1.6.1

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-QPX4QXV4.js → access-YSLEWR2C.js} +8 -8
  2. package/{bugs-TLOECXEM.js → bugs-S6CRUEA2.js} +23 -19
  3. package/{build-IQOS3LKO.js → build-SG3KPX3W.js} +49 -14
  4. package/{cache-O5IBYYSB.js → cache-HA77ROM7.js} +16 -13
  5. package/cache-unzip-src-unzip.js +23 -4
  6. package/{chunk-3S3W7QEM.js → chunk-3E3ISOYM.js} +10 -5
  7. package/{chunk-43EJ4Q42.js → chunk-3JIN46K5.js} +1 -1
  8. package/{chunk-5KW6AOTT.js → chunk-4GMNWW4C.js} +1 -1
  9. package/{chunk-6W5XMVIZ.js → chunk-4UAIPIAV.js} +7 -7
  10. package/{chunk-7UWRR6EE.js → chunk-5Q2HSLVV.js} +1 -1
  11. package/{chunk-LUVDMEW4.js → chunk-6D3QAFNZ.js} +1 -1
  12. package/{chunk-LH7J5BDU.js → chunk-6XVW7CWJ.js} +3 -3
  13. package/{chunk-UZ6ICZE3.js → chunk-7M2VTFLP.js} +12 -1
  14. package/{chunk-XCQCYB6G.js → chunk-AEVT3CHK.js} +142 -16
  15. package/{chunk-SMXXFQPI.js → chunk-AHLBPSGQ.js} +3 -3
  16. package/{chunk-6LZM3I4Q.js → chunk-BF5DRGRZ.js} +25 -4
  17. package/chunk-BH5CVXNY.js +115 -0
  18. package/{chunk-CS6AYPY5.js → chunk-BQMHDAYL.js} +6 -13
  19. package/{chunk-2U4PVHP4.js → chunk-C4RJ4NNS.js} +137 -47
  20. package/{chunk-F7NPYSI2.js → chunk-CAV7FKWQ.js} +2 -2
  21. package/chunk-DXED4ARV.js +436 -0
  22. package/chunk-E74WGW5C.js +49 -0
  23. package/{chunk-CMLDLZZ3.js → chunk-EFHOWRKU.js} +56 -0
  24. package/{chunk-IFEZ6BFV.js → chunk-EMTGRCSE.js} +2 -2
  25. package/{chunk-4TSHLSRK.js → chunk-EYGOEAJM.js} +1 -1
  26. package/{chunk-DBANBIL2.js → chunk-FZCPQWCJ.js} +1 -0
  27. package/chunk-GCTREKA4.js +115 -0
  28. package/{chunk-CW56EJIL.js → chunk-HT6FS4VB.js} +1 -1
  29. package/{chunk-VR7NRWAD.js → chunk-IHERL3TA.js} +17 -16
  30. package/chunk-JV5XR5JQ.js +349 -0
  31. package/{chunk-T5EP7QEF.js → chunk-JZXNHIQE.js} +28 -28
  32. package/{chunk-IJUVVD7E.js → chunk-KD5ZK72K.js} +1 -1
  33. package/{chunk-C6ZVVEFV.js → chunk-KURQHX54.js} +5 -3
  34. package/{chunk-GUP55DM6.js → chunk-L3ZF7OYM.js} +2 -2
  35. package/{chunk-X6JKMIOU.js → chunk-LGQVZTYR.js} +4 -36
  36. package/{chunk-G3FZ2ZJK.js → chunk-M242QVJS.js} +1 -1
  37. package/chunk-MCDLJZXT.js +82 -0
  38. package/{chunk-WHWPAYZY.js → chunk-MSWOR3FV.js} +35 -7
  39. package/chunk-N3V6EK5I.js +77 -0
  40. package/{chunk-ISAMD2FE.js → chunk-N6HV7JWC.js} +1 -1
  41. package/{chunk-MYX4JCIJ.js → chunk-NO53Y3QO.js} +1 -1
  42. package/chunk-O6MQ7NN6.js +1155 -0
  43. package/{chunk-XCSNI6AO.js → chunk-OWL5G4K4.js} +4 -4
  44. package/{chunk-35EG6T3J.js → chunk-Q2UEILN6.js} +21 -9
  45. package/{chunk-Z5D5KODU.js → chunk-VGPLFOJO.js} +4 -2
  46. package/{chunk-ARE7FKDG.js → chunk-W24SBFY5.js} +5 -5
  47. package/{chunk-XD5KUDXX.js → chunk-WMMKUVAT.js} +10 -8
  48. package/{chunk-4UH3KMTD.js → chunk-ZJE3OTP3.js} +258 -451
  49. package/{ci-ESVUMOZO.js → ci-GVLL72SS.js} +21 -17
  50. package/cli-package.json +3 -1
  51. package/{config-ZVVLFKR7.js → config-KH6AEMHI.js} +13 -12
  52. package/{config-TMB2X6DW.js → config-TIPKOPYS.js} +10 -9
  53. package/{create-BLTNKSBQ.js → create-SKNEZEZY.js} +28 -24
  54. package/{deprecate-VA6PGHYL.js → deprecate-RFRLJZVL.js} +12 -12
  55. package/{dist-tag-OYJREFO2.js → dist-tag-LVYOTJHJ.js} +8 -8
  56. package/{docs-6OC3OQNM.js → docs-INXRFEGY.js} +23 -19
  57. package/{exec-AZPGFVRY.js → exec-5MA5XRPZ.js} +28 -24
  58. package/{exec-cache-D75UY2WI.js → exec-cache-7GS4KLWJ.js} +24 -20
  59. package/{exec-local-E2JKB4X4.js → exec-local-RE4KVTMN.js} +22 -18
  60. package/{help-UPW77X5N.js → help-JHLP565L.js} +5 -4
  61. package/{init-SNO6QL7C.js → init-4UFHO67B.js} +13 -12
  62. package/{install-TEJM2YVX.js → install-Z33YVCDK.js} +108 -52
  63. package/{list-NHCC2RNB.js → list-XAMKR6TL.js} +29 -22
  64. package/{login-XNZXCGFD.js → login-6NXUO5FF.js} +14 -13
  65. package/{logout-YCM7O36Q.js → logout-6P7LWTAY.js} +8 -8
  66. package/{outdated-4LA7N63W.js → outdated-YNUSWZJD.js} +18 -17
  67. package/{pack-RC4CZSWF.js → pack-LMQYH75V.js} +15 -14
  68. package/package.json +1 -1
  69. package/{ping-RLVAZGDL.js → ping-VLFZ3WCY.js} +8 -8
  70. package/{pkg-FED5C6TP.js → pkg-JMPBHKSW.js} +16 -15
  71. package/{profile-DJZNLQPG.js → profile-PJJAA2YM.js} +8 -8
  72. package/{publish-54AMVMTQ.js → publish-33RFJ2HJ.js} +24 -20
  73. package/{query-ZQLMSJ7O.js → query-LUUOK57K.js} +29 -22
  74. package/{registry-6HKQYSZX.js → registry-ZGGWVLBM.js} +5 -5
  75. package/registry-client-src-revalidate.js +41 -11
  76. package/{repo-ITA4BLZ4.js → repo-VLHLQP2S.js} +23 -19
  77. package/{reporter-UYVR2WMB.js → reporter-SNSM2TDC.js} +61 -15
  78. package/{run-TP2HTJRN.js → run-USWK7R3N.js} +22 -18
  79. package/{run-exec-UGCC53DV.js → run-exec-PHE44AWW.js} +22 -18
  80. package/security-archive-src-update-expired.js +24 -5
  81. package/{setup-XPAM5U3Z.js → setup-JMY47ERY.js} +206 -27
  82. package/{skills-YD2TB2VD.js → skills-7PYMTDER.js} +41 -56
  83. package/{skills-LR6GXW3X.js → skills-YMMV6TMN.js} +24 -21
  84. package/{src-34D4DOOH.js → src-2ZS4VHJP.js} +25 -19
  85. package/{src-H6DFCAPH.js → src-A5ZJNOHN.js} +6 -4
  86. package/{src-LHDC4NJO.js → src-W2VQULRG.js} +2 -2
  87. package/{token-OF63PFTQ.js → token-YKHELNVQ.js} +10 -9
  88. package/{uninstall-B54FQ5KQ.js → uninstall-Q46HWR5S.js} +53 -17
  89. package/{unpublish-CSHIGMDQ.js → unpublish-LBANPSJ5.js} +8 -8
  90. package/{update-HS4VJ5ZG.js → update-B2EGLZHI.js} +19 -17
  91. package/{version-L7S3DHUS.js → version-IEOBL3NN.js} +14 -13
  92. package/{view-NWKKWFVA.js → view-JCA5VT6F.js} +13 -13
  93. package/vlr.js +1 -1
  94. package/vlrx.js +1 -1
  95. package/vlt.js +1 -1
  96. package/vlx.js +1 -1
  97. package/vlxl.js +1 -1
  98. package/{whoami-65K35VGW.js → whoami-OWJUPO3X.js} +8 -8
  99. package/chunk-T2VBCUF5.js +0 -77
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  commandAliases,
14
14
  jack
15
- } from "./chunk-CMLDLZZ3.js";
15
+ } from "./chunk-EFHOWRKU.js";
16
16
 
17
17
  // ../../src/cli-sdk/src/config/usage.ts
18
18
  var toArr = (v) => Array.isArray(v) ? v : [v];
@@ -17,19 +17,19 @@ import {
17
17
  pickManifest,
18
18
  resolve,
19
19
  revs
20
- } from "./chunk-IFEZ6BFV.js";
20
+ } from "./chunk-EMTGRCSE.js";
21
21
  import {
22
22
  Monorepo,
23
23
  PackageJson
24
- } from "./chunk-C6ZVVEFV.js";
24
+ } from "./chunk-KURQHX54.js";
25
25
  import {
26
26
  Spec
27
- } from "./chunk-LUVDMEW4.js";
27
+ } from "./chunk-6D3QAFNZ.js";
28
28
  import {
29
29
  registryErrorMessage,
30
30
  storeRoot,
31
31
  tokenRefusalAdvice
32
- } from "./chunk-5KW6AOTT.js";
32
+ } from "./chunk-4GMNWW4C.js";
33
33
  import {
34
34
  logRequest
35
35
  } from "./chunk-B6RIGNEO.js";
@@ -41,7 +41,7 @@ import {
41
41
  brotliTarballUrl,
42
42
  integrityHex,
43
43
  tarballFormat
44
- } from "./chunk-6LZM3I4Q.js";
44
+ } from "./chunk-BF5DRGRZ.js";
45
45
  import {
46
46
  error
47
47
  } from "./chunk-WZWDS3W4.js";
@@ -338,7 +338,7 @@ var PackageInfoClient = class {
338
338
  }
339
339
  async getRegistryClient() {
340
340
  if (this.#registryClient) return this.#registryClient;
341
- this.#registryClientPromise ??= import("./src-H6DFCAPH.js").then(({ RegistryClient }) => {
341
+ this.#registryClientPromise ??= import("./src-A5ZJNOHN.js").then(({ RegistryClient }) => {
342
342
  this.#registryClient = new RegistryClient(this.options);
343
343
  return this.#registryClient;
344
344
  });
@@ -377,7 +377,7 @@ var PackageInfoClient = class {
377
377
  }
378
378
  async getTarPool() {
379
379
  if (this.#tarPool) return this.#tarPool;
380
- this.#tarPoolPromise ??= import("./src-LHDC4NJO.js").then(
380
+ this.#tarPoolPromise ??= import("./src-W2VQULRG.js").then(
381
381
  ({ Pool }) => {
382
382
  this.#tarPool = new Pool();
383
383
  return this.#tarPool;
@@ -426,9 +426,10 @@ var PackageInfoClient = class {
426
426
  fromLockfile = false
427
427
  } = options;
428
428
  const f = spec.final;
429
- const brotli = !!resolved && tarballFormat(resolved) === "brotli";
430
- const r = resolved && (integrity || brotli) ? {
431
- resolved,
429
+ const url = f.type === "git" && f.remoteURL && resolved && !/^https?:\/\//.test(resolved) ? f.remoteURL : resolved;
430
+ const brotli = !!url && tarballFormat(url) === "brotli";
431
+ const r = url && (integrity || brotli) ? {
432
+ resolved: url,
432
433
  integrity,
433
434
  spec,
434
435
  ...brotli && !integrity ? { digestRequired: true } : {}
@@ -471,11 +472,10 @@ var PackageInfoClient = class {
471
472
  const storeOn = f.type === "registry" && this.#storeLinker !== "unpack";
472
473
  const copy = this.#storeLinker === "copy";
473
474
  const clone2 = this.#storeLinker === "clone";
474
- const hex = !storeOn ? void 0 : r.integrity ? integrityHex(r.integrity) : integrityHex(
475
- (await this.getRegistryClient()).cachedIntegrity(
476
- r.resolved
477
- )
478
- );
475
+ const cachedIntegrity = storeOn && !r.integrity ? (await this.getRegistryClient()).cachedIntegrity(
476
+ r.resolved
477
+ ) : void 0;
478
+ const hex = !storeOn ? void 0 : r.integrity ? integrityHex(r.integrity) : integrityHex(cachedIntegrity);
479
479
  if (hex) {
480
480
  if (debug.enabled && !this.#storeHitRateLogged) {
481
481
  this.#storeHitRateLogged = true;
@@ -490,6 +490,7 @@ var PackageInfoClient = class {
490
490
  const { how, index } = linked;
491
491
  this.#storeHits[how]++;
492
492
  logRequest(r.resolved, how === "copy" ? "cache" : "store");
493
+ r.integrity ??= cachedIntegrity;
493
494
  return {
494
495
  ...r,
495
496
  manifest: index.manifest,
@@ -593,7 +594,7 @@ var PackageInfoClient = class {
593
594
  }
594
595
  case "remote": {
595
596
  const rc = await this.getRegistryClient();
596
- const { CacheEntry: Entry, cacheKey } = await import("./src-H6DFCAPH.js");
597
+ const { CacheEntry: Entry, cacheKey } = await import("./src-A5ZJNOHN.js");
597
598
  const key = cacheKey("GET", new URL(r.resolved));
598
599
  const unzipped = (entry) => {
599
600
  try {
@@ -0,0 +1,349 @@
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
+ rimraf
14
+ } from "./chunk-PDWPFR5T.js";
15
+ import {
16
+ error
17
+ } from "./chunk-WZWDS3W4.js";
18
+
19
+ // ../../src/rollback-remove/src/index.ts
20
+ import { spawn } from "node:child_process";
21
+ import { rename } from "node:fs/promises";
22
+ import { basename, dirname } from "node:path";
23
+
24
+ // ../../src/rollback-remove/src/remove.ts
25
+ import { resolve } from "node:path";
26
+ var __CODE_SPLIT_SCRIPT_NAME = resolve(import.meta.dirname, "rollback-remove-src-remove.js");
27
+
28
+ // ../../src/rollback-remove/src/index.ts
29
+ var isDeno = globalThis.Deno != void 0;
30
+ var RollbackRemove = class {
31
+ #key = String(Math.random()).substring(2);
32
+ #paths = /* @__PURE__ */ new Map();
33
+ async rm(path) {
34
+ if (this.#paths.has(path)) return;
35
+ const target = `${dirname(path)}/.VLT.DELETE.${this.#key}.${basename(path)}`;
36
+ try {
37
+ await rename(path, target);
38
+ } catch (e) {
39
+ if (e instanceof Error && "code" in e && /* c8 ignore start - very spurious weirdness on Windows */
40
+ (e.code === "ENOENT" || e.code === "EPERM")) {
41
+ return;
42
+ }
43
+ throw e;
44
+ }
45
+ this.#paths.set(path, target);
46
+ }
47
+ confirm() {
48
+ if (!this.#paths.size) return;
49
+ const env = { ...process.env };
50
+ const args = [];
51
+ const detached = !(isDeno && process.platform === "win32");
52
+ if (isDeno) {
53
+ args.push(
54
+ "--unstable-node-globals",
55
+ "--unstable-bare-node-builtins"
56
+ );
57
+ }
58
+ args.push(__CODE_SPLIT_SCRIPT_NAME);
59
+ const child = spawn(process.execPath, args, {
60
+ stdio: ["pipe", "ignore", "ignore"],
61
+ detached,
62
+ env
63
+ });
64
+ for (const path of this.#paths.values()) {
65
+ child.stdin.write(`${path}\0`);
66
+ }
67
+ child.stdin.end();
68
+ if (detached) {
69
+ child.unref();
70
+ }
71
+ this.#paths.clear();
72
+ }
73
+ async rollback() {
74
+ const promises = [];
75
+ for (const [original, moved] of this.#paths) {
76
+ promises.push(
77
+ rimraf(original).catch(() => {
78
+ }).then(() => rename(moved, original))
79
+ );
80
+ }
81
+ await Promise.all(promises);
82
+ this.#paths.clear();
83
+ }
84
+ };
85
+
86
+ // ../../src/cmd-shim/src/read.ts
87
+ import { lstat, readFile, readlink } from "node:fs/promises";
88
+ import { dirname as dirname2, resolve as resolve2 } from "node:path";
89
+
90
+ // ../../src/cmd-shim/src/paths.ts
91
+ var paths = process.platform === "win32" ? (path) => [
92
+ path + ".cmd",
93
+ path + ".ps1",
94
+ path,
95
+ path + ".pwsh"
96
+ ] : (path) => [path];
97
+
98
+ // ../../src/cmd-shim/src/read.ts
99
+ var extractPath = (path, cmdshimContents) => {
100
+ if (/\.cmd$/i.test(path)) {
101
+ return extractPathFromCmd(cmdshimContents);
102
+ } else if (/\.(ps1|pwsh)$/i.test(path)) {
103
+ return extractPathFromPowershell(cmdshimContents);
104
+ } else {
105
+ return extractPathFromCygwin(cmdshimContents);
106
+ }
107
+ };
108
+ var extractPathFromPowershell = (cmdshimContents) => {
109
+ const matches = /"(?:[$]basedir\/|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+[$]args/.exec(
110
+ cmdshimContents
111
+ );
112
+ return matches?.[1]?.replace(/\\/g, "/");
113
+ };
114
+ var extractPathFromCmd = (cmdshimContents) => {
115
+ const matches = /"(?:%(?:~dp0|dp0%)\\|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+%[*]/.exec(
116
+ cmdshimContents
117
+ );
118
+ return matches?.[1]?.replace(/\\/g, "/");
119
+ };
120
+ var extractPathFromCygwin = (cmdshimContents) => {
121
+ const matches = /"(?:[$]basedir\/|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+"[$]@"/.exec(
122
+ cmdshimContents
123
+ );
124
+ return matches?.[1]?.replace(/\\/g, "/");
125
+ };
126
+ var findCmdShimIfExists = async (path) => {
127
+ path = path.replace(/\.(cmd|pwsh|ps1)$/i, "");
128
+ for (const p of paths(path)) {
129
+ const result = await readCmdShimIfExists(p);
130
+ if (result) return [p, result];
131
+ }
132
+ };
133
+ var readCmdShimIfExists = async (path) => {
134
+ try {
135
+ const st = await lstat(path);
136
+ if (st.isSymbolicLink()) {
137
+ return resolve2(dirname2(path), await readlink(path));
138
+ }
139
+ const contents = await readFile(path);
140
+ const destination = extractPath(path, contents.toString());
141
+ if (destination) return resolve2(dirname2(path), destination);
142
+ } catch {
143
+ }
144
+ };
145
+
146
+ // ../../src/cmd-shim/src/index.ts
147
+ import {
148
+ chmod,
149
+ mkdir,
150
+ readFile as readFile2,
151
+ stat,
152
+ writeFile
153
+ } from "node:fs/promises";
154
+ import { dirname as dirname3, isAbsolute, relative } from "node:path";
155
+
156
+ // ../../src/cmd-shim/src/to-batch-syntax.ts
157
+ var convertToSetCommand = (key, value) => convertToSetCommand_(key.trim(), value.trim());
158
+ var convertToSetCommand_ = (key, value) => key && value ? `@SET ${key}=${replaceDollarWithPercentPair(value)}\r
159
+ ` : "";
160
+ var extractVariableValuePairs = (declarations) => declarations.reduce(
161
+ (pairs, declaration) => {
162
+ const [key = "", val = ""] = declaration.split("=");
163
+ pairs[key] = val;
164
+ return pairs;
165
+ },
166
+ {}
167
+ );
168
+ var convertToSetCommands = (variableString) => Object.entries(extractVariableValuePairs(variableString.split(" "))).map(([key, val]) => convertToSetCommand(key, val)).join("");
169
+ var replaceDollarWithPercentPair = (value) => {
170
+ const dollarExpressions = /\$\{?([^$@#?\- \t{}:]+)\}?/g;
171
+ let result = "";
172
+ let startIndex = 0;
173
+ do {
174
+ const match = dollarExpressions.exec(value);
175
+ if (match) {
176
+ const betweenMatches = value.substring(startIndex, match.index) || "";
177
+ result += betweenMatches + "%" + String(match[1]) + "%";
178
+ startIndex = dollarExpressions.lastIndex;
179
+ }
180
+ } while (dollarExpressions.lastIndex > 0);
181
+ result += value.slice(startIndex);
182
+ return result;
183
+ };
184
+
185
+ // ../../src/cmd-shim/src/index.ts
186
+ var shebangExpr = /^#!\s*(?:\/usr\/bin\/env\s+(?:-S\s+)?((?:[^ \t=]+=[^ \t=]+\s+)*))?([^ \t]+)(.*)$/;
187
+ var cmdShimIfExists = async (from, to, remover) => {
188
+ try {
189
+ await stat(from);
190
+ } catch {
191
+ return;
192
+ }
193
+ await writeShim(from, to, remover);
194
+ };
195
+ var cmdShim = async (from, to, remover) => {
196
+ try {
197
+ await stat(from);
198
+ await writeShim(from, to, remover);
199
+ } catch (er) {
200
+ throw error("Could not shim to executable file", {
201
+ path: from,
202
+ target: to,
203
+ cause: er
204
+ });
205
+ }
206
+ };
207
+ var writeShim = async (from, to, remover) => {
208
+ await Promise.all([
209
+ remover.rm(to),
210
+ remover.rm(to + ".cmd"),
211
+ remover.rm(to + ".ps1"),
212
+ remover.rm(to + ".pwsh")
213
+ ]);
214
+ await mkdir(dirname3(to), { recursive: true });
215
+ const data = await readFile2(from, "utf8").catch(() => "");
216
+ if (!data) {
217
+ return await writeShim_(from, to);
218
+ }
219
+ const firstLine = data.trim().split(/\r*\n/)[0];
220
+ const shebang = firstLine?.match(shebangExpr) ?? void 0;
221
+ return writeShim_(
222
+ from,
223
+ to,
224
+ shebang?.[2],
225
+ shebang?.[3],
226
+ shebang?.[1]
227
+ );
228
+ };
229
+ var writeShim_ = async (from, to, prog, args, variables) => {
230
+ let shTarget = relative(dirname3(to), from);
231
+ const [dp0, basedir] = isAbsolute(shTarget) ? ["", ""] : ["%dp0%\\", "$basedir/"];
232
+ let target = shTarget.split("/").join("\\");
233
+ let longProg;
234
+ let shProg = prog?.split("\\").join("/");
235
+ let shLongProg;
236
+ let pwshProg = shProg && `"${shProg}$exe"`;
237
+ let pwshLongProg;
238
+ shTarget = shTarget.split("\\").join("/");
239
+ args = args || "";
240
+ variables = variables || "";
241
+ if (!prog) {
242
+ prog = `"${dp0}${target}"`;
243
+ shProg = `"${basedir}${shTarget}"`;
244
+ pwshProg = shProg;
245
+ args = "";
246
+ target = "";
247
+ shTarget = "";
248
+ } else {
249
+ longProg = `"%dp0%\\${prog}.exe"`;
250
+ shLongProg = `"$basedir/${prog}"`;
251
+ pwshLongProg = `"$basedir/${prog}$exe"`;
252
+ target = `"${dp0}${target}"`;
253
+ shTarget = `"${basedir}${shTarget}"`;
254
+ }
255
+ const head = "@ECHO off\r\nGOTO start\r\n:find_dp0\r\nSET dp0=%~dp0\r\nEXIT /b\r\n:start\r\nSETLOCAL\r\nCALL :find_dp0\r\n";
256
+ let cmd;
257
+ if (longProg) {
258
+ shLongProg = (shLongProg ?? "").trim();
259
+ args = args.trim();
260
+ const variablesBatch = convertToSetCommands(variables);
261
+ cmd = `${head}${variablesBatch}\r
262
+ IF EXIST ${longProg} (\r
263
+ SET "_prog=${longProg.replace(/(^")|("$)/g, "")}"\r
264
+ ) ELSE (\r
265
+ SET "_prog=${prog.replace(/(^")|("$)/g, "")}"\r
266
+ SET PATHEXT=%PATHEXT:;.JS;=;%\r
267
+ )\r
268
+ \r
269
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" ${args} ${target} %*\r
270
+ `;
271
+ } else {
272
+ cmd = `${head}${prog} ${args} ${target} %*\r
273
+ `;
274
+ }
275
+ let sh = `#!/bin/sh
276
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
277
+
278
+ case \`uname\` in
279
+ *CYGWIN*|*MINGW*|*MSYS*)
280
+ if command -v cygpath > /dev/null 2>&1; then
281
+ basedir=\`cygpath -w "$basedir"\`
282
+ fi
283
+ ;;
284
+ esac
285
+
286
+ `;
287
+ if (shLongProg) {
288
+ sh += `if [ -x ${shLongProg} ]; then
289
+ exec ${variables}${shLongProg} ${args} ${shTarget} "$@"
290
+ else
291
+ exec ${variables}${shProg} ${args} ${shTarget} "$@"
292
+ fi
293
+ `;
294
+ } else {
295
+ sh += `exec ${shProg} ${args} ${shTarget} "$@"
296
+ `;
297
+ }
298
+ let pwsh = '#!/usr/bin/env pwsh\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n\n$exe=""\nif ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n # Fix case when both the Windows and Linux builds of Node\n # are installed in the same directory\n $exe=".exe"\n}\n';
299
+ if (shLongProg) {
300
+ pwsh += `$ret=0
301
+ if (Test-Path ${pwshLongProg}) {
302
+ # Support pipeline input
303
+ if ($MyInvocation.ExpectingInput) {
304
+ $input | & ${pwshLongProg} ${args} ${shTarget} $args
305
+ } else {
306
+ & ${pwshLongProg} ${args} ${shTarget} $args
307
+ }
308
+ $ret=$LASTEXITCODE
309
+ } else {
310
+ # Support pipeline input
311
+ if ($MyInvocation.ExpectingInput) {
312
+ $input | & ${pwshProg} ${args} ${shTarget} $args
313
+ } else {
314
+ & ${pwshProg} ${args} ${shTarget} $args
315
+ }
316
+ $ret=$LASTEXITCODE
317
+ }
318
+ exit $ret
319
+ `;
320
+ } else {
321
+ pwsh += `# Support pipeline input
322
+ if ($MyInvocation.ExpectingInput) {
323
+ $input | & ${pwshProg} ${args} ${shTarget} $args
324
+ } else {
325
+ & ${pwshProg} ${args} ${shTarget} $args
326
+ }
327
+ exit $LASTEXITCODE
328
+ `;
329
+ }
330
+ await Promise.all([
331
+ writeFile(to + ".cmd", cmd, "utf8"),
332
+ writeFile(to + ".ps1", pwsh, "utf8"),
333
+ writeFile(to, sh, "utf8")
334
+ ]);
335
+ await chmodShim(to);
336
+ };
337
+ var chmodShim = async (to) => await Promise.all([
338
+ chmod(to, 493),
339
+ chmod(to + ".cmd", 493),
340
+ chmod(to + ".ps1", 493)
341
+ ]);
342
+
343
+ export {
344
+ findCmdShimIfExists,
345
+ readCmdShimIfExists,
346
+ cmdShimIfExists,
347
+ cmdShim,
348
+ RollbackRemove
349
+ };
@@ -15,10 +15,10 @@ import {
15
15
  } from "./chunk-SRWDPPLX.js";
16
16
  import {
17
17
  minimatch
18
- } from "./chunk-C6ZVVEFV.js";
18
+ } from "./chunk-KURQHX54.js";
19
19
  import {
20
20
  Spec
21
- } from "./chunk-LUVDMEW4.js";
21
+ } from "./chunk-6D3QAFNZ.js";
22
22
  import {
23
23
  parse,
24
24
  stringify
@@ -1865,7 +1865,12 @@ var require_ignore = __commonJS({
1865
1865
  // ../../src/cli-sdk/src/pack-tarball.ts
1866
1866
  var ssri = __toESM(require_lib(), 1);
1867
1867
  import assert from "node:assert";
1868
- import { existsSync, readFileSync, statSync } from "node:fs";
1868
+ import {
1869
+ existsSync,
1870
+ readdirSync,
1871
+ readFileSync,
1872
+ statSync
1873
+ } from "node:fs";
1869
1874
  import { join } from "node:path";
1870
1875
  var import_ignore = __toESM(require_ignore(), 1);
1871
1876
  var replaceWorkspaceAndCatalogSpecs = (manifest_, config) => {
@@ -2004,7 +2009,16 @@ var buildPackFilter = (manifest, packDir) => {
2004
2009
  }
2005
2010
  }
2006
2011
  }
2007
- return (path) => {
2012
+ const files = (manifestWithFiles.files ?? []).map((pattern) => pattern.replace(/^\.?\//, "").replace(/\/+$/, "")).filter(Boolean);
2013
+ const isReadableDir = (dir) => {
2014
+ try {
2015
+ readdirSync(join(packDir, dir));
2016
+ return true;
2017
+ } catch {
2018
+ return false;
2019
+ }
2020
+ };
2021
+ return (path, entry) => {
2008
2022
  const normalizedPath = path.replace(/^\.\//, "");
2009
2023
  if (path === "." || normalizedPath === "") {
2010
2024
  return true;
@@ -2025,30 +2039,16 @@ var buildPackFilter = (manifest, packDir) => {
2025
2039
  if (hasEmptyFilesField) {
2026
2040
  return false;
2027
2041
  }
2028
- if (hasFilesField && manifestWithFiles.files) {
2029
- return manifestWithFiles.files.some((pattern) => {
2030
- if (pattern.endsWith("/")) {
2031
- const dirName = pattern.slice(0, -1);
2032
- const globPattern = pattern.replace(/\/$/, "/**");
2033
- const matchesDir = normalizedPath === dirName;
2034
- const matchesContents = minimatch(
2035
- normalizedPath,
2036
- globPattern,
2037
- { dot: true }
2038
- );
2039
- return matchesDir || matchesContents;
2040
- }
2041
- const directMatch = minimatch(normalizedPath, pattern, {
2042
- dot: true
2043
- });
2044
- const isParentDir = pattern.includes("/") && pattern.startsWith(normalizedPath + "/");
2045
- const isChildOfPattern = minimatch(
2046
- normalizedPath,
2047
- pattern + "/**",
2048
- { dot: true }
2049
- );
2050
- return directMatch || isParentDir || isChildOfPattern;
2051
- });
2042
+ if (hasFilesField) {
2043
+ const isDir = "isDirectory" in entry && entry.isDirectory();
2044
+ return files.some(
2045
+ (pattern) => minimatch(normalizedPath, pattern, { dot: true }) || minimatch(normalizedPath, `${pattern}/**`, { dot: true })
2046
+ ) || isDir && files.some(
2047
+ (pattern) => minimatch(normalizedPath, pattern, {
2048
+ dot: true,
2049
+ partial: true
2050
+ })
2051
+ ) && isReadableDir(normalizedPath);
2052
2052
  }
2053
2053
  if (ig?.ignores(normalizedPath)) {
2054
2054
  return false;
@@ -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
  getId
14
- } from "./chunk-F7NPYSI2.js";
14
+ } from "./chunk-CAV7FKWQ.js";
15
15
 
16
16
  // ../../src/cli-sdk/src/stub-node.ts
17
17
  var createStubNode = (spec, name, version, options) => ({
@@ -13,7 +13,7 @@ import {
13
13
  graphRun,
14
14
  graphRunSync,
15
15
  joinDepIDTuple
16
- } from "./chunk-F7NPYSI2.js";
16
+ } from "./chunk-CAV7FKWQ.js";
17
17
  import {
18
18
  load,
19
19
  parse,
@@ -33,7 +33,7 @@ import {
33
33
  normalizeManifest,
34
34
  parseRange,
35
35
  satisfies
36
- } from "./chunk-6LZM3I4Q.js";
36
+ } from "./chunk-BF5DRGRZ.js";
37
37
  import {
38
38
  error
39
39
  } from "./chunk-WZWDS3W4.js";
@@ -115,6 +115,7 @@ var PackageJson = class {
115
115
  writeFileSync(filename, stringify(manifest, void 0, indent));
116
116
  this.#cache.set(dir, manifest);
117
117
  this.#pathCache.set(manifest, dir);
118
+ this.#errCache.delete(dir);
118
119
  } catch (err) {
119
120
  this.#cache.delete(dir);
120
121
  this.#pathCache.delete(manifest);
@@ -5350,5 +5351,6 @@ export {
5350
5351
  resolveWSConfig,
5351
5352
  migratableWSConfig,
5352
5353
  splitNegatedPatterns,
5353
- Monorepo
5354
+ Monorepo,
5355
+ workspaceCache
5354
5356
  };
@@ -11,11 +11,11 @@ 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-WHWPAYZY.js";
14
+ } from "./chunk-MSWOR3FV.js";
15
15
  import {
16
16
  migratableWSConfig,
17
17
  resolveWSConfig
18
- } from "./chunk-C6ZVVEFV.js";
18
+ } from "./chunk-KURQHX54.js";
19
19
  import {
20
20
  save
21
21
  } from "./chunk-HTOTG4TS.js";
@@ -12,43 +12,12 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  source_default
14
14
  } from "./chunk-WGDTG44V.js";
15
+ import {
16
+ loadPackageJson
17
+ } from "./chunk-E74WGW5C.js";
15
18
  import {
16
19
  commandAliases
17
- } from "./chunk-CMLDLZZ3.js";
18
-
19
- // ../../node_modules/.vlt/~npm~package-json-from-dist@1.0.1/node_modules/package-json-from-dist/dist/esm/index.js
20
- import { readFileSync } from "node:fs";
21
- import { dirname, resolve, sep } from "node:path";
22
- import { fileURLToPath } from "node:url";
23
- var NM = `${sep}node_modules${sep}`;
24
- var STORE = `.store${sep}`;
25
- var PKG = `${sep}package${sep}`;
26
- var DIST = `${sep}dist${sep}`;
27
- var findPackageJson = (from, pathFromSrc = "../package.json") => {
28
- const f = typeof from === "object" || from.startsWith("file://") ? fileURLToPath(from) : from;
29
- const __dirname = dirname(f);
30
- const nms = __dirname.lastIndexOf(NM);
31
- if (nms !== -1) {
32
- const nm = __dirname.substring(0, nms + NM.length);
33
- const pkgDir = __dirname.substring(nms + NM.length);
34
- if (pkgDir.startsWith(STORE)) {
35
- const pkg = pkgDir.indexOf(PKG, STORE.length);
36
- if (pkg) {
37
- return resolve(nm, pkgDir.substring(0, pkg + PKG.length), "package.json");
38
- }
39
- }
40
- const pkgName = pkgDir.startsWith("@") ? pkgDir.split(sep, 2).join(sep) : String(pkgDir.split(sep)[0]);
41
- return resolve(nm, pkgName, "package.json");
42
- } else {
43
- const d = __dirname.lastIndexOf(DIST);
44
- if (d !== -1) {
45
- return resolve(__dirname.substring(0, d), "package.json");
46
- } else {
47
- return resolve(__dirname, pathFromSrc);
48
- }
49
- }
50
- };
51
- var loadPackageJson = (from, pathFromSrc = "../package.json") => JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), "utf8"));
20
+ } from "./chunk-EFHOWRKU.js";
52
21
 
53
22
  // ../../src/cli-sdk/src/custom-help.ts
54
23
  var { version } = loadPackageJson(
@@ -407,7 +376,6 @@ ${s("dim", `Run \`vlt help <command>\` for detailed information about a specific
407
376
  };
408
377
 
409
378
  export {
410
- loadPackageJson,
411
379
  generateDefaultHelp,
412
380
  generateFullHelp
413
381
  };
@@ -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.5.0",
17
+ version: "1.6.1",
18
18
  repository: {
19
19
  type: "git",
20
20
  url: "git+https://github.com/vltpkg/vltpkg.git",