@socketsecurity/lib 5.11.1 → 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 +10 -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.js +16 -5
- 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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.11.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.2) - 2026-03-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **http-request**: Custom CA certificate support for TLS connections
|
|
13
|
+
- `httpRequest`, `httpJson`, `httpText` accept `ca` option for custom certificate authorities
|
|
14
|
+
- `httpDownload` accepts `ca` option, threaded through redirects and retries
|
|
15
|
+
- `fetchChecksums` accepts `ca` option, passed through to underlying request
|
|
16
|
+
- Enables SSL_CERT_FILE support when NODE_EXTRA_CA_CERTS is unavailable at process startup
|
|
17
|
+
|
|
8
18
|
## [5.11.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.1) - 2026-03-24
|
|
9
19
|
|
|
10
20
|
### Added
|
package/dist/agent.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 agent_exports = {};
|
|
21
31
|
__export(agent_exports, {
|
|
@@ -34,6 +44,7 @@ __export(agent_exports, {
|
|
|
34
44
|
isPnpmLoglevelFlag: () => isPnpmLoglevelFlag
|
|
35
45
|
});
|
|
36
46
|
module.exports = __toCommonJS(agent_exports);
|
|
47
|
+
var import_node_process = __toESM(require("node:process"));
|
|
37
48
|
var import_agents = require("./constants/agents");
|
|
38
49
|
var import_node = require("./constants/node");
|
|
39
50
|
var import_platform = require("./constants/platform");
|
|
@@ -230,7 +241,7 @@ function execScript(scriptName, args, options) {
|
|
|
230
241
|
return (0, import_spawn.spawn)(scriptName, resolvedArgs, spawnOptions);
|
|
231
242
|
}
|
|
232
243
|
const useNodeRun = !prepost && (0, import_node.supportsNodeRun)();
|
|
233
|
-
const cwd = (0, import_objects.getOwn)(spawnOptions, "cwd") ??
|
|
244
|
+
const cwd = (0, import_objects.getOwn)(spawnOptions, "cwd") ?? import_node_process.default.cwd();
|
|
234
245
|
const pnpmLockPath = (0, import_fs.findUpSync)(import_agents.PNPM_LOCK_YAML, { cwd });
|
|
235
246
|
if (pnpmLockPath) {
|
|
236
247
|
return execPnpm(["run", scriptName, ...resolvedArgs], spawnOptions);
|
package/dist/archives.js
CHANGED
|
@@ -39,6 +39,7 @@ module.exports = __toCommonJS(archives_exports);
|
|
|
39
39
|
var import_node_fs = require("node:fs");
|
|
40
40
|
var import_promises = require("node:stream/promises");
|
|
41
41
|
var import_node_zlib = require("node:zlib");
|
|
42
|
+
var import_node_process = __toESM(require("node:process"));
|
|
42
43
|
var import_adm_zip = __toESM(require("./external/adm-zip.js"));
|
|
43
44
|
var import_tar_fs = __toESM(require("./external/tar-fs.js"));
|
|
44
45
|
var import_fs = require("./fs.js");
|
|
@@ -96,7 +97,7 @@ async function extractTar(archivePath, outputDir, options = {}) {
|
|
|
96
97
|
}
|
|
97
98
|
if (header.type === "symlink" || header.type === "link") {
|
|
98
99
|
destroyScheduled = true;
|
|
99
|
-
|
|
100
|
+
import_node_process.default.nextTick(() => {
|
|
100
101
|
extractStream.destroy(
|
|
101
102
|
new Error(
|
|
102
103
|
`Symlink detected in archive: ${header.name}. Symlinks are not supported for security reasons.`
|
|
@@ -107,7 +108,7 @@ async function extractTar(archivePath, outputDir, options = {}) {
|
|
|
107
108
|
}
|
|
108
109
|
if (header.size && header.size > maxFileSize) {
|
|
109
110
|
destroyScheduled = true;
|
|
110
|
-
|
|
111
|
+
import_node_process.default.nextTick(() => {
|
|
111
112
|
extractStream.destroy(
|
|
112
113
|
new Error(
|
|
113
114
|
`File size exceeds limit: ${header.name} (${header.size} bytes > ${maxFileSize} bytes)`
|
|
@@ -120,7 +121,7 @@ async function extractTar(archivePath, outputDir, options = {}) {
|
|
|
120
121
|
totalExtractedSize += header.size;
|
|
121
122
|
if (totalExtractedSize > maxTotalSize) {
|
|
122
123
|
destroyScheduled = true;
|
|
123
|
-
|
|
124
|
+
import_node_process.default.nextTick(() => {
|
|
124
125
|
extractStream.destroy(
|
|
125
126
|
new Error(
|
|
126
127
|
`Total extracted size exceeds limit: ${totalExtractedSize} bytes > ${maxTotalSize} bytes`
|
|
@@ -161,7 +162,7 @@ async function extractTarGz(archivePath, outputDir, options = {}) {
|
|
|
161
162
|
}
|
|
162
163
|
if (header.type === "symlink" || header.type === "link") {
|
|
163
164
|
destroyScheduled = true;
|
|
164
|
-
|
|
165
|
+
import_node_process.default.nextTick(() => {
|
|
165
166
|
extractStream.destroy(
|
|
166
167
|
new Error(
|
|
167
168
|
`Symlink detected in archive: ${header.name}. Symlinks are not supported for security reasons.`
|
|
@@ -172,7 +173,7 @@ async function extractTarGz(archivePath, outputDir, options = {}) {
|
|
|
172
173
|
}
|
|
173
174
|
if (header.size && header.size > maxFileSize) {
|
|
174
175
|
destroyScheduled = true;
|
|
175
|
-
|
|
176
|
+
import_node_process.default.nextTick(() => {
|
|
176
177
|
extractStream.destroy(
|
|
177
178
|
new Error(
|
|
178
179
|
`File size exceeds limit: ${header.name} (${header.size} bytes > ${maxFileSize} bytes)`
|
|
@@ -185,7 +186,7 @@ async function extractTarGz(archivePath, outputDir, options = {}) {
|
|
|
185
186
|
totalExtractedSize += header.size;
|
|
186
187
|
if (totalExtractedSize > maxTotalSize) {
|
|
187
188
|
destroyScheduled = true;
|
|
188
|
-
|
|
189
|
+
import_node_process.default.nextTick(() => {
|
|
189
190
|
extractStream.destroy(
|
|
190
191
|
new Error(
|
|
191
192
|
`Total extracted size exceeds limit: ${totalExtractedSize} bytes > ${maxTotalSize} bytes`
|
package/dist/argv/flags.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common flag utilities for Socket CLI applications.
|
|
3
|
-
* Provides consistent flag checking across all Socket projects.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Flag values object from parsed arguments.
|
|
7
|
-
*/
|
|
8
1
|
export interface FlagValues {
|
|
9
2
|
[key: string]: unknown;
|
|
10
3
|
quiet?: boolean;
|
package/dist/argv/flags.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 flags_exports = {};
|
|
21
31
|
__export(flags_exports, {
|
|
@@ -37,7 +47,8 @@ __export(flags_exports, {
|
|
|
37
47
|
isWatch: () => isWatch
|
|
38
48
|
});
|
|
39
49
|
module.exports = __toCommonJS(flags_exports);
|
|
40
|
-
|
|
50
|
+
var import_node_process = __toESM(require("node:process"));
|
|
51
|
+
const processArg = [...import_node_process.default.argv];
|
|
41
52
|
function getLogLevel(input) {
|
|
42
53
|
if (isQuiet(input)) {
|
|
43
54
|
return "silent";
|
package/dist/argv/parse.js
CHANGED
|
@@ -36,12 +36,13 @@ __export(parse_exports, {
|
|
|
36
36
|
parseArgsWithDefaults: () => parseArgsWithDefaults
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(parse_exports);
|
|
39
|
+
var import_node_process = __toESM(require("node:process"));
|
|
39
40
|
var import_yargs_parser = __toESM(require("../external/yargs-parser"));
|
|
40
41
|
function parseArgs(config = {}) {
|
|
41
42
|
const {
|
|
42
43
|
allowNegative = false,
|
|
43
44
|
allowPositionals = true,
|
|
44
|
-
args =
|
|
45
|
+
args = import_node_process.default.argv.slice(2),
|
|
45
46
|
configuration,
|
|
46
47
|
options = {},
|
|
47
48
|
strict = true
|
|
@@ -142,7 +143,7 @@ const commonParseArgsConfig = {
|
|
|
142
143
|
strict: false
|
|
143
144
|
};
|
|
144
145
|
function getPositionalArgs(startIndex = 2) {
|
|
145
|
-
const args =
|
|
146
|
+
const args = import_node_process.default.argv.slice(startIndex);
|
|
146
147
|
const positionals = [];
|
|
147
148
|
let i = 0;
|
|
148
149
|
while (i < args.length) {
|
|
@@ -155,7 +156,7 @@ function getPositionalArgs(startIndex = 2) {
|
|
|
155
156
|
}
|
|
156
157
|
return positionals;
|
|
157
158
|
}
|
|
158
|
-
function hasFlag(flag, argv =
|
|
159
|
+
function hasFlag(flag, argv = import_node_process.default.argv) {
|
|
159
160
|
const flagVariants = [
|
|
160
161
|
`--${flag}`,
|
|
161
162
|
// Short flag.
|
package/dist/bin.js
CHANGED
|
@@ -42,6 +42,7 @@ __export(bin_exports, {
|
|
|
42
42
|
whichSync: () => whichSync
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(bin_exports);
|
|
45
|
+
var import_node_process = __toESM(require("node:process"));
|
|
45
46
|
var import_home = require("./env/home");
|
|
46
47
|
var import_windows = require("./env/windows");
|
|
47
48
|
var import_xdg = require("./env/xdg");
|
|
@@ -135,7 +136,7 @@ function findRealBin(binName, commonPaths = []) {
|
|
|
135
136
|
function findRealNpm() {
|
|
136
137
|
const fs = /* @__PURE__ */ getFs();
|
|
137
138
|
const path = /* @__PURE__ */ getPath();
|
|
138
|
-
const nodeDir = path.dirname(
|
|
139
|
+
const nodeDir = path.dirname(import_node_process.default.execPath);
|
|
139
140
|
const npmInNodeDir = path.join(nodeDir, "npm");
|
|
140
141
|
if (fs.existsSync(npmInNodeDir)) {
|
|
141
142
|
return npmInNodeDir;
|
package/dist/constants/node.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 node_exports = {};
|
|
21
31
|
__export(node_exports, {
|
|
@@ -41,8 +51,9 @@ __export(node_exports, {
|
|
|
41
51
|
supportsProcessSend: () => supportsProcessSend
|
|
42
52
|
});
|
|
43
53
|
module.exports = __toCommonJS(node_exports);
|
|
54
|
+
var import_node_process = __toESM(require("node:process"));
|
|
44
55
|
var import_maintained_node_versions = require("./maintained-node-versions");
|
|
45
|
-
const NODE_VERSION =
|
|
56
|
+
const NODE_VERSION = import_node_process.default.version;
|
|
46
57
|
function getNodeVersion() {
|
|
47
58
|
return NODE_VERSION;
|
|
48
59
|
}
|
|
@@ -105,7 +116,7 @@ function getNodeDisableSigusr1Flags() {
|
|
|
105
116
|
return _nodeDisableSigusr1Flags;
|
|
106
117
|
}
|
|
107
118
|
function supportsProcessSend() {
|
|
108
|
-
return typeof
|
|
119
|
+
return typeof import_node_process.default.send === "function";
|
|
109
120
|
}
|
|
110
121
|
let _nodeHardenFlags;
|
|
111
122
|
let _nodePermissionFlags;
|
|
@@ -152,7 +163,7 @@ function getNodeNoWarningsFlags() {
|
|
|
152
163
|
return _nodeNoWarningsFlags;
|
|
153
164
|
}
|
|
154
165
|
function getExecPath() {
|
|
155
|
-
return
|
|
166
|
+
return import_node_process.default.execPath;
|
|
156
167
|
}
|
|
157
168
|
const NODE_SEA_FUSE = "NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2";
|
|
158
169
|
const ESNEXT = "esnext";
|
package/dist/cover/code.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,12 +18,21 @@ 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 code_exports = {};
|
|
21
31
|
__export(code_exports, {
|
|
22
32
|
getCodeCoverage: () => getCodeCoverage
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(code_exports);
|
|
35
|
+
var import_node_process = __toESM(require("node:process"));
|
|
25
36
|
var import_fs = require("../fs");
|
|
26
37
|
var import_objects = require("../objects");
|
|
27
38
|
var import_spawn = require("../spawn");
|
|
@@ -45,7 +56,7 @@ async function getCodeCoverage(options) {
|
|
|
45
56
|
const path = /* @__PURE__ */ getPath();
|
|
46
57
|
const opts = {
|
|
47
58
|
__proto__: null,
|
|
48
|
-
coveragePath: path.join(
|
|
59
|
+
coveragePath: path.join(import_node_process.default.cwd(), "coverage/coverage-final.json"),
|
|
49
60
|
generateIfMissing: false,
|
|
50
61
|
...options
|
|
51
62
|
};
|
|
@@ -58,7 +69,7 @@ async function getCodeCoverage(options) {
|
|
|
58
69
|
if (!coverageExists) {
|
|
59
70
|
if (generateIfMissing) {
|
|
60
71
|
await (0, import_spawn.spawn)("vitest", ["run", "--coverage"], {
|
|
61
|
-
cwd:
|
|
72
|
+
cwd: import_node_process.default.cwd(),
|
|
62
73
|
stdio: "inherit"
|
|
63
74
|
});
|
|
64
75
|
} else {
|
package/dist/cover/type.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,17 +18,26 @@ 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 type_exports = {};
|
|
21
31
|
__export(type_exports, {
|
|
22
32
|
getTypeCoverage: () => getTypeCoverage
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(type_exports);
|
|
35
|
+
var import_node_process = __toESM(require("node:process"));
|
|
25
36
|
var import_spawn = require("../spawn");
|
|
26
37
|
async function getTypeCoverage(options) {
|
|
27
38
|
const opts = {
|
|
28
39
|
__proto__: null,
|
|
29
|
-
cwd:
|
|
40
|
+
cwd: import_node_process.default.cwd(),
|
|
30
41
|
generateIfMissing: false,
|
|
31
42
|
...options
|
|
32
43
|
};
|
package/dist/dlx/binary.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 binary_exports = {};
|
|
21
31
|
__export(binary_exports, {
|
|
@@ -31,6 +41,7 @@ __export(binary_exports, {
|
|
|
31
41
|
writeBinaryCacheMetadata: () => writeBinaryCacheMetadata
|
|
32
42
|
});
|
|
33
43
|
module.exports = __toCommonJS(binary_exports);
|
|
44
|
+
var import_node_process = __toESM(require("node:process"));
|
|
34
45
|
var import_platform = require("../constants/platform");
|
|
35
46
|
var import_time = require("../constants/time");
|
|
36
47
|
var import_cache = require("./cache");
|
|
@@ -120,7 +131,7 @@ async function dlxBinary(args, options, spawnExtra) {
|
|
|
120
131
|
const path = /* @__PURE__ */ getPath();
|
|
121
132
|
const force = yes === true ? true : userForce;
|
|
122
133
|
const cacheDir = getDlxCachePath();
|
|
123
|
-
const binaryName = name || `binary-${
|
|
134
|
+
const binaryName = name || `binary-${import_node_process.default.platform}-${(0, import_platform.getArch)()}`;
|
|
124
135
|
const spec = `${url}:${binaryName}`;
|
|
125
136
|
const cacheKey = (0, import_cache.generateCacheKey)(spec);
|
|
126
137
|
const cacheEntryDir = path.join(cacheDir, cacheKey);
|
|
@@ -189,7 +200,7 @@ Ensure the filesystem is writable or set SOCKET_DLX_DIR to a writable location.`
|
|
|
189
200
|
...spawnOptions,
|
|
190
201
|
env: {
|
|
191
202
|
...spawnOptions?.env,
|
|
192
|
-
PATH: `${cacheEntryDir}${(/* @__PURE__ */ getPath()).delimiter}${
|
|
203
|
+
PATH: `${cacheEntryDir}${(/* @__PURE__ */ getPath()).delimiter}${import_node_process.default.env["PATH"] || ""}`
|
|
193
204
|
},
|
|
194
205
|
shell: true
|
|
195
206
|
} : spawnOptions;
|
|
@@ -212,7 +223,7 @@ async function downloadBinary(options) {
|
|
|
212
223
|
const fs = /* @__PURE__ */ getFs();
|
|
213
224
|
const path = /* @__PURE__ */ getPath();
|
|
214
225
|
const cacheDir = getDlxCachePath();
|
|
215
|
-
const binaryName = name || `binary-${
|
|
226
|
+
const binaryName = name || `binary-${import_node_process.default.platform}-${(0, import_platform.getArch)()}`;
|
|
216
227
|
const spec = `${url}:${binaryName}`;
|
|
217
228
|
const cacheKey = (0, import_cache.generateCacheKey)(spec);
|
|
218
229
|
const cacheEntryDir = path.join(cacheDir, cacheKey);
|
|
@@ -321,7 +332,7 @@ function executeBinary(binaryPath, args, spawnOptions, spawnExtra) {
|
|
|
321
332
|
...spawnOptions,
|
|
322
333
|
env: {
|
|
323
334
|
...spawnOptions?.env,
|
|
324
|
-
PATH: `${cacheEntryDir}${path.delimiter}${
|
|
335
|
+
PATH: `${cacheEntryDir}${path.delimiter}${import_node_process.default.env["PATH"] || ""}`
|
|
325
336
|
},
|
|
326
337
|
shell: true
|
|
327
338
|
} : spawnOptions;
|
|
@@ -414,7 +425,7 @@ async function writeBinaryCacheMetadata(cacheEntryPath, cacheKey, url, integrity
|
|
|
414
425
|
}
|
|
415
426
|
};
|
|
416
427
|
const fs = /* @__PURE__ */ getFs();
|
|
417
|
-
const tmpPath = `${metaPath}.tmp.${
|
|
428
|
+
const tmpPath = `${metaPath}.tmp.${import_node_process.default.pid}`;
|
|
418
429
|
await fs.promises.writeFile(tmpPath, JSON.stringify(metadata, null, 2));
|
|
419
430
|
await fs.promises.rename(tmpPath, metaPath);
|
|
420
431
|
}
|
|
@@ -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 package_manager_exports = {};
|
|
21
31
|
__export(package_manager_exports, {
|
|
@@ -24,6 +34,7 @@ __export(package_manager_exports, {
|
|
|
24
34
|
getPackageManagerUserAgent: () => getPackageManagerUserAgent
|
|
25
35
|
});
|
|
26
36
|
module.exports = __toCommonJS(package_manager_exports);
|
|
37
|
+
var import_node_process = __toESM(require("node:process"));
|
|
27
38
|
var import_rewire = require("./rewire");
|
|
28
39
|
// @__NO_SIDE_EFFECTS__
|
|
29
40
|
function detectPackageManager() {
|
|
@@ -34,7 +45,7 @@ function detectPackageManager() {
|
|
|
34
45
|
return match[1];
|
|
35
46
|
}
|
|
36
47
|
}
|
|
37
|
-
const argv0 =
|
|
48
|
+
const argv0 = import_node_process.default.argv[0];
|
|
38
49
|
if (argv0) {
|
|
39
50
|
if (argv0.includes("/pnpm/") || argv0.includes("\\pnpm\\")) {
|
|
40
51
|
return "pnpm";
|
package/dist/env/rewire.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 rewire_exports = {};
|
|
21
31
|
__export(rewire_exports, {
|
|
@@ -29,6 +39,7 @@ __export(rewire_exports, {
|
|
|
29
39
|
withEnvSync: () => withEnvSync
|
|
30
40
|
});
|
|
31
41
|
module.exports = __toCommonJS(rewire_exports);
|
|
42
|
+
var import_node_process = __toESM(require("node:process"));
|
|
32
43
|
var import_objects = require("../objects");
|
|
33
44
|
var import_helpers = require("./helpers");
|
|
34
45
|
let _async_hooks;
|
|
@@ -44,7 +55,7 @@ const isolatedOverridesStorage = new AsyncLocalStorage();
|
|
|
44
55
|
const sharedOverridesSymbol = Symbol.for(
|
|
45
56
|
"@socketsecurity/lib/env/rewire/test-overrides"
|
|
46
57
|
);
|
|
47
|
-
const isVitestEnv = (0, import_helpers.envAsBoolean)(
|
|
58
|
+
const isVitestEnv = (0, import_helpers.envAsBoolean)(import_node_process.default.env.VITEST);
|
|
48
59
|
if (isVitestEnv && !globalThis[sharedOverridesSymbol]) {
|
|
49
60
|
globalThis[sharedOverridesSymbol] = /* @__PURE__ */ new Map();
|
|
50
61
|
}
|
|
@@ -60,7 +71,7 @@ function getEnvValue(key) {
|
|
|
60
71
|
if (sharedOverrides?.has(key)) {
|
|
61
72
|
return sharedOverrides.get(key);
|
|
62
73
|
}
|
|
63
|
-
return
|
|
74
|
+
return import_node_process.default.env[key];
|
|
64
75
|
}
|
|
65
76
|
function hasOverride(key) {
|
|
66
77
|
const isolatedOverrides = isolatedOverridesStorage.getStore();
|
|
@@ -74,7 +85,7 @@ function isInEnv(key) {
|
|
|
74
85
|
if (sharedOverrides?.has(key)) {
|
|
75
86
|
return true;
|
|
76
87
|
}
|
|
77
|
-
return (0, import_objects.hasOwn)(
|
|
88
|
+
return (0, import_objects.hasOwn)(import_node_process.default.env, key);
|
|
78
89
|
}
|
|
79
90
|
function resetEnv() {
|
|
80
91
|
sharedOverrides?.clear();
|
package/dist/fs.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview File system utilities with cross-platform path handling.
|
|
3
|
-
* Provides enhanced fs operations, glob matching, and directory traversal functions.
|
|
4
|
-
*/
|
|
5
1
|
import type { Abortable } from 'events';
|
|
6
2
|
import type { MakeDirectoryOptions, ObjectEncodingOptions, OpenMode, PathLike } from 'fs';
|
|
7
3
|
import type { JsonReviver } from './json/types';
|
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();
|