node-version-use 2.1.7 → 2.1.8
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/dist/cjs/lib/loadNodeVersionInstall.js +2 -2
- package/dist/cjs/lib/loadNodeVersionInstall.js.map +1 -1
- package/dist/cjs/worker.js +1 -1
- package/dist/cjs/worker.js.map +1 -1
- package/dist/esm/lib/loadNodeVersionInstall.js +2 -2
- package/dist/esm/lib/loadNodeVersionInstall.js.map +1 -1
- package/dist/esm/worker.js +1 -1
- package/dist/esm/worker.js.map +1 -1
- package/package.json +24 -24
|
@@ -66,8 +66,8 @@ function loadModule(moduleName, callback) {
|
|
|
66
66
|
Promise.resolve(moduleName).then(function(p) {
|
|
67
67
|
return /*#__PURE__*/ _interop_require_wildcard(require(p));
|
|
68
68
|
}).then(function(mod) {
|
|
69
|
-
var
|
|
70
|
-
callback(null, (
|
|
69
|
+
var _ref;
|
|
70
|
+
callback(null, (_ref = mod === null || mod === void 0 ? void 0 : mod.default) !== null && _ref !== void 0 ? _ref : null);
|
|
71
71
|
}).catch(callback);
|
|
72
72
|
} else {
|
|
73
73
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/lib/loadNodeVersionInstall.ts"],"sourcesContent":["import installModule from 'install-module-linked';\nimport type { InstallOptions, InstallResult } from 'node-version-install';\nimport path from 'path';\nimport url from 'url';\n\nconst _dirname = path.dirname(typeof __dirname !== 'undefined' ? __dirname : url.fileURLToPath(import.meta.url));\nconst nodeModules = path.join(_dirname, '..', '..', '..', 'node_modules');\nconst moduleName = 'node-version-install';\n\ntype InstallCallback = (err?: Error, results?: InstallResult[]) => void;\ntype InstallVersionFn = (version: string, options: InstallOptions, callback: InstallCallback) => void;\n\nlet cached: InstallVersionFn | undefined;\n\nfunction loadModule(moduleName, callback) {\n if (typeof require === 'undefined') {\n import(moduleName)\n .then((mod) => {\n callback(null, mod?.default ?? null);\n })\n .catch(callback);\n } else {\n try {\n callback(null, require(moduleName));\n } catch (err) {\n callback(err, null);\n }\n }\n}\n\nexport default function loadNodeVersionInstall(callback: (err: Error | null, installVersion: InstallVersionFn) => void): void {\n if (cached !== undefined) {\n callback(null, cached);\n return;\n }\n\n installModule(moduleName, nodeModules, {}, (err) => {\n if (err) return callback(err, null);\n loadModule(moduleName, (err, _cached: InstallVersionFn) => {\n if (err) return callback(err, null);\n cached = _cached;\n callback(null, cached);\n });\n });\n}\n"],"names":["loadNodeVersionInstall","_dirname","path","dirname","__dirname","url","fileURLToPath","nodeModules","join","moduleName","cached","loadModule","callback","require","then","mod","default","catch","err","undefined","installModule","_cached"],"mappings":";;;;+BA8BA;;;eAAwBA;;;0EA9BE;2DAET;0DACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhB,IAAMC,WAAWC,aAAI,CAACC,OAAO,CAAC,OAAOC,cAAc,cAAcA,YAAYC,YAAG,CAACC,aAAa,CAAC;AAC/F,IAAMC,cAAcL,aAAI,CAACM,IAAI,CAACP,UAAU,MAAM,MAAM,MAAM;AAC1D,IAAMQ,aAAa;AAKnB,IAAIC;AAEJ,SAASC,WAAWF,UAAU,EAAEG,QAAQ;IACtC,IAAI,OAAOC,YAAY,aAAa;QAClC,gBAAOJ;2DAAP;WACGK,IAAI,CAAC,SAACC
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/lib/loadNodeVersionInstall.ts"],"sourcesContent":["import installModule from 'install-module-linked';\nimport type { InstallOptions, InstallResult } from 'node-version-install';\nimport path from 'path';\nimport url from 'url';\n\nconst _dirname = path.dirname(typeof __dirname !== 'undefined' ? __dirname : url.fileURLToPath(import.meta.url));\nconst nodeModules = path.join(_dirname, '..', '..', '..', 'node_modules');\nconst moduleName = 'node-version-install';\n\ntype InstallCallback = (err?: Error, results?: InstallResult[]) => void;\ntype InstallVersionFn = (version: string, options: InstallOptions, callback: InstallCallback) => void;\n\nlet cached: InstallVersionFn | undefined;\n\nfunction loadModule(moduleName, callback) {\n if (typeof require === 'undefined') {\n import(moduleName)\n .then((mod) => {\n callback(null, mod?.default ?? null);\n })\n .catch(callback);\n } else {\n try {\n callback(null, require(moduleName));\n } catch (err) {\n callback(err, null);\n }\n }\n}\n\nexport default function loadNodeVersionInstall(callback: (err: Error | null, installVersion: InstallVersionFn) => void): void {\n if (cached !== undefined) {\n callback(null, cached);\n return;\n }\n\n installModule(moduleName, nodeModules, {}, (err) => {\n if (err) return callback(err, null);\n loadModule(moduleName, (err, _cached: InstallVersionFn) => {\n if (err) return callback(err, null);\n cached = _cached;\n callback(null, cached);\n });\n });\n}\n"],"names":["loadNodeVersionInstall","_dirname","path","dirname","__dirname","url","fileURLToPath","nodeModules","join","moduleName","cached","loadModule","callback","require","then","mod","default","catch","err","undefined","installModule","_cached"],"mappings":";;;;+BA8BA;;;eAAwBA;;;0EA9BE;2DAET;0DACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhB,IAAMC,WAAWC,aAAI,CAACC,OAAO,CAAC,OAAOC,cAAc,cAAcA,YAAYC,YAAG,CAACC,aAAa,CAAC;AAC/F,IAAMC,cAAcL,aAAI,CAACM,IAAI,CAACP,UAAU,MAAM,MAAM,MAAM;AAC1D,IAAMQ,aAAa;AAKnB,IAAIC;AAEJ,SAASC,WAAWF,UAAU,EAAEG,QAAQ;IACtC,IAAI,OAAOC,YAAY,aAAa;QAClC,gBAAOJ;2DAAP;WACGK,IAAI,CAAC,SAACC;;YACLH,SAAS,cAAMG,gBAAAA,0BAAAA,IAAKC,OAAO,uCAAI;QACjC,GACCC,KAAK,CAACL;IACX,OAAO;QACL,IAAI;YACFA,SAAS,MAAMC,QAAQJ;QACzB,EAAE,OAAOS,KAAK;YACZN,SAASM,KAAK;QAChB;IACF;AACF;AAEe,SAASlB,uBAAuBY,QAAuE;IACpH,IAAIF,WAAWS,WAAW;QACxBP,SAAS,MAAMF;QACf;IACF;IAEAU,IAAAA,4BAAa,EAACX,YAAYF,aAAa,CAAC,GAAG,SAACW;QAC1C,IAAIA,KAAK,OAAON,SAASM,KAAK;QAC9BP,WAAWF,YAAY,SAACS,KAAKG;YAC3B,IAAIH,KAAK,OAAON,SAASM,KAAK;YAC9BR,SAASW;YACTT,SAAS,MAAMF;QACjB;IACF;AACF"}
|
package/dist/cjs/worker.js
CHANGED
|
@@ -185,7 +185,7 @@ function worker(versionExpression, command, args, options, callback) {
|
|
|
185
185
|
error: new Error("Unexpected version results for version ".concat(version, ". Install ").concat(JSON.stringify(installs))),
|
|
186
186
|
result: null
|
|
187
187
|
});
|
|
188
|
-
return
|
|
188
|
+
return cb();
|
|
189
189
|
}
|
|
190
190
|
var spawnOptions = (0, _nodeversionutils.spawnOptions)(install.installPath, options);
|
|
191
191
|
var prefix = install.version;
|
package/dist/cjs/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/worker.ts"],"sourcesContent":["import spawn, { type SpawnOptions } from 'cross-spawn-cb';\nimport fs from 'fs';\nimport resolveVersions, { type VersionOptions } from 'node-resolve-versions';\nimport type { InstallOptions } from 'node-version-install';\nimport { spawnOptions as createSpawnOptions } from 'node-version-utils';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport resolveBin from 'resolve-bin-sync';\nimport spawnStreaming from 'spawn-streaming';\nimport { createSession, formatArguments } from 'spawn-term';\nimport { stringEndsWith } from './compat.ts';\nimport { storagePath } from './constants.ts';\nimport loadNodeVersionInstall from './lib/loadNodeVersionInstall.ts';\n\nimport type { Options, UseCallback, UseOptions, UseResult } from './types.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\n// Parse npm-generated .cmd wrapper to extract the JS script path\nfunction parseNpmCmdWrapper(cmdPath: string): string | null {\n try {\n const content = fs.readFileSync(cmdPath, 'utf8');\n // Match: \"%_prog%\" \"%dp0%\\node_modules\\...\\cli.js\" %*\n // or: \"%_prog%\" \"%dp0%\\path\\to\\script.js\" %*\n const match = content.match(/\"%_prog%\"\\s+\"?%dp0%\\\\([^\"]+)\"?\\s+%\\*/);\n if (match) {\n const relativePath = match[1];\n const cmdDir = path.dirname(cmdPath);\n return path.join(cmdDir, relativePath);\n }\n } catch (_e) {\n // ignore\n }\n return null;\n}\n\n// On Windows, resolve npm bin commands to their JS entry points to bypass .cmd wrappers\n// This fixes issues with nvm-windows where .cmd wrappers use symlinked node.exe directly\nfunction resolveCommand(command: string, args: string[]): { command: string; args: string[] } {\n if (!isWindows) return { command, args };\n\n // Case 1: Command is a .cmd file path\n if (stringEndsWith(command.toLowerCase(), '.cmd')) {\n const scriptPath = parseNpmCmdWrapper(command);\n if (scriptPath) {\n return { command: NODE, args: [scriptPath, ...args] };\n }\n }\n\n // Case 2: Try to resolve the command as an npm package bin from node_modules\n try {\n const binPath = resolveBin(command);\n return { command: NODE, args: [binPath, ...args] };\n } catch (_e) {\n // Not an npm package bin, use original command\n }\n\n return { command, args };\n}\n\nexport default function worker(versionExpression: string, command: string, args: string[], options: UseOptions, callback: UseCallback): undefined {\n // Load node-version-install lazily\n loadNodeVersionInstall((loadErr, installVersion) => {\n if (loadErr) return callback(loadErr);\n\n resolveVersions(versionExpression, options as VersionOptions, (err?: Error, versions?: string[]) => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`No versions found from expression: ${versionExpression}`));\n return;\n }\n\n const installOptions = { storagePath, ...options } as InstallOptions;\n const streamingOptions = options as Options;\n const results: UseResult[] = [];\n const queue = new Queue(1);\n\n // Create session once for all processes (only if multiple versions)\n const interactive = options.interactive !== false;\n const session = versions.length >= 2 && createSession && !streamingOptions.streaming ? createSession({ header: `${command} ${args.join(' ')}`, showStatusBar: true, interactive }) : null;\n\n versions.forEach((version: string) => {\n queue.defer((cb) => {\n installVersion(version, installOptions, (_err, installs) => {\n const install = installs && installs.length === 1 ? installs[0] : null;\n if (!install) {\n results.push({ install, command, version, error: new Error(`Unexpected version results for version ${version}. Install ${JSON.stringify(installs)}`), result: null });\n return
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/worker.ts"],"sourcesContent":["import spawn, { type SpawnOptions } from 'cross-spawn-cb';\nimport fs from 'fs';\nimport resolveVersions, { type VersionOptions } from 'node-resolve-versions';\nimport type { InstallOptions } from 'node-version-install';\nimport { spawnOptions as createSpawnOptions } from 'node-version-utils';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport resolveBin from 'resolve-bin-sync';\nimport spawnStreaming from 'spawn-streaming';\nimport { createSession, formatArguments } from 'spawn-term';\nimport { stringEndsWith } from './compat.ts';\nimport { storagePath } from './constants.ts';\nimport loadNodeVersionInstall from './lib/loadNodeVersionInstall.ts';\n\nimport type { Options, UseCallback, UseOptions, UseResult } from './types.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\n// Parse npm-generated .cmd wrapper to extract the JS script path\nfunction parseNpmCmdWrapper(cmdPath: string): string | null {\n try {\n const content = fs.readFileSync(cmdPath, 'utf8');\n // Match: \"%_prog%\" \"%dp0%\\node_modules\\...\\cli.js\" %*\n // or: \"%_prog%\" \"%dp0%\\path\\to\\script.js\" %*\n const match = content.match(/\"%_prog%\"\\s+\"?%dp0%\\\\([^\"]+)\"?\\s+%\\*/);\n if (match) {\n const relativePath = match[1];\n const cmdDir = path.dirname(cmdPath);\n return path.join(cmdDir, relativePath);\n }\n } catch (_e) {\n // ignore\n }\n return null;\n}\n\n// On Windows, resolve npm bin commands to their JS entry points to bypass .cmd wrappers\n// This fixes issues with nvm-windows where .cmd wrappers use symlinked node.exe directly\nfunction resolveCommand(command: string, args: string[]): { command: string; args: string[] } {\n if (!isWindows) return { command, args };\n\n // Case 1: Command is a .cmd file path\n if (stringEndsWith(command.toLowerCase(), '.cmd')) {\n const scriptPath = parseNpmCmdWrapper(command);\n if (scriptPath) {\n return { command: NODE, args: [scriptPath, ...args] };\n }\n }\n\n // Case 2: Try to resolve the command as an npm package bin from node_modules\n try {\n const binPath = resolveBin(command);\n return { command: NODE, args: [binPath, ...args] };\n } catch (_e) {\n // Not an npm package bin, use original command\n }\n\n return { command, args };\n}\n\nexport default function worker(versionExpression: string, command: string, args: string[], options: UseOptions, callback: UseCallback): undefined {\n // Load node-version-install lazily\n loadNodeVersionInstall((loadErr, installVersion) => {\n if (loadErr) return callback(loadErr);\n\n resolveVersions(versionExpression, options as VersionOptions, (err?: Error, versions?: string[]) => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`No versions found from expression: ${versionExpression}`));\n return;\n }\n\n const installOptions = { storagePath, ...options } as InstallOptions;\n const streamingOptions = options as Options;\n const results: UseResult[] = [];\n const queue = new Queue(1);\n\n // Create session once for all processes (only if multiple versions)\n const interactive = options.interactive !== false;\n const session = versions.length >= 2 && createSession && !streamingOptions.streaming ? createSession({ header: `${command} ${args.join(' ')}`, showStatusBar: true, interactive }) : null;\n\n versions.forEach((version: string) => {\n queue.defer((cb) => {\n installVersion(version, installOptions, (_err, installs) => {\n const install = installs && installs.length === 1 ? installs[0] : null;\n if (!install) {\n results.push({ install, command, version, error: new Error(`Unexpected version results for version ${version}. Install ${JSON.stringify(installs)}`), result: null });\n return cb();\n }\n const spawnOptions = createSpawnOptions(install.installPath, options as SpawnOptions);\n const prefix = install.version;\n\n function next(err?, res?): undefined {\n if (err && err.message.indexOf('ExperimentalWarning') >= 0) {\n res = err;\n err = null;\n }\n results.push({ install, command, version, error: err, result: res });\n cb();\n }\n\n // On Windows, resolve npm bin commands to bypass .cmd wrappers\n const resolved = resolveCommand(command, args);\n\n if (versions.length < 2) {\n // Show command when running single version (no terminal session, unless silent)\n if (!options.silent) console.log(`$ ${formatArguments([resolved.command].concat(resolved.args)).join(' ')}`);\n return spawn(resolved.command, resolved.args, spawnOptions, next);\n }\n if (session) session.spawn(resolved.command, resolved.args, spawnOptions, { group: prefix, expanded: streamingOptions.expanded }, next);\n else spawnStreaming(resolved.command, resolved.args, spawnOptions, { prefix }, next);\n });\n });\n });\n queue.await((err) => {\n if (session) {\n session.waitAndClose(() => {\n err ? callback(err) : callback(null, results);\n });\n } else {\n err ? callback(err) : callback(null, results);\n }\n });\n });\n });\n}\n"],"names":["worker","isWindows","process","platform","test","env","OSTYPE","NODE","parseNpmCmdWrapper","cmdPath","content","fs","readFileSync","match","relativePath","cmdDir","path","dirname","join","_e","resolveCommand","command","args","stringEndsWith","toLowerCase","scriptPath","binPath","resolveBin","versionExpression","options","callback","loadNodeVersionInstall","loadErr","installVersion","resolveVersions","err","versions","length","Error","installOptions","storagePath","streamingOptions","results","queue","Queue","interactive","session","createSession","streaming","header","showStatusBar","forEach","version","defer","cb","_err","installs","next","res","message","indexOf","push","install","error","result","JSON","stringify","spawnOptions","createSpawnOptions","installPath","prefix","resolved","silent","console","log","formatArguments","concat","spawn","group","expanded","spawnStreaming","await","waitAndClose"],"mappings":";;;;+BA6DA;;;eAAwBA;;;mEA7DiB;yDAC1B;0EACsC;gCAEF;2DAClC;8DACC;qEACK;qEACI;yBACoB;wBAChB;2BACH;+EACO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAInC,IAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMC,OAAON,YAAY,aAAa;AAEtC,iEAAiE;AACjE,SAASO,mBAAmBC,OAAe;IACzC,IAAI;QACF,IAAMC,UAAUC,WAAE,CAACC,YAAY,CAACH,SAAS;QACzC,uDAAuD;QACvD,8CAA8C;QAC9C,IAAMI,QAAQH,QAAQG,KAAK,CAAC;QAC5B,IAAIA,OAAO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;wBAEzC,IAAIc,SAASC,MAAM,GAAG,GAAG;4BACvB,gFAAgF;4BAChF,IAAI,CAACR,QAAQ2C,MAAM,EAAEC,QAAQC,GAAG,CAAC,AAAC,KAAwE,OAApEC,IAAAA,0BAAe,EAAC;gCAACJ,SAASlD,OAAO;6BAAC,CAACuD,MAAM,CAACL,SAASjD,IAAI,GAAGJ,IAAI,CAAC;4BACrG,OAAO2D,IAAAA,qBAAK,EAACN,SAASlD,OAAO,EAAEkD,SAASjD,IAAI,EAAE6C,cAAcV;wBAC9D;wBACA,IAAIX,SAASA,QAAQ+B,KAAK,CAACN,SAASlD,OAAO,EAAEkD,SAASjD,IAAI,EAAE6C,cAAc;4BAAEW,OAAOR;4BAAQS,UAAUtC,iBAAiBsC,QAAQ;wBAAC,GAAGtB;6BAC7HuB,IAAAA,uBAAc,EAACT,SAASlD,OAAO,EAAEkD,SAASjD,IAAI,EAAE6C,cAAc;4BAAEG,QAAAA;wBAAO,GAAGb;oBACjF;gBACF;YACF;YACAd,MAAMsC,KAAK,CAAC,SAAC9C;gBACX,IAAIW,SAAS;oBACXA,QAAQoC,YAAY,CAAC;wBACnB/C,MAAML,SAASK,OAAOL,SAAS,MAAMY;oBACvC;gBACF,OAAO;oBACLP,MAAML,SAASK,OAAOL,SAAS,MAAMY;gBACvC;YACF;QACF;IACF;AACF"}
|
|
@@ -8,8 +8,8 @@ let cached;
|
|
|
8
8
|
function loadModule(moduleName, callback) {
|
|
9
9
|
if (typeof require === 'undefined') {
|
|
10
10
|
import(moduleName).then((mod)=>{
|
|
11
|
-
var
|
|
12
|
-
callback(null, (
|
|
11
|
+
var _ref;
|
|
12
|
+
callback(null, (_ref = mod === null || mod === void 0 ? void 0 : mod.default) !== null && _ref !== void 0 ? _ref : null);
|
|
13
13
|
}).catch(callback);
|
|
14
14
|
} else {
|
|
15
15
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/lib/loadNodeVersionInstall.ts"],"sourcesContent":["import installModule from 'install-module-linked';\nimport type { InstallOptions, InstallResult } from 'node-version-install';\nimport path from 'path';\nimport url from 'url';\n\nconst _dirname = path.dirname(typeof __dirname !== 'undefined' ? __dirname : url.fileURLToPath(import.meta.url));\nconst nodeModules = path.join(_dirname, '..', '..', '..', 'node_modules');\nconst moduleName = 'node-version-install';\n\ntype InstallCallback = (err?: Error, results?: InstallResult[]) => void;\ntype InstallVersionFn = (version: string, options: InstallOptions, callback: InstallCallback) => void;\n\nlet cached: InstallVersionFn | undefined;\n\nfunction loadModule(moduleName, callback) {\n if (typeof require === 'undefined') {\n import(moduleName)\n .then((mod) => {\n callback(null, mod?.default ?? null);\n })\n .catch(callback);\n } else {\n try {\n callback(null, require(moduleName));\n } catch (err) {\n callback(err, null);\n }\n }\n}\n\nexport default function loadNodeVersionInstall(callback: (err: Error | null, installVersion: InstallVersionFn) => void): void {\n if (cached !== undefined) {\n callback(null, cached);\n return;\n }\n\n installModule(moduleName, nodeModules, {}, (err) => {\n if (err) return callback(err, null);\n loadModule(moduleName, (err, _cached: InstallVersionFn) => {\n if (err) return callback(err, null);\n cached = _cached;\n callback(null, cached);\n });\n });\n}\n"],"names":["installModule","path","url","_dirname","dirname","__dirname","fileURLToPath","nodeModules","join","moduleName","cached","loadModule","callback","require","then","mod","default","catch","err","loadNodeVersionInstall","undefined","_cached"],"mappings":"AAAA,OAAOA,mBAAmB,wBAAwB;AAElD,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AAEtB,MAAMC,WAAWF,KAAKG,OAAO,CAAC,OAAOC,cAAc,cAAcA,YAAYH,IAAII,aAAa,CAAC,YAAYJ,GAAG;AAC9G,MAAMK,cAAcN,KAAKO,IAAI,CAACL,UAAU,MAAM,MAAM,MAAM;AAC1D,MAAMM,aAAa;AAKnB,IAAIC;AAEJ,SAASC,WAAWF,UAAU,EAAEG,QAAQ;IACtC,IAAI,OAAOC,YAAY,aAAa;QAClC,MAAM,CAACJ,YACJK,IAAI,CAAC,CAACC
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/lib/loadNodeVersionInstall.ts"],"sourcesContent":["import installModule from 'install-module-linked';\nimport type { InstallOptions, InstallResult } from 'node-version-install';\nimport path from 'path';\nimport url from 'url';\n\nconst _dirname = path.dirname(typeof __dirname !== 'undefined' ? __dirname : url.fileURLToPath(import.meta.url));\nconst nodeModules = path.join(_dirname, '..', '..', '..', 'node_modules');\nconst moduleName = 'node-version-install';\n\ntype InstallCallback = (err?: Error, results?: InstallResult[]) => void;\ntype InstallVersionFn = (version: string, options: InstallOptions, callback: InstallCallback) => void;\n\nlet cached: InstallVersionFn | undefined;\n\nfunction loadModule(moduleName, callback) {\n if (typeof require === 'undefined') {\n import(moduleName)\n .then((mod) => {\n callback(null, mod?.default ?? null);\n })\n .catch(callback);\n } else {\n try {\n callback(null, require(moduleName));\n } catch (err) {\n callback(err, null);\n }\n }\n}\n\nexport default function loadNodeVersionInstall(callback: (err: Error | null, installVersion: InstallVersionFn) => void): void {\n if (cached !== undefined) {\n callback(null, cached);\n return;\n }\n\n installModule(moduleName, nodeModules, {}, (err) => {\n if (err) return callback(err, null);\n loadModule(moduleName, (err, _cached: InstallVersionFn) => {\n if (err) return callback(err, null);\n cached = _cached;\n callback(null, cached);\n });\n });\n}\n"],"names":["installModule","path","url","_dirname","dirname","__dirname","fileURLToPath","nodeModules","join","moduleName","cached","loadModule","callback","require","then","mod","default","catch","err","loadNodeVersionInstall","undefined","_cached"],"mappings":"AAAA,OAAOA,mBAAmB,wBAAwB;AAElD,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AAEtB,MAAMC,WAAWF,KAAKG,OAAO,CAAC,OAAOC,cAAc,cAAcA,YAAYH,IAAII,aAAa,CAAC,YAAYJ,GAAG;AAC9G,MAAMK,cAAcN,KAAKO,IAAI,CAACL,UAAU,MAAM,MAAM,MAAM;AAC1D,MAAMM,aAAa;AAKnB,IAAIC;AAEJ,SAASC,WAAWF,UAAU,EAAEG,QAAQ;IACtC,IAAI,OAAOC,YAAY,aAAa;QAClC,MAAM,CAACJ,YACJK,IAAI,CAAC,CAACC;;YACLH,SAAS,cAAMG,gBAAAA,0BAAAA,IAAKC,OAAO,uCAAI;QACjC,GACCC,KAAK,CAACL;IACX,OAAO;QACL,IAAI;YACFA,SAAS,MAAMC,QAAQJ;QACzB,EAAE,OAAOS,KAAK;YACZN,SAASM,KAAK;QAChB;IACF;AACF;AAEA,eAAe,SAASC,uBAAuBP,QAAuE;IACpH,IAAIF,WAAWU,WAAW;QACxBR,SAAS,MAAMF;QACf;IACF;IAEAV,cAAcS,YAAYF,aAAa,CAAC,GAAG,CAACW;QAC1C,IAAIA,KAAK,OAAON,SAASM,KAAK;QAC9BP,WAAWF,YAAY,CAACS,KAAKG;YAC3B,IAAIH,KAAK,OAAON,SAASM,KAAK;YAC9BR,SAASW;YACTT,SAAS,MAAMF;QACjB;IACF;AACF"}
|
package/dist/esm/worker.js
CHANGED
|
@@ -106,7 +106,7 @@ export default function worker(versionExpression, command, args, options, callba
|
|
|
106
106
|
error: new Error(`Unexpected version results for version ${version}. Install ${JSON.stringify(installs)}`),
|
|
107
107
|
result: null
|
|
108
108
|
});
|
|
109
|
-
return
|
|
109
|
+
return cb();
|
|
110
110
|
}
|
|
111
111
|
const spawnOptions = createSpawnOptions(install.installPath, options);
|
|
112
112
|
const prefix = install.version;
|
package/dist/esm/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/worker.ts"],"sourcesContent":["import spawn, { type SpawnOptions } from 'cross-spawn-cb';\nimport fs from 'fs';\nimport resolveVersions, { type VersionOptions } from 'node-resolve-versions';\nimport type { InstallOptions } from 'node-version-install';\nimport { spawnOptions as createSpawnOptions } from 'node-version-utils';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport resolveBin from 'resolve-bin-sync';\nimport spawnStreaming from 'spawn-streaming';\nimport { createSession, formatArguments } from 'spawn-term';\nimport { stringEndsWith } from './compat.ts';\nimport { storagePath } from './constants.ts';\nimport loadNodeVersionInstall from './lib/loadNodeVersionInstall.ts';\n\nimport type { Options, UseCallback, UseOptions, UseResult } from './types.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\n// Parse npm-generated .cmd wrapper to extract the JS script path\nfunction parseNpmCmdWrapper(cmdPath: string): string | null {\n try {\n const content = fs.readFileSync(cmdPath, 'utf8');\n // Match: \"%_prog%\" \"%dp0%\\node_modules\\...\\cli.js\" %*\n // or: \"%_prog%\" \"%dp0%\\path\\to\\script.js\" %*\n const match = content.match(/\"%_prog%\"\\s+\"?%dp0%\\\\([^\"]+)\"?\\s+%\\*/);\n if (match) {\n const relativePath = match[1];\n const cmdDir = path.dirname(cmdPath);\n return path.join(cmdDir, relativePath);\n }\n } catch (_e) {\n // ignore\n }\n return null;\n}\n\n// On Windows, resolve npm bin commands to their JS entry points to bypass .cmd wrappers\n// This fixes issues with nvm-windows where .cmd wrappers use symlinked node.exe directly\nfunction resolveCommand(command: string, args: string[]): { command: string; args: string[] } {\n if (!isWindows) return { command, args };\n\n // Case 1: Command is a .cmd file path\n if (stringEndsWith(command.toLowerCase(), '.cmd')) {\n const scriptPath = parseNpmCmdWrapper(command);\n if (scriptPath) {\n return { command: NODE, args: [scriptPath, ...args] };\n }\n }\n\n // Case 2: Try to resolve the command as an npm package bin from node_modules\n try {\n const binPath = resolveBin(command);\n return { command: NODE, args: [binPath, ...args] };\n } catch (_e) {\n // Not an npm package bin, use original command\n }\n\n return { command, args };\n}\n\nexport default function worker(versionExpression: string, command: string, args: string[], options: UseOptions, callback: UseCallback): undefined {\n // Load node-version-install lazily\n loadNodeVersionInstall((loadErr, installVersion) => {\n if (loadErr) return callback(loadErr);\n\n resolveVersions(versionExpression, options as VersionOptions, (err?: Error, versions?: string[]) => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`No versions found from expression: ${versionExpression}`));\n return;\n }\n\n const installOptions = { storagePath, ...options } as InstallOptions;\n const streamingOptions = options as Options;\n const results: UseResult[] = [];\n const queue = new Queue(1);\n\n // Create session once for all processes (only if multiple versions)\n const interactive = options.interactive !== false;\n const session = versions.length >= 2 && createSession && !streamingOptions.streaming ? createSession({ header: `${command} ${args.join(' ')}`, showStatusBar: true, interactive }) : null;\n\n versions.forEach((version: string) => {\n queue.defer((cb) => {\n installVersion(version, installOptions, (_err, installs) => {\n const install = installs && installs.length === 1 ? installs[0] : null;\n if (!install) {\n results.push({ install, command, version, error: new Error(`Unexpected version results for version ${version}. Install ${JSON.stringify(installs)}`), result: null });\n return
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/worker.ts"],"sourcesContent":["import spawn, { type SpawnOptions } from 'cross-spawn-cb';\nimport fs from 'fs';\nimport resolveVersions, { type VersionOptions } from 'node-resolve-versions';\nimport type { InstallOptions } from 'node-version-install';\nimport { spawnOptions as createSpawnOptions } from 'node-version-utils';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport resolveBin from 'resolve-bin-sync';\nimport spawnStreaming from 'spawn-streaming';\nimport { createSession, formatArguments } from 'spawn-term';\nimport { stringEndsWith } from './compat.ts';\nimport { storagePath } from './constants.ts';\nimport loadNodeVersionInstall from './lib/loadNodeVersionInstall.ts';\n\nimport type { Options, UseCallback, UseOptions, UseResult } from './types.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\n// Parse npm-generated .cmd wrapper to extract the JS script path\nfunction parseNpmCmdWrapper(cmdPath: string): string | null {\n try {\n const content = fs.readFileSync(cmdPath, 'utf8');\n // Match: \"%_prog%\" \"%dp0%\\node_modules\\...\\cli.js\" %*\n // or: \"%_prog%\" \"%dp0%\\path\\to\\script.js\" %*\n const match = content.match(/\"%_prog%\"\\s+\"?%dp0%\\\\([^\"]+)\"?\\s+%\\*/);\n if (match) {\n const relativePath = match[1];\n const cmdDir = path.dirname(cmdPath);\n return path.join(cmdDir, relativePath);\n }\n } catch (_e) {\n // ignore\n }\n return null;\n}\n\n// On Windows, resolve npm bin commands to their JS entry points to bypass .cmd wrappers\n// This fixes issues with nvm-windows where .cmd wrappers use symlinked node.exe directly\nfunction resolveCommand(command: string, args: string[]): { command: string; args: string[] } {\n if (!isWindows) return { command, args };\n\n // Case 1: Command is a .cmd file path\n if (stringEndsWith(command.toLowerCase(), '.cmd')) {\n const scriptPath = parseNpmCmdWrapper(command);\n if (scriptPath) {\n return { command: NODE, args: [scriptPath, ...args] };\n }\n }\n\n // Case 2: Try to resolve the command as an npm package bin from node_modules\n try {\n const binPath = resolveBin(command);\n return { command: NODE, args: [binPath, ...args] };\n } catch (_e) {\n // Not an npm package bin, use original command\n }\n\n return { command, args };\n}\n\nexport default function worker(versionExpression: string, command: string, args: string[], options: UseOptions, callback: UseCallback): undefined {\n // Load node-version-install lazily\n loadNodeVersionInstall((loadErr, installVersion) => {\n if (loadErr) return callback(loadErr);\n\n resolveVersions(versionExpression, options as VersionOptions, (err?: Error, versions?: string[]) => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`No versions found from expression: ${versionExpression}`));\n return;\n }\n\n const installOptions = { storagePath, ...options } as InstallOptions;\n const streamingOptions = options as Options;\n const results: UseResult[] = [];\n const queue = new Queue(1);\n\n // Create session once for all processes (only if multiple versions)\n const interactive = options.interactive !== false;\n const session = versions.length >= 2 && createSession && !streamingOptions.streaming ? createSession({ header: `${command} ${args.join(' ')}`, showStatusBar: true, interactive }) : null;\n\n versions.forEach((version: string) => {\n queue.defer((cb) => {\n installVersion(version, installOptions, (_err, installs) => {\n const install = installs && installs.length === 1 ? installs[0] : null;\n if (!install) {\n results.push({ install, command, version, error: new Error(`Unexpected version results for version ${version}. Install ${JSON.stringify(installs)}`), result: null });\n return cb();\n }\n const spawnOptions = createSpawnOptions(install.installPath, options as SpawnOptions);\n const prefix = install.version;\n\n function next(err?, res?): undefined {\n if (err && err.message.indexOf('ExperimentalWarning') >= 0) {\n res = err;\n err = null;\n }\n results.push({ install, command, version, error: err, result: res });\n cb();\n }\n\n // On Windows, resolve npm bin commands to bypass .cmd wrappers\n const resolved = resolveCommand(command, args);\n\n if (versions.length < 2) {\n // Show command when running single version (no terminal session, unless silent)\n if (!options.silent) console.log(`$ ${formatArguments([resolved.command].concat(resolved.args)).join(' ')}`);\n return spawn(resolved.command, resolved.args, spawnOptions, next);\n }\n if (session) session.spawn(resolved.command, resolved.args, spawnOptions, { group: prefix, expanded: streamingOptions.expanded }, next);\n else spawnStreaming(resolved.command, resolved.args, spawnOptions, { prefix }, next);\n });\n });\n });\n queue.await((err) => {\n if (session) {\n session.waitAndClose(() => {\n err ? callback(err) : callback(null, results);\n });\n } else {\n err ? callback(err) : callback(null, results);\n }\n });\n });\n });\n}\n"],"names":["spawn","fs","resolveVersions","spawnOptions","createSpawnOptions","path","Queue","resolveBin","spawnStreaming","createSession","formatArguments","stringEndsWith","storagePath","loadNodeVersionInstall","isWindows","process","platform","test","env","OSTYPE","NODE","parseNpmCmdWrapper","cmdPath","content","readFileSync","match","relativePath","cmdDir","dirname","join","_e","resolveCommand","command","args","toLowerCase","scriptPath","binPath","worker","versionExpression","options","callback","loadErr","installVersion","err","versions","length","Error","installOptions","streamingOptions","results","queue","interactive","session","streaming","header","showStatusBar","forEach","version","defer","cb","_err","installs","install","push","error","JSON","stringify","result","installPath","prefix","next","res","message","indexOf","resolved","silent","console","log","concat","group","expanded","await","waitAndClose"],"mappings":"AAAA,OAAOA,WAAkC,iBAAiB;AAC1D,OAAOC,QAAQ,KAAK;AACpB,OAAOC,qBAA8C,wBAAwB;AAE7E,SAASC,gBAAgBC,kBAAkB,QAAQ,qBAAqB;AACxE,OAAOC,UAAU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
|
{
|
|
2
2
|
"name": "node-version-use",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "Cross-platform solution for using multiple versions of node. Useful for compatibility testing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -48,39 +48,39 @@
|
|
|
48
48
|
"version": "tsds version"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"cross-spawn-cb": "^2.
|
|
52
|
-
"env-path-key": "^1.
|
|
53
|
-
"exit-compat": "^1.0.
|
|
54
|
-
"fs-remove-compat": "^0.
|
|
55
|
-
"get-file-compat": "^0.
|
|
51
|
+
"cross-spawn-cb": "^2.0.0",
|
|
52
|
+
"env-path-key": "^1.0.0",
|
|
53
|
+
"exit-compat": "^1.0.0",
|
|
54
|
+
"fs-remove-compat": "^1.0.0",
|
|
55
|
+
"get-file-compat": "^2.0.0",
|
|
56
56
|
"getopts-compat": "^2.2.6",
|
|
57
57
|
"homedir-polyfill": "^1.0.3",
|
|
58
|
-
"install-module-linked": "^1.3.
|
|
59
|
-
"mkdirp-classic": "^0.5.
|
|
58
|
+
"install-module-linked": "^1.3.17",
|
|
59
|
+
"mkdirp-classic": "^0.5.2",
|
|
60
60
|
"module-root-sync": "^2.0.2",
|
|
61
|
-
"node-resolve-versions": "^1.
|
|
62
|
-
"node-version-utils": "^1.
|
|
63
|
-
"queue-cb": "^1.
|
|
61
|
+
"node-resolve-versions": "^1.0.0",
|
|
62
|
+
"node-version-utils": "^1.0.2",
|
|
63
|
+
"queue-cb": "^1.0.0",
|
|
64
64
|
"resolve-bin-sync": "^1.0.12",
|
|
65
65
|
"spawn-streaming": "^1.1.15",
|
|
66
66
|
"spawn-term": "^3.3.5",
|
|
67
|
-
"tar-iterator": "^3.1.
|
|
68
|
-
"zip-iterator": "^3.0.
|
|
67
|
+
"tar-iterator": "^3.1.11",
|
|
68
|
+
"zip-iterator": "^3.0.18"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@types/mocha": "
|
|
72
|
-
"@types/node": "
|
|
71
|
+
"@types/mocha": "*",
|
|
72
|
+
"@types/node": "*",
|
|
73
73
|
"cr": "^0.1.0",
|
|
74
|
-
"fs-copy-compat": "^0.
|
|
75
|
-
"fs-remove-compat": "^0.
|
|
74
|
+
"fs-copy-compat": "^1.0.0",
|
|
75
|
+
"fs-remove-compat": "^1.0.0",
|
|
76
76
|
"is-version": "^1.0.9",
|
|
77
|
-
"mkdirp-classic": "^0.5.
|
|
78
|
-
"node-version-install": "^1.5
|
|
79
|
-
"node-version-use": "
|
|
80
|
-
"os-shim": "^0.1.
|
|
81
|
-
"pinkie-promise": "
|
|
82
|
-
"ts-dev-stack": "
|
|
83
|
-
"tsds-config": "
|
|
77
|
+
"mkdirp-classic": "^0.5.2",
|
|
78
|
+
"node-version-install": "^1.0.5",
|
|
79
|
+
"node-version-use": "*",
|
|
80
|
+
"os-shim": "^0.1.0",
|
|
81
|
+
"pinkie-promise": "*",
|
|
82
|
+
"ts-dev-stack": "*",
|
|
83
|
+
"tsds-config": "*"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=0.8"
|