node-install-release 1.7.11 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/assets/files.cjs +1 -0
  2. package/dist/cjs/constants.cjs +5 -0
  3. package/dist/cjs/constants.cjs.map +1 -1
  4. package/dist/cjs/installNPM/index.cjs +15 -3
  5. package/dist/cjs/installNPM/index.cjs.map +1 -1
  6. package/dist/cjs/installNPM/installBin.cjs +1 -1
  7. package/dist/cjs/installNPM/installBin.cjs.map +1 -1
  8. package/dist/cjs/installNPM/installLib.cjs +8 -5
  9. package/dist/cjs/installNPM/installLib.cjs.map +1 -1
  10. package/dist/cjs/installNode/index.cjs +16 -5
  11. package/dist/cjs/installNode/index.cjs.map +1 -1
  12. package/dist/cjs/installNode/installCompressed.cjs +0 -2
  13. package/dist/cjs/installNode/installCompressed.cjs.map +1 -1
  14. package/dist/cjs/installNode/installExe.cjs +0 -1
  15. package/dist/cjs/installNode/installExe.cjs.map +1 -1
  16. package/dist/cjs/installNode/installSource/buildWin32.cjs +1 -1
  17. package/dist/cjs/installNode/installSource/buildWin32.cjs.map +1 -1
  18. package/dist/cjs/installNode/validateDownload.cjs +1 -3
  19. package/dist/cjs/installNode/validateDownload.cjs.map +1 -1
  20. package/dist/cjs/lib/conditionalCache.cjs +1 -6
  21. package/dist/cjs/lib/conditionalCache.cjs.map +1 -1
  22. package/dist/cjs/lib/conditionalCopy.cjs +3 -12
  23. package/dist/cjs/lib/conditionalCopy.cjs.map +1 -1
  24. package/dist/cjs/lib/conditionalExtract.cjs +8 -11
  25. package/dist/cjs/lib/conditionalExtract.cjs.map +1 -1
  26. package/dist/cjs/workers/install.cjs +11 -13
  27. package/dist/cjs/workers/install.cjs.map +1 -1
  28. package/dist/esm/constants.mjs +3 -0
  29. package/dist/esm/constants.mjs.map +1 -1
  30. package/dist/esm/installNPM/index.mjs +13 -3
  31. package/dist/esm/installNPM/index.mjs.map +1 -1
  32. package/dist/esm/installNPM/installBin.mjs +1 -1
  33. package/dist/esm/installNPM/installBin.mjs.map +1 -1
  34. package/dist/esm/installNPM/installLib.mjs +8 -5
  35. package/dist/esm/installNPM/installLib.mjs.map +1 -1
  36. package/dist/esm/installNode/index.mjs +13 -6
  37. package/dist/esm/installNode/index.mjs.map +1 -1
  38. package/dist/esm/installNode/installCompressed.mjs +0 -2
  39. package/dist/esm/installNode/installCompressed.mjs.map +1 -1
  40. package/dist/esm/installNode/installExe.mjs +0 -1
  41. package/dist/esm/installNode/installExe.mjs.map +1 -1
  42. package/dist/esm/installNode/installSource/buildWin32.mjs +1 -1
  43. package/dist/esm/installNode/installSource/buildWin32.mjs.map +1 -1
  44. package/dist/esm/installNode/validateDownload.mjs +1 -3
  45. package/dist/esm/installNode/validateDownload.mjs.map +1 -1
  46. package/dist/esm/lib/conditionalCache.mjs +1 -6
  47. package/dist/esm/lib/conditionalCache.mjs.map +1 -1
  48. package/dist/esm/lib/conditionalCopy.mjs +3 -12
  49. package/dist/esm/lib/conditionalCopy.mjs.map +1 -1
  50. package/dist/esm/lib/conditionalExtract.mjs +9 -12
  51. package/dist/esm/lib/conditionalExtract.mjs.map +1 -1
  52. package/dist/esm/workers/install.mjs +10 -12
  53. package/dist/esm/workers/install.mjs.map +1 -1
  54. package/dist/types/constants.d.ts +1 -0
  55. package/dist/types/lib/conditionalCopy.d.ts +1 -1
  56. package/package.json +6 -3
  57. package/dist/cjs/lib/progress.cjs +0 -22
  58. package/dist/cjs/lib/progress.cjs.map +0 -1
  59. package/dist/esm/lib/progress.mjs +0 -6
  60. package/dist/esm/lib/progress.mjs.map +0 -1
  61. package/dist/types/lib/progress.d.ts +0 -1
@@ -0,0 +1 @@
1
+ module.exports = JSON.parse('{"aix":[{"filename":"aix-ppc64","starting":"v6.7.0"}],"headers":[{"filename":"headers","starting":"v0.10.41"}],"linux":[{"filename":"linux-s390x","starting":"v6.6.0"},{"filename":"linux-ppc64le","starting":"v4.3.2"},{"filename":"linux-arm64","starting":"v4.0.0"},{"filename":"linux-armv7l","starting":"v4.0.0"},{"filename":"linux-armv6l","starting":"v4.0.0"},{"filename":"linux-x64","starting":"v0.8.6"},{"filename":"linux-x86","starting":"v0.8.6"}],"osx":[{"filename":"osx-arm64-tar","starting":"v16.0.0"},{"filename":"osx-x64-tar","starting":"v0.8.6"},{"filename":"osx-x86-tar","starting":"v0.8.6"},{"filename":"osx-x64-pkg","starting":"v0.6.1"}],"src":[{"filename":"src","starting":"v0.1.14"}],"win":[{"filename":"win-x64-7z","starting":"v4.5.0"},{"filename":"win-x64-zip","starting":"v4.5.0"},{"filename":"win-x86-7z","starting":"v4.5.0"},{"filename":"win-x86-zip","starting":"v4.5.0"},{"filename":"win-arm64-7z","starting":"v19.9.0"},{"filename":"win-arm64-zip","starting":"v19.9.0"},{"filename":"win-x64-msi","starting":"v0.7.11"},{"filename":"win-x86-msi","starting":"v0.7.11"},{"filename":"win-x64-exe","starting":"v0.6.13"},{"filename":"win-x86-exe","starting":"v0.5.1"}],"sunos":[{"filename":"sunos-x64","starting":"v0.8.6"},{"filename":"sunos-x86","starting":"v0.8.6"}]}')
@@ -18,6 +18,9 @@ _export(exports, {
18
18
  EXTENSIONS_COMPRESSED: function() {
19
19
  return EXTENSIONS_COMPRESSED;
20
20
  },
21
+ FILES: function() {
22
+ return FILES;
23
+ },
21
24
  NODE: function() {
22
25
  return NODE;
23
26
  },
@@ -45,12 +48,14 @@ _export(exports, {
45
48
  });
46
49
  var _path = /*#__PURE__*/ _interop_require_default(require("path"));
47
50
  var _homedirpolyfill = /*#__PURE__*/ _interop_require_default(require("homedir-polyfill"));
51
+ var _filescjs = /*#__PURE__*/ _interop_require_default(require("../../assets/files.cjs"));
48
52
  var _createStoragePaths = /*#__PURE__*/ _interop_require_default(require("./createStoragePaths.cjs"));
49
53
  function _interop_require_default(obj) {
50
54
  return obj && obj.__esModule ? obj : {
51
55
  default: obj
52
56
  };
53
57
  }
58
+ var FILES = _filescjs.default;
54
59
  var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
55
60
  var NODE = isWindows ? 'node.exe' : 'node';
56
61
  var DEFAULT_STORAGE_PATH = _path.default.join((0, _homedirpolyfill.default)(), '.nir');
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import path from 'path';\nimport home from 'homedir-polyfill';\nimport createStoragePaths from './createStoragePaths';\n\nexport const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nexport const NODE = isWindows ? 'node.exe' : 'node';\n\nexport const DEFAULT_STORAGE_PATH = path.join(home(), '.nir');\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\nexport const NPM_PLATFORM_FILES = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ],\n posix: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm-cli.js'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx-cli.js'), dest: 'npx', optional: true },\n ],\n};\n"],"names":["DEFAULT_STORAGE_PATH","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","NODE","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_MIN_VERSION","NPM_PLATFORM_FILES","isWindows","process","platform","test","env","OSTYPE","path","join","home","createStoragePaths","win32","src","dest","optional","posix"],"mappings":";;;;;;;;;;;IAOaA,oBAAoB;eAApBA;;IACAC,qBAAqB;eAArBA;;IAEAC,qBAAqB;eAArBA;;IALAC,IAAI;eAAJA;;IAOAC,kBAAkB;eAAlBA;;IACAC,kBAAkB;eAAlBA;;IAGAC,iBAAiB;eAAjBA;;IADAC,YAAY;eAAZA;;IAEAC,eAAe;eAAfA;;IACAC,kBAAkB;eAAlBA;;IAdAC,SAAS;eAATA;;;2DAJI;sEACA;yEACc;;;;;;AAExB,IAAMA,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMZ,OAAOO,YAAY,aAAa;AAEtC,IAAMV,uBAAuBgB,aAAI,CAACC,IAAI,CAACC,IAAAA,wBAAI,KAAI;AAC/C,IAAMjB,wBAAwBkB,IAAAA,2BAAkB,EAACnB;AAEjD,IAAME,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM;AAE3D,IAAME,qBAAqB;AAC3B,IAAMC,qBAAqB;AAE3B,IAAME,eAAe;AACrB,IAAMD,oBAAoB;AAC1B,IAAME,kBAAkB;AACxB,IAAMC,qBAAqB;IAChCW,OAAO;QACL;YAAEC,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQK,MAAM;QAAM;QACnE;YAAED,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYK,MAAM;QAAU;QAC3E;YAAED,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQK,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEF,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYK,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDC,OAAO;QACL;YAAEH,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeK,MAAM;QAAM;QAC1E;YAAED,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeK,MAAM;YAAOC,UAAU;QAAK;KAC3F;AACH"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import path from 'path';\nimport home from 'homedir-polyfill';\n// @ts-ignore\nimport files from '../../assets/files.cjs';\nimport createStoragePaths from './createStoragePaths';\n\nexport const FILES = files;\n\nexport const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nexport const NODE = isWindows ? 'node.exe' : 'node';\n\nexport const DEFAULT_STORAGE_PATH = path.join(home(), '.nir');\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\nexport const NPM_PLATFORM_FILES = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ],\n posix: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm-cli.js'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx-cli.js'), dest: 'npx', optional: true },\n ],\n};\n"],"names":["DEFAULT_STORAGE_PATH","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","FILES","NODE","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_MIN_VERSION","NPM_PLATFORM_FILES","isWindows","files","process","platform","test","env","OSTYPE","path","join","home","createStoragePaths","win32","src","dest","optional","posix"],"mappings":";;;;;;;;;;;IAWaA,oBAAoB;eAApBA;;IACAC,qBAAqB;eAArBA;;IAEAC,qBAAqB;eAArBA;;IARAC,KAAK;eAALA;;IAGAC,IAAI;eAAJA;;IAOAC,kBAAkB;eAAlBA;;IACAC,kBAAkB;eAAlBA;;IAGAC,iBAAiB;eAAjBA;;IADAC,YAAY;eAAZA;;IAEAC,eAAe;eAAfA;;IACAC,kBAAkB;eAAlBA;;IAdAC,SAAS;eAATA;;;2DARI;sEACA;+DAEC;yEACa;;;;;;AAExB,IAAMR,QAAQS,iBAAK;AAEnB,IAAMD,YAAYE,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMb,OAAOO,YAAY,aAAa;AAEtC,IAAMX,uBAAuBkB,aAAI,CAACC,IAAI,CAACC,IAAAA,wBAAI,KAAI;AAC/C,IAAMnB,wBAAwBoB,IAAAA,2BAAkB,EAACrB;AAEjD,IAAME,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM;AAE3D,IAAMG,qBAAqB;AAC3B,IAAMC,qBAAqB;AAE3B,IAAME,eAAe;AACrB,IAAMD,oBAAoB;AAC1B,IAAME,kBAAkB;AACxB,IAAMC,qBAAqB;IAChCY,OAAO;QACL;YAAEC,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQK,MAAM;QAAM;QACnE;YAAED,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYK,MAAM;QAAU;QAC3E;YAAED,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQK,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEF,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYK,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDC,OAAO;QACL;YAAEH,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeK,MAAM;QAAM;QAC1E;YAAED,KAAKL,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeK,MAAM;YAAOC,UAAU;QAAK;KAC3F;AACH"}
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "default", {
8
8
  return install;
9
9
  }
