@vltpkg/cli-js 1.0.3 → 1.0.5
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-5WETTBDZ.js → access-AFFG4IBZ.js} +4 -4
- package/{bugs-KONFLIQQ.js → bugs-MCLLEJJP.js} +9 -9
- package/{build-S7G2DU7I.js → build-TKUT6V2P.js} +6 -6
- package/{cache-Z4OIMLXQ.js → cache-O464JQI4.js} +7 -7
- package/cache-unzip-src-unzip.js +26 -2
- package/{chunk-UXIRAU5T.js → chunk-34VLICEH.js} +3 -3
- package/{chunk-LZGKX7JI.js → chunk-3NGV7EC6.js} +99 -80
- package/{chunk-NXEH3NQZ.js → chunk-3NWTVANS.js} +4 -4
- package/{chunk-OCJDISSI.js → chunk-3OPNZI6G.js} +2 -2
- package/{chunk-DYCF76WI.js → chunk-4LBWNGU6.js} +2 -2
- package/{chunk-T4GYDWUJ.js → chunk-5JFRXIK2.js} +17 -2
- package/{chunk-E737X73P.js → chunk-AL42Z2D3.js} +12 -5
- package/{chunk-5B23EKN4.js → chunk-ED2DDTQT.js} +21 -14
- package/{chunk-XQSBCMSC.js → chunk-FBHWUWBW.js} +2 -2
- package/{chunk-VB3IWNHX.js → chunk-GDJ7JT2R.js} +1 -1
- package/{chunk-5QJEOGEM.js → chunk-JFO2EQA5.js} +1 -1
- package/{chunk-5UPPEUG2.js → chunk-K55EFH4U.js} +5 -5
- package/{chunk-UAAZW4N6.js → chunk-QWTGTFHN.js} +3 -3
- package/{chunk-HNCE3YE5.js → chunk-R32BJAKT.js} +1081 -478
- package/{chunk-FFOXTPQA.js → chunk-SVBEF5PK.js} +127 -78
- package/{chunk-W2Q5EIMH.js → chunk-UCYLZSZ7.js} +5 -5
- package/{chunk-IITIX4ID.js → chunk-VFBCWAOC.js} +37 -1
- package/{chunk-XU5SMHXP.js → chunk-XKVU23NC.js} +1 -1
- package/{chunk-TMBNGWXK.js → chunk-YRLO236S.js} +3 -3
- package/{chunk-G7UPIJAP.js → chunk-YZPRRP7W.js} +6 -6
- package/chunk-ZBNPQDQ7.js +75 -0
- package/{chunk-FWKQ7YDF.js → chunk-ZWKI5OSF.js} +118 -117
- package/{ci-RZZE375O.js → ci-GPZGE4SU.js} +9 -7
- package/cli-package.json +1 -1
- package/{config-MDFY3ORD.js → config-WDCFW5X7.js} +8 -8
- package/{config-LL3RLMZG.js → config-YEEKT7WH.js} +7 -7
- package/{create-GVSDTOGQ.js → create-TVVUUIUZ.js} +14 -14
- package/{deprecate-T4TQLGXQ.js → deprecate-AH4LOHMI.js} +8 -8
- package/{devtools-HGLF4KAO.js → devtools-66MVSNF5.js} +30 -30
- package/{dist-tag-GO46UQUN.js → dist-tag-4R6YHSZ7.js} +4 -4
- package/{docs-FJME563T.js → docs-7MHXAHGG.js} +9 -9
- package/{exec-M22KBPCK.js → exec-FRQOPS5C.js} +16 -14
- package/{exec-cache-3UNLDUAP.js → exec-cache-VYVXFKA2.js} +12 -12
- package/{exec-local-YHVO5RLU.js → exec-local-MXYOC2AY.js} +11 -11
- package/{help-ZEWMLOJX.js → help-J5CYJ7BO.js} +1 -1
- package/{init-4HPZY2KN.js → init-7D5MFAP5.js} +7 -7
- package/{install-2TZIP4PJ.js → install-T34U5HPS.js} +10 -8
- package/{list-NFFXER43.js → list-C2LX6EIY.js} +11 -11
- package/{login-KV5YC5Z2.js → login-6JP7WTRM.js} +4 -4
- package/{logout-I2VT3NAR.js → logout-JYOBUHP3.js} +4 -4
- package/{pack-47ZKFSHI.js → pack-ON6BK2AI.js} +9 -9
- package/package.json +1 -1
- package/{ping-Q7Y7QV63.js → ping-GUNQJ53P.js} +4 -4
- package/{pkg-VTJS2ISJ.js → pkg-GIH3WMUK.js} +8 -8
- package/{profile-YXZYVEUX.js → profile-IEIZFNOD.js} +4 -4
- package/{publish-CBN67KN2.js → publish-VTRA3MIS.js} +11 -11
- package/{query-U3QHF3ZE.js → query-KEXYDRHP.js} +11 -11
- package/{registry-CZPFR3OF.js → registry-43SSGAPE.js} +3 -3
- package/registry-client-package.json +1 -1
- package/registry-client-src-revalidate.js +1348 -720
- package/{repo-4UIQRBI7.js → repo-LI5FOP3N.js} +9 -9
- package/{reporter-DKZTTACW.js → reporter-Y7RMSVN4.js} +83 -83
- package/{run-5DUYI6GL.js → run-LEWQVDWO.js} +11 -11
- package/{run-exec-HPNBVAXH.js → run-exec-CLCZ47NU.js} +11 -11
- package/security-archive-src-update-expired.js +37 -1
- package/{setup-23W5FQVW.js → setup-MPG4UQPT.js} +7 -7
- package/{src-2NB67FPG.js → src-ARXB4NH5.js} +12 -12
- package/{src-6OKPBJJT.js → src-B4IYFLHG.js} +4 -2
- package/{src-M5RRGKUM.js → src-U4EBFPPT.js} +39 -16
- package/{token-SRCS5CRU.js → token-UD4AF4I7.js} +4 -4
- package/{uninstall-JXHAFXZ2.js → uninstall-MSKFXGAO.js} +10 -8
- package/{unpublish-GRYB5KQH.js → unpublish-2RNLXZWP.js} +4 -4
- package/{update-GDLL4ER6.js → update-3HXQLP34.js} +9 -7
- package/{version-JVG4CI4L.js → version-RBLKW6BQ.js} +7 -7
- package/{view-ABQLVL4L.js → view-3XTRGRGJ.js} +12 -12
- 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-RCCZ7BXI.js → whoami-WSXDPFSQ.js} +4 -4
- package/chunk-RNJSI3NZ.js +0 -75
|
@@ -10,8 +10,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
12
|
import {
|
|
13
|
-
defaultRegistries
|
|
14
|
-
|
|
13
|
+
defaultRegistries,
|
|
14
|
+
defaultRegistryName
|
|
15
|
+
} from "./chunk-VFBCWAOC.js";
|
|
15
16
|
import {
|
|
16
17
|
error
|
|
17
18
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -67,6 +68,17 @@ var missingRegistryError = () => error(
|
|
|
67
68
|
].join("\n"),
|
|
68
69
|
{ code: "ECONFIG" }
|
|
69
70
|
);
|
|
71
|
+
var missingNpmRegistryError = (alias = defaultRegistryName) => error(
|
|
72
|
+
[
|
|
73
|
+
`Missing ${alias} registry configuration.`,
|
|
74
|
+
"",
|
|
75
|
+
`Install commands require the \`registries.${alias}\` alias.`,
|
|
76
|
+
"Run `vlt setup` to get configured.",
|
|
77
|
+
"",
|
|
78
|
+
"See https://docs.vlt.sh/cli for other ways to set a registry."
|
|
79
|
+
].join("\n"),
|
|
80
|
+
{ code: "ECONFIG" }
|
|
81
|
+
);
|
|
70
82
|
var ambiguousRegistryError = (candidates) => error(
|
|
71
83
|
[
|
|
72
84
|
"Multiple registries are configured; specify which one to use.",
|
|
@@ -95,6 +107,7 @@ var gatherCandidates = (conf) => {
|
|
|
95
107
|
return Object.entries(conf.options.registries).filter(([alias, url]) => builtins[alias] !== url).map(([alias, url]) => ({ alias, url }));
|
|
96
108
|
};
|
|
97
109
|
var hasConfiguredRegistry = (conf) => !!conf.options.registry || gatherCandidates(conf).length > 0;
|
|
110
|
+
var hasNpmRegistry = (conf) => !!conf.options.registries[conf.options["default-registry-alias"]];
|
|
98
111
|
var requireRegistry = (conf, alias) => {
|
|
99
112
|
if (alias !== void 0) return resolveRegistryAlias(conf, alias);
|
|
100
113
|
const { registry } = conf.options;
|
|
@@ -131,7 +144,9 @@ var resolveRegistry = async (conf, {
|
|
|
131
144
|
|
|
132
145
|
export {
|
|
133
146
|
missingRegistryError,
|
|
147
|
+
missingNpmRegistryError,
|
|
134
148
|
hasConfiguredRegistry,
|
|
149
|
+
hasNpmRegistry,
|
|
135
150
|
requireRegistry,
|
|
136
151
|
resolveRegistry
|
|
137
152
|
};
|
|
@@ -20,15 +20,17 @@ import {
|
|
|
20
20
|
} from "./chunk-G2YT2GWF.js";
|
|
21
21
|
import {
|
|
22
22
|
parseError
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GDJ7JT2R.js";
|
|
24
24
|
import {
|
|
25
25
|
hasConfiguredRegistry,
|
|
26
|
+
hasNpmRegistry,
|
|
27
|
+
missingNpmRegistryError,
|
|
26
28
|
missingRegistryError
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5JFRXIK2.js";
|
|
28
30
|
import {
|
|
29
31
|
isGraphRunError,
|
|
30
32
|
splitDepID
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-3OPNZI6G.js";
|
|
32
34
|
import {
|
|
33
35
|
defaultView
|
|
34
36
|
} from "./chunk-WP6CYBPM.js";
|
|
@@ -46,7 +48,7 @@ import {
|
|
|
46
48
|
import {
|
|
47
49
|
isErrorWithCause,
|
|
48
50
|
isObject
|
|
49
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-VFBCWAOC.js";
|
|
50
52
|
|
|
51
53
|
// ../../src/cli-sdk/src/print-err.ts
|
|
52
54
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -493,7 +495,7 @@ var startView = async (conf, opts, views, { start } = { start: Date.now() }) =>
|
|
|
493
495
|
var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
494
496
|
start: Date.now()
|
|
495
497
|
}) => {
|
|
496
|
-
const { usage, views, command, needsRegistry } = cliCommand;
|
|
498
|
+
const { usage, views, command, needsRegistry, needsNpmRegistry } = cliCommand;
|
|
497
499
|
const stdoutColor = conf.values.color ?? supportsColor2(process.stdout);
|
|
498
500
|
const stderrColor = conf.values.color ?? supportsColor2(process.stderr);
|
|
499
501
|
if (conf.values.help) {
|
|
@@ -525,6 +527,11 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
|
|
|
525
527
|
if (needsRegistry && !hasConfiguredRegistry(conf)) {
|
|
526
528
|
throw missingRegistryError();
|
|
527
529
|
}
|
|
530
|
+
if (needsNpmRegistry && !hasNpmRegistry(conf)) {
|
|
531
|
+
throw missingNpmRegistryError(
|
|
532
|
+
conf.options["default-registry-alias"]
|
|
533
|
+
);
|
|
534
|
+
}
|
|
528
535
|
const output = await onDone(await command(conf));
|
|
529
536
|
stopRequestLog();
|
|
530
537
|
const duration_ms = Date.now() - start;
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
asDepID,
|
|
14
14
|
baseDepID,
|
|
15
15
|
splitDepID
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3OPNZI6G.js";
|
|
17
17
|
import {
|
|
18
18
|
loadPackageJson
|
|
19
19
|
} from "./chunk-E74WGW5C.js";
|
|
@@ -23,6 +23,9 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
XDG
|
|
25
25
|
} from "./chunk-XNLSTHDK.js";
|
|
26
|
+
import {
|
|
27
|
+
defaultRegistryName
|
|
28
|
+
} from "./chunk-VFBCWAOC.js";
|
|
26
29
|
import {
|
|
27
30
|
error
|
|
28
31
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -250,16 +253,20 @@ var __CODE_SPLIT_SCRIPT_NAME = resolve(import.meta.dirname, "security-archive-sr
|
|
|
250
253
|
// ../../src/security-archive/src/index.ts
|
|
251
254
|
var SOCKET_API_V0_URL = "https://api.socket.dev/v0/purl?alerts=true";
|
|
252
255
|
var SOCKET_PUBLIC_API_TOKEN = "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api";
|
|
253
|
-
var
|
|
254
|
-
var
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
256
|
+
var npmRegistryURL = "https://registry.npmjs.org/";
|
|
257
|
+
var normalizeRegistryURL = (url) => url.endsWith("/") ? url : `${url}/`;
|
|
258
|
+
var nodeRegistryURL = (node) => {
|
|
259
|
+
const [type, reg] = splitDepID(node.id);
|
|
260
|
+
if (type !== "registry") return;
|
|
261
|
+
const url = /^https?:\/\//.test(reg) ? reg : node.options.registries?.[reg];
|
|
262
|
+
return url ? normalizeRegistryURL(url) : void 0;
|
|
263
|
+
};
|
|
264
|
+
var usesNpmRegistry = (node) => {
|
|
265
|
+
const origin = nodeRegistryURL(node);
|
|
266
|
+
if (!origin) return false;
|
|
267
|
+
if (origin === npmRegistryURL) return true;
|
|
268
|
+
const npmAlias = node.options.registries?.[defaultRegistryName];
|
|
269
|
+
return !!npmAlias && normalizeRegistryURL(npmAlias) === origin;
|
|
263
270
|
};
|
|
264
271
|
var { version } = loadPackageJson(
|
|
265
272
|
import.meta.filename,
|
|
@@ -412,7 +419,7 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
412
419
|
const queue = /* @__PURE__ */ new Set();
|
|
413
420
|
for (const node of this.#nodesByID.values()) {
|
|
414
421
|
const normalizedId = baseDepID(node.id);
|
|
415
|
-
if (
|
|
422
|
+
if (usesNpmRegistry(node) && !this.has(normalizedId) && !this.#expired.has(normalizedId)) {
|
|
416
423
|
const purl = `pkg:npm/${node.name}@${node.version}`;
|
|
417
424
|
queue.add({ purl });
|
|
418
425
|
}
|
|
@@ -512,12 +519,12 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
512
519
|
}
|
|
513
520
|
}
|
|
514
521
|
/**
|
|
515
|
-
* Validates that all
|
|
522
|
+
* Validates that all npm-ecosystem packages in the nodes
|
|
516
523
|
* have a valid report data in the current in-memory cache.
|
|
517
524
|
*/
|
|
518
525
|
#validateReportData() {
|
|
519
526
|
for (const node of this.#nodesByID.values()) {
|
|
520
|
-
if (
|
|
527
|
+
if (usesNpmRegistry(node)) {
|
|
521
528
|
if (!this.has(baseDepID(node.id))) {
|
|
522
529
|
this.ok = false;
|
|
523
530
|
return;
|
|
@@ -12,12 +12,12 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
init,
|
|
14
14
|
install
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3NGV7EC6.js";
|
|
16
16
|
import {
|
|
17
17
|
asWSConfig,
|
|
18
18
|
assertWSConfig,
|
|
19
19
|
minimatch
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SVBEF5PK.js";
|
|
21
21
|
import {
|
|
22
22
|
commandUsage
|
|
23
23
|
} from "./chunk-LCDBW6IT.js";
|
|
@@ -11,17 +11,17 @@ 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-YZPRRP7W.js";
|
|
15
15
|
import {
|
|
16
16
|
findCmdShimIfExists,
|
|
17
17
|
install
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3NGV7EC6.js";
|
|
19
19
|
import {
|
|
20
20
|
PathScurry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SVBEF5PK.js";
|
|
22
22
|
import {
|
|
23
23
|
Spec
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XKVU23NC.js";
|
|
25
25
|
import {
|
|
26
26
|
walkUp
|
|
27
27
|
} from "./chunk-HTOTG4TS.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from "./chunk-XNLSTHDK.js";
|
|
31
31
|
import {
|
|
32
32
|
parseScope
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-VFBCWAOC.js";
|
|
34
34
|
import {
|
|
35
35
|
error
|
|
36
36
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
Ct,
|
|
14
14
|
Qn,
|
|
15
15
|
require_lib
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZWKI5OSF.js";
|
|
17
17
|
import {
|
|
18
18
|
minimatch
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SVBEF5PK.js";
|
|
20
20
|
import {
|
|
21
21
|
Spec
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XKVU23NC.js";
|
|
23
23
|
import {
|
|
24
24
|
parse,
|
|
25
25
|
stringify
|