@socketsecurity/lib 6.0.0 → 6.0.2
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/CHANGELOG.md +91 -0
- package/README.md +26 -17
- package/dist/ai/discover.js +2 -2
- package/dist/ai/spawn.js +3 -3
- package/dist/ai/worktree.js +3 -3
- package/dist/argv/parse-args-string.d.ts +30 -0
- package/dist/argv/parse-args-string.js +42 -0
- package/dist/bin/check-primordials.js +15 -10
- package/dist/bin/check.js +2 -2
- package/dist/bin/exec.d.ts +1 -1
- package/dist/bin/exec.js +2 -2
- package/dist/bin/socket-lib.js +2 -2
- package/dist/{ttl-cache/cache.js → cache/ttl/store.js} +15 -15
- package/dist/{ttl-cache → cache/ttl}/types.d.ts +1 -1
- package/dist/checks/primordials-defaults.d.ts +20 -0
- package/dist/checks/primordials-defaults.js +92 -0
- package/dist/colors/socket-palette.d.ts +69 -0
- package/dist/colors/socket-palette.js +91 -0
- package/dist/constants/socket.js +1 -1
- package/dist/cover/code.js +2 -2
- package/dist/cover/type.js +2 -2
- package/dist/debug/_internal.d.ts +1 -1
- package/dist/debug/_internal.js +2 -2
- package/dist/debug/output.js +5 -5
- package/dist/dlx/binary-types.d.ts +2 -2
- package/dist/dlx/binary.d.ts +2 -2
- package/dist/dlx/binary.js +3 -3
- package/dist/dlx/firewall.js +2 -2
- package/dist/dlx/manifest.js +2 -2
- package/dist/dlx/package.d.ts +2 -2
- package/dist/dlx/package.js +2 -2
- package/dist/dlx/types.d.ts +2 -2
- package/dist/eco/npm/npm/exec.d.ts +2 -2
- package/dist/eco/npm/npm/exec.js +2 -2
- package/dist/eco/npm/pnpm/exec.d.ts +1 -1
- package/dist/eco/npm/script.d.ts +1 -1
- package/dist/eco/npm/script.js +3 -3
- package/dist/eco/npm/yarnpkg/yarn/exec.d.ts +1 -1
- package/dist/{signal-exit → events/exit}/_internal.d.ts +1 -1
- package/dist/{signal-exit/register.js → events/exit/handler.js} +4 -4
- package/dist/{signal-exit → events/exit}/intercept.js +2 -2
- package/dist/{signal-exit → events/exit}/types.d.ts +1 -1
- package/dist/{warnings/event-target.d.ts → events/warning/handler.d.ts} +1 -1
- package/dist/{warnings/event-target.js → events/warning/handler.js} +4 -4
- package/dist/{warnings → events/warning}/suppress.d.ts +3 -3
- package/dist/{warnings → events/warning}/suppress.js +2 -2
- package/dist/external-tools/janus/asset-names.d.ts +7 -0
- package/dist/external-tools/janus/asset-names.js +5 -0
- package/dist/external-tools/janus/from-download.d.ts +1 -1
- package/dist/external-tools/janus/from-download.js +12 -4
- package/dist/fs/read-json-cache.d.ts +83 -0
- package/dist/fs/read-json-cache.js +156 -0
- package/dist/fs/read-json.d.ts +6 -1
- package/dist/fs/read-json.js +80 -8
- package/dist/fs/types.d.ts +14 -0
- package/dist/git/_internal.js +3 -3
- package/dist/github/refs-cache.d.ts +1 -1
- package/dist/github/refs-cache.js +2 -2
- package/dist/github/token.d.ts +1 -1
- package/dist/github/token.js +2 -2
- package/dist/globs/{glob.js → match.js} +3 -3
- package/dist/http-request/browser-fetch.d.ts +10 -0
- package/dist/http-request/browser-fetch.js +32 -0
- package/dist/http-request/browser.d.ts +190 -0
- package/dist/http-request/browser.js +224 -0
- package/dist/http-request/download-types.d.ts +2 -2
- package/dist/http-request/http-request.d.ts +12 -0
- package/dist/http-request/http-request.js +36 -0
- package/dist/http-request/node.d.ts +29 -0
- package/dist/http-request/{convenience.js → node.js} +9 -3
- package/dist/http-request/request-attempt.js +4 -0
- package/dist/http-request/request-types.d.ts +15 -0
- package/dist/http-request/request.js +5 -0
- package/dist/links/{link.d.ts → create.d.ts} +2 -2
- package/dist/links/{link.js → create.js} +3 -3
- package/dist/logger/_internal.d.ts +1 -1
- package/dist/logger/browser.d.ts +18 -0
- package/dist/logger/browser.js +58 -0
- package/dist/logger/console.js +3 -3
- package/dist/logger/default.d.ts +11 -0
- package/dist/logger/default.js +37 -0
- package/dist/logger/logger.d.ts +8 -403
- package/dist/logger/logger.js +3 -827
- package/dist/logger/node.d.ts +400 -0
- package/dist/logger/node.js +856 -0
- package/dist/logger/symbols-builder.d.ts +1 -1
- package/dist/logger/types.d.ts +1 -1
- package/dist/packages/isolation.js +3 -3
- package/dist/packages/provenance.d.ts +42 -0
- package/dist/packages/provenance.js +71 -0
- package/dist/packages/types.d.ts +2 -0
- package/dist/primordials/globals.d.ts +6 -3
- package/dist/primordials/globals.js +15 -9
- package/dist/primordials/map-set.d.ts +35 -0
- package/dist/primordials/map-set.js +43 -0
- package/dist/primordials/url.d.ts +1 -1
- package/dist/process/lock-manager.js +4 -4
- package/dist/{spawn → process/spawn}/_internal.js +3 -3
- package/dist/{spawn/spawn.js → process/spawn/child.js} +13 -13
- package/dist/{spawn → process/spawn}/errors.js +5 -5
- package/dist/{spawn → process/spawn}/stdio.js +1 -1
- package/dist/{spawn → process/spawn}/types.d.ts +3 -3
- package/dist/promises/types.d.ts +15 -2
- package/dist/releases/github-archives.js +2 -2
- package/dist/releases/github-downloads.js +4 -4
- package/dist/spinner/{registry.d.ts → default.d.ts} +1 -1
- package/dist/spinner/{registry.js → default.js} +3 -3
- package/dist/spinner/spinner.js +4 -4
- package/dist/spinner/with.d.ts +1 -1
- package/dist/stdio/divider.js +2 -2
- package/dist/stdio/footer.js +2 -2
- package/dist/stdio/header.js +2 -2
- package/dist/stdio/prompts.js +2 -2
- package/package.json +410 -132
- package/dist/http-request/convenience.d.ts +0 -104
- package/dist/promise-queue/types.d.ts +0 -10
- package/dist/ttl-cache/types.js +0 -18
- /package/dist/{ttl-cache/cache.d.ts → cache/ttl/store.d.ts} +0 -0
- /package/dist/{promise-queue → cache/ttl}/types.js +0 -0
- /package/dist/{signal-exit → events/exit}/_internal.js +0 -0
- /package/dist/{signal-exit/register.d.ts → events/exit/handler.d.ts} +0 -0
- /package/dist/{signal-exit → events/exit}/intercept.d.ts +0 -0
- /package/dist/{signal-exit → events/exit}/lifecycle.d.ts +0 -0
- /package/dist/{signal-exit → events/exit}/lifecycle.js +0 -0
- /package/dist/{signal-exit → events/exit}/signals.d.ts +0 -0
- /package/dist/{signal-exit → events/exit}/signals.js +0 -0
- /package/dist/{signal-exit → events/exit}/types.js +0 -0
- /package/dist/globs/{glob.d.ts → match.d.ts} +0 -0
- /package/dist/{spawn → process/spawn}/_internal.d.ts +0 -0
- /package/dist/{spawn/spawn.d.ts → process/spawn/child.d.ts} +0 -0
- /package/dist/{spawn → process/spawn}/errors.d.ts +0 -0
- /package/dist/{spawn → process/spawn}/stdio.d.ts +0 -0
- /package/dist/{spawn → process/spawn}/types.js +0 -0
- /package/dist/{promise-queue → promises}/queue.d.ts +0 -0
- /package/dist/{promise-queue → promises}/queue.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Free-function helpers for per-instance log-symbol construction + symbol
|
|
3
|
-
* stripping. Extracted from `logger/
|
|
3
|
+
* stripping. Extracted from `logger/node.ts` (the `Logger` class) so the
|
|
4
4
|
* class stays under the 1000-line hard cap and so other callers (alt loggers,
|
|
5
5
|
* format helpers) can reuse the same logic without instantiating a `Logger`.
|
|
6
6
|
*
|
package/dist/logger/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* interface returned by `Logger.createTask`. Pure types; no runtime side
|
|
5
5
|
* effects so this module stays cheap to import everywhere.
|
|
6
6
|
*/
|
|
7
|
-
import type { Logger } from './
|
|
7
|
+
import type { Logger } from './node';
|
|
8
8
|
/**
|
|
9
9
|
* Log symbols for terminal output with colored indicators.
|
|
10
10
|
*
|
|
@@ -40,7 +40,7 @@ var import_platform = require("../constants/platform");
|
|
|
40
40
|
var import_message = require("../errors/message");
|
|
41
41
|
var import_normalize = require("../paths/normalize");
|
|
42
42
|
var import_socket = require("../paths/socket");
|
|
43
|
-
var
|
|
43
|
+
var import_child = require("../process/spawn/child");
|
|
44
44
|
var import_operations = require("./operations");
|
|
45
45
|
var import_error = require("../primordials/error");
|
|
46
46
|
var import_json = require("../primordials/json");
|
|
@@ -123,7 +123,7 @@ async function isolatePackage(packageSpec, options) {
|
|
|
123
123
|
await install(packageTempDir);
|
|
124
124
|
} else {
|
|
125
125
|
const packageInstallSpec = (0, import_string.StringPrototypeStartsWith)(spec, "https://") ? spec : `${packageName}@${spec}`;
|
|
126
|
-
await (0,
|
|
126
|
+
await (0, import_child.spawn)("pnpm", ["add", packageInstallSpec], {
|
|
127
127
|
cwd: packageTempDir,
|
|
128
128
|
shell: import_platform.WIN32,
|
|
129
129
|
stdio: "pipe"
|
|
@@ -170,7 +170,7 @@ async function isolatePackage(packageSpec, options) {
|
|
|
170
170
|
if (install) {
|
|
171
171
|
await install(installedPath);
|
|
172
172
|
} else {
|
|
173
|
-
await (0,
|
|
173
|
+
await (0, import_child.spawn)("pnpm", ["install"], {
|
|
174
174
|
cwd: installedPath,
|
|
175
175
|
shell: import_platform.WIN32,
|
|
176
176
|
stdio: "pipe"
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
* @file Package provenance and attestation verification utilities.
|
|
3
3
|
*/
|
|
4
4
|
import type { ProvenanceOptions } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Comparator ordering two trust statuses by ascending trust level. Sorts an
|
|
7
|
+
* array of statuses lowest-trust-first; negate for highest-first.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compareTrust(a: TrustStatus, b: TrustStatus): -1 | 0 | 1;
|
|
10
|
+
/**
|
|
11
|
+
* Whether `next` sits at a lower trust level than `prev` — i.e. a release
|
|
12
|
+
* regressed its supply-chain posture. Drives the post-publish provenance
|
|
13
|
+
* reminder: a version that drops from trustedPublisher back to bare provenance
|
|
14
|
+
* is a red flag worth surfacing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function didTrustDecrease(prev: TrustStatus, next: TrustStatus): boolean;
|
|
5
17
|
/**
|
|
6
18
|
* Fetch package provenance information from npm registry.
|
|
7
19
|
*
|
|
@@ -30,7 +42,37 @@ export declare function getFetcher(): import("../external/make-fetch-happen").Ma
|
|
|
30
42
|
* ```
|
|
31
43
|
*/
|
|
32
44
|
export declare function getProvenanceDetails(attestationData: unknown): unknown;
|
|
45
|
+
/**
|
|
46
|
+
* Map a trust status to its 0..3 ladder level.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getTrustLevel(status: TrustStatus): TrustLevel;
|
|
49
|
+
/**
|
|
50
|
+
* Map a trust status to its human-readable level name.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getTrustLevelName(status: TrustStatus): TrustLevelName;
|
|
53
|
+
/**
|
|
54
|
+
* Extract provenance / trusted-publisher / staged-publish flags from a registry
|
|
55
|
+
* version document.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getTrustStatus(meta: unknown): TrustStatus;
|
|
33
58
|
/**
|
|
34
59
|
* Check if a value indicates a trusted publisher (GitHub or GitLab).
|
|
35
60
|
*/
|
|
36
61
|
export declare function isTrustedPublisher(value: unknown): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Trust signals derived from a registry version document.
|
|
64
|
+
*/
|
|
65
|
+
export interface TrustStatus {
|
|
66
|
+
provenance: boolean;
|
|
67
|
+
trustedPublisher: boolean;
|
|
68
|
+
stagedPublish: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Trust ladder, low → high. The index IS the level (0..3), so a single array
|
|
72
|
+
* maps both directions: `TRUST_LEVELS[level]` → name, and
|
|
73
|
+
* `TRUST_LEVELS.indexOf(name)` → level. One source of truth, no parallel Record
|
|
74
|
+
* to keep in sync.
|
|
75
|
+
*/
|
|
76
|
+
export declare const TRUST_LEVELS: readonly ['none', 'provenance', 'trustedPublisher', 'stagedPublish'];
|
|
77
|
+
export type TrustLevel = 0 | 1 | 2 | 3;
|
|
78
|
+
export type TrustLevelName = (typeof TRUST_LEVELS)[number];
|
|
@@ -30,11 +30,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
31
|
var provenance_exports = {};
|
|
32
32
|
__export(provenance_exports, {
|
|
33
|
+
TRUST_LEVELS: () => TRUST_LEVELS,
|
|
34
|
+
compareTrust: () => compareTrust,
|
|
35
|
+
didTrustDecrease: () => didTrustDecrease,
|
|
33
36
|
fetchPackageProvenance: () => fetchPackageProvenance,
|
|
34
37
|
findProvenance: () => findProvenance,
|
|
35
38
|
getAttestations: () => getAttestations,
|
|
36
39
|
getFetcher: () => getFetcher,
|
|
37
40
|
getProvenanceDetails: () => getProvenanceDetails,
|
|
41
|
+
getTrustLevel: () => getTrustLevel,
|
|
42
|
+
getTrustLevelName: () => getTrustLevelName,
|
|
43
|
+
getTrustStatus: () => getTrustStatus,
|
|
38
44
|
isTrustedPublisher: () => isTrustedPublisher
|
|
39
45
|
});
|
|
40
46
|
module.exports = __toCommonJS(provenance_exports);
|
|
@@ -43,13 +49,29 @@ var import_packages = require("../constants/packages");
|
|
|
43
49
|
var import_make_fetch_happen = __toESM(require("../external/make-fetch-happen"));
|
|
44
50
|
var import_signal = require("../abort/signal");
|
|
45
51
|
var import_parse = require("../url/parse");
|
|
52
|
+
var import_predicates = require("../objects/predicates");
|
|
46
53
|
var import_array = require("../primordials/array");
|
|
47
54
|
var import_buffer = require("../primordials/buffer");
|
|
48
55
|
var import_json = require("../primordials/json");
|
|
56
|
+
var import_object = require("../primordials/object");
|
|
49
57
|
var import_string = require("../primordials/string");
|
|
50
58
|
const SLSA_PROVENANCE_V0_2 = "https://slsa.dev/provenance/v0.2";
|
|
51
59
|
const SLSA_PROVENANCE_V1_0 = "https://slsa.dev/provenance/v1";
|
|
52
60
|
let _fetcher;
|
|
61
|
+
function compareTrust(a, b) {
|
|
62
|
+
const levelA = getTrustLevel(a);
|
|
63
|
+
const levelB = getTrustLevel(b);
|
|
64
|
+
if (levelA < levelB) {
|
|
65
|
+
return -1;
|
|
66
|
+
}
|
|
67
|
+
if (levelA > levelB) {
|
|
68
|
+
return 1;
|
|
69
|
+
}
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
function didTrustDecrease(prev, next) {
|
|
73
|
+
return getTrustLevel(next) < getTrustLevel(prev);
|
|
74
|
+
}
|
|
53
75
|
// @__NO_SIDE_EFFECTS__
|
|
54
76
|
async function fetchPackageProvenance(pkgName, pkgVersion, options) {
|
|
55
77
|
const { signal, timeout = 1e4 } = {
|
|
@@ -165,6 +187,43 @@ function getProvenanceDetails(attestationData) {
|
|
|
165
187
|
workflowRunId
|
|
166
188
|
};
|
|
167
189
|
}
|
|
190
|
+
function getTrustLevel(status) {
|
|
191
|
+
if (status.stagedPublish) {
|
|
192
|
+
return 3;
|
|
193
|
+
}
|
|
194
|
+
if (status.trustedPublisher && status.provenance) {
|
|
195
|
+
return 2;
|
|
196
|
+
}
|
|
197
|
+
if (status.provenance) {
|
|
198
|
+
return 1;
|
|
199
|
+
}
|
|
200
|
+
return 0;
|
|
201
|
+
}
|
|
202
|
+
function getTrustLevelName(status) {
|
|
203
|
+
return TRUST_LEVELS[getTrustLevel(status)];
|
|
204
|
+
}
|
|
205
|
+
function getTrustStatus(meta) {
|
|
206
|
+
const status = {
|
|
207
|
+
provenance: false,
|
|
208
|
+
trustedPublisher: false,
|
|
209
|
+
// Reserved: the npm registry does not yet expose a staged-publish flag, so
|
|
210
|
+
// this stays false until a registry signal exists to set it.
|
|
211
|
+
stagedPublish: false
|
|
212
|
+
};
|
|
213
|
+
if (!(0, import_predicates.isObject)(meta)) {
|
|
214
|
+
return status;
|
|
215
|
+
}
|
|
216
|
+
const npmUser = (0, import_object.ObjectHasOwn)(meta, "_npmUser") ? meta["_npmUser"] : void 0;
|
|
217
|
+
if ((0, import_predicates.isObject)(npmUser) && (0, import_object.ObjectHasOwn)(npmUser, "trustedPublisher") && npmUser["trustedPublisher"]) {
|
|
218
|
+
status.trustedPublisher = true;
|
|
219
|
+
}
|
|
220
|
+
const dist = (0, import_object.ObjectHasOwn)(meta, "dist") ? meta["dist"] : void 0;
|
|
221
|
+
const attestations = (0, import_predicates.isObject)(dist) && (0, import_object.ObjectHasOwn)(dist, "attestations") ? dist["attestations"] : void 0;
|
|
222
|
+
if ((0, import_predicates.isObject)(attestations) && (0, import_object.ObjectHasOwn)(attestations, "provenance") && attestations["provenance"]) {
|
|
223
|
+
status.provenance = true;
|
|
224
|
+
}
|
|
225
|
+
return status;
|
|
226
|
+
}
|
|
168
227
|
function isTrustedPublisher(value) {
|
|
169
228
|
if (typeof value !== "string" || !value) {
|
|
170
229
|
return false;
|
|
@@ -191,12 +250,24 @@ function isTrustedPublisher(value) {
|
|
|
191
250
|
}
|
|
192
251
|
return (0, import_string.StringPrototypeIncludes)(value, "github") || (0, import_string.StringPrototypeIncludes)(value, "gitlab");
|
|
193
252
|
}
|
|
253
|
+
const TRUST_LEVELS = [
|
|
254
|
+
"none",
|
|
255
|
+
"provenance",
|
|
256
|
+
"trustedPublisher",
|
|
257
|
+
"stagedPublish"
|
|
258
|
+
];
|
|
194
259
|
// Annotate the CommonJS export names for ESM import in node:
|
|
195
260
|
0 && (module.exports = {
|
|
261
|
+
TRUST_LEVELS,
|
|
262
|
+
compareTrust,
|
|
263
|
+
didTrustDecrease,
|
|
196
264
|
fetchPackageProvenance,
|
|
197
265
|
findProvenance,
|
|
198
266
|
getAttestations,
|
|
199
267
|
getFetcher,
|
|
200
268
|
getProvenanceDetails,
|
|
269
|
+
getTrustLevel,
|
|
270
|
+
getTrustLevelName,
|
|
271
|
+
getTrustStatus,
|
|
201
272
|
isTrustedPublisher
|
|
202
273
|
});
|
package/dist/packages/types.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export type PackageJson = {
|
|
|
73
73
|
private?: boolean | undefined;
|
|
74
74
|
publishConfig?: Record<string, unknown> | undefined;
|
|
75
75
|
files?: string[] | undefined;
|
|
76
|
+
keywords?: string[] | undefined;
|
|
77
|
+
sideEffects?: boolean | string[] | undefined;
|
|
76
78
|
engines?: Record<string, string> | undefined;
|
|
77
79
|
os?: string[] | undefined;
|
|
78
80
|
cpu?: string[] | undefined;
|
|
@@ -12,6 +12,9 @@ export declare const ProxyCtor: ProxyConstructor;
|
|
|
12
12
|
export declare const SharedArrayBufferCtor: SharedArrayBufferConstructor;
|
|
13
13
|
export declare const InfinityValue: number;
|
|
14
14
|
export declare const NaNValue: number;
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export declare const
|
|
15
|
+
declare const capturedGlobalThis: typeof globalThis;
|
|
16
|
+
export { capturedGlobalThis as globalThis };
|
|
17
|
+
export declare const atob: typeof globalThis.atob;
|
|
18
|
+
export declare const btoa: typeof globalThis.btoa;
|
|
19
|
+
export declare const decodeURIComponent: typeof globalThis.decodeURIComponent;
|
|
20
|
+
export declare const encodeURIComponent: typeof globalThis.encodeURIComponent;
|
|
@@ -26,9 +26,11 @@ __export(globals_exports, {
|
|
|
26
26
|
NaNValue: () => NaNValue,
|
|
27
27
|
ProxyCtor: () => ProxyCtor,
|
|
28
28
|
SharedArrayBufferCtor: () => SharedArrayBufferCtor,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
atob: () => atob,
|
|
30
|
+
btoa: () => btoa,
|
|
31
|
+
decodeURIComponent: () => decodeURIComponent,
|
|
32
|
+
encodeURIComponent: () => encodeURIComponent,
|
|
33
|
+
globalThis: () => capturedGlobalThis
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(globals_exports);
|
|
34
36
|
const BigIntCtor = BigInt;
|
|
@@ -37,9 +39,11 @@ const ProxyCtor = Proxy;
|
|
|
37
39
|
const SharedArrayBufferCtor = SharedArrayBuffer;
|
|
38
40
|
const InfinityValue = Infinity;
|
|
39
41
|
const NaNValue = NaN;
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
42
|
+
const capturedGlobalThis = globalThis;
|
|
43
|
+
const atob = globalThis.atob;
|
|
44
|
+
const btoa = globalThis.btoa;
|
|
45
|
+
const decodeURIComponent = globalThis.decodeURIComponent;
|
|
46
|
+
const encodeURIComponent = globalThis.encodeURIComponent;
|
|
43
47
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
48
|
0 && (module.exports = {
|
|
45
49
|
BigIntCtor,
|
|
@@ -48,7 +52,9 @@ const encodeComponent = globalThis.encodeURIComponent;
|
|
|
48
52
|
NaNValue,
|
|
49
53
|
ProxyCtor,
|
|
50
54
|
SharedArrayBufferCtor,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
atob,
|
|
56
|
+
btoa,
|
|
57
|
+
decodeURIComponent,
|
|
58
|
+
encodeURIComponent,
|
|
59
|
+
globalThis
|
|
54
60
|
});
|
|
@@ -4,6 +4,30 @@
|
|
|
4
4
|
* constructor — there's a separate `weakRefSafe` wrapper in `./uncurry` for
|
|
5
5
|
* the throws-on-non-Object case.
|
|
6
6
|
*/
|
|
7
|
+
declare global {
|
|
8
|
+
interface Map<K, V> {
|
|
9
|
+
getOrInsert(key: K, value: V): V;
|
|
10
|
+
getOrInsertComputed(key: K, callbackfn: (key: K) => V): V;
|
|
11
|
+
}
|
|
12
|
+
interface WeakMap<K extends WeakKey, V> {
|
|
13
|
+
getOrInsert(key: K, value: V): V;
|
|
14
|
+
getOrInsertComputed(key: K, callbackfn: (key: K) => V): V;
|
|
15
|
+
}
|
|
16
|
+
interface ReadonlySetLike<T> {
|
|
17
|
+
has(value: T): boolean;
|
|
18
|
+
keys(): IterableIterator<T>;
|
|
19
|
+
readonly size: number;
|
|
20
|
+
}
|
|
21
|
+
interface Set<T> {
|
|
22
|
+
difference<U>(other: ReadonlySetLike<U>): Set<T>;
|
|
23
|
+
intersection<U>(other: ReadonlySetLike<U>): Set<T & U>;
|
|
24
|
+
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
|
|
25
|
+
isSubsetOf(other: ReadonlySetLike<unknown>): boolean;
|
|
26
|
+
isSupersetOf(other: ReadonlySetLike<unknown>): boolean;
|
|
27
|
+
symmetricDifference<U>(other: ReadonlySetLike<U>): Set<T | U>;
|
|
28
|
+
union<U>(other: ReadonlySetLike<U>): Set<T | U>;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
7
31
|
export declare const MapCtor: MapConstructor;
|
|
8
32
|
export declare const SetCtor: SetConstructor;
|
|
9
33
|
export declare const WeakMapCtor: WeakMapConstructor;
|
|
@@ -14,6 +38,8 @@ export declare const MapPrototypeDelete: (self: unknown, key: any) => boolean;
|
|
|
14
38
|
export declare const MapPrototypeEntries: (self: unknown) => MapIterator<[any, any]>;
|
|
15
39
|
export declare const MapPrototypeForEach: (self: unknown, callbackfn: (value: any, key: any, map: Map<any, any>) => void, thisArg?: any) => void;
|
|
16
40
|
export declare const MapPrototypeGet: (self: unknown, key: any) => any;
|
|
41
|
+
export declare const MapPrototypeGetOrInsert: (self: unknown, key: any, value: any) => any;
|
|
42
|
+
export declare const MapPrototypeGetOrInsertComputed: (self: unknown, key: any, callbackfn: (key: any) => any) => any;
|
|
17
43
|
export declare const MapPrototypeHas: (self: unknown, key: any) => boolean;
|
|
18
44
|
export declare const MapPrototypeKeys: (self: unknown) => MapIterator<any>;
|
|
19
45
|
export declare const MapPrototypeSet: (self: unknown, key: any, value: any) => Map<any, any>;
|
|
@@ -21,13 +47,22 @@ export declare const MapPrototypeValues: (self: unknown) => MapIterator<any>;
|
|
|
21
47
|
export declare const SetPrototypeAdd: (self: unknown, value: any) => Set<any>;
|
|
22
48
|
export declare const SetPrototypeClear: (self: unknown) => void;
|
|
23
49
|
export declare const SetPrototypeDelete: (self: unknown, value: any) => boolean;
|
|
50
|
+
export declare const SetPrototypeDifference: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
|
|
24
51
|
export declare const SetPrototypeEntries: (self: unknown) => SetIterator<[any, any]>;
|
|
25
52
|
export declare const SetPrototypeForEach: (self: unknown, callbackfn: (value: any, value2: any, set: Set<any>) => void, thisArg?: any) => void;
|
|
26
53
|
export declare const SetPrototypeHas: (self: unknown, value: any) => boolean;
|
|
54
|
+
export declare const SetPrototypeIntersection: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
|
|
55
|
+
export declare const SetPrototypeIsDisjointFrom: (self: unknown, other: ReadonlySetLike<unknown>) => boolean;
|
|
56
|
+
export declare const SetPrototypeIsSubsetOf: (self: unknown, other: ReadonlySetLike<unknown>) => boolean;
|
|
57
|
+
export declare const SetPrototypeIsSupersetOf: (self: unknown, other: ReadonlySetLike<unknown>) => boolean;
|
|
27
58
|
export declare const SetPrototypeKeys: (self: unknown) => SetIterator<any>;
|
|
59
|
+
export declare const SetPrototypeSymmetricDifference: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
|
|
60
|
+
export declare const SetPrototypeUnion: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
|
|
28
61
|
export declare const SetPrototypeValues: (self: unknown) => SetIterator<any>;
|
|
29
62
|
export declare const WeakMapPrototypeDelete: (self: unknown, key: WeakKey) => boolean;
|
|
30
63
|
export declare const WeakMapPrototypeGet: (self: unknown, key: WeakKey) => any;
|
|
64
|
+
export declare const WeakMapPrototypeGetOrInsert: (self: unknown, key: WeakKey, value: any) => any;
|
|
65
|
+
export declare const WeakMapPrototypeGetOrInsertComputed: (self: unknown, key: WeakKey, callbackfn: (key: WeakKey) => any) => any;
|
|
31
66
|
export declare const WeakMapPrototypeHas: (self: unknown, key: WeakKey) => boolean;
|
|
32
67
|
export declare const WeakMapPrototypeSet: (self: unknown, key: WeakKey, value: any) => WeakMap<WeakKey, any>;
|
|
33
68
|
export declare const WeakSetPrototypeAdd: (self: unknown, value: WeakKey) => WeakSet<WeakKey>;
|
|
@@ -26,6 +26,8 @@ __export(map_set_exports, {
|
|
|
26
26
|
MapPrototypeEntries: () => MapPrototypeEntries,
|
|
27
27
|
MapPrototypeForEach: () => MapPrototypeForEach,
|
|
28
28
|
MapPrototypeGet: () => MapPrototypeGet,
|
|
29
|
+
MapPrototypeGetOrInsert: () => MapPrototypeGetOrInsert,
|
|
30
|
+
MapPrototypeGetOrInsertComputed: () => MapPrototypeGetOrInsertComputed,
|
|
29
31
|
MapPrototypeHas: () => MapPrototypeHas,
|
|
30
32
|
MapPrototypeKeys: () => MapPrototypeKeys,
|
|
31
33
|
MapPrototypeSet: () => MapPrototypeSet,
|
|
@@ -34,14 +36,23 @@ __export(map_set_exports, {
|
|
|
34
36
|
SetPrototypeAdd: () => SetPrototypeAdd,
|
|
35
37
|
SetPrototypeClear: () => SetPrototypeClear,
|
|
36
38
|
SetPrototypeDelete: () => SetPrototypeDelete,
|
|
39
|
+
SetPrototypeDifference: () => SetPrototypeDifference,
|
|
37
40
|
SetPrototypeEntries: () => SetPrototypeEntries,
|
|
38
41
|
SetPrototypeForEach: () => SetPrototypeForEach,
|
|
39
42
|
SetPrototypeHas: () => SetPrototypeHas,
|
|
43
|
+
SetPrototypeIntersection: () => SetPrototypeIntersection,
|
|
44
|
+
SetPrototypeIsDisjointFrom: () => SetPrototypeIsDisjointFrom,
|
|
45
|
+
SetPrototypeIsSubsetOf: () => SetPrototypeIsSubsetOf,
|
|
46
|
+
SetPrototypeIsSupersetOf: () => SetPrototypeIsSupersetOf,
|
|
40
47
|
SetPrototypeKeys: () => SetPrototypeKeys,
|
|
48
|
+
SetPrototypeSymmetricDifference: () => SetPrototypeSymmetricDifference,
|
|
49
|
+
SetPrototypeUnion: () => SetPrototypeUnion,
|
|
41
50
|
SetPrototypeValues: () => SetPrototypeValues,
|
|
42
51
|
WeakMapCtor: () => WeakMapCtor,
|
|
43
52
|
WeakMapPrototypeDelete: () => WeakMapPrototypeDelete,
|
|
44
53
|
WeakMapPrototypeGet: () => WeakMapPrototypeGet,
|
|
54
|
+
WeakMapPrototypeGetOrInsert: () => WeakMapPrototypeGetOrInsert,
|
|
55
|
+
WeakMapPrototypeGetOrInsertComputed: () => WeakMapPrototypeGetOrInsertComputed,
|
|
45
56
|
WeakMapPrototypeHas: () => WeakMapPrototypeHas,
|
|
46
57
|
WeakMapPrototypeSet: () => WeakMapPrototypeSet,
|
|
47
58
|
WeakRefCtor: () => WeakRefCtor,
|
|
@@ -62,6 +73,10 @@ const MapPrototypeDelete = (0, import_uncurry.uncurryThis)(Map.prototype.delete)
|
|
|
62
73
|
const MapPrototypeEntries = (0, import_uncurry.uncurryThis)(Map.prototype.entries);
|
|
63
74
|
const MapPrototypeForEach = (0, import_uncurry.uncurryThis)(Map.prototype.forEach);
|
|
64
75
|
const MapPrototypeGet = (0, import_uncurry.uncurryThis)(Map.prototype.get);
|
|
76
|
+
const MapPrototypeGetOrInsert = (0, import_uncurry.uncurryThis)(Map.prototype.getOrInsert);
|
|
77
|
+
const MapPrototypeGetOrInsertComputed = (0, import_uncurry.uncurryThis)(
|
|
78
|
+
Map.prototype.getOrInsertComputed
|
|
79
|
+
);
|
|
65
80
|
const MapPrototypeHas = (0, import_uncurry.uncurryThis)(Map.prototype.has);
|
|
66
81
|
const MapPrototypeKeys = (0, import_uncurry.uncurryThis)(Map.prototype.keys);
|
|
67
82
|
const MapPrototypeSet = (0, import_uncurry.uncurryThis)(Map.prototype.set);
|
|
@@ -69,13 +84,30 @@ const MapPrototypeValues = (0, import_uncurry.uncurryThis)(Map.prototype.values)
|
|
|
69
84
|
const SetPrototypeAdd = (0, import_uncurry.uncurryThis)(Set.prototype.add);
|
|
70
85
|
const SetPrototypeClear = (0, import_uncurry.uncurryThis)(Set.prototype.clear);
|
|
71
86
|
const SetPrototypeDelete = (0, import_uncurry.uncurryThis)(Set.prototype.delete);
|
|
87
|
+
const SetPrototypeDifference = (0, import_uncurry.uncurryThis)(Set.prototype.difference);
|
|
72
88
|
const SetPrototypeEntries = (0, import_uncurry.uncurryThis)(Set.prototype.entries);
|
|
73
89
|
const SetPrototypeForEach = (0, import_uncurry.uncurryThis)(Set.prototype.forEach);
|
|
74
90
|
const SetPrototypeHas = (0, import_uncurry.uncurryThis)(Set.prototype.has);
|
|
91
|
+
const SetPrototypeIntersection = (0, import_uncurry.uncurryThis)(Set.prototype.intersection);
|
|
92
|
+
const SetPrototypeIsDisjointFrom = (0, import_uncurry.uncurryThis)(
|
|
93
|
+
Set.prototype.isDisjointFrom
|
|
94
|
+
);
|
|
95
|
+
const SetPrototypeIsSubsetOf = (0, import_uncurry.uncurryThis)(Set.prototype.isSubsetOf);
|
|
96
|
+
const SetPrototypeIsSupersetOf = (0, import_uncurry.uncurryThis)(Set.prototype.isSupersetOf);
|
|
75
97
|
const SetPrototypeKeys = (0, import_uncurry.uncurryThis)(Set.prototype.keys);
|
|
98
|
+
const SetPrototypeSymmetricDifference = (0, import_uncurry.uncurryThis)(
|
|
99
|
+
Set.prototype.symmetricDifference
|
|
100
|
+
);
|
|
101
|
+
const SetPrototypeUnion = (0, import_uncurry.uncurryThis)(Set.prototype.union);
|
|
76
102
|
const SetPrototypeValues = (0, import_uncurry.uncurryThis)(Set.prototype.values);
|
|
77
103
|
const WeakMapPrototypeDelete = (0, import_uncurry.uncurryThis)(WeakMap.prototype.delete);
|
|
78
104
|
const WeakMapPrototypeGet = (0, import_uncurry.uncurryThis)(WeakMap.prototype.get);
|
|
105
|
+
const WeakMapPrototypeGetOrInsert = (0, import_uncurry.uncurryThis)(
|
|
106
|
+
WeakMap.prototype.getOrInsert
|
|
107
|
+
);
|
|
108
|
+
const WeakMapPrototypeGetOrInsertComputed = (0, import_uncurry.uncurryThis)(
|
|
109
|
+
WeakMap.prototype.getOrInsertComputed
|
|
110
|
+
);
|
|
79
111
|
const WeakMapPrototypeHas = (0, import_uncurry.uncurryThis)(WeakMap.prototype.has);
|
|
80
112
|
const WeakMapPrototypeSet = (0, import_uncurry.uncurryThis)(WeakMap.prototype.set);
|
|
81
113
|
const WeakSetPrototypeAdd = (0, import_uncurry.uncurryThis)(WeakSet.prototype.add);
|
|
@@ -89,6 +121,8 @@ const WeakSetPrototypeHas = (0, import_uncurry.uncurryThis)(WeakSet.prototype.ha
|
|
|
89
121
|
MapPrototypeEntries,
|
|
90
122
|
MapPrototypeForEach,
|
|
91
123
|
MapPrototypeGet,
|
|
124
|
+
MapPrototypeGetOrInsert,
|
|
125
|
+
MapPrototypeGetOrInsertComputed,
|
|
92
126
|
MapPrototypeHas,
|
|
93
127
|
MapPrototypeKeys,
|
|
94
128
|
MapPrototypeSet,
|
|
@@ -97,14 +131,23 @@ const WeakSetPrototypeHas = (0, import_uncurry.uncurryThis)(WeakSet.prototype.ha
|
|
|
97
131
|
SetPrototypeAdd,
|
|
98
132
|
SetPrototypeClear,
|
|
99
133
|
SetPrototypeDelete,
|
|
134
|
+
SetPrototypeDifference,
|
|
100
135
|
SetPrototypeEntries,
|
|
101
136
|
SetPrototypeForEach,
|
|
102
137
|
SetPrototypeHas,
|
|
138
|
+
SetPrototypeIntersection,
|
|
139
|
+
SetPrototypeIsDisjointFrom,
|
|
140
|
+
SetPrototypeIsSubsetOf,
|
|
141
|
+
SetPrototypeIsSupersetOf,
|
|
103
142
|
SetPrototypeKeys,
|
|
143
|
+
SetPrototypeSymmetricDifference,
|
|
144
|
+
SetPrototypeUnion,
|
|
104
145
|
SetPrototypeValues,
|
|
105
146
|
WeakMapCtor,
|
|
106
147
|
WeakMapPrototypeDelete,
|
|
107
148
|
WeakMapPrototypeGet,
|
|
149
|
+
WeakMapPrototypeGetOrInsert,
|
|
150
|
+
WeakMapPrototypeGetOrInsertComputed,
|
|
108
151
|
WeakMapPrototypeHas,
|
|
109
152
|
WeakMapPrototypeSet,
|
|
110
153
|
WeakRefCtor,
|
|
@@ -6,7 +6,7 @@ export declare const URLCtor: typeof URL;
|
|
|
6
6
|
export declare const URLSearchParamsCtor: typeof URLSearchParams;
|
|
7
7
|
export declare const URLSearchParamsPrototypeAppend: (self: unknown, name: string, value: string) => void;
|
|
8
8
|
export declare const URLSearchParamsPrototypeDelete: (self: unknown, name: string, value?: string | undefined) => void;
|
|
9
|
-
export declare const URLSearchParamsPrototypeForEach:
|
|
9
|
+
export declare const URLSearchParamsPrototypeForEach: (self: unknown, callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
|
|
10
10
|
export declare const URLSearchParamsPrototypeGet: (self: unknown, name: string) => string | null;
|
|
11
11
|
export declare const URLSearchParamsPrototypeGetAll: (self: unknown, name: string) => string[];
|
|
12
12
|
export declare const URLSearchParamsPrototypeHas: (self: unknown, name: string, value?: string | undefined) => boolean;
|
|
@@ -25,15 +25,15 @@ __export(lock_manager_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(lock_manager_exports);
|
|
26
26
|
var import_message = require("../errors/message");
|
|
27
27
|
var import_safe = require("../fs/safe");
|
|
28
|
-
var
|
|
28
|
+
var import_default = require("../logger/default");
|
|
29
29
|
var import_date = require("../primordials/date");
|
|
30
30
|
var import_error = require("../primordials/error");
|
|
31
31
|
var import_map_set = require("../primordials/map-set");
|
|
32
32
|
var import_math = require("../primordials/math");
|
|
33
33
|
var import_retry = require("../promises/retry");
|
|
34
|
-
var
|
|
34
|
+
var import_handler = require("../events/exit/handler");
|
|
35
35
|
var import_internal = require("./_internal");
|
|
36
|
-
const logger = (0,
|
|
36
|
+
const logger = (0, import_default.getDefaultLogger)();
|
|
37
37
|
class ProcessLockManager {
|
|
38
38
|
activeLocks = new import_map_set.SetCtor();
|
|
39
39
|
touchTimers = new import_map_set.MapCtor();
|
|
@@ -46,7 +46,7 @@ class ProcessLockManager {
|
|
|
46
46
|
if (this.exitHandlerRegistered) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
(0,
|
|
49
|
+
(0, import_handler.onExit)(() => {
|
|
50
50
|
for (const timer of this.touchTimers.values()) {
|
|
51
51
|
clearInterval(timer);
|
|
52
52
|
}
|
|
@@ -27,8 +27,8 @@ __export(internal_exports, {
|
|
|
27
27
|
windowsScriptExtRegExp: () => windowsScriptExtRegExp
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(internal_exports);
|
|
30
|
-
var import_strip = require("
|
|
31
|
-
var import_map_set = require("
|
|
30
|
+
var import_strip = require("../../ansi/strip");
|
|
31
|
+
var import_map_set = require("../../primordials/map-set");
|
|
32
32
|
const stackCache = new import_map_set.WeakMapCtor();
|
|
33
33
|
const spawnBinPathCache = new import_map_set.MapCtor();
|
|
34
34
|
const windowsScriptExtRegExp = /\.(?:cmd|bat|ps1)$/i;
|
|
@@ -36,7 +36,7 @@ let _npmCliPromiseSpawn;
|
|
|
36
36
|
// @__NO_SIDE_EFFECTS__
|
|
37
37
|
function getNpmCliPromiseSpawn() {
|
|
38
38
|
if (_npmCliPromiseSpawn === void 0) {
|
|
39
|
-
_npmCliPromiseSpawn = require("
|
|
39
|
+
_npmCliPromiseSpawn = require("../../external/@npmcli/promise-spawn");
|
|
40
40
|
}
|
|
41
41
|
return _npmCliPromiseSpawn;
|
|
42
42
|
}
|
|
@@ -28,27 +28,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var child_exports = {};
|
|
32
|
+
__export(child_exports, {
|
|
33
33
|
spawn: () => spawn,
|
|
34
34
|
spawnSync: () => spawnSync
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(child_exports);
|
|
37
37
|
var import_node_process = __toESM(require("node:process"));
|
|
38
|
-
var import_which = require("
|
|
39
|
-
var import_abort = require("
|
|
40
|
-
var import_child_process = require("
|
|
41
|
-
var import_fs = require("
|
|
42
|
-
var import_path = require("
|
|
43
|
-
var import_inspect = require("
|
|
44
|
-
var import_normalize = require("
|
|
45
|
-
var import_regexp = require("
|
|
46
|
-
var
|
|
38
|
+
var import_which = require("../../bin/which");
|
|
39
|
+
var import_abort = require("../../process/abort");
|
|
40
|
+
var import_child_process = require("../../node/child-process");
|
|
41
|
+
var import_fs = require("../../node/fs");
|
|
42
|
+
var import_path = require("../../node/path");
|
|
43
|
+
var import_inspect = require("../../objects/inspect");
|
|
44
|
+
var import_normalize = require("../../paths/normalize");
|
|
45
|
+
var import_regexp = require("../../primordials/regexp");
|
|
46
|
+
var import_default = require("../../spinner/default");
|
|
47
47
|
var import_internal = require("./_internal");
|
|
48
48
|
var import_errors = require("./errors");
|
|
49
49
|
var import_stdio = require("./stdio");
|
|
50
50
|
const abortSignal = (0, import_abort.getAbortSignal)();
|
|
51
|
-
const spinner = (0,
|
|
51
|
+
const spinner = (0, import_default.getDefaultSpinner)();
|
|
52
52
|
function spawn(cmd, args, options, extra) {
|
|
53
53
|
const {
|
|
54
54
|
spinner: optionsSpinner = spinner,
|
|
@@ -24,11 +24,11 @@ __export(errors_exports, {
|
|
|
24
24
|
isSpawnError: () => isSpawnError
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(errors_exports);
|
|
27
|
-
var import_stack = require("
|
|
28
|
-
var import_predicates = require("
|
|
29
|
-
var import_error = require("
|
|
30
|
-
var import_object = require("
|
|
31
|
-
var import_reflect = require("
|
|
27
|
+
var import_stack = require("../../errors/stack");
|
|
28
|
+
var import_predicates = require("../../objects/predicates");
|
|
29
|
+
var import_error = require("../../primordials/error");
|
|
30
|
+
var import_object = require("../../primordials/object");
|
|
31
|
+
var import_reflect = require("../../primordials/reflect");
|
|
32
32
|
var import_internal = require("./_internal");
|
|
33
33
|
// @__NO_SIDE_EFFECTS__
|
|
34
34
|
function enhanceSpawnError(error) {
|
|
@@ -23,7 +23,7 @@ __export(stdio_exports, {
|
|
|
23
23
|
isStdioType: () => isStdioType
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(stdio_exports);
|
|
26
|
-
var import_predicates = require("
|
|
26
|
+
var import_predicates = require("../../arrays/predicates");
|
|
27
27
|
// @__NO_SIDE_EFFECTS__
|
|
28
28
|
function isStdioType(stdio, type) {
|
|
29
29
|
if (arguments.length === 1) {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import type { SendHandle, Serializable, StdioOptions } from 'node:child_process';
|
|
20
20
|
import type { EventEmitter } from 'node:events';
|
|
21
|
-
import type { Remap } from '
|
|
22
|
-
import type { SpinnerInstance } from '
|
|
21
|
+
import type { Remap } from '../../objects/types';
|
|
22
|
+
import type { SpinnerInstance } from '../../spinner/types';
|
|
23
23
|
export type BufferEncoding = globalThis.BufferEncoding;
|
|
24
24
|
/**
|
|
25
25
|
* Options for spawning a child process with promise-based completion.
|
|
@@ -270,7 +270,7 @@ export interface WritableStreamType {
|
|
|
270
270
|
* @property {number | undefined} gid - Group identity (POSIX)
|
|
271
271
|
* @property {boolean | string | undefined} shell - Run command in shell.
|
|
272
272
|
* @property {AbortSignal | undefined} signal - Abort signal.
|
|
273
|
-
* @property {import('
|
|
273
|
+
* @property {import('../../spinner/types').SpinnerInstance | undefined} spinner -
|
|
274
274
|
* Spinner instance to pause during execution.
|
|
275
275
|
* @property {StdioType | undefined} stdio - Stdio configuration.
|
|
276
276
|
* @property {boolean | undefined} stdioString - Convert output to strings
|
package/dist/promises/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Public type surface for `promises/*` modules: `RetryOptions`,
|
|
3
|
-
* `IterationOptions`,
|
|
4
|
-
*
|
|
3
|
+
* `IterationOptions`, `PromiseWithResolvers`, and the `QueuedTask` storage
|
|
4
|
+
* shape used by the bounded-concurrency `PromiseQueue`. Pure types, no
|
|
5
|
+
* runtime side effects.
|
|
5
6
|
*/
|
|
6
7
|
/**
|
|
7
8
|
* Configuration options for retry behavior with exponential backoff.
|
|
@@ -188,3 +189,15 @@ export interface PromiseWithResolvers<T> {
|
|
|
188
189
|
*/
|
|
189
190
|
reject: (reason?: unknown) => void;
|
|
190
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Queued-task storage shape for the bounded-concurrency `PromiseQueue`.
|
|
194
|
+
*
|
|
195
|
+
* Each entry pairs a deferred task function with the resolver / rejecter for
|
|
196
|
+
* the promise returned to the caller, so the queue can run tasks under a
|
|
197
|
+
* concurrency cap and forward results when they settle.
|
|
198
|
+
*/
|
|
199
|
+
export type QueuedTask<T> = {
|
|
200
|
+
fn: () => Promise<T>;
|
|
201
|
+
resolve: (value: T) => void;
|
|
202
|
+
reject: (error: unknown) => void;
|
|
203
|
+
};
|
|
@@ -27,11 +27,11 @@ module.exports = __toCommonJS(github_archives_exports);
|
|
|
27
27
|
var import_detect = require("../archives/detect");
|
|
28
28
|
var import_extract = require("../archives/extract");
|
|
29
29
|
var import_safe = require("../fs/safe");
|
|
30
|
-
var
|
|
30
|
+
var import_default = require("../logger/default");
|
|
31
31
|
var import_error = require("../primordials/error");
|
|
32
32
|
var import_github_downloads = require("./github-downloads");
|
|
33
33
|
var import_path = require("../node/path");
|
|
34
|
-
const logger = (0,
|
|
34
|
+
const logger = (0, import_default.getDefaultLogger)();
|
|
35
35
|
async function downloadAndExtractArchive(tag, assetPattern, outputDir, repoConfig, options = { __proto__: null }) {
|
|
36
36
|
const { cleanup = true, format, quiet = false, strip } = options;
|
|
37
37
|
const path = (0, import_path.getNodePath)();
|