@vltpkg/cli-js 1.0.9 → 1.0.10
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-5DJJIIGD.js → access-4RPC3X5N.js} +3 -3
- package/{bugs-NRHU4ENC.js → bugs-K6QLQLL4.js} +8 -8
- package/{build-5VZJTEBD.js → build-VD4L5IED.js} +3 -3
- package/{cache-QZ5XII4U.js → cache-Q6FUUEQF.js} +5 -5
- package/{chunk-USRMYD4F.js → chunk-3564IL5W.js} +1 -1
- package/{chunk-YAIKXFLN.js → chunk-5HBKYSTX.js} +1 -1
- package/{chunk-PTR5IGFQ.js → chunk-5HPGL5WS.js} +1 -1
- package/{chunk-A6TBJ4AB.js → chunk-B5IILBX7.js} +3 -3
- package/{chunk-KCXN2GTX.js → chunk-BSPUKIWY.js} +1 -1
- package/{chunk-SBEZ7RUC.js → chunk-DAS7TVRN.js} +2 -2
- package/{chunk-LHMEJF6J.js → chunk-FUCQ7ARR.js} +68 -17
- package/{chunk-XISRK3R5.js → chunk-MNK55XSE.js} +17 -0
- package/{chunk-EBXBZ2Y5.js → chunk-NA732FNL.js} +2 -2
- package/{chunk-ATYE2HQV.js → chunk-NWLS3VOQ.js} +11 -4
- package/{chunk-HRY5MJCA.js → chunk-P5S2TFCF.js} +22 -10
- package/{chunk-6WMR7BLF.js → chunk-TYRKIWGF.js} +2 -2
- package/{chunk-MXCWH7WC.js → chunk-VL7RJVNN.js} +24 -2
- package/{chunk-6NQBG3ZR.js → chunk-WAYVHANF.js} +2 -2
- package/{chunk-GKCU7R4B.js → chunk-XUP35M5Q.js} +4 -4
- package/chunk-Y3QEV76Q.js +75 -0
- package/{chunk-2HDWM6AD.js → chunk-ZNCVQQDT.js} +1 -1
- package/{ci-MBYD4AGJ.js → ci-G4PJWJQE.js} +3 -3
- package/cli-package.json +1 -1
- package/{config-RQKPUW5B.js → config-66ARNESN.js} +3 -3
- package/{config-DTZ7EWQF.js → config-WTIWWXRD.js} +4 -4
- package/{create-CYTNZ66Z.js → create-DF6RQTHC.js} +9 -9
- package/{deprecate-H3L4MPZS.js → deprecate-2KTC2HKH.js} +4 -4
- package/{dist-tag-CZHTW7C6.js → dist-tag-QKJQIOGN.js} +3 -3
- package/{docs-Z76UCNLH.js → docs-YSWJTGYX.js} +8 -8
- package/{exec-PGPFYCAM.js → exec-5XIMPSBI.js} +9 -9
- package/{exec-cache-HPILZWUY.js → exec-cache-OGX7WR5P.js} +7 -7
- package/{exec-local-VKDC6XAQ.js → exec-local-SB7EPYED.js} +7 -7
- package/{help-QPZESL4Y.js → help-GMCQHGVN.js} +4 -4
- package/{init-MMQV6UC5.js → init-KXIIWHBA.js} +4 -4
- package/{install-KZPDV66V.js → install-ODTEMAMS.js} +4 -4
- package/{list-PJ2U4FE7.js → list-QS4FLJSU.js} +9 -9
- package/{login-L3D5FQGT.js → login-6TGYRY43.js} +5 -5
- package/{logout-SRZ574SQ.js → logout-GOAB7KHJ.js} +3 -3
- package/{pack-OI5JLA3R.js → pack-PJDH6PKP.js} +4 -4
- package/package.json +1 -1
- package/{ping-VQ662NAP.js → ping-ANBW2IRW.js} +3 -3
- package/{pkg-HNPRMTWV.js → pkg-GZWUXU65.js} +5 -5
- package/{profile-Z7IOODZ4.js → profile-BLY74CMB.js} +3 -3
- package/{publish-KTUUX25U.js → publish-W2KOTNMB.js} +19 -7
- package/{query-MV5HKRIT.js → query-3PUMU5ON.js} +9 -9
- package/{registry-BMWXMQS4.js → registry-ONSDWNPV.js} +2 -2
- package/registry-client-package.json +1 -1
- package/registry-client-src-revalidate.js +11 -4
- package/{repo-ZBCD65WE.js → repo-LZ6STH4C.js} +8 -8
- package/{run-QJK5LA6Q.js → run-JMIBADHE.js} +7 -7
- package/{run-exec-EAASMT5O.js → run-exec-JEKM2O53.js} +7 -7
- package/{setup-Q7NTAV26.js → setup-BTBU3NAI.js} +7 -7
- package/{src-YVODDQYK.js → src-23VBKASP.js} +7 -7
- package/{src-MEEFRFWA.js → src-J4BAYOBO.js} +1 -1
- package/{token-NQRHTTKG.js → token-PUJ7QN6D.js} +3 -3
- package/{uninstall-E2SVGYI3.js → uninstall-OTISP2T7.js} +4 -4
- package/{unpublish-IE4KYVM4.js → unpublish-X75EEQAN.js} +3 -3
- package/{update-KZOWARII.js → update-CKXX5POE.js} +3 -3
- package/{version-T6PTPZPR.js → version-24B2X7M7.js} +18 -12
- package/{view-MVYV7YZ2.js → view-Q7MAQ6R3.js} +3 -3
- 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-A5RM2Z7Z.js → whoami-S6CQZFE3.js} +3 -3
- package/chunk-XEPCV7DP.js +0 -75
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
} from "./chunk-5JFRXIK2.js";
|
|
15
15
|
import {
|
|
16
16
|
commandUsage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5HPGL5WS.js";
|
|
18
18
|
import "./chunk-XKVU23NC.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-MNK55XSE.js";
|
|
20
20
|
import {
|
|
21
21
|
RegistryClient
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NWLS3VOQ.js";
|
|
23
23
|
import "./chunk-HAYXR3MW.js";
|
|
24
24
|
import "./chunk-E74WGW5C.js";
|
|
25
25
|
import "./chunk-LPIBYUMT.js";
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
} from "./chunk-CLVRCGOZ.js";
|
|
15
15
|
import {
|
|
16
16
|
openUrl
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZNCVQQDT.js";
|
|
18
18
|
import {
|
|
19
19
|
createHostContextsMap
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WAYVHANF.js";
|
|
21
21
|
import {
|
|
22
22
|
PackageInfoClient
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-P5S2TFCF.js";
|
|
24
24
|
import "./chunk-ZWKI5OSF.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-VL7RJVNN.js";
|
|
26
|
+
import "./chunk-5HBKYSTX.js";
|
|
27
27
|
import "./chunk-G2YT2GWF.js";
|
|
28
28
|
import "./chunk-GDJ7JT2R.js";
|
|
29
29
|
import "./chunk-5JFRXIK2.js";
|
|
@@ -31,7 +31,7 @@ import "./chunk-WGDTG44V.js";
|
|
|
31
31
|
import {
|
|
32
32
|
Query,
|
|
33
33
|
actual
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
35
35
|
import {
|
|
36
36
|
SecurityArchive
|
|
37
37
|
} from "./chunk-2YJ5MESP.js";
|
|
@@ -39,11 +39,11 @@ import "./chunk-USTJECVS.js";
|
|
|
39
39
|
import "./chunk-YOE3VZFX.js";
|
|
40
40
|
import {
|
|
41
41
|
commandUsage
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-5HPGL5WS.js";
|
|
43
43
|
import {
|
|
44
44
|
Spec
|
|
45
45
|
} from "./chunk-XKVU23NC.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-MNK55XSE.js";
|
|
47
47
|
import "./chunk-4KCU2KZL.js";
|
|
48
48
|
import "./chunk-HTOTG4TS.js";
|
|
49
49
|
import "./chunk-HAYXR3MW.js";
|
|
@@ -11,15 +11,15 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
build
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
15
15
|
import "./chunk-2YJ5MESP.js";
|
|
16
16
|
import "./chunk-USTJECVS.js";
|
|
17
17
|
import "./chunk-YOE3VZFX.js";
|
|
18
18
|
import {
|
|
19
19
|
commandUsage
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5HPGL5WS.js";
|
|
21
21
|
import "./chunk-XKVU23NC.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-MNK55XSE.js";
|
|
23
23
|
import "./chunk-HTOTG4TS.js";
|
|
24
24
|
import "./chunk-E74WGW5C.js";
|
|
25
25
|
import "./chunk-LPIBYUMT.js";
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
stderr,
|
|
17
17
|
stdout
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-VL7RJVNN.js";
|
|
19
|
+
import "./chunk-5HBKYSTX.js";
|
|
20
20
|
import "./chunk-G2YT2GWF.js";
|
|
21
21
|
import "./chunk-GDJ7JT2R.js";
|
|
22
22
|
import "./chunk-5JFRXIK2.js";
|
|
@@ -24,17 +24,17 @@ import "./chunk-WGDTG44V.js";
|
|
|
24
24
|
import "./chunk-YOE3VZFX.js";
|
|
25
25
|
import {
|
|
26
26
|
commandUsage
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5HPGL5WS.js";
|
|
28
28
|
import {
|
|
29
29
|
Spec
|
|
30
30
|
} from "./chunk-XKVU23NC.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-MNK55XSE.js";
|
|
32
32
|
import {
|
|
33
33
|
ViewClass
|
|
34
34
|
} from "./chunk-4KCU2KZL.js";
|
|
35
35
|
import {
|
|
36
36
|
CacheEntry
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-NWLS3VOQ.js";
|
|
38
38
|
import "./chunk-HAYXR3MW.js";
|
|
39
39
|
import "./chunk-E74WGW5C.js";
|
|
40
40
|
import "./chunk-LPIBYUMT.js";
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
} from "./chunk-RIYFGX27.js";
|
|
15
15
|
import {
|
|
16
16
|
createHostContextsMap
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WAYVHANF.js";
|
|
18
18
|
import {
|
|
19
19
|
stderr,
|
|
20
20
|
stdout,
|
|
21
21
|
styleTextStdout
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VL7RJVNN.js";
|
|
23
23
|
import {
|
|
24
24
|
require_emoji_regex
|
|
25
25
|
} from "./chunk-VTEFO2FT.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
Query,
|
|
28
28
|
actual,
|
|
29
29
|
isRunResult
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
31
31
|
import {
|
|
32
32
|
Monorepo
|
|
33
33
|
} from "./chunk-USTJECVS.js";
|
|
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
init,
|
|
14
14
|
install
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
16
16
|
import {
|
|
17
17
|
asWSConfig,
|
|
18
18
|
assertWSConfig,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-USTJECVS.js";
|
|
21
21
|
import {
|
|
22
22
|
commandUsage
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5HPGL5WS.js";
|
|
24
24
|
import {
|
|
25
25
|
load,
|
|
26
26
|
save
|
|
@@ -5740,6 +5740,39 @@ var parse2 = (query) => {
|
|
|
5740
5740
|
return (0, import_postcss_selector_parser.default)(transformAst).astSync(escapedQuery);
|
|
5741
5741
|
};
|
|
5742
5742
|
|
|
5743
|
+
// ../../src/query/src/error.ts
|
|
5744
|
+
var selectorText = (node) => {
|
|
5745
|
+
const text = node.toString === Object.prototype.toString ? "" : String(node).trim().replace(/\\(.)/g, "$1");
|
|
5746
|
+
return text || (node.value ?? node.type);
|
|
5747
|
+
};
|
|
5748
|
+
var queryError = (message, node, extra) => error(message, {
|
|
5749
|
+
code: "EQUERY",
|
|
5750
|
+
found: selectorText(node),
|
|
5751
|
+
...extra
|
|
5752
|
+
});
|
|
5753
|
+
var distance = (a, b, max) => {
|
|
5754
|
+
if (Math.abs(a.length - b.length) > max) return max + 1;
|
|
5755
|
+
let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
5756
|
+
for (let i = 1; i <= a.length; i++) {
|
|
5757
|
+
const row = [i];
|
|
5758
|
+
let best = i;
|
|
5759
|
+
for (let j = 1; j <= b.length; j++) {
|
|
5760
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
5761
|
+
const d = Math.min(
|
|
5762
|
+
(row[j - 1] ?? 0) + 1,
|
|
5763
|
+
(prev[j] ?? 0) + 1,
|
|
5764
|
+
(prev[j - 1] ?? 0) + cost
|
|
5765
|
+
);
|
|
5766
|
+
row.push(d);
|
|
5767
|
+
if (d < best) best = d;
|
|
5768
|
+
}
|
|
5769
|
+
if (best > max) return max + 1;
|
|
5770
|
+
prev = row;
|
|
5771
|
+
}
|
|
5772
|
+
return prev[b.length] ?? max + 1;
|
|
5773
|
+
};
|
|
5774
|
+
var didYouMean = (value, candidates, max = 2) => [...candidates].map((c) => [c, distance(value, c, max)]).filter(([, d]) => d <= max).sort(([a, x], [b, y]) => x - y || a.localeCompare(b, "en")).map(([c]) => c);
|
|
5775
|
+
|
|
5743
5776
|
// ../../src/query/src/pseudo/helpers.ts
|
|
5744
5777
|
var removeNode = (state, node) => {
|
|
5745
5778
|
for (const edge of node.edgesIn) {
|
|
@@ -5898,9 +5931,11 @@ var attribute = async (state) => {
|
|
|
5898
5931
|
if (state.loose) {
|
|
5899
5932
|
return state;
|
|
5900
5933
|
}
|
|
5901
|
-
throw
|
|
5902
|
-
|
|
5903
|
-
|
|
5934
|
+
throw queryError(
|
|
5935
|
+
`Unsupported attribute operator: ${curr.operator}`,
|
|
5936
|
+
state.current,
|
|
5937
|
+
{ validOptions: [...attributeSelectorsMap.keys()] }
|
|
5938
|
+
);
|
|
5904
5939
|
}
|
|
5905
5940
|
const value = curr.value || "";
|
|
5906
5941
|
const propertyName = curr.attribute;
|
|
@@ -5985,9 +6020,11 @@ var combinator = async (state) => {
|
|
|
5985
6020
|
if (state.loose) {
|
|
5986
6021
|
return state;
|
|
5987
6022
|
}
|
|
5988
|
-
throw
|
|
5989
|
-
|
|
5990
|
-
|
|
6023
|
+
throw queryError(
|
|
6024
|
+
`Unsupported combinator: ${state.current.value}`,
|
|
6025
|
+
state.current,
|
|
6026
|
+
{ validOptions: [...combinatorSelectorsMap.keys()] }
|
|
6027
|
+
);
|
|
5991
6028
|
}
|
|
5992
6029
|
return parserFn(state);
|
|
5993
6030
|
};
|
|
@@ -8432,6 +8469,9 @@ var pseudoSelectors = new Map(
|
|
|
8432
8469
|
workspace
|
|
8433
8470
|
})
|
|
8434
8471
|
);
|
|
8472
|
+
var pseudoSelectorNames = new Set(
|
|
8473
|
+
pseudoSelectors.keys()
|
|
8474
|
+
);
|
|
8435
8475
|
var pseudo = async (state) => {
|
|
8436
8476
|
await state.cancellable();
|
|
8437
8477
|
const curr = asPseudoNode(state.current);
|
|
@@ -8442,9 +8482,15 @@ var pseudo = async (state) => {
|
|
|
8442
8482
|
state.partial.nodes.clear();
|
|
8443
8483
|
return state;
|
|
8444
8484
|
}
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8485
|
+
const name = selectorText(state.current).replace(/^:/, "").replace(/\(.*$/s, "");
|
|
8486
|
+
const suggestions = didYouMean(name, pseudoSelectorNames).map(
|
|
8487
|
+
(n) => `:${n}`
|
|
8488
|
+
);
|
|
8489
|
+
throw queryError(
|
|
8490
|
+
`Unsupported pseudo-class: ${state.current.value}`,
|
|
8491
|
+
state.current,
|
|
8492
|
+
suggestions.length > 1 ? { validOptions: suggestions } : { wanted: suggestions[0] }
|
|
8493
|
+
);
|
|
8448
8494
|
}
|
|
8449
8495
|
const result = await parserFn(state);
|
|
8450
8496
|
const pseudoValue = curr.value.slice(1);
|
|
@@ -8456,11 +8502,18 @@ var pseudo = async (state) => {
|
|
|
8456
8502
|
|
|
8457
8503
|
// ../../src/query/src/index.ts
|
|
8458
8504
|
var noopFn = async (state) => state;
|
|
8505
|
+
var unsupportedName = (state) => {
|
|
8506
|
+
const text = selectorText(state.current);
|
|
8507
|
+
const name = text.replace(/^[.#]/, "");
|
|
8508
|
+
return queryError("Unsupported selector", state.current, {
|
|
8509
|
+
wanted: pseudoSelectorNames.has(name) ? `:${name}` : name ? `#${name}` : void 0
|
|
8510
|
+
});
|
|
8511
|
+
};
|
|
8459
8512
|
var selectors = {
|
|
8460
8513
|
attribute,
|
|
8461
|
-
/* c8 ignore start */
|
|
8514
|
+
/* c8 ignore start -- dss-parser reports `.foo` as an escaped tag */
|
|
8462
8515
|
class: async (state) => {
|
|
8463
|
-
throw
|
|
8516
|
+
throw unsupportedName(state);
|
|
8464
8517
|
},
|
|
8465
8518
|
/* c8 ignore end */
|
|
8466
8519
|
combinator,
|
|
@@ -8482,11 +8535,11 @@ var selectors = {
|
|
|
8482
8535
|
return state;
|
|
8483
8536
|
},
|
|
8484
8537
|
string: async (state) => {
|
|
8485
|
-
throw
|
|
8538
|
+
throw queryError("Unsupported selector", state.current);
|
|
8486
8539
|
},
|
|
8487
8540
|
tag: async (state) => {
|
|
8488
8541
|
if (state.current.value !== "{" && state.current.value !== "}") {
|
|
8489
|
-
throw
|
|
8542
|
+
throw unsupportedName(state);
|
|
8490
8543
|
}
|
|
8491
8544
|
return state;
|
|
8492
8545
|
},
|
|
@@ -8502,11 +8555,9 @@ var walk = async (state) => {
|
|
|
8502
8555
|
if (state.loose) {
|
|
8503
8556
|
return state;
|
|
8504
8557
|
}
|
|
8505
|
-
throw
|
|
8558
|
+
throw queryError(
|
|
8506
8559
|
`Missing parser for query node: ${state.current.type}`,
|
|
8507
|
-
|
|
8508
|
-
found: state.current
|
|
8509
|
-
}
|
|
8560
|
+
state.current
|
|
8510
8561
|
);
|
|
8511
8562
|
}
|
|
8512
8563
|
state = await parserFn(state);
|
|
@@ -1745,6 +1745,23 @@ var definition = j2.heading("Configuration").description(
|
|
|
1745
1745
|
description: "Set the access level of the package",
|
|
1746
1746
|
validOptions: ["public", "restricted"]
|
|
1747
1747
|
}
|
|
1748
|
+
}).flag({
|
|
1749
|
+
"git-tag-version": {
|
|
1750
|
+
description: `Commit and tag the version change made by \`vlt version\`.
|
|
1751
|
+
|
|
1752
|
+
Set \`--no-git-tag-version\` to bump the version in
|
|
1753
|
+
\`package.json\` without touching git at all, so that a
|
|
1754
|
+
series of bumps can be committed together.`,
|
|
1755
|
+
default: true
|
|
1756
|
+
},
|
|
1757
|
+
commit: {
|
|
1758
|
+
description: `Create the version commit in \`vlt version\`.
|
|
1759
|
+
|
|
1760
|
+
Set \`--no-commit\` to leave the bumped \`package.json\`
|
|
1761
|
+
uncommitted while still creating the git tag. Implied by
|
|
1762
|
+
\`--no-git-tag-version\`.`,
|
|
1763
|
+
default: true
|
|
1764
|
+
}
|
|
1748
1765
|
}).opt({
|
|
1749
1766
|
otp: {
|
|
1750
1767
|
description: `Provide an OTP to use when publishing a package.`
|
|
@@ -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
|
PackageInfoClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-P5S2TFCF.js";
|
|
15
15
|
import {
|
|
16
16
|
Monorepo,
|
|
17
17
|
PackageJson,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getCommand,
|
|
28
28
|
isRecordField,
|
|
29
29
|
recordFields
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MNK55XSE.js";
|
|
31
31
|
import {
|
|
32
32
|
find,
|
|
33
33
|
load,
|
|
@@ -27641,7 +27641,8 @@ var RegistryClient = class {
|
|
|
27641
27641
|
redirections = /* @__PURE__ */ new Set(),
|
|
27642
27642
|
signal,
|
|
27643
27643
|
otp = (process.env.VLT_OTP ?? "").trim(),
|
|
27644
|
-
staleWhileRevalidate = true
|
|
27644
|
+
staleWhileRevalidate = true,
|
|
27645
|
+
forceRevalidate = false
|
|
27645
27646
|
} = options;
|
|
27646
27647
|
let { trustIntegrity } = options;
|
|
27647
27648
|
const m = isCacheableMethod(method) ? method : void 0;
|
|
@@ -27650,11 +27651,12 @@ var RegistryClient = class {
|
|
|
27650
27651
|
const key = cacheKey(method, u);
|
|
27651
27652
|
const buffer = useCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
|
|
27652
27653
|
const entry = buffer ? this.#decodeCached(buffer) : void 0;
|
|
27653
|
-
if (entry?.valid) {
|
|
27654
|
+
if (entry?.valid && !forceRevalidate) {
|
|
27654
27655
|
logRequest(url, "cache", { method });
|
|
27655
27656
|
return entry;
|
|
27656
27657
|
}
|
|
27657
|
-
|
|
27658
|
+
const forcedFallback = forceRevalidate && entry?.staleWhileRevalidate ? entry : void 0;
|
|
27659
|
+
if (!forceRevalidate && staleWhileRevalidate && entry?.staleWhileRevalidate && m) {
|
|
27658
27660
|
register2(dirname3(this.cache.path()), m, url);
|
|
27659
27661
|
logRequest(url, "stale", { method });
|
|
27660
27662
|
return entry;
|
|
@@ -27700,6 +27702,10 @@ var RegistryClient = class {
|
|
|
27700
27702
|
options
|
|
27701
27703
|
);
|
|
27702
27704
|
} catch (er) {
|
|
27705
|
+
if (forcedFallback && !signal?.aborted) {
|
|
27706
|
+
logRequest(url, "stale", { method });
|
|
27707
|
+
return forcedFallback;
|
|
27708
|
+
}
|
|
27703
27709
|
throw error("Request failed", {
|
|
27704
27710
|
code: "EREQUEST",
|
|
27705
27711
|
cause: er,
|
|
@@ -27728,7 +27734,8 @@ var RegistryClient = class {
|
|
|
27728
27734
|
if (result.isGzip && !trustIntegrity) {
|
|
27729
27735
|
result.checkIntegrity({ url });
|
|
27730
27736
|
}
|
|
27731
|
-
|
|
27737
|
+
const clobbersCachedEntry = forceRevalidate && !!entry && result.statusCode !== 200;
|
|
27738
|
+
if (useCache && !clobbersCachedEntry) {
|
|
27732
27739
|
const buffer2 = result.encode();
|
|
27733
27740
|
this.cache.set(
|
|
27734
27741
|
key,
|
|
@@ -88,6 +88,7 @@ var noRegistryError = (spec) => error(
|
|
|
88
88
|
'No registry configured to resolve this spec. Set "registry" in vlt.json, pass --registry, or run `vlt login --registry=<url>`. See https://docs.vlt.sh/cli',
|
|
89
89
|
{ code: "ECONFIG", spec }
|
|
90
90
|
);
|
|
91
|
+
var isMovingSelector = (f) => !!(f.distTag || f.range?.isAny);
|
|
91
92
|
var PackageInfoClient = class {
|
|
92
93
|
#registryClient;
|
|
93
94
|
#projectRoot;
|
|
@@ -101,7 +102,9 @@ var PackageInfoClient = class {
|
|
|
101
102
|
#cachePath;
|
|
102
103
|
// In-flight coalescing key is `${registry}${name}` — no representation
|
|
103
104
|
// component. Safe only because every caller requests the same full
|
|
104
|
-
// packument (see #fetchPackument).
|
|
105
|
+
// packument (see #fetchPackument). The one thing that does vary per
|
|
106
|
+
// caller is forceRevalidate, so record it and let a moving selector
|
|
107
|
+
// reuse a forced promise but never a non-forced one (see packument()).
|
|
105
108
|
#packumentPromises = /* @__PURE__ */ new Map();
|
|
106
109
|
// unique temp file names for atomic manifest cache writes
|
|
107
110
|
#manifestWriteRandom = randomBytes(6).toString("hex");
|
|
@@ -116,7 +119,7 @@ var PackageInfoClient = class {
|
|
|
116
119
|
#tarPoolPromise;
|
|
117
120
|
async getRegistryClient() {
|
|
118
121
|
if (this.#registryClient) return this.#registryClient;
|
|
119
|
-
this.#registryClientPromise ??= import("./src-
|
|
122
|
+
this.#registryClientPromise ??= import("./src-J4BAYOBO.js").then(({ RegistryClient }) => {
|
|
120
123
|
this.#registryClient = new RegistryClient(this.options);
|
|
121
124
|
return this.#registryClient;
|
|
122
125
|
});
|
|
@@ -398,7 +401,7 @@ var PackageInfoClient = class {
|
|
|
398
401
|
return;
|
|
399
402
|
}
|
|
400
403
|
const f = spec.final;
|
|
401
|
-
if (f
|
|
404
|
+
if (isMovingSelector(f)) {
|
|
402
405
|
return;
|
|
403
406
|
}
|
|
404
407
|
const key = this.#manifestCacheKey(f, options);
|
|
@@ -732,15 +735,20 @@ var PackageInfoClient = class {
|
|
|
732
735
|
const { registry, name } = f;
|
|
733
736
|
if (!registry) throw noRegistryError(spec);
|
|
734
737
|
const packumentKey = `${registry}${name}`;
|
|
738
|
+
const forced = isMovingSelector(f);
|
|
735
739
|
const inflight = this.#packumentPromises.get(packumentKey);
|
|
736
|
-
if (inflight
|
|
740
|
+
if (inflight && (!forced || inflight.forced))
|
|
741
|
+
return inflight.promise;
|
|
737
742
|
const pakuURL = new URL(name, registry);
|
|
738
743
|
const promise = this.#fetchPackument(spec, options, pakuURL);
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
(
|
|
743
|
-
|
|
744
|
+
const record = { promise, forced };
|
|
745
|
+
this.#packumentPromises.set(packumentKey, record);
|
|
746
|
+
const clear = () => {
|
|
747
|
+
if (this.#packumentPromises.get(packumentKey) === record) {
|
|
748
|
+
this.#packumentPromises.delete(packumentKey);
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
promise.then(clear, clear);
|
|
744
752
|
return promise;
|
|
745
753
|
}
|
|
746
754
|
}
|
|
@@ -748,7 +756,11 @@ var PackageInfoClient = class {
|
|
|
748
756
|
async #fetchPackument(spec, options, pakuURL, useCache) {
|
|
749
757
|
const response = await (await this.getRegistryClient()).request(pakuURL, {
|
|
750
758
|
headers: { accept: "application/json" },
|
|
751
|
-
...useCache === false ? { useCache } : {}
|
|
759
|
+
...useCache === false ? { useCache } : {},
|
|
760
|
+
// costs a conditional GET per moving selector on an otherwise warm
|
|
761
|
+
// cache, install included. 304s are cheap but not free; the
|
|
762
|
+
// alternative is serving a dist tag that moved (#1656).
|
|
763
|
+
...isMovingSelector(spec.final) ? { forceRevalidate: true } : {}
|
|
752
764
|
});
|
|
753
765
|
if (response.statusCode !== 200) {
|
|
754
766
|
throw this.#resolveError(
|
|
@@ -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
|
PackageInfoClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-P5S2TFCF.js";
|
|
15
15
|
import {
|
|
16
16
|
findCmdShimIfExists,
|
|
17
17
|
install
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
19
19
|
import {
|
|
20
20
|
PathScurry
|
|
21
21
|
} from "./chunk-USTJECVS.js";
|
|
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
generateDefaultHelp,
|
|
14
14
|
generateFullHelp
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5HBKYSTX.js";
|
|
16
16
|
import {
|
|
17
17
|
flush,
|
|
18
18
|
trackCommand,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "./chunk-YOE3VZFX.js";
|
|
34
34
|
import {
|
|
35
35
|
defaultView
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-MNK55XSE.js";
|
|
37
37
|
import {
|
|
38
38
|
isLazyView,
|
|
39
39
|
isViewClass,
|
|
@@ -214,6 +214,14 @@ var printCode = (err, usage, stderr2, format) => {
|
|
|
214
214
|
}
|
|
215
215
|
return { file: true };
|
|
216
216
|
}
|
|
217
|
+
case "ENEEDAUTH": {
|
|
218
|
+
const { url } = err.cause;
|
|
219
|
+
stderr2(`Authentication Error: ${err.message}`);
|
|
220
|
+
if (url) {
|
|
221
|
+
stderr2(indent(`URL: ${formatURL(url, format)}`));
|
|
222
|
+
}
|
|
223
|
+
return {};
|
|
224
|
+
}
|
|
217
225
|
case "EREQUEST": {
|
|
218
226
|
const { url, method } = err.cause;
|
|
219
227
|
const { code, syscall } = err.cause.cause ?? {};
|
|
@@ -232,6 +240,20 @@ var printCode = (err, usage, stderr2, format) => {
|
|
|
232
240
|
}
|
|
233
241
|
return { file: true };
|
|
234
242
|
}
|
|
243
|
+
case "EQUERY": {
|
|
244
|
+
const { found, wanted, validOptions } = err.cause;
|
|
245
|
+
stderr2(`Query Error: ${err.message}`);
|
|
246
|
+
if (found) {
|
|
247
|
+
stderr2(indent(`Found: ${format(found)}`));
|
|
248
|
+
}
|
|
249
|
+
if (wanted) {
|
|
250
|
+
stderr2(indent(`Did you mean: ${format(wanted)}`));
|
|
251
|
+
}
|
|
252
|
+
if (validOptions) {
|
|
253
|
+
stderr2(indent(`Valid Options: ${format(validOptions)}`));
|
|
254
|
+
}
|
|
255
|
+
return {};
|
|
256
|
+
}
|
|
235
257
|
case "ECONFIG": {
|
|
236
258
|
const { found, wanted, validOptions } = err.cause;
|
|
237
259
|
stderr2(`Config Error: ${err.message}`);
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
actual,
|
|
14
14
|
callLimit,
|
|
15
15
|
createVirtualRoot
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
17
17
|
import {
|
|
18
18
|
SecurityArchive
|
|
19
19
|
} from "./chunk-2YJ5MESP.js";
|
|
@@ -115,7 +115,7 @@ var reloadConfig = async (folder) => {
|
|
|
115
115
|
unload("project");
|
|
116
116
|
} catch {
|
|
117
117
|
}
|
|
118
|
-
const { Config } = await import("./config-
|
|
118
|
+
const { Config } = await import("./config-66ARNESN.js");
|
|
119
119
|
return Config.load(folder, process.argv, true);
|
|
120
120
|
};
|
|
121
121
|
|
|
@@ -11,19 +11,19 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
openUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZNCVQQDT.js";
|
|
15
15
|
import {
|
|
16
16
|
stderr
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VL7RJVNN.js";
|
|
18
18
|
import {
|
|
19
19
|
mermaidOutput
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FUCQ7ARR.js";
|
|
21
21
|
import {
|
|
22
22
|
ViewClass
|
|
23
23
|
} from "./chunk-4KCU2KZL.js";
|
|
24
24
|
import {
|
|
25
25
|
getTokenByURL
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NWLS3VOQ.js";
|
|
27
27
|
|
|
28
28
|
// ../../src/cli-sdk/src/query-auth.ts
|
|
29
29
|
var createGetAuthHeader = (conf) => async (url) => getTokenByURL(url, conf.options.identity);
|