@vltpkg/cli-js 1.3.1 → 1.3.3
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-ATF2FQHI.js → access-KMBBQIIT.js} +2 -2
- package/{bugs-P26XZBIE.js → bugs-CABZX76X.js} +5 -5
- package/{build-UABOHT3O.js → build-WNHKYA4E.js} +3 -3
- package/{cache-R2SEGAZJ.js → cache-KKT4GIYD.js} +2 -2
- package/{chunk-73YPXX6C.js → chunk-3IDIPSH7.js} +1 -1
- package/chunk-7JK53T6G.js +75 -0
- package/{chunk-U3WCCLFD.js → chunk-DCFLXO2M.js} +1 -1
- package/{chunk-KPMPYRBZ.js → chunk-GA4LA6B2.js} +2 -2
- package/{chunk-ZPVVD6CI.js → chunk-GZWJAGBL.js} +1 -1
- package/{chunk-OOYLF23O.js → chunk-HCMAX6Q5.js} +1 -1
- package/{chunk-YL5D7SKZ.js → chunk-LY5FNWRY.js} +3 -3
- package/{chunk-QXKWSPKX.js → chunk-MOL2DUEQ.js} +25 -17
- package/{chunk-OKJ4U3PP.js → chunk-QBXGMTDE.js} +7 -2
- package/{chunk-2QA7DUYM.js → chunk-ROCFQPP2.js} +1 -1
- package/{chunk-P6LBJWJN.js → chunk-SH24EMXO.js} +24 -11
- package/{chunk-B7YWFGLB.js → chunk-TJBBYDUN.js} +2 -2
- package/{chunk-LCAH3OGR.js → chunk-YU2W5UPG.js} +1 -1
- package/{chunk-7AYULBUY.js → chunk-ZBJRZXSU.js} +2 -2
- package/{chunk-3WBHQEWL.js → chunk-ZRRNOLEG.js} +123 -81
- package/{ci-3R6MFNVV.js → ci-BGVGC5RF.js} +16 -12
- package/cli-package.json +1 -1
- package/{config-4SAA7FD2.js → config-AWX2VEKL.js} +2 -2
- package/{config-WPVXQDM5.js → config-FIKZ4VWG.js} +2 -2
- package/{create-MS4GFBDA.js → create-CHTG7KO3.js} +7 -7
- package/{deprecate-JTTM44ZL.js → deprecate-W7KQ62HF.js} +3 -3
- package/{dist-tag-HJEVOOH3.js → dist-tag-66CC6HT7.js} +2 -2
- package/{docs-6OIBQSV6.js → docs-HW4U5TGD.js} +5 -5
- package/{exec-LCWL6Z3E.js → exec-BVVNAGFI.js} +7 -7
- package/{exec-cache-6UBB7RI2.js → exec-cache-L3ONPM5C.js} +5 -5
- package/{exec-local-C7MPFSOE.js → exec-local-NR3RYQDQ.js} +5 -5
- package/{help-DC77D3YW.js → help-5YL6SUAN.js} +1 -1
- package/{init-B6G7COKW.js → init-RI2WVCGL.js} +4 -4
- package/{install-LJPM2XSF.js → install-OWAI4EOW.js} +8 -8
- package/{list-4KT3WIIG.js → list-4ZFX7ANG.js} +6 -6
- package/{login-CFYSVNFH.js → login-6TL3EE6Q.js} +4 -4
- package/{logout-5ZUJHYWI.js → logout-VQWHVHBE.js} +2 -2
- package/{pack-YP5WBIT6.js → pack-Q5IRRAMU.js} +4 -4
- package/package.json +1 -1
- package/{ping-LLMQAG3Y.js → ping-2WV3V7GB.js} +2 -2
- package/{pkg-QTMOXWRT.js → pkg-RXB6BRS5.js} +5 -5
- package/{profile-IA3ELAPB.js → profile-GNGWS5H2.js} +2 -2
- package/{publish-QSIXKUCZ.js → publish-PI74W4GH.js} +5 -5
- package/{query-KHXMK2ED.js → query-NESDWXGE.js} +6 -6
- package/registry-client-src-revalidate.js +24 -11
- package/{repo-XKG2HZ46.js → repo-PPBN3SKP.js} +5 -5
- package/{reporter-47XFGNJH.js → reporter-XBHCUW7W.js} +3 -3
- package/{run-3OEGBMSR.js → run-7GTWIFMV.js} +5 -5
- package/{run-exec-IH5YQF4G.js → run-exec-VLSH5SOB.js} +5 -5
- package/security-archive-src-update-expired.js +1 -1
- package/{setup-LRR3VSGV.js → setup-6O7RFGU2.js} +4 -4
- package/{src-N3QY4ITW.js → src-6E7KCC7J.js} +3 -3
- package/{src-PKFKIVVK.js → src-U4MCZFJT.js} +2 -2
- package/{token-UBMP2WBT.js → token-NZ4HODXE.js} +2 -2
- package/{uninstall-4F4QIOAW.js → uninstall-KBZ6PJBG.js} +5 -5
- package/{unpublish-JPDDQZXF.js → unpublish-JBWSIBRX.js} +2 -2
- package/{update-CVJFMZOK.js → update-X4EC6MPP.js} +7 -7
- package/{version-I7K3J2O2.js → version-QEHPAFAE.js} +4 -4
- package/{view-G5O4ZBLM.js → view-WGGZTYAT.js} +3 -3
- package/vlr.js +2 -1
- package/vlrx.js +2 -1
- package/vlt.js +2 -1
- package/vlx.js +2 -1
- package/vlxl.js +2 -1
- package/{whoami-NG7XVRAL.js → whoami-RYNXOULV.js} +2 -2
- package/chunk-GVQDUMNW.js +0 -75
|
@@ -19,12 +19,12 @@ import "./chunk-64VFL4WI.js";
|
|
|
19
19
|
import "./chunk-ENSGPOLR.js";
|
|
20
20
|
import {
|
|
21
21
|
RegistryClient
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SH24EMXO.js";
|
|
23
23
|
import "./chunk-APMYKJI2.js";
|
|
24
24
|
import {
|
|
25
25
|
assertOk
|
|
26
26
|
} from "./chunk-PBBULTAG.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-YU2W5UPG.js";
|
|
28
28
|
import "./chunk-U7TEQCBN.js";
|
|
29
29
|
import "./chunk-XNLSTHDK.js";
|
|
30
30
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -17,24 +17,24 @@ import {
|
|
|
17
17
|
} from "./chunk-MC6CESRA.js";
|
|
18
18
|
import {
|
|
19
19
|
createHostContextsMap
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LY5FNWRY.js";
|
|
21
21
|
import "./chunk-CSZTT7QN.js";
|
|
22
22
|
import "./chunk-CU752KW7.js";
|
|
23
23
|
import "./chunk-G2YT2GWF.js";
|
|
24
24
|
import "./chunk-CRGWLUGC.js";
|
|
25
25
|
import {
|
|
26
26
|
PackageInfoClient
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-MOL2DUEQ.js";
|
|
28
28
|
import "./chunk-ZWKI5OSF.js";
|
|
29
29
|
import "./chunk-WGDTG44V.js";
|
|
30
30
|
import "./chunk-J4NHRZX6.js";
|
|
31
31
|
import {
|
|
32
32
|
Query,
|
|
33
33
|
actual
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ZRRNOLEG.js";
|
|
35
35
|
import {
|
|
36
36
|
SecurityArchive
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-DCFLXO2M.js";
|
|
38
38
|
import {
|
|
39
39
|
commandUsage
|
|
40
40
|
} from "./chunk-I6QGYSB4.js";
|
|
@@ -48,7 +48,7 @@ import "./chunk-ENSGPOLR.js";
|
|
|
48
48
|
import "./chunk-HTOTG4TS.js";
|
|
49
49
|
import "./chunk-APMYKJI2.js";
|
|
50
50
|
import "./chunk-PBBULTAG.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-YU2W5UPG.js";
|
|
52
52
|
import "./chunk-U7TEQCBN.js";
|
|
53
53
|
import "./chunk-XNLSTHDK.js";
|
|
54
54
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -11,8 +11,8 @@ 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-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ZRRNOLEG.js";
|
|
15
|
+
import "./chunk-DCFLXO2M.js";
|
|
16
16
|
import {
|
|
17
17
|
commandUsage
|
|
18
18
|
} from "./chunk-I6QGYSB4.js";
|
|
@@ -21,7 +21,7 @@ import "./chunk-JIQBZ2UT.js";
|
|
|
21
21
|
import "./chunk-64VFL4WI.js";
|
|
22
22
|
import "./chunk-ENSGPOLR.js";
|
|
23
23
|
import "./chunk-HTOTG4TS.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-YU2W5UPG.js";
|
|
25
25
|
import "./chunk-U7TEQCBN.js";
|
|
26
26
|
import "./chunk-XNLSTHDK.js";
|
|
27
27
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -34,12 +34,12 @@ import {
|
|
|
34
34
|
import "./chunk-ENSGPOLR.js";
|
|
35
35
|
import {
|
|
36
36
|
CacheEntry
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SH24EMXO.js";
|
|
38
38
|
import "./chunk-APMYKJI2.js";
|
|
39
39
|
import {
|
|
40
40
|
assertOk
|
|
41
41
|
} from "./chunk-PBBULTAG.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-YU2W5UPG.js";
|
|
43
43
|
import "./chunk-U7TEQCBN.js";
|
|
44
44
|
import "./chunk-XNLSTHDK.js";
|
|
45
45
|
import {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var global = globalThis;
|
|
2
|
+
import {Buffer} from "node:buffer";
|
|
3
|
+
import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
|
|
4
|
+
globalThis.setTimeout = _vlt_setTimeout;
|
|
5
|
+
globalThis.clearTimeout = _vlt_clearTimeout;
|
|
6
|
+
globalThis.setImmediate = _vlt_setImmediate;
|
|
7
|
+
globalThis.clearImmediate = _vlt_clearImmediate;
|
|
8
|
+
globalThis.setInterval = _vlt_setInterval;
|
|
9
|
+
globalThis.clearInterval = _vlt_clearInterval;
|
|
10
|
+
import {createRequire as _vlt_createRequire} from "node:module";
|
|
11
|
+
var require = _vlt_createRequire(import.meta.filename);
|
|
12
|
+
import {
|
|
13
|
+
error
|
|
14
|
+
} from "./chunk-WZWDS3W4.js";
|
|
15
|
+
import {
|
|
16
|
+
__glob
|
|
17
|
+
} from "./chunk-PZLD7RTK.js";
|
|
18
|
+
|
|
19
|
+
// import("./commands/**/*.ts") in ../../src/cli-sdk/src/load-command.ts
|
|
20
|
+
var globImport_commands_ts = __glob({
|
|
21
|
+
"./commands/access.ts": () => import("./access-KMBBQIIT.js"),
|
|
22
|
+
"./commands/bugs.ts": () => import("./bugs-CABZX76X.js"),
|
|
23
|
+
"./commands/build.ts": () => import("./build-WNHKYA4E.js"),
|
|
24
|
+
"./commands/cache.ts": () => import("./cache-KKT4GIYD.js"),
|
|
25
|
+
"./commands/ci.ts": () => import("./ci-BGVGC5RF.js"),
|
|
26
|
+
"./commands/config.ts": () => import("./config-FIKZ4VWG.js"),
|
|
27
|
+
"./commands/create.ts": () => import("./create-CHTG7KO3.js"),
|
|
28
|
+
"./commands/deprecate.ts": () => import("./deprecate-W7KQ62HF.js"),
|
|
29
|
+
"./commands/dist-tag.ts": () => import("./dist-tag-66CC6HT7.js"),
|
|
30
|
+
"./commands/docs.ts": () => import("./docs-HW4U5TGD.js"),
|
|
31
|
+
"./commands/exec-cache.ts": () => import("./exec-cache-L3ONPM5C.js"),
|
|
32
|
+
"./commands/exec-local.ts": () => import("./exec-local-NR3RYQDQ.js"),
|
|
33
|
+
"./commands/exec.ts": () => import("./exec-BVVNAGFI.js"),
|
|
34
|
+
"./commands/help.ts": () => import("./help-5YL6SUAN.js"),
|
|
35
|
+
"./commands/init.ts": () => import("./init-RI2WVCGL.js"),
|
|
36
|
+
"./commands/install.ts": () => import("./install-OWAI4EOW.js"),
|
|
37
|
+
"./commands/install/reporter.ts": () => import("./reporter-XBHCUW7W.js"),
|
|
38
|
+
"./commands/list.ts": () => import("./list-4ZFX7ANG.js"),
|
|
39
|
+
"./commands/login.ts": () => import("./login-6TL3EE6Q.js"),
|
|
40
|
+
"./commands/logout.ts": () => import("./logout-VQWHVHBE.js"),
|
|
41
|
+
"./commands/pack.ts": () => import("./pack-Q5IRRAMU.js"),
|
|
42
|
+
"./commands/ping.ts": () => import("./ping-2WV3V7GB.js"),
|
|
43
|
+
"./commands/pkg.ts": () => import("./pkg-RXB6BRS5.js"),
|
|
44
|
+
"./commands/profile.ts": () => import("./profile-GNGWS5H2.js"),
|
|
45
|
+
"./commands/publish.ts": () => import("./publish-PI74W4GH.js"),
|
|
46
|
+
"./commands/query.ts": () => import("./query-NESDWXGE.js"),
|
|
47
|
+
"./commands/registry.ts": () => import("./registry-MXAA4HVJ.js"),
|
|
48
|
+
"./commands/repo.ts": () => import("./repo-PPBN3SKP.js"),
|
|
49
|
+
"./commands/run-exec.ts": () => import("./run-exec-VLSH5SOB.js"),
|
|
50
|
+
"./commands/run.ts": () => import("./run-7GTWIFMV.js"),
|
|
51
|
+
"./commands/setup.ts": () => import("./setup-6O7RFGU2.js"),
|
|
52
|
+
"./commands/token.ts": () => import("./token-NZ4HODXE.js"),
|
|
53
|
+
"./commands/uninstall.ts": () => import("./uninstall-KBZ6PJBG.js"),
|
|
54
|
+
"./commands/unpublish.ts": () => import("./unpublish-JBWSIBRX.js"),
|
|
55
|
+
"./commands/update.ts": () => import("./update-X4EC6MPP.js"),
|
|
56
|
+
"./commands/version.ts": () => import("./version-QEHPAFAE.js"),
|
|
57
|
+
"./commands/view.ts": () => import("./view-WGGZTYAT.js"),
|
|
58
|
+
"./commands/whoami.ts": () => import("./whoami-RYNXOULV.js")
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ../../src/cli-sdk/src/load-command.ts
|
|
62
|
+
var loadCommand = async (command) => {
|
|
63
|
+
try {
|
|
64
|
+
return await globImport_commands_ts(`./commands/${command}.ts`);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
throw error("Could not load command", {
|
|
67
|
+
found: command,
|
|
68
|
+
cause: e
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
loadCommand
|
|
75
|
+
};
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-CSZTT7QN.js";
|
|
18
18
|
import {
|
|
19
19
|
mermaidOutput
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZRRNOLEG.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-SH24EMXO.js";
|
|
27
27
|
|
|
28
28
|
// ../../src/cli-sdk/src/query-auth.ts
|
|
29
29
|
var createGetAuthHeader = (conf) => async (url) => getTokenByURL(url, conf.options.identity);
|
|
@@ -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-MOL2DUEQ.js";
|
|
15
15
|
import {
|
|
16
16
|
Monorepo,
|
|
17
17
|
PackageJson,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
actual,
|
|
14
14
|
callLimit,
|
|
15
15
|
createVirtualRoot
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZRRNOLEG.js";
|
|
17
17
|
import {
|
|
18
18
|
SecurityArchive
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DCFLXO2M.js";
|
|
20
20
|
import {
|
|
21
21
|
error
|
|
22
22
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -140,7 +140,7 @@ var reloadConfig = async (folder) => {
|
|
|
140
140
|
unload("project");
|
|
141
141
|
} catch {
|
|
142
142
|
}
|
|
143
|
-
const { Config } = await import("./config-
|
|
143
|
+
const { Config } = await import("./config-AWX2VEKL.js");
|
|
144
144
|
return Config.load(folder, process.argv, true);
|
|
145
145
|
};
|
|
146
146
|
|
|
@@ -145,13 +145,15 @@ var debug = debuglog("vlt");
|
|
|
145
145
|
var xdg = new XDG("vlt");
|
|
146
146
|
var delimiter = "~";
|
|
147
147
|
var VLT_PACKUMENT_MIME = "application/vnd.vlt.packument-v1+json";
|
|
148
|
-
var
|
|
148
|
+
var VLT_PACKUMENT_V2_MIME = "application/vnd.vlt.packument-v2+json";
|
|
149
|
+
var PACKUMENT_ACCEPT = `${VLT_PACKUMENT_V2_MIME}; q=1.0, ${VLT_PACKUMENT_MIME}; q=0.9, application/json; q=0.8, */*; q=0.1`;
|
|
149
150
|
var manifestCacheMaxAge = 5 * 60 * 1e3;
|
|
150
151
|
var noRegistryError = (spec) => error(
|
|
151
152
|
'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',
|
|
152
153
|
{ code: "ECONFIG", spec }
|
|
153
154
|
);
|
|
154
155
|
var isMovingSelector = (f) => !!(f.distTag || f.range?.isAny);
|
|
156
|
+
var revalidateMode = (f, options) => !isMovingSelector(f) ? void 0 : options.backgroundRevalidate ? "background" : true;
|
|
155
157
|
var isStableSelector = (f) => {
|
|
156
158
|
const { range } = f;
|
|
157
159
|
if (!range) return false;
|
|
@@ -167,7 +169,7 @@ var PackageInfoClient = class {
|
|
|
167
169
|
packageJson;
|
|
168
170
|
monorepo;
|
|
169
171
|
#trustedIntegrities = /* @__PURE__ */ new Map();
|
|
170
|
-
// `${registry}${name}` of every packument served as
|
|
172
|
+
// `${registry}${name}` of every packument served as a vlt packument type
|
|
171
173
|
#vltPackuments = /* @__PURE__ */ new Set();
|
|
172
174
|
#manifestCacheMinAge = Date.now() - manifestCacheMaxAge;
|
|
173
175
|
#cachePath;
|
|
@@ -190,8 +192,8 @@ var PackageInfoClient = class {
|
|
|
190
192
|
// In-flight coalescing key is `${registry}${name}` — no representation
|
|
191
193
|
// component. Safe only because every caller requests the same full
|
|
192
194
|
// packument (see #fetchPackument). The one thing that does vary per
|
|
193
|
-
// caller is forceRevalidate, so record
|
|
194
|
-
//
|
|
195
|
+
// caller is forceRevalidate, so record how hard it revalidates and
|
|
196
|
+
// never let a request ride a weaker one (see #packument()).
|
|
195
197
|
#packumentPromises = /* @__PURE__ */ new Map();
|
|
196
198
|
// unique temp file names for atomic manifest cache writes
|
|
197
199
|
#manifestWriteRandom = randomBytes(6).toString("hex");
|
|
@@ -206,7 +208,7 @@ var PackageInfoClient = class {
|
|
|
206
208
|
#tarPoolPromise;
|
|
207
209
|
async getRegistryClient() {
|
|
208
210
|
if (this.#registryClient) return this.#registryClient;
|
|
209
|
-
this.#registryClientPromise ??= import("./src-
|
|
211
|
+
this.#registryClientPromise ??= import("./src-U4MCZFJT.js").then(({ RegistryClient }) => {
|
|
210
212
|
this.#registryClient = new RegistryClient(this.options);
|
|
211
213
|
return this.#registryClient;
|
|
212
214
|
});
|
|
@@ -947,19 +949,19 @@ var PackageInfoClient = class {
|
|
|
947
949
|
);
|
|
948
950
|
const fullKey = `${registry}${name}`;
|
|
949
951
|
const packumentKey = stable ? `${fullKey}?stable` : fullKey;
|
|
950
|
-
const
|
|
952
|
+
const mode = revalidateMode(f, options);
|
|
953
|
+
const rank = mode === true ? 2 : mode ? 1 : 0;
|
|
951
954
|
const inflight = this.#packumentPromises.get(packumentKey) ?? // the full packument is a superset of the stable one, so an
|
|
952
955
|
// in-flight full request answers a stable ask too, and a package
|
|
953
956
|
// wanted both ways is still fetched once
|
|
954
957
|
(stable ? this.#packumentPromises.get(fullKey) : void 0);
|
|
955
|
-
if (inflight &&
|
|
956
|
-
return inflight.promise;
|
|
958
|
+
if (inflight && inflight.rank >= rank) return inflight.promise;
|
|
957
959
|
const pakuURL = new URL(
|
|
958
960
|
stable ? `${name}?stable` : name,
|
|
959
961
|
registry
|
|
960
962
|
);
|
|
961
963
|
const promise = this.#fetchPackument(spec, options, pakuURL);
|
|
962
|
-
const record = { promise,
|
|
964
|
+
const record = { promise, rank };
|
|
963
965
|
this.#packumentPromises.set(packumentKey, record);
|
|
964
966
|
const clear = () => {
|
|
965
967
|
if (this.#packumentPromises.get(packumentKey) === record) {
|
|
@@ -972,15 +974,17 @@ var PackageInfoClient = class {
|
|
|
972
974
|
}
|
|
973
975
|
}
|
|
974
976
|
async #fetchPackument(spec, options, pakuURL, useCache) {
|
|
977
|
+
const mode = revalidateMode(spec.final, options);
|
|
975
978
|
const response = await (await this.getRegistryClient()).request(pakuURL, {
|
|
976
979
|
headers: {
|
|
977
980
|
accept: options.full ? "application/json" : PACKUMENT_ACCEPT
|
|
978
981
|
},
|
|
979
982
|
...useCache === false || options.full ? { useCache: false } : {},
|
|
980
|
-
//
|
|
981
|
-
//
|
|
982
|
-
//
|
|
983
|
-
|
|
983
|
+
// a moving selector pays a conditional GET before use, so a moved
|
|
984
|
+
// dist tag is seen at once (#1656). with backgroundRevalidate a
|
|
985
|
+
// packument still within max-age is served and revalidated after
|
|
986
|
+
// exit instead.
|
|
987
|
+
...mode === void 0 ? {} : { forceRevalidate: mode }
|
|
984
988
|
});
|
|
985
989
|
if (response.statusCode !== 200) {
|
|
986
990
|
throw this.#resolveError(
|
|
@@ -1003,10 +1007,15 @@ var PackageInfoClient = class {
|
|
|
1003
1007
|
throw er;
|
|
1004
1008
|
}
|
|
1005
1009
|
const { registry, name } = spec.final;
|
|
1006
|
-
|
|
1010
|
+
const { contentType } = response;
|
|
1011
|
+
const v2 = contentType.startsWith(VLT_PACKUMENT_V2_MIME);
|
|
1012
|
+
if (v2 || contentType.startsWith(VLT_PACKUMENT_MIME)) {
|
|
1007
1013
|
this.#vltPackuments.add(`${registry}${name}`);
|
|
1008
1014
|
}
|
|
1009
|
-
if (registry)
|
|
1015
|
+
if (registry) {
|
|
1016
|
+
const base = registry.endsWith("/") ? registry : registry + "/";
|
|
1017
|
+
absolutizeTarballs(paku, v2 ? `${base}${name}/-/` : base);
|
|
1018
|
+
}
|
|
1010
1019
|
return paku;
|
|
1011
1020
|
}
|
|
1012
1021
|
async resolve(spec, options = {}) {
|
|
@@ -1169,8 +1178,7 @@ var PackageInfoClient = class {
|
|
|
1169
1178
|
return er;
|
|
1170
1179
|
}
|
|
1171
1180
|
};
|
|
1172
|
-
var absolutizeTarballs = (paku,
|
|
1173
|
-
const base = registry.endsWith("/") ? registry : registry + "/";
|
|
1181
|
+
var absolutizeTarballs = (paku, base) => {
|
|
1174
1182
|
for (const { dist } of Object.values(paku.versions)) {
|
|
1175
1183
|
const tarball = dist?.tarball;
|
|
1176
1184
|
if (tarball && !/^[a-z][a-z0-9+.-]*:/i.test(tarball)) {
|
|
@@ -9,17 +9,22 @@ 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
|
+
XDG
|
|
14
|
+
} from "./chunk-XNLSTHDK.js";
|
|
12
15
|
|
|
13
16
|
// ../build/src/bins.ts
|
|
14
17
|
import module from "node:module";
|
|
15
18
|
import { resolve } from "node:path";
|
|
16
|
-
module.enableCompileCache()
|
|
19
|
+
if (module.enableCompileCache().status === module.constants.compileCacheStatus.FAILED) {
|
|
20
|
+
module.enableCompileCache(new XDG("vlt").cache("compile-cache"));
|
|
21
|
+
}
|
|
17
22
|
var BINS_DIR = resolve(import.meta.dirname, "bins");
|
|
18
23
|
var run = async (command) => {
|
|
19
24
|
if (command) {
|
|
20
25
|
process.argv.splice(2, 0, command);
|
|
21
26
|
}
|
|
22
|
-
const vlt = await import("./src-
|
|
27
|
+
const vlt = await import("./src-6E7KCC7J.js");
|
|
23
28
|
await vlt.default();
|
|
24
29
|
};
|
|
25
30
|
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-PBBULTAG.js";
|
|
22
22
|
import {
|
|
23
23
|
userAgent
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YU2W5UPG.js";
|
|
25
25
|
import {
|
|
26
26
|
I,
|
|
27
27
|
logRequest
|
|
@@ -26739,6 +26739,12 @@ var CacheEntry = class _CacheEntry {
|
|
|
26739
26739
|
*/
|
|
26740
26740
|
setHeader(h, value) {
|
|
26741
26741
|
this.#headers = setRawHeader(this.#headers, h, value);
|
|
26742
|
+
if (h.toLowerCase() === "date") {
|
|
26743
|
+
this.#date = void 0;
|
|
26744
|
+
this.#valid = void 0;
|
|
26745
|
+
this.#validUntil = void 0;
|
|
26746
|
+
this.#staleUntil = void 0;
|
|
26747
|
+
}
|
|
26742
26748
|
}
|
|
26743
26749
|
/**
|
|
26744
26750
|
* Remove a header, if present
|
|
@@ -27898,7 +27904,15 @@ var RegistryClient = class {
|
|
|
27898
27904
|
const key = cacheKey(method, u);
|
|
27899
27905
|
const buffer = useCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
|
|
27900
27906
|
const entry = buffer ? this.#decodeCached(buffer) : void 0;
|
|
27901
|
-
if (entry?.valid &&
|
|
27907
|
+
if (entry?.valid && forceRevalidate !== true) {
|
|
27908
|
+
if (forceRevalidate === "background" && m) {
|
|
27909
|
+
register2(
|
|
27910
|
+
dirname3(this.cache.path()),
|
|
27911
|
+
m,
|
|
27912
|
+
url,
|
|
27913
|
+
getHeader(options.headers, "accept")
|
|
27914
|
+
);
|
|
27915
|
+
}
|
|
27902
27916
|
logRequest(url, "cache", { method });
|
|
27903
27917
|
return entry;
|
|
27904
27918
|
}
|
|
@@ -27993,16 +28007,15 @@ var RegistryClient = class {
|
|
|
27993
28007
|
const clobbersCachedEntry = forceRevalidate && !!entry && result.statusCode !== 200;
|
|
27994
28008
|
if (useCache && !clobbersCachedEntry) {
|
|
27995
28009
|
const integrity2 = result.integrity ?? (result.statusCode === 200 && !result.isJSON ? result.integrityActual : void 0);
|
|
27996
|
-
const
|
|
27997
|
-
|
|
27998
|
-
|
|
27999
|
-
|
|
28000
|
-
|
|
28001
|
-
buffer2.byteOffset,
|
|
28002
|
-
buffer2.byteLength
|
|
28003
|
-
),
|
|
28004
|
-
{ integrity: integrity2 }
|
|
28010
|
+
const encoded = result.encode();
|
|
28011
|
+
const stored = Buffer.from(
|
|
28012
|
+
encoded.buffer,
|
|
28013
|
+
encoded.byteOffset,
|
|
28014
|
+
encoded.byteLength
|
|
28005
28015
|
);
|
|
28016
|
+
this.cache.set(key, stored, { integrity: integrity2 });
|
|
28017
|
+
if (result === entry && entry.isJSON)
|
|
28018
|
+
this.#decoded.set(stored, entry);
|
|
28006
28019
|
}
|
|
28007
28020
|
return result;
|
|
28008
28021
|
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-RIYFGX27.js";
|
|
15
15
|
import {
|
|
16
16
|
createHostContextsMap
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LY5FNWRY.js";
|
|
18
18
|
import {
|
|
19
19
|
stderr,
|
|
20
20
|
stdout,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
Query,
|
|
28
28
|
actual,
|
|
29
29
|
isRunResult
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZRRNOLEG.js";
|
|
31
31
|
import {
|
|
32
32
|
Monorepo
|
|
33
33
|
} from "./chunk-BUKZHMMK.js";
|
|
@@ -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.
|
|
17
|
+
version: "1.3.3",
|
|
18
18
|
repository: {
|
|
19
19
|
type: "git",
|
|
20
20
|
url: "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -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-MOL2DUEQ.js";
|
|
15
15
|
import {
|
|
16
16
|
findCmdShimIfExists,
|
|
17
17
|
install
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZRRNOLEG.js";
|
|
19
19
|
import {
|
|
20
20
|
PathScurry
|
|
21
21
|
} from "./chunk-BUKZHMMK.js";
|