@socketsecurity/lib 5.2.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/bin.d.ts +0 -9
- package/dist/bin.js +70 -48
- package/dist/constants/agents.js +2 -2
- package/dist/constants/platform.d.ts +21 -0
- package/dist/constants/platform.js +30 -6
- package/dist/cover/code.js +13 -5
- package/dist/debug.js +1 -1
- package/dist/dlx/binary.d.ts +1 -1
- package/dist/dlx/binary.js +49 -39
- package/dist/dlx/cache.js +10 -2
- package/dist/dlx/dir.js +1 -1
- package/dist/dlx/manifest.d.ts +2 -1
- package/dist/dlx/manifest.js +45 -41
- package/dist/dlx/package.js +39 -19
- package/dist/dlx/packages.js +1 -1
- package/dist/dlx/paths.js +1 -1
- package/dist/env/rewire.js +10 -2
- package/dist/external/@inquirer/checkbox.js +4 -2528
- package/dist/external/@inquirer/confirm.js +4 -2371
- package/dist/external/@inquirer/input.js +4 -2395
- package/dist/external/@inquirer/password.js +4 -2503
- package/dist/external/@inquirer/search.js +4 -2500
- package/dist/external/@inquirer/select.js +4 -2617
- package/dist/external/del.js +4 -7139
- package/dist/external/fast-glob.js +4 -5776
- package/dist/external/inquirer-pack.js +4610 -0
- package/dist/external/npm-core.js +3 -1
- package/dist/external/pico-pack.js +7162 -0
- package/dist/external/picomatch.js +4 -1523
- package/dist/external/spdx-correct.js +4 -1384
- package/dist/external/spdx-expression-parse.js +4 -1047
- package/dist/external/spdx-pack.js +1640 -0
- package/dist/external/validate-npm-package-name.js +4 -104
- package/dist/fs.js +3 -3
- package/dist/git.js +41 -38
- package/dist/http-request.js +12 -4
- package/dist/ipc.js +53 -29
- package/dist/json/edit.js +1 -1
- package/dist/json/format.js +1 -1
- package/dist/logger.js +1 -1
- package/dist/packages/edit.js +3 -3
- package/dist/packages/isolation.js +45 -23
- package/dist/packages/licenses.js +10 -2
- package/dist/paths/normalize.js +3 -3
- package/dist/paths/packages.js +1 -1
- package/dist/paths/socket.d.ts +2 -2
- package/dist/paths/socket.js +27 -21
- package/dist/process-lock.js +23 -14
- package/dist/promises.js +1 -1
- package/dist/releases/github.d.ts +82 -137
- package/dist/releases/github.js +91 -48
- package/dist/releases/socket-btm.d.ts +78 -192
- package/dist/releases/socket-btm.js +112 -50
- package/dist/signal-exit.js +1 -1
- package/dist/spawn.js +11 -4
- package/dist/stdio/mask.d.ts +6 -21
- package/dist/stdio/mask.js +18 -14
- package/dist/themes/context.js +10 -2
- package/package.json +3 -2
package/dist/stdio/mask.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
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
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
var mask_exports = {};
|
|
31
21
|
__export(mask_exports, {
|
|
@@ -35,11 +25,25 @@ __export(mask_exports, {
|
|
|
35
25
|
runWithMask: () => runWithMask
|
|
36
26
|
});
|
|
37
27
|
module.exports = __toCommonJS(mask_exports);
|
|
38
|
-
var import_child_process = require("child_process");
|
|
39
|
-
var import_readline = __toESM(require("readline"));
|
|
40
28
|
var import_spinner = require("../spinner.js");
|
|
41
29
|
var import_clear = require("./clear.js");
|
|
42
30
|
var import_stdout = require("./stdout.js");
|
|
31
|
+
let _child_process;
|
|
32
|
+
// @__NO_SIDE_EFFECTS__
|
|
33
|
+
function getChildProcess() {
|
|
34
|
+
if (_child_process === void 0) {
|
|
35
|
+
_child_process = require("child_process");
|
|
36
|
+
}
|
|
37
|
+
return _child_process;
|
|
38
|
+
}
|
|
39
|
+
let _readline;
|
|
40
|
+
// @__NO_SIDE_EFFECTS__
|
|
41
|
+
function getReadline() {
|
|
42
|
+
if (_readline === void 0) {
|
|
43
|
+
_readline = require("readline");
|
|
44
|
+
}
|
|
45
|
+
return _readline;
|
|
46
|
+
}
|
|
43
47
|
const spinner = (0, import_spinner.getDefaultSpinner)();
|
|
44
48
|
function createOutputMask(options = {}) {
|
|
45
49
|
const { showOutput = false } = options;
|
|
@@ -101,7 +105,7 @@ function attachOutputMask(child, options = {}) {
|
|
|
101
105
|
);
|
|
102
106
|
}
|
|
103
107
|
if (process.stdin.isTTY) {
|
|
104
|
-
|
|
108
|
+
(/* @__PURE__ */ getReadline()).emitKeypressEvents(process.stdin);
|
|
105
109
|
process.stdin.setRawMode(true);
|
|
106
110
|
const keypressHandler = createKeyboardHandler(mask, child, options);
|
|
107
111
|
process.stdin.on("keypress", keypressHandler);
|
|
@@ -194,7 +198,7 @@ async function runWithMask(command, args = [], options = {}) {
|
|
|
194
198
|
toggleText = "to see output",
|
|
195
199
|
...spawnOptions
|
|
196
200
|
} = options;
|
|
197
|
-
const child = (
|
|
201
|
+
const child = (/* @__PURE__ */ getChildProcess()).spawn(command, args, {
|
|
198
202
|
stdio: ["inherit", "pipe", "pipe"],
|
|
199
203
|
...spawnOptions
|
|
200
204
|
});
|
package/dist/themes/context.js
CHANGED
|
@@ -26,9 +26,17 @@ __export(context_exports, {
|
|
|
26
26
|
withThemeSync: () => withThemeSync
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(context_exports);
|
|
29
|
-
var import_node_async_hooks = require("node:async_hooks");
|
|
30
29
|
var import_themes = require("./themes");
|
|
31
|
-
|
|
30
|
+
let _async_hooks;
|
|
31
|
+
// @__NO_SIDE_EFFECTS__
|
|
32
|
+
function getAsyncHooks() {
|
|
33
|
+
if (_async_hooks === void 0) {
|
|
34
|
+
_async_hooks = require("async_hooks");
|
|
35
|
+
}
|
|
36
|
+
return _async_hooks;
|
|
37
|
+
}
|
|
38
|
+
const { AsyncLocalStorage } = /* @__PURE__ */ getAsyncHooks();
|
|
39
|
+
const themeStorage = new AsyncLocalStorage();
|
|
32
40
|
let fallbackTheme = import_themes.SOCKET_THEME;
|
|
33
41
|
const listeners = /* @__PURE__ */ new Set();
|
|
34
42
|
function setTheme(theme) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"packageManager": "pnpm@10.27.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
723
723
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
724
724
|
"@socketregistry/yocto-spinner": "1.0.25",
|
|
725
|
-
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.2.
|
|
725
|
+
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.2.1",
|
|
726
726
|
"@types/node": "24.9.2",
|
|
727
727
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
|
728
728
|
"@vitest/coverage-v8": "4.0.3",
|
|
@@ -787,6 +787,7 @@
|
|
|
787
787
|
"@sigstore/sign": "4.1.0",
|
|
788
788
|
"ansi-regex": "6.2.2",
|
|
789
789
|
"lru-cache": "11.2.2",
|
|
790
|
+
"picomatch": "4.0.3",
|
|
790
791
|
"semver": "7.7.2",
|
|
791
792
|
"string-width": "8.1.0",
|
|
792
793
|
"strip-ansi": "7.1.2",
|