@socketsecurity/lib 5.5.0 → 5.5.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 +16 -0
- package/dist/constants/agents.d.ts +1 -1
- package/dist/constants/packages.js +1 -1
- package/dist/dlx/package.js +4 -11
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +31 -0
- package/dist/external/pony-cause.js +148 -0
- package/dist/releases/github.js +3 -0
- package/dist/spawn.d.ts +6 -0
- package/dist/spawn.js +83 -1
- package/package.json +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.5.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.2) - 2026-01-20
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **dlx/package**: Use `getSocketCacacheDir()` instead of `getPacoteCachePath()` for Arborist cache configuration
|
|
13
|
+
- Ensures consistent use of Socket's shared cacache directory (`~/.socket/_cacache`)
|
|
14
|
+
- Removes dependency on pacote cache path extraction which could fail
|
|
15
|
+
- Simplifies cache configuration by using reliable Socket path utility
|
|
16
|
+
|
|
17
|
+
## [5.5.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.1) - 2026-01-12
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Fixed dotenvx compatibility with pre-commit hooks
|
|
22
|
+
- Fixed empty releases being returned when finding latest release
|
|
23
|
+
|
|
8
24
|
## [5.5.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.0) - 2026-01-12
|
|
9
25
|
|
|
10
26
|
### Added
|
|
@@ -6,7 +6,7 @@ export declare const BUN = "bun";
|
|
|
6
6
|
export declare const VLT = "vlt";
|
|
7
7
|
export declare const NPX = "npx";
|
|
8
8
|
// NPM binary path - resolved at runtime using which.
|
|
9
|
-
export declare const NPM_BIN_PATH:
|
|
9
|
+
export declare const NPM_BIN_PATH: string;
|
|
10
10
|
// NPM CLI entry point - resolved at runtime from npm bin location.
|
|
11
11
|
// NOTE: This is kept for backward compatibility but NPM_BIN_PATH should be used instead
|
|
12
12
|
// because cli.js exports a function that must be invoked, not executed directly.
|
|
@@ -111,7 +111,7 @@ function getPacoteCachePath() {
|
|
|
111
111
|
"x",
|
|
112
112
|
{}
|
|
113
113
|
).cache : "";
|
|
114
|
-
_pacoteCachePath = (0, import_normalize.normalizePath)(cachePath);
|
|
114
|
+
_pacoteCachePath = cachePath ? (0, import_normalize.normalizePath)(cachePath) : "";
|
|
115
115
|
} catch {
|
|
116
116
|
_pacoteCachePath = "";
|
|
117
117
|
}
|
package/dist/dlx/package.js
CHANGED
|
@@ -35,12 +35,10 @@ __export(package_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(package_exports);
|
|
37
37
|
var import_platform = require("../constants/platform");
|
|
38
|
-
var import_packages = require("../constants/packages");
|
|
39
38
|
var import_cache = require("./cache");
|
|
40
39
|
var import_arborist = __toESM(require("../external/@npmcli/arborist"));
|
|
41
40
|
var import_libnpmexec = __toESM(require("../external/libnpmexec"));
|
|
42
41
|
var import_npm_package_arg = __toESM(require("../external/npm-package-arg"));
|
|
43
|
-
var import_pacote = __toESM(require("../external/pacote"));
|
|
44
42
|
var import_fs = require("../fs");
|
|
45
43
|
var import_normalize = require("../paths/normalize");
|
|
46
44
|
var import_socket = require("../paths/socket");
|
|
@@ -122,15 +120,11 @@ Ensure the filesystem is writable or set SOCKET_DLX_DIR to a writable location.`
|
|
|
122
120
|
return { installed: false, packageDir };
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
|
-
const pacoteCachePath = (0, import_packages.getPacoteCachePath)();
|
|
126
123
|
try {
|
|
127
|
-
await import_pacote.default.extract(packageSpec, installedDir, {
|
|
128
|
-
// Use consistent pacote cache path (respects npm cache locations when available).
|
|
129
|
-
cache: pacoteCachePath || path.join(packageDir, ".cache")
|
|
130
|
-
});
|
|
131
124
|
const arb = new import_arborist.default({
|
|
132
|
-
path:
|
|
133
|
-
|
|
125
|
+
path: packageDir,
|
|
126
|
+
// Use Socket's shared cacache directory (~/.socket/_cacache).
|
|
127
|
+
cache: (0, import_socket.getSocketCacacheDir)(),
|
|
134
128
|
// Skip devDependencies (production-only like npx).
|
|
135
129
|
omit: ["dev"],
|
|
136
130
|
// Security: Skip install/preinstall/postinstall scripts to prevent arbitrary code execution.
|
|
@@ -144,8 +138,7 @@ Ensure the filesystem is writable or set SOCKET_DLX_DIR to a writable location.`
|
|
|
144
138
|
// Suppress output (unneeded for ephemeral dlx installs).
|
|
145
139
|
silent: true
|
|
146
140
|
});
|
|
147
|
-
await arb.
|
|
148
|
-
await arb.reify({ save: false });
|
|
141
|
+
await arb.reify({ save: true, add: [packageSpec] });
|
|
149
142
|
} catch (e) {
|
|
150
143
|
const code = e.code;
|
|
151
144
|
if (code === "E404" || code === "ETARGET") {
|
package/dist/errors.d.ts
ADDED
package/dist/errors.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var errors_exports = {};
|
|
21
|
+
__export(errors_exports, {
|
|
22
|
+
messageWithCauses: () => import_pony_cause.messageWithCauses,
|
|
23
|
+
stackWithCauses: () => import_pony_cause.stackWithCauses
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(errors_exports);
|
|
26
|
+
var import_pony_cause = require("./external/pony-cause");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
messageWithCauses,
|
|
30
|
+
stackWithCauses
|
|
31
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bundled from pony-cause
|
|
4
|
+
* This is a zero-dependency bundle created by esbuild.
|
|
5
|
+
*/
|
|
6
|
+
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/pony-cause@2.1.11/node_modules/pony-cause/lib/error-with-cause.js
|
|
15
|
+
var require_error_with_cause = __commonJS({
|
|
16
|
+
"node_modules/.pnpm/pony-cause@2.1.11/node_modules/pony-cause/lib/error-with-cause.js"(exports2, module2) {
|
|
17
|
+
"use strict";
|
|
18
|
+
var ErrorWithCause = class _ErrorWithCause extends Error {
|
|
19
|
+
static {
|
|
20
|
+
__name(this, "ErrorWithCause");
|
|
21
|
+
}
|
|
22
|
+
// linemod-prefix-with: export
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} message
|
|
25
|
+
* @param {{ cause?: T }} options
|
|
26
|
+
*/
|
|
27
|
+
constructor(message, { cause } = {}) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = _ErrorWithCause.name;
|
|
30
|
+
if (cause) {
|
|
31
|
+
this.cause = cause;
|
|
32
|
+
}
|
|
33
|
+
this.message = message;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
module2.exports = {
|
|
37
|
+
// linemod-remove
|
|
38
|
+
ErrorWithCause
|
|
39
|
+
// linemod-remove
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// node_modules/.pnpm/pony-cause@2.1.11/node_modules/pony-cause/lib/helpers.js
|
|
45
|
+
var require_helpers = __commonJS({
|
|
46
|
+
"node_modules/.pnpm/pony-cause@2.1.11/node_modules/pony-cause/lib/helpers.js"(exports2, module2) {
|
|
47
|
+
"use strict";
|
|
48
|
+
var findCauseByReference = /* @__PURE__ */ __name((err, reference) => {
|
|
49
|
+
if (!err || !reference) return;
|
|
50
|
+
if (!(err instanceof Error)) return;
|
|
51
|
+
if (!(reference.prototype instanceof Error) && // @ts-ignore
|
|
52
|
+
reference !== Error) return;
|
|
53
|
+
const seen = /* @__PURE__ */ new Set();
|
|
54
|
+
let currentErr = err;
|
|
55
|
+
while (currentErr && !seen.has(currentErr)) {
|
|
56
|
+
seen.add(currentErr);
|
|
57
|
+
if (currentErr instanceof reference) {
|
|
58
|
+
return currentErr;
|
|
59
|
+
}
|
|
60
|
+
currentErr = getErrorCause(currentErr);
|
|
61
|
+
}
|
|
62
|
+
}, "findCauseByReference");
|
|
63
|
+
var getErrorCause = /* @__PURE__ */ __name((err) => {
|
|
64
|
+
if (!err || typeof err !== "object" || !("cause" in err)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (typeof err.cause === "function") {
|
|
68
|
+
const causeResult = err.cause();
|
|
69
|
+
return causeResult instanceof Error ? causeResult : void 0;
|
|
70
|
+
} else {
|
|
71
|
+
return err.cause instanceof Error ? err.cause : void 0;
|
|
72
|
+
}
|
|
73
|
+
}, "getErrorCause");
|
|
74
|
+
var _stackWithCauses = /* @__PURE__ */ __name((err, seen) => {
|
|
75
|
+
if (!(err instanceof Error)) return "";
|
|
76
|
+
const stack = err.stack || "";
|
|
77
|
+
if (seen.has(err)) {
|
|
78
|
+
return stack + "\ncauses have become circular...";
|
|
79
|
+
}
|
|
80
|
+
const cause = getErrorCause(err);
|
|
81
|
+
if (cause) {
|
|
82
|
+
seen.add(err);
|
|
83
|
+
return stack + "\ncaused by: " + _stackWithCauses(cause, seen);
|
|
84
|
+
} else {
|
|
85
|
+
return stack;
|
|
86
|
+
}
|
|
87
|
+
}, "_stackWithCauses");
|
|
88
|
+
var stackWithCauses = /* @__PURE__ */ __name((err) => _stackWithCauses(err, /* @__PURE__ */ new Set()), "stackWithCauses");
|
|
89
|
+
var _messageWithCauses = /* @__PURE__ */ __name((err, seen, skip) => {
|
|
90
|
+
if (!(err instanceof Error)) return "";
|
|
91
|
+
const message = skip ? "" : err.message || "";
|
|
92
|
+
if (seen.has(err)) {
|
|
93
|
+
return message + ": ...";
|
|
94
|
+
}
|
|
95
|
+
const cause = getErrorCause(err);
|
|
96
|
+
if (cause) {
|
|
97
|
+
seen.add(err);
|
|
98
|
+
const skipIfVErrorStyleCause = "cause" in err && typeof err.cause === "function";
|
|
99
|
+
return message + (skipIfVErrorStyleCause ? "" : ": ") + _messageWithCauses(cause, seen, skipIfVErrorStyleCause);
|
|
100
|
+
} else {
|
|
101
|
+
return message;
|
|
102
|
+
}
|
|
103
|
+
}, "_messageWithCauses");
|
|
104
|
+
var messageWithCauses = /* @__PURE__ */ __name((err) => _messageWithCauses(err, /* @__PURE__ */ new Set()), "messageWithCauses");
|
|
105
|
+
module2.exports = {
|
|
106
|
+
// linemod-remove
|
|
107
|
+
findCauseByReference,
|
|
108
|
+
// linemod-remove
|
|
109
|
+
getErrorCause,
|
|
110
|
+
// linemod-remove
|
|
111
|
+
stackWithCauses,
|
|
112
|
+
// linemod-remove
|
|
113
|
+
messageWithCauses
|
|
114
|
+
// linemod-remove
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// node_modules/.pnpm/pony-cause@2.1.11/node_modules/pony-cause/index.js
|
|
120
|
+
var require_pony_cause = __commonJS({
|
|
121
|
+
"node_modules/.pnpm/pony-cause@2.1.11/node_modules/pony-cause/index.js"(exports2, module2) {
|
|
122
|
+
"use strict";
|
|
123
|
+
var { ErrorWithCause } = require_error_with_cause();
|
|
124
|
+
var {
|
|
125
|
+
// linemod-replace-with: export {
|
|
126
|
+
findCauseByReference,
|
|
127
|
+
getErrorCause,
|
|
128
|
+
messageWithCauses,
|
|
129
|
+
stackWithCauses
|
|
130
|
+
} = require_helpers();
|
|
131
|
+
module2.exports = {
|
|
132
|
+
// linemod-remove
|
|
133
|
+
ErrorWithCause,
|
|
134
|
+
// linemod-remove
|
|
135
|
+
findCauseByReference,
|
|
136
|
+
// linemod-remove
|
|
137
|
+
getErrorCause,
|
|
138
|
+
// linemod-remove
|
|
139
|
+
stackWithCauses,
|
|
140
|
+
// linemod-remove
|
|
141
|
+
messageWithCauses
|
|
142
|
+
// linemod-remove
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// src/external/pony-cause.js
|
|
148
|
+
module.exports = require_pony_cause();
|
package/dist/releases/github.js
CHANGED
|
@@ -139,6 +139,9 @@ async function getLatestRelease(toolPrefix, repoConfig, options = {}) {
|
|
|
139
139
|
if (!tag2.startsWith(toolPrefix)) {
|
|
140
140
|
return false;
|
|
141
141
|
}
|
|
142
|
+
if (!assets || assets.length === 0) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
142
145
|
if (isMatch) {
|
|
143
146
|
const hasMatchingAsset = assets.some(
|
|
144
147
|
(a) => isMatch(a.name)
|
package/dist/spawn.d.ts
CHANGED
|
@@ -158,6 +158,12 @@ export interface SpawnSyncReturns<T> {
|
|
|
158
158
|
signal: NodeJS.Signals | null;
|
|
159
159
|
error?: Error | undefined;
|
|
160
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Enhances spawn error with better context.
|
|
163
|
+
* Converts generic "command failed" to detailed error with command, exit code, and stderr.
|
|
164
|
+
*/
|
|
165
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
166
|
+
export declare function enhanceSpawnError(error: unknown): unknown;
|
|
161
167
|
/**
|
|
162
168
|
* Check if a value is a spawn error with expected error properties.
|
|
163
169
|
* Tests for common error properties from child process failures.
|
package/dist/spawn.js
CHANGED
|
@@ -29,6 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
var spawn_exports = {};
|
|
31
31
|
__export(spawn_exports, {
|
|
32
|
+
enhanceSpawnError: () => enhanceSpawnError,
|
|
32
33
|
isSpawnError: () => isSpawnError,
|
|
33
34
|
isStdioType: () => isStdioType,
|
|
34
35
|
spawn: () => spawn,
|
|
@@ -36,6 +37,7 @@ __export(spawn_exports, {
|
|
|
36
37
|
});
|
|
37
38
|
module.exports = __toCommonJS(spawn_exports);
|
|
38
39
|
var import_process = require("./constants/process");
|
|
40
|
+
var import_errors = require("./errors");
|
|
39
41
|
var import_promise_spawn = __toESM(require("./external/@npmcli/promise-spawn"));
|
|
40
42
|
var import_arrays = require("./arrays");
|
|
41
43
|
var import_bin = require("./bin");
|
|
@@ -53,6 +55,7 @@ function getPath() {
|
|
|
53
55
|
}
|
|
54
56
|
const abortSignal = (0, import_process.getAbortSignal)();
|
|
55
57
|
const spinner = (0, import_spinner.getDefaultSpinner)();
|
|
58
|
+
const stackCache = /* @__PURE__ */ new WeakMap();
|
|
56
59
|
const windowsScriptExtRegExp = /\.(?:cmd|bat|ps1)$/i;
|
|
57
60
|
let _child_process;
|
|
58
61
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -63,6 +66,79 @@ function getChildProcess() {
|
|
|
63
66
|
return _child_process;
|
|
64
67
|
}
|
|
65
68
|
// @__NO_SIDE_EFFECTS__
|
|
69
|
+
function enhanceSpawnError(error) {
|
|
70
|
+
if (error === null || typeof error !== "object") {
|
|
71
|
+
return error;
|
|
72
|
+
}
|
|
73
|
+
if (!/* @__PURE__ */ isSpawnError(error)) {
|
|
74
|
+
return error;
|
|
75
|
+
}
|
|
76
|
+
const err = error;
|
|
77
|
+
const { args, cmd, code, signal, stderr } = err;
|
|
78
|
+
const stderrText = typeof stderr === "string" ? stderr : stderr?.toString() ?? "";
|
|
79
|
+
let enhancedMessage = `Command failed: ${cmd}`;
|
|
80
|
+
if (args && args.length > 0) {
|
|
81
|
+
const argsStr = args.join(" ");
|
|
82
|
+
if (argsStr.length < 100) {
|
|
83
|
+
enhancedMessage += ` ${argsStr}`;
|
|
84
|
+
} else {
|
|
85
|
+
enhancedMessage += ` ${argsStr.slice(0, 97)}...`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (signal) {
|
|
89
|
+
enhancedMessage += ` (terminated by ${signal})`;
|
|
90
|
+
} else if (code !== void 0) {
|
|
91
|
+
enhancedMessage += ` (exit code ${code})`;
|
|
92
|
+
}
|
|
93
|
+
const trimmedStderr = stderrText.trim();
|
|
94
|
+
if (trimmedStderr) {
|
|
95
|
+
const firstLine = trimmedStderr.split("\n")[0];
|
|
96
|
+
if (firstLine.length < 200) {
|
|
97
|
+
enhancedMessage += `
|
|
98
|
+
${firstLine}`;
|
|
99
|
+
} else {
|
|
100
|
+
enhancedMessage += `
|
|
101
|
+
${firstLine.slice(0, 197)}...`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const isSynthetic = err.message === "command failed";
|
|
105
|
+
if (isSynthetic) {
|
|
106
|
+
Object.defineProperty(err, "message", {
|
|
107
|
+
__proto__: null,
|
|
108
|
+
value: enhancedMessage,
|
|
109
|
+
writable: true,
|
|
110
|
+
enumerable: false,
|
|
111
|
+
configurable: true
|
|
112
|
+
});
|
|
113
|
+
return err;
|
|
114
|
+
}
|
|
115
|
+
const enhancedError = new Error(enhancedMessage, {
|
|
116
|
+
cause: err
|
|
117
|
+
});
|
|
118
|
+
const descriptors = Object.getOwnPropertyDescriptors(err);
|
|
119
|
+
delete descriptors.message;
|
|
120
|
+
delete descriptors.stack;
|
|
121
|
+
Object.defineProperties(enhancedError, descriptors);
|
|
122
|
+
Object.defineProperty(enhancedError, "stack", {
|
|
123
|
+
__proto__: null,
|
|
124
|
+
configurable: true,
|
|
125
|
+
enumerable: false,
|
|
126
|
+
get() {
|
|
127
|
+
let stack = stackCache.get(enhancedError);
|
|
128
|
+
if (stack === void 0) {
|
|
129
|
+
try {
|
|
130
|
+
stack = (0, import_errors.stackWithCauses)(err);
|
|
131
|
+
} catch {
|
|
132
|
+
stack = err.stack ?? new Error().stack ?? "";
|
|
133
|
+
}
|
|
134
|
+
stackCache.set(enhancedError, stack);
|
|
135
|
+
}
|
|
136
|
+
return stack;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return enhancedError;
|
|
140
|
+
}
|
|
141
|
+
// @__NO_SIDE_EFFECTS__
|
|
66
142
|
function isSpawnError(value) {
|
|
67
143
|
if (value === null || typeof value !== "object") {
|
|
68
144
|
return false;
|
|
@@ -152,7 +228,9 @@ function spawn(cmd, args, options, extra) {
|
|
|
152
228
|
}
|
|
153
229
|
return strippedResult;
|
|
154
230
|
}).catch((error) => {
|
|
155
|
-
|
|
231
|
+
const strippedError = /* @__PURE__ */ stripAnsiFromSpawnResult(error);
|
|
232
|
+
const enhancedError = /* @__PURE__ */ enhanceSpawnError(strippedError);
|
|
233
|
+
throw enhancedError;
|
|
156
234
|
});
|
|
157
235
|
} else {
|
|
158
236
|
newSpawnPromise = spawnPromise.then((result) => {
|
|
@@ -162,6 +240,9 @@ function spawn(cmd, args, options, extra) {
|
|
|
162
240
|
return res;
|
|
163
241
|
}
|
|
164
242
|
return result;
|
|
243
|
+
}).catch((error) => {
|
|
244
|
+
const enhancedError = /* @__PURE__ */ enhanceSpawnError(error);
|
|
245
|
+
throw enhancedError;
|
|
165
246
|
});
|
|
166
247
|
}
|
|
167
248
|
if (shouldRestartSpinner) {
|
|
@@ -215,6 +296,7 @@ function spawnSync(cmd, args, options) {
|
|
|
215
296
|
}
|
|
216
297
|
// Annotate the CommonJS export names for ESM import in node:
|
|
217
298
|
0 && (module.exports = {
|
|
299
|
+
enhanceSpawnError,
|
|
218
300
|
isSpawnError,
|
|
219
301
|
isStdioType,
|
|
220
302
|
spawn,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.2",
|
|
4
4
|
"packageManager": "pnpm@10.28.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
@@ -359,6 +359,10 @@
|
|
|
359
359
|
"types": "./dist/env/xdg.d.ts",
|
|
360
360
|
"default": "./dist/env/xdg.js"
|
|
361
361
|
},
|
|
362
|
+
"./errors": {
|
|
363
|
+
"types": "./dist/errors.d.ts",
|
|
364
|
+
"default": "./dist/errors.js"
|
|
365
|
+
},
|
|
362
366
|
"./fs": {
|
|
363
367
|
"types": "./dist/fs.d.ts",
|
|
364
368
|
"default": "./dist/fs.js"
|
|
@@ -726,7 +730,7 @@
|
|
|
726
730
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
727
731
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
728
732
|
"@socketregistry/yocto-spinner": "1.0.25",
|
|
729
|
-
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.
|
|
733
|
+
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.5.0",
|
|
730
734
|
"@types/node": "24.9.2",
|
|
731
735
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
|
732
736
|
"@vitest/coverage-v8": "4.0.3",
|
|
@@ -760,6 +764,7 @@
|
|
|
760
764
|
"npm-package-arg": "13.0.0",
|
|
761
765
|
"pacote": "21.0.1",
|
|
762
766
|
"picomatch": "2.3.1",
|
|
767
|
+
"pony-cause": "2.1.11",
|
|
763
768
|
"semver": "7.7.2",
|
|
764
769
|
"signal-exit": "4.1.0",
|
|
765
770
|
"spdx-correct": "3.2.0",
|
|
@@ -795,6 +800,7 @@
|
|
|
795
800
|
"@sigstore/sign": "4.1.0",
|
|
796
801
|
"ansi-regex": "6.2.2",
|
|
797
802
|
"debug": "4.4.3",
|
|
803
|
+
"execa": "5.1.1",
|
|
798
804
|
"has-flag": "5.0.1",
|
|
799
805
|
"isexe": "3.1.1",
|
|
800
806
|
"lru-cache": "11.2.2",
|
|
@@ -812,7 +818,8 @@
|
|
|
812
818
|
"patchedDependencies": {
|
|
813
819
|
"@npmcli/run-script@10.0.0": "patches/@npmcli__run-script@10.0.0.patch",
|
|
814
820
|
"@sigstore/sign@4.1.0": "patches/@sigstore__sign@4.1.0.patch",
|
|
815
|
-
"node-gyp@11.5.0": "patches/node-gyp@11.5.0.patch"
|
|
821
|
+
"node-gyp@11.5.0": "patches/node-gyp@11.5.0.patch",
|
|
822
|
+
"execa@5.1.1": "patches/execa@5.1.1.patch"
|
|
816
823
|
}
|
|
817
824
|
}
|
|
818
825
|
}
|