10
10
  });
11
+ var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
12
+ var _singlelinelog2 = /*#__PURE__*/ _interop_require_default(require("single-line-log2"));
11
13
  var _installBin = /*#__PURE__*/ _interop_require_default(require("./installBin.cjs"));
12
14
  var _installLib = /*#__PURE__*/ _interop_require_default(require("./installLib.cjs"));
13
15
  function _interop_require_default(obj) {
@@ -16,9 +18,19 @@ function _interop_require_default(obj) {
16
18
  };
17
19
  }
18
20
  function install(version, dest, options, callback) {
19
- (0, _installLib.default)(version, dest, options, function(err) {
20
- if (err) return callback(err);
21
- (0, _installBin.default)(version, dest, options, callback);
21
+ var npmVersion = null;
22
+ var queue = new _queuecb.default(1);
23
+ queue.defer(function(cb) {
24
+ return (0, _installLib.default)(version, dest, options, function(err, _npmVersion) {
25
+ npmVersion = _npmVersion;
26
+ cb(err);
27
+ });
28
+ });
29
+ queue.defer(_installBin.default.bind(null, version, dest, options));
30
+ queue.await(function(err) {
31
+ _singlelinelog2.default.stdout('');
32
+ console.log("npm ".concat(npmVersion || '', " ").concat(!err ? 'installed' : "install failed. Error: ".concat(err.message)));
33
+ callback(err);
22
34
  });
23
35
  }
24
36
  /* 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-install-release/src/installNPM/index.ts"],"sourcesContent":["import installBin from './installBin';\nimport installLib from './installLib';\n\nexport default function install(version, dest, options, callback) {\n installLib(version, dest, options, (err) => {\n if (err) return callback(err);\n installBin(version, dest, options, callback);\n });\n}\n"],"names":["install","version","dest","options","callback","installLib","err","installBin"],"mappings":";;;;+BAGA;;;eAAwBA;;;iEAHD;iEACA;;;;;;AAER,SAASA,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC9DC,IAAAA,mBAAU,EAACJ,SAASC,MAAMC,SAAS,SAACG;QAClC,IAAIA,KAAK,OAAOF,SAASE;QACzBC,IAAAA,mBAAU,EAACN,SAASC,MAAMC,SAASC;IACrC;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/index.ts"],"sourcesContent":["import Queue from 'queue-cb';\nimport sll from 'single-line-log2';\nimport installBin from './installBin';\nimport installLib from './installLib';\n\nexport default function install(version, dest, options, callback) {\n let npmVersion = null;\n\n const queue = new Queue(1);\n queue.defer((cb) =>\n installLib(version, dest, options, (err, _npmVersion) => {\n npmVersion = _npmVersion;\n cb(err);\n })\n );\n queue.defer(installBin.bind(null, version, dest, options));\n queue.await((err) => {\n sll.stdout('');\n console.log(`npm ${npmVersion || ''} ${!err ? 'installed' : `install failed. Error: ${err.message}`}`);\n callback(err);\n });\n}\n"],"names":["install","version","dest","options","callback","npmVersion","queue","Queue","defer","cb","installLib","err","_npmVersion","installBin","bind","await","sll","stdout","console","log","message"],"mappings":";;;;+BAKA;;;eAAwBA;;;8DALN;qEACF;iEACO;iEACA;;;;;;AAER,SAASA,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC9D,IAAIC,aAAa;IAEjB,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAAC,SAACC;eACXC,IAAAA,mBAAU,EAACT,SAASC,MAAMC,SAAS,SAACQ,KAAKC;YACvCP,aAAaO;YACbH,GAAGE;QACL;;IAEFL,MAAME,KAAK,CAACK,mBAAU,CAACC,IAAI,CAAC,MAAMb,SAASC,MAAMC;IACjDG,MAAMS,KAAK,CAAC,SAACJ;QACXK,uBAAG,CAACC,MAAM,CAAC;QACXC,QAAQC,GAAG,CAAC,AAAC,OAA0B,OAApBd,cAAc,IAAG,KAAgE,OAA7D,CAACM,MAAM,cAAc,AAAC,0BAAqC,OAAZA,IAAIS,OAAO;QACjGhB,SAASO;IACX;AACF"}
@@ -25,7 +25,7 @@ function installBin(_version, dest, options, callback) {
25
25
  var files = _constants.NPM_PLATFORM_FILES[platform] || _constants.NPM_PLATFORM_FILES.posix;
26
26
  for(var index = 0; index < files.length; index++){
27
27
  var file = files[index];
28
- queue.defer(_conditionalCopy.default.bind(null, _path.default.join(libPath, file.src), _path.default.join(binPath, file.dest), file.optional));
28
+ queue.defer(_conditionalCopy.default.bind(null, _path.default.join(libPath, file.src), _path.default.join(binPath, file.dest), file));
29
29
  }
30
30
  queue.await(callback);
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installBin.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\nimport conditionalCopy from '../lib/conditionalCopy';\n\nimport { NPM_PLATFORM_FILES } from '../constants';\n\nexport default function installBin(_version, dest, options, callback) {\n const platform = options.platform || process.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const binPath = platform === 'win32' ? dest : path.join(dest, 'bin');\n\n const queue = new Queue();\n const files = NPM_PLATFORM_FILES[platform] || NPM_PLATFORM_FILES.posix;\n for (let index = 0; index < files.length; index++) {\n const file = files[index];\n queue.defer(conditionalCopy.bind(null, path.join(libPath, file.src), path.join(binPath, file.dest), file.optional));\n }\n\n queue.await(callback);\n}\n"],"names":["installBin","_version","dest","options","callback","platform","process","libPath","path","join","binPath","queue","Queue","files","NPM_PLATFORM_FILES","posix","index","length","file","defer","conditionalCopy","bind","src","optional","await"],"mappings":";;;;+BAMA;;;eAAwBA;;;2DANP;8DACC;sEACU;yBAEO;;;;;;AAEpB,SAASA,WAAWC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAClE,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,UAAUF,aAAa,UAAUH,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;IAC9D,IAAMQ,UAAUL,aAAa,UAAUH,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;IAE9D,IAAMS,QAAQ,IAAIC,gBAAK;IACvB,IAAMC,QAAQC,6BAAkB,CAACT,SAAS,IAAIS,6BAAkB,CAACC,KAAK;IACtE,IAAK,IAAIC,QAAQ,GAAGA,QAAQH,MAAMI,MAAM,EAAED,QAAS;QACjD,IAAME,OAAOL,KAAK,CAACG,MAAM;QACzBL,MAAMQ,KAAK,CAACC,wBAAe,CAACC,IAAI,CAAC,MAAMb,aAAI,CAACC,IAAI,CAACF,SAASW,KAAKI,GAAG,GAAGd,aAAI,CAACC,IAAI,CAACC,SAASQ,KAAKhB,IAAI,GAAGgB,KAAKK,QAAQ;IACnH;IAEAZ,MAAMa,KAAK,CAACpB;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installBin.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\nimport conditionalCopy from '../lib/conditionalCopy';\n\nimport { NPM_PLATFORM_FILES } from '../constants';\n\nexport default function installBin(_version, dest, options, callback) {\n const platform = options.platform || process.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const binPath = platform === 'win32' ? dest : path.join(dest, 'bin');\n\n const queue = new Queue();\n const files = NPM_PLATFORM_FILES[platform] || NPM_PLATFORM_FILES.posix;\n for (let index = 0; index < files.length; index++) {\n const file = files[index];\n queue.defer(conditionalCopy.bind(null, path.join(libPath, file.src), path.join(binPath, file.dest), file));\n }\n\n queue.await(callback);\n}\n"],"names":["installBin","_version","dest","options","callback","platform","process","libPath","path","join","binPath","queue","Queue","files","NPM_PLATFORM_FILES","posix","index","length","file","defer","conditionalCopy","bind","src","await"],"mappings":";;;;+BAMA;;;eAAwBA;;;2DANP;8DACC;sEACU;yBAEO;;;;;;AAEpB,SAASA,WAAWC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAClE,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,UAAUF,aAAa,UAAUH,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;IAC9D,IAAMQ,UAAUL,aAAa,UAAUH,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;IAE9D,IAAMS,QAAQ,IAAIC,gBAAK;IACvB,IAAMC,QAAQC,6BAAkB,CAACT,SAAS,IAAIS,6BAAkB,CAACC,KAAK;IACtE,IAAK,IAAIC,QAAQ,GAAGA,QAAQH,MAAMI,MAAM,EAAED,QAAS;QACjD,IAAME,OAAOL,KAAK,CAACG,MAAM;QACzBL,MAAMQ,KAAK,CAACC,wBAAe,CAACC,IAAI,CAAC,MAAMb,aAAI,CAACC,IAAI,CAACF,SAASW,KAAKI,GAAG,GAAGd,aAAI,CAACC,IAAI,CAACC,SAASQ,KAAKhB,IAAI,GAAGgB;IACtG;IAEAP,MAAMY,KAAK,CAACnB;AACd"}
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "default", {
11
11
  var _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
12
  var _getremote = /*#__PURE__*/ _interop_require_default(require("get-remote"));
13
13
  var _nodefilenametodistpaths = require("node-filename-to-dist-paths");
14
+ var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
14
15
  var _conditionalCache = /*#__PURE__*/ _interop_require_default(require("../lib/conditionalCache.cjs"));
15
16
  var _conditionalExtract = /*#__PURE__*/ _interop_require_default(require("../lib/conditionalExtract.cjs"));
16
17
  var _constants = require("../constants.cjs");
@@ -29,12 +30,14 @@ function installLib(version, dest, options, callback) {
29
30
  (0, _getremote.default)(_constants.NPM_DIST_TAGS_URL).json(function(err, res) {
30
31
  if (err) return callback(err);
31
32
  var distTags = res.body;
32
- var installVersion = distTags["latest-".concat(npmMajor)] || distTags["next-".concat(npmMajor)] || distTags.latest;
33
- var downloadPath = "".concat(_constants.NPM_DIST_URL, "/-/npm-").concat(installVersion, ".tgz");
33
+ var npmVersion = distTags["latest-".concat(npmMajor)] || distTags["next-".concat(npmMajor)] || distTags.latest;
34
+ var downloadPath = "".concat(_constants.NPM_DIST_URL, "/-/npm-").concat(npmVersion, ".tgz");
34
35
  var cachePath = _path.default.join(options.cachePath, _path.default.basename(downloadPath));
35
- (0, _conditionalCache.default)(downloadPath, cachePath, function(err) {
36
- if (err) return callback(err);
37
- (0, _conditionalExtract.default)(cachePath, installPath, callback);
36
+ var queue = new _queuecb.default(1);
37
+ queue.defer(_conditionalCache.default.bind(null, downloadPath, cachePath));
38
+ queue.defer(_conditionalExtract.default.bind(null, cachePath, installPath));
39
+ queue.await(function(err) {
40
+ err ? callback(err) : callback(null, npmVersion);
38
41
  });
39
42
  });
40
43
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installLib.ts"],"sourcesContent":["import path from 'path';\nimport get from 'get-remote';\nimport { getDist } from 'node-filename-to-dist-paths';\n\nimport conditionalCache from '../lib/conditionalCache';\nimport conditionalExtract from '../lib/conditionalExtract';\n\nimport { NPM_DIST_TAGS_URL, NPM_DIST_URL, NPM_MIN_VERSION } from '../constants';\n\ninterface DistRecord {\n latest: string;\n}\n\nexport default function installLib(version, dest, options, callback) {\n const platform = options.platform || process.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n\n const dist = getDist(version);\n const npmMajorPair = dist && dist.npm ? +dist.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n get(NPM_DIST_TAGS_URL).json((err, res) => {\n if (err) return callback(err);\n const distTags = res.body as DistRecord;\n const installVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n const downloadPath = `${NPM_DIST_URL}/-/npm-${installVersion}.tgz`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n conditionalExtract(cachePath, installPath, callback);\n });\n });\n}\n"],"names":["installLib","version","dest","options","callback","platform","process","libPath","path","join","installPath","dist","getDist","npmMajorPair","npm","split","NPM_MIN_VERSION","npmMajor","Math","max","get","NPM_DIST_TAGS_URL","json","err","res","distTags","body","installVersion","latest","downloadPath","NPM_DIST_URL","cachePath","basename","conditionalCache","conditionalExtract"],"mappings":";;;;+BAaA;;;eAAwBA;;;2DAbP;gEACD;uCACQ;uEAEK;yEACE;yBAEkC;;;;;;AAMlD,SAASA,WAAWC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACjE,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,UAAUF,aAAa,UAAUH,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;IAC9D,IAAMQ,cAAcF,aAAI,CAACC,IAAI,CAACF,SAAS,gBAAgB;IAEvD,IAAMI,OAAOC,IAAAA,gCAAO,EAACX;IACrB,IAAMY,eAAeF,QAAQA,KAAKG,GAAG,GAAG,CAACH,KAAKG,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGC,0BAAe;IACjF,IAAMC,WAAWC,KAAKC,GAAG,CAACN,cAAcG,0BAAe;IAEvDI,IAAAA,kBAAG,EAACC,4BAAiB,EAAEC,IAAI,CAAC,SAACC,KAAKC;QAChC,IAAID,KAAK,OAAOnB,SAASmB;QACzB,IAAME,WAAWD,IAAIE,IAAI;QACzB,IAAMC,iBAAiBF,QAAQ,CAAC,AAAC,UAAkB,OAATR,UAAW,IAAIQ,QAAQ,CAAC,AAAC,QAAgB,OAATR,UAAW,IAAIQ,SAASG,MAAM;QACxG,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,uBAAY,EAAC,WAAwB,OAAfH,gBAAe;QAC7D,IAAMI,YAAYvB,aAAI,CAACC,IAAI,CAACN,QAAQ4B,SAAS,EAAEvB,aAAI,CAACwB,QAAQ,CAACH;QAC7DI,IAAAA,yBAAgB,EAACJ,cAAcE,WAAW,SAACR;YACzC,IAAIA,KAAK,OAAOnB,SAASmB;YACzBW,IAAAA,2BAAkB,EAACH,WAAWrB,aAAaN;QAC7C;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installLib.ts"],"sourcesContent":["import path from 'path';\nimport get from 'get-remote';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport Queue from 'queue-cb';\n\nimport conditionalCache from '../lib/conditionalCache';\nimport conditionalExtract from '../lib/conditionalExtract';\n\nimport { NPM_DIST_TAGS_URL, NPM_DIST_URL, NPM_MIN_VERSION } from '../constants';\n\ninterface DistRecord {\n latest: string;\n}\n\nexport default function installLib(version, dest, options, callback) {\n const platform = options.platform || process.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n\n const dist = getDist(version);\n const npmMajorPair = dist && dist.npm ? +dist.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n get(NPM_DIST_TAGS_URL).json((err, res) => {\n if (err) return callback(err);\n const distTags = res.body as DistRecord;\n const npmVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n const downloadPath = `${NPM_DIST_URL}/-/npm-${npmVersion}.tgz`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(conditionalExtract.bind(null, cachePath, installPath));\n queue.await((err) => {\n err ? callback(err) : callback(null, npmVersion);\n });\n });\n}\n"],"names":["installLib","version","dest","options","callback","platform","process","libPath","path","join","installPath","dist","getDist","npmMajorPair","npm","split","NPM_MIN_VERSION","npmMajor","Math","max","get","NPM_DIST_TAGS_URL","json","err","res","distTags","body","npmVersion","latest","downloadPath","NPM_DIST_URL","cachePath","basename","queue","Queue","defer","conditionalCache","bind","conditionalExtract","await"],"mappings":";;;;+BAcA;;;eAAwBA;;;2DAdP;gEACD;uCACQ;8DACN;uEAEW;yEACE;yBAEkC;;;;;;AAMlD,SAASA,WAAWC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACjE,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,UAAUF,aAAa,UAAUH,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;IAC9D,IAAMQ,cAAcF,aAAI,CAACC,IAAI,CAACF,SAAS,gBAAgB;IAEvD,IAAMI,OAAOC,IAAAA,gCAAO,EAACX;IACrB,IAAMY,eAAeF,QAAQA,KAAKG,GAAG,GAAG,CAACH,KAAKG,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGC,0BAAe;IACjF,IAAMC,WAAWC,KAAKC,GAAG,CAACN,cAAcG,0BAAe;IAEvDI,IAAAA,kBAAG,EAACC,4BAAiB,EAAEC,IAAI,CAAC,SAACC,KAAKC;QAChC,IAAID,KAAK,OAAOnB,SAASmB;QACzB,IAAME,WAAWD,IAAIE,IAAI;QACzB,IAAMC,aAAaF,QAAQ,CAAC,AAAC,UAAkB,OAATR,UAAW,IAAIQ,QAAQ,CAAC,AAAC,QAAgB,OAATR,UAAW,IAAIQ,SAASG,MAAM;QACpG,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,uBAAY,EAAC,WAAoB,OAAXH,YAAW;QACzD,IAAMI,YAAYvB,aAAI,CAACC,IAAI,CAACN,QAAQ4B,SAAS,EAAEvB,aAAI,CAACwB,QAAQ,CAACH;QAE7D,IAAMI,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,yBAAgB,CAACC,IAAI,CAAC,MAAMR,cAAcE;QACtDE,MAAME,KAAK,CAACG,2BAAkB,CAACD,IAAI,CAAC,MAAMN,WAAWrB;QACrDuB,MAAMM,KAAK,CAAC,SAAChB;YACXA,MAAMnB,SAASmB,OAAOnB,SAAS,MAAMuB;QACvC;IACF;AACF"}
@@ -8,8 +8,10 @@ Object.defineProperty(exports, "default", {
8
8
  return install;
9
9
  }
10
10
  });
11
+ var _singlelinelog2 = /*#__PURE__*/ _interop_require_default(require("single-line-log2"));
11
12
  var _archcjs = /*#__PURE__*/ _interop_require_default(require("../machine/arch.cjs"));
12
13
  var _installFilename = /*#__PURE__*/ _interop_require_default(require("./installFilename.cjs"));
14
+ var _constants = require("../constants.cjs");
13
15
  function _interop_require_default(obj) {
14
16
  return obj && obj.__esModule ? obj : {
15
17
  default: obj
@@ -31,25 +33,34 @@ function install(version, dest, options, callback) {
31
33
  ];
32
34
  if (options.type) parts.push(options.type);
33
35
  if (options.compression) parts.push(options.compression);
36
+ // generate the files in search order
34
37
  var archs = [
35
- arch
38
+ arch,
39
+ process.arch
36
40
  ];
37
- if (archs.indexOf('x64') < 0) archs.push('x64');
38
- if (arch !== process.arch && archs.indexOf(process.arch) < 0) archs.push(process.arch);
39
41
  var filenames = archs.map(function(a) {
40
42
  return [
41
43
  platform,
42
44
  a
43
45
  ].concat(parts.slice(2)).join('-');
44
46
  });
45
- if (platform === 'win') filenames.push('win-x64-exe', 'win-x86-exe');
47
+ (_constants.FILES[platform] || []).forEach(function(x) {
48
+ return filenames.push(x.filename);
49
+ });
46
50
  filenames.push('src');
51
+ filenames = filenames.filter(function(filename, i) {
52
+ return filenames.indexOf(filename) === i;
53
+ });
47
54
  var tryNext = function(cb) {
48
55
  if (filenames.length === 0) return cb(new Error("Failed to find installable for ".concat(version)));
49
56
  (0, _installFilename.default)(filenames.shift(), version, dest, options, function(err) {
50
57
  return err ? tryNext(cb) : cb();
51
58
  });
52
59
  };
53
- tryNext(callback);
60
+ tryNext(function(err) {
61
+ _singlelinelog2.default.stdout('');
62
+ console.log("node ".concat(version.slice(1), " ").concat(!err ? 'installed' : "install failed. Error: ".concat(err.message)));
63
+ callback(err);
64
+ });
54
65
  }
55
66
  /* 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-install-release/src/installNode/index.ts"],"sourcesContent":["import realArch from '../machine/arch.cjs';\nimport installFilename from './installFilename';\n\nconst PLATFORM_MAP = {\n win32: 'win',\n darwin: 'osx',\n};\n\nlet archMachine: NodeJS.Architecture;\nexport default function install(version, dest, options, callback) {\n if (!archMachine) archMachine = realArch() as NodeJS.Architecture;\n let platform = options.platform || process.platform;\n platform = PLATFORM_MAP[platform] || platform;\n const arch = options.arch || archMachine || process.arch;\n const parts = [platform, arch];\n if (options.type) parts.push(options.type);\n if (options.compression) parts.push(options.compression);\n\n const archs = [arch];\n if (archs.indexOf('x64') < 0) archs.push('x64');\n if (arch !== process.arch && archs.indexOf(process.arch) < 0) archs.push(process.arch);\n const filenames = archs.map((a) => [platform, a].concat(parts.slice(2)).join('-'));\n if (platform === 'win') filenames.push('win-x64-exe', 'win-x86-exe');\n filenames.push('src');\n\n const tryNext = (cb) => {\n if (filenames.length === 0) return cb(new Error(`Failed to find installable for ${version}`));\n installFilename(filenames.shift(), version, dest, options, (err) => (err ? tryNext(cb) : cb()));\n };\n tryNext(callback);\n}\n"],"names":["install","PLATFORM_MAP","win32","darwin","archMachine","version","dest","options","callback","realArch","platform","process","arch","parts","type","push","compression","archs","indexOf","filenames","map","a","concat","slice","join","tryNext","cb","length","Error","installFilename","shift","err"],"mappings":";;;;+BASA;;;eAAwBA;;;8DATH;sEACO;;;;;;AAE5B,IAAMC,eAAe;IACnBC,OAAO;IACPC,QAAQ;AACV;AAEA,IAAIC;AACW,SAASJ,QAAQK,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC9D,IAAI,CAACJ,aAAaA,cAAcK,IAAAA,gBAAQ;IACxC,IAAIC,WAAWH,QAAQG,QAAQ,IAAIC,QAAQD,QAAQ;IACnDA,WAAWT,YAAY,CAACS,SAAS,IAAIA;IACrC,IAAME,OAAOL,QAAQK,IAAI,IAAIR,eAAeO,QAAQC,IAAI;IACxD,IAAMC,QAAQ;QAACH;QAAUE;KAAK;IAC9B,IAAIL,QAAQO,IAAI,EAAED,MAAME,IAAI,CAACR,QAAQO,IAAI;IACzC,IAAIP,QAAQS,WAAW,EAAEH,MAAME,IAAI,CAACR,QAAQS,WAAW;IAEvD,IAAMC,QAAQ;QAACL;KAAK;IACpB,IAAIK,MAAMC,OAAO,CAAC,SAAS,GAAGD,MAAMF,IAAI,CAAC;IACzC,IAAIH,SAASD,QAAQC,IAAI,IAAIK,MAAMC,OAAO,CAACP,QAAQC,IAAI,IAAI,GAAGK,MAAMF,IAAI,CAACJ,QAAQC,IAAI;IACrF,IAAMO,YAAYF,MAAMG,GAAG,CAAC,SAACC;eAAM;YAACX;YAAUW;SAAE,CAACC,MAAM,CAACT,MAAMU,KAAK,CAAC,IAAIC,IAAI,CAAC;;IAC7E,IAAId,aAAa,OAAOS,UAAUJ,IAAI,CAAC,eAAe;IACtDI,UAAUJ,IAAI,CAAC;IAEf,IAAMU,UAAU,SAACC;QACf,IAAIP,UAAUQ,MAAM,KAAK,GAAG,OAAOD,GAAG,IAAIE,MAAM,AAAC,kCAAyC,OAARvB;QAClFwB,IAAAA,wBAAe,EAACV,UAAUW,KAAK,IAAIzB,SAASC,MAAMC,SAAS,SAACwB;mBAASA,MAAMN,QAAQC,MAAMA;;IAC3F;IACAD,QAAQjB;AACV"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/index.ts"],"sourcesContent":["import sll from 'single-line-log2';\nimport realArch from '../machine/arch.cjs';\nimport installFilename from './installFilename';\n\nimport { FILES } from '../constants';\n\nconst PLATFORM_MAP = {\n win32: 'win',\n darwin: 'osx',\n};\n\nlet archMachine: NodeJS.Architecture;\nexport default function install(version, dest, options, callback) {\n if (!archMachine) archMachine = realArch() as NodeJS.Architecture;\n let platform = options.platform || process.platform;\n platform = PLATFORM_MAP[platform] || platform;\n const arch = options.arch || archMachine || process.arch;\n const parts = [platform, arch];\n if (options.type) parts.push(options.type);\n if (options.compression) parts.push(options.compression);\n\n // generate the files in search order\n const archs = [arch, process.arch];\n let filenames = archs.map((a) => [platform, a].concat(parts.slice(2)).join('-'));\n (FILES[platform] || []).forEach((x) => filenames.push(x.filename));\n filenames.push('src');\n filenames = filenames.filter((filename, i) => filenames.indexOf(filename) === i);\n\n const tryNext = (cb) => {\n if (filenames.length === 0) return cb(new Error(`Failed to find installable for ${version}`));\n installFilename(filenames.shift(), version, dest, options, (err) => (err ? tryNext(cb) : cb()));\n };\n tryNext((err) => {\n sll.stdout('');\n console.log(`node ${version.slice(1)} ${!err ? 'installed' : `install failed. Error: ${err.message}`}`);\n callback(err);\n });\n}\n"],"names":["install","PLATFORM_MAP","win32","darwin","archMachine","version","dest","options","callback","realArch","platform","process","arch","parts","type","push","compression","archs","filenames","map","a","concat","slice","join","FILES","forEach","x","filename","filter","i","indexOf","tryNext","cb","length","Error","installFilename","shift","err","sll","stdout","console","log","message"],"mappings":";;;;+BAYA;;;eAAwBA;;;qEAZR;8DACK;sEACO;yBAEN;;;;;;AAEtB,IAAMC,eAAe;IACnBC,OAAO;IACPC,QAAQ;AACV;AAEA,IAAIC;AACW,SAASJ,QAAQK,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC9D,IAAI,CAACJ,aAAaA,cAAcK,IAAAA,gBAAQ;IACxC,IAAIC,WAAWH,QAAQG,QAAQ,IAAIC,QAAQD,QAAQ;IACnDA,WAAWT,YAAY,CAACS,SAAS,IAAIA;IACrC,IAAME,OAAOL,QAAQK,IAAI,IAAIR,eAAeO,QAAQC,IAAI;IACxD,IAAMC,QAAQ;QAACH;QAAUE;KAAK;IAC9B,IAAIL,QAAQO,IAAI,EAAED,MAAME,IAAI,CAACR,QAAQO,IAAI;IACzC,IAAIP,QAAQS,WAAW,EAAEH,MAAME,IAAI,CAACR,QAAQS,WAAW;IAEvD,qCAAqC;IACrC,IAAMC,QAAQ;QAACL;QAAMD,QAAQC,IAAI;KAAC;IAClC,IAAIM,YAAYD,MAAME,GAAG,CAAC,SAACC;eAAM;YAACV;YAAUU;SAAE,CAACC,MAAM,CAACR,MAAMS,KAAK,CAAC,IAAIC,IAAI,CAAC;;IAC1EC,CAAAA,gBAAK,CAACd,SAAS,IAAI,EAAE,AAAD,EAAGe,OAAO,CAAC,SAACC;eAAMR,UAAUH,IAAI,CAACW,EAAEC,QAAQ;;IAChET,UAAUH,IAAI,CAAC;IACfG,YAAYA,UAAUU,MAAM,CAAC,SAACD,UAAUE;eAAMX,UAAUY,OAAO,CAACH,cAAcE;;IAE9E,IAAME,UAAU,SAACC;QACf,IAAId,UAAUe,MAAM,KAAK,GAAG,OAAOD,GAAG,IAAIE,MAAM,AAAC,kCAAyC,OAAR7B;QAClF8B,IAAAA,wBAAe,EAACjB,UAAUkB,KAAK,IAAI/B,SAASC,MAAMC,SAAS,SAAC8B;mBAASA,MAAMN,QAAQC,MAAMA;;IAC3F;IACAD,QAAQ,SAACM;QACPC,uBAAG,CAACC,MAAM,CAAC;QACXC,QAAQC,GAAG,CAAC,AAAC,QAA2B,OAApBpC,QAAQiB,KAAK,CAAC,IAAG,KAAgE,OAA7D,CAACe,MAAM,cAAc,AAAC,0BAAqC,OAAZA,IAAIK,OAAO;QAClGlC,SAAS6B;IACX;AACF"}
@@ -15,7 +15,6 @@ var _rimraf2 = /*#__PURE__*/ _interop_require_default(require("rimraf2"));
15
15
  var _constants = require("../constants.cjs");
16
16
  var _conditionalCache = /*#__PURE__*/ _interop_require_default(require("../lib/conditionalCache.cjs"));
17
17
  var _conditionalExtract = /*#__PURE__*/ _interop_require_default(require("../lib/conditionalExtract.cjs"));
18
- var _progress = /*#__PURE__*/ _interop_require_default(require("../lib/progress.cjs"));
19
18
  var _validateDownload = /*#__PURE__*/ _interop_require_default(require("./validateDownload.cjs"));
20
19
  function _define_property(obj, key, value) {
21
20
  if (key in obj) {
@@ -60,7 +59,6 @@ function installCompressed(distPath, dest, options, callback) {
60
59
  queue.defer(_validateDownload.default.bind(null, distPath, cachePath));
61
60
  queue.defer(_conditionalExtract.default.bind(null, cachePath, dest, _object_spread({
62
61
  strip: 1,
63
- progress: _progress.default,
64
62
  time: 1000
65
63
  }, options)));
66
64
  queue.await(function(err) {
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installCompressed.ts"],"sourcesContent":["import path from 'path';\nimport access from 'fs-access-compat';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport { NODE_DIST_BASE_URL } from '../constants';\nimport conditionalCache from '../lib/conditionalCache';\nimport conditionalExtract from '../lib/conditionalExtract';\nimport progress from '../lib/progress.js';\nimport validateDownload from './validateDownload';\n\nexport default function installCompressed(distPath, dest, options, callback) {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(conditionalExtract.bind(null, cachePath, dest, { strip: 1, progress: progress, time: 1000, ...options }));\n queue.await((err) => {\n // some compressed versions of node come with npm pre-installed, but we want to override with a specific version\n const platform = options.platform || process.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n rimraf2(installPath, { disableGlob: true }, () => callback(err));\n });\n });\n}\n"],"names":["installCompressed","distPath","dest","options","callback","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","basename","access","err","queue","Queue","defer","conditionalCache","bind","validateDownload","conditionalExtract","strip","progress","time","await","platform","process","libPath","installPath","rimraf2","disableGlob"],"mappings":";;;;+BAWA;;;eAAwBA;;;2DAXP;qEACE;8DACD;8DACE;yBAEe;uEACN;yEACE;+DACV;uEACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,SAASA,kBAAkBC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACzE,IAAMC,eAAe,AAAC,GAAwBJ,OAAtBK,6BAAkB,EAAC,KAAY,OAATL;IAC9C,IAAMM,YAAYC,aAAI,CAACC,IAAI,CAACN,QAAQI,SAAS,EAAEC,aAAI,CAACE,QAAQ,CAACL;IAE7DM,IAAAA,uBAAM,EAACT,MAAM,SAACU;QACZ,IAAI,CAACA,KAAK,OAAOR,YAAY,iBAAiB;QAE9C,IAAMS,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,yBAAgB,CAACC,IAAI,CAAC,MAAMZ,cAAcE;QACtDM,MAAME,KAAK,CAACG,yBAAgB,CAACD,IAAI,CAAC,MAAMhB,UAAUM;QAClDM,MAAME,KAAK,CAACI,2BAAkB,CAACF,IAAI,CAAC,MAAMV,WAAWL,MAAM;YAAEkB,OAAO;YAAGC,UAAUA,iBAAQ;YAAEC,MAAM;WAASnB;QAC1GU,MAAMU,KAAK,CAAC,SAACX;YACX,gHAAgH;YAChH,IAAMY,WAAWrB,QAAQqB,QAAQ,IAAIC,QAAQD,QAAQ;YACrD,IAAME,UAAUF,aAAa,UAAUtB,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;YAC9D,IAAMyB,cAAcnB,aAAI,CAACC,IAAI,CAACiB,SAAS,gBAAgB;YACvDE,IAAAA,gBAAO,EAACD,aAAa;gBAAEE,aAAa;YAAK,GAAG;uBAAMzB,SAASQ;;QAC7D;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installCompressed.ts"],"sourcesContent":["import path from 'path';\nimport access from 'fs-access-compat';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport { NODE_DIST_BASE_URL } from '../constants';\nimport conditionalCache from '../lib/conditionalCache';\nimport conditionalExtract from '../lib/conditionalExtract';\nimport validateDownload from './validateDownload';\n\nexport default function installCompressed(distPath, dest, options, callback) {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(conditionalExtract.bind(null, cachePath, dest, { strip: 1, time: 1000, ...options }));\n queue.await((err) => {\n // some compressed versions of node come with npm pre-installed, but we want to override with a specific version\n const platform = options.platform || process.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n rimraf2(installPath, { disableGlob: true }, () => callback(err));\n });\n });\n}\n"],"names":["installCompressed","distPath","dest","options","callback","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","basename","access","err","queue","Queue","defer","conditionalCache","bind","validateDownload","conditionalExtract","strip","time","await","platform","process","libPath","installPath","rimraf2","disableGlob"],"mappings":";;;;+BAUA;;;eAAwBA;;;2DAVP;qEACE;8DACD;8DACE;yBAEe;uEACN;yEACE;uEACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,SAASA,kBAAkBC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACzE,IAAMC,eAAe,AAAC,GAAwBJ,OAAtBK,6BAAkB,EAAC,KAAY,OAATL;IAC9C,IAAMM,YAAYC,aAAI,CAACC,IAAI,CAACN,QAAQI,SAAS,EAAEC,aAAI,CAACE,QAAQ,CAACL;IAE7DM,IAAAA,uBAAM,EAACT,MAAM,SAACU;QACZ,IAAI,CAACA,KAAK,OAAOR,YAAY,iBAAiB;QAE9C,IAAMS,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,yBAAgB,CAACC,IAAI,CAAC,MAAMZ,cAAcE;QACtDM,MAAME,KAAK,CAACG,yBAAgB,CAACD,IAAI,CAAC,MAAMhB,UAAUM;QAClDM,MAAME,KAAK,CAACI,2BAAkB,CAACF,IAAI,CAAC,MAAMV,WAAWL,MAAM;YAAEkB,OAAO;YAAGC,MAAM;WAASlB;QACtFU,MAAMS,KAAK,CAAC,SAACV;YACX,gHAAgH;YAChH,IAAMW,WAAWpB,QAAQoB,QAAQ,IAAIC,QAAQD,QAAQ;YACrD,IAAME,UAAUF,aAAa,UAAUrB,OAAOM,aAAI,CAACC,IAAI,CAACP,MAAM;YAC9D,IAAMwB,cAAclB,aAAI,CAACC,IAAI,CAACgB,SAAS,gBAAgB;YACvDE,IAAAA,gBAAO,EAACD,aAAa;gBAAEE,aAAa;YAAK,GAAG;uBAAMxB,SAASQ;;QAC7D;IACF;AACF"}
@@ -26,7 +26,6 @@ function installExe(distPath, dest, options, callback) {
26
26
  var destPath = _path.default.join(dest, _path.default.basename(distPath));
27
27
  (0, _fsaccesscompat.default)(destPath, function(err) {
28
28
  if (!err) return callback(); // already exists
29
- console.log(1);
30
29
  var queue = new _queuecb.default(1);
31
30
  queue.defer(_conditionalCache.default.bind(null, downloadPath, cachePath));
32
31
  queue.defer(_validateDownload.default.bind(null, distPath, cachePath));
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installExe.ts"],"sourcesContent":["import path from 'path';\nimport access from 'fs-access-compat';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL } from '../constants';\nimport conditionalCache from '../lib/conditionalCache';\nimport copyFile from '../lib/copyFile';\nimport validateDownload from './validateDownload';\n\nexport default function installExe(distPath, dest, options, callback) {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, `node-${distPath}.exe`);\n const destPath = path.join(dest, path.basename(distPath));\n\n access(destPath, (err) => {\n if (!err) return callback(); // already exists\n\n console.log(1);\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(copyFile.bind(null, cachePath, destPath));\n queue.await(callback);\n });\n}\n"],"names":["installExe","distPath","dest","options","callback","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","destPath","basename","access","err","console","log","queue","Queue","defer","conditionalCache","bind","validateDownload","copyFile","await"],"mappings":";;;;+BASA;;;eAAwBA;;;2DATP;qEACE;8DACD;yBAEiB;uEACN;+DACR;uEACQ;;;;;;AAEd,SAASA,WAAWC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAClE,IAAMC,eAAe,AAAC,GAAwBJ,OAAtBK,6BAAkB,EAAC,KAAY,OAATL;IAC9C,IAAMM,YAAYC,aAAI,CAACC,IAAI,CAACN,QAAQI,SAAS,EAAE,AAAC,QAAgB,OAATN,UAAS;IAChE,IAAMS,WAAWF,aAAI,CAACC,IAAI,CAACP,MAAMM,aAAI,CAACG,QAAQ,CAACV;IAE/CW,IAAAA,uBAAM,EAACF,UAAU,SAACG;QAChB,IAAI,CAACA,KAAK,OAAOT,YAAY,iBAAiB;QAE9CU,QAAQC,GAAG,CAAC;QACZ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,yBAAgB,CAACC,IAAI,CAAC,MAAMf,cAAcE;QACtDS,MAAME,KAAK,CAACG,yBAAgB,CAACD,IAAI,CAAC,MAAMnB,UAAUM;QAClDS,MAAME,KAAK,CAACI,iBAAQ,CAACF,IAAI,CAAC,MAAMb,WAAWG;QAC3CM,MAAMO,KAAK,CAACnB;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installExe.ts"],"sourcesContent":["import path from 'path';\nimport access from 'fs-access-compat';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL } from '../constants';\nimport conditionalCache from '../lib/conditionalCache';\nimport copyFile from '../lib/copyFile';\nimport validateDownload from './validateDownload';\n\nexport default function installExe(distPath, dest, options, callback) {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, `node-${distPath}.exe`);\n const destPath = path.join(dest, path.basename(distPath));\n\n access(destPath, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(copyFile.bind(null, cachePath, destPath));\n queue.await(callback);\n });\n}\n"],"names":["installExe","distPath","dest","options","callback","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","destPath","basename","access","err","queue","Queue","defer","conditionalCache","bind","validateDownload","copyFile","await"],"mappings":";;;;+BASA;;;eAAwBA;;;2DATP;qEACE;8DACD;yBAEiB;uEACN;+DACR;uEACQ;;;;;;AAEd,SAASA,WAAWC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAClE,IAAMC,eAAe,AAAC,GAAwBJ,OAAtBK,6BAAkB,EAAC,KAAY,OAATL;IAC9C,IAAMM,YAAYC,aAAI,CAACC,IAAI,CAACN,QAAQI,SAAS,EAAE,AAAC,QAAgB,OAATN,UAAS;IAChE,IAAMS,WAAWF,aAAI,CAACC,IAAI,CAACP,MAAMM,aAAI,CAACG,QAAQ,CAACV;IAE/CW,IAAAA,uBAAM,EAACF,UAAU,SAACG;QAChB,IAAI,CAACA,KAAK,OAAOT,YAAY,iBAAiB;QAE9C,IAAMU,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,yBAAgB,CAACC,IAAI,CAAC,MAAMb,cAAcE;QACtDO,MAAME,KAAK,CAACG,yBAAgB,CAACD,IAAI,CAAC,MAAMjB,UAAUM;QAClDO,MAAME,KAAK,CAACI,iBAAQ,CAACF,IAAI,CAAC,MAAMX,WAAWG;QAC3CI,MAAMO,KAAK,CAACjB;IACd;AACF"}
@@ -30,7 +30,7 @@ function installWin32(buildPath, dest, _options, callback) {
30
30
  cwd: buildPath
31
31
  });
32
32
  }));
33
- queue.defer(_conditionalCopy.default.bind(null, buildSource, buildTarget));
33
+ queue.defer(_conditionalCopy.default.bind(null, buildSource, buildTarget, {}));
34
34
  queue.await(callback);
35
35
  });
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/buildWin32.ts"],"sourcesContent":["import path from 'path';\nimport spawn from 'cross-spawn-cb';\nimport Queue from 'queue-cb';\n\nimport access from 'fs-access-compat';\nimport conditionalCopy from '../../lib/conditionalCopy';\n\nexport default function installWin32(buildPath, dest, _options, callback) {\n const buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n const buildTarget = path.join(dest, 'node.exe');\n\n access(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(access.bind(null, buildSource, (err) => (!err ? callback() : spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }))));\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget));\n queue.await(callback);\n });\n}\n"],"names":["installWin32","buildPath","dest","_options","callback","buildSource","path","join","buildTarget","access","err","queue","Queue","defer","bind","spawn","stdio","cwd","conditionalCopy","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;mEACC;8DACA;qEAEC;sEACS;;;;;;AAEb,SAASA,aAAaC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACtE,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACN,WAAW,OAAO,WAAW;IAC3D,IAAMO,cAAcF,aAAI,CAACC,IAAI,CAACL,MAAM;IAEpCO,IAAAA,uBAAM,EAACD,aAAa,SAACE;QACnB,IAAI,CAACA,KAAK,OAAON,YAAY,iBAAiB;QAE9C,IAAMO,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACJ,uBAAM,CAACK,IAAI,CAAC,MAAMT,aAAa,SAACK;mBAAS,CAACA,MAAMN,aAAaW,IAAAA,qBAAK,EAAC,aAAa,EAAE,EAAE;gBAAEC,OAAO;gBAAWC,KAAKhB;YAAU;;QACnIU,MAAME,KAAK,CAACK,wBAAe,CAACJ,IAAI,CAAC,MAAMT,aAAaG;QACpDG,MAAMQ,KAAK,CAACf;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/buildWin32.ts"],"sourcesContent":["import path from 'path';\nimport spawn from 'cross-spawn-cb';\nimport Queue from 'queue-cb';\n\nimport access from 'fs-access-compat';\nimport conditionalCopy from '../../lib/conditionalCopy';\n\nexport default function installWin32(buildPath, dest, _options, callback) {\n const buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n const buildTarget = path.join(dest, 'node.exe');\n\n access(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(access.bind(null, buildSource, (err) => (!err ? callback() : spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }))));\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget, {}));\n queue.await(callback);\n });\n}\n"],"names":["installWin32","buildPath","dest","_options","callback","buildSource","path","join","buildTarget","access","err","queue","Queue","defer","bind","spawn","stdio","cwd","conditionalCopy","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;mEACC;8DACA;qEAEC;sEACS;;;;;;AAEb,SAASA,aAAaC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACtE,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACN,WAAW,OAAO,WAAW;IAC3D,IAAMO,cAAcF,aAAI,CAACC,IAAI,CAACL,MAAM;IAEpCO,IAAAA,uBAAM,EAACD,aAAa,SAACE;QACnB,IAAI,CAACA,KAAK,OAAON,YAAY,iBAAiB;QAE9C,IAAMO,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACJ,uBAAM,CAACK,IAAI,CAAC,MAAMT,aAAa,SAACK;mBAAS,CAACA,MAAMN,aAAaW,IAAAA,qBAAK,EAAC,aAAa,EAAE,EAAE;gBAAEC,OAAO;gBAAWC,KAAKhB;YAAU;;QACnIU,MAAME,KAAK,CAACK,wBAAe,CAACJ,IAAI,CAAC,MAAMT,aAAaG,aAAa,CAAC;QAClEG,MAAMQ,KAAK,CAACf;IACd;AACF"}
@@ -33,9 +33,7 @@ function validateDownload(distPath, installPath, callback) {
33
33
  });
