@socketsecurity/lib 3.5.0 → 4.0.1
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 +13 -0
- package/README.md +8 -8
- package/dist/agent.js +12 -25
- package/dist/bin.d.ts +97 -40
- package/dist/bin.js +133 -138
- package/dist/cacache.d.ts +5 -2
- package/dist/cacache.js +29 -18
- package/dist/cache-with-ttl.js +1 -1
- package/dist/constants/agents.d.ts +0 -4
- package/dist/constants/agents.js +13 -4
- package/dist/constants/node.d.ts +1 -0
- package/dist/constants/node.js +2 -5
- package/dist/constants/packages.js +23 -11
- package/dist/constants/process.d.ts +1 -1
- package/dist/constants/process.js +2 -2
- package/dist/debug.js +3 -3
- package/dist/dlx-binary.js +10 -18
- package/dist/dlx-manifest.js +2 -2
- package/dist/dlx-package.js +22 -62
- package/dist/dlx.js +14 -14
- package/dist/effects/text-shimmer.js +1 -1
- package/dist/env/ci.js +2 -2
- package/dist/env/debug.js +1 -1
- package/dist/env/github.js +1 -1
- package/dist/env/home.js +1 -1
- package/dist/env/locale.js +1 -1
- package/dist/env/node-auth-token.js +1 -1
- package/dist/env/node-env.js +1 -1
- package/dist/env/npm.js +1 -1
- package/dist/env/package-manager.js +1 -1
- package/dist/env/path.js +1 -1
- package/dist/env/pre-commit.js +2 -2
- package/dist/env/rewire.d.ts +7 -7
- package/dist/env/rewire.js +1 -1
- package/dist/env/shell.js +1 -1
- package/dist/env/socket-cli-shadow.js +2 -2
- package/dist/env/socket-cli.js +2 -2
- package/dist/env/socket.js +2 -2
- package/dist/env/temp-dir.js +1 -1
- package/dist/env/term.js +1 -1
- package/dist/env/test.js +3 -3
- package/dist/env/windows.js +1 -1
- package/dist/env/xdg.js +1 -1
- package/dist/fs.js +20 -25
- package/dist/git.d.ts +6 -6
- package/dist/git.js +11 -14
- package/dist/github.js +2 -2
- package/dist/globs.js +16 -29
- package/dist/ipc.d.ts +4 -4
- package/dist/ipc.js +3 -3
- package/dist/logger.d.ts +0 -25
- package/dist/logger.js +0 -26
- package/dist/objects.js +1 -1
- package/dist/package-default-node-range.js +13 -3
- package/dist/package-extensions.d.ts +2 -1
- package/dist/package-extensions.js +12 -2
- package/dist/packages/editable.d.ts +0 -3
- package/dist/packages/editable.js +34 -24
- package/dist/packages/exports.js +1 -1
- package/dist/packages/isolation.js +33 -33
- package/dist/packages/licenses.js +20 -34
- package/dist/packages/manifest.js +21 -36
- package/dist/packages/normalize.js +20 -52
- package/dist/packages/operations.js +39 -103
- package/dist/packages/provenance.js +15 -5
- package/dist/packages/specs.js +13 -12
- package/dist/packages/validation.js +12 -10
- package/dist/packages.d.ts +2 -2
- package/dist/packages.js +3 -3
- package/dist/paths/dirnames.d.ts +13 -0
- package/dist/paths/dirnames.js +50 -0
- package/dist/paths/exts.d.ts +18 -0
- package/dist/paths/exts.js +68 -0
- package/dist/paths/filenames.d.ts +16 -0
- package/dist/paths/filenames.js +62 -0
- package/dist/paths/globs.d.ts +10 -0
- package/dist/{argv/quote.js → paths/globs.js} +21 -19
- package/dist/{path.d.ts → paths/normalize.d.ts} +41 -0
- package/dist/{path.js → paths/normalize.js} +18 -5
- package/dist/{packages/paths.js → paths/packages.js} +8 -8
- package/dist/paths/rewire.d.ts +1 -1
- package/dist/{paths.js → paths/socket.js} +31 -67
- package/dist/promises.js +2 -2
- package/dist/sea.js +2 -2
- package/dist/shadow.js +3 -3
- package/dist/sorts.js +12 -2
- package/dist/spawn.d.ts +15 -12
- package/dist/spawn.js +43 -31
- package/dist/spinner.d.ts +2 -6
- package/dist/spinner.js +9 -41
- package/dist/stdio/prompts.d.ts +8 -10
- package/dist/stdio/prompts.js +15 -13
- package/dist/streams.d.ts +0 -4
- package/dist/streams.js +3 -12
- package/dist/temporary-executor.js +4 -4
- package/dist/versions.js +31 -28
- package/package.json +28 -29
- package/dist/argv/quote.d.ts +0 -49
- package/dist/constants/paths.d.ts +0 -51
- package/dist/constants/paths.js +0 -152
- /package/dist/{packages/paths.d.ts → paths/packages.d.ts} +0 -0
- /package/dist/{paths.d.ts → paths/socket.d.ts} +0 -0
package/dist/sorts.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 sorts_exports = {};
|
|
21
31
|
__export(sorts_exports, {
|
|
@@ -26,6 +36,8 @@ __export(sorts_exports, {
|
|
|
26
36
|
naturalSorter: () => naturalSorter
|
|
27
37
|
});
|
|
28
38
|
module.exports = __toCommonJS(sorts_exports);
|
|
39
|
+
var fastSort = __toESM(require("./external/fast-sort.js"));
|
|
40
|
+
var semver = __toESM(require("./external/semver.js"));
|
|
29
41
|
let _localeCompare;
|
|
30
42
|
// @__NO_SIDE_EFFECTS__
|
|
31
43
|
function localeCompare(x, y) {
|
|
@@ -59,7 +71,6 @@ let _naturalSorter;
|
|
|
59
71
|
// @__NO_SIDE_EFFECTS__
|
|
60
72
|
function naturalSorter(arrayToSort) {
|
|
61
73
|
if (_naturalSorter === void 0) {
|
|
62
|
-
const fastSort = require("./external/fast-sort.js");
|
|
63
74
|
_naturalSorter = fastSort.createNewSortInstance({
|
|
64
75
|
comparer: naturalCompare
|
|
65
76
|
});
|
|
@@ -72,7 +83,6 @@ function compareStr(a, b) {
|
|
|
72
83
|
}
|
|
73
84
|
// @__NO_SIDE_EFFECTS__
|
|
74
85
|
function compareSemver(a, b) {
|
|
75
|
-
const semver = require("./external/semver.js");
|
|
76
86
|
const validA = semver.valid(a);
|
|
77
87
|
const validB = semver.valid(b);
|
|
78
88
|
if (!validA && !validB) {
|
package/dist/spawn.d.ts
CHANGED
|
@@ -4,25 +4,27 @@ type BufferEncoding = globalThis.BufferEncoding;
|
|
|
4
4
|
* Options for spawning a child process with promise-based completion.
|
|
5
5
|
*
|
|
6
6
|
* @property {string | undefined} cwd - Current working directory for the process
|
|
7
|
-
* @property {boolean | undefined} stdioString - Convert stdio output to strings (default: `true`)
|
|
8
|
-
* @property {StdioType | undefined} stdio - Stdio configuration (`'pipe'`, `'ignore'`, `'inherit'`, or array)
|
|
9
7
|
* @property {NodeJS.ProcessEnv | undefined} env - Environment variables for the process
|
|
8
|
+
* @property {number | undefined} gid - Group identity of the process (POSIX only)
|
|
10
9
|
* @property {boolean | string | undefined} shell - Whether to run command in shell, or path to shell
|
|
11
10
|
* @property {AbortSignal | undefined} signal - Signal to abort the process
|
|
11
|
+
* @property {StdioType | undefined} stdio - Stdio configuration (`'pipe'`, `'ignore'`, `'inherit'`, or array)
|
|
12
|
+
* @property {boolean | undefined} stdioString - Convert stdio output to strings (default: `true`)
|
|
12
13
|
* @property {number | undefined} timeout - Maximum time in milliseconds before killing the process
|
|
13
14
|
* @property {number | undefined} uid - User identity of the process (POSIX only)
|
|
14
|
-
* @property {
|
|
15
|
+
* @property {boolean | undefined} windowsVerbatimArguments - Don't quote or escape arguments on Windows (requires shell: true). Use when you need exact argument control. Default: false
|
|
15
16
|
*/
|
|
16
17
|
export type PromiseSpawnOptions = {
|
|
17
18
|
cwd?: string | undefined;
|
|
18
|
-
stdioString?: boolean | undefined;
|
|
19
|
-
stdio?: StdioType | undefined;
|
|
20
19
|
env?: NodeJS.ProcessEnv | undefined;
|
|
20
|
+
gid?: number | undefined;
|
|
21
21
|
shell?: boolean | string | undefined;
|
|
22
22
|
signal?: AbortSignal | undefined;
|
|
23
|
+
stdio?: StdioType | undefined;
|
|
24
|
+
stdioString?: boolean | undefined;
|
|
23
25
|
timeout?: number | undefined;
|
|
24
26
|
uid?: number | undefined;
|
|
25
|
-
|
|
27
|
+
windowsVerbatimArguments?: boolean | undefined;
|
|
26
28
|
};
|
|
27
29
|
/**
|
|
28
30
|
* Result returned by {@link spawn} when the child process completes.
|
|
@@ -266,17 +268,18 @@ interface WritableStreamType {
|
|
|
266
268
|
* Options for spawning a child process with {@link spawn}.
|
|
267
269
|
* Extends Node.js spawn options with additional Socket-specific functionality.
|
|
268
270
|
*
|
|
269
|
-
* @property {import('./spinner').Spinner | undefined} spinner - Spinner instance to pause during execution
|
|
270
|
-
* @property {boolean | undefined} stdioString - Convert output to strings (default: `true`)
|
|
271
|
-
* @property {boolean | undefined} stripAnsi - Remove ANSI codes from output (default: `true`)
|
|
272
271
|
* @property {string | URL | undefined} cwd - Current working directory
|
|
273
272
|
* @property {NodeJS.ProcessEnv | undefined} env - Environment variables
|
|
274
|
-
* @property {
|
|
273
|
+
* @property {number | undefined} gid - Group identity (POSIX)
|
|
275
274
|
* @property {boolean | string | undefined} shell - Run command in shell
|
|
276
|
-
* @property {number | undefined} timeout - Timeout in milliseconds
|
|
277
275
|
* @property {AbortSignal | undefined} signal - Abort signal
|
|
276
|
+
* @property {import('./spinner').Spinner | undefined} spinner - Spinner instance to pause during execution
|
|
277
|
+
* @property {StdioType | undefined} stdio - Stdio configuration
|
|
278
|
+
* @property {boolean | undefined} stdioString - Convert output to strings (default: `true`)
|
|
279
|
+
* @property {boolean | undefined} stripAnsi - Remove ANSI codes from output (default: `true`)
|
|
280
|
+
* @property {number | undefined} timeout - Timeout in milliseconds
|
|
278
281
|
* @property {number | undefined} uid - User identity (POSIX)
|
|
279
|
-
* @property {
|
|
282
|
+
* @property {boolean | undefined} windowsVerbatimArguments - Don't quote or escape arguments on Windows (requires shell: true). Use when you need exact argument control. Default: false
|
|
280
283
|
*/
|
|
281
284
|
export type SpawnOptions = import('./objects').Remap<NodeSpawnOptions & {
|
|
282
285
|
spinner?: import('./spinner').Spinner | undefined;
|
package/dist/spawn.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 spawn_exports = {};
|
|
21
31
|
__export(spawn_exports, {
|
|
@@ -25,8 +35,12 @@ __export(spawn_exports, {
|
|
|
25
35
|
spawnSync: () => spawnSync
|
|
26
36
|
});
|
|
27
37
|
module.exports = __toCommonJS(spawn_exports);
|
|
28
|
-
var import_process = require("
|
|
38
|
+
var import_process = require("./constants/process");
|
|
39
|
+
var import_promise_spawn = __toESM(require("./external/@npmcli/promise-spawn"));
|
|
40
|
+
var import_node_path = __toESM(require("node:path"));
|
|
29
41
|
var import_arrays = require("./arrays");
|
|
42
|
+
var import_bin = require("./bin");
|
|
43
|
+
var import_normalize = require("./paths/normalize");
|
|
30
44
|
var import_objects = require("./objects");
|
|
31
45
|
var import_strings = require("./strings");
|
|
32
46
|
const abortSignal = (0, import_process.getAbortSignal)();
|
|
@@ -40,22 +54,6 @@ function getChildProcess() {
|
|
|
40
54
|
}
|
|
41
55
|
return _child_process;
|
|
42
56
|
}
|
|
43
|
-
let _npmCliPromiseSpawn;
|
|
44
|
-
// @__NO_SIDE_EFFECTS__
|
|
45
|
-
function getNpmcliPromiseSpawn() {
|
|
46
|
-
if (_npmCliPromiseSpawn === void 0) {
|
|
47
|
-
_npmCliPromiseSpawn = require("./external/@npmcli/promise-spawn.js");
|
|
48
|
-
}
|
|
49
|
-
return _npmCliPromiseSpawn;
|
|
50
|
-
}
|
|
51
|
-
let _path;
|
|
52
|
-
// @__NO_SIDE_EFFECTS__
|
|
53
|
-
function getPath() {
|
|
54
|
-
if (_path === void 0) {
|
|
55
|
-
_path = require("node:path");
|
|
56
|
-
}
|
|
57
|
-
return _path;
|
|
58
|
-
}
|
|
59
57
|
// @__NO_SIDE_EFFECTS__
|
|
60
58
|
function isSpawnError(value) {
|
|
61
59
|
if (value === null || typeof value !== "object") {
|
|
@@ -85,27 +83,32 @@ function stripAnsiFromSpawnResult(result) {
|
|
|
85
83
|
return res;
|
|
86
84
|
}
|
|
87
85
|
function spawn(cmd, args, options, extra) {
|
|
88
|
-
const shell = (0, import_objects.getOwn)(options, "shell");
|
|
89
|
-
const WIN32 = process.platform === "win32";
|
|
90
|
-
let actualCmd = cmd;
|
|
91
|
-
if (WIN32 && shell && windowsScriptExtRegExp.test(actualCmd)) {
|
|
92
|
-
const path = /* @__PURE__ */ getPath();
|
|
93
|
-
actualCmd = path.basename(actualCmd, path.extname(actualCmd));
|
|
94
|
-
}
|
|
95
86
|
const {
|
|
96
87
|
spinner: optionsSpinner = spinner,
|
|
97
88
|
stripAnsi: shouldStripAnsi = true,
|
|
98
|
-
...
|
|
89
|
+
...rawSpawnOptions
|
|
99
90
|
} = { __proto__: null, ...options };
|
|
100
91
|
const spinnerInstance = optionsSpinner;
|
|
101
|
-
const {
|
|
92
|
+
const spawnOptions = { __proto__: null, ...rawSpawnOptions };
|
|
93
|
+
const { env, shell, stdio, stdioString = true } = spawnOptions;
|
|
94
|
+
const cwd = spawnOptions.cwd ? String(spawnOptions.cwd) : void 0;
|
|
95
|
+
let actualCmd = cmd;
|
|
96
|
+
if (!(0, import_normalize.isPath)(cmd)) {
|
|
97
|
+
const resolved = (0, import_bin.whichSync)(cmd, { cwd, nothrow: true });
|
|
98
|
+
if (resolved && typeof resolved === "string") {
|
|
99
|
+
actualCmd = resolved;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const WIN32 = process.platform === "win32";
|
|
103
|
+
if (WIN32 && shell && windowsScriptExtRegExp.test(actualCmd)) {
|
|
104
|
+
actualCmd = import_node_path.default.basename(actualCmd, import_node_path.default.extname(actualCmd));
|
|
105
|
+
}
|
|
102
106
|
const wasSpinning = !!spinnerInstance?.isSpinning;
|
|
103
107
|
const shouldStopSpinner = wasSpinning && !/* @__PURE__ */ isStdioType(stdio, "ignore") && !/* @__PURE__ */ isStdioType(stdio, "pipe");
|
|
104
108
|
const shouldRestartSpinner = shouldStopSpinner;
|
|
105
109
|
if (shouldStopSpinner) {
|
|
106
110
|
spinnerInstance.stop();
|
|
107
111
|
}
|
|
108
|
-
const npmCliPromiseSpawn = /* @__PURE__ */ getNpmcliPromiseSpawn();
|
|
109
112
|
const envToUse = env ? {
|
|
110
113
|
__proto__: null,
|
|
111
114
|
...process.env,
|
|
@@ -119,11 +122,12 @@ function spawn(cmd, args, options, extra) {
|
|
|
119
122
|
stdio: spawnOptions.stdio,
|
|
120
123
|
stdioString,
|
|
121
124
|
shell: spawnOptions.shell,
|
|
125
|
+
windowsVerbatimArguments: spawnOptions.windowsVerbatimArguments,
|
|
122
126
|
timeout: spawnOptions.timeout,
|
|
123
127
|
uid: spawnOptions.uid,
|
|
124
128
|
gid: spawnOptions.gid
|
|
125
129
|
};
|
|
126
|
-
const spawnPromise =
|
|
130
|
+
const spawnPromise = (0, import_promise_spawn.default)(
|
|
127
131
|
actualCmd,
|
|
128
132
|
args ? [...args] : [],
|
|
129
133
|
promiseSpawnOpts,
|
|
@@ -163,12 +167,20 @@ function spawn(cmd, args, options, extra) {
|
|
|
163
167
|
return newSpawnPromise;
|
|
164
168
|
}
|
|
165
169
|
function spawnSync(cmd, args, options) {
|
|
170
|
+
let actualCmd = cmd;
|
|
171
|
+
if (!(0, import_normalize.isPath)(cmd)) {
|
|
172
|
+
const resolved = (0, import_bin.whichSync)(cmd, {
|
|
173
|
+
cwd: (0, import_objects.getOwn)(options, "cwd"),
|
|
174
|
+
nothrow: true
|
|
175
|
+
});
|
|
176
|
+
if (resolved && typeof resolved === "string") {
|
|
177
|
+
actualCmd = resolved;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
166
180
|
const shell = (0, import_objects.getOwn)(options, "shell");
|
|
167
181
|
const WIN32 = process.platform === "win32";
|
|
168
|
-
let actualCmd = cmd;
|
|
169
182
|
if (WIN32 && shell && windowsScriptExtRegExp.test(actualCmd)) {
|
|
170
|
-
|
|
171
|
-
actualCmd = path.basename(actualCmd, path.extname(actualCmd));
|
|
183
|
+
actualCmd = import_node_path.default.basename(actualCmd, import_node_path.default.extname(actualCmd));
|
|
172
184
|
}
|
|
173
185
|
const { stripAnsi: shouldStripAnsi = true, ...rawSpawnOptions } = {
|
|
174
186
|
__proto__: null,
|
package/dist/spinner.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ import type { ColorInherit, ColorRgb, ColorValue } from './colors';
|
|
|
7
7
|
import type { ShimmerColorGradient, ShimmerConfig, ShimmerDirection, ShimmerState } from './effects/text-shimmer';
|
|
8
8
|
/**
|
|
9
9
|
* Symbol types for status messages.
|
|
10
|
-
* Maps to log symbols: fail (✗), info (ℹ),
|
|
10
|
+
* Maps to log symbols: fail (✗), info (ℹ), skip (↻), success (✓), warn (⚠).
|
|
11
11
|
*/
|
|
12
|
-
export type SymbolType = 'fail' | 'info' | '
|
|
12
|
+
export type SymbolType = 'fail' | 'info' | 'skip' | 'success' | 'warn';
|
|
13
13
|
/**
|
|
14
14
|
* Progress tracking information for display in spinner.
|
|
15
15
|
* Used by `progress()` and `progressStep()` methods to show animated progress bars.
|
|
@@ -101,10 +101,6 @@ export type Spinner = {
|
|
|
101
101
|
progress(current: number, total: number, unit?: string | undefined): Spinner;
|
|
102
102
|
/** Increment progress by specified amount (default: 1) */
|
|
103
103
|
progressStep(amount?: number): Spinner;
|
|
104
|
-
/** Show reasoning (∴) message without stopping the spinner */
|
|
105
|
-
reason(text?: string | undefined, ...extras: unknown[]): Spinner;
|
|
106
|
-
/** Show reasoning (∴) message and stop the spinner, auto-clearing the line */
|
|
107
|
-
reasonAndStop(text?: string | undefined, ...extras: unknown[]): Spinner;
|
|
108
104
|
/** Set complete shimmer configuration */
|
|
109
105
|
setShimmer(config: ShimmerConfig): Spinner;
|
|
110
106
|
/** Show skip (↻) message without stopping the spinner */
|
package/dist/spinner.js
CHANGED
|
@@ -38,8 +38,10 @@ __export(spinner_exports, {
|
|
|
38
38
|
withSpinnerSync: () => withSpinnerSync
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(spinner_exports);
|
|
41
|
+
var import_yoctocolors_cjs = __toESM(require("./external/yoctocolors-cjs"));
|
|
41
42
|
var import_colors = require("./colors");
|
|
42
|
-
var
|
|
43
|
+
var import_process = require("./constants/process");
|
|
44
|
+
var import_ci = require("./env/ci");
|
|
43
45
|
var import_debug = require("./debug");
|
|
44
46
|
var import_pulse_frames = require("./effects/pulse-frames");
|
|
45
47
|
var import_text_shimmer = require("./effects/text-shimmer");
|
|
@@ -76,8 +78,7 @@ function renderProgressBar(percentage, width = 20) {
|
|
|
76
78
|
const filled = Math.round(percentage / 100 * width);
|
|
77
79
|
const empty = width - filled;
|
|
78
80
|
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
79
|
-
|
|
80
|
-
return colors.cyan(bar);
|
|
81
|
+
return import_yoctocolors_cjs.default.cyan(bar);
|
|
81
82
|
}
|
|
82
83
|
let _cliSpinners;
|
|
83
84
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -169,7 +170,7 @@ function Spinner(options) {
|
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
super({
|
|
172
|
-
signal:
|
|
173
|
+
signal: (0, import_process.getAbortSignal)(),
|
|
173
174
|
...opts,
|
|
174
175
|
// Pass RGB color directly to yocto-spinner (it now supports RGB).
|
|
175
176
|
color: spinnerColorRgb,
|
|
@@ -571,40 +572,6 @@ function Spinner(options) {
|
|
|
571
572
|
}
|
|
572
573
|
return this;
|
|
573
574
|
}
|
|
574
|
-
/**
|
|
575
|
-
* Show a reasoning/working message (∴) without stopping the spinner.
|
|
576
|
-
* Outputs to stderr and continues spinning.
|
|
577
|
-
*
|
|
578
|
-
* @param text - Reasoning message to display
|
|
579
|
-
* @param extras - Additional values to log
|
|
580
|
-
* @returns This spinner for chaining
|
|
581
|
-
*/
|
|
582
|
-
reason(text, ...extras) {
|
|
583
|
-
return this.#showStatusAndKeepSpinning("reason", [text, ...extras]);
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Show a reasoning/working message (∴) and stop the spinner.
|
|
587
|
-
* Auto-clears the spinner line before displaying the message.
|
|
588
|
-
*
|
|
589
|
-
* Implementation note: Unlike other *AndStop methods (successAndStop, failAndStop, etc.),
|
|
590
|
-
* this method cannot use #apply() with a 'reason' method name because yocto-spinner
|
|
591
|
-
* doesn't have a built-in 'reason' method. Instead, we manually stop the spinner then
|
|
592
|
-
* log the message with the reason symbol. This matches the pattern used by methods
|
|
593
|
-
* like debugAndStop() and maintains consistency with normalizeText() usage and empty
|
|
594
|
-
* string handling (see #apply's stop method handling for the pattern).
|
|
595
|
-
*
|
|
596
|
-
* @param text - Reasoning message to display
|
|
597
|
-
* @param extras - Additional values to log
|
|
598
|
-
* @returns This spinner for chaining
|
|
599
|
-
*/
|
|
600
|
-
reasonAndStop(text, ...extras) {
|
|
601
|
-
this.#apply("stop", []);
|
|
602
|
-
const normalized = normalizeText(text);
|
|
603
|
-
if (normalized) {
|
|
604
|
-
logger.error(`${import_logger.LOG_SYMBOLS.reason} ${normalized}`, ...extras);
|
|
605
|
-
}
|
|
606
|
-
return this;
|
|
607
|
-
}
|
|
608
575
|
/**
|
|
609
576
|
* Show a skip message (↻) without stopping the spinner.
|
|
610
577
|
* Outputs to stderr and continues spinning.
|
|
@@ -620,9 +587,10 @@ function Spinner(options) {
|
|
|
620
587
|
* Show a skip message (↻) and stop the spinner.
|
|
621
588
|
* Auto-clears the spinner line before displaying the message.
|
|
622
589
|
*
|
|
623
|
-
* Implementation note:
|
|
624
|
-
* with a 'skip' method name because yocto-spinner doesn't
|
|
625
|
-
* method. Instead, we manually stop the spinner then log the message
|
|
590
|
+
* Implementation note: Unlike other *AndStop methods (successAndStop, failAndStop, etc.),
|
|
591
|
+
* this method cannot use #apply() with a 'skip' method name because yocto-spinner doesn't
|
|
592
|
+
* have a built-in 'skip' method. Instead, we manually stop the spinner then log the message
|
|
593
|
+
* with the skip symbol.
|
|
626
594
|
*
|
|
627
595
|
* @param text - Skip message to display
|
|
628
596
|
* @param extras - Additional values to log
|
package/dist/stdio/prompts.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import checkboxRaw from '../external/@inquirer/checkbox';
|
|
2
|
+
import confirmRaw from '../external/@inquirer/confirm';
|
|
3
|
+
import inputRaw from '../external/@inquirer/input';
|
|
4
|
+
import passwordRaw from '../external/@inquirer/password';
|
|
1
5
|
import { type ThemeName } from '../themes/themes';
|
|
2
6
|
import type { Theme } from '../themes/types';
|
|
7
|
+
// Modules imported at the top - extract default and Separator
|
|
8
|
+
declare const searchRaw: any;
|
|
9
|
+
declare const selectRaw: any;
|
|
10
|
+
declare const ActualSeparator: any;
|
|
3
11
|
// Type definitions
|
|
4
12
|
/**
|
|
5
13
|
* Choice option for select and search prompts.
|
|
@@ -98,16 +106,6 @@ export declare function createInquirerTheme(theme: Theme | ThemeName | unknown):
|
|
|
98
106
|
*/
|
|
99
107
|
/*@__NO_SIDE_EFFECTS__*/
|
|
100
108
|
export declare function wrapPrompt<T = unknown>(inquirerPrompt: (...args: unknown[]) => Promise<T>): (...args: unknown[]) => Promise<T | undefined>;
|
|
101
|
-
// c8 ignore start - Third-party inquirer library requires and exports not testable in isolation.
|
|
102
|
-
declare const checkboxRaw: any;
|
|
103
|
-
declare const confirmRaw: any;
|
|
104
|
-
declare const inputRaw: any;
|
|
105
|
-
declare const passwordRaw: any;
|
|
106
|
-
// Search and select export additional named exports, so we access .default.
|
|
107
|
-
declare const searchRaw: any;
|
|
108
|
-
declare const selectRaw: any;
|
|
109
|
-
declare const ActualSeparator: any;
|
|
110
|
-
// c8 ignore stop
|
|
111
109
|
/**
|
|
112
110
|
* Prompt to select multiple items from a list of choices.
|
|
113
111
|
* Wrapped with spinner handling and abort signal support.
|
package/dist/stdio/prompts.js
CHANGED
|
@@ -41,13 +41,23 @@ __export(prompts_exports, {
|
|
|
41
41
|
wrapPrompt: () => wrapPrompt
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(prompts_exports);
|
|
44
|
-
var import_process = require("
|
|
44
|
+
var import_process = require("../constants/process");
|
|
45
|
+
var import_checkbox = __toESM(require("../external/@inquirer/checkbox"));
|
|
46
|
+
var import_confirm = __toESM(require("../external/@inquirer/confirm"));
|
|
47
|
+
var import_input = __toESM(require("../external/@inquirer/input"));
|
|
48
|
+
var import_password = __toESM(require("../external/@inquirer/password"));
|
|
49
|
+
var searchModule = __toESM(require("../external/@inquirer/search"));
|
|
50
|
+
var selectModuleImport = __toESM(require("../external/@inquirer/select"));
|
|
45
51
|
var import_context = require("../themes/context");
|
|
46
52
|
var import_themes = require("../themes/themes");
|
|
47
53
|
var import_utils = require("../themes/utils");
|
|
48
54
|
var import_yoctocolors_cjs = __toESM(require("../external/yoctocolors-cjs"));
|
|
49
55
|
const abortSignal = (0, import_process.getAbortSignal)();
|
|
50
56
|
const spinner = (0, import_process.getSpinner)();
|
|
57
|
+
const searchRaw = searchModule.default;
|
|
58
|
+
const selectModule = selectModuleImport;
|
|
59
|
+
const selectRaw = selectModule.default;
|
|
60
|
+
const ActualSeparator = selectModule.Separator;
|
|
51
61
|
function applyColor(text, color) {
|
|
52
62
|
if (typeof color === "string") {
|
|
53
63
|
return import_yoctocolors_cjs.default[color](text);
|
|
@@ -141,18 +151,10 @@ function wrapPrompt(inquirerPrompt) {
|
|
|
141
151
|
return typeof result === "string" ? result.trim() : result;
|
|
142
152
|
};
|
|
143
153
|
}
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const searchRaw = require("../external/@inquirer/search").default;
|
|
149
|
-
const selectModule = require("../external/@inquirer/select");
|
|
150
|
-
const selectRaw = selectModule.default;
|
|
151
|
-
const ActualSeparator = selectModule.Separator;
|
|
152
|
-
const checkbox = /* @__PURE__ */ wrapPrompt(checkboxRaw);
|
|
153
|
-
const confirm = /* @__PURE__ */ wrapPrompt(confirmRaw);
|
|
154
|
-
const input = /* @__PURE__ */ wrapPrompt(inputRaw);
|
|
155
|
-
const password = /* @__PURE__ */ wrapPrompt(passwordRaw);
|
|
154
|
+
const checkbox = /* @__PURE__ */ wrapPrompt(import_checkbox.default);
|
|
155
|
+
const confirm = /* @__PURE__ */ wrapPrompt(import_confirm.default);
|
|
156
|
+
const input = /* @__PURE__ */ wrapPrompt(import_input.default);
|
|
157
|
+
const password = /* @__PURE__ */ wrapPrompt(import_password.default);
|
|
156
158
|
const search = /* @__PURE__ */ wrapPrompt(searchRaw);
|
|
157
159
|
const select = /* @__PURE__ */ wrapPrompt(selectRaw);
|
|
158
160
|
function createSeparator(text) {
|
package/dist/streams.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Stream processing utilities with streaming-iterables integration.
|
|
3
|
-
* Provides async stream handling and transformation functions.
|
|
4
|
-
*/
|
|
5
1
|
import type { IterationOptions } from './promises';
|
|
6
2
|
/**
|
|
7
3
|
* Execute a function for each item in an iterable in parallel.
|
package/dist/streams.js
CHANGED
|
@@ -24,15 +24,8 @@ __export(streams_exports, {
|
|
|
24
24
|
transform: () => transform
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(streams_exports);
|
|
27
|
+
var import_streaming_iterables = require("./external/streaming-iterables");
|
|
27
28
|
var import_promises = require("./promises");
|
|
28
|
-
let _streamingIterables;
|
|
29
|
-
// @__NO_SIDE_EFFECTS__
|
|
30
|
-
function getStreamingIterables() {
|
|
31
|
-
if (_streamingIterables === void 0) {
|
|
32
|
-
_streamingIterables = require("./external/streaming-iterables.js");
|
|
33
|
-
}
|
|
34
|
-
return _streamingIterables;
|
|
35
|
-
}
|
|
36
29
|
// @__NO_SIDE_EFFECTS__
|
|
37
30
|
async function parallelEach(iterable, func, options) {
|
|
38
31
|
for await (const _ of /* @__PURE__ */ parallelMap(iterable, func, options)) {
|
|
@@ -40,9 +33,8 @@ async function parallelEach(iterable, func, options) {
|
|
|
40
33
|
}
|
|
41
34
|
// @__NO_SIDE_EFFECTS__
|
|
42
35
|
function parallelMap(iterable, func, options) {
|
|
43
|
-
const streamingIterables = /* @__PURE__ */ getStreamingIterables();
|
|
44
36
|
const opts = (0, import_promises.normalizeIterationOptions)(options);
|
|
45
|
-
const result =
|
|
37
|
+
const result = (0, import_streaming_iterables.parallelMap)(
|
|
46
38
|
opts.concurrency,
|
|
47
39
|
async (item) => {
|
|
48
40
|
const result2 = await (0, import_promises.pRetry)((...args) => func(args[0]), {
|
|
@@ -57,9 +49,8 @@ function parallelMap(iterable, func, options) {
|
|
|
57
49
|
}
|
|
58
50
|
// @__NO_SIDE_EFFECTS__
|
|
59
51
|
function transform(iterable, func, options) {
|
|
60
|
-
const streamingIterables = /* @__PURE__ */ getStreamingIterables();
|
|
61
52
|
const opts = (0, import_promises.normalizeIterationOptions)(options);
|
|
62
|
-
const result =
|
|
53
|
+
const result = (0, import_streaming_iterables.transform)(
|
|
63
54
|
opts.concurrency,
|
|
64
55
|
async (item) => {
|
|
65
56
|
const result2 = await (0, import_promises.pRetry)((...args) => func(args[0]), {
|
|
@@ -22,16 +22,16 @@ __export(temporary_executor_exports, {
|
|
|
22
22
|
isRunningInTemporaryExecutor: () => isRunningInTemporaryExecutor
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(temporary_executor_exports);
|
|
25
|
-
var import_platform = require("
|
|
26
|
-
var
|
|
25
|
+
var import_platform = require("./constants/platform");
|
|
26
|
+
var import_normalize = require("./paths/normalize");
|
|
27
27
|
function isRunningInTemporaryExecutor(cwd = process.cwd()) {
|
|
28
28
|
const userAgent = process.env["npm_config_user_agent"];
|
|
29
29
|
if (userAgent?.includes("exec") || userAgent?.includes("npx") || userAgent?.includes("dlx")) {
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
const normalizedCwd = (0,
|
|
32
|
+
const normalizedCwd = (0, import_normalize.normalizePath)(cwd);
|
|
33
33
|
const npmCache = process.env["npm_config_cache"];
|
|
34
|
-
if (npmCache && normalizedCwd.includes((0,
|
|
34
|
+
if (npmCache && normalizedCwd.includes((0, import_normalize.normalizePath)(npmCache))) {
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
const tempPatterns = [
|
package/dist/versions.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 versions_exports = {};
|
|
21
31
|
__export(versions_exports, {
|
|
@@ -41,69 +51,62 @@ __export(versions_exports, {
|
|
|
41
51
|
versionDiff: () => versionDiff
|
|
42
52
|
});
|
|
43
53
|
module.exports = __toCommonJS(versions_exports);
|
|
44
|
-
|
|
45
|
-
// @__NO_SIDE_EFFECTS__
|
|
46
|
-
function getSemver() {
|
|
47
|
-
if (_semver === void 0) {
|
|
48
|
-
_semver = require("./external/semver.js");
|
|
49
|
-
}
|
|
50
|
-
return _semver;
|
|
51
|
-
}
|
|
54
|
+
var semver = __toESM(require("./external/semver.js"));
|
|
52
55
|
function coerceVersion(version) {
|
|
53
|
-
const coerced =
|
|
56
|
+
const coerced = semver.coerce(version);
|
|
54
57
|
return coerced?.version;
|
|
55
58
|
}
|
|
56
59
|
function compareVersions(v1, v2) {
|
|
57
60
|
try {
|
|
58
|
-
return
|
|
61
|
+
return semver.compare(v1, v2);
|
|
59
62
|
} catch {
|
|
60
63
|
return void 0;
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
function filterVersions(versions, range) {
|
|
64
|
-
return versions.filter((v) =>
|
|
67
|
+
return versions.filter((v) => semver.satisfies(v, range));
|
|
65
68
|
}
|
|
66
69
|
function getMajorVersion(version) {
|
|
67
|
-
const parsed =
|
|
70
|
+
const parsed = semver.parse(version);
|
|
68
71
|
return parsed?.major;
|
|
69
72
|
}
|
|
70
73
|
function getMinorVersion(version) {
|
|
71
|
-
const parsed =
|
|
74
|
+
const parsed = semver.parse(version);
|
|
72
75
|
return parsed?.minor;
|
|
73
76
|
}
|
|
74
77
|
function getPatchVersion(version) {
|
|
75
|
-
const parsed =
|
|
78
|
+
const parsed = semver.parse(version);
|
|
76
79
|
return parsed?.patch;
|
|
77
80
|
}
|
|
78
81
|
function incrementVersion(version, release, identifier) {
|
|
79
|
-
return
|
|
82
|
+
return semver.inc(version, release, identifier) || void 0;
|
|
80
83
|
}
|
|
81
84
|
function isEqual(version1, version2) {
|
|
82
|
-
return
|
|
85
|
+
return semver.eq(version1, version2);
|
|
83
86
|
}
|
|
84
87
|
function isGreaterThan(version1, version2) {
|
|
85
|
-
return
|
|
88
|
+
return semver.gt(version1, version2);
|
|
86
89
|
}
|
|
87
90
|
function isGreaterThanOrEqual(version1, version2) {
|
|
88
|
-
return
|
|
91
|
+
return semver.gte(version1, version2);
|
|
89
92
|
}
|
|
90
93
|
function isLessThan(version1, version2) {
|
|
91
|
-
return
|
|
94
|
+
return semver.lt(version1, version2);
|
|
92
95
|
}
|
|
93
96
|
function isLessThanOrEqual(version1, version2) {
|
|
94
|
-
return
|
|
97
|
+
return semver.lte(version1, version2);
|
|
95
98
|
}
|
|
96
99
|
function isValidVersion(version) {
|
|
97
|
-
return
|
|
100
|
+
return semver.valid(version) !== null;
|
|
98
101
|
}
|
|
99
102
|
function maxVersion(versions) {
|
|
100
|
-
return
|
|
103
|
+
return semver.maxSatisfying(versions, "*") || void 0;
|
|
101
104
|
}
|
|
102
105
|
function minVersion(versions) {
|
|
103
|
-
return
|
|
106
|
+
return semver.minSatisfying(versions, "*") || void 0;
|
|
104
107
|
}
|
|
105
108
|
function parseVersion(version) {
|
|
106
|
-
const parsed =
|
|
109
|
+
const parsed = semver.parse(version);
|
|
107
110
|
if (!parsed) {
|
|
108
111
|
return void 0;
|
|
109
112
|
}
|
|
@@ -116,17 +119,17 @@ function parseVersion(version) {
|
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
function satisfiesVersion(version, range) {
|
|
119
|
-
return
|
|
122
|
+
return semver.satisfies(version, range);
|
|
120
123
|
}
|
|
121
124
|
function sortVersions(versions) {
|
|
122
|
-
return
|
|
125
|
+
return semver.sort([...versions]);
|
|
123
126
|
}
|
|
124
127
|
function sortVersionsDesc(versions) {
|
|
125
|
-
return
|
|
128
|
+
return semver.rsort([...versions]);
|
|
126
129
|
}
|
|
127
130
|
function versionDiff(version1, version2) {
|
|
128
131
|
try {
|
|
129
|
-
return
|
|
132
|
+
return semver.diff(version1, version2) || void 0;
|
|
130
133
|
} catch {
|
|
131
134
|
return void 0;
|
|
132
135
|
}
|