@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.
- package/{access-4W6PMOGC.js → access-422UGEWN.js} +8 -8
- package/{bugs-FJHQFPZF.js → bugs-RED7Y33Q.js} +17 -17
- package/{build-SPWU3NOH.js → build-IHMPBWRO.js} +9 -9
- package/{cache-SBNEPOMQ.js → cache-FJP2RZJX.js} +31 -19
- package/cache-unzip-src-unzip.js +21 -1
- package/{chunk-SPWJ3X5Y.js → chunk-2AMOC4DN.js} +4 -4
- package/{chunk-QYS5MGGM.js → chunk-4UCADW6S.js} +86 -10
- package/{chunk-GZ5MYMBT.js → chunk-5IJTPZXP.js} +1 -1
- package/{chunk-L3K2ZAOO.js → chunk-5RHABCYI.js} +76 -11
- package/{chunk-OWUICQFY.js → chunk-5TNXLRW2.js} +33 -20
- package/{chunk-IHXJVKAE.js → chunk-5Y4SYLJ2.js} +2 -1
- package/chunk-6IF3RJND.js +81 -0
- package/{chunk-3U6QWN62.js → chunk-7T3XAYP4.js} +1 -1
- package/{chunk-FKZ5I53D.js → chunk-ASLX43R3.js} +3 -3
- package/{chunk-5ZCDGBVU.js → chunk-C23TDXRG.js} +1 -1
- package/{chunk-H77JYU7F.js → chunk-DNRR3XMG.js} +12 -3
- package/{chunk-IBGFQR23.js → chunk-FLH4YC6W.js} +21 -0
- package/{chunk-XDSZO74H.js → chunk-FZUYGJZU.js} +7 -7
- package/{chunk-W2ZO5RZL.js → chunk-GIIAODRI.js} +4 -4
- package/{chunk-F5D3DVC5.js → chunk-HZXJ423P.js} +7 -3
- package/{chunk-CB65DPZ2.js → chunk-I7UMHYZX.js} +151 -27
- package/{chunk-2M2O6A4R.js → chunk-ISE4IRHF.js} +4 -4
- package/{chunk-TLY4VGMH.js → chunk-LHPEBLOU.js} +1 -1
- package/{chunk-EL4GVZK5.js → chunk-MKWPTN3C.js} +2 -2
- package/{chunk-QVPNKMUU.js → chunk-OAJ3PO3Z.js} +115 -19
- package/{chunk-7BHHCB5C.js → chunk-OVPHE4O7.js} +348 -24
- package/{chunk-KOFQTETH.js → chunk-PHJJPY5G.js} +3 -3
- package/{chunk-SV4WK3KX.js → chunk-PLG3OYCX.js} +2 -2
- package/{chunk-KMOOTBHM.js → chunk-QCSUWACA.js} +1 -1
- package/{chunk-6D54UN4T.js → chunk-SR2VOY5J.js} +1 -1
- package/chunk-T6FBP4OU.js +76 -0
- package/{chunk-A2TSRXZD.js → chunk-THSYN5EK.js} +1 -1
- package/{chunk-3D3IB4YN.js → chunk-TO23PR7J.js} +61 -27
- package/{chunk-OWMR2EDW.js → chunk-TPRK6IDA.js} +1 -1
- package/chunk-UGCKF5ZE.js +57 -0
- package/{chunk-SE2FSMBR.js → chunk-WF6KLKRN.js} +26 -10
- package/{chunk-I7SCSGUO.js → chunk-X4FVR4R5.js} +23 -18
- package/{chunk-VBDNOU76.js → chunk-ZJMJ7MCT.js} +1 -1
- package/{ci-76TAJGF5.js → ci-YSKNNO5M.js} +10 -10
- package/cli-package.json +1 -1
- package/{config-3UQXAYAA.js → config-CSPCDMR3.js} +9 -8
- package/{config-AFIHF54I.js → config-HO7GY3QT.js} +11 -10
- package/{create-5ADQTH6K.js → create-2TJT3AHJ.js} +19 -18
- package/{deprecate-RTQVLJDZ.js → deprecate-7FRJI2RL.js} +11 -11
- package/{dist-tag-V4DRDHWA.js → dist-tag-WCFF5OEG.js} +8 -8
- package/{docs-RRULRTKQ.js → docs-JMBPTU23.js} +17 -17
- package/{exec-NXQUCX3I.js → exec-FBOUKZZ2.js} +27 -18
- package/{exec-cache-KVZJHFZD.js → exec-cache-X3ZWM5S3.js} +16 -16
- package/{exec-local-53B5IRKG.js → exec-local-Y3KQC22N.js} +16 -15
- package/{help-EN4XUTMS.js → help-PUKVH5X7.js} +4 -4
- package/{init-4L6CQMIL.js → init-GOKAQXXZ.js} +10 -10
- package/{install-MHWLYW3X.js → install-XFN4UFOC.js} +116 -16
- package/{list-XZRF7TBW.js → list-43JFFG5D.js} +19 -19
- package/{login-6GRRY4H7.js → login-RSTZKNKN.js} +13 -12
- package/{logout-KI2AOYRT.js → logout-4576FFXZ.js} +8 -8
- package/{outdated-TWUPFRCD.js → outdated-ACQ5A2Y7.js} +31 -29
- package/{pack-2ZQLDYFD.js → pack-QQVJ3G25.js} +15 -12
- package/package.json +1 -1
- package/{ping-ZOTGLOKY.js → ping-QCDQQRO5.js} +8 -8
- package/{pkg-HRNOTFXB.js → pkg-CSOJV7UC.js} +17 -12
- package/{profile-5V3FFDMG.js → profile-VL4HPW3N.js} +8 -8
- package/{publish-7ZXEMWTW.js → publish-2YBO6ZXE.js} +23 -18
- package/{query-62UDNMGR.js → query-IHHFMJRT.js} +19 -19
- package/{registry-MQJJCWJY.js → registry-W7BRZZZ2.js} +5 -5
- package/registry-client-src-revalidate.js +132 -17
- package/{repo-HDUGP5PH.js → repo-L3BXAAWS.js} +17 -17
- package/{reporter-TGBPLNR5.js → reporter-5NYOHBO7.js} +11 -10
- package/{run-6NRDZD4T.js → run-AMUUVLTI.js} +16 -15
- package/{run-exec-I4IIXTLW.js → run-exec-5W3XWQZA.js} +16 -15
- package/security-archive-src-update-expired.js +46 -12
- package/{setup-UVXEFUUJ.js → setup-TFM4GJF7.js} +16 -15
- package/{src-QEJ6WZQ7.js → src-4CYCUWZL.js} +29 -24
- package/{src-6CJEMSVB.js → src-I3GMULFP.js} +6 -4
- package/{src-GP7VLT7P.js → src-LUTN2ODD.js} +58 -9
- package/{token-WTN27E7A.js → token-OANOBE3G.js} +8 -8
- package/{uninstall-ZJOKXIVQ.js → uninstall-YXTQ4AIZ.js} +12 -12
- package/{unpublish-LMUGR7GI.js → unpublish-SZXYMYIU.js} +8 -8
- package/{update-WVWMRUYY.js → update-FHLMWGIM.js} +26 -16
- package/{version-OJTRHNKV.js → version-ZWFCTU5V.js} +16 -11
- package/{view-6Q5B7ZYN.js → view-NFNJXMLV.js} +73 -25
- package/vlr.js +1 -1
- package/vlrx.js +1 -1
- package/vlt.js +1 -1
- package/vlx.js +1 -1
- package/vlxl.js +1 -1
- package/{whoami-SPF34TV6.js → whoami-O7GOSGCI.js} +8 -8
- package/chunk-A6FAI65V.js +0 -76
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
graphRun,
|
|
14
14
|
graphRunSync,
|
|
15
15
|
joinDepIDTuple
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PLG3OYCX.js";
|
|
17
17
|
import {
|
|
18
18
|
Spec
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5IJTPZXP.js";
|
|
20
20
|
import {
|
|
21
21
|
load,
|
|
22
22
|
parse as parse2,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
parse,
|
|
44
44
|
parseRange,
|
|
45
45
|
satisfies
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-FLH4YC6W.js";
|
|
47
47
|
import {
|
|
48
48
|
error
|
|
49
49
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -338,7 +338,7 @@ var require_promise_retry = __commonJS({
|
|
|
338
338
|
fn = temp;
|
|
339
339
|
}
|
|
340
340
|
operation = retry.operation(options);
|
|
341
|
-
return new Promise(function(
|
|
341
|
+
return new Promise(function(resolve6, reject) {
|
|
342
342
|
operation.attempt(function(number) {
|
|
343
343
|
Promise.resolve().then(function() {
|
|
344
344
|
return fn(function(err) {
|
|
@@ -347,7 +347,7 @@ var require_promise_retry = __commonJS({
|
|
|
347
347
|
}
|
|
348
348
|
throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
|
|
349
349
|
}, number);
|
|
350
|
-
}).then(
|
|
350
|
+
}).then(resolve6, function(err) {
|
|
351
351
|
if (isRetryError(err)) {
|
|
352
352
|
err = err.retried;
|
|
353
353
|
if (operation.retry(err || new Error())) {
|
|
@@ -3836,10 +3836,10 @@ var Minipass = class extends EventEmitter {
|
|
|
3836
3836
|
* Return a void Promise that resolves once the stream ends.
|
|
3837
3837
|
*/
|
|
3838
3838
|
async promise() {
|
|
3839
|
-
return new Promise((
|
|
3839
|
+
return new Promise((resolve6, reject) => {
|
|
3840
3840
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
3841
3841
|
this.on("error", (er) => reject(er));
|
|
3842
|
-
this.on("end", () =>
|
|
3842
|
+
this.on("end", () => resolve6());
|
|
3843
3843
|
});
|
|
3844
3844
|
}
|
|
3845
3845
|
/**
|
|
@@ -3863,7 +3863,7 @@ var Minipass = class extends EventEmitter {
|
|
|
3863
3863
|
return Promise.resolve({ done: false, value: res });
|
|
3864
3864
|
if (this[EOF])
|
|
3865
3865
|
return stop();
|
|
3866
|
-
let
|
|
3866
|
+
let resolve6;
|
|
3867
3867
|
let reject;
|
|
3868
3868
|
const onerr = (er) => {
|
|
3869
3869
|
this.off("data", ondata);
|
|
@@ -3877,19 +3877,19 @@ var Minipass = class extends EventEmitter {
|
|
|
3877
3877
|
this.off("end", onend);
|
|
3878
3878
|
this.off(DESTROYED, ondestroy);
|
|
3879
3879
|
this.pause();
|
|
3880
|
-
|
|
3880
|
+
resolve6({ value, done: !!this[EOF] });
|
|
3881
3881
|
};
|
|
3882
3882
|
const onend = () => {
|
|
3883
3883
|
this.off("error", onerr);
|
|
3884
3884
|
this.off("data", ondata);
|
|
3885
3885
|
this.off(DESTROYED, ondestroy);
|
|
3886
3886
|
stop();
|
|
3887
|
-
|
|
3887
|
+
resolve6({ done: true, value: void 0 });
|
|
3888
3888
|
};
|
|
3889
3889
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
3890
3890
|
return new Promise((res2, rej) => {
|
|
3891
3891
|
reject = rej;
|
|
3892
|
-
|
|
3892
|
+
resolve6 = res2;
|
|
3893
3893
|
this.once(DESTROYED, ondestroy);
|
|
3894
3894
|
this.once("error", onerr);
|
|
3895
3895
|
this.once("end", onend);
|
|
@@ -4865,9 +4865,9 @@ var PathBase = class {
|
|
|
4865
4865
|
if (this.#asyncReaddirInFlight) {
|
|
4866
4866
|
await this.#asyncReaddirInFlight;
|
|
4867
4867
|
} else {
|
|
4868
|
-
let
|
|
4868
|
+
let resolve6 = () => {
|
|
4869
4869
|
};
|
|
4870
|
-
this.#asyncReaddirInFlight = new Promise((res) =>
|
|
4870
|
+
this.#asyncReaddirInFlight = new Promise((res) => resolve6 = res);
|
|
4871
4871
|
try {
|
|
4872
4872
|
for (const e of await this.#fs.promises.readdir(fullpath, {
|
|
4873
4873
|
withFileTypes: true
|
|
@@ -4880,7 +4880,7 @@ var PathBase = class {
|
|
|
4880
4880
|
children.provisional = 0;
|
|
4881
4881
|
}
|
|
4882
4882
|
this.#asyncReaddirInFlight = void 0;
|
|
4883
|
-
|
|
4883
|
+
resolve6();
|
|
4884
4884
|
}
|
|
4885
4885
|
return children.slice(0, children.provisional);
|
|
4886
4886
|
}
|
|
@@ -5110,7 +5110,7 @@ var PathScurryBase = class {
|
|
|
5110
5110
|
*
|
|
5111
5111
|
* @internal
|
|
5112
5112
|
*/
|
|
5113
|
-
constructor(cwd = process.cwd(), pathImpl,
|
|
5113
|
+
constructor(cwd = process.cwd(), pathImpl, sep3, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
|
|
5114
5114
|
this.#fs = fsFromOption(fs);
|
|
5115
5115
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
5116
5116
|
cwd = fileURLToPath3(cwd);
|
|
@@ -5121,7 +5121,7 @@ var PathScurryBase = class {
|
|
|
5121
5121
|
this.#resolveCache = new ResolveCache();
|
|
5122
5122
|
this.#resolvePosixCache = new ResolveCache();
|
|
5123
5123
|
this.#children = new ChildrenCache(childrenCacheSize);
|
|
5124
|
-
const split = cwdPath.substring(this.rootPath.length).split(
|
|
5124
|
+
const split = cwdPath.substring(this.rootPath.length).split(sep3);
|
|
5125
5125
|
if (split.length === 1 && !split[0]) {
|
|
5126
5126
|
split.pop();
|
|
5127
5127
|
}
|
|
@@ -5718,7 +5718,126 @@ var Path = process.platform === "win32" ? PathWin32 : PathPosix;
|
|
|
5718
5718
|
var PathScurry = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
|
|
5719
5719
|
|
|
5720
5720
|
// ../../src/workspaces/src/index.ts
|
|
5721
|
-
import { basename as basename2, posix as posix2, resolve as
|
|
5721
|
+
import { basename as basename2, posix as posix2, resolve as resolve5 } from "node:path";
|
|
5722
|
+
|
|
5723
|
+
// ../../src/workspaces/src/pnpm-workspace.ts
|
|
5724
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
5725
|
+
import { resolve as resolve4 } from "node:path";
|
|
5726
|
+
var sep2 = (prev, flow) => !prev || (flow ? /[\s[,]/ : /\s/).test(prev);
|
|
5727
|
+
var skipQuoted = (s, i) => {
|
|
5728
|
+
const q = s.charAt(i);
|
|
5729
|
+
for (let j = i + 1; j < s.length && s.charAt(j) !== "\n"; j++) {
|
|
5730
|
+
const c = s.charAt(j);
|
|
5731
|
+
if (q === '"' && c === "\\") j++;
|
|
5732
|
+
else if (c === q) {
|
|
5733
|
+
if (q === "'" && s.charAt(j + 1) === "'") j++;
|
|
5734
|
+
else return j + 1;
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5737
|
+
return -1;
|
|
5738
|
+
};
|
|
5739
|
+
var isQuote = (c) => c === "'" || c === '"';
|
|
5740
|
+
var stripComment = (line, flow) => {
|
|
5741
|
+
for (let i = 0; i < line.length; i++) {
|
|
5742
|
+
const c = line.charAt(i);
|
|
5743
|
+
const prev = line.charAt(i - 1);
|
|
5744
|
+
if (isQuote(c) && sep2(prev, flow)) {
|
|
5745
|
+
const end = skipQuoted(line, i);
|
|
5746
|
+
if (end < 0) break;
|
|
5747
|
+
i = end - 1;
|
|
5748
|
+
} else if (c === "#" && sep2(prev, false)) {
|
|
5749
|
+
return line.slice(0, i).trimEnd();
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5752
|
+
return line.trimEnd();
|
|
5753
|
+
};
|
|
5754
|
+
var splitFlow = (s) => {
|
|
5755
|
+
const items = [];
|
|
5756
|
+
let start = 1;
|
|
5757
|
+
for (let i = 1; i < s.length; i++) {
|
|
5758
|
+
const c = s.charAt(i);
|
|
5759
|
+
if (isQuote(c) && sep2(s.charAt(i - 1), true)) {
|
|
5760
|
+
const end = skipQuoted(s, i);
|
|
5761
|
+
if (end < 0) return void 0;
|
|
5762
|
+
i = end - 1;
|
|
5763
|
+
} else if (c === "[" || c === "{") {
|
|
5764
|
+
return void 0;
|
|
5765
|
+
} else if (c === "," || c === "]") {
|
|
5766
|
+
const item = s.slice(start, i).trim();
|
|
5767
|
+
if (item) items.push(item);
|
|
5768
|
+
else if (c === ",") return void 0;
|
|
5769
|
+
if (c === "]") {
|
|
5770
|
+
return /^(?:\n|$)/.test(s.slice(i + 1)) ? items : void 0;
|
|
5771
|
+
}
|
|
5772
|
+
start = i + 1;
|
|
5773
|
+
}
|
|
5774
|
+
}
|
|
5775
|
+
return void 0;
|
|
5776
|
+
};
|
|
5777
|
+
var splitBlock = (lines) => {
|
|
5778
|
+
const items = [];
|
|
5779
|
+
let indent;
|
|
5780
|
+
for (const line of lines) {
|
|
5781
|
+
const l = stripComment(line, false);
|
|
5782
|
+
if (!l.trim()) continue;
|
|
5783
|
+
const m = /^ *- +(?=\S)/.exec(l);
|
|
5784
|
+
if (!m) {
|
|
5785
|
+
if (/^\S/.test(l) && l !== "-") break;
|
|
5786
|
+
return void 0;
|
|
5787
|
+
}
|
|
5788
|
+
const i = l.indexOf("-");
|
|
5789
|
+
indent ??= i;
|
|
5790
|
+
if (i !== indent) return void 0;
|
|
5791
|
+
items.push(l.slice(m[0].length));
|
|
5792
|
+
}
|
|
5793
|
+
return items;
|
|
5794
|
+
};
|
|
5795
|
+
var scalar = (s, flow) => {
|
|
5796
|
+
if (/^'(?:[^']|'')*'$/.test(s)) {
|
|
5797
|
+
return s.slice(1, -1).replace(/''/g, "'");
|
|
5798
|
+
}
|
|
5799
|
+
if (s.startsWith('"')) {
|
|
5800
|
+
try {
|
|
5801
|
+
return JSON.parse(s);
|
|
5802
|
+
} catch {
|
|
5803
|
+
return void 0;
|
|
5804
|
+
}
|
|
5805
|
+
}
|
|
5806
|
+
return /^[-?:,[\]{}#&*!|>'"%@`]/.test(s) || /: |:$|\s['"]/.test(s) || flow && /[{}\n]/.test(s) ? void 0 : s;
|
|
5807
|
+
};
|
|
5808
|
+
var parsePnpmWorkspacePackages = (yaml) => {
|
|
5809
|
+
const lines = yaml.replace(/^\uFEFF/, "").split(/\r?\n/);
|
|
5810
|
+
const keys = lines.flatMap((l, i) => {
|
|
5811
|
+
const m = /^(['"]?)packages\1[ \t]*:(?=[ \t]|$)/.exec(l);
|
|
5812
|
+
return m ? [{ i, value: l.slice(m[0].length) }] : [];
|
|
5813
|
+
});
|
|
5814
|
+
const [key, dup] = keys;
|
|
5815
|
+
if (!key || dup) return void 0;
|
|
5816
|
+
const flow = key.value.trimStart().startsWith("[");
|
|
5817
|
+
const rest = stripComment(key.value, flow).trim();
|
|
5818
|
+
const after = lines.slice(key.i + 1);
|
|
5819
|
+
const raw = flow ? splitFlow(
|
|
5820
|
+
[rest, ...after.map((l) => stripComment(l, true))].join("\n")
|
|
5821
|
+
) : rest ? void 0 : splitBlock(after);
|
|
5822
|
+
const out = raw?.map((r) => scalar(r, flow));
|
|
5823
|
+
if (!out?.every((v) => v !== void 0)) return void 0;
|
|
5824
|
+
const globs = out.filter((v) => v !== "." && v !== "./");
|
|
5825
|
+
return globs.some((g) => !g.startsWith("!")) ? globs : void 0;
|
|
5826
|
+
};
|
|
5827
|
+
var readPnpmWorkspacePackages = (projectRoot) => {
|
|
5828
|
+
let yaml;
|
|
5829
|
+
try {
|
|
5830
|
+
yaml = readFileSync3(
|
|
5831
|
+
resolve4(projectRoot, "pnpm-workspace.yaml"),
|
|
5832
|
+
"utf8"
|
|
5833
|
+
);
|
|
5834
|
+
} catch {
|
|
5835
|
+
return void 0;
|
|
5836
|
+
}
|
|
5837
|
+
return parsePnpmWorkspacePackages(yaml);
|
|
5838
|
+
};
|
|
5839
|
+
|
|
5840
|
+
// ../../src/workspaces/src/index.ts
|
|
5722
5841
|
var isSyntaxError = (err) => {
|
|
5723
5842
|
if (err instanceof SyntaxError) return true;
|
|
5724
5843
|
if (err instanceof Error) {
|
|
@@ -5812,11 +5931,14 @@ var resolveWSConfig = (projectRoot, packageJson = new PackageJson()) => {
|
|
|
5812
5931
|
return { config: asWSConfig(fromVltJson), source: "vlt.json" };
|
|
5813
5932
|
}
|
|
5814
5933
|
const workspaces = packageJson.maybeRead(projectRoot)?.workspaces;
|
|
5815
|
-
if (workspaces === void 0)
|
|
5934
|
+
if (workspaces === void 0) {
|
|
5935
|
+
const packages = readPnpmWorkspacePackages(projectRoot);
|
|
5936
|
+
return packages ? { config: { packages }, source: "pnpm-workspace.yaml" } : { config: {} };
|
|
5937
|
+
}
|
|
5816
5938
|
return {
|
|
5817
5939
|
config: asManifestWSConfig(
|
|
5818
5940
|
workspaces,
|
|
5819
|
-
|
|
5941
|
+
resolve5(projectRoot, "package.json")
|
|
5820
5942
|
),
|
|
5821
5943
|
source: "package.json"
|
|
5822
5944
|
};
|
|
@@ -5854,16 +5976,17 @@ var Monorepo = class _Monorepo {
|
|
|
5854
5976
|
return [...this.values()].length;
|
|
5855
5977
|
}
|
|
5856
5978
|
constructor(projectRoot, options = {}) {
|
|
5857
|
-
this.projectRoot =
|
|
5979
|
+
this.projectRoot = resolve5(projectRoot);
|
|
5858
5980
|
this.scurry = options.scurry ?? new PathScurry(projectRoot);
|
|
5859
5981
|
this.packageJson = options.packageJson ?? new PackageJson();
|
|
5860
5982
|
this.#config = options.config;
|
|
5861
5983
|
if (options.load) this.load(options.load);
|
|
5862
5984
|
}
|
|
5863
5985
|
/**
|
|
5864
|
-
* Load the workspace definitions from vlt.json,
|
|
5865
|
-
* package.json
|
|
5866
|
-
* into the effective
|
|
5986
|
+
* Load the workspace definitions from vlt.json, else the root
|
|
5987
|
+
* package.json, else pnpm-workspace.yaml (see {@link resolveWSConfig}),
|
|
5988
|
+
* canonicalizing the result into the effective
|
|
5989
|
+
* `{[group:string]:string[]}` form.
|
|
5867
5990
|
*
|
|
5868
5991
|
* Eg:
|
|
5869
5992
|
* - `"src/*"` => `{packages:["src/*"]}`
|
|
@@ -5941,7 +6064,7 @@ var Monorepo = class _Monorepo {
|
|
|
5941
6064
|
// Either load a workspace from disk, or from our internal set,
|
|
5942
6065
|
// and assign it to the named group
|
|
5943
6066
|
#loadWS(path2, group) {
|
|
5944
|
-
const fullpath =
|
|
6067
|
+
const fullpath = resolve5(this.projectRoot, path2);
|
|
5945
6068
|
const loaded = this.#workspaces.get(fullpath);
|
|
5946
6069
|
if (loaded) return loaded;
|
|
5947
6070
|
const fromCache = workspaceCache.get(fullpath);
|
|
@@ -6043,7 +6166,7 @@ var Monorepo = class _Monorepo {
|
|
|
6043
6166
|
throw error(
|
|
6044
6167
|
`Failed to parse package.json in workspace "${rel}"`,
|
|
6045
6168
|
{
|
|
6046
|
-
path:
|
|
6169
|
+
path: resolve5(this.projectRoot, rel, "package.json"),
|
|
6047
6170
|
cause: err
|
|
6048
6171
|
}
|
|
6049
6172
|
);
|
|
@@ -6235,8 +6358,9 @@ var Monorepo = class _Monorepo {
|
|
|
6235
6358
|
/**
|
|
6236
6359
|
* Convenience method to instantiate and load in one call.
|
|
6237
6360
|
* Returns undefined if the project is not a monorepo workspaces root,
|
|
6238
|
-
* meaning
|
|
6239
|
-
* workspaces. Otherwise returns
|
|
6361
|
+
* meaning none of `vlt.json`, the root `package.json` or
|
|
6362
|
+
* `pnpm-workspace.yaml` declares any workspaces. Otherwise returns
|
|
6363
|
+
* the loaded Monorepo.
|
|
6240
6364
|
*/
|
|
6241
6365
|
static maybeLoad(projectRoot, options = { load: {} }) {
|
|
6242
6366
|
if (options.config) {
|
|
@@ -11,18 +11,18 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
asUnknownSpecPrefix
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-THSYN5EK.js";
|
|
15
15
|
import {
|
|
16
16
|
addKey,
|
|
17
17
|
asDependency
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OVPHE4O7.js";
|
|
19
19
|
import {
|
|
20
20
|
joinDepIDTuple,
|
|
21
21
|
splitDepID
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-PLG3OYCX.js";
|
|
23
23
|
import {
|
|
24
24
|
Spec
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-5IJTPZXP.js";
|
|
26
26
|
|
|
27
27
|
// ../../src/cli-sdk/src/parse-add-remove-args.ts
|
|
28
28
|
import { isAbsolute, relative, resolve } from "node:path";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-SRWDPPLX.js";
|
|
16
16
|
import {
|
|
17
17
|
minimatch
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-I7UMHYZX.js";
|
|
19
19
|
import {
|
|
20
20
|
Spec
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5IJTPZXP.js";
|
|
22
22
|
import {
|
|
23
23
|
parse,
|
|
24
24
|
stringify
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
statusText,
|
|
19
19
|
storeRoot,
|
|
20
20
|
tokenRefusal
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SR2VOY5J.js";
|
|
22
22
|
import {
|
|
23
23
|
userAgent
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZJMJ7MCT.js";
|
|
25
25
|
import {
|
|
26
26
|
I,
|
|
27
27
|
logRequest
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
asError,
|
|
37
37
|
integrityHex,
|
|
38
38
|
integrityRE
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-FLH4YC6W.js";
|
|
40
40
|
import {
|
|
41
41
|
error
|
|
42
42
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -11273,14 +11273,14 @@ var require_retry_agent = __commonJS({
|
|
|
11273
11273
|
this.#options = options;
|
|
11274
11274
|
}
|
|
11275
11275
|
dispatch(opts, handler) {
|
|
11276
|
-
const
|
|
11276
|
+
const retry2 = new RetryHandler({
|
|
11277
11277
|
...opts,
|
|
11278
11278
|
retryOptions: this.#options
|
|
11279
11279
|
}, {
|
|
11280
11280
|
dispatch: this.#agent.dispatch.bind(this.#agent),
|
|
11281
11281
|
handler
|
|
11282
11282
|
});
|
|
11283
|
-
return this.#agent.dispatch(opts,
|
|
11283
|
+
return this.#agent.dispatch(opts, retry2);
|
|
11284
11284
|
}
|
|
11285
11285
|
close() {
|
|
11286
11286
|
return this.#agent.close();
|
|
@@ -13770,7 +13770,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
13770
13770
|
"use strict";
|
|
13771
13771
|
var { writeFile: writeFile3, readFile: readFile3, mkdir: mkdir3 } = __require("node:fs/promises");
|
|
13772
13772
|
var { dirname: dirname4, resolve: resolve5 } = __require("node:path");
|
|
13773
|
-
var { setTimeout:
|
|
13773
|
+
var { setTimeout: setTimeout4, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
13774
13774
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
13775
13775
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
13776
13776
|
function formatRequestKey(opts, headerFilters, matchOptions = {}) {
|
|
@@ -14104,7 +14104,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14104
14104
|
* Schedules a flush (debounced to avoid excessive writes)
|
|
14105
14105
|
*/
|
|
14106
14106
|
#scheduleFlush() {
|
|
14107
|
-
this.#flushTimeout =
|
|
14107
|
+
this.#flushTimeout = setTimeout4(() => {
|
|
14108
14108
|
this.saveSnapshots().catch(() => {
|
|
14109
14109
|
});
|
|
14110
14110
|
if (this.#autoFlush) {
|
|
@@ -19487,7 +19487,7 @@ var require_request2 = __commonJS({
|
|
|
19487
19487
|
var { URLSerializer } = require_data_url();
|
|
19488
19488
|
var { kConstruct } = require_symbols();
|
|
19489
19489
|
var assert = __require("node:assert");
|
|
19490
|
-
var { getMaxListeners, setMaxListeners, defaultMaxListeners } = __require("node:events");
|
|
19490
|
+
var { getMaxListeners, setMaxListeners: setMaxListeners2, defaultMaxListeners } = __require("node:events");
|
|
19491
19491
|
var kAbortController = /* @__PURE__ */ Symbol("abortController");
|
|
19492
19492
|
var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
|
|
19493
19493
|
signal.removeEventListener("abort", abort);
|
|
@@ -19727,7 +19727,7 @@ var require_request2 = __commonJS({
|
|
|
19727
19727
|
const acRef = new WeakRef(ac);
|
|
19728
19728
|
const abort = buildAbort(acRef);
|
|
19729
19729
|
if (abortSignalHasEventHandlerLeakWarning && getMaxListeners(signal) === defaultMaxListeners) {
|
|
19730
|
-
|
|
19730
|
+
setMaxListeners2(1500, signal);
|
|
19731
19731
|
}
|
|
19732
19732
|
util.addAbortListener(signal, abort);
|
|
19733
19733
|
requestFinalizer.register(ac, { signal, abort }, abort);
|
|
@@ -26153,8 +26153,9 @@ import { randomUUID } from "node:crypto";
|
|
|
26153
26153
|
import { closeSync, openSync, readFileSync as readFileSync2, readSync } from "node:fs";
|
|
26154
26154
|
import { availableParallelism } from "node:os";
|
|
26155
26155
|
import { dirname as dirname3, resolve as resolve4 } from "node:path";
|
|
26156
|
+
import { setMaxListeners } from "node:events";
|
|
26156
26157
|
import { pipeline } from "node:stream";
|
|
26157
|
-
import { setTimeout as
|
|
26158
|
+
import { setTimeout as setTimeout3 } from "node:timers/promises";
|
|
26158
26159
|
import { createGunzip } from "node:zlib";
|
|
26159
26160
|
|
|
26160
26161
|
// ../../src/registry-client/src/is-iterable.ts
|
|
@@ -26320,10 +26321,15 @@ var getKC = (identity) => {
|
|
|
26320
26321
|
return nkc;
|
|
26321
26322
|
};
|
|
26322
26323
|
var isToken = (t) => typeof t === "string" && (t.startsWith("Bearer ") || t.startsWith("Basic "));
|
|
26323
|
-
var deleteToken = async (registry, identity) => {
|
|
26324
|
+
var deleteToken = async (registry, identity, token) => {
|
|
26324
26325
|
const kc = getKC(identity);
|
|
26325
26326
|
await kc.load();
|
|
26326
26327
|
kc.delete(normalizeRegistryKey(registry));
|
|
26328
|
+
if (token) {
|
|
26329
|
+
for (const key of kc.keysSync()) {
|
|
26330
|
+
if (kc.getSync(key) === token) kc.delete(key);
|
|
26331
|
+
}
|
|
26332
|
+
}
|
|
26327
26333
|
await kc.save();
|
|
26328
26334
|
};
|
|
26329
26335
|
var setToken = async (registry, token, identity) => {
|
|
@@ -26346,9 +26352,19 @@ var getToken = async (registry, identity) => {
|
|
|
26346
26352
|
if (tok) return `Bearer ${tok}`;
|
|
26347
26353
|
return kc.get(key);
|
|
26348
26354
|
};
|
|
26349
|
-
var
|
|
26355
|
+
var registryKeys = (o) => [
|
|
26356
|
+
...new Set(
|
|
26357
|
+
[
|
|
26358
|
+
o.registry,
|
|
26359
|
+
...Object.values(o.registries ?? {}),
|
|
26360
|
+
...Object.values(o["scoped-registries"] ?? {}),
|
|
26361
|
+
...Object.values(o["jsr-registries"] ?? {})
|
|
26362
|
+
].filter((u) => !!u && URL.canParse(u)).map(normalizeRegistryKey)
|
|
26363
|
+
)
|
|
26364
|
+
];
|
|
26365
|
+
var getTokenByURL = async (requestUrl, identity, keys = []) => {
|
|
26350
26366
|
const normalized = normalizeRegistryKey(requestUrl);
|
|
26351
|
-
const candidates = [...runtimeTokens.keys()];
|
|
26367
|
+
const candidates = [...runtimeTokens.keys(), ...keys];
|
|
26352
26368
|
const envReg = process.env.VLT_REGISTRY;
|
|
26353
26369
|
if (envReg) {
|
|
26354
26370
|
candidates.push(normalizeRegistryKey(envReg));
|
|
@@ -27393,6 +27409,40 @@ var readBody = async (response, entry) => {
|
|
|
27393
27409
|
});
|
|
27394
27410
|
};
|
|
27395
27411
|
|
|
27412
|
+
// ../../src/registry-client/src/retry.ts
|
|
27413
|
+
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
27414
|
+
var retry = (err, { state: { counter }, opts }, cb) => {
|
|
27415
|
+
const { code, statusCode, headers } = err;
|
|
27416
|
+
const { method } = opts;
|
|
27417
|
+
const { signal } = opts;
|
|
27418
|
+
const {
|
|
27419
|
+
maxRetries,
|
|
27420
|
+
minTimeout,
|
|
27421
|
+
maxTimeout,
|
|
27422
|
+
timeoutFactor,
|
|
27423
|
+
methods,
|
|
27424
|
+
statusCodes,
|
|
27425
|
+
errorCodes
|
|
27426
|
+
} = opts.retryOptions;
|
|
27427
|
+
if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code) || !methods.includes(method) || typeof statusCode === "number" && !statusCodes.includes(statusCode) || counter > maxRetries) {
|
|
27428
|
+
cb(err);
|
|
27429
|
+
return;
|
|
27430
|
+
}
|
|
27431
|
+
const ra = String(headers?.["retry-after"] ?? "");
|
|
27432
|
+
const secs = Number(ra);
|
|
27433
|
+
const after = Number.isNaN(secs) ? Date.parse(ra) - Date.now() : secs * 1e3;
|
|
27434
|
+
const wait = Math.min(
|
|
27435
|
+
after > 0 ? after : minTimeout * timeoutFactor ** (counter - 1),
|
|
27436
|
+
maxTimeout
|
|
27437
|
+
);
|
|
27438
|
+
setTimeout2(wait, null, {
|
|
27439
|
+
signal: signal instanceof AbortSignal ? signal : void 0
|
|
27440
|
+
}).then(
|
|
27441
|
+
() => cb(null),
|
|
27442
|
+
(er) => cb(er)
|
|
27443
|
+
);
|
|
27444
|
+
};
|
|
27445
|
+
|
|
27396
27446
|
// ../../src/registry-client/src/oidc.ts
|
|
27397
27447
|
var import_undici2 = __toESM(require_undici(), 1);
|
|
27398
27448
|
var log2 = (...args) => (
|
|
@@ -27573,10 +27623,22 @@ var RegistryClient = class {
|
|
|
27573
27623
|
agent;
|
|
27574
27624
|
cache;
|
|
27575
27625
|
identity;
|
|
27626
|
+
/** configured registry keys; `VLT_TOKEN_<key>` applies under each */
|
|
27627
|
+
registryKeys;
|
|
27576
27628
|
staleWhileRevalidateFactor;
|
|
27577
27629
|
#session = randomUUID();
|
|
27578
27630
|
#decoded = /* @__PURE__ */ new WeakMap();
|
|
27631
|
+
// request() calls not settled yet, awaited by drain()
|
|
27632
|
+
#inFlight = /* @__PURE__ */ new Set();
|
|
27633
|
+
#signal;
|
|
27634
|
+
/** the request's own signal joined with the client's */
|
|
27635
|
+
#withSignal(own) {
|
|
27636
|
+
const c = this.#signal;
|
|
27637
|
+
return !c || own === c || !(own instanceof AbortSignal) ? own ?? c : AbortSignal.any([own, c]);
|
|
27638
|
+
}
|
|
27579
27639
|
constructor(options) {
|
|
27640
|
+
this.#signal = options.signal;
|
|
27641
|
+
if (options.signal) setMaxListeners(0, options.signal);
|
|
27580
27642
|
const {
|
|
27581
27643
|
cache = xdg.cache(),
|
|
27582
27644
|
"fetch-retry-factor": timeoutFactor = 2,
|
|
@@ -27588,6 +27650,7 @@ var RegistryClient = class {
|
|
|
27588
27650
|
// 48h for a 5min cache
|
|
27589
27651
|
} = options;
|
|
27590
27652
|
this.identity = identity;
|
|
27653
|
+
this.registryKeys = registryKeys(options);
|
|
27591
27654
|
this.staleWhileRevalidateFactor = staleWhileRevalidateFactor;
|
|
27592
27655
|
const path = resolve4(cache, "registry-client");
|
|
27593
27656
|
const store = options.storeRoot ?? storeRoot(cache);
|
|
@@ -27608,6 +27671,7 @@ var RegistryClient = class {
|
|
|
27608
27671
|
minTimeout,
|
|
27609
27672
|
maxTimeout,
|
|
27610
27673
|
retryAfter: true,
|
|
27674
|
+
retry,
|
|
27611
27675
|
errorCodes: [
|
|
27612
27676
|
"ECONNREFUSED",
|
|
27613
27677
|
"ECONNRESET",
|
|
@@ -27710,7 +27774,7 @@ var RegistryClient = class {
|
|
|
27710
27774
|
}
|
|
27711
27775
|
}
|
|
27712
27776
|
} finally {
|
|
27713
|
-
await deleteToken(registry, this.identity);
|
|
27777
|
+
await deleteToken(registry, this.identity, tok);
|
|
27714
27778
|
}
|
|
27715
27779
|
}
|
|
27716
27780
|
/**
|
|
@@ -27811,7 +27875,7 @@ var RegistryClient = class {
|
|
|
27811
27875
|
const rt = response.getHeaderString("retry-after");
|
|
27812
27876
|
const retryAfter = rt ? Number(rt) : -1;
|
|
27813
27877
|
if (retryAfter > 0) {
|
|
27814
|
-
await
|
|
27878
|
+
await setTimeout3(retryAfter * 1e3, null, { signal });
|
|
27815
27879
|
}
|
|
27816
27880
|
return await this.#checkLogin(url, options);
|
|
27817
27881
|
}
|
|
@@ -27951,6 +28015,7 @@ var RegistryClient = class {
|
|
|
27951
28015
|
const u = typeof url === "string" ? new URL(url) : url;
|
|
27952
28016
|
const o = {
|
|
27953
28017
|
...options,
|
|
28018
|
+
signal: this.#withSignal(options.signal),
|
|
27954
28019
|
method: options.method ?? "GET",
|
|
27955
28020
|
path: u.pathname.replace(/\/+$/, "") + u.search,
|
|
27956
28021
|
origin: u.origin,
|
|
@@ -27971,7 +28036,11 @@ var RegistryClient = class {
|
|
|
27971
28036
|
o.headers = addHeader(
|
|
27972
28037
|
o.headers,
|
|
27973
28038
|
"authorization",
|
|
27974
|
-
await getTokenByURL(
|
|
28039
|
+
await getTokenByURL(
|
|
28040
|
+
String(u),
|
|
28041
|
+
this.identity,
|
|
28042
|
+
this.registryKeys
|
|
28043
|
+
)
|
|
27975
28044
|
);
|
|
27976
28045
|
logRequest(url, "start", { method: o.method });
|
|
27977
28046
|
const requestStart = Date.now();
|
|
@@ -27994,7 +28063,29 @@ var RegistryClient = class {
|
|
|
27994
28063
|
}
|
|
27995
28064
|
return { statusCode: response.statusCode, body };
|
|
27996
28065
|
}
|
|
28066
|
+
/**
|
|
28067
|
+
* Settle in-flight requests and their cache writes. Await before
|
|
28068
|
+
* removing the cache dir.
|
|
28069
|
+
*/
|
|
28070
|
+
async drain() {
|
|
28071
|
+
do {
|
|
28072
|
+
await Promise.all(this.#inFlight);
|
|
28073
|
+
await this.cache.promise();
|
|
28074
|
+
} while (this.#inFlight.size);
|
|
28075
|
+
}
|
|
27997
28076
|
async request(url, options = {}) {
|
|
28077
|
+
options.signal = this.#withSignal(options.signal);
|
|
28078
|
+
let settle;
|
|
28079
|
+
const tracked = new Promise((res) => settle = res);
|
|
28080
|
+
this.#inFlight.add(tracked);
|
|
28081
|
+
try {
|
|
28082
|
+
return await this.#request(url, options);
|
|
28083
|
+
} finally {
|
|
28084
|
+
this.#inFlight.delete(tracked);
|
|
28085
|
+
settle();
|
|
28086
|
+
}
|
|
28087
|
+
}
|
|
28088
|
+
async #request(url, options) {
|
|
27998
28089
|
const u = typeof url === "string" ? new URL(url) : url;
|
|
27999
28090
|
const {
|
|
28000
28091
|
method = "GET",
|
|
@@ -28070,7 +28161,11 @@ var RegistryClient = class {
|
|
|
28070
28161
|
options.headers = addHeader(
|
|
28071
28162
|
options.headers,
|
|
28072
28163
|
"authorization",
|
|
28073
|
-
await getTokenByURL(
|
|
28164
|
+
await getTokenByURL(
|
|
28165
|
+
String(u),
|
|
28166
|
+
this.identity,
|
|
28167
|
+
this.registryKeys
|
|
28168
|
+
)
|
|
28074
28169
|
);
|
|
28075
28170
|
}
|
|
28076
28171
|
let response = null;
|
|
@@ -28134,7 +28229,7 @@ var RegistryClient = class {
|
|
|
28134
28229
|
if (response.statusCode === 401) {
|
|
28135
28230
|
const otpResult = await otplease(this, options, response);
|
|
28136
28231
|
if (otpResult && "retry" in otpResult) {
|
|
28137
|
-
return await this
|
|
28232
|
+
return await this.#request(url, otpResult.retry);
|
|
28138
28233
|
}
|
|
28139
28234
|
if (otpResult && "bodyConsumed" in otpResult) {
|
|
28140
28235
|
consumedBody = otpResult.bodyConsumed;
|
|
@@ -28162,7 +28257,7 @@ var RegistryClient = class {
|
|
|
28162
28257
|
response.body.resume();
|
|
28163
28258
|
const [nextURL, nextOptions] = redirect(options, result, url);
|
|
28164
28259
|
if (nextOptions && nextURL) {
|
|
28165
|
-
return await this
|
|
28260
|
+
return await this.#request(nextURL, nextOptions);
|
|
28166
28261
|
}
|
|
28167
28262
|
return result;
|
|
28168
28263
|
}
|
|
@@ -28188,6 +28283,7 @@ export {
|
|
|
28188
28283
|
deleteToken,
|
|
28189
28284
|
setToken,
|
|
28190
28285
|
getToken,
|
|
28286
|
+
registryKeys,
|
|
28191
28287
|
getTokenByURL,
|
|
28192
28288
|
CacheEntry,
|
|
28193
28289
|
oidc,
|