34
34
  (0, _endofstream.default)(input, function(err) {
35
35
  if (err) return callback(err);
36
- var digest = hash.digest('hex');
37
- console.log("hash ".concat(digest === expected ? 'matches' : 'different', " for ").concat(filename));
38
- digest !== expected ? callback(new Error("SHASUMS256 failed for ".concat(filename))) : callback();
36
+ hash.digest('hex') !== expected ? callback(new Error("".concat(filename, " checksum failed"))) : callback();
39
37
  });
40
38
  });
41
39
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/validateDownload.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport eos from 'end-of-stream';\nimport get from 'get-remote';\nimport { NODE_DIST_BASE_URL } from '../constants';\nexport default function validateDownload(distPath, installPath, callback) {\n const version = distPath.split('/')[0];\n const downloadPath = `${NODE_DIST_BASE_URL}/${version}/SHASUMS256.txt`;\n get(downloadPath).text((err, res) => {\n if (err) return callback(err);\n const text = res.body;\n const filename = distPath.split('/').slice(1).join('/');\n const expected = text.split(filename)[0].split('\\n').pop().trim();\n const hash = crypto.createHash('sha256');\n const input = fs.createReadStream(installPath);\n input.on('data', (data) => hash.update(data));\n eos(input, (err) => {\n if (err) return callback(err);\n const digest = hash.digest('hex');\n console.log(`hash ${digest === expected ? 'matches' : 'different'} for ${filename}`);\n digest !== expected ? callback(new Error(`SHASUMS256 failed for ${filename}`)) : callback();\n });\n });\n}\n"],"names":["validateDownload","distPath","installPath","callback","version","split","downloadPath","NODE_DIST_BASE_URL","get","text","err","res","body","filename","slice","join","expected","pop","trim","hash","crypto","createHash","input","fs","createReadStream","on","data","update","eos","digest","console","log","Error"],"mappings":";;;;+BAKA;;;eAAwBA;;;6DALL;yDACJ;kEACC;gEACA;yBACmB;;;;;;AACpB,SAASA,iBAAiBC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ;IACtE,IAAMC,UAAUH,SAASI,KAAK,CAAC,IAAI,CAAC,EAAE;IACtC,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,6BAAkB,EAAC,KAAW,OAARH,SAAQ;IACtDI,IAAAA,kBAAG,EAACF,cAAcG,IAAI,CAAC,SAACC,KAAKC;QAC3B,IAAID,KAAK,OAAOP,SAASO;QACzB,IAAMD,OAAOE,IAAIC,IAAI;QACrB,IAAMC,WAAWZ,SAASI,KAAK,CAAC,KAAKS,KAAK,CAAC,GAAGC,IAAI,CAAC;QACnD,IAAMC,WAAWP,KAAKJ,KAAK,CAACQ,SAAS,CAAC,EAAE,CAACR,KAAK,CAAC,MAAMY,GAAG,GAAGC,IAAI;QAC/D,IAAMC,OAAOC,eAAM,CAACC,UAAU,CAAC;QAC/B,IAAMC,QAAQC,WAAE,CAACC,gBAAgB,CAACtB;QAClCoB,MAAMG,EAAE,CAAC,QAAQ,SAACC;mBAASP,KAAKQ,MAAM,CAACD;;QACvCE,IAAAA,oBAAG,EAACN,OAAO,SAACZ;YACV,IAAIA,KAAK,OAAOP,SAASO;YACzB,IAAMmB,SAASV,KAAKU,MAAM,CAAC;YAC3BC,QAAQC,GAAG,CAAC,AAAC,QAA4DlB,OAArDgB,WAAWb,WAAW,YAAY,aAAY,SAAgB,OAATH;YACzEgB,WAAWb,WAAWb,SAAS,IAAI6B,MAAM,AAAC,yBAAiC,OAATnB,cAAeV;QACnF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/validateDownload.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport eos from 'end-of-stream';\nimport get from 'get-remote';\nimport { NODE_DIST_BASE_URL } from '../constants';\nexport default function validateDownload(distPath, installPath, callback) {\n const version = distPath.split('/')[0];\n const downloadPath = `${NODE_DIST_BASE_URL}/${version}/SHASUMS256.txt`;\n get(downloadPath).text((err, res) => {\n if (err) return callback(err);\n const text = res.body;\n const filename = distPath.split('/').slice(1).join('/');\n const expected = text.split(filename)[0].split('\\n').pop().trim();\n const hash = crypto.createHash('sha256');\n const input = fs.createReadStream(installPath);\n input.on('data', (data) => hash.update(data));\n eos(input, (err) => {\n if (err) return callback(err);\n hash.digest('hex') !== expected ? callback(new Error(`${filename} checksum failed`)) : callback();\n });\n });\n}\n"],"names":["validateDownload","distPath","installPath","callback","version","split","downloadPath","NODE_DIST_BASE_URL","get","text","err","res","body","filename","slice","join","expected","pop","trim","hash","crypto","createHash","input","fs","createReadStream","on","data","update","eos","digest","Error"],"mappings":";;;;+BAKA;;;eAAwBA;;;6DALL;yDACJ;kEACC;gEACA;yBACmB;;;;;;AACpB,SAASA,iBAAiBC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ;IACtE,IAAMC,UAAUH,SAASI,KAAK,CAAC,IAAI,CAAC,EAAE;IACtC,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,6BAAkB,EAAC,KAAW,OAARH,SAAQ;IACtDI,IAAAA,kBAAG,EAACF,cAAcG,IAAI,CAAC,SAACC,KAAKC;QAC3B,IAAID,KAAK,OAAOP,SAASO;QACzB,IAAMD,OAAOE,IAAIC,IAAI;QACrB,IAAMC,WAAWZ,SAASI,KAAK,CAAC,KAAKS,KAAK,CAAC,GAAGC,IAAI,CAAC;QACnD,IAAMC,WAAWP,KAAKJ,KAAK,CAACQ,SAAS,CAAC,EAAE,CAACR,KAAK,CAAC,MAAMY,GAAG,GAAGC,IAAI;QAC/D,IAAMC,OAAOC,eAAM,CAACC,UAAU,CAAC;QAC/B,IAAMC,QAAQC,WAAE,CAACC,gBAAgB,CAACtB;QAClCoB,MAAMG,EAAE,CAAC,QAAQ,SAACC;mBAASP,KAAKQ,MAAM,CAACD;;QACvCE,IAAAA,oBAAG,EAACN,OAAO,SAACZ;YACV,IAAIA,KAAK,OAAOP,SAASO;YACzBS,KAAKU,MAAM,CAAC,WAAWb,WAAWb,SAAS,IAAI2B,MAAM,AAAC,GAAW,OAATjB,UAAS,wBAAsBV;QACzF;IACF;AACF"}
@@ -12,7 +12,6 @@ var _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
12
  var _fsaccesscompat = /*#__PURE__*/ _interop_require_default(require("fs-access-compat"));
