node-version-use 1.2.4 → 1.2.6
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/constants.cjs
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "storagePath", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return storagePath;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
2
11
|
var path = require('path');
|
|
3
12
|
var home = require('homedir-polyfill')();
|
|
4
|
-
|
|
5
|
-
installPath: path.join(home, '.nvu')
|
|
6
|
-
};
|
|
13
|
+
var storagePath = path.join(home, '.nvu');
|
|
7
14
|
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/constants.js"],"sourcesContent":["const path = require('path');\nconst home = require('homedir-polyfill')();\n\
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/constants.js"],"sourcesContent":["const path = require('path');\nconst home = require('homedir-polyfill')();\n\nexport const storagePath = path.join(home, '.nvu');\n"],"names":["storagePath","path","require","home","join"],"mappings":";;;;+BAGaA;;;eAAAA;;;AAHb,IAAMC,OAAOC,QAAQ;AACrB,IAAMC,OAAOD,QAAQ;AAEd,IAAMF,cAAcC,KAAKG,IAAI,CAACD,MAAM"}
|
package/dist/cjs/worker.cjs
CHANGED
|
@@ -75,14 +75,15 @@ function worker(versionExpression, command, args, options, callback) {
|
|
|
75
75
|
(0, _noderesolveversions.default)(versionExpression, options, function(err, versions) {
|
|
76
76
|
if (err) return callback(err);
|
|
77
77
|
if (!versions.length) return callback(new Error("No versions found from expression: ".concat(versionExpression)));
|
|
78
|
+
var installOptions = _object_spread({
|
|
79
|
+
storagePath: _constants.storagePath
|
|
80
|
+
}, options);
|
|
78
81
|
var results = [];
|
|
79
82
|
var queue = new _queuecb.default(1);
|
|
80
83
|
versions.forEach(function(version) {
|
|
81
84
|
return queue.defer(function(cb) {
|
|
82
85
|
!options.header || options.header(version, command, args);
|
|
83
|
-
(0, _nodeversioninstall.default)(version, {
|
|
84
|
-
installPath: _constants.installPath
|
|
85
|
-
}, function(err, installs) {
|
|
86
|
+
(0, _nodeversioninstall.default)(version, installOptions, function(err, installs) {
|
|
86
87
|
if (err) return cb(err);
|
|
87
88
|
if (installs.length !== 1) return callback(new Error("Unexpected version results for version ".concat(version, ". Install ").concat(installs)));
|
|
88
89
|
(0, _crossspawncb.default)(command, args, (0, _nodeversionutils.spawnOptions)(installs[0].installPath, options), function(error, result) {
|
package/dist/cjs/worker.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/worker.mjs"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport resolveVersions from 'node-resolve-versions';\nimport install from 'node-version-install';\nimport { spawnOptions } from 'node-version-utils';\nimport Queue from 'queue-cb';\nimport {
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/worker.mjs"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport resolveVersions from 'node-resolve-versions';\nimport install from 'node-version-install';\nimport { spawnOptions } from 'node-version-utils';\nimport Queue from 'queue-cb';\nimport { storagePath } from './constants';\n\nexport default function worker(versionExpression, command, args, options, callback) {\n resolveVersions(versionExpression, options, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`No versions found from expression: ${versionExpression}`));\n\n const installOptions = { storagePath, ...options };\n const results = [];\n const queue = new Queue(1);\n versions.forEach((version) =>\n queue.defer((cb) => {\n !options.header || options.header(version, command, args);\n install(version, installOptions, (err, installs) => {\n if (err) return cb(err);\n if (installs.length !== 1) return callback(new Error(`Unexpected version results for version ${version}. Install ${installs}`));\n\n spawn(command, args, spawnOptions(installs[0].installPath, options), (error, result) => {\n results.push({ ...install, command, version, error, result });\n cb();\n });\n });\n })\n );\n queue.await((err) => {\n err ? callback(err) : callback(null, results);\n });\n });\n}\n"],"names":["worker","versionExpression","command","args","options","callback","resolveVersions","err","versions","length","Error","installOptions","storagePath","results","queue","Queue","forEach","version","defer","cb","header","install","installs","spawn","spawnOptions","installPath","error","result","push","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;mEAPN;0EACU;yEACR;gCACS;8DACX;yBACU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,SAASA,OAAOC,iBAAiB,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChFC,IAAAA,4BAAe,EAACL,mBAAmBG,SAAS,SAACG,KAAKC;QAChD,IAAID,KAAK,OAAOF,SAASE;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE,OAAOJ,SAAS,IAAIK,MAAM,AAAC,sCAAuD,OAAlBT;QAEtF,IAAMU,iBAAiB;YAAEC,aAAAA,sBAAW;WAAKR;QACzC,IAAMS,UAAU,EAAE;QAClB,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;QACxBP,SAASQ,OAAO,CAAC,SAACC;mBAChBH,MAAMI,KAAK,CAAC,SAACC;gBACX,CAACf,QAAQgB,MAAM,IAAIhB,QAAQgB,MAAM,CAACH,SAASf,SAASC;gBACpDkB,IAAAA,2BAAO,EAACJ,SAASN,gBAAgB,SAACJ,KAAKe;oBACrC,IAAIf,KAAK,OAAOY,GAAGZ;oBACnB,IAAIe,SAASb,MAAM,KAAK,GAAG,OAAOJ,SAAS,IAAIK,MAAM,AAAC,0CAA6DY,OAApBL,SAAQ,cAAqB,OAATK;oBAEnHC,IAAAA,qBAAK,EAACrB,SAASC,MAAMqB,IAAAA,8BAAY,EAACF,QAAQ,CAAC,EAAE,CAACG,WAAW,EAAErB,UAAU,SAACsB,OAAOC;wBAC3Ed,QAAQe,IAAI,CAAC,wCAAKP,2BAAO;4BAAEnB,SAAAA;4BAASe,SAAAA;4BAASS,OAAAA;4BAAOC,QAAAA;;wBACpDR;oBACF;gBACF;YACF;;QAEFL,MAAMe,KAAK,CAAC,SAACtB;YACXA,MAAMF,SAASE,OAAOF,SAAS,MAAMQ;QACvC;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const storagePath: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-version-use",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "Cross-platform solution for using multiple versions of node. Useful for compatibility testing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"version": "tsds version"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"cross-spawn-cb": "^2.0.
|
|
37
|
+
"cross-spawn-cb": "^2.0.1",
|
|
38
38
|
"exit": "^0.1.2",
|
|
39
39
|
"getopts-compat": "^2.2.5",
|
|
40
40
|
"homedir-polyfill": "^1.0.3",
|
|
41
41
|
"node-resolve-versions": "^1.0.5",
|
|
42
|
-
"node-version-install": "^0.
|
|
43
|
-
"node-version-utils": "^1.2.
|
|
42
|
+
"node-version-install": "^0.2.2",
|
|
43
|
+
"node-version-utils": "^1.2.1",
|
|
44
44
|
"queue-cb": "^1.4.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|