@socketsecurity/lib 5.11.0 → 5.11.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 +19 -0
- package/dist/agent.js +12 -1
- package/dist/archives.js +7 -6
- package/dist/argv/flags.d.ts +0 -7
- package/dist/argv/flags.js +12 -1
- package/dist/argv/parse.js +4 -3
- package/dist/bin.js +2 -1
- package/dist/constants/node.js +14 -3
- package/dist/cover/code.js +13 -2
- package/dist/cover/type.js +12 -1
- package/dist/dlx/binary.d.ts +13 -1
- package/dist/dlx/binary.js +28 -9
- package/dist/env/package-manager.js +12 -1
- package/dist/env/rewire.js +14 -3
- package/dist/fs.d.ts +0 -4
- package/dist/fs.js +13 -2
- package/dist/git.js +12 -1
- package/dist/github.js +13 -2
- package/dist/http-request.d.ts +29 -0
- package/dist/http-request.js +20 -2
- package/dist/ipc.js +16 -5
- package/dist/json/edit.js +14 -3
- package/dist/logger.js +5 -4
- package/dist/performance.js +13 -2
- package/dist/releases/github.js +4 -3
- package/dist/sea.js +12 -1
- package/dist/shadow.js +14 -3
- package/dist/spawn.js +5 -4
- package/dist/spinner.d.ts +0 -4
- package/dist/spinner.js +2 -1
- package/dist/stdio/clear.d.ts +0 -21
- package/dist/stdio/clear.js +20 -9
- package/dist/stdio/mask.js +27 -16
- package/dist/stdio/progress.js +2 -1
- package/dist/stdio/stderr.d.ts +0 -13
- package/dist/stdio/stderr.js +12 -1
- package/dist/stdio/stdout.js +17 -6
- package/dist/suppress-warnings.d.ts +0 -9
- package/dist/suppress-warnings.js +17 -6
- package/dist/temporary-executor.js +14 -3
- package/package.json +3 -3
package/dist/fs.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var fs_exports = {};
|
|
21
31
|
__export(fs_exports, {
|
|
@@ -50,6 +60,7 @@ __export(fs_exports, {
|
|
|
50
60
|
writeJsonSync: () => writeJsonSync
|
|
51
61
|
});
|
|
52
62
|
module.exports = __toCommonJS(fs_exports);
|
|
63
|
+
var import_node_process = __toESM(require("node:process"));
|
|
53
64
|
var import_process = require("./constants/process");
|
|
54
65
|
var import_arrays = require("./arrays");
|
|
55
66
|
var import_del = require("./external/del");
|
|
@@ -128,7 +139,7 @@ function stringify(json, EOL, finalEOL, replacer, spaces = 2) {
|
|
|
128
139
|
}
|
|
129
140
|
// @__NO_SIDE_EFFECTS__
|
|
130
141
|
async function findUp(name, options) {
|
|
131
|
-
const { cwd =
|
|
142
|
+
const { cwd = import_node_process.default.cwd(), signal = abortSignal } = {
|
|
132
143
|
__proto__: null,
|
|
133
144
|
...options
|
|
134
145
|
};
|
|
@@ -170,7 +181,7 @@ async function findUp(name, options) {
|
|
|
170
181
|
}
|
|
171
182
|
// @__NO_SIDE_EFFECTS__
|
|
172
183
|
function findUpSync(name, options) {
|
|
173
|
-
const { cwd =
|
|
184
|
+
const { cwd = import_node_process.default.cwd(), stopAt } = {
|
|
174
185
|
__proto__: null,
|
|
175
186
|
...options
|
|
176
187
|
};
|
package/dist/git.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var git_exports = {};
|
|
21
31
|
__export(git_exports, {
|
|
@@ -34,6 +44,7 @@ __export(git_exports, {
|
|
|
34
44
|
isUnstagedSync: () => isUnstagedSync
|
|
35
45
|
});
|
|
36
46
|
module.exports = __toCommonJS(git_exports);
|
|
47
|
+
var import_node_process = __toESM(require("node:process"));
|
|
37
48
|
var import_bin = require("./bin");
|
|
38
49
|
var import_debug = require("./debug");
|
|
39
50
|
var import_globs = require("./globs");
|
|
@@ -91,7 +102,7 @@ function getGitPath() {
|
|
|
91
102
|
return _gitPath;
|
|
92
103
|
}
|
|
93
104
|
function getCwd() {
|
|
94
|
-
return (/* @__PURE__ */ getFs()).realpathSync(
|
|
105
|
+
return (/* @__PURE__ */ getFs()).realpathSync(import_node_process.default.cwd());
|
|
95
106
|
}
|
|
96
107
|
function getGitDiffSpawnArgs(cwd) {
|
|
97
108
|
const resolvedCwd = cwd ? (/* @__PURE__ */ getFs()).realpathSync(cwd) : getCwd();
|
package/dist/github.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var github_exports = {};
|
|
21
31
|
__export(github_exports, {
|
|
@@ -30,6 +40,7 @@ __export(github_exports, {
|
|
|
30
40
|
resolveRefToSha: () => resolveRefToSha
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(github_exports);
|
|
43
|
+
var import_node_process = __toESM(require("node:process"));
|
|
33
44
|
var import_cache_with_ttl = require("./cache-with-ttl");
|
|
34
45
|
var import_github = require("./env/github");
|
|
35
46
|
var import_socket_cli = require("./env/socket-cli");
|
|
@@ -100,7 +111,7 @@ async function resolveRefToSha(owner, repo, ref, options) {
|
|
|
100
111
|
...options
|
|
101
112
|
};
|
|
102
113
|
const cacheKey = `${owner}/${repo}@${ref}`;
|
|
103
|
-
if (
|
|
114
|
+
if (import_node_process.default.env["DISABLE_GITHUB_CACHE"]) {
|
|
104
115
|
return await fetchRefSha(owner, repo, ref, opts);
|
|
105
116
|
}
|
|
106
117
|
const cache = getGithubCache();
|
|
@@ -189,7 +200,7 @@ async function fetchGhsaDetails(ghsaId, options) {
|
|
|
189
200
|
async function cacheFetchGhsa(ghsaId, options) {
|
|
190
201
|
const cache = getGithubCache();
|
|
191
202
|
const key = `ghsa:${ghsaId}`;
|
|
192
|
-
if (
|
|
203
|
+
if (import_node_process.default.env["DISABLE_GITHUB_CACHE"]) {
|
|
193
204
|
return await fetchGhsaDetails(ghsaId, options);
|
|
194
205
|
}
|
|
195
206
|
const cached = await cache.getOrFetch(key, async () => {
|
package/dist/http-request.d.ts
CHANGED
|
@@ -25,6 +25,24 @@ export interface HttpRequestOptions {
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
body?: Buffer | string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Custom CA certificates for TLS connections.
|
|
30
|
+
* When provided, these certificates are combined with the default trust
|
|
31
|
+
* store via an HTTPS agent. Useful when SSL_CERT_FILE is set but
|
|
32
|
+
* NODE_EXTRA_CA_CERTS was not available at process startup.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { rootCertificates } from 'node:tls'
|
|
37
|
+
* import { readFileSync } from 'node:fs'
|
|
38
|
+
*
|
|
39
|
+
* const extraCerts = readFileSync('/path/to/cert.pem', 'utf-8')
|
|
40
|
+
* await httpRequest('https://api.example.com', {
|
|
41
|
+
* ca: [...rootCertificates, extraCerts]
|
|
42
|
+
* })
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
ca?: string[] | undefined;
|
|
28
46
|
/**
|
|
29
47
|
* Whether to automatically follow HTTP redirects (3xx status codes).
|
|
30
48
|
*
|
|
@@ -257,6 +275,12 @@ export interface HttpResponse {
|
|
|
257
275
|
* Configuration options for file downloads.
|
|
258
276
|
*/
|
|
259
277
|
export interface HttpDownloadOptions {
|
|
278
|
+
/**
|
|
279
|
+
* Custom CA certificates for TLS connections.
|
|
280
|
+
* When provided, these certificates are used for the download request.
|
|
281
|
+
* See `HttpRequestOptions.ca` for details.
|
|
282
|
+
*/
|
|
283
|
+
ca?: string[] | undefined;
|
|
260
284
|
/**
|
|
261
285
|
* Whether to automatically follow HTTP redirects (3xx status codes).
|
|
262
286
|
* This is essential for downloading from services that use CDN redirects,
|
|
@@ -501,6 +525,11 @@ export declare function parseChecksums(text: string): Checksums;
|
|
|
501
525
|
* Options for fetching checksums from a URL.
|
|
502
526
|
*/
|
|
503
527
|
export interface FetchChecksumsOptions {
|
|
528
|
+
/**
|
|
529
|
+
* Custom CA certificates for TLS connections.
|
|
530
|
+
* See `HttpRequestOptions.ca` for details.
|
|
531
|
+
*/
|
|
532
|
+
ca?: string[] | undefined;
|
|
504
533
|
/**
|
|
505
534
|
* HTTP headers to send with the request.
|
|
506
535
|
*/
|
package/dist/http-request.js
CHANGED
|
@@ -82,11 +82,15 @@ function parseChecksums(text) {
|
|
|
82
82
|
return checksums;
|
|
83
83
|
}
|
|
84
84
|
async function fetchChecksums(url, options) {
|
|
85
|
-
const {
|
|
85
|
+
const {
|
|
86
|
+
ca,
|
|
87
|
+
headers = {},
|
|
88
|
+
timeout = 3e4
|
|
89
|
+
} = {
|
|
86
90
|
__proto__: null,
|
|
87
91
|
...options
|
|
88
92
|
};
|
|
89
|
-
const response = await httpRequest(url, { headers, timeout });
|
|
93
|
+
const response = await httpRequest(url, { ca, headers, timeout });
|
|
90
94
|
if (!response.ok) {
|
|
91
95
|
throw new Error(
|
|
92
96
|
`Failed to fetch checksums from ${url}: ${response.status} ${response.statusText}`
|
|
@@ -96,6 +100,7 @@ async function fetchChecksums(url, options) {
|
|
|
96
100
|
}
|
|
97
101
|
async function httpDownloadAttempt(url, destPath, options) {
|
|
98
102
|
const {
|
|
103
|
+
ca,
|
|
99
104
|
followRedirects = true,
|
|
100
105
|
headers = {},
|
|
101
106
|
maxRedirects = 5,
|
|
@@ -117,6 +122,9 @@ async function httpDownloadAttempt(url, destPath, options) {
|
|
|
117
122
|
port: parsedUrl.port,
|
|
118
123
|
timeout
|
|
119
124
|
};
|
|
125
|
+
if (ca && isHttps) {
|
|
126
|
+
requestOptions["ca"] = ca;
|
|
127
|
+
}
|
|
120
128
|
const { createWriteStream } = /* @__PURE__ */ getFs();
|
|
121
129
|
let fileStream;
|
|
122
130
|
let streamClosed = false;
|
|
@@ -141,6 +149,7 @@ async function httpDownloadAttempt(url, destPath, options) {
|
|
|
141
149
|
const redirectUrl = res.headers.location.startsWith("http") ? res.headers.location : new URL(res.headers.location, url).toString();
|
|
142
150
|
resolve(
|
|
143
151
|
httpDownloadAttempt(redirectUrl, destPath, {
|
|
152
|
+
ca,
|
|
144
153
|
followRedirects,
|
|
145
154
|
headers,
|
|
146
155
|
maxRedirects: maxRedirects - 1,
|
|
@@ -223,6 +232,7 @@ async function httpDownloadAttempt(url, destPath, options) {
|
|
|
223
232
|
async function httpRequestAttempt(url, options) {
|
|
224
233
|
const {
|
|
225
234
|
body,
|
|
235
|
+
ca,
|
|
226
236
|
followRedirects = true,
|
|
227
237
|
headers = {},
|
|
228
238
|
maxRedirects = 5,
|
|
@@ -244,6 +254,9 @@ async function httpRequestAttempt(url, options) {
|
|
|
244
254
|
port: parsedUrl.port,
|
|
245
255
|
timeout
|
|
246
256
|
};
|
|
257
|
+
if (ca && isHttps) {
|
|
258
|
+
requestOptions["ca"] = ca;
|
|
259
|
+
}
|
|
247
260
|
const request = httpModule.request(
|
|
248
261
|
requestOptions,
|
|
249
262
|
(res) => {
|
|
@@ -260,6 +273,7 @@ async function httpRequestAttempt(url, options) {
|
|
|
260
273
|
resolve(
|
|
261
274
|
httpRequestAttempt(redirectUrl, {
|
|
262
275
|
body,
|
|
276
|
+
ca,
|
|
263
277
|
followRedirects,
|
|
264
278
|
headers,
|
|
265
279
|
maxRedirects: maxRedirects - 1,
|
|
@@ -328,6 +342,7 @@ async function httpRequestAttempt(url, options) {
|
|
|
328
342
|
}
|
|
329
343
|
async function httpDownload(url, destPath, options) {
|
|
330
344
|
const {
|
|
345
|
+
ca,
|
|
331
346
|
followRedirects = true,
|
|
332
347
|
headers = {},
|
|
333
348
|
logger,
|
|
@@ -363,6 +378,7 @@ async function httpDownload(url, destPath, options) {
|
|
|
363
378
|
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
364
379
|
try {
|
|
365
380
|
const result = await httpDownloadAttempt(url, tempPath, {
|
|
381
|
+
ca,
|
|
366
382
|
followRedirects,
|
|
367
383
|
headers,
|
|
368
384
|
maxRedirects,
|
|
@@ -437,6 +453,7 @@ async function httpJson(url, options) {
|
|
|
437
453
|
async function httpRequest(url, options) {
|
|
438
454
|
const {
|
|
439
455
|
body,
|
|
456
|
+
ca,
|
|
440
457
|
followRedirects = true,
|
|
441
458
|
headers = {},
|
|
442
459
|
maxRedirects = 5,
|
|
@@ -450,6 +467,7 @@ async function httpRequest(url, options) {
|
|
|
450
467
|
try {
|
|
451
468
|
return await httpRequestAttempt(url, {
|
|
452
469
|
body,
|
|
470
|
+
ca,
|
|
453
471
|
followRedirects,
|
|
454
472
|
headers,
|
|
455
473
|
maxRedirects,
|
package/dist/ipc.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var ipc_exports = {};
|
|
21
31
|
__export(ipc_exports, {
|
|
@@ -33,6 +43,7 @@ __export(ipc_exports, {
|
|
|
33
43
|
writeIpcStub: () => writeIpcStub
|
|
34
44
|
});
|
|
35
45
|
module.exports = __toCommonJS(ipc_exports);
|
|
46
|
+
var import_node_process = __toESM(require("node:process"));
|
|
36
47
|
var import_fs = require("./fs");
|
|
37
48
|
var import_socket = require("./paths/socket");
|
|
38
49
|
var import_zod = require("./zod");
|
|
@@ -93,13 +104,13 @@ const IpcStubSchema = import_zod.z.object({
|
|
|
93
104
|
});
|
|
94
105
|
function createIpcChannelId(prefix = "socket") {
|
|
95
106
|
const crypto = /* @__PURE__ */ getCrypto();
|
|
96
|
-
return `${prefix}-${
|
|
107
|
+
return `${prefix}-${import_node_process.default.pid}-${crypto.randomBytes(8).toString("hex")}`;
|
|
97
108
|
}
|
|
98
109
|
function getIpcStubPath(appName) {
|
|
99
110
|
const tempDir = (0, import_socket.getOsTmpDir)();
|
|
100
111
|
const path = /* @__PURE__ */ getPath();
|
|
101
112
|
const stubDir = path.join(tempDir, ".socket-ipc", appName);
|
|
102
|
-
return path.join(stubDir, `stub-${
|
|
113
|
+
return path.join(stubDir, `stub-${import_node_process.default.pid}.json`);
|
|
103
114
|
}
|
|
104
115
|
async function ensureIpcDirectory(filePath) {
|
|
105
116
|
const fs = /* @__PURE__ */ getFs();
|
|
@@ -112,7 +123,7 @@ async function writeIpcStub(appName, data) {
|
|
|
112
123
|
await ensureIpcDirectory(stubPath);
|
|
113
124
|
const ipcData = {
|
|
114
125
|
data,
|
|
115
|
-
pid:
|
|
126
|
+
pid: import_node_process.default.pid,
|
|
116
127
|
timestamp: Date.now()
|
|
117
128
|
};
|
|
118
129
|
const validated = IpcStubSchema.parse(ipcData);
|
|
@@ -198,9 +209,9 @@ function onIpc(handler) {
|
|
|
198
209
|
handler(parsed);
|
|
199
210
|
}
|
|
200
211
|
};
|
|
201
|
-
|
|
212
|
+
import_node_process.default.on("message", listener);
|
|
202
213
|
return () => {
|
|
203
|
-
|
|
214
|
+
import_node_process.default.off("message", listener);
|
|
204
215
|
};
|
|
205
216
|
}
|
|
206
217
|
function waitForIpc(messageType, options = {}) {
|
package/dist/json/edit.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var edit_exports = {};
|
|
21
31
|
__export(edit_exports, {
|
|
@@ -23,6 +33,7 @@ __export(edit_exports, {
|
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(edit_exports);
|
|
25
35
|
var import_promises = require("node:timers/promises");
|
|
36
|
+
var import_node_process = __toESM(require("node:process"));
|
|
26
37
|
var import_format = require("./format");
|
|
27
38
|
const identSymbol = import_format.INDENT_SYMBOL;
|
|
28
39
|
const newlineSymbol = import_format.NEWLINE_SYMBOL;
|
|
@@ -41,7 +52,7 @@ async function retryWrite(filepath, content, retries = 3, baseDelay = 10) {
|
|
|
41
52
|
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
42
53
|
try {
|
|
43
54
|
await fsPromises.writeFile(filepath, content);
|
|
44
|
-
if (
|
|
55
|
+
if (import_node_process.default.platform === "win32") {
|
|
45
56
|
await (0, import_promises.setTimeout)(50);
|
|
46
57
|
let accessRetries = 0;
|
|
47
58
|
const maxAccessRetries = 5;
|
|
@@ -74,7 +85,7 @@ function parseJson(content) {
|
|
|
74
85
|
}
|
|
75
86
|
async function readFile(filepath) {
|
|
76
87
|
const { promises: fsPromises } = /* @__PURE__ */ getFs();
|
|
77
|
-
const maxRetries =
|
|
88
|
+
const maxRetries = import_node_process.default.platform === "win32" ? 5 : 1;
|
|
78
89
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
79
90
|
try {
|
|
80
91
|
return await fsPromises.readFile(filepath, "utf8");
|
|
@@ -84,7 +95,7 @@ async function readFile(filepath) {
|
|
|
84
95
|
if (!isEnoent || isLastAttempt) {
|
|
85
96
|
throw err;
|
|
86
97
|
}
|
|
87
|
-
const delay =
|
|
98
|
+
const delay = import_node_process.default.platform === "win32" ? 50 * (attempt + 1) : 20;
|
|
88
99
|
await (0, import_promises.setTimeout)(delay);
|
|
89
100
|
}
|
|
90
101
|
}
|
package/dist/logger.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(logger_exports, {
|
|
|
36
36
|
lastWasBlankSymbol: () => lastWasBlankSymbol
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(logger_exports);
|
|
39
|
+
var import_node_process = __toESM(require("node:process"));
|
|
39
40
|
var import_is_unicode_supported = __toESM(require("./external/@socketregistry/is-unicode-supported"));
|
|
40
41
|
var import_yoctocolors_cjs = __toESM(require("./external/yoctocolors-cjs"));
|
|
41
42
|
var import_strings = require("./strings");
|
|
@@ -282,8 +283,8 @@ class Logger {
|
|
|
282
283
|
con = /* @__PURE__ */ constructConsole(...ctorArgs);
|
|
283
284
|
} else {
|
|
284
285
|
con = /* @__PURE__ */ constructConsole({
|
|
285
|
-
stdout:
|
|
286
|
-
stderr:
|
|
286
|
+
stdout: import_node_process.default.stdout,
|
|
287
|
+
stderr: import_node_process.default.stderr
|
|
287
288
|
});
|
|
288
289
|
for (const { 0: key, 1: method } of boundConsoleEntries) {
|
|
289
290
|
con[key] = method;
|
|
@@ -1442,8 +1443,8 @@ function ensurePrototypeInitialized() {
|
|
|
1442
1443
|
con = /* @__PURE__ */ constructConsole(...ctorArgs);
|
|
1443
1444
|
} else {
|
|
1444
1445
|
con = /* @__PURE__ */ constructConsole({
|
|
1445
|
-
stdout:
|
|
1446
|
-
stderr:
|
|
1446
|
+
stdout: import_node_process.default.stdout,
|
|
1447
|
+
stderr: import_node_process.default.stderr
|
|
1447
1448
|
});
|
|
1448
1449
|
for (const { 0: k, 1: method } of boundConsoleEntries) {
|
|
1449
1450
|
con[k] = method;
|
package/dist/performance.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var performance_exports = {};
|
|
21
31
|
__export(performance_exports, {
|
|
@@ -31,10 +41,11 @@ __export(performance_exports, {
|
|
|
31
41
|
trackMemory: () => trackMemory
|
|
32
42
|
});
|
|
33
43
|
module.exports = __toCommonJS(performance_exports);
|
|
44
|
+
var import_node_process = __toESM(require("node:process"));
|
|
34
45
|
var import_debug = require("./debug");
|
|
35
46
|
const performanceMetrics = [];
|
|
36
47
|
function isPerfEnabled() {
|
|
37
|
-
return
|
|
48
|
+
return import_node_process.default.env["DEBUG"]?.includes("perf") || false;
|
|
38
49
|
}
|
|
39
50
|
function perfTimer(operation, metadata) {
|
|
40
51
|
if (!isPerfEnabled()) {
|
|
@@ -155,7 +166,7 @@ function trackMemory(label) {
|
|
|
155
166
|
if (!isPerfEnabled()) {
|
|
156
167
|
return 0;
|
|
157
168
|
}
|
|
158
|
-
const usage =
|
|
169
|
+
const usage = import_node_process.default.memoryUsage();
|
|
159
170
|
const heapUsedMB = Math.round(usage.heapUsed / 1024 / 1024 * 100) / 100;
|
|
160
171
|
(0, import_debug.debugLog)(`[perf] [MEMORY] ${label}: ${heapUsedMB}MB heap used`);
|
|
161
172
|
const metric = {
|
package/dist/releases/github.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(github_exports, {
|
|
|
40
40
|
getReleaseAssetUrl: () => getReleaseAssetUrl
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(github_exports);
|
|
43
|
+
var import_node_process = __toESM(require("node:process"));
|
|
43
44
|
var import_picomatch = __toESM(require("../external/picomatch.js"));
|
|
44
45
|
var import_archives = require("../archives.js");
|
|
45
46
|
var import_fs = require("../fs.js");
|
|
@@ -92,7 +93,7 @@ async function downloadGitHubRelease(config) {
|
|
|
92
93
|
const {
|
|
93
94
|
assetName,
|
|
94
95
|
binaryName,
|
|
95
|
-
cwd =
|
|
96
|
+
cwd = import_node_process.default.cwd(),
|
|
96
97
|
downloadDir = "build/downloaded",
|
|
97
98
|
owner,
|
|
98
99
|
platformArch,
|
|
@@ -147,7 +148,7 @@ async function downloadGitHubRelease(config) {
|
|
|
147
148
|
const isWindows = binaryName.endsWith(".exe");
|
|
148
149
|
if (!isWindows) {
|
|
149
150
|
fs.chmodSync(binaryPath, 493);
|
|
150
|
-
if (removeMacOSQuarantine &&
|
|
151
|
+
if (removeMacOSQuarantine && import_node_process.default.platform === "darwin" && platformArch.startsWith("darwin")) {
|
|
151
152
|
try {
|
|
152
153
|
await (0, import_spawn.spawn)("xattr", ["-d", "com.apple.quarantine", binaryPath], {
|
|
153
154
|
stdio: "ignore"
|
|
@@ -185,7 +186,7 @@ async function downloadReleaseAsset(tag, assetPattern, outputPath, repoConfig, o
|
|
|
185
186
|
});
|
|
186
187
|
}
|
|
187
188
|
function getAuthHeaders() {
|
|
188
|
-
const token =
|
|
189
|
+
const token = import_node_process.default.env["GH_TOKEN"] || import_node_process.default.env["GITHUB_TOKEN"];
|
|
189
190
|
const headers = {
|
|
190
191
|
Accept: "application/vnd.github+json",
|
|
191
192
|
"X-GitHub-Api-Version": "2022-11-28"
|
package/dist/sea.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var sea_exports = {};
|
|
21
31
|
__export(sea_exports, {
|
|
@@ -23,10 +33,11 @@ __export(sea_exports, {
|
|
|
23
33
|
isSeaBinary: () => isSeaBinary
|
|
24
34
|
});
|
|
25
35
|
module.exports = __toCommonJS(sea_exports);
|
|
36
|
+
var import_node_process = __toESM(require("node:process"));
|
|
26
37
|
var import_normalize = require("./paths/normalize");
|
|
27
38
|
let _isSea;
|
|
28
39
|
function getSeaBinaryPath() {
|
|
29
|
-
return isSeaBinary() &&
|
|
40
|
+
return isSeaBinary() && import_node_process.default.argv[0] ? (0, import_normalize.normalizePath)(import_node_process.default.argv[0]) : void 0;
|
|
30
41
|
}
|
|
31
42
|
function isSeaBinary() {
|
|
32
43
|
if (_isSea === void 0) {
|
package/dist/shadow.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,27 +18,36 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var shadow_exports = {};
|
|
21
31
|
__export(shadow_exports, {
|
|
22
32
|
shouldSkipShadow: () => shouldSkipShadow
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(shadow_exports);
|
|
35
|
+
var import_node_process = __toESM(require("node:process"));
|
|
25
36
|
var import_normalize = require("./paths/normalize");
|
|
26
37
|
function shouldSkipShadow(binPath, options) {
|
|
27
|
-
const { cwd =
|
|
38
|
+
const { cwd = import_node_process.default.cwd(), win32 = false } = {
|
|
28
39
|
__proto__: null,
|
|
29
40
|
...options
|
|
30
41
|
};
|
|
31
42
|
if (win32 && binPath) {
|
|
32
43
|
return true;
|
|
33
44
|
}
|
|
34
|
-
const userAgent =
|
|
45
|
+
const userAgent = import_node_process.default.env["npm_config_user_agent"];
|
|
35
46
|
if (userAgent?.includes("exec") || userAgent?.includes("npx") || userAgent?.includes("dlx")) {
|
|
36
47
|
return true;
|
|
37
48
|
}
|
|
38
49
|
const normalizedCwd = (0, import_normalize.normalizePath)(cwd);
|
|
39
|
-
const npmCache =
|
|
50
|
+
const npmCache = import_node_process.default.env["npm_config_cache"];
|
|
40
51
|
if (npmCache && normalizedCwd.includes((0, import_normalize.normalizePath)(npmCache))) {
|
|
41
52
|
return true;
|
|
42
53
|
}
|
package/dist/spawn.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(spawn_exports, {
|
|
|
36
36
|
spawnSync: () => spawnSync
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(spawn_exports);
|
|
39
|
+
var import_node_process = __toESM(require("node:process"));
|
|
39
40
|
var import_process = require("./constants/process");
|
|
40
41
|
var import_errors = require("./errors");
|
|
41
42
|
var import_promise_spawn = __toESM(require("./external/@npmcli/promise-spawn"));
|
|
@@ -204,7 +205,7 @@ function spawn(cmd, args, options, extra) {
|
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
const WIN32 =
|
|
208
|
+
const WIN32 = import_node_process.default.platform === "win32";
|
|
208
209
|
if (WIN32 && shell && windowsScriptExtRegExp.test(actualCmd)) {
|
|
209
210
|
if (!(0, import_normalize.isPath)(actualCmd)) {
|
|
210
211
|
actualCmd = (/* @__PURE__ */ getPath()).basename(actualCmd, (/* @__PURE__ */ getPath()).extname(actualCmd));
|
|
@@ -218,9 +219,9 @@ function spawn(cmd, args, options, extra) {
|
|
|
218
219
|
}
|
|
219
220
|
const envToUse = env ? {
|
|
220
221
|
__proto__: null,
|
|
221
|
-
...
|
|
222
|
+
...import_node_process.default.env,
|
|
222
223
|
...env
|
|
223
|
-
} :
|
|
224
|
+
} : import_node_process.default.env;
|
|
224
225
|
const promiseSpawnOpts = {
|
|
225
226
|
__proto__: null,
|
|
226
227
|
cwd: typeof spawnOptions.cwd === "string" ? spawnOptions.cwd : void 0,
|
|
@@ -290,7 +291,7 @@ function spawnSync(cmd, args, options) {
|
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
293
|
const shell = (0, import_objects.getOwn)(options, "shell");
|
|
293
|
-
const WIN32 =
|
|
294
|
+
const WIN32 = import_node_process.default.platform === "win32";
|
|
294
295
|
if (WIN32 && shell && windowsScriptExtRegExp.test(actualCmd)) {
|
|
295
296
|
if (!(0, import_normalize.isPath)(actualCmd)) {
|
|
296
297
|
actualCmd = (/* @__PURE__ */ getPath()).basename(actualCmd, (/* @__PURE__ */ getPath()).extname(actualCmd));
|
package/dist/spinner.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview CLI spinner utilities for long-running operations.
|
|
3
|
-
* Provides animated progress indicators with CI environment detection.
|
|
4
|
-
*/
|
|
5
1
|
import type { Writable } from 'stream';
|
|
6
2
|
import type { ColorInherit, ColorRgb, ColorValue } from './colors';
|
|
7
3
|
import type { ShimmerColorGradient, ShimmerConfig, ShimmerDirection, ShimmerState } from './effects/text-shimmer';
|