13
13
  var _getremote = /*#__PURE__*/ _interop_require_default(require("get-remote"));
14
14
  var _ensureDestinationParent = /*#__PURE__*/ _interop_require_default(require("./ensureDestinationParent.cjs"));
15
- var _progress = /*#__PURE__*/ _interop_require_default(require("./progress.cjs"));
16
15
  function _define_property(obj, key, value) {
17
16
  if (key in obj) {
18
17
  Object.defineProperty(obj, key, {
@@ -58,12 +57,8 @@ function conditionalCache(endpoint, dest, options, callback) {
58
57
  if (err) return callback(err);
59
58
  (0, _getremote.default)(endpoint, _object_spread({
60
59
  filename: _path.default.basename(dest),
61
- progress: _progress.default,
62
60
  time: 1000
63
- }, options)).file(_path.default.dirname(dest), function(err) {
64
- console.log('');
65
- callback(err);
66
- });
61
+ }, options)).file(_path.default.dirname(dest), callback);
67
62
  });
68
63
  });
69
64
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCache.ts"],"sourcesContent":["import path from 'path';\nimport access from 'fs-access-compat';\nimport get from 'get-remote';\n\nimport ensureDestinationParent from './ensureDestinationParent';\nimport progress from './progress';\n\nexport default function conditionalCache(endpoint, dest, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n ensureDestinationParent(dest, (err) => {\n if (err) return callback(err);\n\n get(endpoint, { filename: path.basename(dest), progress: progress, time: 1000, ...options }).file(path.dirname(dest), (err) => {\n console.log('');\n callback(err);\n });\n });\n });\n}\n"],"names":["conditionalCache","endpoint","dest","options","callback","access","err","ensureDestinationParent","get","filename","path","basename","progress","time","file","dirname","console","log"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;qEACE;gEACH;8EAEoB;+DACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEN,SAASA,iBAAiBC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAS;IACzE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBE,IAAAA,uBAAM,EAACH,MAAM,SAACI;QACZ,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAE9CG,IAAAA,gCAAuB,EAACL,MAAM,SAACI;YAC7B,IAAIA,KAAK,OAAOF,SAASE;YAEzBE,IAAAA,kBAAG,EAACP,UAAU;gBAAEQ,UAAUC,aAAI,CAACC,QAAQ,CAACT;gBAAOU,UAAUA,iBAAQ;gBAAEC,MAAM;eAASV,UAAWW,IAAI,CAACJ,aAAI,CAACK,OAAO,CAACb,OAAO,SAACI;gBACrHU,QAAQC,GAAG,CAAC;gBACZb,SAASE;YACX;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCache.ts"],"sourcesContent":["import path from 'path';\nimport access from 'fs-access-compat';\nimport get from 'get-remote';\n\nimport ensureDestinationParent from './ensureDestinationParent';\n\nexport default function conditionalCache(endpoint, dest, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n ensureDestinationParent(dest, (err) => {\n if (err) return callback(err);\n get(endpoint, { filename: path.basename(dest), time: 1000, ...options }).file(path.dirname(dest), callback);\n });\n });\n}\n"],"names":["conditionalCache","endpoint","dest","options","callback","access","err","ensureDestinationParent","get","filename","path","basename","time","file","dirname"],"mappings":";;;;+BAMA;;;eAAwBA;;;2DANP;qEACE;gEACH;8EAEoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,SAASA,iBAAiBC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAS;IACzE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBE,IAAAA,uBAAM,EAACH,MAAM,SAACI;QACZ,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAE9CG,IAAAA,gCAAuB,EAACL,MAAM,SAACI;YAC7B,IAAIA,KAAK,OAAOF,SAASE;YACzBE,IAAAA,kBAAG,EAACP,UAAU;gBAAEQ,UAAUC,aAAI,CAACC,QAAQ,CAACT;gBAAOU,MAAM;eAAST,UAAWU,IAAI,CAACH,aAAI,CAACI,OAAO,CAACZ,OAAOE;QACpG;IACF;AACF"}
@@ -10,26 +10,17 @@ Object.defineProperty(exports, "default", {
10
10
  });
