node-version-use 2.1.6 → 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/assets/installBinaries.cjs +284 -0
- package/assets/postinstall.cjs +11 -404
- package/dist/cjs/assets/installBinaries.cjs +284 -0
- package/dist/cjs/assets/installBinaries.cjs.map +1 -0
- package/dist/cjs/assets/installBinaries.d.cts +1 -0
- package/dist/cjs/assets/postinstall.cjs +11 -404
- package/dist/cjs/assets/postinstall.cjs.map +1 -1
- package/dist/cjs/commands/index.js +2 -3
- package/dist/cjs/commands/index.js.map +1 -1
- package/dist/cjs/commands/setup.js +23 -41
- package/dist/cjs/commands/setup.js.map +1 -1
- package/dist/cjs/commands/teardown.js +2 -1
- package/dist/cjs/commands/teardown.js.map +1 -1
- package/dist/cjs/compat.d.cts +1 -0
- package/dist/cjs/compat.d.ts +1 -0
- package/dist/cjs/compat.js +11 -4
- package/dist/cjs/compat.js.map +1 -1
- 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/assets/installBinaries.cjs +282 -0
- package/dist/esm/assets/installBinaries.cjs.map +1 -0
- package/dist/esm/assets/installBinaries.d.cts +1 -0
- package/dist/esm/assets/postinstall.cjs +11 -404
- package/dist/esm/assets/postinstall.cjs.map +1 -1
- package/dist/esm/commands/index.js +2 -3
- package/dist/esm/commands/index.js.map +1 -1
- package/dist/esm/commands/setup.js +24 -42
- package/dist/esm/commands/setup.js.map +1 -1
- package/dist/esm/commands/teardown.js +2 -1
- package/dist/esm/commands/teardown.js.map +1 -1
- package/dist/esm/compat.d.ts +1 -0
- package/dist/esm/compat.js +8 -4
- package/dist/esm/compat.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 +27 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/commands/setup.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/commands/setup.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport Module from 'module';\nimport path from 'path';\nimport { readdirWithTypes } from '../compat.ts';\nimport { storagePath } from '../constants.ts';\nimport { findInstalledVersions } from '../lib/findInstalledVersions.ts';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst { installBinaries, printInstructions } = _require('../assets/installBinaries.cjs');\n\n/**\n * nvu setup [--shims]\n *\n * Install/reinstall nvu binaries to ~/.nvu/bin\n * With --shims: create shims for existing global packages\n */\nexport default function setupCmd(args: string[]): void {\n const options = getopts(args, { boolean: ['force'] });\n\n installBinaries(options, (err, installed) => {\n if (err) {\n console.error(`Setup failed: ${err.message || err}`);\n exit(1);\n return;\n }\n\n printInstructions();\n if (!installed) console.log('Use --force to reinstall.');\n\n if (options.force) {\n const binDir = path.join(storagePath, 'bin');\n createShimsForGlobalPackages(binDir);\n return;\n }\n });\n}\n\n/**\n * Create shims for all global packages in the default Node version\n */\nfunction createShimsForGlobalPackages(binDir: string): void {\n // Read default version\n const defaultPath = path.join(storagePath, 'default');\n if (!fs.existsSync(defaultPath)) {\n console.log('No default Node version set.');\n console.log('Set one with: nvu default <version>');\n exit(1);\n return;\n }\n\n const defaultVersion = fs.readFileSync(defaultPath, 'utf8').trim();\n const versionsDir = path.join(storagePath, 'installed');\n\n // Resolve to exact version\n const matches = findInstalledVersions(versionsDir, defaultVersion);\n if (matches.length === 0) {\n console.log(`Default version ${defaultVersion} is not installed.`);\n exit(1);\n return;\n }\n\n const resolvedVersion = matches[matches.length - 1];\n const nodeBinDir = path.join(versionsDir, resolvedVersion, 'bin');\n\n if (!fs.existsSync(nodeBinDir)) {\n console.log(`No bin directory found for ${resolvedVersion}`);\n exit(1);\n return;\n }\n\n // Get the node shim to copy from\n const nodeShim = path.join(binDir, 'node');\n if (!fs.existsSync(nodeShim)) {\n console.log('Node shim not found. Run: nvu setup');\n exit(1);\n return;\n }\n\n // Scan binaries in Node's bin directory\n const entries = readdirWithTypes(nodeBinDir);\n let created = 0;\n let skipped = 0;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n const name = entry.name;\n\n // Skip our routing shims (node/npm/npx) - don't overwrite them\n if (name === 'node' || name === 'npm' || name === 'npx') continue;\n const shimPath = path.join(binDir, name);\n\n // Skip if shim already exists\n if (fs.existsSync(shimPath)) {\n skipped++;\n continue;\n }\n\n // Copy the node shim\n try {\n const shimContent = fs.readFileSync(nodeShim);\n fs.writeFileSync(shimPath, shimContent);\n fs.chmodSync(shimPath, 493); // 0755\n console.log(`Created shim: ${name}`);\n created++;\n } catch (err) {\n console.error(`Failed to create shim for ${name}: ${(err as Error).message}`);\n }\n }\n\n console.log('');\n console.log(`Done. Created ${created} shims, skipped ${skipped} (already exists).`);\n exit(0);\n}\n"],"names":["exit","fs","getopts","Module","path","readdirWithTypes","storagePath","findInstalledVersions","_require","require","createRequire","url","installBinaries","printInstructions","setupCmd","args","options","boolean","err","installed","console","error","message","log","force","binDir","join","createShimsForGlobalPackages","defaultPath","existsSync","defaultVersion","readFileSync","trim","versionsDir","matches","length","resolvedVersion","nodeBinDir","nodeShim","entries","created","skipped","i","entry","name","shimPath","shimContent","writeFileSync","chmodSync"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,YAAY,SAAS;AAC5B,OAAOC,UAAU,OAAO;AACxB,SAASC,gBAAgB,QAAQ,eAAe;AAChD,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,qBAAqB,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s from 'fs';
|
|
|
3
3
|
import { rmSync } from 'fs-remove-compat';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { storagePath } from '../constants.js';
|
|
6
|
+
const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
|
|
6
7
|
/**
|
|
7
8
|
* nvu teardown
|
|
8
9
|
*
|
|
@@ -14,7 +15,7 @@ import { storagePath } from '../constants.js';
|
|
|
14
15
|
'npm',
|
|
15
16
|
'npx'
|
|
16
17
|
];
|
|
17
|
-
const ext =
|
|
18
|
+
const ext = isWindows ? '.exe' : '';
|
|
18
19
|
let removed = 0;
|
|
19
20
|
for(let i = 0; i < binaries.length; i++){
|
|
20
21
|
const binaryPath = path.join(binDir, binaries[i] + ext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/commands/teardown.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport { rmSync } from 'fs-remove-compat';\nimport path from 'path';\nimport { storagePath } from '../constants.ts';\n\n/**\n * nvu teardown\n *\n * Remove nvu binaries from ~/.nvu/bin\n */\nexport default function teardownCmd(_args: string[]): void {\n const binDir = path.join(storagePath, 'bin');\n\n const binaries = ['node', 'npm', 'npx'];\n const ext =
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/commands/teardown.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport { rmSync } from 'fs-remove-compat';\nimport path from 'path';\nimport { storagePath } from '../constants.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\n/**\n * nvu teardown\n *\n * Remove nvu binaries from ~/.nvu/bin\n */\nexport default function teardownCmd(_args: string[]): void {\n const binDir = path.join(storagePath, 'bin');\n\n const binaries = ['node', 'npm', 'npx'];\n const ext = isWindows ? '.exe' : '';\n\n let removed = 0;\n for (let i = 0; i < binaries.length; i++) {\n const binaryPath = path.join(binDir, binaries[i] + ext);\n if (fs.existsSync(binaryPath)) {\n rmSync(binaryPath, { force: true });\n removed++;\n }\n }\n\n if (removed > 0) {\n console.log(`Removed ${removed} binary(s) from ${binDir}`);\n console.log('');\n console.log('You may also want to remove ~/.nvu/bin from your PATH.');\n } else {\n console.log('No binaries found to remove.');\n }\n\n exit(0);\n}\n"],"names":["exit","fs","rmSync","path","storagePath","isWindows","process","platform","test","env","OSTYPE","teardownCmd","_args","binDir","join","binaries","ext","removed","i","length","binaryPath","existsSync","force","console","log"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,UAAU,OAAO;AACxB,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,MAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAE3F;;;;CAIC,GACD,eAAe,SAASC,YAAYC,KAAe;IACjD,MAAMC,SAASV,KAAKW,IAAI,CAACV,aAAa;IAEtC,MAAMW,WAAW;QAAC;QAAQ;QAAO;KAAM;IACvC,MAAMC,MAAMX,YAAY,SAAS;IAEjC,IAAIY,UAAU;IACd,IAAK,IAAIC,IAAI,GAAGA,IAAIH,SAASI,MAAM,EAAED,IAAK;QACxC,MAAME,aAAajB,KAAKW,IAAI,CAACD,QAAQE,QAAQ,CAACG,EAAE,GAAGF;QACnD,IAAIf,GAAGoB,UAAU,CAACD,aAAa;YAC7BlB,OAAOkB,YAAY;gBAAEE,OAAO;YAAK;YACjCL;QACF;IACF;IAEA,IAAIA,UAAU,GAAG;QACfM,QAAQC,GAAG,CAAC,CAAC,QAAQ,EAAEP,QAAQ,gBAAgB,EAAEJ,QAAQ;QACzDU,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;IACd,OAAO;QACLD,QAAQC,GAAG,CAAC;IACd;IAEAxB,KAAK;AACP"}
|
package/dist/esm/compat.d.ts
CHANGED
package/dist/esm/compat.js
CHANGED
|
@@ -9,12 +9,16 @@ import path from 'path';
|
|
|
9
9
|
const _require = typeof require === 'undefined' ? _Module.createRequire(import.meta.url) : require;
|
|
10
10
|
const hasHomedir = typeof os.homedir === 'function';
|
|
11
11
|
export function homedir() {
|
|
12
|
-
if (hasHomedir)
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const home = _require('homedir-polyfill');
|
|
12
|
+
if (hasHomedir) return os.homedir();
|
|
13
|
+
const home = require('homedir-polyfill');
|
|
16
14
|
return home();
|
|
17
15
|
}
|
|
16
|
+
const hasTmpdir = typeof os.tmpdir === 'function';
|
|
17
|
+
export function tmpdir() {
|
|
18
|
+
if (hasTmpdir) return os.tmpdir();
|
|
19
|
+
const osShim = require('os-shim');
|
|
20
|
+
return osShim.tmpdir();
|
|
21
|
+
}
|
|
18
22
|
/**
|
|
19
23
|
* String.prototype.endsWith wrapper for Node.js 0.8+
|
|
20
24
|
* - Uses native endsWith on Node 4.0+ / ES2015+
|
package/dist/esm/compat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport fs from 'fs';\nimport _Module from 'module';\nimport os from 'os';\nimport path from 'path';\n\n// Use existing require in CJS, or createRequire in ESM (Node 12.2+)\nconst _require = typeof require === 'undefined' ? _Module.createRequire(import.meta.url) : require;\n\nconst hasHomedir = typeof os.homedir === 'function';\
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport fs from 'fs';\nimport _Module from 'module';\nimport os from 'os';\nimport path from 'path';\n\n// Use existing require in CJS, or createRequire in ESM (Node 12.2+)\nconst _require = typeof require === 'undefined' ? _Module.createRequire(import.meta.url) : require;\n\nconst hasHomedir = typeof os.homedir === 'function';\nexport function homedir(): string {\n if (hasHomedir) return os.homedir();\n const home = require('homedir-polyfill');\n return home();\n}\n\nconst hasTmpdir = typeof os.tmpdir === 'function';\nexport function tmpdir(): string {\n if (hasTmpdir) return os.tmpdir();\n const osShim = require('os-shim');\n return osShim.tmpdir();\n}\n\n/**\n * String.prototype.endsWith wrapper for Node.js 0.8+\n * - Uses native endsWith on Node 4.0+ / ES2015+\n * - Falls back to lastIndexOf on Node 0.8-3.x\n */\nconst hasEndsWith = typeof String.prototype.endsWith === 'function';\n\nexport function stringEndsWith(str: string, search: string, position?: number): boolean {\n if (hasEndsWith) {\n return str.endsWith(search, position);\n }\n const len = position === undefined ? str.length : position;\n return str.lastIndexOf(search) === len - search.length;\n}\n\n/**\n * Recursive mkdir for Node.js 0.8+\n */\nexport function mkdirpSync(dir: string): void {\n const mkdirp = _require('mkdirp-classic');\n mkdirp.sync(dir);\n}\n\n/**\n * Recursive rm for Node.js 0.8+\n */\nexport function rmSync(dir: string): void {\n const safeRmSync = _require('fs-remove-compat').safeRmSync;\n safeRmSync(dir);\n}\n\n/**\n * Read directory entries with types for Node.js 0.8+\n * Returns array of {name, isDirectory()}\n */\nexport interface DirEntry {\n name: string;\n isDirectory(): boolean;\n}\n\nexport function readdirWithTypes(dir: string): DirEntry[] {\n const names = fs.readdirSync(dir);\n return names.map((name) => {\n const fullPath = path.join(dir, name);\n let stat: fs.Stats;\n try {\n stat = fs.statSync(fullPath);\n } catch (_e) {\n // If stat fails, treat as non-directory\n return { name: name, isDirectory: () => false };\n }\n return {\n name: name,\n isDirectory: () => stat.isDirectory(),\n };\n });\n}\n"],"names":["fs","_Module","os","path","_require","require","createRequire","url","hasHomedir","homedir","home","hasTmpdir","tmpdir","osShim","hasEndsWith","String","prototype","endsWith","stringEndsWith","str","search","position","len","undefined","length","lastIndexOf","mkdirpSync","dir","mkdirp","sync","rmSync","safeRmSync","readdirWithTypes","names","readdirSync","map","name","fullPath","join","stat","statSync","_e","isDirectory"],"mappings":"AAAA;;;CAGC,GACD,OAAOA,QAAQ,KAAK;AACpB,OAAOC,aAAa,SAAS;AAC7B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AAExB,oEAAoE;AACpE,MAAMC,WAAW,OAAOC,YAAY,cAAcJ,QAAQK,aAAa,CAAC,YAAYC,GAAG,IAAIF;AAE3F,MAAMG,aAAa,OAAON,GAAGO,OAAO,KAAK;AACzC,OAAO,SAASA;IACd,IAAID,YAAY,OAAON,GAAGO,OAAO;IACjC,MAAMC,OAAOL,QAAQ;IACrB,OAAOK;AACT;AAEA,MAAMC,YAAY,OAAOT,GAAGU,MAAM,KAAK;AACvC,OAAO,SAASA;IACd,IAAID,WAAW,OAAOT,GAAGU,MAAM;IAC/B,MAAMC,SAASR,QAAQ;IACvB,OAAOQ,OAAOD,MAAM;AACtB;AAEA;;;;CAIC,GACD,MAAME,cAAc,OAAOC,OAAOC,SAAS,CAACC,QAAQ,KAAK;AAEzD,OAAO,SAASC,eAAeC,GAAW,EAAEC,MAAc,EAAEC,QAAiB;IAC3E,IAAIP,aAAa;QACf,OAAOK,IAAIF,QAAQ,CAACG,QAAQC;IAC9B;IACA,MAAMC,MAAMD,aAAaE,YAAYJ,IAAIK,MAAM,GAAGH;IAClD,OAAOF,IAAIM,WAAW,CAACL,YAAYE,MAAMF,OAAOI,MAAM;AACxD;AAEA;;CAEC,GACD,OAAO,SAASE,WAAWC,GAAW;IACpC,MAAMC,SAASxB,SAAS;IACxBwB,OAAOC,IAAI,CAACF;AACd;AAEA;;CAEC,GACD,OAAO,SAASG,OAAOH,GAAW;IAChC,MAAMI,aAAa3B,SAAS,oBAAoB2B,UAAU;IAC1DA,WAAWJ;AACb;AAWA,OAAO,SAASK,iBAAiBL,GAAW;IAC1C,MAAMM,QAAQjC,GAAGkC,WAAW,CAACP;IAC7B,OAAOM,MAAME,GAAG,CAAC,CAACC;QAChB,MAAMC,WAAWlC,KAAKmC,IAAI,CAACX,KAAKS;QAChC,IAAIG;QACJ,IAAI;YACFA,OAAOvC,GAAGwC,QAAQ,CAACH;QACrB,EAAE,OAAOI,IAAI;YACX,wCAAwC;YACxC,OAAO;gBAAEL,MAAMA;gBAAMM,aAAa,IAAM;YAAM;QAChD;QACA,OAAO;YACLN,MAAMA;YACNM,aAAa,IAAMH,KAAKG,WAAW;QACrC;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,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,mBAAmB;AAC1C,OAAOC,oBAAoB,kBAAkB;AAC7C,SAASC,aAAa,EAAEC,eAAe,QAAQ,aAAa;AAC5D,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,OAAOC,4BAA4B,kCAAkC;AAIrE,MAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,MAAMC,OAAON,YAAY,aAAa;AAEtC,iEAAiE;AACjE,SAASO,mBAAmBC,OAAe;IACzC,IAAI;QACF,MAAMC,UAAUtB,GAAGuB,YAAY,CAACF,SAAS;QACzC,uDAAuD;QACvD,8CAA8C;QAC9C,MAAMG,QAAQF,QAAQE,K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SAAS1C,OAAO;6BAAC,CAAC8C,MAAM,CAACJ,SAASzC,IAAI,GAAGJ,IAAI,CAAC,MAAM;4BAC3G,OAAO7B,MAAM0E,SAAS1C,OAAO,EAAE0C,SAASzC,IAAI,EAAE9B,cAAcmE;wBAC9D;wBACA,IAAIlB,SAASA,QAAQpD,KAAK,CAAC0E,SAAS1C,OAAO,EAAE0C,SAASzC,IAAI,EAAE9B,cAAc;4BAAE4E,OAAOV;4BAAQW,UAAUhC,iBAAiBgC,QAAQ;wBAAC,GAAGV;6BAC7H9D,eAAekE,SAAS1C,OAAO,EAAE0C,SAASzC,IAAI,EAAE9B,cAAc;4BAAEkE;wBAAO,GAAGC;oBACjF;gBACF;YACF;YACApB,MAAM+B,KAAK,CAAC,CAACtC;gBACX,IAAIS,SAAS;oBACXA,QAAQ8B,YAAY,CAAC;wBACnBvC,MAAMH,SAASG,OAAOH,SAAS,MAAMS;oBACvC;gBACF,OAAO;oBACLN,MAAMH,SAASG,OAAOH,SAAS,MAAMS;gBACvC;YACF;QACF;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsds build",
|
|
41
|
-
"build:assets": "tsds
|
|
41
|
+
"build:assets": "tsds validate && mkdir -p assets && cp -R dist/cjs/assets/*.cjs assets/",
|
|
42
42
|
"clean": "rm -rf .tmp dist",
|
|
43
43
|
"format": "tsds format",
|
|
44
44
|
"postinstall": "node assets/postinstall.cjs",
|
|
@@ -48,34 +48,39 @@
|
|
|
48
48
|
"version": "tsds version"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"cross-spawn-cb": "^2.
|
|
52
|
-
"
|
|
53
|
-
"
|
|
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",
|
|
54
56
|
"getopts-compat": "^2.2.6",
|
|
55
57
|
"homedir-polyfill": "^1.0.3",
|
|
56
|
-
"install-module-linked": "^1.3.
|
|
57
|
-
"mkdirp-classic": "^0.5.
|
|
58
|
-
"
|
|
59
|
-
"node-
|
|
60
|
-
"
|
|
58
|
+
"install-module-linked": "^1.3.17",
|
|
59
|
+
"mkdirp-classic": "^0.5.2",
|
|
60
|
+
"module-root-sync": "^2.0.2",
|
|
61
|
+
"node-resolve-versions": "^1.0.0",
|
|
62
|
+
"node-version-utils": "^1.0.2",
|
|
63
|
+
"queue-cb": "^1.0.0",
|
|
61
64
|
"resolve-bin-sync": "^1.0.12",
|
|
62
65
|
"spawn-streaming": "^1.1.15",
|
|
63
|
-
"spawn-term": "^3.3.5"
|
|
66
|
+
"spawn-term": "^3.3.5",
|
|
67
|
+
"tar-iterator": "^3.1.11",
|
|
68
|
+
"zip-iterator": "^3.0.18"
|
|
64
69
|
},
|
|
65
70
|
"devDependencies": {
|
|
66
|
-
"@types/mocha": "
|
|
67
|
-
"@types/node": "
|
|
71
|
+
"@types/mocha": "*",
|
|
72
|
+
"@types/node": "*",
|
|
68
73
|
"cr": "^0.1.0",
|
|
69
|
-
"fs-copy-compat": "^0.
|
|
70
|
-
"fs-remove-compat": "^0.
|
|
74
|
+
"fs-copy-compat": "^1.0.0",
|
|
75
|
+
"fs-remove-compat": "^1.0.0",
|
|
71
76
|
"is-version": "^1.0.9",
|
|
72
|
-
"mkdirp-classic": "^0.5.
|
|
73
|
-
"node-version-install": "^1.5
|
|
74
|
-
"node-version-use": "
|
|
75
|
-
"os-shim": "^0.1.
|
|
76
|
-
"pinkie-promise": "
|
|
77
|
-
"ts-dev-stack": "
|
|
78
|
-
"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": "*"
|
|
79
84
|
},
|
|
80
85
|
"engines": {
|
|
81
86
|
"node": ">=0.8"
|