@vltpkg/cli-js 1.4.0 → 1.5.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-422UGEWN.js → access-QPX4QXV4.js} +13 -12
- package/{bugs-RED7Y33Q.js → bugs-TLOECXEM.js} +28 -25
- package/{build-IHMPBWRO.js → build-IQOS3LKO.js} +28 -19
- package/{cache-FJP2RZJX.js → cache-O5IBYYSB.js} +17 -17
- package/cache-unzip-src-unzip.js +35 -11
- package/{chunk-OVPHE4O7.js → chunk-2U4PVHP4.js} +5232 -10882
- package/{chunk-OAJ3PO3Z.js → chunk-35EG6T3J.js} +7 -7
- package/{chunk-GIIAODRI.js → chunk-3S3W7QEM.js} +7 -5
- package/{chunk-UGCKF5ZE.js → chunk-43EJ4Q42.js} +1 -1
- package/{chunk-5Y4SYLJ2.js → chunk-4TSHLSRK.js} +1 -1
- package/chunk-4UH3KMTD.js +6444 -0
- package/{chunk-SR2VOY5J.js → chunk-5KW6AOTT.js} +1 -1
- package/{chunk-FLH4YC6W.js → chunk-6LZM3I4Q.js} +35 -11
- package/{chunk-X4FVR4R5.js → chunk-6W5XMVIZ.js} +12 -10
- package/{chunk-TPRK6IDA.js → chunk-7UWRR6EE.js} +2 -2
- package/{chunk-ASLX43R3.js → chunk-ARE7FKDG.js} +6 -4
- package/chunk-B6RIGNEO.js +626 -0
- package/{chunk-I7UMHYZX.js → chunk-C6ZVVEFV.js} +111 -1186
- package/{chunk-WF6KLKRN.js → chunk-CMLDLZZ3.js} +47 -1
- package/{chunk-ISE4IRHF.js → chunk-CS6AYPY5.js} +6 -6
- package/{chunk-LHPEBLOU.js → chunk-CW56EJIL.js} +1 -1
- package/{chunk-PLG3OYCX.js → chunk-F7NPYSI2.js} +3 -2
- package/{chunk-ZJMJ7MCT.js → chunk-G3FZ2ZJK.js} +1 -1
- package/chunk-GUP55DM6.js +59 -0
- package/chunk-HOF7LEIC.js +24 -0
- package/chunk-IFEZ6BFV.js +1111 -0
- package/{chunk-7T3XAYP4.js → chunk-IJUVVD7E.js} +1 -1
- package/{chunk-DNRR3XMG.js → chunk-ISAMD2FE.js} +1 -1
- package/{chunk-PHJJPY5G.js → chunk-LH7J5BDU.js} +5 -5
- package/{chunk-5IJTPZXP.js → chunk-LUVDMEW4.js} +1 -1
- package/{chunk-C23TDXRG.js → chunk-MYX4JCIJ.js} +1 -1
- package/{chunk-APMYKJI2.js → chunk-QNHBAGXQ.js} +1 -1
- package/{chunk-5TNXLRW2.js → chunk-SMXXFQPI.js} +50 -12
- package/chunk-SUU2WETN.js +268 -0
- package/chunk-T2VBCUF5.js +77 -0
- package/{chunk-MKWPTN3C.js → chunk-T5EP7QEF.js} +2 -2
- package/{chunk-THSYN5EK.js → chunk-UZ6ICZE3.js} +1 -1
- package/{chunk-TO23PR7J.js → chunk-VR7NRWAD.js} +14 -12
- package/chunk-W4T5CGCO.js +52 -0
- package/{chunk-FZUYGJZU.js → chunk-WHWPAYZY.js} +117 -19
- package/{chunk-QCSUWACA.js → chunk-X6JKMIOU.js} +5 -1
- package/{chunk-5RHABCYI.js → chunk-XCQCYB6G.js} +8 -8
- package/{chunk-2AMOC4DN.js → chunk-XCSNI6AO.js} +4 -4
- package/{chunk-4UCADW6S.js → chunk-XD5KUDXX.js} +7 -7
- package/{chunk-HZXJ423P.js → chunk-Z5D5KODU.js} +1 -1
- package/{ci-YSKNNO5M.js → ci-ESVUMOZO.js} +31 -13
- package/cli-package.json +1 -1
- package/{config-CSPCDMR3.js → config-TMB2X6DW.js} +11 -9
- package/{config-HO7GY3QT.js → config-ZVVLFKR7.js} +15 -13
- package/{create-2TJT3AHJ.js → create-BLTNKSBQ.js} +28 -26
- package/{deprecate-7FRJI2RL.js → deprecate-VA6PGHYL.js} +17 -15
- package/{dist-tag-WCFF5OEG.js → dist-tag-OYJREFO2.js} +13 -12
- package/{docs-JMBPTU23.js → docs-6OC3OQNM.js} +28 -25
- package/{exec-FBOUKZZ2.js → exec-AZPGFVRY.js} +28 -26
- package/{exec-cache-X3ZWM5S3.js → exec-cache-D75UY2WI.js} +24 -22
- package/{exec-local-Y3KQC22N.js → exec-local-E2JKB4X4.js} +22 -20
- package/{help-PUKVH5X7.js → help-UPW77X5N.js} +5 -5
- package/{init-GOKAQXXZ.js → init-SNO6QL7C.js} +14 -11
- package/{install-XFN4UFOC.js → install-TEJM2YVX.js} +67 -28
- package/{list-43JFFG5D.js → list-NHCC2RNB.js} +33 -27
- package/{login-RSTZKNKN.js → login-XNZXCGFD.js} +18 -16
- package/{logout-4576FFXZ.js → logout-YCM7O36Q.js} +13 -12
- package/{outdated-ACQ5A2Y7.js → outdated-4LA7N63W.js} +26 -22
- package/{pack-QQVJ3G25.js → pack-RC4CZSWF.js} +22 -18
- package/package.json +1 -1
- package/{ping-QCDQQRO5.js → ping-RLVAZGDL.js} +13 -12
- package/{pkg-CSOJV7UC.js → pkg-FED5C6TP.js} +18 -14
- package/{profile-VL4HPW3N.js → profile-DJZNLQPG.js} +13 -12
- package/{publish-2YBO6ZXE.js → publish-54AMVMTQ.js} +56 -45
- package/{query-IHHFMJRT.js → query-ZQLMSJ7O.js} +35 -29
- package/{registry-W7BRZZZ2.js → registry-6HKQYSZX.js} +7 -7
- package/registry-client-src-revalidate.js +36 -12
- package/{repo-L3BXAAWS.js → repo-ITA4BLZ4.js} +28 -25
- package/{reporter-5NYOHBO7.js → reporter-UYVR2WMB.js} +72 -14
- package/{run-AMUUVLTI.js → run-TP2HTJRN.js} +22 -20
- package/{run-exec-5W3XWQZA.js → run-exec-UGCC53DV.js} +22 -20
- package/security-archive-src-update-expired.js +43 -17
- package/{setup-TFM4GJF7.js → setup-XPAM5U3Z.js} +22 -21
- package/skills-LR6GXW3X.js +413 -0
- package/skills-YD2TB2VD.js +495 -0
- package/{src-4CYCUWZL.js → src-34D4DOOH.js} +23 -18
- package/{src-I3GMULFP.js → src-H6DFCAPH.js} +9 -8
- package/{src-LUTN2ODD.js → src-LHDC4NJO.js} +2 -2
- package/{token-OANOBE3G.js → token-OF63PFTQ.js} +13 -12
- package/{uninstall-YXTQ4AIZ.js → uninstall-B54FQ5KQ.js} +20 -15
- package/{unpublish-SZXYMYIU.js → unpublish-CSHIGMDQ.js} +31 -16
- package/{update-FHLMWGIM.js → update-HS4VJ5ZG.js} +50 -25
- package/{version-ZWFCTU5V.js → version-L7S3DHUS.js} +19 -14
- package/{view-NFNJXMLV.js → view-NWKKWFVA.js} +17 -15
- 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-O7GOSGCI.js → whoami-65K35VGW.js} +13 -12
- package/chunk-G2YT2GWF.js +0 -120
- package/chunk-T6FBP4OU.js +0 -76
- package/chunk-U7TEQCBN.js +0 -880
|
@@ -11,7 +11,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
getId
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-F7NPYSI2.js";
|
|
15
15
|
|
|
16
16
|
// ../../src/cli-sdk/src/stub-node.ts
|
|
17
17
|
var createStubNode = (spec, name, version, options) => ({
|
|
@@ -11,13 +11,13 @@ 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-
|
|
15
|
-
import {
|
|
16
|
-
stderr
|
|
17
|
-
} from "./chunk-FZUYGJZU.js";
|
|
14
|
+
} from "./chunk-7UWRR6EE.js";
|
|
18
15
|
import {
|
|
19
16
|
mermaidOutput
|
|
20
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4UH3KMTD.js";
|
|
18
|
+
import {
|
|
19
|
+
stderr
|
|
20
|
+
} from "./chunk-WHWPAYZY.js";
|
|
21
21
|
import {
|
|
22
22
|
ViewClass
|
|
23
23
|
} from "./chunk-4KCU2KZL.js";
|
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
asDepID,
|
|
14
14
|
baseDepID,
|
|
15
15
|
splitDepID
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-F7NPYSI2.js";
|
|
17
17
|
import {
|
|
18
18
|
userAgent
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-G3FZ2ZJK.js";
|
|
20
20
|
import {
|
|
21
21
|
I
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-B6RIGNEO.js";
|
|
23
23
|
import {
|
|
24
24
|
XDG
|
|
25
25
|
} from "./chunk-XNLSTHDK.js";
|
|
26
26
|
import {
|
|
27
27
|
defaultRegistryName
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-6LZM3I4Q.js";
|
|
29
29
|
import {
|
|
30
30
|
error
|
|
31
31
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -291,10 +291,15 @@ var usesNpmRegistry = (node) => {
|
|
|
291
291
|
// ../../src/security-archive/src/index.ts
|
|
292
292
|
var SOCKET_API_V0_URL = "https://api.socket.dev/v0/purl?alerts=true";
|
|
293
293
|
var SOCKET_PUBLIC_API_TOKEN = "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api";
|
|
294
|
+
var asTimeout = (raw) => {
|
|
295
|
+
const n = Number(raw);
|
|
296
|
+
return Number.isInteger(n) && n > 0 && n <= 2147483647 ? n : void 0;
|
|
297
|
+
};
|
|
294
298
|
var SecurityArchive = class _SecurityArchive extends I {
|
|
295
299
|
#expired = /* @__PURE__ */ new Set();
|
|
296
300
|
#path;
|
|
297
301
|
#retries;
|
|
302
|
+
#timeout;
|
|
298
303
|
#nodesByName = /* @__PURE__ */ new Map();
|
|
299
304
|
#nodesByID = /* @__PURE__ */ new Map();
|
|
300
305
|
/**
|
|
@@ -302,6 +307,10 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
302
307
|
* for all public registry packages from the initial list of nodes.
|
|
303
308
|
*/
|
|
304
309
|
ok = false;
|
|
310
|
+
/**
|
|
311
|
+
* True if the last refresh() timed out waiting for the remote API.
|
|
312
|
+
*/
|
|
313
|
+
timedOut = false;
|
|
305
314
|
/**
|
|
306
315
|
* Creates a new security archive instance and starts the refresh process.
|
|
307
316
|
*/
|
|
@@ -322,6 +331,12 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
322
331
|
static get defaultTtl() {
|
|
323
332
|
return 1e3 * 60 * 60 * 3;
|
|
324
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* By default, remote requests time out after 30 seconds.
|
|
336
|
+
*/
|
|
337
|
+
static get defaultTimeout() {
|
|
338
|
+
return 3e4;
|
|
339
|
+
}
|
|
325
340
|
constructor(options = {}) {
|
|
326
341
|
super({
|
|
327
342
|
max: _SecurityArchive.defaultMax,
|
|
@@ -331,6 +346,7 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
331
346
|
});
|
|
332
347
|
this.#path = options.path ?? new XDG("vlt").cache("security-archive.db");
|
|
333
348
|
this.#retries = options.retries ?? 3;
|
|
349
|
+
this.#timeout = asTimeout(options.timeout) ?? asTimeout(process.env.VLT_SECURITY_ARCHIVE_TIMEOUT) ?? _SecurityArchive.defaultTimeout;
|
|
334
350
|
}
|
|
335
351
|
/**
|
|
336
352
|
* Get the report data for a node, keyed by its base {@link DepID}.
|
|
@@ -433,6 +449,7 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
433
449
|
const payload = {
|
|
434
450
|
dbPath: this.#path,
|
|
435
451
|
retries: this.#retries,
|
|
452
|
+
timeout: this.#timeout,
|
|
436
453
|
ttl: _SecurityArchive.defaultTtl,
|
|
437
454
|
expired
|
|
438
455
|
};
|
|
@@ -474,7 +491,7 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
474
491
|
* Fetches security information from the socket.dev API.
|
|
475
492
|
* Returns a string of NDJSON data.
|
|
476
493
|
*/
|
|
477
|
-
async #retrieveRemoteData(queue) {
|
|
494
|
+
async #retrieveRemoteData(queue, signal) {
|
|
478
495
|
const req = await fetch(SOCKET_API_V0_URL, {
|
|
479
496
|
method: "POST",
|
|
480
497
|
headers: {
|
|
@@ -483,7 +500,8 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
483
500
|
},
|
|
484
501
|
body: JSON.stringify({
|
|
485
502
|
components: Array.from(queue)
|
|
486
|
-
})
|
|
503
|
+
}),
|
|
504
|
+
signal
|
|
487
505
|
});
|
|
488
506
|
if (req.status === 404) {
|
|
489
507
|
throw new AbortError("Missing API");
|
|
@@ -494,6 +512,25 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
494
512
|
const str = await req.text();
|
|
495
513
|
return str.trim() + "\n";
|
|
496
514
|
}
|
|
515
|
+
/**
|
|
516
|
+
* Fetches remote data within the configured timeout, retries included.
|
|
517
|
+
* Returns `undefined` on timeout so that queued packages stay unscanned.
|
|
518
|
+
*/
|
|
519
|
+
async #fetchRemoteData(queue) {
|
|
520
|
+
const signal = AbortSignal.timeout(this.#timeout);
|
|
521
|
+
try {
|
|
522
|
+
return await pRetry(
|
|
523
|
+
() => this.#retrieveRemoteData(queue, signal),
|
|
524
|
+
{ retries: this.#retries, signal }
|
|
525
|
+
);
|
|
526
|
+
} catch (err) {
|
|
527
|
+
if (!signal.aborted) throw err;
|
|
528
|
+
this.timedOut = true;
|
|
529
|
+
console.warn(
|
|
530
|
+
`security-archive: timed out after ${this.#timeout}ms fetching security data; ${queue.size} package(s) left unscanned (use :scanned to exclude them). Set VLT_SECURITY_ARCHIVE_TIMEOUT=<ms> to wait longer.`
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
497
534
|
/**
|
|
498
535
|
* Parses and load NDJSON data into the in-memory cache.
|
|
499
536
|
* Returns a set of dep ids that were successfully loaded.
|
|
@@ -578,6 +615,7 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
578
615
|
*/
|
|
579
616
|
async refresh({ nodes }) {
|
|
580
617
|
this.clear();
|
|
618
|
+
this.timedOut = false;
|
|
581
619
|
const db = this.#openDatabase();
|
|
582
620
|
this.#nodesByName.clear();
|
|
583
621
|
this.#nodesByID.clear();
|
|
@@ -591,12 +629,11 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
591
629
|
this.#loadItemsFromDatabase(db, nodes);
|
|
592
630
|
const queue = this.#queueUpRequiredPackages();
|
|
593
631
|
if (queue.size > 0) {
|
|
594
|
-
const res = await
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
this.#storeNewItemsToDatabase(db, ids);
|
|
632
|
+
const res = await this.#fetchRemoteData(queue);
|
|
633
|
+
if (res !== void 0) {
|
|
634
|
+
const ids = this.#loadFromNDJSON(res);
|
|
635
|
+
this.#storeNewItemsToDatabase(db, ids);
|
|
636
|
+
}
|
|
600
637
|
}
|
|
601
638
|
this.#validateReportData();
|
|
602
639
|
} finally {
|
|
@@ -626,5 +663,6 @@ var SecurityArchive = class _SecurityArchive extends I {
|
|
|
626
663
|
export {
|
|
627
664
|
AbortError,
|
|
628
665
|
pRetry,
|
|
666
|
+
usesNpmRegistry,
|
|
629
667
|
SecurityArchive
|
|
630
668
|
};
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
|
|
16
|
+
// ../../src/promise-spawn/src/index.ts
|
|
17
|
+
import { spawn } from "node:child_process";
|
|
18
|
+
var isPipe = (stdio = "pipe", fd) => stdio === "pipe" || stdio === "overlapped" || stdio === null ? true : Array.isArray(stdio) ? isPipe(stdio[fd], fd) : false;
|
|
19
|
+
function stdioResult(stdout, stderr, o) {
|
|
20
|
+
return {
|
|
21
|
+
stdout: !isPipe(o.stdio, 1) ? null : o.stdioString !== false ? Buffer.concat(stdout).toString().trim() : Buffer.concat(stdout),
|
|
22
|
+
stderr: !isPipe(o.stdio, 2) ? null : o.stdioString !== false ? Buffer.concat(stderr).toString().trim() : Buffer.concat(stderr)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var SpawnPromise = class extends Promise {
|
|
26
|
+
[Symbol.toStringTag] = "SpawnPromise";
|
|
27
|
+
/** The spawned process this promise references */
|
|
28
|
+
process;
|
|
29
|
+
/** Expose the child process stdin, if available */
|
|
30
|
+
stdin;
|
|
31
|
+
/**
|
|
32
|
+
* Set static `Symbol.species` back to the base Promise class so that
|
|
33
|
+
* v8 doesn't get confused by the changed constructor signature.
|
|
34
|
+
*/
|
|
35
|
+
static get [Symbol.species]() {
|
|
36
|
+
return Promise;
|
|
37
|
+
}
|
|
38
|
+
constructor(command, args, opts, extra = {}) {
|
|
39
|
+
let proc;
|
|
40
|
+
super((res, rej) => {
|
|
41
|
+
proc = spawn(command, args, opts);
|
|
42
|
+
const stdout = [];
|
|
43
|
+
const stderr = [];
|
|
44
|
+
const reject = (er, status, signal) => {
|
|
45
|
+
const stdio = stdioResult(stdout, stderr, opts);
|
|
46
|
+
const errorResult = {
|
|
47
|
+
command,
|
|
48
|
+
args,
|
|
49
|
+
stdout: stdio.stdout,
|
|
50
|
+
stderr: stdio.stderr,
|
|
51
|
+
cwd: opts.cwd?.toString() ?? process.cwd()
|
|
52
|
+
};
|
|
53
|
+
if (er !== void 0) {
|
|
54
|
+
errorResult.cause = er;
|
|
55
|
+
}
|
|
56
|
+
if (status !== void 0) {
|
|
57
|
+
errorResult.status = status;
|
|
58
|
+
}
|
|
59
|
+
if (signal !== void 0) {
|
|
60
|
+
errorResult.signal = signal;
|
|
61
|
+
}
|
|
62
|
+
Object.assign(errorResult, extra);
|
|
63
|
+
rej(error("command failed", errorResult));
|
|
64
|
+
};
|
|
65
|
+
const resolve = (status, signal) => {
|
|
66
|
+
const stdio = stdioResult(stdout, stderr, opts);
|
|
67
|
+
const successResult = {
|
|
68
|
+
command,
|
|
69
|
+
args,
|
|
70
|
+
status,
|
|
71
|
+
signal,
|
|
72
|
+
stdout: stdio.stdout,
|
|
73
|
+
stderr: stdio.stderr,
|
|
74
|
+
cwd: opts.cwd?.toString() ?? process.cwd()
|
|
75
|
+
};
|
|
76
|
+
Object.assign(successResult, extra);
|
|
77
|
+
res(successResult);
|
|
78
|
+
};
|
|
79
|
+
proc.on("error", reject);
|
|
80
|
+
proc.stdout?.on("data", (c) => stdout.push(c)).on("error", reject);
|
|
81
|
+
proc.stderr?.on("data", (c) => stderr.push(c)).on("error", reject);
|
|
82
|
+
proc.on("close", (status, signal) => {
|
|
83
|
+
if ((status || signal) && !opts.acceptFail) {
|
|
84
|
+
reject(void 0, status, signal);
|
|
85
|
+
} else {
|
|
86
|
+
resolve(status, signal);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
this.process = proc;
|
|
91
|
+
this.stdin = proc.stdin;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
function promiseSpawn(command, args, opts = {}, extra = {}) {
|
|
95
|
+
return new SpawnPromise(command, args, opts, extra);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ../../node_modules/.vlt/~npm~isexe@3.1.5/node_modules/isexe/dist/esm/index.min.js
|
|
99
|
+
import { statSync as w } from "node:fs";
|
|
100
|
+
import { stat as S } from "node:fs/promises";
|
|
101
|
+
import { statSync as k } from "node:fs";
|
|
102
|
+
import { stat as I } from "node:fs/promises";
|
|
103
|
+
import { delimiter as _ } from "node:path";
|
|
104
|
+
var y = Object.defineProperty;
|
|
105
|
+
var u = (t, r) => {
|
|
106
|
+
for (var e in r) y(t, e, { get: r[e], enumerable: true });
|
|
107
|
+
};
|
|
108
|
+
var i = {};
|
|
109
|
+
u(i, { isexe: () => C, sync: () => A });
|
|
110
|
+
var C = async (t, r = {}) => {
|
|
111
|
+
let { ignoreErrors: e = false } = r;
|
|
112
|
+
try {
|
|
113
|
+
return d(await S(t), r);
|
|
114
|
+
} catch (s) {
|
|
115
|
+
let o = s;
|
|
116
|
+
if (e || o.code === "EACCES") return false;
|
|
117
|
+
throw o;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var A = (t, r = {}) => {
|
|
121
|
+
let { ignoreErrors: e = false } = r;
|
|
122
|
+
try {
|
|
123
|
+
return d(w(t), r);
|
|
124
|
+
} catch (s) {
|
|
125
|
+
let o = s;
|
|
126
|
+
if (e || o.code === "EACCES") return false;
|
|
127
|
+
throw o;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
var d = (t, r) => t.isFile() && T(t, r);
|
|
131
|
+
var T = (t, r) => {
|
|
132
|
+
let e = r.uid ?? process.getuid?.(), s = r.groups ?? process.getgroups?.() ?? [], o = r.gid ?? process.getgid?.() ?? s[0];
|
|
133
|
+
if (e === void 0 || o === void 0) throw new Error("cannot get uid or gid");
|
|
134
|
+
let c = /* @__PURE__ */ new Set([o, ...s]), n = t.mode, l = t.uid, E = t.gid, f = parseInt("100", 8), p = parseInt("010", 8), x = parseInt("001", 8), h = f | p;
|
|
135
|
+
return !!(n & x || n & p && c.has(E) || n & f && l === e || n & h && e === 0);
|
|
136
|
+
};
|
|
137
|
+
var a = {};
|
|
138
|
+
u(a, { isexe: () => F, sync: () => L });
|
|
139
|
+
var F = async (t, r = {}) => {
|
|
140
|
+
let { ignoreErrors: e = false } = r;
|
|
141
|
+
try {
|
|
142
|
+
return m(await I(t), t, r);
|
|
143
|
+
} catch (s) {
|
|
144
|
+
let o = s;
|
|
145
|
+
if (e || o.code === "EACCES") return false;
|
|
146
|
+
throw o;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var L = (t, r = {}) => {
|
|
150
|
+
let { ignoreErrors: e = false } = r;
|
|
151
|
+
try {
|
|
152
|
+
return m(k(t), t, r);
|
|
153
|
+
} catch (s) {
|
|
154
|
+
let o = s;
|
|
155
|
+
if (e || o.code === "EACCES") return false;
|
|
156
|
+
throw o;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var P = (t, r) => {
|
|
160
|
+
let { pathExt: e = process.env.PATHEXT || "" } = r, s = e.split(_);
|
|
161
|
+
if (s.indexOf("") !== -1) return true;
|
|
162
|
+
for (let o of s) {
|
|
163
|
+
let c = o.toLowerCase(), n = t.substring(t.length - c.length).toLowerCase();
|
|
164
|
+
if (c && n === c) return true;
|
|
165
|
+
}
|
|
166
|
+
return false;
|
|
167
|
+
};
|
|
168
|
+
var m = (t, r, e) => t.isFile() && P(r, e);
|
|
169
|
+
var v = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
|
|
170
|
+
var g = v === "win32" ? a : i;
|
|
171
|
+
var R = g.isexe;
|
|
172
|
+
var U = g.sync;
|
|
173
|
+
|
|
174
|
+
// ../../src/which/src/index.ts
|
|
175
|
+
import { delimiter, join, sep } from "node:path";
|
|
176
|
+
var isWindows = process.platform === "win32";
|
|
177
|
+
var rSlash = sep === "/" ? /\// : /[\\/]/;
|
|
178
|
+
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
179
|
+
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
180
|
+
var getPathInfo = (cmd, {
|
|
181
|
+
path: optPath = process.env.PATH,
|
|
182
|
+
pathExt: optPathExt = process.env.PATHEXT,
|
|
183
|
+
delimiter: optDelimiter = delimiter
|
|
184
|
+
}) => {
|
|
185
|
+
const pathEnv = cmd.match(rSlash) ? [""] : [
|
|
186
|
+
// windows always checks the cwd first
|
|
187
|
+
/* c8 ignore next - platform-specific */
|
|
188
|
+
...isWindows ? [process.cwd()] : [],
|
|
189
|
+
...(optPath ?? /* c8 ignore next - very unusual */
|
|
190
|
+
"").split(
|
|
191
|
+
optDelimiter
|
|
192
|
+
)
|
|
193
|
+
];
|
|
194
|
+
if (isWindows) {
|
|
195
|
+
const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
|
|
196
|
+
const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
|
|
197
|
+
if (cmd.includes(".") && pathExt[0] !== "") {
|
|
198
|
+
pathExt.unshift("");
|
|
199
|
+
}
|
|
200
|
+
return { pathEnv, pathExt, pathExtExe };
|
|
201
|
+
}
|
|
202
|
+
return { pathEnv, pathExt: [""] };
|
|
203
|
+
};
|
|
204
|
+
var getPathPart = (raw, cmd) => {
|
|
205
|
+
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
206
|
+
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
207
|
+
return prefix + join(pathPart, cmd);
|
|
208
|
+
};
|
|
209
|
+
async function which(cmd, opt = {}) {
|
|
210
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
211
|
+
const found = [];
|
|
212
|
+
for (const envPart of pathEnv) {
|
|
213
|
+
const p = getPathPart(envPart, cmd);
|
|
214
|
+
for (const ext of pathExt) {
|
|
215
|
+
const withExt = p + ext;
|
|
216
|
+
const is = await R(withExt, {
|
|
217
|
+
pathExt: pathExtExe,
|
|
218
|
+
ignoreErrors: true
|
|
219
|
+
});
|
|
220
|
+
if (is) {
|
|
221
|
+
if (!opt.all) {
|
|
222
|
+
return withExt;
|
|
223
|
+
}
|
|
224
|
+
found.push(withExt);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (opt.all && found.length) {
|
|
229
|
+
return found;
|
|
230
|
+
}
|
|
231
|
+
if (opt.nothrow) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
throw getNotFoundError(cmd);
|
|
235
|
+
}
|
|
236
|
+
function whichSync(cmd, opt = {}) {
|
|
237
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
238
|
+
const found = [];
|
|
239
|
+
for (const pathEnvPart of pathEnv) {
|
|
240
|
+
const p = getPathPart(pathEnvPart, cmd);
|
|
241
|
+
for (const ext of pathExt) {
|
|
242
|
+
const withExt = p + ext;
|
|
243
|
+
const is = U(withExt, {
|
|
244
|
+
pathExt: pathExtExe,
|
|
245
|
+
ignoreErrors: true
|
|
246
|
+
});
|
|
247
|
+
if (is) {
|
|
248
|
+
if (!opt.all) {
|
|
249
|
+
return withExt;
|
|
250
|
+
}
|
|
251
|
+
found.push(withExt);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (opt.all && found.length) {
|
|
256
|
+
return found;
|
|
257
|
+
}
|
|
258
|
+
if (opt.nothrow) {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
throw getNotFoundError(cmd);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export {
|
|
265
|
+
promiseSpawn,
|
|
266
|
+
which,
|
|
267
|
+
whichSync
|
|
268
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
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-QPX4QXV4.js"),
|
|
22
|
+
"./commands/bugs.ts": () => import("./bugs-TLOECXEM.js"),
|
|
23
|
+
"./commands/build.ts": () => import("./build-IQOS3LKO.js"),
|
|
24
|
+
"./commands/cache.ts": () => import("./cache-O5IBYYSB.js"),
|
|
25
|
+
"./commands/ci.ts": () => import("./ci-ESVUMOZO.js"),
|
|
26
|
+
"./commands/config.ts": () => import("./config-ZVVLFKR7.js"),
|
|
27
|
+
"./commands/create.ts": () => import("./create-BLTNKSBQ.js"),
|
|
28
|
+
"./commands/deprecate.ts": () => import("./deprecate-VA6PGHYL.js"),
|
|
29
|
+
"./commands/dist-tag.ts": () => import("./dist-tag-OYJREFO2.js"),
|
|
30
|
+
"./commands/docs.ts": () => import("./docs-6OC3OQNM.js"),
|
|
31
|
+
"./commands/exec-cache.ts": () => import("./exec-cache-D75UY2WI.js"),
|
|
32
|
+
"./commands/exec-local.ts": () => import("./exec-local-E2JKB4X4.js"),
|
|
33
|
+
"./commands/exec.ts": () => import("./exec-AZPGFVRY.js"),
|
|
34
|
+
"./commands/help.ts": () => import("./help-UPW77X5N.js"),
|
|
35
|
+
"./commands/init.ts": () => import("./init-SNO6QL7C.js"),
|
|
36
|
+
"./commands/install.ts": () => import("./install-TEJM2YVX.js"),
|
|
37
|
+
"./commands/install/reporter.ts": () => import("./reporter-UYVR2WMB.js"),
|
|
38
|
+
"./commands/list.ts": () => import("./list-NHCC2RNB.js"),
|
|
39
|
+
"./commands/login.ts": () => import("./login-XNZXCGFD.js"),
|
|
40
|
+
"./commands/logout.ts": () => import("./logout-YCM7O36Q.js"),
|
|
41
|
+
"./commands/outdated.ts": () => import("./outdated-4LA7N63W.js"),
|
|
42
|
+
"./commands/pack.ts": () => import("./pack-RC4CZSWF.js"),
|
|
43
|
+
"./commands/ping.ts": () => import("./ping-RLVAZGDL.js"),
|
|
44
|
+
"./commands/pkg.ts": () => import("./pkg-FED5C6TP.js"),
|
|
45
|
+
"./commands/profile.ts": () => import("./profile-DJZNLQPG.js"),
|
|
46
|
+
"./commands/publish.ts": () => import("./publish-54AMVMTQ.js"),
|
|
47
|
+
"./commands/query.ts": () => import("./query-ZQLMSJ7O.js"),
|
|
48
|
+
"./commands/registry.ts": () => import("./registry-6HKQYSZX.js"),
|
|
49
|
+
"./commands/repo.ts": () => import("./repo-ITA4BLZ4.js"),
|
|
50
|
+
"./commands/run-exec.ts": () => import("./run-exec-UGCC53DV.js"),
|
|
51
|
+
"./commands/run.ts": () => import("./run-TP2HTJRN.js"),
|
|
52
|
+
"./commands/setup.ts": () => import("./setup-XPAM5U3Z.js"),
|
|
53
|
+
"./commands/skills.ts": () => import("./skills-LR6GXW3X.js"),
|
|
54
|
+
"./commands/token.ts": () => import("./token-OF63PFTQ.js"),
|
|
55
|
+
"./commands/uninstall.ts": () => import("./uninstall-B54FQ5KQ.js"),
|
|
56
|
+
"./commands/unpublish.ts": () => import("./unpublish-CSHIGMDQ.js"),
|
|
57
|
+
"./commands/update.ts": () => import("./update-HS4VJ5ZG.js"),
|
|
58
|
+
"./commands/version.ts": () => import("./version-L7S3DHUS.js"),
|
|
59
|
+
"./commands/view.ts": () => import("./view-NWKKWFVA.js"),
|
|
60
|
+
"./commands/whoami.ts": () => import("./whoami-65K35VGW.js")
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// ../../src/cli-sdk/src/load-command.ts
|
|
64
|
+
var loadCommand = async (command) => {
|
|
65
|
+
try {
|
|
66
|
+
return await globImport_commands_ts(`./commands/${command}.ts`);
|
|
67
|
+
} catch (e) {
|
|
68
|
+
throw error("Could not load command", {
|
|
69
|
+
found: command,
|
|
70
|
+
cause: e
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
loadCommand
|
|
77
|
+
};
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-SRWDPPLX.js";
|
|
16
16
|
import {
|
|
17
17
|
minimatch
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-C6ZVVEFV.js";
|
|
19
19
|
import {
|
|
20
20
|
Spec
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LUVDMEW4.js";
|
|
22
22
|
import {
|
|
23
23
|
parse,
|
|
24
24
|
stringify
|
|
@@ -13,24 +13,26 @@ import {
|
|
|
13
13
|
Qn
|
|
14
14
|
} from "./chunk-SRWDPPLX.js";
|
|
15
15
|
import {
|
|
16
|
-
Monorepo,
|
|
17
|
-
PackageJson,
|
|
18
16
|
clone,
|
|
19
17
|
pickManifest,
|
|
20
18
|
resolve,
|
|
21
19
|
revs
|
|
22
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IFEZ6BFV.js";
|
|
21
|
+
import {
|
|
22
|
+
Monorepo,
|
|
23
|
+
PackageJson
|
|
24
|
+
} from "./chunk-C6ZVVEFV.js";
|
|
23
25
|
import {
|
|
24
26
|
Spec
|
|
25
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LUVDMEW4.js";
|
|
26
28
|
import {
|
|
27
29
|
registryErrorMessage,
|
|
28
30
|
storeRoot,
|
|
29
31
|
tokenRefusalAdvice
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5KW6AOTT.js";
|
|
31
33
|
import {
|
|
32
34
|
logRequest
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-B6RIGNEO.js";
|
|
34
36
|
import {
|
|
35
37
|
XDG
|
|
36
38
|
} from "./chunk-XNLSTHDK.js";
|
|
@@ -39,7 +41,7 @@ import {
|
|
|
39
41
|
brotliTarballUrl,
|
|
40
42
|
integrityHex,
|
|
41
43
|
tarballFormat
|
|
42
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-6LZM3I4Q.js";
|
|
43
45
|
import {
|
|
44
46
|
error
|
|
45
47
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -336,7 +338,7 @@ var PackageInfoClient = class {
|
|
|
336
338
|
}
|
|
337
339
|
async getRegistryClient() {
|
|
338
340
|
if (this.#registryClient) return this.#registryClient;
|
|
339
|
-
this.#registryClientPromise ??= import("./src-
|
|
341
|
+
this.#registryClientPromise ??= import("./src-H6DFCAPH.js").then(({ RegistryClient }) => {
|
|
340
342
|
this.#registryClient = new RegistryClient(this.options);
|
|
341
343
|
return this.#registryClient;
|
|
342
344
|
});
|
|
@@ -375,7 +377,7 @@ var PackageInfoClient = class {
|
|
|
375
377
|
}
|
|
376
378
|
async getTarPool() {
|
|
377
379
|
if (this.#tarPool) return this.#tarPool;
|
|
378
|
-
this.#tarPoolPromise ??= import("./src-
|
|
380
|
+
this.#tarPoolPromise ??= import("./src-LHDC4NJO.js").then(
|
|
379
381
|
({ Pool }) => {
|
|
380
382
|
this.#tarPool = new Pool();
|
|
381
383
|
return this.#tarPool;
|
|
@@ -591,7 +593,7 @@ var PackageInfoClient = class {
|
|
|
591
593
|
}
|
|
592
594
|
case "remote": {
|
|
593
595
|
const rc = await this.getRegistryClient();
|
|
594
|
-
const { CacheEntry: Entry, cacheKey } = await import("./src-
|
|
596
|
+
const { CacheEntry: Entry, cacheKey } = await import("./src-H6DFCAPH.js");
|
|
595
597
|
const key = cacheKey("GET", new URL(r.resolved));
|
|
596
598
|
const unzipped = (entry) => {
|
|
597
599
|
try {
|
|
@@ -656,7 +658,7 @@ var PackageInfoClient = class {
|
|
|
656
658
|
r.integrity = found;
|
|
657
659
|
const buf = response.buffer();
|
|
658
660
|
try {
|
|
659
|
-
await (await this.getTarPool()).unpack(buf, target);
|
|
661
|
+
await (await this.getTarPool()).unpack(buf, target, tarballFormat(r.resolved));
|
|
660
662
|
} catch (er) {
|
|
661
663
|
throw this.#resolveError(
|
|
662
664
|
spec,
|
|
@@ -1199,7 +1201,7 @@ var PackageInfoClient = class {
|
|
|
1199
1201
|
const buf = response.buffer();
|
|
1200
1202
|
const integrity = storedIntegrity(response);
|
|
1201
1203
|
try {
|
|
1202
|
-
await (await this.getTarPool()).unpack(buf, dir);
|
|
1204
|
+
await (await this.getTarPool()).unpack(buf, dir, tarballFormat(remoteURL));
|
|
1203
1205
|
} catch (er) {
|
|
1204
1206
|
throw this.#resolveError(
|
|
1205
1207
|
s,
|