11
11
  var _fsaccesscompat = /*#__PURE__*/ _interop_require_default(require("fs-access-compat"));
12
12
  var _copyFile = /*#__PURE__*/ _interop_require_default(require("./copyFile.cjs"));
13
- var _ensureDestinationParent = /*#__PURE__*/ _interop_require_default(require("./ensureDestinationParent.cjs"));
14
13
  function _interop_require_default(obj) {
15
14
  return obj && obj.__esModule ? obj : {
16
15
  default: obj
17
16
  };
18
17
  }
19
18
  function conditionalCopy(src, dest, optional, callback) {
20
- if (typeof optional === 'function') {
21
- callback = optional;
22
- optional = false;
23
- }
19
+ if (typeof optional === 'function') return callback(new Error('conditionalCopy missing options'));
24
20
  (0, _fsaccesscompat.default)(dest, function(err) {
25
21
  if (!err) return callback(); // already exists
26
- (0, _ensureDestinationParent.default)(dest, function(err) {
27
- if (err) return callback(err);
28
- if (!optional) return (0, _copyFile.default)(src, dest, callback);
29
- (0, _fsaccesscompat.default)(src, function(err) {
30
- if (err) return callback(); // optional file missing
31
- (0, _copyFile.default)(src, dest, callback);
32
- });
22
+ (0, _fsaccesscompat.default)(src, function(err) {
23
+ err && optional ? callback() : (0, _copyFile.default)(src, dest, callback); // optional file missing
33
24
  });
34
25
  });
35
26
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCopy.ts"],"sourcesContent":["import access from 'fs-access-compat';\n\nimport copyFile from './copyFile';\nimport ensureDestinationParent from './ensureDestinationParent';\n\nexport default function conditionalCopy(src, dest, optional, callback) {\n if (typeof optional === 'function') {\n callback = optional;\n optional = false;\n }\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n ensureDestinationParent(dest, (err) => {\n if (err) return callback(err);\n if (!optional) return copyFile(src, dest, callback);\n\n access(src, (err) => {\n if (err) return callback(); // optional file missing\n copyFile(src, dest, callback);\n });\n });\n });\n}\n"],"names":["conditionalCopy","src","dest","optional","callback","access","err","ensureDestinationParent","copyFile"],"mappings":";;;;+BAKA;;;eAAwBA;;;qEALL;+DAEE;8EACe;;;;;;AAErB,SAASA,gBAAgBC,GAAG,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACnE,IAAI,OAAOD,aAAa,YAAY;QAClCC,WAAWD;QACXA,WAAW;IACb;IAEAE,IAAAA,uBAAM,EAACH,MAAM,SAACI;QACZ,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAE9CG,IAAAA,gCAAuB,EAACL,MAAM,SAACI;YAC7B,IAAIA,KAAK,OAAOF,SAASE;YACzB,IAAI,CAACH,UAAU,OAAOK,IAAAA,iBAAQ,EAACP,KAAKC,MAAME;YAE1CC,IAAAA,uBAAM,EAACJ,KAAK,SAACK;gBACX,IAAIA,KAAK,OAAOF,YAAY,wBAAwB;gBACpDI,IAAAA,iBAAQ,EAACP,KAAKC,MAAME;YACtB;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCopy.ts"],"sourcesContent":["import access from 'fs-access-compat';\nimport copyFile from './copyFile';\n\nexport default function conditionalCopy(src, dest, optional, callback) {\n if (typeof optional === 'function') return callback(new Error('conditionalCopy missing options'));\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n access(src, (err) => {\n err && optional ? callback() : copyFile(src, dest, callback); // optional file missing\n });\n });\n}\n"],"names":["conditionalCopy","src","dest","optional","callback","Error","access","err","copyFile"],"mappings":";;;;+BAGA;;;eAAwBA;;;qEAHL;+DACE;;;;;;AAEN,SAASA,gBAAgBC,GAAG,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACnE,IAAI,OAAOD,aAAa,YAAY,OAAOC,SAAS,IAAIC,MAAM;IAE9DC,IAAAA,uBAAM,EAACJ,MAAM,SAACK;QACZ,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAE9CE,IAAAA,uBAAM,EAACL,KAAK,SAACM;YACXA,OAAOJ,WAAWC,aAAaI,IAAAA,iBAAQ,EAACP,KAAKC,MAAME,WAAW,wBAAwB;QACxF;IACF;AACF"}
@@ -12,7 +12,7 @@ var _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
12
  var _fastextract = /*#__PURE__*/ _interop_require_default(require("fast-extract"));
13
13
  var _fsaccesscompat = /*#__PURE__*/ _interop_require_default(require("fs-access-compat"));
14
14
  var _mkdirpclassic = /*#__PURE__*/ _interop_require_default(require("mkdirp-classic"));
15
- var _progress = /*#__PURE__*/ _interop_require_default(require("./progress.cjs"));
15
+ var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
16
16
  function _define_property(obj, key, value) {
17
17
  if (key in obj) {
18
18
  Object.defineProperty(obj, key, {
@@ -54,16 +54,13 @@ function conditionalExtract(src, dest, options, callback) {
54
54
  options = options || {};
55
55
  (0, _fsaccesscompat.default)(dest, function(err) {
56
56
  if (!err) return callback(); // already exists
57
- (0, _mkdirpclassic.default)(_path.default.dirname(dest), function() {
58
- (0, _fastextract.default)(src, dest, _object_spread({
59
- strip: 1,
60
- progress: _progress.default,
61
- time: 1000
62
- }, options), function(err) {
63
- console.log('');
64
- callback(err);
65
- });
66
- });
57
+ var queue = new _queuecb.default(1);
58
+ queue.defer(_mkdirpclassic.default.bind(null, _path.default.dirname(dest)));
59
+ queue.defer(_fastextract.default.bind(null, src, dest, _object_spread({
60
+ strip: 1,
61
+ time: 1000
62
+ }, options)));
63
+ queue.await(callback);
67
64
  });
68
65
  }
69
66
  /* 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-install-release/src/lib/conditionalExtract.ts"],"sourcesContent":["import path from 'path';\nimport extract from 'fast-extract';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\n\nimport progress from './progress.js';\n\nexport default function conditionalExtract(src, dest, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n mkdirp(path.dirname(dest), () => {\n extract(src, dest, { strip: 1, progress: progress, time: 1000, ...options }, (err) => {\n console.log('');\n callback(err);\n });\n });\n });\n}\n"],"names":["conditionalExtract","src","dest","options","callback","access","err","mkdirp","path","dirname","extract","strip","progress","time","console","log"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;kEACG;qEACD;oEACA;+DAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEN,SAASA,mBAAmBC,GAAG,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAS;IACtE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBE,IAAAA,uBAAM,EAACH,MAAM,SAACI;QACZ,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAE9CG,IAAAA,sBAAM,EAACC,aAAI,CAACC,OAAO,CAACP,OAAO;YACzBQ,IAAAA,oBAAO,EAACT,KAAKC,MAAM;gBAAES,OAAO;gBAAGC,UAAUA,iBAAQ;gBAAEC,MAAM;eAASV,UAAW,SAACG;gBAC5EQ,QAAQC,GAAG,CAAC;gBACZX,SAASE;YACX;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalExtract.ts"],"sourcesContent":["import path from 'path';\nimport extract from 'fast-extract';\nimport access from 'fs-access-compat';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\n\nexport default function conditionalExtract(src, dest, options, callback?) {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, path.dirname(dest)));\n queue.defer(extract.bind(null, src, dest, { strip: 1, time: 1000, ...options }));\n queue.await(callback);\n });\n}\n"],"names":["conditionalExtract","src","dest","options","callback","access","err","queue","Queue","defer","mkdirp","bind","path","dirname","extract","strip","time","await"],"mappings":";;;;+BAMA;;;eAAwBA;;;2DANP;kEACG;qEACD;oEACA;8DACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,SAASA,mBAAmBC,GAAG,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAS;IACtE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBE,IAAAA,uBAAM,EAACH,MAAM,SAACI;QACZ,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAE9C,IAAMG,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,sBAAM,CAACC,IAAI,CAAC,MAAMC,aAAI,CAACC,OAAO,CAACX;QAC3CK,MAAME,KAAK,CAACK,oBAAO,CAACH,IAAI,CAAC,MAAMV,KAAKC,MAAM;YAAEa,OAAO;YAAGC,MAAM;WAASb;QACrEI,MAAMU,KAAK,CAACb;IACd;AACF"}
@@ -67,19 +67,17 @@ function install(versionExpression, options, callback) {
67
67
  if (versions.length !== 1) return callback(new Error("Version ".concat(versionExpression, " resolved to multiple versions: ").concat(versions.map(function(x) {
68
68
  return x.version;
69
69
  }), ". Expecting one.")));
70
- (0, _mkdirpclassic.default)(options.cachePath, function(err) {
71
- if (err) return callback(err);
72
- var version = versions[0];
73
- var result = (0, _createResult.default)(options, version);
74
- (0, _checkMissing.default)(result.installPath, options, function(err, missing) {
75
- if (err || !missing.length) return callback(err, result);
76
- var queue = new _queuecb.default(1);
77
- queue.defer(_ensureDestinationParent.default.bind(null, result.installPath));
78
- !~missing.indexOf('node') || queue.defer(_index1.default.bind(null, version, result.installPath, options));
79
- !~missing.indexOf('npm') || queue.defer(_index.default.bind(null, version, result.installPath, options));
80
- queue.await(function(err) {
81
- return err ? callback(err) : callback(null, result);
82
- });
70
+ var version = versions[0];
71
+ var result = (0, _createResult.default)(options, version);
72
+ (0, _checkMissing.default)(result.installPath, options, function(err, missing) {
73
+ if (err || !missing.length) return callback(err, result);
74
+ var queue = new _queuecb.default(1);
75
+ queue.defer(_mkdirpclassic.default.bind(null, options.cachePath));
76
+ queue.defer(_ensureDestinationParent.default.bind(null, result.installPath));
77
+ !~missing.indexOf('node') || queue.defer(_index1.default.bind(null, version, result.installPath, options));
78
+ !~missing.indexOf('npm') || queue.defer(_index.default.bind(null, version, result.installPath, options));
79
+ queue.await(function(err) {
80
+ return err ? callback(err) : callback(null, result);
83
81
  });
84
82
  });
85
83
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport { DEFAULT_STORAGE_PATHS } from '../constants';\n\nimport createResult from '../createResult';\nimport createStoragePaths from '../createStoragePaths';\n\nimport resolveVersions from 'node-resolve-versions';\n\nimport installNPM from '../installNPM/index';\nimport installNode from '../installNode/index';\nimport checkMissing from '../lib/checkMissing';\nimport ensureDestinationParent from '../lib/ensureDestinationParent';\n\n// short circuit\nfunction getVersions(versionExpression, options, callback) {\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression, options, callback) {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n\n options = { ...storagePaths, ...options };\n getVersions(versionExpression, options, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n if (versions.length !== 1) return callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x.version)}. Expecting one.`));\n\n mkdirp(options.cachePath, (err) => {\n if (err) return callback(err);\n const version = versions[0];\n const result = createResult(options, version);\n\n checkMissing(result.installPath, options, (err, missing) => {\n if (err || !missing.length) return callback(err, result);\n\n const queue = new Queue(1);\n queue.defer(ensureDestinationParent.bind(null, result.installPath));\n !~missing.indexOf('node') || queue.defer(installNode.bind(null, version, result.installPath, options));\n !~missing.indexOf('npm') || queue.defer(installNPM.bind(null, version, result.installPath, options));\n queue.await((err) => (err ? callback(err) : callback(null, result)));\n });\n });\n });\n}\n"],"names":["install","getVersions","versionExpression","options","callback","isVersion","resolveVersions","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","err","versions","length","Error","map","x","version","mkdirp","cachePath","result","createResult","checkMissing","installPath","missing","queue","Queue","defer","ensureDestinationParent","bind","indexOf","installNode","installNPM","await"],"mappings":";;;;+BAoBA;;;eAAwBA;;;gEApBF;oEACH;8DACD;yBACoB;mEAEb;yEACM;0EAEH;4DAEL;6DACC;mEACC;8EACW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpC,gBAAgB;AAChB,SAASC,YAAYC,iBAAiB,EAAEC,OAAO,EAAEC,QAAQ;IACvDC,IAAAA,kBAAS,EAACH,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAII,IAAAA,4BAAe,EAACJ,mBAAmBC,SAASC;AACnH;AAEe,SAASJ,QAAQE,iBAAiB,EAAEC,OAAO,EAAEC,QAAQ;IAClE,IAAMG,eAAeJ,QAAQK,WAAW,GAAGC,IAAAA,2BAAkB,EAACN,QAAQK,WAAW,IAAIE,gCAAqB;IAE1GP,UAAU,mBAAKI,cAAiBJ;IAChCF,YAAYC,mBAAmBC,SAAS,SAACQ,KAAKC;QAC5C,IAAID,KAAK,OAAOP,SAASO;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE,OAAOT,SAAS,IAAIU,MAAM,AAAC,mCAAoD,OAAlBZ;QACnF,IAAIU,SAASC,MAAM,KAAK,GAAG,OAAOT,SAAS,IAAIU,MAAM,AAAC,WAA8DF,OAApDV,mBAAkB,oCAAiE,OAA/BU,SAASG,GAAG,CAAC,SAACC;mBAAMA,EAAEC,OAAO;YAAE;QAEnJC,IAAAA,sBAAM,EAACf,QAAQgB,SAAS,EAAE,SAACR;YACzB,IAAIA,KAAK,OAAOP,SAASO;YACzB,IAAMM,UAAUL,QAAQ,CAAC,EAAE;YAC3B,IAAMQ,SAASC,IAAAA,qBAAY,EAAClB,SAASc;YAErCK,IAAAA,qBAAY,EAACF,OAAOG,WAAW,EAAEpB,SAAS,SAACQ,KAAKa;gBAC9C,IAAIb,OAAO,CAACa,QAAQX,MAAM,EAAE,OAAOT,SAASO,KAAKS;gBAEjD,IAAMK,QAAQ,IAAIC,gBAAK,CAAC;gBACxBD,MAAME,KAAK,CAACC,gCAAuB,CAACC,IAAI,CAAC,MAAMT,OAAOG,WAAW;gBACjE,CAAC,CAACC,QAAQM,OAAO,CAAC,WAAWL,MAAME,KAAK,CAACI,eAAW,CAACF,IAAI,CAAC,MAAMZ,SAASG,OAAOG,WAAW,EAAEpB;gBAC7F,CAAC,CAACqB,QAAQM,OAAO,CAAC,UAAUL,MAAME,KAAK,CAACK,cAAU,CAACH,IAAI,CAAC,MAAMZ,SAASG,OAAOG,WAAW,EAAEpB;gBAC3FsB,MAAMQ,KAAK,CAAC,SAACtB;2BAASA,MAAMP,SAASO,OAAOP,SAAS,MAAMgB;;YAC7D;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport Queue from 'queue-cb';\nimport { DEFAULT_STORAGE_PATHS } from '../constants';\n\nimport createResult from '../createResult';\nimport createStoragePaths from '../createStoragePaths';\n\nimport resolveVersions from 'node-resolve-versions';\n\nimport installNPM from '../installNPM/index';\nimport installNode from '../installNode/index';\nimport checkMissing from '../lib/checkMissing';\nimport ensureDestinationParent from '../lib/ensureDestinationParent';\n\n// short circuit\nfunction getVersions(versionExpression, options, callback) {\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression, options, callback) {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n\n options = { ...storagePaths, ...options };\n getVersions(versionExpression, options, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n if (versions.length !== 1) return callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x.version)}. Expecting one.`));\n\n const version = versions[0];\n const result = createResult(options, version);\n\n checkMissing(result.installPath, options, (err, missing) => {\n if (err || !missing.length) return callback(err, result);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, result.installPath));\n !~missing.indexOf('node') || queue.defer(installNode.bind(null, version, result.installPath, options));\n !~missing.indexOf('npm') || queue.defer(installNPM.bind(null, version, result.installPath, options));\n queue.await((err) => (err ? callback(err) : callback(null, result)));\n });\n });\n}\n"],"names":["install","getVersions","versionExpression","options","callback","isVersion","resolveVersions","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","err","versions","length","Error","map","x","version","result","createResult","checkMissing","installPath","missing","queue","Queue","defer","mkdirp","bind","cachePath","ensureDestinationParent","indexOf","installNode","installNPM","await"],"mappings":";;;;+BAoBA;;;eAAwBA;;;gEApBF;oEACH;8DACD;yBACoB;mEAEb;yEACM;0EAEH;4DAEL;6DACC;mEACC;8EACW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpC,gBAAgB;AAChB,SAASC,YAAYC,iBAAiB,EAAEC,OAAO,EAAEC,QAAQ;IACvDC,IAAAA,kBAAS,EAACH,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAII,IAAAA,4BAAe,EAACJ,mBAAmBC,SAASC;AACnH;AAEe,SAASJ,QAAQE,iBAAiB,EAAEC,OAAO,EAAEC,QAAQ;IAClE,IAAMG,eAAeJ,QAAQK,WAAW,GAAGC,IAAAA,2BAAkB,EAACN,QAAQK,WAAW,IAAIE,gCAAqB;IAE1GP,UAAU,mBAAKI,cAAiBJ;IAChCF,YAAYC,mBAAmBC,SAAS,SAACQ,KAAKC;QAC5C,IAAID,KAAK,OAAOP,SAASO;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE,OAAOT,SAAS,IAAIU,MAAM,AAAC,mCAAoD,OAAlBZ;QACnF,IAAIU,SAASC,MAAM,KAAK,GAAG,OAAOT,SAAS,IAAIU,MAAM,AAAC,WAA8DF,OAApDV,mBAAkB,oCAAiE,OAA/BU,SAASG,GAAG,CAAC,SAACC;mBAAMA,EAAEC,OAAO;YAAE;QAEnJ,IAAMA,UAAUL,QAAQ,CAAC,EAAE;QAC3B,IAAMM,SAASC,IAAAA,qBAAY,EAAChB,SAASc;QAErCG,IAAAA,qBAAY,EAACF,OAAOG,WAAW,EAAElB,SAAS,SAACQ,KAAKW;YAC9C,IAAIX,OAAO,CAACW,QAAQT,MAAM,EAAE,OAAOT,SAASO,KAAKO;YAEjD,IAAMK,QAAQ,IAAIC,gBAAK,CAAC;YACxBD,MAAME,KAAK,CAACC,sBAAM,CAACC,IAAI,CAAC,MAAMxB,QAAQyB,SAAS;YAC/CL,MAAME,KAAK,CAACI,gCAAuB,CAACF,IAAI,CAAC,MAAMT,OAAOG,WAAW;YACjE,CAAC,CAACC,QAAQQ,OAAO,CAAC,WAAWP,MAAME,KAAK,CAACM,eAAW,CAACJ,IAAI,CAAC,MAAMV,SAASC,OAAOG,WAAW,EAAElB;YAC7F,CAAC,CAACmB,QAAQQ,OAAO,CAAC,UAAUP,MAAME,KAAK,CAACO,cAAU,CAACL,IAAI,CAAC,MAAMV,SAASC,OAAOG,WAAW,EAAElB;YAC3FoB,MAAMU,KAAK,CAAC,SAACtB;uBAASA,MAAMP,SAASO,OAAOP,SAAS,MAAMc;;QAC7D;IACF;AACF"}
@@ -1,6 +1,9 @@
1
1
  import path from 'path';
2
2
  import home from 'homedir-polyfill';
3
+ // @ts-ignore
4
+ import files from '../../assets/files.cjs';
3
5
  import createStoragePaths from './createStoragePaths.mjs';
6
+ export const FILES = files;
4
7
  export const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
5
8
  export const NODE = isWindows ? 'node.exe' : 'node';
6
9
  export const DEFAULT_STORAGE_PATH = path.join(home(), '.nir');
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import path from 'path';\nimport home from 'homedir-polyfill';\nimport createStoragePaths from './createStoragePaths';\n\nexport const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nexport const NODE = isWindows ? 'node.exe' : 'node';\n\nexport const DEFAULT_STORAGE_PATH = path.join(home(), '.nir');\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\nexport const NPM_PLATFORM_FILES = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ],\n posix: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm-cli.js'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx-cli.js'), dest: 'npx', optional: true },\n ],\n};\n"],"names":["path","home","createStoragePaths","isWindows","process","platform","test","env","OSTYPE","NODE","DEFAULT_STORAGE_PATH","join","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_URL","NPM_DIST_TAGS_URL","NPM_MIN_VERSION","NPM_PLATFORM_FILES","win32","src","dest","optional","posix"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,UAAU,mBAAmB;AACpC,OAAOC,wBAAwB,uBAAuB;AAEtD,OAAO,MAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM,EAAE;AACpG,OAAO,MAAMC,OAAON,YAAY,aAAa,OAAO;AAEpD,OAAO,MAAMO,uBAAuBV,KAAKW,IAAI,CAACV,QAAQ,QAAQ;AAC9D,OAAO,MAAMW,wBAAwBV,mBAAmBQ,sBAAsB;AAE9E,OAAO,MAAMG,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM,CAAC;AAEnE,OAAO,MAAMC,qBAAqB,0BAA0B;AAC5D,OAAO,MAAMC,qBAAqB,wEAAwE;AAE1G,OAAO,MAAMC,eAAe,iCAAiC;AAC7D,OAAO,MAAMC,oBAAoB,qDAAqD;AACtF,OAAO,MAAMC,kBAAkB,EAAE;AACjC,OAAO,MAAMC,qBAAqB;IAChCC,OAAO;QACL;YAAEC,KAAKrB,KAAKW,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQW,MAAM;QAAM;QACnE;YAAED,KAAKrB,KAAKW,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYW,MAAM;QAAU;QAC3E;YAAED,KAAKrB,KAAKW,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQW,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEF,KAAKrB,KAAKW,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYW,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDC,OAAO;QACL;YAAEH,KAAKrB,KAAKW,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeW,MAAM;QAAM;QAC1E;YAAED,KAAKrB,KAAKW,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeW,MAAM;YAAOC,UAAU;QAAK;KAC3F;AACH,EAAE"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import path from 'path';\nimport home from 'homedir-polyfill';\n// @ts-ignore\nimport files from '../../assets/files.cjs';\nimport createStoragePaths from './createStoragePaths';\n\nexport const FILES = files;\n\nexport const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nexport const NODE = isWindows ? 'node.exe' : 'node';\n\nexport const DEFAULT_STORAGE_PATH = path.join(home(), '.nir');\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\nexport const NPM_PLATFORM_FILES = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ],\n posix: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm-cli.js'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx-cli.js'), dest: 'npx', optional: true },\n ],\n};\n"],"names":["path","home","files","createStoragePaths","FILES","isWindows","process","platform","test","env","OSTYPE","NODE","DEFAULT_STORAGE_PATH","join","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_URL","NPM_DIST_TAGS_URL","NPM_MIN_VERSION","NPM_PLATFORM_FILES","win32","src","dest","optional","posix"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,UAAU,mBAAmB;AACpC,aAAa;AACb,OAAOC,WAAW,yBAAyB;AAC3C,OAAOC,wBAAwB,uBAAuB;AAEtD,OAAO,MAAMC,QAAQF,MAAM;AAE3B,OAAO,MAAMG,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM,EAAE;AACpG,OAAO,MAAMC,OAAON,YAAY,aAAa,OAAO;AAEpD,OAAO,MAAMO,uBAAuBZ,KAAKa,IAAI,CAACZ,QAAQ,QAAQ;AAC9D,OAAO,MAAMa,wBAAwBX,mBAAmBS,sBAAsB;AAE9E,OAAO,MAAMG,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM,CAAC;AAEnE,OAAO,MAAMC,qBAAqB,0BAA0B;AAC5D,OAAO,MAAMC,qBAAqB,wEAAwE;AAE1G,OAAO,MAAMC,eAAe,iCAAiC;AAC7D,OAAO,MAAMC,oBAAoB,qDAAqD;AACtF,OAAO,MAAMC,kBAAkB,EAAE;AACjC,OAAO,MAAMC,qBAAqB;IAChCC,OAAO;QACL;YAAEC,KAAKvB,KAAKa,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQW,MAAM;QAAM;QACnE;YAAED,KAAKvB,KAAKa,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYW,MAAM;QAAU;QAC3E;YAAED,KAAKvB,KAAKa,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQW,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEF,KAAKvB,KAAKa,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYW,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDC,OAAO;QACL;YAAEH,KAAKvB,KAAKa,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeW,MAAM;QAAM;QAC1E;YAAED,KAAKvB,KAAKa,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeW,MAAM;YAAOC,UAAU;QAAK;KAC3F;AACH,EAAE"}