@socketsecurity/lib 1.0.0 → 1.0.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 +12 -0
- package/dist/agent.js +8 -8
- package/dist/bin.js +3 -3
- package/dist/cacache.js +1 -1
- package/dist/dlx-binary.js +2 -2
- package/dist/fs.js +2 -2
- package/dist/globs.js +5 -5
- package/dist/index.js +1 -1
- package/dist/logger.js +1 -1
- package/dist/logger.js.map +2 -2
- package/dist/packages/normalize.js +2 -2
- package/dist/packages/normalize.js.map +2 -2
- package/dist/path.js +2 -2
- package/dist/spawn.js +1 -1
- package/dist/spinner.js +1 -1
- package/dist/streams.js +1 -1
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ 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
|
+
## [1.0.2] - 2025-10-21
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fixed module resolution error in packages/normalize module (corrected require path from `../../constants/socket` to `../constants/socket`)
|
|
13
|
+
|
|
14
|
+
## [1.0.1] - 2025-10-21
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Fixed relative import paths in compiled CommonJS output (changed `require("../external/...")` to `require("./external/...")` for root-level dist files)
|
|
19
|
+
|
|
8
20
|
## [1.0.0] - 2025-10-20
|
|
9
21
|
|
|
10
22
|
### Changed
|
package/dist/agent.js
CHANGED
|
@@ -85,7 +85,7 @@ function execNpm(args, options) {
|
|
|
85
85
|
// one level quieter.
|
|
86
86
|
useDebug || npmArgs.some(isNpmLoglevelFlag) ? [] : ["--loglevel", "warn"]
|
|
87
87
|
);
|
|
88
|
-
const npmBin = require("
|
|
88
|
+
const npmBin = require("./constants/agents").NPM_BIN_PATH;
|
|
89
89
|
return (0, import_spawn.spawn)(
|
|
90
90
|
npmBin,
|
|
91
91
|
[
|
|
@@ -227,11 +227,11 @@ function execScript(scriptName, args, options) {
|
|
|
227
227
|
if (spawnOptions.shell === true) {
|
|
228
228
|
return (0, import_spawn.spawn)(scriptName, resolvedArgs, spawnOptions);
|
|
229
229
|
}
|
|
230
|
-
const useNodeRun = !prepost && require("
|
|
230
|
+
const useNodeRun = !prepost && require("./constants/node").SUPPORTS_NODE_RUN;
|
|
231
231
|
const cwd = (0, import_objects.getOwn)(spawnOptions, "cwd") ?? process.cwd();
|
|
232
232
|
const pnpmLockPath = (0, import_fs.findUpSync)(
|
|
233
233
|
/*@__INLINE__*/
|
|
234
|
-
require("
|
|
234
|
+
require("./constants/agents").PNPM_LOCK_YAML,
|
|
235
235
|
{ cwd }
|
|
236
236
|
);
|
|
237
237
|
if (pnpmLockPath) {
|
|
@@ -239,7 +239,7 @@ function execScript(scriptName, args, options) {
|
|
|
239
239
|
}
|
|
240
240
|
const packageLockPath = (0, import_fs.findUpSync)(
|
|
241
241
|
/*@__INLINE__*/
|
|
242
|
-
require("
|
|
242
|
+
require("./constants/agents").PACKAGE_LOCK_JSON,
|
|
243
243
|
{ cwd }
|
|
244
244
|
);
|
|
245
245
|
if (packageLockPath) {
|
|
@@ -247,18 +247,18 @@ function execScript(scriptName, args, options) {
|
|
|
247
247
|
}
|
|
248
248
|
const yarnLockPath = (0, import_fs.findUpSync)(
|
|
249
249
|
/*@__INLINE__*/
|
|
250
|
-
require("
|
|
250
|
+
require("./constants/agents").YARN_LOCK,
|
|
251
251
|
{ cwd }
|
|
252
252
|
);
|
|
253
253
|
if (yarnLockPath) {
|
|
254
254
|
return /* @__PURE__ */ execYarn(["run", scriptName, ...resolvedArgs], spawnOptions);
|
|
255
255
|
}
|
|
256
256
|
return (0, import_spawn.spawn)(
|
|
257
|
-
/* @__PURE__ */ require("
|
|
257
|
+
/* @__PURE__ */ require("./constants/node").getExecPath(),
|
|
258
258
|
[
|
|
259
|
-
.../* @__PURE__ */ require("
|
|
259
|
+
.../* @__PURE__ */ require("./constants/node").getNodeNoWarningsFlags(),
|
|
260
260
|
...useNodeRun ? ["--run"] : [
|
|
261
|
-
require("
|
|
261
|
+
require("./constants/agents").NPM_REAL_EXEC_PATH,
|
|
262
262
|
"run"
|
|
263
263
|
],
|
|
264
264
|
scriptName,
|
package/dist/bin.js
CHANGED
|
@@ -57,7 +57,7 @@ let _which;
|
|
|
57
57
|
// @__NO_SIDE_EFFECTS__
|
|
58
58
|
function getWhich() {
|
|
59
59
|
if (_which === void 0) {
|
|
60
|
-
_which = require("
|
|
60
|
+
_which = require("./external/which");
|
|
61
61
|
}
|
|
62
62
|
return _which;
|
|
63
63
|
}
|
|
@@ -153,7 +153,7 @@ function findRealNpm() {
|
|
|
153
153
|
return "npm";
|
|
154
154
|
}
|
|
155
155
|
function findRealPnpm() {
|
|
156
|
-
const WIN32 = require("
|
|
156
|
+
const WIN32 = require("./constants/platform").WIN32;
|
|
157
157
|
const path = /* @__PURE__ */ getPath();
|
|
158
158
|
const commonPaths = WIN32 ? [
|
|
159
159
|
// Windows common paths.
|
|
@@ -263,7 +263,7 @@ function resolveBinPathSync(binPath) {
|
|
|
263
263
|
return voltaBinPath;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
const WIN32 = require("
|
|
266
|
+
const WIN32 = require("./constants/platform").WIN32;
|
|
267
267
|
if (WIN32) {
|
|
268
268
|
const hasKnownExt = extLowered === "" || extLowered === ".cmd" || extLowered === ".exe" || extLowered === ".ps1";
|
|
269
269
|
const isNpmOrNpx = basename === "npm" || basename === "npx";
|
package/dist/cacache.js
CHANGED
|
@@ -28,7 +28,7 @@ __export(cacache_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(cacache_exports);
|
|
29
29
|
var import_paths = require("./paths");
|
|
30
30
|
function getCacache() {
|
|
31
|
-
return require("
|
|
31
|
+
return require("./external/cacache");
|
|
32
32
|
}
|
|
33
33
|
function patternToRegex(pattern) {
|
|
34
34
|
const escaped = pattern.replaceAll(/[.+?^${}()|[\]\\]/g, "\\$&");
|
package/dist/dlx-binary.js
CHANGED
|
@@ -115,7 +115,7 @@ async function writeMetadata(cacheEntryPath, url, checksum) {
|
|
|
115
115
|
}
|
|
116
116
|
async function cleanDlxCache(maxAge = (
|
|
117
117
|
/*@__INLINE__*/
|
|
118
|
-
require("
|
|
118
|
+
require("./constants/time").DLX_BINARY_CACHE_TTL
|
|
119
119
|
)) {
|
|
120
120
|
const cacheDir = getDlxCachePath();
|
|
121
121
|
if (!(0, import_node_fs.existsSync)(cacheDir)) {
|
|
@@ -157,7 +157,7 @@ async function dlxBinary(args, options, spawnExtra) {
|
|
|
157
157
|
const {
|
|
158
158
|
cacheTtl = (
|
|
159
159
|
/*@__INLINE__*/
|
|
160
|
-
require("
|
|
160
|
+
require("./constants/time").DLX_BINARY_CACHE_TTL
|
|
161
161
|
),
|
|
162
162
|
checksum,
|
|
163
163
|
force = false,
|
package/dist/fs.js
CHANGED
|
@@ -379,7 +379,7 @@ function readJsonSync(filepath, options) {
|
|
|
379
379
|
}
|
|
380
380
|
// @__NO_SIDE_EFFECTS__
|
|
381
381
|
async function safeDelete(filepath, options) {
|
|
382
|
-
const del = require("
|
|
382
|
+
const del = require("./external/del");
|
|
383
383
|
const { deleteAsync } = del;
|
|
384
384
|
const opts = { __proto__: null, ...options };
|
|
385
385
|
const patterns = (0, import_arrays.isArray)(filepath) ? filepath.map(import_path.pathLikeToString) : [(0, import_path.pathLikeToString)(filepath)];
|
|
@@ -426,7 +426,7 @@ async function safeDelete(filepath, options) {
|
|
|
426
426
|
}
|
|
427
427
|
// @__NO_SIDE_EFFECTS__
|
|
428
428
|
function safeDeleteSync(filepath, options) {
|
|
429
|
-
const del = require("
|
|
429
|
+
const del = require("./external/del");
|
|
430
430
|
const { deleteSync } = del;
|
|
431
431
|
const opts = { __proto__: null, ...options };
|
|
432
432
|
const patterns = (0, import_arrays.isArray)(filepath) ? filepath.map(import_path.pathLikeToString) : [(0, import_path.pathLikeToString)(filepath)];
|
package/dist/globs.js
CHANGED
|
@@ -68,7 +68,7 @@ let _picomatch;
|
|
|
68
68
|
// @__NO_SIDE_EFFECTS__
|
|
69
69
|
function getPicomatch() {
|
|
70
70
|
if (_picomatch === void 0) {
|
|
71
|
-
_picomatch = require("
|
|
71
|
+
_picomatch = require("./external/picomatch");
|
|
72
72
|
}
|
|
73
73
|
return _picomatch;
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ let _fastGlob;
|
|
|
76
76
|
// @__NO_SIDE_EFFECTS__
|
|
77
77
|
function getFastGlob() {
|
|
78
78
|
if (_fastGlob === void 0) {
|
|
79
|
-
const globExport = require("
|
|
79
|
+
const globExport = require("./external/fast-glob");
|
|
80
80
|
_fastGlob = globExport.default || globExport;
|
|
81
81
|
}
|
|
82
82
|
return _fastGlob;
|
|
@@ -96,7 +96,7 @@ function globStreamLicenses(dirname, options) {
|
|
|
96
96
|
if (ignoreOriginals) {
|
|
97
97
|
ignore.push(
|
|
98
98
|
/*@__INLINE__*/
|
|
99
|
-
require("
|
|
99
|
+
require("./constants/paths").LICENSE_ORIGINAL_GLOB_RECURSIVE
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
const fastGlob = /* @__PURE__ */ getFastGlob();
|
|
@@ -104,10 +104,10 @@ function globStreamLicenses(dirname, options) {
|
|
|
104
104
|
[
|
|
105
105
|
recursive ? (
|
|
106
106
|
/*@__INLINE__*/
|
|
107
|
-
require("
|
|
107
|
+
require("./constants/paths").LICENSE_GLOB_RECURSIVE
|
|
108
108
|
) : (
|
|
109
109
|
/*@__INLINE__*/
|
|
110
|
-
require("
|
|
110
|
+
require("./constants/paths").LICENSE_GLOB
|
|
111
111
|
)
|
|
112
112
|
],
|
|
113
113
|
{
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var import_registry = require("./packages/registry");
|
|
|
29
29
|
__reExport(index_exports, require("./types"), module.exports);
|
|
30
30
|
function getManifestData(ecosystem, packageName) {
|
|
31
31
|
try {
|
|
32
|
-
const manifestData = require("
|
|
32
|
+
const manifestData = require("./manifest.json");
|
|
33
33
|
if (!ecosystem) {
|
|
34
34
|
return manifestData;
|
|
35
35
|
}
|
package/dist/logger.js
CHANGED
package/dist/logger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/logger.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Console logging utilities with line prefix support.\n * Provides enhanced console methods with formatted output capabilities.\n */\n\nimport isUnicodeSupported from './external/@socketregistry/is-unicode-supported'\nimport yoctocolorsCjs from './external/yoctocolors-cjs'\nimport { objectAssign, objectFreeze } from './objects'\nimport { applyLinePrefix, isBlankString } from './strings'\n\n// Type definitions\ntype LogSymbols = {\n fail: string\n info: string\n success: string\n warn: string\n}\n\ntype LoggerMethods = {\n [K in keyof typeof console]: (typeof console)[K] extends (\n ...args: infer A\n // biome-ignore lint/suspicious/noExplicitAny: Console method return types are dynamic.\n ) => any\n ? (...args: A) => Logger\n : (typeof console)[K]\n}\n\ninterface Task {\n run<T>(f: () => T): T\n}\n\nexport type { LogSymbols, LoggerMethods, Task }\n\nconst globalConsole = console\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst ReflectApply = Reflect.apply\nconst ReflectConstruct = Reflect.construct\n\nlet _Console: typeof import('console').Console | undefined\n/**\n * Construct a new Console instance.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction constructConsole(...args: unknown[]) {\n if (_Console === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n const nodeConsole = /*@__PURE__*/ require('node:console')\n _Console = nodeConsole.Console\n }\n return ReflectConstruct(\n // biome-ignore lint/style/noNonNullAssertion: Initialized above.\n _Console! as new (\n ...args: unknown[]\n ) => Console, // eslint-disable-line no-undef\n args,\n )\n}\n\n/**\n * Get the yoctocolors module for terminal colors.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getYoctocolors() {\n return yoctocolorsCjs\n}\n\nexport const LOG_SYMBOLS = /*@__PURE__*/ (() => {\n const target: Record<string, string> = {\n __proto__: null,\n } as unknown as Record<string, string>\n // Mutable handler to simulate a frozen target.\n const handler: ProxyHandler<Record<string, string>> = {\n __proto__: null,\n } as unknown as ProxyHandler<Record<string, string>>\n const init = () => {\n const supported = isUnicodeSupported()\n const colors = getYoctocolors()\n objectAssign(target, {\n fail: colors.red(supported ? '\u2716' : '\u00D7'),\n info: colors.blue(supported ? '\u2139' : 'i'),\n success: colors.green(supported ? '\u2714' : '\u221A'),\n warn: colors.yellow(supported ? '\u26A0' : '\u203C'),\n })\n objectFreeze(target)\n // The handler of a Proxy is mutable after proxy instantiation.\n // We delete the traps to defer to native behavior.\n for (const trapName in handler) {\n delete handler[trapName as keyof ProxyHandler<Record<string, string>>]\n }\n }\n for (const trapName of Reflect.ownKeys(Reflect)) {\n const fn = (Reflect as Record<PropertyKey, unknown>)[trapName]\n if (typeof fn === 'function') {\n ;(handler as Record<string, (...args: unknown[]) => unknown>)[\n trapName as string\n ] = (...args: unknown[]) => {\n init()\n return fn(...args)\n }\n }\n }\n return new Proxy(target, handler)\n})()\n\nconst boundConsoleEntries = [\n // Add bound properties from console[kBindProperties](ignoreErrors, colorMode, groupIndentation).\n // https://github.com/nodejs/node/blob/v24.0.1/lib/internal/console/constructor.js#L230-L265\n '_stderrErrorHandler',\n '_stdoutErrorHandler',\n // Add methods that need to be bound to function properly.\n 'assert',\n 'clear',\n 'count',\n 'countReset',\n 'createTask',\n 'debug',\n 'dir',\n 'dirxml',\n 'error',\n // Skip group methods because in at least Node 20 with the Node --frozen-intrinsics\n // flag it triggers a readonly property for Symbol(kGroupIndent). Instead, we\n // implement these methods ourselves.\n //'group',\n //'groupCollapsed',\n //'groupEnd',\n 'info',\n 'log',\n 'table',\n 'time',\n 'timeEnd',\n 'timeLog',\n 'trace',\n 'warn',\n]\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic console method access.\n .filter(n => typeof (globalConsole as any)[n] === 'function')\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic console method access.\n .map(n => [n, (globalConsole as any)[n].bind(globalConsole)])\n\nconst consolePropAttributes = {\n __proto__: null,\n writable: true,\n enumerable: false,\n configurable: true,\n}\nconst maxIndentation = 1000\nconst privateConsole = new WeakMap()\n\nconst consoleSymbols = Object.getOwnPropertySymbols(globalConsole)\nexport const incLogCallCountSymbol = Symbol.for('logger.logCallCount++')\nconst kGroupIndentationWidthSymbol =\n // biome-ignore lint/suspicious/noExplicitAny: Symbol property access.\n consoleSymbols.find(s => (s as any).label === 'kGroupIndentWidth') ??\n Symbol('kGroupIndentWidth')\nexport const lastWasBlankSymbol = Symbol.for('logger.lastWasBlank')\n\n/**\n * Custom Logger class that wraps console with additional features.\n * Supports indentation, symbols, and blank line tracking.\n */\n/*@__PURE__*/\nexport class Logger {\n static LOG_SYMBOLS = LOG_SYMBOLS\n\n #parent?: Logger\n #boundStream?: 'stderr' | 'stdout'\n #stderrLogger?: Logger\n #stdoutLogger?: Logger\n #stderrIndention = ''\n #stdoutIndention = ''\n #lastWasBlank = false\n #logCallCount = 0\n #constructorArgs: unknown[]\n #options: Record<string, unknown>\n\n constructor(...args: unknown[]) {\n // Store constructor args for child loggers\n this.#constructorArgs = args\n\n // Store options if provided (for future extensibility)\n const options = args['0']\n if (typeof options === 'object' && options !== null) {\n this.#options = { __proto__: null, ...options }\n } else {\n this.#options = { __proto__: null }\n }\n\n if (args.length) {\n privateConsole.set(this, constructConsole(...args))\n } else {\n // Create a new console that acts like the builtin one so that it will\n // work with Node's --frozen-intrinsics flag.\n const con = constructConsole({\n stdout: process.stdout,\n stderr: process.stderr,\n }) as typeof console & Record<string, unknown>\n for (const { 0: key, 1: method } of boundConsoleEntries) {\n con[key] = method\n }\n privateConsole.set(this, con)\n }\n }\n\n /**\n * Get a logger instance bound to stderr.\n * All operations on this instance will use stderr.\n */\n get stderr(): Logger {\n if (!this.#stderrLogger) {\n // Pass parent's constructor args to maintain config\n const instance = new Logger(...this.#constructorArgs)\n instance.#parent = this\n instance.#boundStream = 'stderr'\n instance.#options = { __proto__: null, ...this.#options }\n this.#stderrLogger = instance\n }\n return this.#stderrLogger\n }\n\n /**\n * Get a logger instance bound to stdout.\n * All operations on this instance will use stdout.\n */\n get stdout(): Logger {\n if (!this.#stdoutLogger) {\n // Pass parent's constructor args to maintain config\n const instance = new Logger(...this.#constructorArgs)\n instance.#parent = this\n instance.#boundStream = 'stdout'\n instance.#options = { __proto__: null, ...this.#options }\n this.#stdoutLogger = instance\n }\n return this.#stdoutLogger\n }\n\n /**\n * Get the root logger (for accessing shared indentation state).\n * @private\n */\n #getRoot(): Logger {\n return this.#parent || this\n }\n\n /**\n * Get indentation for a specific stream.\n * @private\n */\n #getIndent(stream: 'stderr' | 'stdout'): string {\n const root = this.#getRoot()\n return stream === 'stderr' ? root.#stderrIndention : root.#stdoutIndention\n }\n\n /**\n * Set indentation for a specific stream.\n * @private\n */\n #setIndent(stream: 'stderr' | 'stdout', value: string): void {\n const root = this.#getRoot()\n if (stream === 'stderr') {\n root.#stderrIndention = value\n } else {\n root.#stdoutIndention = value\n }\n }\n\n /**\n * Get the target stream for this logger instance.\n * @private\n */\n #getTargetStream(): 'stderr' | 'stdout' {\n return this.#boundStream || 'stderr'\n }\n\n /**\n * Apply a console method with indentation.\n * @private\n */\n #apply(\n methodName: string,\n args: unknown[],\n stream?: 'stderr' | 'stdout',\n ): this {\n const con = privateConsole.get(this) as typeof console &\n Record<string, unknown>\n const text = args.at(0)\n const hasText = typeof text === 'string'\n // Determine which stream this method writes to\n const targetStream = stream || (methodName === 'log' ? 'stdout' : 'stderr')\n const indent = this.#getIndent(targetStream)\n const logArgs = hasText\n ? [applyLinePrefix(text, { prefix: indent }), ...args.slice(1)]\n : args\n ReflectApply(\n con[methodName] as (...args: unknown[]) => unknown,\n con,\n logArgs,\n )\n this[lastWasBlankSymbol](hasText && isBlankString(logArgs[0]))\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[incLogCallCountSymbol]()\n return this\n }\n\n /**\n * Strip log symbols from the start of text.\n * @private\n */\n #stripSymbols(text: string): string {\n // Strip both unicode and emoji forms of log symbols from the start.\n // Matches: \u2716, \u00D7, \u2716\uFE0F, \u26A0, \u203C, \u26A0\uFE0F, \u2714, \u221A, \u2714\uFE0F, \u2139, \u2139\uFE0F\n // Also handles variation selectors (U+FE0F) and whitespace after symbol.\n // Note: We don't strip standalone 'i' to avoid breaking words like 'info'.\n return text.replace(/^[\u2716\u00D7\u26A0\u203C\u2714\u221A\u2139]\\uFE0F?\\s*/u, '')\n }\n\n /**\n * Apply a method with a symbol prefix.\n * @private\n */\n #symbolApply(symbolType: string, args: unknown[]): this {\n const con = privateConsole.get(this)\n let text = args.at(0)\n // biome-ignore lint/suspicious/noImplicitAnyLet: Flexible argument handling.\n let extras\n if (typeof text === 'string') {\n text = this.#stripSymbols(text)\n extras = args.slice(1)\n } else {\n extras = args\n text = ''\n }\n // Note: Meta status messages (info/fail/etc) always go to stderr.\n const indent = this.#getIndent('stderr')\n con.error(\n applyLinePrefix(`${LOG_SYMBOLS[symbolType]} ${text}`, {\n prefix: indent,\n }),\n ...extras,\n )\n this.#lastWasBlank = false\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[incLogCallCountSymbol]()\n return this\n }\n\n /**\n * Get the current log call count.\n */\n get logCallCount() {\n return this.#logCallCount\n }\n\n /**\n * Increment the log call count.\n */\n [incLogCallCountSymbol]() {\n this.#logCallCount += 1\n return this\n }\n\n /**\n * Set whether the last logged line was blank.\n */\n [lastWasBlankSymbol](value: unknown): this {\n this.#lastWasBlank = !!value\n return this\n }\n\n /**\n * Log an assertion.\n */\n assert(value: unknown, ...message: unknown[]): this {\n const con = privateConsole.get(this)\n con.assert(value, ...message)\n this[lastWasBlankSymbol](false)\n return value ? this : this[incLogCallCountSymbol]()\n }\n\n /**\n * Clear the visible terminal screen.\n * Only available on the main logger instance.\n */\n clearVisible() {\n if (this.#boundStream) {\n throw new Error(\n 'clearVisible() is only available on the main logger instance, not on stream-bound instances',\n )\n }\n const con = privateConsole.get(this)\n con.clear()\n // biome-ignore lint/suspicious/noExplicitAny: Internal console property access.\n if ((con as any)._stdout.isTTY) {\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[lastWasBlankSymbol](true)\n this.#logCallCount = 0\n }\n return this\n }\n\n /**\n * Log a count for the given label.\n */\n count(label?: string): this {\n const con = privateConsole.get(this)\n con.count(label)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Create a task with a given name.\n */\n createTask(name: string): Task {\n return {\n run: <T>(f: () => T): T => {\n this.log(`Starting task: ${name}`)\n const result = f()\n this.log(`Completed task: ${name}`)\n return result\n },\n }\n }\n\n /**\n * Decrease indentation level.\n * If called on main logger, affects both streams.\n * If called on stream-bound logger, affects only that stream.\n */\n dedent(spaces = 2) {\n if (this.#boundStream) {\n // Only affect bound stream\n const current = this.#getIndent(this.#boundStream)\n this.#setIndent(this.#boundStream, current.slice(0, -spaces))\n } else {\n // Affect both streams\n const stderrCurrent = this.#getIndent('stderr')\n const stdoutCurrent = this.#getIndent('stdout')\n this.#setIndent('stderr', stderrCurrent.slice(0, -spaces))\n this.#setIndent('stdout', stdoutCurrent.slice(0, -spaces))\n }\n return this\n }\n\n /**\n * Display an object's properties.\n */\n dir(obj: unknown, options?: unknown): this {\n const con = privateConsole.get(this)\n con.dir(obj, options)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Display data as XML.\n */\n dirxml(...data: unknown[]): this {\n const con = privateConsole.get(this)\n con.dirxml(data)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log an error message.\n */\n error(...args: unknown[]): this {\n return this.#apply('error', args)\n }\n\n /**\n * Log a newline to stderr if last line wasn't blank.\n */\n errorNewline() {\n return this.#lastWasBlank ? this : this.error('')\n }\n\n /**\n * Log a failure message with symbol.\n */\n fail(...args: unknown[]): this {\n return this.#symbolApply('fail', args)\n }\n\n /**\n * Start a new log group.\n */\n group(...label: unknown[]): this {\n const { length } = label\n if (length) {\n ReflectApply(this.log, this, label)\n }\n // biome-ignore lint/suspicious/noExplicitAny: Symbol property access.\n this.indent((this as any)[kGroupIndentationWidthSymbol])\n if (length) {\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[lastWasBlankSymbol](false)\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[incLogCallCountSymbol]()\n }\n return this\n }\n\n /**\n * Start a new collapsed log group (alias for group).\n */\n // groupCollapsed is an alias of group.\n // https://nodejs.org/api/console.html#consolegroupcollapsed\n groupCollapsed(...label: unknown[]): this {\n return ReflectApply(this.group, this, label)\n }\n\n /**\n * End the current log group.\n */\n groupEnd() {\n // biome-ignore lint/suspicious/noExplicitAny: Symbol property access.\n this.dedent((this as any)[kGroupIndentationWidthSymbol])\n return this\n }\n\n /**\n * Increase indentation level.\n * If called on main logger, affects both streams.\n * If called on stream-bound logger, affects only that stream.\n */\n indent(spaces = 2) {\n const spacesToAdd = ' '.repeat(Math.min(spaces, maxIndentation))\n if (this.#boundStream) {\n // Only affect bound stream\n const current = this.#getIndent(this.#boundStream)\n this.#setIndent(this.#boundStream, current + spacesToAdd)\n } else {\n // Affect both streams\n const stderrCurrent = this.#getIndent('stderr')\n const stdoutCurrent = this.#getIndent('stdout')\n this.#setIndent('stderr', stderrCurrent + spacesToAdd)\n this.#setIndent('stdout', stdoutCurrent + spacesToAdd)\n }\n return this\n }\n\n /**\n * Log an info message with symbol.\n */\n info(...args: unknown[]): this {\n return this.#symbolApply('info', args)\n }\n\n /**\n * Log a message.\n */\n log(...args: unknown[]): this {\n return this.#apply('log', args)\n }\n\n /**\n * Log a newline to stdout if last line wasn't blank.\n */\n logNewline() {\n return this.#lastWasBlank ? this : this.log('')\n }\n\n /**\n * Reset indentation to zero.\n * If called on main logger, resets both streams.\n * If called on stream-bound logger, resets only that stream.\n */\n resetIndent() {\n if (this.#boundStream) {\n // Only reset bound stream\n this.#setIndent(this.#boundStream, '')\n } else {\n // Reset both streams\n this.#setIndent('stderr', '')\n this.#setIndent('stdout', '')\n }\n return this\n }\n\n /**\n * Log a main step with blank line before (stateless).\n */\n step(msg: string, ...extras: unknown[]): this {\n // Add blank line before the step message.\n if (!this.#lastWasBlank) {\n // Use this.log() to properly track the blank line.\n this.log('')\n }\n // Let log() handle all tracking.\n return this.log(msg, ...extras)\n }\n\n /**\n * Log an indented substep (stateless).\n */\n substep(msg: string, ...extras: unknown[]): this {\n // Add 2-space indent to the message.\n const indentedMsg = ` ${msg}`\n // Let log() handle all tracking.\n return this.log(indentedMsg, ...extras)\n }\n\n /**\n * Log a success message with symbol.\n */\n success(...args: unknown[]): this {\n return this.#symbolApply('success', args)\n }\n\n /**\n * Log a done message (alias for success).\n * Does NOT auto-clear. Call clearLine() first if needed after progress().\n */\n done(...args: unknown[]): this {\n return this.#symbolApply('success', args)\n }\n\n /**\n * Display data in a table format.\n */\n table(tabularData: unknown, properties?: readonly string[]): this {\n const con = privateConsole.get(this)\n con.table(tabularData, properties)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * End a timer and log the elapsed time.\n */\n timeEnd(label?: string): this {\n const con = privateConsole.get(this)\n con.timeEnd(label)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log the current timer value.\n */\n timeLog(label?: string, ...data: unknown[]): this {\n const con = privateConsole.get(this)\n con.timeLog(label, ...data)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log a stack trace.\n */\n trace(message?: unknown, ...args: unknown[]): this {\n const con = privateConsole.get(this)\n con.trace(message, ...args)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log a warning message with symbol.\n */\n warn(...args: unknown[]): this {\n return this.#symbolApply('warn', args)\n }\n\n /**\n * Write to stdout without a newline or indentation.\n */\n write(text: string): this {\n const con = privateConsole.get(this)\n con._stdout.write(text)\n this[lastWasBlankSymbol](false)\n return this\n }\n\n /**\n * Show a progress indicator (can be cleared with clearLine).\n * Simple status message without spinner animation.\n */\n progress(text: string): this {\n const con = privateConsole.get(this)\n const stream = this.#getTargetStream()\n const streamObj = stream === 'stderr' ? con._stderr : con._stdout\n streamObj.write(`\u2234 ${text}`)\n this[lastWasBlankSymbol](false)\n return this\n }\n\n /**\n * Clear the current line.\n */\n clearLine(): this {\n const con = privateConsole.get(this)\n const stream = this.#getTargetStream()\n const streamObj = stream === 'stderr' ? con._stderr : con._stdout\n if (streamObj.isTTY) {\n streamObj.cursorTo(0)\n streamObj.clearLine(0)\n } else {\n streamObj.write('\\r\\x1b[K')\n }\n return this\n }\n}\n\nObject.defineProperties(\n Logger.prototype,\n Object.fromEntries(\n (() => {\n const entries: Array<[string | symbol, PropertyDescriptor]> = [\n [\n kGroupIndentationWidthSymbol,\n {\n ...consolePropAttributes,\n value: 2,\n },\n ],\n [\n Symbol.toStringTag,\n {\n __proto__: null,\n configurable: true,\n value: 'logger',\n } as PropertyDescriptor,\n ],\n ]\n for (const { 0: key, 1: value } of Object.entries(globalConsole)) {\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic prototype check.\n if (!(Logger.prototype as any)[key] && typeof value === 'function') {\n // Dynamically name the log method without using Object.defineProperty.\n const { [key]: func } = {\n [key](...args: unknown[]) {\n const con = privateConsole.get(this)\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic console method access.\n const result = (con as any)[key](...args)\n return result === undefined || result === con ? this : result\n },\n }\n entries.push([\n key,\n {\n ...consolePropAttributes,\n value: func,\n },\n ])\n }\n }\n return entries\n })(),\n ),\n)\n\nexport const logger = new Logger()\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,kCAA+B;AAC/B,6BAA2B;AAC3B,qBAA2C;AAC3C,qBAA+C;AAyB/C,MAAM,gBAAgB;AAKtB,MAAM,eAAe,QAAQ;AAC7B,MAAM,mBAAmB,QAAQ;AAEjC,IAAI;AAAA;AAMJ,SAAS,oBAAoB,MAAiB;AAC5C,MAAI,aAAa,QAAW;AAG1B,UAAM,cAA4B,QAAQ,cAAc;AACxD,eAAW,YAAY;AAAA,EACzB;AACA,SAAO;AAAA;AAAA,IAEL;AAAA;AAAA,IAGA;AAAA,EACF;AACF;AAAA;AAOA,SAAS,iBAAiB;AACxB,SAAO,uBAAAA;AACT;AAEO,MAAM,cAA6B,uBAAM;AAC9C,QAAM,SAAiC;AAAA,IACrC,WAAW;AAAA,EACb;AAEA,QAAM,UAAgD;AAAA,IACpD,WAAW;AAAA,EACb;AACA,QAAM,OAAO,MAAM;AACjB,UAAM,gBAAY,4BAAAC,SAAmB;AACrC,UAAM,SAAS,+BAAe;AAC9B,qCAAa,QAAQ;AAAA,MACnB,MAAM,OAAO,IAAI,YAAY,WAAM,MAAG;AAAA,MACtC,MAAM,OAAO,KAAK,YAAY,WAAM,GAAG;AAAA,MACvC,SAAS,OAAO,MAAM,YAAY,WAAM,QAAG;AAAA,MAC3C,MAAM,OAAO,OAAO,YAAY,WAAM,QAAG;AAAA,IAC3C,CAAC;AACD,qCAAa,MAAM;AAGnB,eAAW,YAAY,SAAS;AAC9B,aAAO,QAAQ,QAAsD;AAAA,IACvE;AAAA,EACF;AACA,aAAW,YAAY,QAAQ,QAAQ,OAAO,GAAG;AAC/C,UAAM,KAAM,QAAyC,QAAQ;AAC7D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,UAAU;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AACF;AAEA,OAAO;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,KACJ,MAAM;AACL,YAAM,UAAwD;AAAA,QAC5D;AAAA,UACE;AAAA,UACA;AAAA,YACE,GAAG;AAAA,YACH,OAAO;AAAA,UACT;AAAA,QACF;AAAA,QACA;AAAA,UACE,OAAO;AAAA,UACP;AAAA,YACE,WAAW;AAAA,YACX,cAAc;AAAA,YACd,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AACA,iBAAW,EAAE,GAAG,KAAK,GAAG,MAAM,KAAK,OAAO,QAAQ,aAAa,GAAG;AAEhE,YAAI,CAAE,OAAO,UAAkB,GAAG,KAAK,OAAO,UAAU,YAAY;AAElE,gBAAM,EAAE,CAAC,GAAG,GAAG,KAAK,IAAI;AAAA,YACtB,CAAC,GAAG,KAAK,MAAiB;AACxB,oBAAM,MAAM,eAAe,IAAI,IAAI;AAEnC,oBAAM,SAAU,IAAY,GAAG,EAAE,GAAG,IAAI;AACxC,qBAAO,WAAW,UAAa,WAAW,MAAM,OAAO;AAAA,YACzD;AAAA,UACF;AACA,kBAAQ,KAAK;AAAA,YACX;AAAA,YACA;AAAA,cACE,GAAG;AAAA,cACH,OAAO;AAAA,YACT;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AACA,aAAO;AAAA,IACT,GAAG;AAAA,EACL;AACF;AAEO,MAAM,SAAS,IAAI,OAAO;",
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Console logging utilities with line prefix support.\n * Provides enhanced console methods with formatted output capabilities.\n */\n\nimport isUnicodeSupported from './external/@socketregistry/is-unicode-supported'\nimport yoctocolorsCjs from './external/yoctocolors-cjs'\nimport { objectAssign, objectFreeze } from './objects'\nimport { applyLinePrefix, isBlankString } from './strings'\n\n// Type definitions\ntype LogSymbols = {\n fail: string\n info: string\n success: string\n warn: string\n}\n\ntype LoggerMethods = {\n [K in keyof typeof console]: (typeof console)[K] extends (\n ...args: infer A\n // biome-ignore lint/suspicious/noExplicitAny: Console method return types are dynamic.\n ) => any\n ? (...args: A) => Logger\n : (typeof console)[K]\n}\n\ninterface Task {\n run<T>(f: () => T): T\n}\n\nexport type { LogSymbols, LoggerMethods, Task }\n\nconst globalConsole = console\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst ReflectApply = Reflect.apply\nconst ReflectConstruct = Reflect.construct\n\nlet _Console: typeof import('console').Console | undefined\n/**\n * Construct a new Console instance.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction constructConsole(...args: unknown[]) {\n if (_Console === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n const nodeConsole = /*@__PURE__*/ require('node:console')\n _Console = nodeConsole.Console\n }\n return ReflectConstruct(\n // biome-ignore lint/style/noNonNullAssertion: Initialized above.\n _Console! as new (\n ...args: unknown[]\n ) => Console, // eslint-disable-line no-undef\n args,\n )\n}\n\n/**\n * Get the yoctocolors module for terminal colors.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getYoctocolors() {\n return yoctocolorsCjs\n}\n\nexport const LOG_SYMBOLS = /*@__PURE__*/ (() => {\n const target: Record<string, string> = {\n __proto__: null,\n } as unknown as Record<string, string>\n // Mutable handler to simulate a frozen target.\n const handler: ProxyHandler<Record<string, string>> = {\n __proto__: null,\n } as unknown as ProxyHandler<Record<string, string>>\n const init = () => {\n const supported = isUnicodeSupported()\n const colors = getYoctocolors()\n objectAssign(target, {\n fail: colors.red(supported ? '\u2716' : '\u00D7'),\n info: colors.blue(supported ? '\u2139' : 'i'),\n success: colors.green(supported ? '\u2714' : '\u221A'),\n warn: colors.yellow(supported ? '\u26A0' : '\u203C'),\n })\n objectFreeze(target)\n // The handler of a Proxy is mutable after proxy instantiation.\n // We delete the traps to defer to native behavior.\n for (const trapName in handler) {\n delete handler[trapName as keyof ProxyHandler<Record<string, string>>]\n }\n }\n for (const trapName of Reflect.ownKeys(Reflect)) {\n const fn = (Reflect as Record<PropertyKey, unknown>)[trapName]\n if (typeof fn === 'function') {\n ;(handler as Record<string, (...args: unknown[]) => unknown>)[\n trapName as string\n ] = (...args: unknown[]) => {\n init()\n return fn(...args)\n }\n }\n }\n return new Proxy(target, handler)\n})()\n\nconst boundConsoleEntries = [\n // Add bound properties from console[kBindProperties](ignoreErrors, colorMode, groupIndentation).\n // https://github.com/nodejs/node/blob/v24.0.1/lib/internal/console/constructor.js#L230-L265\n '_stderrErrorHandler',\n '_stdoutErrorHandler',\n // Add methods that need to be bound to function properly.\n 'assert',\n 'clear',\n 'count',\n 'countReset',\n 'createTask',\n 'debug',\n 'dir',\n 'dirxml',\n 'error',\n // Skip group methods because in at least Node 20 with the Node --frozen-intrinsics\n // flag it triggers a readonly property for Symbol(kGroupIndent). Instead, we\n // implement these methods ourselves.\n //'group',\n //'groupCollapsed',\n //'groupEnd',\n 'info',\n 'log',\n 'table',\n 'time',\n 'timeEnd',\n 'timeLog',\n 'trace',\n 'warn',\n]\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic console method access.\n .filter(n => typeof (globalConsole as any)[n] === 'function')\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic console method access.\n .map(n => [n, (globalConsole as any)[n].bind(globalConsole)])\n\nconst consolePropAttributes = {\n __proto__: null,\n writable: true,\n enumerable: false,\n configurable: true,\n}\nconst maxIndentation = 1000\nconst privateConsole = new WeakMap()\n\nconst consoleSymbols = Object.getOwnPropertySymbols(globalConsole)\nexport const incLogCallCountSymbol = Symbol.for('logger.logCallCount++')\nconst kGroupIndentationWidthSymbol =\n // biome-ignore lint/suspicious/noExplicitAny: Symbol property access.\n consoleSymbols.find(s => (s as any).label === 'kGroupIndentWidth') ??\n Symbol('kGroupIndentWidth')\nexport const lastWasBlankSymbol = Symbol.for('logger.lastWasBlank')\n\n/**\n * Custom Logger class that wraps console with additional features.\n * Supports indentation, symbols, and blank line tracking.\n */\n/*@__PURE__*/\nexport class Logger {\n static LOG_SYMBOLS = LOG_SYMBOLS\n\n #parent?: Logger\n #boundStream?: 'stderr' | 'stdout'\n #stderrLogger?: Logger\n #stdoutLogger?: Logger\n #stderrIndention = ''\n #stdoutIndention = ''\n #lastWasBlank = false\n #logCallCount = 0\n #constructorArgs: unknown[]\n #options: Record<string, unknown>\n\n constructor(...args: unknown[]) {\n // Store constructor args for child loggers\n this.#constructorArgs = args\n\n // Store options if provided (for future extensibility)\n const options = args['0']\n if (typeof options === 'object' && options !== null) {\n this.#options = { __proto__: null, ...options }\n } else {\n this.#options = { __proto__: null }\n }\n\n if (args.length) {\n privateConsole.set(this, constructConsole(...args))\n } else {\n // Create a new console that acts like the builtin one so that it will\n // work with Node's --frozen-intrinsics flag.\n const con = constructConsole({\n stdout: process.stdout,\n stderr: process.stderr,\n }) as typeof console & Record<string, unknown>\n for (const { 0: key, 1: method } of boundConsoleEntries) {\n con[key] = method\n }\n privateConsole.set(this, con)\n }\n }\n\n /**\n * Get a logger instance bound to stderr.\n * All operations on this instance will use stderr.\n */\n get stderr(): Logger {\n if (!this.#stderrLogger) {\n // Pass parent's constructor args to maintain config\n const instance = new Logger(...this.#constructorArgs)\n instance.#parent = this\n instance.#boundStream = 'stderr'\n instance.#options = { __proto__: null, ...this.#options }\n this.#stderrLogger = instance\n }\n return this.#stderrLogger\n }\n\n /**\n * Get a logger instance bound to stdout.\n * All operations on this instance will use stdout.\n */\n get stdout(): Logger {\n if (!this.#stdoutLogger) {\n // Pass parent's constructor args to maintain config\n const instance = new Logger(...this.#constructorArgs)\n instance.#parent = this\n instance.#boundStream = 'stdout'\n instance.#options = { __proto__: null, ...this.#options }\n this.#stdoutLogger = instance\n }\n return this.#stdoutLogger\n }\n\n /**\n * Get the root logger (for accessing shared indentation state).\n * @private\n */\n #getRoot(): Logger {\n return this.#parent || this\n }\n\n /**\n * Get indentation for a specific stream.\n * @private\n */\n #getIndent(stream: 'stderr' | 'stdout'): string {\n const root = this.#getRoot()\n return stream === 'stderr' ? root.#stderrIndention : root.#stdoutIndention\n }\n\n /**\n * Set indentation for a specific stream.\n * @private\n */\n #setIndent(stream: 'stderr' | 'stdout', value: string): void {\n const root = this.#getRoot()\n if (stream === 'stderr') {\n root.#stderrIndention = value\n } else {\n root.#stdoutIndention = value\n }\n }\n\n /**\n * Get the target stream for this logger instance.\n * @private\n */\n #getTargetStream(): 'stderr' | 'stdout' {\n return this.#boundStream || 'stderr'\n }\n\n /**\n * Apply a console method with indentation.\n * @private\n */\n #apply(\n methodName: string,\n args: unknown[],\n stream?: 'stderr' | 'stdout',\n ): this {\n const con = privateConsole.get(this) as typeof console &\n Record<string, unknown>\n const text = args.at(0)\n const hasText = typeof text === 'string'\n // Determine which stream this method writes to\n const targetStream = stream || (methodName === 'log' ? 'stdout' : 'stderr')\n const indent = this.#getIndent(targetStream)\n const logArgs = hasText\n ? [applyLinePrefix(text, { prefix: indent }), ...args.slice(1)]\n : args\n ReflectApply(\n con[methodName] as (...args: unknown[]) => unknown,\n con,\n logArgs,\n )\n this[lastWasBlankSymbol](hasText && isBlankString(logArgs[0]))\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[incLogCallCountSymbol]()\n return this\n }\n\n /**\n * Strip log symbols from the start of text.\n * @private\n */\n #stripSymbols(text: string): string {\n // Strip both unicode and emoji forms of log symbols from the start.\n // Matches: \u2716, \u2717, \u00D7, \u2716\uFE0F, \u26A0, \u203C, \u26A0\uFE0F, \u2714, \u2713, \u221A, \u2714\uFE0F, \u2713\uFE0F, \u2139, \u2139\uFE0F\n // Also handles variation selectors (U+FE0F) and whitespace after symbol.\n // Note: We don't strip standalone 'i' to avoid breaking words like 'info'.\n return text.replace(/^[\u2716\u2717\u00D7\u26A0\u203C\u2714\u2713\u221A\u2139]\\uFE0F?\\s*/u, '')\n }\n\n /**\n * Apply a method with a symbol prefix.\n * @private\n */\n #symbolApply(symbolType: string, args: unknown[]): this {\n const con = privateConsole.get(this)\n let text = args.at(0)\n // biome-ignore lint/suspicious/noImplicitAnyLet: Flexible argument handling.\n let extras\n if (typeof text === 'string') {\n text = this.#stripSymbols(text)\n extras = args.slice(1)\n } else {\n extras = args\n text = ''\n }\n // Note: Meta status messages (info/fail/etc) always go to stderr.\n const indent = this.#getIndent('stderr')\n con.error(\n applyLinePrefix(`${LOG_SYMBOLS[symbolType]} ${text}`, {\n prefix: indent,\n }),\n ...extras,\n )\n this.#lastWasBlank = false\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[incLogCallCountSymbol]()\n return this\n }\n\n /**\n * Get the current log call count.\n */\n get logCallCount() {\n return this.#logCallCount\n }\n\n /**\n * Increment the log call count.\n */\n [incLogCallCountSymbol]() {\n this.#logCallCount += 1\n return this\n }\n\n /**\n * Set whether the last logged line was blank.\n */\n [lastWasBlankSymbol](value: unknown): this {\n this.#lastWasBlank = !!value\n return this\n }\n\n /**\n * Log an assertion.\n */\n assert(value: unknown, ...message: unknown[]): this {\n const con = privateConsole.get(this)\n con.assert(value, ...message)\n this[lastWasBlankSymbol](false)\n return value ? this : this[incLogCallCountSymbol]()\n }\n\n /**\n * Clear the visible terminal screen.\n * Only available on the main logger instance.\n */\n clearVisible() {\n if (this.#boundStream) {\n throw new Error(\n 'clearVisible() is only available on the main logger instance, not on stream-bound instances',\n )\n }\n const con = privateConsole.get(this)\n con.clear()\n // biome-ignore lint/suspicious/noExplicitAny: Internal console property access.\n if ((con as any)._stdout.isTTY) {\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[lastWasBlankSymbol](true)\n this.#logCallCount = 0\n }\n return this\n }\n\n /**\n * Log a count for the given label.\n */\n count(label?: string): this {\n const con = privateConsole.get(this)\n con.count(label)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Create a task with a given name.\n */\n createTask(name: string): Task {\n return {\n run: <T>(f: () => T): T => {\n this.log(`Starting task: ${name}`)\n const result = f()\n this.log(`Completed task: ${name}`)\n return result\n },\n }\n }\n\n /**\n * Decrease indentation level.\n * If called on main logger, affects both streams.\n * If called on stream-bound logger, affects only that stream.\n */\n dedent(spaces = 2) {\n if (this.#boundStream) {\n // Only affect bound stream\n const current = this.#getIndent(this.#boundStream)\n this.#setIndent(this.#boundStream, current.slice(0, -spaces))\n } else {\n // Affect both streams\n const stderrCurrent = this.#getIndent('stderr')\n const stdoutCurrent = this.#getIndent('stdout')\n this.#setIndent('stderr', stderrCurrent.slice(0, -spaces))\n this.#setIndent('stdout', stdoutCurrent.slice(0, -spaces))\n }\n return this\n }\n\n /**\n * Display an object's properties.\n */\n dir(obj: unknown, options?: unknown): this {\n const con = privateConsole.get(this)\n con.dir(obj, options)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Display data as XML.\n */\n dirxml(...data: unknown[]): this {\n const con = privateConsole.get(this)\n con.dirxml(data)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log an error message.\n */\n error(...args: unknown[]): this {\n return this.#apply('error', args)\n }\n\n /**\n * Log a newline to stderr if last line wasn't blank.\n */\n errorNewline() {\n return this.#lastWasBlank ? this : this.error('')\n }\n\n /**\n * Log a failure message with symbol.\n */\n fail(...args: unknown[]): this {\n return this.#symbolApply('fail', args)\n }\n\n /**\n * Start a new log group.\n */\n group(...label: unknown[]): this {\n const { length } = label\n if (length) {\n ReflectApply(this.log, this, label)\n }\n // biome-ignore lint/suspicious/noExplicitAny: Symbol property access.\n this.indent((this as any)[kGroupIndentationWidthSymbol])\n if (length) {\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[lastWasBlankSymbol](false)\n // biome-ignore lint/suspicious/noExplicitAny: Symbol method access.\n ;(this as any)[incLogCallCountSymbol]()\n }\n return this\n }\n\n /**\n * Start a new collapsed log group (alias for group).\n */\n // groupCollapsed is an alias of group.\n // https://nodejs.org/api/console.html#consolegroupcollapsed\n groupCollapsed(...label: unknown[]): this {\n return ReflectApply(this.group, this, label)\n }\n\n /**\n * End the current log group.\n */\n groupEnd() {\n // biome-ignore lint/suspicious/noExplicitAny: Symbol property access.\n this.dedent((this as any)[kGroupIndentationWidthSymbol])\n return this\n }\n\n /**\n * Increase indentation level.\n * If called on main logger, affects both streams.\n * If called on stream-bound logger, affects only that stream.\n */\n indent(spaces = 2) {\n const spacesToAdd = ' '.repeat(Math.min(spaces, maxIndentation))\n if (this.#boundStream) {\n // Only affect bound stream\n const current = this.#getIndent(this.#boundStream)\n this.#setIndent(this.#boundStream, current + spacesToAdd)\n } else {\n // Affect both streams\n const stderrCurrent = this.#getIndent('stderr')\n const stdoutCurrent = this.#getIndent('stdout')\n this.#setIndent('stderr', stderrCurrent + spacesToAdd)\n this.#setIndent('stdout', stdoutCurrent + spacesToAdd)\n }\n return this\n }\n\n /**\n * Log an info message with symbol.\n */\n info(...args: unknown[]): this {\n return this.#symbolApply('info', args)\n }\n\n /**\n * Log a message.\n */\n log(...args: unknown[]): this {\n return this.#apply('log', args)\n }\n\n /**\n * Log a newline to stdout if last line wasn't blank.\n */\n logNewline() {\n return this.#lastWasBlank ? this : this.log('')\n }\n\n /**\n * Reset indentation to zero.\n * If called on main logger, resets both streams.\n * If called on stream-bound logger, resets only that stream.\n */\n resetIndent() {\n if (this.#boundStream) {\n // Only reset bound stream\n this.#setIndent(this.#boundStream, '')\n } else {\n // Reset both streams\n this.#setIndent('stderr', '')\n this.#setIndent('stdout', '')\n }\n return this\n }\n\n /**\n * Log a main step with blank line before (stateless).\n */\n step(msg: string, ...extras: unknown[]): this {\n // Add blank line before the step message.\n if (!this.#lastWasBlank) {\n // Use this.log() to properly track the blank line.\n this.log('')\n }\n // Let log() handle all tracking.\n return this.log(msg, ...extras)\n }\n\n /**\n * Log an indented substep (stateless).\n */\n substep(msg: string, ...extras: unknown[]): this {\n // Add 2-space indent to the message.\n const indentedMsg = ` ${msg}`\n // Let log() handle all tracking.\n return this.log(indentedMsg, ...extras)\n }\n\n /**\n * Log a success message with symbol.\n */\n success(...args: unknown[]): this {\n return this.#symbolApply('success', args)\n }\n\n /**\n * Log a done message (alias for success).\n * Does NOT auto-clear. Call clearLine() first if needed after progress().\n */\n done(...args: unknown[]): this {\n return this.#symbolApply('success', args)\n }\n\n /**\n * Display data in a table format.\n */\n table(tabularData: unknown, properties?: readonly string[]): this {\n const con = privateConsole.get(this)\n con.table(tabularData, properties)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * End a timer and log the elapsed time.\n */\n timeEnd(label?: string): this {\n const con = privateConsole.get(this)\n con.timeEnd(label)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log the current timer value.\n */\n timeLog(label?: string, ...data: unknown[]): this {\n const con = privateConsole.get(this)\n con.timeLog(label, ...data)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log a stack trace.\n */\n trace(message?: unknown, ...args: unknown[]): this {\n const con = privateConsole.get(this)\n con.trace(message, ...args)\n this[lastWasBlankSymbol](false)\n return this[incLogCallCountSymbol]()\n }\n\n /**\n * Log a warning message with symbol.\n */\n warn(...args: unknown[]): this {\n return this.#symbolApply('warn', args)\n }\n\n /**\n * Write to stdout without a newline or indentation.\n */\n write(text: string): this {\n const con = privateConsole.get(this)\n con._stdout.write(text)\n this[lastWasBlankSymbol](false)\n return this\n }\n\n /**\n * Show a progress indicator (can be cleared with clearLine).\n * Simple status message without spinner animation.\n */\n progress(text: string): this {\n const con = privateConsole.get(this)\n const stream = this.#getTargetStream()\n const streamObj = stream === 'stderr' ? con._stderr : con._stdout\n streamObj.write(`\u2234 ${text}`)\n this[lastWasBlankSymbol](false)\n return this\n }\n\n /**\n * Clear the current line.\n */\n clearLine(): this {\n const con = privateConsole.get(this)\n const stream = this.#getTargetStream()\n const streamObj = stream === 'stderr' ? con._stderr : con._stdout\n if (streamObj.isTTY) {\n streamObj.cursorTo(0)\n streamObj.clearLine(0)\n } else {\n streamObj.write('\\r\\x1b[K')\n }\n return this\n }\n}\n\nObject.defineProperties(\n Logger.prototype,\n Object.fromEntries(\n (() => {\n const entries: Array<[string | symbol, PropertyDescriptor]> = [\n [\n kGroupIndentationWidthSymbol,\n {\n ...consolePropAttributes,\n value: 2,\n },\n ],\n [\n Symbol.toStringTag,\n {\n __proto__: null,\n configurable: true,\n value: 'logger',\n } as PropertyDescriptor,\n ],\n ]\n for (const { 0: key, 1: value } of Object.entries(globalConsole)) {\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic prototype check.\n if (!(Logger.prototype as any)[key] && typeof value === 'function') {\n // Dynamically name the log method without using Object.defineProperty.\n const { [key]: func } = {\n [key](...args: unknown[]) {\n const con = privateConsole.get(this)\n // biome-ignore lint/suspicious/noExplicitAny: Dynamic console method access.\n const result = (con as any)[key](...args)\n return result === undefined || result === con ? this : result\n },\n }\n entries.push([\n key,\n {\n ...consolePropAttributes,\n value: func,\n },\n ])\n }\n }\n return entries\n })(),\n ),\n)\n\nexport const logger = new Logger()\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,kCAA+B;AAC/B,6BAA2B;AAC3B,qBAA2C;AAC3C,qBAA+C;AAyB/C,MAAM,gBAAgB;AAKtB,MAAM,eAAe,QAAQ;AAC7B,MAAM,mBAAmB,QAAQ;AAEjC,IAAI;AAAA;AAMJ,SAAS,oBAAoB,MAAiB;AAC5C,MAAI,aAAa,QAAW;AAG1B,UAAM,cAA4B,QAAQ,cAAc;AACxD,eAAW,YAAY;AAAA,EACzB;AACA,SAAO;AAAA;AAAA,IAEL;AAAA;AAAA,IAGA;AAAA,EACF;AACF;AAAA;AAOA,SAAS,iBAAiB;AACxB,SAAO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;AAEnC,oBAAM,SAAU,IAAY,GAAG,EAAE,GAAG,IAAI;AACxC,qBAAO,WAAW,UAAa,WAAW,MAAM,OAAO;AAAA,YACzD;AAAA,UACF;AACA,kBAAQ,KAAK;AAAA,YACX;AAAA,YACA;AAAA,cACE,GAAG;AAAA,cACH,OAAO;AAAA,YACT;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AACA,aAAO;AAAA,IACT,GAAG;AAAA,EACL;AACF;AAEO,MAAM,SAAS,IAAI,OAAO;",
|
|
6
6
|
"names": ["yoctocolorsCjs", "isUnicodeSupported"]
|
|
7
7
|
}
|
|
@@ -31,7 +31,7 @@ let _REGISTRY_SCOPE_DELIMITER;
|
|
|
31
31
|
function getRegistryScopeDelimiter() {
|
|
32
32
|
if (_REGISTRY_SCOPE_DELIMITER === void 0) {
|
|
33
33
|
_REGISTRY_SCOPE_DELIMITER = /*@__INLINE__*/
|
|
34
|
-
require("
|
|
34
|
+
require("../constants/socket").REGISTRY_SCOPE_DELIMITER;
|
|
35
35
|
}
|
|
36
36
|
return _REGISTRY_SCOPE_DELIMITER;
|
|
37
37
|
}
|
|
@@ -39,7 +39,7 @@ let _SOCKET_REGISTRY_SCOPE;
|
|
|
39
39
|
function getSocketRegistryScope() {
|
|
40
40
|
if (_SOCKET_REGISTRY_SCOPE === void 0) {
|
|
41
41
|
_SOCKET_REGISTRY_SCOPE = /*@__INLINE__*/
|
|
42
|
-
require("
|
|
42
|
+
require("../constants/socket").SOCKET_REGISTRY_SCOPE;
|
|
43
43
|
}
|
|
44
44
|
return _SOCKET_REGISTRY_SCOPE;
|
|
45
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/packages/normalize.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Package.json normalization utilities.\n */\n\nimport { merge } from '../objects'\n\nimport type { NormalizeOptions, PackageJson } from '../packages'\n\nconst ArrayIsArray = Array.isArray\nconst ObjectHasOwn = Object.hasOwn\n\n// Lazy load constants to avoid circular dependencies.\nlet _REGISTRY_SCOPE_DELIMITER: string | undefined\nfunction getRegistryScopeDelimiter(): string {\n if (_REGISTRY_SCOPE_DELIMITER === undefined) {\n _REGISTRY_SCOPE_DELIMITER =\n /*@__INLINE__*/ require('
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAAsB;AAItB,MAAM,eAAe,MAAM;AAC3B,MAAM,eAAe,OAAO;AAG5B,IAAI;AACJ,SAAS,4BAAoC;AAC3C,MAAI,8BAA8B,QAAW;AAC3C;AAAA,IACkB,QAAQ,
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Package.json normalization utilities.\n */\n\nimport { merge } from '../objects'\n\nimport type { NormalizeOptions, PackageJson } from '../packages'\n\nconst ArrayIsArray = Array.isArray\nconst ObjectHasOwn = Object.hasOwn\n\n// Lazy load constants to avoid circular dependencies.\nlet _REGISTRY_SCOPE_DELIMITER: string | undefined\nfunction getRegistryScopeDelimiter(): string {\n if (_REGISTRY_SCOPE_DELIMITER === undefined) {\n _REGISTRY_SCOPE_DELIMITER =\n /*@__INLINE__*/ require('../constants/socket').REGISTRY_SCOPE_DELIMITER\n }\n return _REGISTRY_SCOPE_DELIMITER as string\n}\n\nlet _SOCKET_REGISTRY_SCOPE: string | undefined\nfunction getSocketRegistryScope(): string {\n if (_SOCKET_REGISTRY_SCOPE === undefined) {\n _SOCKET_REGISTRY_SCOPE =\n /*@__INLINE__*/ require('../constants/socket').SOCKET_REGISTRY_SCOPE\n }\n return _SOCKET_REGISTRY_SCOPE as string\n}\n\nlet _escapeRegExp: ((s: string) => string) | undefined\nfunction getEscapeRegExp(): (s: string) => string {\n if (_escapeRegExp === undefined) {\n _escapeRegExp = /*@__PURE__*/ require('../regexps').escapeRegExp\n }\n return _escapeRegExp as (s: string) => string\n}\n\nfunction getEscapedScopeRegExp(): RegExp {\n const REGISTRY_SCOPE_DELIMITER = getRegistryScopeDelimiter()\n const escapeRegExp = getEscapeRegExp()\n const firstChar = REGISTRY_SCOPE_DELIMITER[0] as string\n return new RegExp(\n `^[^${escapeRegExp(firstChar)}]+${escapeRegExp(REGISTRY_SCOPE_DELIMITER)}(?!${escapeRegExp(firstChar)})`,\n )\n}\n\nlet _normalizePackageData: typeof import('normalize-package-data') | undefined\n/**\n * Get the normalize-package-data module.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getNormalizePackageData() {\n if (_normalizePackageData === undefined) {\n _normalizePackageData =\n /*@__PURE__*/ require('../../external/normalize-package-data')\n }\n return _normalizePackageData as typeof import('normalize-package-data')\n}\n\n/**\n * Normalize a package.json object with standard npm package normalization.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function normalizePackageJson(\n pkgJson: PackageJson,\n options?: NormalizeOptions,\n): PackageJson {\n const { preserve } = { __proto__: null, ...options } as NormalizeOptions\n // Add default version if not present.\n if (!ObjectHasOwn(pkgJson, 'version')) {\n pkgJson.version = '0.0.0'\n }\n const preserved = [\n ['_id', undefined],\n ['readme', undefined],\n ...(ObjectHasOwn(pkgJson, 'bugs') ? [] : [['bugs', undefined]]),\n ...(ObjectHasOwn(pkgJson, 'homepage') ? [] : [['homepage', undefined]]),\n ...(ObjectHasOwn(pkgJson, 'name') ? [] : [['name', undefined]]),\n ...(ArrayIsArray(preserve)\n ? preserve.map(k => [\n k,\n ObjectHasOwn(pkgJson, k) ? pkgJson[k] : undefined,\n ])\n : []),\n ]\n const normalizePackageData = getNormalizePackageData()\n normalizePackageData(pkgJson)\n // Import findPackageExtensions from operations to avoid circular dependency.\n const { findPackageExtensions } = require('./operations')\n if (pkgJson.name && pkgJson.version) {\n merge(pkgJson, findPackageExtensions(pkgJson.name, pkgJson.version))\n }\n // Revert/remove properties we don't care to have normalized.\n // Properties with undefined values are omitted when saved as JSON.\n for (const { 0: key, 1: value } of preserved) {\n pkgJson[key as keyof typeof pkgJson] = value\n }\n return pkgJson\n}\n\n/**\n * Extract escaped scope from a Socket registry package name.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function resolveEscapedScope(\n sockRegPkgName: string,\n): string | undefined {\n const escapedScopeRegExp = getEscapedScopeRegExp()\n const match = escapedScopeRegExp.exec(sockRegPkgName)?.[0]\n return match || undefined\n}\n\n/**\n * Resolve original package name from Socket registry package name.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function resolveOriginalPackageName(sockRegPkgName: string): string {\n const SOCKET_REGISTRY_SCOPE = getSocketRegistryScope()\n const name = sockRegPkgName.startsWith(`${SOCKET_REGISTRY_SCOPE}/`)\n ? sockRegPkgName.slice(SOCKET_REGISTRY_SCOPE.length + 1)\n : sockRegPkgName\n const escapedScope = resolveEscapedScope(name)\n return escapedScope\n ? `${unescapeScope(escapedScope)}/${name.slice(escapedScope.length)}`\n : name\n}\n\n/**\n * Convert escaped scope to standard npm scope format.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function unescapeScope(escapedScope: string): string {\n const REGISTRY_SCOPE_DELIMITER = getRegistryScopeDelimiter()\n return `@${escapedScope.slice(0, -REGISTRY_SCOPE_DELIMITER.length)}`\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAAsB;AAItB,MAAM,eAAe,MAAM;AAC3B,MAAM,eAAe,OAAO;AAG5B,IAAI;AACJ,SAAS,4BAAoC;AAC3C,MAAI,8BAA8B,QAAW;AAC3C;AAAA,IACkB,QAAQ,qBAAqB,EAAE;AAAA,EACnD;AACA,SAAO;AACT;AAEA,IAAI;AACJ,SAAS,yBAAiC;AACxC,MAAI,2BAA2B,QAAW;AACxC;AAAA,IACkB,QAAQ,qBAAqB,EAAE;AAAA,EACnD;AACA,SAAO;AACT;AAEA,IAAI;AACJ,SAAS,kBAAyC;AAChD,MAAI,kBAAkB,QAAW;AAC/B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AAsB,QAAQ,MAAM,QAAQ,OAAO,CAAC;AAAA,EACrE;AAGA,aAAW,EAAE,GAAG,KAAK,GAAG,MAAM,KAAK,WAAW;AAC5C,YAAQ,GAA2B,IAAI;AAAA,EACzC;AACA,SAAO;AACT;AAAA;AAMO,SAAS,oBACd,gBACoB;AACpB,QAAM,qBAAqB,sBAAsB;AACjD,QAAM,QAAQ,mBAAmB,KAAK,cAAc,IAAI,CAAC;AACzD,SAAO,SAAS;AAClB;AAAA;AAMO,SAAS,2BAA2B,gBAAgC;AACzE,QAAM,wBAAwB,uBAAuB;AACrD,QAAM,OAAO,eAAe,WAAW,GAAG,qBAAqB,GAAG,IAC9D,eAAe,MAAM,sBAAsB,SAAS,CAAC,IACrD;AACJ,QAAM,eAAe,oCAAoB,IAAI;AAC7C,SAAO,eACH,GAAG,8BAAc,YAAY,CAAC,IAAI,KAAK,MAAM,aAAa,MAAM,CAAC,KACjE;AACN;AAAA;AAMO,SAAS,cAAc,cAA8B;AAC1D,QAAM,2BAA2B,0BAA0B;AAC3D,SAAO,IAAI,aAAa,MAAM,GAAG,CAAC,yBAAyB,MAAM,CAAC;AACpE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/path.js
CHANGED
|
@@ -307,7 +307,7 @@ function pathLikeToString(pathLike) {
|
|
|
307
307
|
} catch {
|
|
308
308
|
const pathname = pathLike.pathname;
|
|
309
309
|
const decodedPathname = decodeURIComponent(pathname);
|
|
310
|
-
const WIN322 = require("
|
|
310
|
+
const WIN322 = require("./constants/platform").WIN32;
|
|
311
311
|
if (WIN322 && decodedPathname.startsWith("/")) {
|
|
312
312
|
const letter = decodedPathname.charCodeAt(1) | 32;
|
|
313
313
|
const hasValidDriveLetter = decodedPathname.length >= 3 && letter >= 97 && // 'a' to 'z'
|
|
@@ -365,7 +365,7 @@ function relative(from, to) {
|
|
|
365
365
|
if (actualFrom === actualTo) {
|
|
366
366
|
return "";
|
|
367
367
|
}
|
|
368
|
-
const WIN322 = require("
|
|
368
|
+
const WIN322 = require("./constants/platform").WIN32;
|
|
369
369
|
if (WIN322) {
|
|
370
370
|
const fromLower = actualFrom.toLowerCase();
|
|
371
371
|
const toLower = actualTo.toLowerCase();
|
package/dist/spawn.js
CHANGED
|
@@ -43,7 +43,7 @@ let _npmCliPromiseSpawn;
|
|
|
43
43
|
// @__NO_SIDE_EFFECTS__
|
|
44
44
|
function getNpmcliPromiseSpawn() {
|
|
45
45
|
if (_npmCliPromiseSpawn === void 0) {
|
|
46
|
-
_npmCliPromiseSpawn = require("
|
|
46
|
+
_npmCliPromiseSpawn = require("./external/@npmcli/promise-spawn");
|
|
47
47
|
}
|
|
48
48
|
return _npmCliPromiseSpawn;
|
|
49
49
|
}
|
package/dist/spinner.js
CHANGED
|
@@ -98,7 +98,7 @@ function renderProgressBar(percentage, width = 20) {
|
|
|
98
98
|
const filled = Math.round(percentage / 100 * width);
|
|
99
99
|
const empty = width - filled;
|
|
100
100
|
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
101
|
-
const colors = require("
|
|
101
|
+
const colors = require("./external/yoctocolors-cjs");
|
|
102
102
|
return colors.cyan(bar);
|
|
103
103
|
}
|
|
104
104
|
let _cliSpinners;
|
package/dist/streams.js
CHANGED
|
@@ -28,7 +28,7 @@ let _streamingIterables;
|
|
|
28
28
|
// @__NO_SIDE_EFFECTS__
|
|
29
29
|
function getStreamingIterables() {
|
|
30
30
|
if (_streamingIterables === void 0) {
|
|
31
|
-
_streamingIterables = require("
|
|
31
|
+
_streamingIterables = require("./external/streaming-iterables");
|
|
32
32
|
}
|
|
33
33
|
return _streamingIterables;
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
6
6
|
"keywords": [
|
|
@@ -721,24 +721,19 @@
|
|
|
721
721
|
"build:watch": "node scripts/build-js.mjs --watch",
|
|
722
722
|
"check": "node scripts/check.mjs",
|
|
723
723
|
"claude": "node scripts/claude.mjs",
|
|
724
|
-
"clean": "
|
|
724
|
+
"clean": "node scripts/clean.mjs",
|
|
725
725
|
"cover": "node scripts/cover.mjs",
|
|
726
726
|
"dev": "pnpm run build:watch",
|
|
727
|
-
"fix": "node scripts/
|
|
727
|
+
"fix": "node scripts/lint.mjs --fix",
|
|
728
728
|
"fix:exports": "node scripts/generate-package-exports.mjs && node scripts/fix-commonjs-exports.mjs",
|
|
729
|
-
"lint": "
|
|
729
|
+
"lint": "node scripts/lint.mjs",
|
|
730
730
|
"lint-ci": "pnpm run lint",
|
|
731
731
|
"prepare": "husky",
|
|
732
732
|
"prepublishOnly": "pnpm run build",
|
|
733
|
-
"test": "
|
|
733
|
+
"test": "node scripts/test.mjs",
|
|
734
734
|
"test-ci": "vitest run",
|
|
735
735
|
"type-ci": "pnpm run check"
|
|
736
736
|
},
|
|
737
|
-
"dependencies": {
|
|
738
|
-
"semver": "7.7.2",
|
|
739
|
-
"which": "5.0.0",
|
|
740
|
-
"yoctocolors-cjs": "2.1.3"
|
|
741
|
-
},
|
|
742
737
|
"devDependencies": {
|
|
743
738
|
"@babel/core": "7.28.4",
|
|
744
739
|
"@babel/parser": "7.28.4",
|
|
@@ -746,6 +741,8 @@
|
|
|
746
741
|
"@babel/types": "7.28.4",
|
|
747
742
|
"@biomejs/biome": "2.2.4",
|
|
748
743
|
"@dotenvx/dotenvx": "1.49.0",
|
|
744
|
+
"@eslint/compat": "1.4.0",
|
|
745
|
+
"@eslint/js": "9.38.0",
|
|
749
746
|
"@inquirer/confirm": "5.1.16",
|
|
750
747
|
"@inquirer/input": "4.2.2",
|
|
751
748
|
"@inquirer/password": "4.0.18",
|
|
@@ -767,7 +764,11 @@
|
|
|
767
764
|
"del-cli": "6.0.0",
|
|
768
765
|
"esbuild": "0.25.11",
|
|
769
766
|
"eslint": "9.35.0",
|
|
767
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
768
|
+
"eslint-plugin-import-x": "4.16.1",
|
|
770
769
|
"eslint-plugin-n": "17.23.1",
|
|
770
|
+
"eslint-plugin-sort-destructure-keys": "2.0.0",
|
|
771
|
+
"eslint-plugin-unicorn": "61.0.2",
|
|
771
772
|
"fast-glob": "3.3.3",
|
|
772
773
|
"fast-sort": "3.4.1",
|
|
773
774
|
"get-east-asian-width": "1.3.0",
|