node-install-release 0.4.8 → 1.1.0

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 (60) hide show
  1. package/bin/cli.js +3 -0
  2. package/dist/cjs/arch.js +1 -6
  3. package/dist/cjs/arch.js.map +1 -1
  4. package/dist/cjs/checkMissing.js +1 -6
  5. package/dist/cjs/checkMissing.js.map +1 -1
  6. package/dist/cjs/cli.js +64 -0
  7. package/dist/cjs/cli.js.map +1 -0
  8. package/dist/cjs/conditionalCache.js +1 -6
  9. package/dist/cjs/conditionalCache.js.map +1 -1
  10. package/dist/cjs/conditionalCopy.js +1 -6
  11. package/dist/cjs/conditionalCopy.js.map +1 -1
  12. package/dist/cjs/conditionalExtract.js +2 -7
  13. package/dist/cjs/conditionalExtract.js.map +1 -1
  14. package/dist/cjs/copyFile.js +1 -6
  15. package/dist/cjs/copyFile.js.map +1 -1
  16. package/dist/cjs/endsWithFn.js +1 -6
  17. package/dist/cjs/endsWithFn.js.map +1 -1
  18. package/dist/cjs/ensureDestinationParent.js +1 -6
  19. package/dist/cjs/ensureDestinationParent.js.map +1 -1
  20. package/dist/cjs/index.js +17 -9
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/cjs/install.js +1 -6
  23. package/dist/cjs/install.js.map +1 -1
  24. package/dist/cjs/installNPM/index.js +1 -6
  25. package/dist/cjs/installNPM/index.js.map +1 -1
  26. package/dist/cjs/installNPM/installBin.js +1 -6
  27. package/dist/cjs/installNPM/installBin.js.map +1 -1
  28. package/dist/cjs/installNPM/installLib.js +2 -7
  29. package/dist/cjs/installNPM/installLib.js.map +1 -1
  30. package/dist/cjs/installNode/filenames.js +1 -6
  31. package/dist/cjs/installNode/filenames.js.map +1 -1
  32. package/dist/cjs/installNode/findDistPaths.js +2 -7
  33. package/dist/cjs/installNode/findDistPaths.js.map +1 -1
  34. package/dist/cjs/installNode/index.js +2 -7
  35. package/dist/cjs/installNode/index.js.map +1 -1
  36. package/dist/cjs/installNode/installCompressed.js +1 -6
  37. package/dist/cjs/installNode/installCompressed.js.map +1 -1
  38. package/dist/cjs/installNode/installExe.js +1 -6
  39. package/dist/cjs/installNode/installExe.js.map +1 -1
  40. package/dist/cjs/installNode/installSource/buildPosix.js +1 -6
  41. package/dist/cjs/installNode/installSource/buildPosix.js.map +1 -1
  42. package/dist/cjs/installNode/installSource/buildWin32.js +1 -6
  43. package/dist/cjs/installNode/installSource/buildWin32.js.map +1 -1
  44. package/dist/cjs/installNode/installSource/index.js +1 -6
  45. package/dist/cjs/installNode/installSource/index.js.map +1 -1
  46. package/dist/cjs/installVersion.js +1 -6
  47. package/dist/cjs/installVersion.js.map +1 -1
  48. package/dist/cjs/polyfills/execCallback.js +1 -6
  49. package/dist/cjs/polyfills/execCallback.js.map +1 -1
  50. package/dist/cjs/polyfills/index.js +1 -6
  51. package/dist/cjs/polyfills/index.js.map +1 -1
  52. package/dist/cjs/progress.js +1 -6
  53. package/dist/cjs/progress.js.map +1 -1
  54. package/dist/types/cli.d.ts +2 -0
  55. package/dist/types/index.d.mts +1 -0
  56. package/package.json +14 -14
  57. package/bin/node-install-release.js +0 -46
  58. package/dist/types/buildPosix.d.ts +0 -2
  59. package/dist/types/index.d.ts +0 -2
  60. /package/dist/types/{execCallback.d.ts → polyfills/execCallback.d.ts} +0 -0
package/bin/cli.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ require('../dist/cjs/cli.js')(process.argv.slice(2));
package/dist/cjs/arch.js CHANGED
@@ -59,9 +59,4 @@ var path = require("path");
59
59
  * If none of the above, assume the architecture is 32-bit.
60
60
  */ return "x86";
61
61
  };
62
-
63
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
64
- Object.defineProperty(exports.default, '__esModule', { value: true });
65
- for (var key in exports) exports.default[key] = exports[key];
66
- module.exports = exports.default;
67
- }
62
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["arch.js"],"sourcesContent":["// Inline until merged: https://github.com/jakejarvis/arch/blob/detect-arm/index.js\n\n/*! arch. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nvar cp = require('child_process');\nvar fs = require('fs');\nvar path = require('path');\n\n/**\n * Returns the operating system's CPU architecture. This is different than\n * `process.arch` or `os.arch()` which returns the architecture the Node.js (or\n * Electron) binary was compiled for.\n */\nmodule.exports = function arch() {\n /**\n * On macOS, we need to detect if x64 Node is running because the CPU is truly\n * an Intel chip, or if it's running on Apple Silicon via Rosetta 2:\n * https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment\n */\n if (process.platform === 'darwin') {\n var nativeArm = process.arch === 'arm64';\n var rosettaArm = cp.execSync('sysctl -in sysctl.proc_translated', { encoding: 'utf8' }) === '1\\n';\n\n return nativeArm || rosettaArm ? 'arm64' : 'x64';\n }\n\n /**\n * On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit\n * app is based on the presence of a WOW64 file: %SystemRoot%\\SysNative.\n * See: https://twitter.com/feross/status/776949077208510464\n */\n if (process.platform === 'win32') {\n var useEnv = false;\n try {\n useEnv = !!(process.env.SYSTEMROOT && fs.statSync(process.env.SYSTEMROOT));\n } catch (_err) {}\n\n var sysRoot = useEnv ? process.env.SYSTEMROOT : 'C:\\\\Windows';\n\n // If %SystemRoot%\\SysNative exists, we are in a WOW64 FS Redirected application.\n var isWOW64 = false;\n try {\n isWOW64 = !!fs.statSync(path.join(sysRoot, 'sysnative'));\n } catch (_err) {}\n\n return isWOW64 ? 'x64' : 'x86';\n }\n\n /**\n * On Linux, use the `getconf` command to get the architecture.\n */\n if (process.platform === 'linux') {\n try {\n var output1 = cp.execSync('uname -a', { encoding: 'utf8' });\n if (~output1.indexOf('raspberrypi')) return 'arm-pi';\n } catch (_err) {}\n\n var output = cp.execSync('getconf LONG_BIT', { encoding: 'utf8' });\n return output === '64\\n' ? 'x64' : 'x86';\n }\n\n /**\n * The running binary is 64-bit, so the OS is clearly 64-bit.\n */\n if (process.arch === 'x64') {\n return 'x64';\n }\n\n /**\n * If none of the above, assume the architecture is 32-bit.\n */\n return 'x86';\n};\n"],"names":["cp","require","fs","path","module","exports","arch","process","platform","nativeArm","rosettaArm","execSync","encoding","useEnv","env","SYSTEMROOT","statSync","_err","sysRoot","isWOW64","join","output1","indexOf","output"],"mappings":"AAAA,mFAAmF;AAEnF,2EAA2E;AAC3E,IAAIA,KAAKC,QAAQ;AACjB,IAAIC,KAAKD,QAAQ;AACjB,IAAIE,OAAOF,QAAQ;AAEnB;;;;CAIC,GACDG,OAAOC,OAAO,GAAG,SAASC;IACxB;;;;GAIC,GACD,IAAIC,QAAQC,QAAQ,KAAK,UAAU;QACjC,IAAIC,YAAYF,QAAQD,IAAI,KAAK;QACjC,IAAII,aAAaV,GAAGW,QAAQ,CAAC,qCAAqC;YAAEC,UAAU;QAAO,OAAO;QAE5F,OAAOH,aAAaC,aAAa,UAAU;IAC7C;IAEA;;;;GAIC,GACD,IAAIH,QAAQC,QAAQ,KAAK,SAAS;QAChC,IAAIK,SAAS;QACb,IAAI;YACFA,SAAS,CAAC,CAAEN,CAAAA,QAAQO,GAAG,CAACC,UAAU,IAAIb,GAAGc,QAAQ,CAACT,QAAQO,GAAG,CAACC,UAAU,CAAA;QAC1E,EAAE,OAAOE,MAAM,CAAC;QAEhB,IAAIC,UAAUL,SAASN,QAAQO,GAAG,CAACC,UAAU,GAAG;QAEhD,iFAAiF;QACjF,IAAII,UAAU;QACd,IAAI;YACFA,UAAU,CAAC,CAACjB,GAAGc,QAAQ,CAACb,KAAKiB,IAAI,CAACF,SAAS;QAC7C,EAAE,OAAOD,MAAM,CAAC;QAEhB,OAAOE,UAAU,QAAQ;IAC3B;IAEA;;GAEC,GACD,IAAIZ,QAAQC,QAAQ,KAAK,SAAS;QAChC,IAAI;YACF,IAAIa,UAAUrB,GAAGW,QAAQ,CAAC,YAAY;gBAAEC,UAAU;YAAO;YACzD,IAAI,CAACS,QAAQC,OAAO,CAAC,gBAAgB,OAAO;QAC9C,EAAE,OAAOL,MAAM,CAAC;QAEhB,IAAIM,SAASvB,GAAGW,QAAQ,CAAC,oBAAoB;YAAEC,UAAU;QAAO;QAChE,OAAOW,WAAW,SAAS,QAAQ;IACrC;IAEA;;GAEC,GACD,IAAIhB,QAAQD,IAAI,KAAK,OAAO;QAC1B,OAAO;IACT;IAEA;;GAEC,GACD,OAAO;AACT"}
1
+ {"version":3,"sources":["arch.js"],"sourcesContent":["// Inline until merged: https://github.com/jakejarvis/arch/blob/detect-arm/index.js\n\n/*! arch. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nconst cp = require('child_process');\nconst fs = require('fs');\nconst path = require('path');\n\n/**\n * Returns the operating system's CPU architecture. This is different than\n * `process.arch` or `os.arch()` which returns the architecture the Node.js (or\n * Electron) binary was compiled for.\n */\nmodule.exports = function arch() {\n /**\n * On macOS, we need to detect if x64 Node is running because the CPU is truly\n * an Intel chip, or if it's running on Apple Silicon via Rosetta 2:\n * https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment\n */\n if (process.platform === 'darwin') {\n const nativeArm = process.arch === 'arm64';\n const rosettaArm = cp.execSync('sysctl -in sysctl.proc_translated', { encoding: 'utf8' }) === '1\\n';\n\n return nativeArm || rosettaArm ? 'arm64' : 'x64';\n }\n\n /**\n * On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit\n * app is based on the presence of a WOW64 file: %SystemRoot%\\SysNative.\n * See: https://twitter.com/feross/status/776949077208510464\n */\n if (process.platform === 'win32') {\n let useEnv = false;\n try {\n useEnv = !!(process.env.SYSTEMROOT && fs.statSync(process.env.SYSTEMROOT));\n } catch (_err) {}\n\n const sysRoot = useEnv ? process.env.SYSTEMROOT : 'C:\\\\Windows';\n\n // If %SystemRoot%\\SysNative exists, we are in a WOW64 FS Redirected application.\n let isWOW64 = false;\n try {\n isWOW64 = !!fs.statSync(path.join(sysRoot, 'sysnative'));\n } catch (_err) {}\n\n return isWOW64 ? 'x64' : 'x86';\n }\n\n /**\n * On Linux, use the `getconf` command to get the architecture.\n */\n if (process.platform === 'linux') {\n try {\n const output1 = cp.execSync('uname -a', { encoding: 'utf8' });\n if (~output1.indexOf('raspberrypi')) return 'arm-pi';\n } catch (_err) {}\n\n const output = cp.execSync('getconf LONG_BIT', { encoding: 'utf8' });\n return output === '64\\n' ? 'x64' : 'x86';\n }\n\n /**\n * The running binary is 64-bit, so the OS is clearly 64-bit.\n */\n if (process.arch === 'x64') {\n return 'x64';\n }\n\n /**\n * If none of the above, assume the architecture is 32-bit.\n */\n return 'x86';\n};\n"],"names":["cp","require","fs","path","module","exports","arch","process","platform","nativeArm","rosettaArm","execSync","encoding","useEnv","env","SYSTEMROOT","statSync","_err","sysRoot","isWOW64","join","output1","indexOf","output"],"mappings":"AAAA,mFAAmF;AAEnF,2EAA2E;AAC3E,IAAMA,KAAKC,QAAQ;AACnB,IAAMC,KAAKD,QAAQ;AACnB,IAAME,OAAOF,QAAQ;AAErB;;;;CAIC,GACDG,OAAOC,OAAO,GAAG,SAASC;IACxB;;;;GAIC,GACD,IAAIC,QAAQC,QAAQ,KAAK,UAAU;QACjC,IAAMC,YAAYF,QAAQD,IAAI,KAAK;QACnC,IAAMI,aAAaV,GAAGW,QAAQ,CAAC,qCAAqC;YAAEC,UAAU;QAAO,OAAO;QAE9F,OAAOH,aAAaC,aAAa,UAAU;IAC7C;IAEA;;;;GAIC,GACD,IAAIH,QAAQC,QAAQ,KAAK,SAAS;QAChC,IAAIK,SAAS;QACb,IAAI;YACFA,SAAS,CAAC,CAAEN,CAAAA,QAAQO,GAAG,CAACC,UAAU,IAAIb,GAAGc,QAAQ,CAACT,QAAQO,GAAG,CAACC,UAAU,CAAA;QAC1E,EAAE,OAAOE,MAAM,CAAC;QAEhB,IAAMC,UAAUL,SAASN,QAAQO,GAAG,CAACC,UAAU,GAAG;QAElD,iFAAiF;QACjF,IAAII,UAAU;QACd,IAAI;YACFA,UAAU,CAAC,CAACjB,GAAGc,QAAQ,CAACb,KAAKiB,IAAI,CAACF,SAAS;QAC7C,EAAE,OAAOD,MAAM,CAAC;QAEhB,OAAOE,UAAU,QAAQ;IAC3B;IAEA;;GAEC,GACD,IAAIZ,QAAQC,QAAQ,KAAK,SAAS;QAChC,IAAI;YACF,IAAMa,UAAUrB,GAAGW,QAAQ,CAAC,YAAY;gBAAEC,UAAU;YAAO;YAC3D,IAAI,CAACS,QAAQC,OAAO,CAAC,gBAAgB,OAAO;QAC9C,EAAE,OAAOL,MAAM,CAAC;QAEhB,IAAMM,SAASvB,GAAGW,QAAQ,CAAC,oBAAoB;YAAEC,UAAU;QAAO;QAClE,OAAOW,WAAW,SAAS,QAAQ;IACrC;IAEA;;GAEC,GACD,IAAIhB,QAAQD,IAAI,KAAK,OAAO;QAC1B,OAAO;IACT;IAEA;;GAEC,GACD,OAAO;AACT"}
@@ -40,9 +40,4 @@ module.exports = function checkMissing(dest, options, callback) {
40
40
  return callback(null, missing);
41
41
  });
42
42
  };
43
-
44
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
45
- Object.defineProperty(exports.default, '__esModule', { value: true });
46
- for (var key in exports) exports.default[key] = exports[key];
47
- module.exports = exports.default;
48
- }
43
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["checkMissing.js"],"sourcesContent":["var path = require('path');\nvar fs = require('fs');\nvar keys = require('lodash.keys');\n\nvar PLATFORM_FILES = {\n win32: {\n node: ['node.exe'],\n npm: ['npm', 'npm.cmd'],\n },\n posix: {\n node: ['node'],\n npm: ['npm'],\n },\n};\n\nmodule.exports = function checkMissing(dest, options, callback) {\n var platform = options.platform || process.platform;\n var files = PLATFORM_FILES[platform] || PLATFORM_FILES.posix;\n var binPath = platform === 'win32' ? dest : path.join(dest, 'bin');\n\n fs.readdir(binPath, (err, names) => {\n if (err || !names.length) return callback(null, keys(files));\n\n var missing = [];\n for (var key in files) {\n var needed = files[key];\n for (var index = 0; index < needed.length; index++) {\n if (!~names.indexOf(needed[index])) {\n missing.push(key);\n break;\n }\n }\n }\n return callback(null, missing);\n });\n};\n"],"names":["path","require","fs","keys","PLATFORM_FILES","win32","node","npm","posix","module","exports","checkMissing","dest","options","callback","platform","process","files","binPath","join","readdir","err","names","length","missing","key","needed","index","indexOf","push"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,KAAKD,QAAQ;AACjB,IAAIE,OAAOF,QAAQ;AAEnB,IAAIG,iBAAiB;IACnBC,OAAO;QACLC,MAAM;YAAC;SAAW;QAClBC,KAAK;YAAC;YAAO;SAAU;IACzB;IACAC,OAAO;QACLF,MAAM;YAAC;SAAO;QACdC,KAAK;YAAC;SAAM;IACd;AACF;AAEAE,OAAOC,OAAO,GAAG,SAASC,aAAaC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC5D,IAAIC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACnD,IAAIE,QAAQb,cAAc,CAACW,SAAS,IAAIX,eAAeI,KAAK;IAC5D,IAAIU,UAAUH,aAAa,UAAUH,OAAOZ,KAAKmB,IAAI,CAACP,MAAM;IAE5DV,GAAGkB,OAAO,CAACF,SAAS,SAACG,KAAKC;QACxB,IAAID,OAAO,CAACC,MAAMC,MAAM,EAAE,OAAOT,SAAS,MAAMX,KAAKc;QAErD,IAAIO,UAAU,EAAE;QAChB,IAAK,IAAIC,OAAOR,MAAO;YACrB,IAAIS,SAAST,KAAK,CAACQ,IAAI;YACvB,IAAK,IAAIE,QAAQ,GAAGA,QAAQD,OAAOH,MAAM,EAAEI,QAAS;gBAClD,IAAI,CAAC,CAACL,MAAMM,OAAO,CAACF,MAAM,CAACC,MAAM,GAAG;oBAClCH,QAAQK,IAAI,CAACJ;oBACb;gBACF;YACF;QACF;QACA,OAAOX,SAAS,MAAMU;IACxB;AACF"}
1
+ {"version":3,"sources":["checkMissing.js"],"sourcesContent":["const path = require('path');\nconst fs = require('fs');\nconst keys = require('lodash.keys');\n\nconst PLATFORM_FILES = {\n win32: {\n node: ['node.exe'],\n npm: ['npm', 'npm.cmd'],\n },\n posix: {\n node: ['node'],\n npm: ['npm'],\n },\n};\n\nmodule.exports = function checkMissing(dest, options, callback) {\n const platform = options.platform || process.platform;\n const files = PLATFORM_FILES[platform] || PLATFORM_FILES.posix;\n const binPath = platform === 'win32' ? dest : path.join(dest, 'bin');\n\n fs.readdir(binPath, (err, names) => {\n if (err || !names.length) return callback(null, keys(files));\n\n const missing = [];\n for (const key in files) {\n const needed = files[key];\n for (let index = 0; index < needed.length; index++) {\n if (!~names.indexOf(needed[index])) {\n missing.push(key);\n break;\n }\n }\n }\n return callback(null, missing);\n });\n};\n"],"names":["path","require","fs","keys","PLATFORM_FILES","win32","node","npm","posix","module","exports","checkMissing","dest","options","callback","platform","process","files","binPath","join","readdir","err","names","length","missing","key","needed","index","indexOf","push"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,KAAKD,QAAQ;AACnB,IAAME,OAAOF,QAAQ;AAErB,IAAMG,iBAAiB;IACrBC,OAAO;QACLC,MAAM;YAAC;SAAW;QAClBC,KAAK;YAAC;YAAO;SAAU;IACzB;IACAC,OAAO;QACLF,MAAM;YAAC;SAAO;QACdC,KAAK;YAAC;SAAM;IACd;AACF;AAEAE,OAAOC,OAAO,GAAG,SAASC,aAAaC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC5D,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,QAAQb,cAAc,CAACW,SAAS,IAAIX,eAAeI,KAAK;IAC9D,IAAMU,UAAUH,aAAa,UAAUH,OAAOZ,KAAKmB,IAAI,CAACP,MAAM;IAE9DV,GAAGkB,OAAO,CAACF,SAAS,SAACG,KAAKC;QACxB,IAAID,OAAO,CAACC,MAAMC,MAAM,EAAE,OAAOT,SAAS,MAAMX,KAAKc;QAErD,IAAMO,UAAU,EAAE;QAClB,IAAK,IAAMC,OAAOR,MAAO;YACvB,IAAMS,SAAST,KAAK,CAACQ,IAAI;YACzB,IAAK,IAAIE,QAAQ,GAAGA,QAAQD,OAAOH,MAAM,EAAEI,QAAS;gBAClD,IAAI,CAAC,CAACL,MAAMM,OAAO,CAACF,MAAM,CAACC,MAAM,GAAG;oBAClCH,QAAQK,IAAI,CAACJ;oBACb;gBACF;YACF;QACF;QACA,OAAOX,SAAS,MAAMU;IACxB;AACF"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _exit = /*#__PURE__*/ _interop_require_default(require("exit"));
12
+ var _getoptscompat = /*#__PURE__*/ _interop_require_default(require("getopts-compat"));
13
+ var _index = /*#__PURE__*/ _interop_require_default(require("./index.js"));
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ var _default = function(argv) {
20
+ var options = (0, _getoptscompat.default)(argv.slice(1), {
21
+ alias: {
22
+ platform: "p",
23
+ arch: "a",
24
+ filename: "f",
25
+ cacheDirectory: "c",
26
+ silent: "s"
27
+ },
28
+ boolean: [
29
+ "silent"
30
+ ]
31
+ });
32
+ // define.option('-p, --platform [platform]', 'Platform like darwin');
33
+ // define.option('-a, --arch [arch]', 'Architecure x64, x86, arm-pi');
34
+ // define.option('-f, --filename [filename]', 'Distribution filename from https://nodejs.org/dist/index.json');
35
+ // define.option('-c, --cacheDirectory [cacheDirectory]', 'Cache directory');
36
+ var args = argv.slice(0, 1).concat(options._);
37
+ if (args.length < 1) {
38
+ console.log("Missing command. Example usage: nir version [directory]");
39
+ return (0, _exit.default)(-1);
40
+ }
41
+ var installPath = args.length > 1 ? args[1] : null;
42
+ (0, _index.default)(args[0], installPath, Object.assign({
43
+ stdio: "inherit"
44
+ }, options), function(err, results) {
45
+ if (err) {
46
+ console.log(err.message);
47
+ return (0, _exit.default)(err.code || -1);
48
+ }
49
+ var errors = results.filter(function(result) {
50
+ return !!result.error;
51
+ });
52
+ if (!options.silent) {
53
+ console.log("\n======================");
54
+ for(var index = 0; index < results.length; index++){
55
+ var result = results[index];
56
+ if (result.error) console.log("".concat(result.version, " not installed. Error: ").concat(result.error.message));
57
+ else console.log("".concat(result.version, " installed in: ").concat(result.fullPath));
58
+ }
59
+ console.log("======================");
60
+ }
61
+ (0, _exit.default)(errors.length ? -1 : 0);
62
+ });
63
+ };
64
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["cli.js"],"sourcesContent":["import exit from 'exit';\nimport getopts from 'getopts-compat';\nimport nir from './index.js';\n\nexport default (argv) => {\n const options = getopts(argv.slice(1), {\n alias: { platform: 'p', arch: 'a', filename: 'f', cacheDirectory: 'c', silent: 's' },\n boolean: ['silent'],\n });\n\n // define.option('-p, --platform [platform]', 'Platform like darwin');\n // define.option('-a, --arch [arch]', 'Architecure x64, x86, arm-pi');\n // define.option('-f, --filename [filename]', 'Distribution filename from https://nodejs.org/dist/index.json');\n // define.option('-c, --cacheDirectory [cacheDirectory]', 'Cache directory');\n\n const args = argv.slice(0, 1).concat(options._);\n if (args.length < 1) {\n console.log('Missing command. Example usage: nir version [directory]');\n return exit(-1);\n }\n\n const installPath = args.length > 1 ? args[1] : null;\n nir(args[0], installPath, Object.assign({ stdio: 'inherit' }, options), (err, results) => {\n if (err) {\n console.log(err.message);\n return exit(err.code || -1);\n }\n const errors = results.filter((result) => !!result.error);\n\n if (!options.silent) {\n console.log('\\n======================');\n for (let index = 0; index < results.length; index++) {\n const result = results[index];\n if (result.error) console.log(`${result.version} not installed. Error: ${result.error.message}`);\n else console.log(`${result.version} installed in: ${result.fullPath}`);\n }\n console.log('======================');\n }\n\n exit(errors.length ? -1 : 0);\n });\n};\n"],"names":["argv","options","getopts","slice","alias","platform","arch","filename","cacheDirectory","silent","boolean","args","concat","_","length","console","log","exit","installPath","nir","Object","assign","stdio","err","results","message","code","errors","filter","result","error","index","version","fullPath"],"mappings":";;;;+BAIA;;;eAAA;;;2DAJiB;oEACG;4DACJ;;;;;;IAEhB,WAAe,SAACA;IACd,IAAMC,UAAUC,IAAAA,sBAAO,EAACF,KAAKG,KAAK,CAAC,IAAI;QACrCC,OAAO;YAAEC,UAAU;YAAKC,MAAM;YAAKC,UAAU;YAAKC,gBAAgB;YAAKC,QAAQ;QAAI;QACnFC,SAAS;YAAC;SAAS;IACrB;IAEA,sEAAsE;IACtE,sEAAsE;IACtE,+GAA+G;IAC/G,6EAA6E;IAE7E,IAAMC,OAAOX,KAAKG,KAAK,CAAC,GAAG,GAAGS,MAAM,CAACX,QAAQY,CAAC;IAC9C,IAAIF,KAAKG,MAAM,GAAG,GAAG;QACnBC,QAAQC,GAAG,CAAC;QACZ,OAAOC,IAAAA,aAAI,EAAC,CAAC;IACf;IAEA,IAAMC,cAAcP,KAAKG,MAAM,GAAG,IAAIH,IAAI,CAAC,EAAE,GAAG;IAChDQ,IAAAA,cAAG,EAACR,IAAI,CAAC,EAAE,EAAEO,aAAaE,OAAOC,MAAM,CAAC;QAAEC,OAAO;IAAU,GAAGrB,UAAU,SAACsB,KAAKC;QAC5E,IAAID,KAAK;YACPR,QAAQC,GAAG,CAACO,IAAIE,OAAO;YACvB,OAAOR,IAAAA,aAAI,EAACM,IAAIG,IAAI,IAAI,CAAC;QAC3B;QACA,IAAMC,SAASH,QAAQI,MAAM,CAAC,SAACC;mBAAW,CAAC,CAACA,OAAOC,KAAK;;QAExD,IAAI,CAAC7B,QAAQQ,MAAM,EAAE;YACnBM,QAAQC,GAAG,CAAC;YACZ,IAAK,IAAIe,QAAQ,GAAGA,QAAQP,QAAQV,MAAM,EAAEiB,QAAS;gBACnD,IAAMF,SAASL,OAAO,CAACO,MAAM;gBAC7B,IAAIF,OAAOC,KAAK,EAAEf,QAAQC,GAAG,CAAC,AAAC,GAA0Ca,OAAxCA,OAAOG,OAAO,EAAC,2BAA8C,OAArBH,OAAOC,KAAK,CAACL,OAAO;qBACxFV,QAAQC,GAAG,CAAC,AAAC,GAAkCa,OAAhCA,OAAOG,OAAO,EAAC,mBAAiC,OAAhBH,OAAOI,QAAQ;YACrE;YACAlB,QAAQC,GAAG,CAAC;QACd;QAEAC,IAAAA,aAAI,EAACU,OAAOb,MAAM,GAAG,CAAC,IAAI;IAC5B;AACF"}
@@ -26,9 +26,4 @@ module.exports = function conditionalCache(endpoint, dest, options, callback) {
26
26
  });
27
27
  });
28
28
  };
29
-
30
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
31
- Object.defineProperty(exports.default, '__esModule', { value: true });
32
- for (var key in exports) exports.default[key] = exports[key];
33
- module.exports = exports.default;
34
- }
29
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["conditionalCache.js"],"sourcesContent":["var path = require('path');\nvar get = require('get-remote');\nvar access = require('fs-access-compat');\n\nvar progress = require('./progress');\nvar ensureDestinationParent = require('./ensureDestinationParent');\n\nmodule.exports = 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 // TODO: do I need assign?\n get(endpoint, Object.assign({ 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":["path","require","get","access","progress","ensureDestinationParent","module","exports","conditionalCache","endpoint","dest","options","callback","err","Object","assign","filename","basename","time","file","dirname","console","log"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,MAAMD,QAAQ;AAClB,IAAIE,SAASF,QAAQ;AAErB,IAAIG,WAAWH,QAAQ;AACvB,IAAII,0BAA0BJ,QAAQ;AAEtCK,OAAOC,OAAO,GAAG,SAASC,iBAAiBC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC1E,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBR,OAAOO,MAAM,SAACG;QACZ,IAAI,CAACA,KAAK,OAAOD,YAAY,iBAAiB;QAE9CP,wBAAwBK,MAAM,SAACG;YAC7B,IAAIA,KAAK,OAAOD,SAASC;YAEzB,0BAA0B;YAC1BX,IAAIO,UAAUK,OAAOC,MAAM,CAAC;gBAAEC,UAAUhB,KAAKiB,QAAQ,CAACP;gBAAON,UAAUA;gBAAUc,MAAM;YAAK,GAAGP,UAAUQ,IAAI,CAACnB,KAAKoB,OAAO,CAACV,OAAO,SAACG;gBACjIQ,QAAQC,GAAG,CAAC;gBACZV,SAASC;YACX;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["conditionalCache.js"],"sourcesContent":["const path = require('path');\nconst get = require('get-remote');\nconst access = require('fs-access-compat');\n\nconst progress = require('./progress');\nconst ensureDestinationParent = require('./ensureDestinationParent');\n\nmodule.exports = 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 // TODO: do I need assign?\n get(endpoint, Object.assign({ 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":["path","require","get","access","progress","ensureDestinationParent","module","exports","conditionalCache","endpoint","dest","options","callback","err","Object","assign","filename","basename","time","file","dirname","console","log"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,MAAMD,QAAQ;AACpB,IAAME,SAASF,QAAQ;AAEvB,IAAMG,WAAWH,QAAQ;AACzB,IAAMI,0BAA0BJ,QAAQ;AAExCK,OAAOC,OAAO,GAAG,SAASC,iBAAiBC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC1E,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBR,OAAOO,MAAM,SAACG;QACZ,IAAI,CAACA,KAAK,OAAOD,YAAY,iBAAiB;QAE9CP,wBAAwBK,MAAM,SAACG;YAC7B,IAAIA,KAAK,OAAOD,SAASC;YAEzB,0BAA0B;YAC1BX,IAAIO,UAAUK,OAAOC,MAAM,CAAC;gBAAEC,UAAUhB,KAAKiB,QAAQ,CAACP;gBAAON,UAAUA;gBAAUc,MAAM;YAAK,GAAGP,UAAUQ,IAAI,CAACnB,KAAKoB,OAAO,CAACV,OAAO,SAACG;gBACjIQ,QAAQC,GAAG,CAAC;gBACZV,SAASC;YACX;QACF;IACF;AACF"}
@@ -19,9 +19,4 @@ module.exports = function conditionalCopy(src, dest, optional, callback) {
19
19
  });
20
20
  });
21
21
  };
22
-
23
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
24
- Object.defineProperty(exports.default, '__esModule', { value: true });
25
- for (var key in exports) exports.default[key] = exports[key];
26
- module.exports = exports.default;
27
- }
22
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["conditionalCopy.js"],"sourcesContent":["var access = require('fs-access-compat');\n\nvar copyFile = require('./copyFile');\nvar ensureDestinationParent = require('./ensureDestinationParent');\n\nmodule.exports = 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":["access","require","copyFile","ensureDestinationParent","module","exports","conditionalCopy","src","dest","optional","callback","err"],"mappings":";AAAA,IAAIA,SAASC,QAAQ;AAErB,IAAIC,WAAWD,QAAQ;AACvB,IAAIE,0BAA0BF,QAAQ;AAEtCG,OAAOC,OAAO,GAAG,SAASC,gBAAgBC,GAAG,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACrE,IAAI,OAAOD,aAAa,YAAY;QAClCC,WAAWD;QACXA,WAAW;IACb;IAEAT,OAAOQ,MAAM,SAACG;QACZ,IAAI,CAACA,KAAK,OAAOD,YAAY,iBAAiB;QAE9CP,wBAAwBK,MAAM,SAACG;YAC7B,IAAIA,KAAK,OAAOD,SAASC;YACzB,IAAI,CAACF,UAAU,OAAOP,SAASK,KAAKC,MAAME;YAE1CV,OAAOO,KAAK,SAACI;gBACX,IAAIA,KAAK,OAAOD,YAAY,wBAAwB;gBACpDR,SAASK,KAAKC,MAAME;YACtB;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["conditionalCopy.js"],"sourcesContent":["const access = require('fs-access-compat');\n\nconst copyFile = require('./copyFile');\nconst ensureDestinationParent = require('./ensureDestinationParent');\n\nmodule.exports = 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":["access","require","copyFile","ensureDestinationParent","module","exports","conditionalCopy","src","dest","optional","callback","err"],"mappings":";AAAA,IAAMA,SAASC,QAAQ;AAEvB,IAAMC,WAAWD,QAAQ;AACzB,IAAME,0BAA0BF,QAAQ;AAExCG,OAAOC,OAAO,GAAG,SAASC,gBAAgBC,GAAG,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACrE,IAAI,OAAOD,aAAa,YAAY;QAClCC,WAAWD;QACXA,WAAW;IACb;IAEAT,OAAOQ,MAAM,SAACG;QACZ,IAAI,CAACA,KAAK,OAAOD,YAAY,iBAAiB;QAE9CP,wBAAwBK,MAAM,SAACG;YAC7B,IAAIA,KAAK,OAAOD,SAASC;YACzB,IAAI,CAACF,UAAU,OAAOP,SAASK,KAAKC,MAAME;YAE1CV,OAAOO,KAAK,SAACI;gBACX,IAAIA,KAAK,OAAOD,YAAY,wBAAwB;gBACpDR,SAASK,KAAKC,MAAME;YACtB;QACF;IACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  var path = require("path");
3
- var extract = require("fast-extract");
3
+ var extract = require("fast-extract").default;
4
4
  var mkpath = require("mkpath");
5
5
  var access = require("fs-access-compat");
6
6
  var progress = require("./progress");
@@ -25,9 +25,4 @@ module.exports = function conditionalExtract(src, dest, options, callback) {
25
25
  });
26
26
  });
27
27
  };
28
-
29
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
30
- Object.defineProperty(exports.default, '__esModule', { value: true });
31
- for (var key in exports) exports.default[key] = exports[key];
32
- module.exports = exports.default;
33
- }
28
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["conditionalExtract.js"],"sourcesContent":["var path = require('path');\nvar extract = require('fast-extract');\nvar mkpath = require('mkpath');\nvar access = require('fs-access-compat');\n\nvar progress = require('./progress');\n\nmodule.exports = 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 mkpath(path.dirname(dest), () => {\n var extractOptions = Object.assign({ strip: 1, progress: progress, time: 1000 }, options);\n\n extract(src, dest, extractOptions, (err) => {\n console.log('');\n callback(err);\n });\n });\n });\n};\n"],"names":["path","require","extract","mkpath","access","progress","module","exports","conditionalExtract","src","dest","options","callback","err","dirname","extractOptions","Object","assign","strip","time","console","log"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,UAAUD,QAAQ;AACtB,IAAIE,SAASF,QAAQ;AACrB,IAAIG,SAASH,QAAQ;AAErB,IAAII,WAAWJ,QAAQ;AAEvBK,OAAOC,OAAO,GAAG,SAASC,mBAAmBC,GAAG,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACvE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBP,OAAOM,MAAM,SAACG;QACZ,IAAI,CAACA,KAAK,OAAOD,YAAY,iBAAiB;QAE9CT,OAAOH,KAAKc,OAAO,CAACJ,OAAO;YACzB,IAAIK,iBAAiBC,OAAOC,MAAM,CAAC;gBAAEC,OAAO;gBAAGb,UAAUA;gBAAUc,MAAM;YAAK,GAAGR;YAEjFT,QAAQO,KAAKC,MAAMK,gBAAgB,SAACF;gBAClCO,QAAQC,GAAG,CAAC;gBACZT,SAASC;YACX;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["conditionalExtract.js"],"sourcesContent":["const path = require('path');\nconst extract = require('fast-extract').default;\nconst mkpath = require('mkpath');\nconst access = require('fs-access-compat');\n\nconst progress = require('./progress');\n\nmodule.exports = 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 mkpath(path.dirname(dest), () => {\n const extractOptions = Object.assign({ strip: 1, progress: progress, time: 1000 }, options);\n\n extract(src, dest, extractOptions, (err) => {\n console.log('');\n callback(err);\n });\n });\n });\n};\n"],"names":["path","require","extract","default","mkpath","access","progress","module","exports","conditionalExtract","src","dest","options","callback","err","dirname","extractOptions","Object","assign","strip","time","console","log"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,UAAUD,QAAQ,gBAAgBE,OAAO;AAC/C,IAAMC,SAASH,QAAQ;AACvB,IAAMI,SAASJ,QAAQ;AAEvB,IAAMK,WAAWL,QAAQ;AAEzBM,OAAOC,OAAO,GAAG,SAASC,mBAAmBC,GAAG,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACvE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtBP,OAAOM,MAAM,SAACG;QACZ,IAAI,CAACA,KAAK,OAAOD,YAAY,iBAAiB;QAE9CT,OAAOJ,KAAKe,OAAO,CAACJ,OAAO;YACzB,IAAMK,iBAAiBC,OAAOC,MAAM,CAAC;gBAAEC,OAAO;gBAAGb,UAAUA;gBAAUc,MAAM;YAAK,GAAGR;YAEnFV,QAAQQ,KAAKC,MAAMK,gBAAgB,SAACF;gBAClCO,QAAQC,GAAG,CAAC;gBACZT,SAASC;YACX;QACF;IACF;AACF"}
@@ -22,9 +22,4 @@ module.exports = function safeCopyFile(src, dest, callback) {
22
22
  queue.defer(copyFile.bind(null, src, dest));
23
23
  queue.await(callback);
24
24
  };
25
-
26
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
27
- Object.defineProperty(exports.default, '__esModule', { value: true });
28
- for (var key in exports) exports.default[key] = exports[key];
29
- module.exports = exports.default;
30
- }
25
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["copyFile.js"],"sourcesContent":["var fs = require('fs');\nvar rimraf = require('rimraf');\nvar pump = require('pump');\nvar Queue = require('queue-cb');\n\nvar ensureDestinationParent = require('./ensureDestinationParent');\n\nfunction streamCopyFile(src, dest, callback) {\n fs.stat(src, (err) => {\n if (err) return callback(err);\n pump(fs.createReadStream(src), fs.createWriteStream(dest), callback);\n });\n}\n\nvar copyFile = fs.copyFile || streamCopyFile;\n\nmodule.exports = function safeCopyFile(src, dest, callback) {\n var queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n rimraf(dest, (err) => {\n err && err.code !== 'EEXIST' ? callback(err) : callback();\n });\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n};\n"],"names":["fs","require","rimraf","pump","Queue","ensureDestinationParent","streamCopyFile","src","dest","callback","stat","err","createReadStream","createWriteStream","copyFile","module","exports","safeCopyFile","queue","defer","bind","code","await"],"mappings":";AAAA,IAAIA,KAAKC,QAAQ;AACjB,IAAIC,SAASD,QAAQ;AACrB,IAAIE,OAAOF,QAAQ;AACnB,IAAIG,QAAQH,QAAQ;AAEpB,IAAII,0BAA0BJ,QAAQ;AAEtC,SAASK,eAAeC,GAAG,EAAEC,IAAI,EAAEC,QAAQ;IACzCT,GAAGU,IAAI,CAACH,KAAK,SAACI;QACZ,IAAIA,KAAK,OAAOF,SAASE;QACzBR,KAAKH,GAAGY,gBAAgB,CAACL,MAAMP,GAAGa,iBAAiB,CAACL,OAAOC;IAC7D;AACF;AAEA,IAAIK,WAAWd,GAAGc,QAAQ,IAAIR;AAE9BS,OAAOC,OAAO,GAAG,SAASC,aAAaV,GAAG,EAAEC,IAAI,EAAEC,QAAQ;IACxD,IAAIS,QAAQ,IAAId,MAAM;IAEtBc,MAAMC,KAAK,CAACd,wBAAwBe,IAAI,CAAC,MAAMZ;IAC/CU,MAAMC,KAAK,CAAC,SAACV;QACXP,OAAOM,MAAM,SAACG;YACZA,OAAOA,IAAIU,IAAI,KAAK,WAAWZ,SAASE,OAAOF;QACjD;IACF;IACAS,MAAMC,KAAK,CAACL,SAASM,IAAI,CAAC,MAAMb,KAAKC;IACrCU,MAAMI,KAAK,CAACb;AACd"}
1
+ {"version":3,"sources":["copyFile.js"],"sourcesContent":["const fs = require('fs');\nconst rimraf = require('rimraf');\nconst pump = require('pump');\nconst Queue = require('queue-cb');\n\nconst ensureDestinationParent = require('./ensureDestinationParent');\n\nfunction streamCopyFile(src, dest, callback) {\n fs.stat(src, (err) => {\n if (err) return callback(err);\n pump(fs.createReadStream(src), fs.createWriteStream(dest), callback);\n });\n}\n\nconst copyFile = fs.copyFile || streamCopyFile;\n\nmodule.exports = function safeCopyFile(src, dest, callback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n rimraf(dest, (err) => {\n err && err.code !== 'EEXIST' ? callback(err) : callback();\n });\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n};\n"],"names":["fs","require","rimraf","pump","Queue","ensureDestinationParent","streamCopyFile","src","dest","callback","stat","err","createReadStream","createWriteStream","copyFile","module","exports","safeCopyFile","queue","defer","bind","code","await"],"mappings":";AAAA,IAAMA,KAAKC,QAAQ;AACnB,IAAMC,SAASD,QAAQ;AACvB,IAAME,OAAOF,QAAQ;AACrB,IAAMG,QAAQH,QAAQ;AAEtB,IAAMI,0BAA0BJ,QAAQ;AAExC,SAASK,eAAeC,GAAG,EAAEC,IAAI,EAAEC,QAAQ;IACzCT,GAAGU,IAAI,CAACH,KAAK,SAACI;QACZ,IAAIA,KAAK,OAAOF,SAASE;QACzBR,KAAKH,GAAGY,gBAAgB,CAACL,MAAMP,GAAGa,iBAAiB,CAACL,OAAOC;IAC7D;AACF;AAEA,IAAMK,WAAWd,GAAGc,QAAQ,IAAIR;AAEhCS,OAAOC,OAAO,GAAG,SAASC,aAAaV,GAAG,EAAEC,IAAI,EAAEC,QAAQ;IACxD,IAAMS,QAAQ,IAAId,MAAM;IAExBc,MAAMC,KAAK,CAACd,wBAAwBe,IAAI,CAAC,MAAMZ;IAC/CU,MAAMC,KAAK,CAAC,SAACV;QACXP,OAAOM,MAAM,SAACG;YACZA,OAAOA,IAAIU,IAAI,KAAK,WAAWZ,SAASE,OAAOF;QACjD;IACF;IACAS,MAAMC,KAAK,CAACL,SAASM,IAAI,CAAC,MAAMb,KAAKC;IACrCU,MAAMI,KAAK,CAACb;AACd"}
@@ -12,9 +12,4 @@ module.exports = function endsWithFn(endings) {
12
12
  return false;
13
13
  };
14
14
  };
15
-
16
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
17
- Object.defineProperty(exports.default, '__esModule', { value: true });
18
- for (var key in exports) exports.default[key] = exports[key];
19
- module.exports = exports.default;
20
- }
15
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["endsWithFn.js"],"sourcesContent":["var isArray = require('isarray');\nvar endsWith = require('end-with');\n\nmodule.exports = function endsWithFn(endings) {\n if (!isArray(endings)) endings = [endings];\n return (string) => {\n for (var index = 0; index < endings.length; index++) {\n if (endsWith(string, endings[index])) return true;\n }\n return false;\n };\n};\n"],"names":["isArray","require","endsWith","module","exports","endsWithFn","endings","string","index","length"],"mappings":";AAAA,IAAIA,UAAUC,QAAQ;AACtB,IAAIC,WAAWD,QAAQ;AAEvBE,OAAOC,OAAO,GAAG,SAASC,WAAWC,OAAO;IAC1C,IAAI,CAACN,QAAQM,UAAUA,UAAU;QAACA;KAAQ;IAC1C,OAAO,SAACC;QACN,IAAK,IAAIC,QAAQ,GAAGA,QAAQF,QAAQG,MAAM,EAAED,QAAS;YACnD,IAAIN,SAASK,QAAQD,OAAO,CAACE,MAAM,GAAG,OAAO;QAC/C;QACA,OAAO;IACT;AACF"}
1
+ {"version":3,"sources":["endsWithFn.js"],"sourcesContent":["const isArray = require('isarray');\nconst endsWith = require('end-with');\n\nmodule.exports = function endsWithFn(endings) {\n if (!isArray(endings)) endings = [endings];\n return (string) => {\n for (let index = 0; index < endings.length; index++) {\n if (endsWith(string, endings[index])) return true;\n }\n return false;\n };\n};\n"],"names":["isArray","require","endsWith","module","exports","endsWithFn","endings","string","index","length"],"mappings":";AAAA,IAAMA,UAAUC,QAAQ;AACxB,IAAMC,WAAWD,QAAQ;AAEzBE,OAAOC,OAAO,GAAG,SAASC,WAAWC,OAAO;IAC1C,IAAI,CAACN,QAAQM,UAAUA,UAAU;QAACA;KAAQ;IAC1C,OAAO,SAACC;QACN,IAAK,IAAIC,QAAQ,GAAGA,QAAQF,QAAQG,MAAM,EAAED,QAAS;YACnD,IAAIN,SAASK,QAAQD,OAAO,CAACE,MAAM,GAAG,OAAO;QAC/C;QACA,OAAO;IACT;AACF"}
@@ -8,9 +8,4 @@ module.exports = function ensureDestinationParent(dest, callback) {
8
8
  callback(err);
9
9
  });
10
10
  };
11
-
12
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
13
- Object.defineProperty(exports.default, '__esModule', { value: true });
14
- for (var key in exports) exports.default[key] = exports[key];
15
- module.exports = exports.default;
16
- }
11
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["ensureDestinationParent.js"],"sourcesContent":["var path = require('path');\nvar mkpath = require('mkpath');\n\nmodule.exports = function ensureDestinationParent(dest, callback) {\n var parent = path.dirname(dest);\n if (parent === '.' || parent === '/') return callback();\n mkpath(parent, (err) => {\n callback(err);\n });\n};\n"],"names":["path","require","mkpath","module","exports","ensureDestinationParent","dest","callback","parent","dirname","err"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,SAASD,QAAQ;AAErBE,OAAOC,OAAO,GAAG,SAASC,wBAAwBC,IAAI,EAAEC,QAAQ;IAC9D,IAAIC,SAASR,KAAKS,OAAO,CAACH;IAC1B,IAAIE,WAAW,OAAOA,WAAW,KAAK,OAAOD;IAC7CL,OAAOM,QAAQ,SAACE;QACdH,SAASG;IACX;AACF"}
1
+ {"version":3,"sources":["ensureDestinationParent.js"],"sourcesContent":["const path = require('path');\nconst mkpath = require('mkpath');\n\nmodule.exports = function ensureDestinationParent(dest, callback) {\n const parent = path.dirname(dest);\n if (parent === '.' || parent === '/') return callback();\n mkpath(parent, (err) => {\n callback(err);\n });\n};\n"],"names":["path","require","mkpath","module","exports","ensureDestinationParent","dest","callback","parent","dirname","err"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,SAASD,QAAQ;AAEvBE,OAAOC,OAAO,GAAG,SAASC,wBAAwBC,IAAI,EAAEC,QAAQ;IAC9D,IAAMC,SAASR,KAAKS,OAAO,CAACH;IAC5B,IAAIE,WAAW,OAAOA,WAAW,KAAK,OAAOD;IAC7CL,OAAOM,QAAQ,SAACE;QACdH,SAASG;IACX;AACF"}
package/dist/cjs/index.js CHANGED
@@ -1,23 +1,31 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return installRelease;
9
+ }
10
+ });
11
+ var _install = /*#__PURE__*/ _interop_require_default(require("./install"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
2
17
  require("./polyfills");
3
- var install = require("./install");
4
18
  function installRelease(versionDetails, dest, options, callback) {
5
19
  if (typeof options === "function") {
6
20
  callback = options;
7
21
  options = null;
8
22
  }
9
23
  options = options || {};
10
- if (typeof callback === "function") return install(versionDetails, dest, options, callback);
24
+ if (typeof callback === "function") return (0, _install.default)(versionDetails, dest, options, callback);
11
25
  return new Promise(function(resolve, reject) {
12
26
  installRelease(versionDetails, dest, options, function installCallback(err, result) {
13
27
  err ? reject(err) : resolve(result);
14
28
  });
15
29
  });
16
30
  }
17
- module.exports = installRelease;
18
-
19
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
20
- Object.defineProperty(exports.default, '__esModule', { value: true });
21
- for (var key in exports) exports.default[key] = exports[key];
22
- module.exports = exports.default;
23
- }
31
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["require('./polyfills');\nvar install = require('./install');\n\nfunction installRelease(versionDetails, dest, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n if (typeof callback === 'function') return install(versionDetails, dest, options, callback);\n return new Promise((resolve, reject) => {\n installRelease(versionDetails, dest, options, function installCallback(err, result) {\n err ? reject(err) : resolve(result);\n });\n });\n}\n\nmodule.exports = installRelease;\n"],"names":["require","install","installRelease","versionDetails","dest","options","callback","Promise","resolve","reject","installCallback","err","result","module","exports"],"mappings":";AAAAA,QAAQ;AACR,IAAIC,UAAUD,QAAQ;AAEtB,SAASE,eAAeC,cAAc,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC7D,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtB,IAAI,OAAOC,aAAa,YAAY,OAAOL,QAAQE,gBAAgBC,MAAMC,SAASC;IAClF,OAAO,IAAIC,QAAQ,SAACC,SAASC;QAC3BP,eAAeC,gBAAgBC,MAAMC,SAAS,SAASK,gBAAgBC,GAAG,EAAEC,MAAM;YAChFD,MAAMF,OAAOE,OAAOH,QAAQI;QAC9B;IACF;AACF;AAEAC,OAAOC,OAAO,GAAGZ"}
1
+ {"version":3,"sources":["index.mjs"],"sourcesContent":["require('./polyfills');\nimport install from './install';\n\nexport default function installRelease(versionDetails, dest, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n if (typeof callback === 'function') return install(versionDetails, dest, options, callback);\n return new Promise((resolve, reject) => {\n installRelease(versionDetails, dest, options, function installCallback(err, result) {\n err ? reject(err) : resolve(result);\n });\n });\n}\n"],"names":["installRelease","require","versionDetails","dest","options","callback","install","Promise","resolve","reject","installCallback","err","result"],"mappings":";;;;+BAGA;;;eAAwBA;;;8DAFJ;;;;;;AADpBC,QAAQ;AAGO,SAASD,eAAeE,cAAc,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC5E,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU;IACZ;IACAA,UAAUA,WAAW,CAAC;IAEtB,IAAI,OAAOC,aAAa,YAAY,OAAOC,IAAAA,gBAAO,EAACJ,gBAAgBC,MAAMC,SAASC;IAClF,OAAO,IAAIE,QAAQ,SAACC,SAASC;QAC3BT,eAAeE,gBAAgBC,MAAMC,SAAS,SAASM,gBAAgBC,GAAG,EAAEC,MAAM;YAChFD,MAAMF,OAAOE,OAAOH,QAAQI;QAC9B;IACF;AACF"}
@@ -45,9 +45,4 @@ module.exports = function install(versionDetails, dest, options, callback) {
45
45
  });
46
46
  });
47
47
  };
48
-
49
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
50
- Object.defineProperty(exports.default, '__esModule', { value: true });
51
- for (var key in exports) exports.default[key] = exports[key];
52
- module.exports = exports.default;
53
- }
48
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["install.js"],"sourcesContent":["var path = require('path');\nvar Queue = require('queue-cb');\nvar mkpath = require('mkpath');\n\nvar resolveVersions = require('node-resolve-versions');\n\nvar installVersion = require('./installVersion');\n\nvar NIR_DIR = path.join(require('osenv').home(), '.nir');\nvar DEFAULT_OPTIONS = {\n cacheDirectory: path.join(NIR_DIR, 'cache'),\n buildDirectory: path.join(NIR_DIR, 'build'),\n downloadURL: function downloadURL(relativePath) {\n return `https://nodejs.org/dist/${relativePath}`;\n },\n};\n\nmodule.exports = function install(versionDetails, dest, options, callback) {\n options = Object.assign({}, DEFAULT_OPTIONS, options, { path: 'raw' });\n resolveVersions(versionDetails, options, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`Could not resolve versions for: ${JSON.stringify(versionDetails)}`));\n\n var results = [];\n var queue = new Queue(1);\n queue.defer((callback) => {\n mkpath(options.cacheDirectory, callback.bind(null, null));\n });\n for (var index = 0; index < versions.length; index++) {\n ((version) => {\n queue.defer((callback) => {\n var installDirectory = dest && versions.length > 1 ? path.join(dest, version.version) : dest;\n installVersion(version, installDirectory, options, (err, fullPath) => {\n if (err) return callback(err);\n results.push({ version: version.version, error: err, fullPath: fullPath });\n callback();\n });\n });\n })(versions[index]);\n }\n queue.await((err) => {\n err ? callback(err) : callback(null, results);\n });\n });\n};\n"],"names":["path","require","Queue","mkpath","resolveVersions","installVersion","NIR_DIR","join","home","DEFAULT_OPTIONS","cacheDirectory","buildDirectory","downloadURL","relativePath","module","exports","install","versionDetails","dest","options","callback","Object","assign","err","versions","length","Error","JSON","stringify","results","queue","defer","bind","index","version","installDirectory","fullPath","push","error","await"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,QAAQD,QAAQ;AACpB,IAAIE,SAASF,QAAQ;AAErB,IAAIG,kBAAkBH,QAAQ;AAE9B,IAAII,iBAAiBJ,QAAQ;AAE7B,IAAIK,UAAUN,KAAKO,IAAI,CAACN,QAAQ,SAASO,IAAI,IAAI;AACjD,IAAIC,kBAAkB;IACpBC,gBAAgBV,KAAKO,IAAI,CAACD,SAAS;IACnCK,gBAAgBX,KAAKO,IAAI,CAACD,SAAS;IACnCM,aAAa,SAASA,YAAYC,YAAY;QAC5C,OAAO,AAAC,2BAAuC,OAAbA;IACpC;AACF;AAEAC,OAAOC,OAAO,GAAG,SAASC,QAAQC,cAAc,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACvED,UAAUE,OAAOC,MAAM,CAAC,CAAC,GAAGb,iBAAiBU,SAAS;QAAEnB,MAAM;IAAM;IACpEI,gBAAgBa,gBAAgBE,SAAS,SAACI,KAAKC;QAC7C,IAAID,KAAK,OAAOH,SAASG;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE,OAAOL,SAAS,IAAIM,MAAM,AAAC,mCAAiE,OAA/BC,KAAKC,SAAS,CAACX;QAElG,IAAIY,UAAU,EAAE;QAChB,IAAIC,QAAQ,IAAI5B,MAAM;QACtB4B,MAAMC,KAAK,CAAC,SAACX;YACXjB,OAAOgB,QAAQT,cAAc,EAAEU,SAASY,IAAI,CAAC,MAAM;QACrD;QACA,IAAK,IAAIC,QAAQ,GAAGA,QAAQT,SAASC,MAAM,EAAEQ,QAAS;YACnD,CAAA,SAACC;gBACAJ,MAAMC,KAAK,CAAC,SAACX;oBACX,IAAIe,mBAAmBjB,QAAQM,SAASC,MAAM,GAAG,IAAIzB,KAAKO,IAAI,CAACW,MAAMgB,QAAQA,OAAO,IAAIhB;oBACxFb,eAAe6B,SAASC,kBAAkBhB,SAAS,SAACI,KAAKa;wBACvD,IAAIb,KAAK,OAAOH,SAASG;wBACzBM,QAAQQ,IAAI,CAAC;4BAAEH,SAASA,QAAQA,OAAO;4BAAEI,OAAOf;4BAAKa,UAAUA;wBAAS;wBACxEhB;oBACF;gBACF;YACF,CAAA,EAAGI,QAAQ,CAACS,MAAM;QACpB;QACAH,MAAMS,KAAK,CAAC,SAAChB;YACXA,MAAMH,SAASG,OAAOH,SAAS,MAAMS;QACvC;IACF;AACF"}
1
+ {"version":3,"sources":["install.js"],"sourcesContent":["const path = require('path');\nconst Queue = require('queue-cb');\nconst mkpath = require('mkpath');\n\nconst resolveVersions = require('node-resolve-versions');\n\nconst installVersion = require('./installVersion');\n\nconst NIR_DIR = path.join(require('osenv').home(), '.nir');\nconst DEFAULT_OPTIONS = {\n cacheDirectory: path.join(NIR_DIR, 'cache'),\n buildDirectory: path.join(NIR_DIR, 'build'),\n downloadURL: function downloadURL(relativePath) {\n return `https://nodejs.org/dist/${relativePath}`;\n },\n};\n\nmodule.exports = function install(versionDetails, dest, options, callback) {\n options = Object.assign({}, DEFAULT_OPTIONS, options, { path: 'raw' });\n resolveVersions(versionDetails, options, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`Could not resolve versions for: ${JSON.stringify(versionDetails)}`));\n\n const results = [];\n const queue = new Queue(1);\n queue.defer((callback) => {\n mkpath(options.cacheDirectory, callback.bind(null, null));\n });\n for (let index = 0; index < versions.length; index++) {\n ((version) => {\n queue.defer((callback) => {\n const installDirectory = dest && versions.length > 1 ? path.join(dest, version.version) : dest;\n installVersion(version, installDirectory, options, (err, fullPath) => {\n if (err) return callback(err);\n results.push({ version: version.version, error: err, fullPath: fullPath });\n callback();\n });\n });\n })(versions[index]);\n }\n queue.await((err) => {\n err ? callback(err) : callback(null, results);\n });\n });\n};\n"],"names":["path","require","Queue","mkpath","resolveVersions","installVersion","NIR_DIR","join","home","DEFAULT_OPTIONS","cacheDirectory","buildDirectory","downloadURL","relativePath","module","exports","install","versionDetails","dest","options","callback","Object","assign","err","versions","length","Error","JSON","stringify","results","queue","defer","bind","index","version","installDirectory","fullPath","push","error","await"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AACtB,IAAME,SAASF,QAAQ;AAEvB,IAAMG,kBAAkBH,QAAQ;AAEhC,IAAMI,iBAAiBJ,QAAQ;AAE/B,IAAMK,UAAUN,KAAKO,IAAI,CAACN,QAAQ,SAASO,IAAI,IAAI;AACnD,IAAMC,kBAAkB;IACtBC,gBAAgBV,KAAKO,IAAI,CAACD,SAAS;IACnCK,gBAAgBX,KAAKO,IAAI,CAACD,SAAS;IACnCM,aAAa,SAASA,YAAYC,YAAY;QAC5C,OAAO,AAAC,2BAAuC,OAAbA;IACpC;AACF;AAEAC,OAAOC,OAAO,GAAG,SAASC,QAAQC,cAAc,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACvED,UAAUE,OAAOC,MAAM,CAAC,CAAC,GAAGb,iBAAiBU,SAAS;QAAEnB,MAAM;IAAM;IACpEI,gBAAgBa,gBAAgBE,SAAS,SAACI,KAAKC;QAC7C,IAAID,KAAK,OAAOH,SAASG;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE,OAAOL,SAAS,IAAIM,MAAM,AAAC,mCAAiE,OAA/BC,KAAKC,SAAS,CAACX;QAElG,IAAMY,UAAU,EAAE;QAClB,IAAMC,QAAQ,IAAI5B,MAAM;QACxB4B,MAAMC,KAAK,CAAC,SAACX;YACXjB,OAAOgB,QAAQT,cAAc,EAAEU,SAASY,IAAI,CAAC,MAAM;QACrD;QACA,IAAK,IAAIC,QAAQ,GAAGA,QAAQT,SAASC,MAAM,EAAEQ,QAAS;YACnD,CAAA,SAACC;gBACAJ,MAAMC,KAAK,CAAC,SAACX;oBACX,IAAMe,mBAAmBjB,QAAQM,SAASC,MAAM,GAAG,IAAIzB,KAAKO,IAAI,CAACW,MAAMgB,QAAQA,OAAO,IAAIhB;oBAC1Fb,eAAe6B,SAASC,kBAAkBhB,SAAS,SAACI,KAAKa;wBACvD,IAAIb,KAAK,OAAOH,SAASG;wBACzBM,QAAQQ,IAAI,CAAC;4BAAEH,SAASA,QAAQA,OAAO;4BAAEI,OAAOf;4BAAKa,UAAUA;wBAAS;wBACxEhB;oBACF;gBACF;YACF,CAAA,EAAGI,QAAQ,CAACS,MAAM;QACpB;QACAH,MAAMS,KAAK,CAAC,SAAChB;YACXA,MAAMH,SAASG,OAAOH,SAAS,MAAMS;QACvC;IACF;AACF"}
@@ -7,9 +7,4 @@ module.exports = function install(version, dest, options, callback) {
7
7
  installBin(version, dest, options, callback);
8
8
  });
9
9
  };
10
-
11
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
12
- Object.defineProperty(exports.default, '__esModule', { value: true });
13
- for (var key in exports) exports.default[key] = exports[key];
14
- module.exports = exports.default;
15
- }
10
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["var installBin = require('./installBin');\nvar installLib = require('./installLib');\n\nmodule.exports = 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":["installBin","require","installLib","module","exports","install","version","dest","options","callback","err"],"mappings":";AAAA,IAAIA,aAAaC,QAAQ;AACzB,IAAIC,aAAaD,QAAQ;AAEzBE,OAAOC,OAAO,GAAG,SAASC,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChEP,WAAWI,SAASC,MAAMC,SAAS,SAACE;QAClC,IAAIA,KAAK,OAAOD,SAASC;QACzBV,WAAWM,SAASC,MAAMC,SAASC;IACrC;AACF"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["const installBin = require('./installBin');\nconst installLib = require('./installLib');\n\nmodule.exports = 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":["installBin","require","installLib","module","exports","install","version","dest","options","callback","err"],"mappings":";AAAA,IAAMA,aAAaC,QAAQ;AAC3B,IAAMC,aAAaD,QAAQ;AAE3BE,OAAOC,OAAO,GAAG,SAASC,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChEP,WAAWI,SAASC,MAAMC,SAAS,SAACE;QAClC,IAAIA,KAAK,OAAOD,SAASC;QACzBV,WAAWM,SAASC,MAAMC,SAASC;IACrC;AACF"}
@@ -47,9 +47,4 @@ module.exports = function installBin(_version, dest, options, callback) {
47
47
  }
48
48
  queue.await(callback);
49
49
  };
50
-
51
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
52
- Object.defineProperty(exports.default, '__esModule', { value: true });
53
- for (var key in exports) exports.default[key] = exports[key];
54
- module.exports = exports.default;
55
- }
50
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["installBin.js"],"sourcesContent":["var path = require('path');\nvar Queue = require('queue-cb');\nvar conditionalCopy = require('../conditionalCopy');\n\nvar 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\nmodule.exports = function installBin(_version, dest, options, callback) {\n var platform = options.platform || process.platform;\n var libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n var binPath = platform === 'win32' ? dest : path.join(dest, 'bin');\n\n var queue = new Queue();\n var files = PLATFORM_FILES[platform] || PLATFORM_FILES.posix;\n for (var index = 0; index < files.length; index++) {\n var 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":["path","require","Queue","conditionalCopy","PLATFORM_FILES","win32","src","join","dest","optional","posix","module","exports","installBin","_version","options","callback","platform","process","libPath","binPath","queue","files","index","length","file","defer","bind","await"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,QAAQD,QAAQ;AACpB,IAAIE,kBAAkBF,QAAQ;AAE9B,IAAIG,iBAAiB;IACnBC,OAAO;QACL;YAAEC,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQC,MAAM;QAAM;QACnE;YAAEF,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYC,MAAM;QAAU;QAC3E;YAAEF,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQC,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEH,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYC,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDC,OAAO;QACL;YAAEJ,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeC,MAAM;QAAM;QAC1E;YAAEF,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeC,MAAM;YAAOC,UAAU;QAAK;KAC3F;AACH;AAEAE,OAAOC,OAAO,GAAG,SAASC,WAAWC,QAAQ,EAAEN,IAAI,EAAEO,OAAO,EAAEC,QAAQ;IACpE,IAAIC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACnD,IAAIE,UAAUF,aAAa,UAAUT,OAAOR,KAAKO,IAAI,CAACC,MAAM;IAC5D,IAAIY,UAAUH,aAAa,UAAUT,OAAOR,KAAKO,IAAI,CAACC,MAAM;IAE5D,IAAIa,QAAQ,IAAInB;IAChB,IAAIoB,QAAQlB,cAAc,CAACa,SAAS,IAAIb,eAAeM,KAAK;IAC5D,IAAK,IAAIa,QAAQ,GAAGA,QAAQD,MAAME,MAAM,EAAED,QAAS;QACjD,IAAIE,OAAOH,KAAK,CAACC,MAAM;QACvBF,MAAMK,KAAK,CAACvB,gBAAgBwB,IAAI,CAAC,MAAM3B,KAAKO,IAAI,CAACY,SAASM,KAAKnB,GAAG,GAAGN,KAAKO,IAAI,CAACa,SAASK,KAAKjB,IAAI,GAAGiB,KAAKhB,QAAQ;IACnH;IAEAY,MAAMO,KAAK,CAACZ;AACd"}
1
+ {"version":3,"sources":["installBin.js"],"sourcesContent":["const path = require('path');\nconst Queue = require('queue-cb');\nconst conditionalCopy = require('../conditionalCopy');\n\nconst 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\nmodule.exports = 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 = PLATFORM_FILES[platform] || 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":["path","require","Queue","conditionalCopy","PLATFORM_FILES","win32","src","join","dest","optional","posix","module","exports","installBin","_version","options","callback","platform","process","libPath","binPath","queue","files","index","length","file","defer","bind","await"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AACtB,IAAME,kBAAkBF,QAAQ;AAEhC,IAAMG,iBAAiB;IACrBC,OAAO;QACL;YAAEC,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQC,MAAM;QAAM;QACnE;YAAEF,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYC,MAAM;QAAU;QAC3E;YAAEF,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQC,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEH,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYC,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDC,OAAO;QACL;YAAEJ,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeC,MAAM;QAAM;QAC1E;YAAEF,KAAKN,KAAKO,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAeC,MAAM;YAAOC,UAAU;QAAK;KAC3F;AACH;AAEAE,OAAOC,OAAO,GAAG,SAASC,WAAWC,QAAQ,EAAEN,IAAI,EAAEO,OAAO,EAAEC,QAAQ;IACpE,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,UAAUF,aAAa,UAAUT,OAAOR,KAAKO,IAAI,CAACC,MAAM;IAC9D,IAAMY,UAAUH,aAAa,UAAUT,OAAOR,KAAKO,IAAI,CAACC,MAAM;IAE9D,IAAMa,QAAQ,IAAInB;IAClB,IAAMoB,QAAQlB,cAAc,CAACa,SAAS,IAAIb,eAAeM,KAAK;IAC9D,IAAK,IAAIa,QAAQ,GAAGA,QAAQD,MAAME,MAAM,EAAED,QAAS;QACjD,IAAME,OAAOH,KAAK,CAACC,MAAM;QACzBF,MAAMK,KAAK,CAACvB,gBAAgBwB,IAAI,CAAC,MAAM3B,KAAKO,IAAI,CAACY,SAASM,KAAKnB,GAAG,GAAGN,KAAKO,IAAI,CAACa,SAASK,KAAKjB,IAAI,GAAGiB,KAAKhB,QAAQ;IACnH;IAEAY,MAAMO,KAAK,CAACZ;AACd"}
@@ -17,7 +17,7 @@ module.exports = function installLib(version, dest, options, callback) {
17
17
  var found = releases.find(function(record) {
18
18
  return record.version === version.version;
19
19
  });
20
- var npmMajorPair = (found === null || found === void 0 ? void 0 : found.npm) ? +found.npm.split(".")[0] : NPM_MIN_VERSION;
20
+ var npmMajorPair = found && found.npm ? +found.npm.split(".")[0] : NPM_MIN_VERSION;
21
21
  var npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);
22
22
  get(NPM_DIST_TAGS_URL).json(function(err, res2) {
23
23
  if (err) return callback(err);
@@ -32,9 +32,4 @@ module.exports = function installLib(version, dest, options, callback) {
32
32
  });
33
33
  });
34
34
  };
35
-
36
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
37
- Object.defineProperty(exports.default, '__esModule', { value: true });
38
- for (var key in exports) exports.default[key] = exports[key];
39
- module.exports = exports.default;
40
- }
35
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["installLib.js"],"sourcesContent":["var path = require('path');\nvar get = require('get-remote');\n\nvar conditionalCache = require('../conditionalCache');\nvar conditionalExtract = require('../conditionalExtract');\n\nvar NODE_DIST_URL = 'https://nodejs.org/dist/index.json';\nvar NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nvar NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nvar NPM_MIN_VERSION = 3;\n\nmodule.exports = function installLib(version, dest, options, callback) {\n var platform = options.platform || process.platform;\n var libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n var installPath = path.join(libPath, 'node_modules', 'npm');\n\n get(NODE_DIST_URL).json((err, res1) => {\n if (err) return callback(err);\n var releases = res1.body;\n\n var found = releases.find((record) => record.version === version.version);\n var npmMajorPair = found?.npm ? +found.npm.split('.')[0] : NPM_MIN_VERSION;\n var npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n get(NPM_DIST_TAGS_URL).json((err, res2) => {\n if (err) return callback(err);\n var distTags = res2.body;\n var installVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n var downloadPath = `${NPM_DIST_URL}/-/npm-${installVersion}.tgz`;\n var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n conditionalExtract(cachePath, installPath, callback);\n });\n });\n });\n};\n"],"names":["path","require","get","conditionalCache","conditionalExtract","NODE_DIST_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_MIN_VERSION","module","exports","installLib","version","dest","options","callback","platform","process","libPath","join","installPath","json","err","res1","releases","body","found","find","record","npmMajorPair","npm","split","npmMajor","Math","max","res2","distTags","installVersion","latest","downloadPath","cachePath","cacheDirectory","basename"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,MAAMD,QAAQ;AAElB,IAAIE,mBAAmBF,QAAQ;AAC/B,IAAIG,qBAAqBH,QAAQ;AAEjC,IAAII,gBAAgB;AACpB,IAAIC,oBAAoB;AACxB,IAAIC,eAAe;AACnB,IAAIC,kBAAkB;AAEtBC,OAAOC,OAAO,GAAG,SAASC,WAAWC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACnE,IAAIC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACnD,IAAIE,UAAUF,aAAa,UAAUH,OAAOb,KAAKmB,IAAI,CAACN,MAAM;IAC5D,IAAIO,cAAcpB,KAAKmB,IAAI,CAACD,SAAS,gBAAgB;IAErDhB,IAAIG,eAAegB,IAAI,CAAC,SAACC,KAAKC;QAC5B,IAAID,KAAK,OAAOP,SAASO;QACzB,IAAIE,WAAWD,KAAKE,IAAI;QAExB,IAAIC,QAAQF,SAASG,IAAI,CAAC,SAACC;mBAAWA,OAAOhB,OAAO,KAAKA,QAAQA,OAAO;;QACxE,IAAIiB,eAAeH,CAAAA,kBAAAA,4BAAAA,MAAOI,GAAG,IAAG,CAACJ,MAAMI,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGvB;QAC3D,IAAIwB,WAAWC,KAAKC,GAAG,CAACL,cAAcrB;QAEtCN,IAAII,mBAAmBe,IAAI,CAAC,SAACC,KAAKa;YAChC,IAAIb,KAAK,OAAOP,SAASO;YACzB,IAAIc,WAAWD,KAAKV,IAAI;YACxB,IAAIY,iBAAiBD,QAAQ,CAAC,AAAC,UAAkB,OAATJ,UAAW,IAAII,QAAQ,CAAC,AAAC,QAAgB,OAATJ,UAAW,IAAII,SAASE,MAAM;YACtG,IAAIC,eAAe,AAAC,GAAwBF,OAAtB9B,cAAa,WAAwB,OAAf8B,gBAAe;YAC3D,IAAIG,YAAYxC,KAAKmB,IAAI,CAACL,QAAQ2B,cAAc,EAAEzC,KAAK0C,QAAQ,CAACH;YAChEpC,iBAAiBoC,cAAcC,WAAW,SAAClB;gBACzC,IAAIA,KAAK,OAAOP,SAASO;gBACzBlB,mBAAmBoC,WAAWpB,aAAaL;YAC7C;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["installLib.js"],"sourcesContent":["const path = require('path');\nconst get = require('get-remote');\n\nconst conditionalCache = require('../conditionalCache');\nconst conditionalExtract = require('../conditionalExtract');\n\nconst NODE_DIST_URL = 'https://nodejs.org/dist/index.json';\nconst NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nconst NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nconst NPM_MIN_VERSION = 3;\n\nmodule.exports = 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 get(NODE_DIST_URL).json((err, res1) => {\n if (err) return callback(err);\n const releases = res1.body;\n\n const found = releases.find((record) => record.version === version.version);\n const npmMajorPair = found && found.npm ? +found.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n get(NPM_DIST_TAGS_URL).json((err, res2) => {\n if (err) return callback(err);\n const distTags = res2.body;\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.cacheDirectory, path.basename(downloadPath));\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n conditionalExtract(cachePath, installPath, callback);\n });\n });\n });\n};\n"],"names":["path","require","get","conditionalCache","conditionalExtract","NODE_DIST_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_MIN_VERSION","module","exports","installLib","version","dest","options","callback","platform","process","libPath","join","installPath","json","err","res1","releases","body","found","find","record","npmMajorPair","npm","split","npmMajor","Math","max","res2","distTags","installVersion","latest","downloadPath","cachePath","cacheDirectory","basename"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,MAAMD,QAAQ;AAEpB,IAAME,mBAAmBF,QAAQ;AACjC,IAAMG,qBAAqBH,QAAQ;AAEnC,IAAMI,gBAAgB;AACtB,IAAMC,oBAAoB;AAC1B,IAAMC,eAAe;AACrB,IAAMC,kBAAkB;AAExBC,OAAOC,OAAO,GAAG,SAASC,WAAWC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACnE,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,UAAUF,aAAa,UAAUH,OAAOb,KAAKmB,IAAI,CAACN,MAAM;IAC9D,IAAMO,cAAcpB,KAAKmB,IAAI,CAACD,SAAS,gBAAgB;IAEvDhB,IAAIG,eAAegB,IAAI,CAAC,SAACC,KAAKC;QAC5B,IAAID,KAAK,OAAOP,SAASO;QACzB,IAAME,WAAWD,KAAKE,IAAI;QAE1B,IAAMC,QAAQF,SAASG,IAAI,CAAC,SAACC;mBAAWA,OAAOhB,OAAO,KAAKA,QAAQA,OAAO;;QAC1E,IAAMiB,eAAeH,SAASA,MAAMI,GAAG,GAAG,CAACJ,MAAMI,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGvB;QACrE,IAAMwB,WAAWC,KAAKC,GAAG,CAACL,cAAcrB;QAExCN,IAAII,mBAAmBe,IAAI,CAAC,SAACC,KAAKa;YAChC,IAAIb,KAAK,OAAOP,SAASO;YACzB,IAAMc,WAAWD,KAAKV,IAAI;YAC1B,IAAMY,iBAAiBD,QAAQ,CAAC,AAAC,UAAkB,OAATJ,UAAW,IAAII,QAAQ,CAAC,AAAC,QAAgB,OAATJ,UAAW,IAAII,SAASE,MAAM;YACxG,IAAMC,eAAe,AAAC,GAAwBF,OAAtB9B,cAAa,WAAwB,OAAf8B,gBAAe;YAC7D,IAAMG,YAAYxC,KAAKmB,IAAI,CAACL,QAAQ2B,cAAc,EAAEzC,KAAK0C,QAAQ,CAACH;YAClEpC,iBAAiBoC,cAAcC,WAAW,SAAClB;gBACzC,IAAIA,KAAK,OAAOP,SAASO;gBACzBlB,mBAAmBoC,WAAWpB,aAAaL;YAC7C;QACF;IACF;AACF"}
@@ -33,9 +33,4 @@ module.exports = function prebuiltFilenames(options) {
33
33
  }
34
34
  return results;
35
35
  };
36
-
37
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
38
- Object.defineProperty(exports.default, '__esModule', { value: true });
39
- for (var key in exports) exports.default[key] = exports[key];
40
- module.exports = exports.default;
41
- }
36
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["filenames.js"],"sourcesContent":["var osArch = require('os').arch || require('../arch');\n\nvar PLATFORM_OS = {\n win32: 'win',\n darwin: 'osx',\n};\n\nvar PLATFORM_FILES = {\n win32: ['zip', 'exe'],\n darwin: ['tar'],\n};\n\nmodule.exports = function prebuiltFilenames(options) {\n var platform = options.platform || process.platform;\n var os = PLATFORM_OS[platform] || platform;\n var archs = [options.arch || osArch()];\n if (platform === 'darwin' && archs[0] === 'arm64') archs.push('x64'); // fallback\n\n var files = PLATFORM_FILES[platform];\n var results = [];\n for (var i = 0; i < archs.length; i++) {\n if (typeof files === 'undefined') {\n results.push(`${os}-${archs[i]}`);\n } else {\n for (var j = 0; j < files.length; j++) {\n results.push(`${os}-${archs[i]}-${files[j]}`);\n }\n }\n }\n return results;\n};\n"],"names":["osArch","require","arch","PLATFORM_OS","win32","darwin","PLATFORM_FILES","module","exports","prebuiltFilenames","options","platform","process","os","archs","push","files","results","i","length","j"],"mappings":";AAAA,IAAIA,SAASC,QAAQ,MAAMC,IAAI,IAAID,QAAQ;AAE3C,IAAIE,cAAc;IAChBC,OAAO;IACPC,QAAQ;AACV;AAEA,IAAIC,iBAAiB;IACnBF,OAAO;QAAC;QAAO;KAAM;IACrBC,QAAQ;QAAC;KAAM;AACjB;AAEAE,OAAOC,OAAO,GAAG,SAASC,kBAAkBC,OAAO;IACjD,IAAIC,WAAWD,QAAQC,QAAQ,IAAIC,QAAQD,QAAQ;IACnD,IAAIE,KAAKV,WAAW,CAACQ,SAAS,IAAIA;IAClC,IAAIG,QAAQ;QAACJ,QAAQR,IAAI,IAAIF;KAAS;IACtC,IAAIW,aAAa,YAAYG,KAAK,CAAC,EAAE,KAAK,SAASA,MAAMC,IAAI,CAAC,QAAQ,WAAW;IAEjF,IAAIC,QAAQV,cAAc,CAACK,SAAS;IACpC,IAAIM,UAAU,EAAE;IAChB,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,MAAMK,MAAM,EAAED,IAAK;QACrC,IAAI,OAAOF,UAAU,aAAa;YAChCC,QAAQF,IAAI,CAAC,AAAC,GAAQD,OAAND,IAAG,KAAY,OAATC,KAAK,CAACI,EAAE;QAChC,OAAO;YACL,IAAK,IAAIE,IAAI,GAAGA,IAAIJ,MAAMG,MAAM,EAAEC,IAAK;gBACrCH,QAAQF,IAAI,CAAC,AAAC,GAAQD,OAAND,IAAG,KAAeG,OAAZF,KAAK,CAACI,EAAE,EAAC,KAAY,OAATF,KAAK,CAACI,EAAE;YAC5C;QACF;IACF;IACA,OAAOH;AACT"}
1
+ {"version":3,"sources":["filenames.js"],"sourcesContent":["const osArch = require('os').arch || require('../arch');\n\nconst PLATFORM_OS = {\n win32: 'win',\n darwin: 'osx',\n};\n\nconst PLATFORM_FILES = {\n win32: ['zip', 'exe'],\n darwin: ['tar'],\n};\n\nmodule.exports = function prebuiltFilenames(options) {\n const platform = options.platform || process.platform;\n const os = PLATFORM_OS[platform] || platform;\n const archs = [options.arch || osArch()];\n if (platform === 'darwin' && archs[0] === 'arm64') archs.push('x64'); // fallback\n\n const files = PLATFORM_FILES[platform];\n const results = [];\n for (let i = 0; i < archs.length; i++) {\n if (typeof files === 'undefined') {\n results.push(`${os}-${archs[i]}`);\n } else {\n for (let j = 0; j < files.length; j++) {\n results.push(`${os}-${archs[i]}-${files[j]}`);\n }\n }\n }\n return results;\n};\n"],"names":["osArch","require","arch","PLATFORM_OS","win32","darwin","PLATFORM_FILES","module","exports","prebuiltFilenames","options","platform","process","os","archs","push","files","results","i","length","j"],"mappings":";AAAA,IAAMA,SAASC,QAAQ,MAAMC,IAAI,IAAID,QAAQ;AAE7C,IAAME,cAAc;IAClBC,OAAO;IACPC,QAAQ;AACV;AAEA,IAAMC,iBAAiB;IACrBF,OAAO;QAAC;QAAO;KAAM;IACrBC,QAAQ;QAAC;KAAM;AACjB;AAEAE,OAAOC,OAAO,GAAG,SAASC,kBAAkBC,OAAO;IACjD,IAAMC,WAAWD,QAAQC,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,KAAKV,WAAW,CAACQ,SAAS,IAAIA;IACpC,IAAMG,QAAQ;QAACJ,QAAQR,IAAI,IAAIF;KAAS;IACxC,IAAIW,aAAa,YAAYG,KAAK,CAAC,EAAE,KAAK,SAASA,MAAMC,IAAI,CAAC,QAAQ,WAAW;IAEjF,IAAMC,QAAQV,cAAc,CAACK,SAAS;IACtC,IAAMM,UAAU,EAAE;IAClB,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,MAAMK,MAAM,EAAED,IAAK;QACrC,IAAI,OAAOF,UAAU,aAAa;YAChCC,QAAQF,IAAI,CAAC,AAAC,GAAQD,OAAND,IAAG,KAAY,OAATC,KAAK,CAACI,EAAE;QAChC,OAAO;YACL,IAAK,IAAIE,IAAI,GAAGA,IAAIJ,MAAMG,MAAM,EAAEC,IAAK;gBACrCH,QAAQF,IAAI,CAAC,AAAC,GAAQD,OAAND,IAAG,KAAeG,OAAZF,KAAK,CAACI,EAAE,EAAC,KAAY,OAATF,KAAK,CAACI,EAAE;YAC5C;QACF;IACF;IACA,OAAOH;AACT"}
@@ -9,7 +9,7 @@ module.exports = function findDistPaths(version, options) {
9
9
  var filename = filenames[index];
10
10
  if (!~version.files.indexOf(filename)) continue;
11
11
  var relativePaths = distPaths(filename, version.version);
12
- if (relativePaths === null || relativePaths === void 0 ? void 0 : relativePaths.length) return {
12
+ if (relativePaths && relativePaths.length) return {
13
13
  version: version.version,
14
14
  filename: filename,
15
15
  relativePaths: relativePaths
@@ -17,9 +17,4 @@ module.exports = function findDistPaths(version, options) {
17
17
  }
18
18
  return null;
19
19
  };
20
-
21
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
22
- Object.defineProperty(exports.default, '__esModule', { value: true });
23
- for (var key in exports) exports.default[key] = exports[key];
24
- module.exports = exports.default;
25
- }
20
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["findDistPaths.js"],"sourcesContent":["var distPaths = require('node-filename-to-dist-paths');\nvar prebuiltFilenames = require('./filenames');\n\nmodule.exports = function findDistPaths(version, options) {\n var filenames = options.filename ? [options.filename] : prebuiltFilenames(options);\n for (var index = 0; index < filenames.length; index++) {\n var filename = filenames[index];\n if (!~version.files.indexOf(filename)) continue;\n var relativePaths = distPaths(filename, version.version);\n if (relativePaths?.length) return { version: version.version, filename: filename, relativePaths: relativePaths };\n }\n return null;\n};\n"],"names":["distPaths","require","prebuiltFilenames","module","exports","findDistPaths","version","options","filenames","filename","index","length","files","indexOf","relativePaths"],"mappings":";AAAA,IAAIA,YAAYC,QAAQ;AACxB,IAAIC,oBAAoBD,QAAQ;AAEhCE,OAAOC,OAAO,GAAG,SAASC,cAAcC,OAAO,EAAEC,OAAO;IACtD,IAAIC,YAAYD,QAAQE,QAAQ,GAAG;QAACF,QAAQE,QAAQ;KAAC,GAAGP,kBAAkBK;IAC1E,IAAK,IAAIG,QAAQ,GAAGA,QAAQF,UAAUG,MAAM,EAAED,QAAS;QACrD,IAAID,WAAWD,SAAS,CAACE,MAAM;QAC/B,IAAI,CAAC,CAACJ,QAAQM,KAAK,CAACC,OAAO,CAACJ,WAAW;QACvC,IAAIK,gBAAgBd,UAAUS,UAAUH,QAAQA,OAAO;QACvD,IAAIQ,0BAAAA,oCAAAA,cAAeH,MAAM,EAAE,OAAO;YAAEL,SAASA,QAAQA,OAAO;YAAEG,UAAUA;YAAUK,eAAeA;QAAc;IACjH;IACA,OAAO;AACT"}
1
+ {"version":3,"sources":["findDistPaths.js"],"sourcesContent":["const distPaths = require('node-filename-to-dist-paths');\nconst prebuiltFilenames = require('./filenames');\n\nmodule.exports = function findDistPaths(version, options) {\n const filenames = options.filename ? [options.filename] : prebuiltFilenames(options);\n for (let index = 0; index < filenames.length; index++) {\n const filename = filenames[index];\n if (!~version.files.indexOf(filename)) continue;\n const relativePaths = distPaths(filename, version.version);\n if (relativePaths && relativePaths.length) return { version: version.version, filename: filename, relativePaths: relativePaths };\n }\n return null;\n};\n"],"names":["distPaths","require","prebuiltFilenames","module","exports","findDistPaths","version","options","filenames","filename","index","length","files","indexOf","relativePaths"],"mappings":";AAAA,IAAMA,YAAYC,QAAQ;AAC1B,IAAMC,oBAAoBD,QAAQ;AAElCE,OAAOC,OAAO,GAAG,SAASC,cAAcC,OAAO,EAAEC,OAAO;IACtD,IAAMC,YAAYD,QAAQE,QAAQ,GAAG;QAACF,QAAQE,QAAQ;KAAC,GAAGP,kBAAkBK;IAC5E,IAAK,IAAIG,QAAQ,GAAGA,QAAQF,UAAUG,MAAM,EAAED,QAAS;QACrD,IAAMD,WAAWD,SAAS,CAACE,MAAM;QACjC,IAAI,CAAC,CAACJ,QAAQM,KAAK,CAACC,OAAO,CAACJ,WAAW;QACvC,IAAMK,gBAAgBd,UAAUS,UAAUH,QAAQA,OAAO;QACzD,IAAIQ,iBAAiBA,cAAcH,MAAM,EAAE,OAAO;YAAEL,SAASA,QAAQA,OAAO;YAAEG,UAAUA;YAAUK,eAAeA;QAAc;IACjI;IACA,OAAO;AACT"}
@@ -20,12 +20,7 @@ module.exports = function install(version, dest, options, callback) {
20
20
  record = findDistPaths(version, {
21
21
  filename: "src"
22
22
  });
23
- if (record === null || record === void 0 ? void 0 : record.relativePaths.length) return installSource(record.relativePaths[0], dest, record, options, callback);
23
+ if (record && record.relativePaths.length) return installSource(record.relativePaths[0], dest, record, options, callback);
24
24
  callback(new Error("Unable to install ".concat(version)));
25
25
  };
26
-
27
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
28
- Object.defineProperty(exports.default, '__esModule', { value: true });
29
- for (var key in exports) exports.default[key] = exports[key];
30
- module.exports = exports.default;
31
- }
26
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["var find = require('lodash.find');\n\nvar endsWithFn = require('../endsWithFn');\nvar findDistPaths = require('./findDistPaths');\nvar installCompressed = require('./installCompressed');\nvar installExe = require('./installExe');\nvar installSource = require('./installSource');\n\nmodule.exports = function install(version, dest, options, callback) {\n var record = findDistPaths(version, options);\n if (record) {\n if (record.filename === 'src') return installSource(record.relativePaths[0], dest, record, options, callback);\n\n var relativePath = find(record.relativePaths, endsWithFn(['.tar.gz', '.zip']));\n if (relativePath) return installCompressed(relativePath, dest, record, options, callback);\n\n relativePath = find(record.relativePaths, endsWithFn('.exe'));\n if (relativePath) return installExe(relativePath, dest, record, options, callback);\n }\n\n record = findDistPaths(version, { filename: 'src' });\n if (record?.relativePaths.length) return installSource(record.relativePaths[0], dest, record, options, callback);\n\n callback(new Error(`Unable to install ${version}`));\n};\n"],"names":["find","require","endsWithFn","findDistPaths","installCompressed","installExe","installSource","module","exports","install","version","dest","options","callback","record","filename","relativePaths","relativePath","length","Error"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AAEnB,IAAIC,aAAaD,QAAQ;AACzB,IAAIE,gBAAgBF,QAAQ;AAC5B,IAAIG,oBAAoBH,QAAQ;AAChC,IAAII,aAAaJ,QAAQ;AACzB,IAAIK,gBAAgBL,QAAQ;AAE5BM,OAAOC,OAAO,GAAG,SAASC,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChE,IAAIC,SAASX,cAAcO,SAASE;IACpC,IAAIE,QAAQ;QACV,IAAIA,OAAOC,QAAQ,KAAK,OAAO,OAAOT,cAAcQ,OAAOE,aAAa,CAAC,EAAE,EAAEL,MAAMG,QAAQF,SAASC;QAEpG,IAAII,eAAejB,KAAKc,OAAOE,aAAa,EAAEd,WAAW;YAAC;YAAW;SAAO;QAC5E,IAAIe,cAAc,OAAOb,kBAAkBa,cAAcN,MAAMG,QAAQF,SAASC;QAEhFI,eAAejB,KAAKc,OAAOE,aAAa,EAAEd,WAAW;QACrD,IAAIe,cAAc,OAAOZ,WAAWY,cAAcN,MAAMG,QAAQF,SAASC;IAC3E;IAEAC,SAASX,cAAcO,SAAS;QAAEK,UAAU;IAAM;IAClD,IAAID,mBAAAA,6BAAAA,OAAQE,aAAa,CAACE,MAAM,EAAE,OAAOZ,cAAcQ,OAAOE,aAAa,CAAC,EAAE,EAAEL,MAAMG,QAAQF,SAASC;IAEvGA,SAAS,IAAIM,MAAM,AAAC,qBAA4B,OAART;AAC1C"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["const find = require('lodash.find');\n\nconst endsWithFn = require('../endsWithFn');\nconst findDistPaths = require('./findDistPaths');\nconst installCompressed = require('./installCompressed');\nconst installExe = require('./installExe');\nconst installSource = require('./installSource');\n\nmodule.exports = function install(version, dest, options, callback) {\n let record = findDistPaths(version, options);\n if (record) {\n if (record.filename === 'src') return installSource(record.relativePaths[0], dest, record, options, callback);\n\n let relativePath = find(record.relativePaths, endsWithFn(['.tar.gz', '.zip']));\n if (relativePath) return installCompressed(relativePath, dest, record, options, callback);\n\n relativePath = find(record.relativePaths, endsWithFn('.exe'));\n if (relativePath) return installExe(relativePath, dest, record, options, callback);\n }\n\n record = findDistPaths(version, { filename: 'src' });\n if (record && record.relativePaths.length) return installSource(record.relativePaths[0], dest, record, options, callback);\n callback(new Error(`Unable to install ${version}`));\n};\n"],"names":["find","require","endsWithFn","findDistPaths","installCompressed","installExe","installSource","module","exports","install","version","dest","options","callback","record","filename","relativePaths","relativePath","length","Error"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AAErB,IAAMC,aAAaD,QAAQ;AAC3B,IAAME,gBAAgBF,QAAQ;AAC9B,IAAMG,oBAAoBH,QAAQ;AAClC,IAAMI,aAAaJ,QAAQ;AAC3B,IAAMK,gBAAgBL,QAAQ;AAE9BM,OAAOC,OAAO,GAAG,SAASC,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChE,IAAIC,SAASX,cAAcO,SAASE;IACpC,IAAIE,QAAQ;QACV,IAAIA,OAAOC,QAAQ,KAAK,OAAO,OAAOT,cAAcQ,OAAOE,aAAa,CAAC,EAAE,EAAEL,MAAMG,QAAQF,SAASC;QAEpG,IAAII,eAAejB,KAAKc,OAAOE,aAAa,EAAEd,WAAW;YAAC;YAAW;SAAO;QAC5E,IAAIe,cAAc,OAAOb,kBAAkBa,cAAcN,MAAMG,QAAQF,SAASC;QAEhFI,eAAejB,KAAKc,OAAOE,aAAa,EAAEd,WAAW;QACrD,IAAIe,cAAc,OAAOZ,WAAWY,cAAcN,MAAMG,QAAQF,SAASC;IAC3E;IAEAC,SAASX,cAAcO,SAAS;QAAEK,UAAU;IAAM;IAClD,IAAID,UAAUA,OAAOE,aAAa,CAACE,MAAM,EAAE,OAAOZ,cAAcQ,OAAOE,aAAa,CAAC,EAAE,EAAEL,MAAMG,QAAQF,SAASC;IAChHA,SAAS,IAAIM,MAAM,AAAC,qBAA4B,OAART;AAC1C"}
@@ -30,9 +30,4 @@ module.exports = function installCompressed(relativePath, dest, _record, options
30
30
  });
31
31
  });
32
32
  };
33
-
34
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
35
- Object.defineProperty(exports.default, '__esModule', { value: true });
36
- for (var key in exports) exports.default[key] = exports[key];
37
- module.exports = exports.default;
38
- }
33
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["installCompressed.js"],"sourcesContent":["var path = require('path');\nvar access = require('fs-access-compat');\nvar rimraf = require('rimraf');\n\nvar conditionalCache = require('../conditionalCache');\nvar conditionalExtract = require('../conditionalExtract');\nvar progress = require('../progress');\n\nmodule.exports = function installCompressed(relativePath, dest, _record, options, callback) {\n var downloadPath = options.downloadURL(relativePath);\n var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));\n\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n conditionalExtract(cachePath, dest, Object.assign({ strip: 1, progress: progress, time: 1000 }, options), (err) => {\n console.log('');\n if (err) return callback(err);\n\n // some compressed versions of node come with npm pre-installed, but we want to override with a specific version\n var platform = options.platform || process.platform;\n var libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n var installPath = path.join(libPath, 'node_modules', 'npm');\n rimraf(installPath, () => {\n callback(err);\n });\n });\n });\n });\n};\n"],"names":["path","require","access","rimraf","conditionalCache","conditionalExtract","progress","module","exports","installCompressed","relativePath","dest","_record","options","callback","downloadPath","downloadURL","cachePath","join","cacheDirectory","basename","err","Object","assign","strip","time","console","log","platform","process","libPath","installPath"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,SAASD,QAAQ;AACrB,IAAIE,SAASF,QAAQ;AAErB,IAAIG,mBAAmBH,QAAQ;AAC/B,IAAII,qBAAqBJ,QAAQ;AACjC,IAAIK,WAAWL,QAAQ;AAEvBM,OAAOC,OAAO,GAAG,SAASC,kBAAkBC,YAAY,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ;IACxF,IAAIC,eAAeF,QAAQG,WAAW,CAACN;IACvC,IAAIO,YAAYjB,KAAKkB,IAAI,CAACL,QAAQM,cAAc,EAAEnB,KAAKoB,QAAQ,CAACL;IAEhEX,iBAAiBW,cAAcE,WAAW,SAACI;QACzC,IAAIA,KAAK,OAAOP,SAASO;QACzBnB,OAAOS,MAAM,SAACU;YACZ,IAAI,CAACA,KAAK,OAAOP,YAAY,iBAAiB;YAC9CT,mBAAmBY,WAAWN,MAAMW,OAAOC,MAAM,CAAC;gBAAEC,OAAO;gBAAGlB,UAAUA;gBAAUmB,MAAM;YAAK,GAAGZ,UAAU,SAACQ;gBACzGK,QAAQC,GAAG,CAAC;gBACZ,IAAIN,KAAK,OAAOP,SAASO;gBAEzB,gHAAgH;gBAChH,IAAIO,WAAWf,QAAQe,QAAQ,IAAIC,QAAQD,QAAQ;gBACnD,IAAIE,UAAUF,aAAa,UAAUjB,OAAOX,KAAKkB,IAAI,CAACP,MAAM;gBAC5D,IAAIoB,cAAc/B,KAAKkB,IAAI,CAACY,SAAS,gBAAgB;gBACrD3B,OAAO4B,aAAa;oBAClBjB,SAASO;gBACX;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["installCompressed.js"],"sourcesContent":["const path = require('path');\nconst access = require('fs-access-compat');\nconst rimraf = require('rimraf');\n\nconst conditionalCache = require('../conditionalCache');\nconst conditionalExtract = require('../conditionalExtract');\nconst progress = require('../progress');\n\nmodule.exports = function installCompressed(relativePath, dest, _record, options, callback) {\n const downloadPath = options.downloadURL(relativePath);\n const cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));\n\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n access(dest, (err) => {\n if (!err) return callback(); // already exists\n conditionalExtract(cachePath, dest, Object.assign({ strip: 1, progress: progress, time: 1000 }, options), (err) => {\n console.log('');\n if (err) return callback(err);\n\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 rimraf(installPath, () => {\n callback(err);\n });\n });\n });\n });\n};\n"],"names":["path","require","access","rimraf","conditionalCache","conditionalExtract","progress","module","exports","installCompressed","relativePath","dest","_record","options","callback","downloadPath","downloadURL","cachePath","join","cacheDirectory","basename","err","Object","assign","strip","time","console","log","platform","process","libPath","installPath"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,SAASD,QAAQ;AACvB,IAAME,SAASF,QAAQ;AAEvB,IAAMG,mBAAmBH,QAAQ;AACjC,IAAMI,qBAAqBJ,QAAQ;AACnC,IAAMK,WAAWL,QAAQ;AAEzBM,OAAOC,OAAO,GAAG,SAASC,kBAAkBC,YAAY,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ;IACxF,IAAMC,eAAeF,QAAQG,WAAW,CAACN;IACzC,IAAMO,YAAYjB,KAAKkB,IAAI,CAACL,QAAQM,cAAc,EAAEnB,KAAKoB,QAAQ,CAACL;IAElEX,iBAAiBW,cAAcE,WAAW,SAACI;QACzC,IAAIA,KAAK,OAAOP,SAASO;QACzBnB,OAAOS,MAAM,SAACU;YACZ,IAAI,CAACA,KAAK,OAAOP,YAAY,iBAAiB;YAC9CT,mBAAmBY,WAAWN,MAAMW,OAAOC,MAAM,CAAC;gBAAEC,OAAO;gBAAGlB,UAAUA;gBAAUmB,MAAM;YAAK,GAAGZ,UAAU,SAACQ;gBACzGK,QAAQC,GAAG,CAAC;gBACZ,IAAIN,KAAK,OAAOP,SAASO;gBAEzB,gHAAgH;gBAChH,IAAMO,WAAWf,QAAQe,QAAQ,IAAIC,QAAQD,QAAQ;gBACrD,IAAME,UAAUF,aAAa,UAAUjB,OAAOX,KAAKkB,IAAI,CAACP,MAAM;gBAC9D,IAAMoB,cAAc/B,KAAKkB,IAAI,CAACY,SAAS,gBAAgB;gBACvD3B,OAAO4B,aAAa;oBAClBjB,SAASO;gBACX;YACF;QACF;IACF;AACF"}
@@ -15,9 +15,4 @@ module.exports = function installExe(relativePath, dest, record, options, callba
15
15
  });
16
16
  });
17
17
  };
18
-
19
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
20
- Object.defineProperty(exports.default, '__esModule', { value: true });
21
- for (var key in exports) exports.default[key] = exports[key];
22
- module.exports = exports.default;
23
- }
18
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["installExe.js"],"sourcesContent":["var path = require('path');\nvar access = require('fs-access-compat');\n\nvar conditionalCache = require('../conditionalCache');\nvar copyFile = require('../copyFile');\n\nmodule.exports = function installExe(relativePath, dest, record, options, callback) {\n var downloadPath = options.downloadURL(relativePath);\n var cachePath = path.join(options.cacheDirectory, `node-${record.version}.exe`);\n var destPath = path.join(dest, path.basename(relativePath));\n\n access(destPath, (err) => {\n if (!err) return callback(); // already exists\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n copyFile(cachePath, destPath, callback);\n });\n });\n};\n"],"names":["path","require","access","conditionalCache","copyFile","module","exports","installExe","relativePath","dest","record","options","callback","downloadPath","downloadURL","cachePath","join","cacheDirectory","version","destPath","basename","err"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,SAASD,QAAQ;AAErB,IAAIE,mBAAmBF,QAAQ;AAC/B,IAAIG,WAAWH,QAAQ;AAEvBI,OAAOC,OAAO,GAAG,SAASC,WAAWC,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ;IAChF,IAAIC,eAAeF,QAAQG,WAAW,CAACN;IACvC,IAAIO,YAAYf,KAAKgB,IAAI,CAACL,QAAQM,cAAc,EAAE,AAAC,QAAsB,OAAfP,OAAOQ,OAAO,EAAC;IACzE,IAAIC,WAAWnB,KAAKgB,IAAI,CAACP,MAAMT,KAAKoB,QAAQ,CAACZ;IAE7CN,OAAOiB,UAAU,SAACE;QAChB,IAAI,CAACA,KAAK,OAAOT,YAAY,iBAAiB;QAC9CT,iBAAiBU,cAAcE,WAAW,SAACM;YACzC,IAAIA,KAAK,OAAOT,SAASS;YACzBjB,SAASW,WAAWI,UAAUP;QAChC;IACF;AACF"}
1
+ {"version":3,"sources":["installExe.js"],"sourcesContent":["const path = require('path');\nconst access = require('fs-access-compat');\n\nconst conditionalCache = require('../conditionalCache');\nconst copyFile = require('../copyFile');\n\nmodule.exports = function installExe(relativePath, dest, record, options, callback) {\n const downloadPath = options.downloadURL(relativePath);\n const cachePath = path.join(options.cacheDirectory, `node-${record.version}.exe`);\n const destPath = path.join(dest, path.basename(relativePath));\n\n access(destPath, (err) => {\n if (!err) return callback(); // already exists\n conditionalCache(downloadPath, cachePath, (err) => {\n if (err) return callback(err);\n copyFile(cachePath, destPath, callback);\n });\n });\n};\n"],"names":["path","require","access","conditionalCache","copyFile","module","exports","installExe","relativePath","dest","record","options","callback","downloadPath","downloadURL","cachePath","join","cacheDirectory","version","destPath","basename","err"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,SAASD,QAAQ;AAEvB,IAAME,mBAAmBF,QAAQ;AACjC,IAAMG,WAAWH,QAAQ;AAEzBI,OAAOC,OAAO,GAAG,SAASC,WAAWC,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ;IAChF,IAAMC,eAAeF,QAAQG,WAAW,CAACN;IACzC,IAAMO,YAAYf,KAAKgB,IAAI,CAACL,QAAQM,cAAc,EAAE,AAAC,QAAsB,OAAfP,OAAOQ,OAAO,EAAC;IAC3E,IAAMC,WAAWnB,KAAKgB,IAAI,CAACP,MAAMT,KAAKoB,QAAQ,CAACZ;IAE/CN,OAAOiB,UAAU,SAACE;QAChB,IAAI,CAACA,KAAK,OAAOT,YAAY,iBAAiB;QAC9CT,iBAAiBU,cAAcE,WAAW,SAACM;YACzC,IAAIA,KAAK,OAAOT,SAASS;YACzBjB,SAASW,WAAWI,UAAUP;QAChC;IACF;AACF"}
@@ -27,9 +27,4 @@ module.exports = function installDefault(buildPath, dest, _options, callback) {
27
27
  queue.await(callback);
28
28
  });
29
29
  };
30
-
31
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
32
- Object.defineProperty(exports.default, '__esModule', { value: true });
33
- for (var key in exports) exports.default[key] = exports[key];
34
- module.exports = exports.default;
35
- }
30
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["buildPosix.js"],"sourcesContent":["var path = require('path');\nvar spawn = require('cross-spawn-cb');\nvar Queue = require('queue-cb');\nvar access = require('fs-access-compat');\n\nmodule.exports = function installDefault(buildPath, dest, _options, callback) {\n var buildTarget = path.join(dest, 'node');\n\n access(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n var queue = new Queue(1);\n queue.defer((callback) => {\n spawn('./configure', [`--prefix=${dest}`], { stdio: 'inherit', cwd: buildPath }, callback);\n });\n queue.defer((callback) => {\n spawn('make', ['install'], { stdio: 'inherit', cwd: buildPath }, callback);\n });\n queue.await(callback);\n });\n};\n"],"names":["path","require","spawn","Queue","access","module","exports","installDefault","buildPath","dest","_options","callback","buildTarget","join","err","queue","defer","stdio","cwd","await"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,QAAQD,QAAQ;AACpB,IAAIE,QAAQF,QAAQ;AACpB,IAAIG,SAASH,QAAQ;AAErBI,OAAOC,OAAO,GAAG,SAASC,eAAeC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IAC1E,IAAIC,cAAcZ,KAAKa,IAAI,CAACJ,MAAM;IAElCL,OAAOQ,aAAa,SAACE;QACnB,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAE9C,IAAII,QAAQ,IAAIZ,MAAM;QACtBY,MAAMC,KAAK,CAAC,SAACL;YACXT,MAAM,eAAe;gBAAE,YAAgB,OAALO;aAAO,EAAE;gBAAEQ,OAAO;gBAAWC,KAAKV;YAAU,GAAGG;QACnF;QACAI,MAAMC,KAAK,CAAC,SAACL;YACXT,MAAM,QAAQ;gBAAC;aAAU,EAAE;gBAAEe,OAAO;gBAAWC,KAAKV;YAAU,GAAGG;QACnE;QACAI,MAAMI,KAAK,CAACR;IACd;AACF"}
1
+ {"version":3,"sources":["buildPosix.js"],"sourcesContent":["const path = require('path');\nconst spawn = require('cross-spawn-cb');\nconst Queue = require('queue-cb');\nconst access = require('fs-access-compat');\n\nmodule.exports = function installDefault(buildPath, dest, _options, callback) {\n const buildTarget = path.join(dest, 'node');\n\n access(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer((callback) => {\n spawn('./configure', [`--prefix=${dest}`], { stdio: 'inherit', cwd: buildPath }, callback);\n });\n queue.defer((callback) => {\n spawn('make', ['install'], { stdio: 'inherit', cwd: buildPath }, callback);\n });\n queue.await(callback);\n });\n};\n"],"names":["path","require","spawn","Queue","access","module","exports","installDefault","buildPath","dest","_options","callback","buildTarget","join","err","queue","defer","stdio","cwd","await"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AACtB,IAAME,QAAQF,QAAQ;AACtB,IAAMG,SAASH,QAAQ;AAEvBI,OAAOC,OAAO,GAAG,SAASC,eAAeC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IAC1E,IAAMC,cAAcZ,KAAKa,IAAI,CAACJ,MAAM;IAEpCL,OAAOQ,aAAa,SAACE;QACnB,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAE9C,IAAMI,QAAQ,IAAIZ,MAAM;QACxBY,MAAMC,KAAK,CAAC,SAACL;YACXT,MAAM,eAAe;gBAAE,YAAgB,OAALO;aAAO,EAAE;gBAAEQ,OAAO;gBAAWC,KAAKV;YAAU,GAAGG;QACnF;QACAI,MAAMC,KAAK,CAAC,SAACL;YACXT,MAAM,QAAQ;gBAAC;aAAU,EAAE;gBAAEe,OAAO;gBAAWC,KAAKV;YAAU,GAAGG;QACnE;QACAI,MAAMI,KAAK,CAACR;IACd;AACF"}
@@ -23,9 +23,4 @@ module.exports = function installWin32(buildPath, dest, _options, callback) {
23
23
  queue.await(callback);
24
24
  });
25
25
  };
26
-
27
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
28
- Object.defineProperty(exports.default, '__esModule', { value: true });
29
- for (var key in exports) exports.default[key] = exports[key];
30
- module.exports = exports.default;
31
- }
26
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["buildWin32.js"],"sourcesContent":["var path = require('path');\nvar spawn = require('cross-spawn-cb');\nvar Queue = require('queue-cb');\n\nvar access = require('fs-access-compat');\nvar conditionalCopy = require('../../conditionalCopy');\n\nmodule.exports = function installWin32(buildPath, dest, _options, callback) {\n var buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n var buildTarget = path.join(dest, 'node.exe');\n\n access(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n var queue = new Queue(1);\n queue.defer((callback) => {\n access(buildSource, (err) => {\n if (!err) return callback(); // already exists\n spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }, callback);\n });\n });\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget));\n queue.await(callback);\n });\n};\n"],"names":["path","require","spawn","Queue","access","conditionalCopy","module","exports","installWin32","buildPath","dest","_options","callback","buildSource","join","buildTarget","err","queue","defer","stdio","cwd","bind","await"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,QAAQD,QAAQ;AACpB,IAAIE,QAAQF,QAAQ;AAEpB,IAAIG,SAASH,QAAQ;AACrB,IAAII,kBAAkBJ,QAAQ;AAE9BK,OAAOC,OAAO,GAAG,SAASC,aAAaC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACxE,IAAIC,cAAcb,KAAKc,IAAI,CAACL,WAAW,OAAO,WAAW;IACzD,IAAIM,cAAcf,KAAKc,IAAI,CAACJ,MAAM;IAElCN,OAAOW,aAAa,SAACC;QACnB,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;QAE9C,IAAIK,QAAQ,IAAId,MAAM;QACtBc,MAAMC,KAAK,CAAC,SAACN;YACXR,OAAOS,aAAa,SAACG;gBACnB,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;gBAC9CV,MAAM,aAAa,EAAE,EAAE;oBAAEiB,OAAO;oBAAWC,KAAKX;gBAAU,GAAGG;YAC/D;QACF;QACAK,MAAMC,KAAK,CAACb,gBAAgBgB,IAAI,CAAC,MAAMR,aAAaE;QACpDE,MAAMK,KAAK,CAACV;IACd;AACF"}
1
+ {"version":3,"sources":["buildWin32.js"],"sourcesContent":["const path = require('path');\nconst spawn = require('cross-spawn-cb');\nconst Queue = require('queue-cb');\n\nconst access = require('fs-access-compat');\nconst conditionalCopy = require('../../conditionalCopy');\n\nmodule.exports = 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((callback) => {\n access(buildSource, (err) => {\n if (!err) return callback(); // already exists\n spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }, callback);\n });\n });\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget));\n queue.await(callback);\n });\n};\n"],"names":["path","require","spawn","Queue","access","conditionalCopy","module","exports","installWin32","buildPath","dest","_options","callback","buildSource","join","buildTarget","err","queue","defer","stdio","cwd","bind","await"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AACtB,IAAME,QAAQF,QAAQ;AAEtB,IAAMG,SAASH,QAAQ;AACvB,IAAMI,kBAAkBJ,QAAQ;AAEhCK,OAAOC,OAAO,GAAG,SAASC,aAAaC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ;IACxE,IAAMC,cAAcb,KAAKc,IAAI,CAACL,WAAW,OAAO,WAAW;IAC3D,IAAMM,cAAcf,KAAKc,IAAI,CAACJ,MAAM;IAEpCN,OAAOW,aAAa,SAACC;QACnB,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;QAE9C,IAAMK,QAAQ,IAAId,MAAM;QACxBc,MAAMC,KAAK,CAAC,SAACN;YACXR,OAAOS,aAAa,SAACG;gBACnB,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;gBAC9CV,MAAM,aAAa,EAAE,EAAE;oBAAEiB,OAAO;oBAAWC,KAAKX;gBAAU,GAAGG;YAC/D;QACF;QACAK,MAAMC,KAAK,CAACb,gBAAgBgB,IAAI,CAAC,MAAMR,aAAaE;QACpDE,MAAMK,KAAK,CAACV;IACd;AACF"}
@@ -19,9 +19,4 @@ module.exports = function InstallSource(relativePath, dest, _record, options, ca
19
19
  queue.defer(build.bind(null, buildPath, dest, options));
20
20
  queue.await(callback);
21
21
  };
22
-
23
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
24
- Object.defineProperty(exports.default, '__esModule', { value: true });
25
- for (var key in exports) exports.default[key] = exports[key];
26
- module.exports = exports.default;
27
- }
22
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["var path = require('path');\nvar Queue = require('queue-cb');\n\nvar conditionalCache = require('../../conditionalCache');\nvar conditionalExtract = require('../../conditionalExtract');\nvar buildPosix = require('./buildPosix');\nvar buildWin32 = require('./buildWin32');\n\nmodule.exports = function InstallSource(relativePath, dest, _record, options, callback) {\n var platform = options.platform || process.platform;\n var build = platform === 'win32' ? buildWin32 : buildPosix;\n var downloadPath = options.downloadURL(relativePath);\n var buildPath = path.join(options.buildDirectory, path.basename(relativePath));\n var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));\n\n var queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(conditionalExtract.bind(null, cachePath, buildPath, { strip: 1 }));\n queue.defer(build.bind(null, buildPath, dest, options));\n queue.await(callback);\n};\n"],"names":["path","require","Queue","conditionalCache","conditionalExtract","buildPosix","buildWin32","module","exports","InstallSource","relativePath","dest","_record","options","callback","platform","process","build","downloadPath","downloadURL","buildPath","join","buildDirectory","basename","cachePath","cacheDirectory","queue","defer","bind","strip","await"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,QAAQD,QAAQ;AAEpB,IAAIE,mBAAmBF,QAAQ;AAC/B,IAAIG,qBAAqBH,QAAQ;AACjC,IAAII,aAAaJ,QAAQ;AACzB,IAAIK,aAAaL,QAAQ;AAEzBM,OAAOC,OAAO,GAAG,SAASC,cAAcC,YAAY,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ;IACpF,IAAIC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACnD,IAAIE,QAAQF,aAAa,UAAUT,aAAaD;IAChD,IAAIa,eAAeL,QAAQM,WAAW,CAACT;IACvC,IAAIU,YAAYpB,KAAKqB,IAAI,CAACR,QAAQS,cAAc,EAAEtB,KAAKuB,QAAQ,CAACb;IAChE,IAAIc,YAAYxB,KAAKqB,IAAI,CAACR,QAAQY,cAAc,EAAEzB,KAAKuB,QAAQ,CAACL;IAEhE,IAAIQ,QAAQ,IAAIxB,MAAM;IACtBwB,MAAMC,KAAK,CAACxB,iBAAiByB,IAAI,CAAC,MAAMV,cAAcM;IACtDE,MAAMC,KAAK,CAACvB,mBAAmBwB,IAAI,CAAC,MAAMJ,WAAWJ,WAAW;QAAES,OAAO;IAAE;IAC3EH,MAAMC,KAAK,CAACV,MAAMW,IAAI,CAAC,MAAMR,WAAWT,MAAME;IAC9Ca,MAAMI,KAAK,CAAChB;AACd"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["const path = require('path');\nconst Queue = require('queue-cb');\n\nconst conditionalCache = require('../../conditionalCache');\nconst conditionalExtract = require('../../conditionalExtract');\nconst buildPosix = require('./buildPosix');\nconst buildWin32 = require('./buildWin32');\n\nmodule.exports = function InstallSource(relativePath, dest, _record, options, callback) {\n const platform = options.platform || process.platform;\n const build = platform === 'win32' ? buildWin32 : buildPosix;\n const downloadPath = options.downloadURL(relativePath);\n const buildPath = path.join(options.buildDirectory, path.basename(relativePath));\n const cachePath = path.join(options.cacheDirectory, 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, buildPath, { strip: 1 }));\n queue.defer(build.bind(null, buildPath, dest, options));\n queue.await(callback);\n};\n"],"names":["path","require","Queue","conditionalCache","conditionalExtract","buildPosix","buildWin32","module","exports","InstallSource","relativePath","dest","_record","options","callback","platform","process","build","downloadPath","downloadURL","buildPath","join","buildDirectory","basename","cachePath","cacheDirectory","queue","defer","bind","strip","await"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AAEtB,IAAME,mBAAmBF,QAAQ;AACjC,IAAMG,qBAAqBH,QAAQ;AACnC,IAAMI,aAAaJ,QAAQ;AAC3B,IAAMK,aAAaL,QAAQ;AAE3BM,OAAOC,OAAO,GAAG,SAASC,cAAcC,YAAY,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ;IACpF,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,QAAQF,aAAa,UAAUT,aAAaD;IAClD,IAAMa,eAAeL,QAAQM,WAAW,CAACT;IACzC,IAAMU,YAAYpB,KAAKqB,IAAI,CAACR,QAAQS,cAAc,EAAEtB,KAAKuB,QAAQ,CAACb;IAClE,IAAMc,YAAYxB,KAAKqB,IAAI,CAACR,QAAQY,cAAc,EAAEzB,KAAKuB,QAAQ,CAACL;IAElE,IAAMQ,QAAQ,IAAIxB,MAAM;IACxBwB,MAAMC,KAAK,CAACxB,iBAAiByB,IAAI,CAAC,MAAMV,cAAcM;IACtDE,MAAMC,KAAK,CAACvB,mBAAmBwB,IAAI,CAAC,MAAMJ,WAAWJ,WAAW;QAAES,OAAO;IAAE;IAC3EH,MAAMC,KAAK,CAACV,MAAMW,IAAI,CAAC,MAAMR,WAAWT,MAAME;IAC9Ca,MAAMI,KAAK,CAAChB;AACd"}
@@ -19,9 +19,4 @@ module.exports = function install(version, dest, options, callback) {
19
19
  });
20
20
  });
21
21
  };
22
-
23
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
24
- Object.defineProperty(exports.default, '__esModule', { value: true });
25
- for (var key in exports) exports.default[key] = exports[key];
26
- module.exports = exports.default;
27
- }
22
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["installVersion.js"],"sourcesContent":["var path = require('path');\nvar Queue = require('queue-cb');\n\nvar installNode = require('./installNode');\nvar installNPM = require('./installNPM');\nvar checkMissing = require('./checkMissing');\nvar ensureDestinationParent = require('./ensureDestinationParent');\n\nmodule.exports = function install(version, dest, options, callback) {\n // use cwd if dest not provided\n if (!dest) dest = path.join(process.cwd(), version.version);\n\n checkMissing(dest, options, (err, missing) => {\n if (err || !missing.length) return callback(err, dest);\n\n var queue = new Queue(1);\n queue.defer(ensureDestinationParent.bind(null, dest));\n !~missing.indexOf('node') || queue.defer(installNode.bind(null, version, dest, options));\n !~missing.indexOf('npm') || queue.defer(installNPM.bind(null, version, dest, options));\n queue.await((err) => {\n err ? callback(err) : callback(null, dest);\n });\n });\n};\n"],"names":["path","require","Queue","installNode","installNPM","checkMissing","ensureDestinationParent","module","exports","install","version","dest","options","callback","join","process","cwd","err","missing","length","queue","defer","bind","indexOf","await"],"mappings":";AAAA,IAAIA,OAAOC,QAAQ;AACnB,IAAIC,QAAQD,QAAQ;AAEpB,IAAIE,cAAcF,QAAQ;AAC1B,IAAIG,aAAaH,QAAQ;AACzB,IAAII,eAAeJ,QAAQ;AAC3B,IAAIK,0BAA0BL,QAAQ;AAEtCM,OAAOC,OAAO,GAAG,SAASC,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChE,+BAA+B;IAC/B,IAAI,CAACF,MAAMA,OAAOX,KAAKc,IAAI,CAACC,QAAQC,GAAG,IAAIN,QAAQA,OAAO;IAE1DL,aAAaM,MAAMC,SAAS,SAACK,KAAKC;QAChC,IAAID,OAAO,CAACC,QAAQC,MAAM,EAAE,OAAON,SAASI,KAAKN;QAEjD,IAAIS,QAAQ,IAAIlB,MAAM;QACtBkB,MAAMC,KAAK,CAACf,wBAAwBgB,IAAI,CAAC,MAAMX;QAC/C,CAAC,CAACO,QAAQK,OAAO,CAAC,WAAWH,MAAMC,KAAK,CAAClB,YAAYmB,IAAI,CAAC,MAAMZ,SAASC,MAAMC;QAC/E,CAAC,CAACM,QAAQK,OAAO,CAAC,UAAUH,MAAMC,KAAK,CAACjB,WAAWkB,IAAI,CAAC,MAAMZ,SAASC,MAAMC;QAC7EQ,MAAMI,KAAK,CAAC,SAACP;YACXA,MAAMJ,SAASI,OAAOJ,SAAS,MAAMF;QACvC;IACF;AACF"}
1
+ {"version":3,"sources":["installVersion.js"],"sourcesContent":["const path = require('path');\nconst Queue = require('queue-cb');\n\nconst installNode = require('./installNode');\nconst installNPM = require('./installNPM');\nconst checkMissing = require('./checkMissing');\nconst ensureDestinationParent = require('./ensureDestinationParent');\n\nmodule.exports = function install(version, dest, options, callback) {\n // use cwd if dest not provided\n if (!dest) dest = path.join(process.cwd(), version.version);\n\n checkMissing(dest, options, (err, missing) => {\n if (err || !missing.length) return callback(err, dest);\n\n const queue = new Queue(1);\n queue.defer(ensureDestinationParent.bind(null, dest));\n !~missing.indexOf('node') || queue.defer(installNode.bind(null, version, dest, options));\n !~missing.indexOf('npm') || queue.defer(installNPM.bind(null, version, dest, options));\n queue.await((err) => {\n err ? callback(err) : callback(null, dest);\n });\n });\n};\n"],"names":["path","require","Queue","installNode","installNPM","checkMissing","ensureDestinationParent","module","exports","install","version","dest","options","callback","join","process","cwd","err","missing","length","queue","defer","bind","indexOf","await"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AAEtB,IAAME,cAAcF,QAAQ;AAC5B,IAAMG,aAAaH,QAAQ;AAC3B,IAAMI,eAAeJ,QAAQ;AAC7B,IAAMK,0BAA0BL,QAAQ;AAExCM,OAAOC,OAAO,GAAG,SAASC,QAAQC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAChE,+BAA+B;IAC/B,IAAI,CAACF,MAAMA,OAAOX,KAAKc,IAAI,CAACC,QAAQC,GAAG,IAAIN,QAAQA,OAAO;IAE1DL,aAAaM,MAAMC,SAAS,SAACK,KAAKC;QAChC,IAAID,OAAO,CAACC,QAAQC,MAAM,EAAE,OAAON,SAASI,KAAKN;QAEjD,IAAMS,QAAQ,IAAIlB,MAAM;QACxBkB,MAAMC,KAAK,CAACf,wBAAwBgB,IAAI,CAAC,MAAMX;QAC/C,CAAC,CAACO,QAAQK,OAAO,CAAC,WAAWH,MAAMC,KAAK,CAAClB,YAAYmB,IAAI,CAAC,MAAMZ,SAASC,MAAMC;QAC/E,CAAC,CAACM,QAAQK,OAAO,CAAC,UAAUH,MAAMC,KAAK,CAACjB,WAAWkB,IAAI,CAAC,MAAMZ,SAASC,MAAMC;QAC7EQ,MAAMI,KAAK,CAAC,SAACP;YACXA,MAAMJ,SAASI,OAAOJ,SAAS,MAAMF;QACvC;IACF;AACF"}
@@ -3,9 +3,4 @@ var cp = require("child_process");
3
3
  module.exports = function execCallback(cmd, options, callback) {
4
4
  return cp.exec(cmd, options, callback);
5
5
  };
6
-
7
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
8
- Object.defineProperty(exports.default, '__esModule', { value: true });
9
- for (var key in exports) exports.default[key] = exports[key];
10
- module.exports = exports.default;
11
- }
6
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["execCallback.js"],"sourcesContent":["var cp = require('child_process');\n\nmodule.exports = function execCallback(cmd, options, callback) {\n return cp.exec(cmd, options, callback);\n};\n"],"names":["cp","require","module","exports","execCallback","cmd","options","callback","exec"],"mappings":";AAAA,IAAIA,KAAKC,QAAQ;AAEjBC,OAAOC,OAAO,GAAG,SAASC,aAAaC,GAAG,EAAEC,OAAO,EAAEC,QAAQ;IAC3D,OAAOP,GAAGQ,IAAI,CAACH,KAAKC,SAASC;AAC/B"}
1
+ {"version":3,"sources":["execCallback.js"],"sourcesContent":["const cp = require('child_process');\n\nmodule.exports = function execCallback(cmd, options, callback) {\n return cp.exec(cmd, options, callback);\n};\n"],"names":["cp","require","module","exports","execCallback","cmd","options","callback","exec"],"mappings":";AAAA,IAAMA,KAAKC,QAAQ;AAEnBC,OAAOC,OAAO,GAAG,SAASC,aAAaC,GAAG,EAAEC,OAAO,EAAEC,QAAQ;IAC3D,OAAOP,GAAGQ,IAAI,CAACH,KAAKC,SAASC;AAC/B"}
@@ -13,9 +13,4 @@ if (!cp.execSync) {
13
13
  }, execCallback, cmd, options || {});
14
14
  };
15
15
  }
16
-
17
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
18
- Object.defineProperty(exports.default, '__esModule', { value: true });
19
- for (var key in exports) exports.default[key] = exports[key];
20
- module.exports = exports.default;
21
- }
16
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["require('core-js/actual/object/assign');\nrequire('core-js/actual/promise');\n\nvar cp = require('child_process');\nif (!cp.execSync) {\n var path = require('path');\n var execCallback = path.join(__dirname, 'execCallback.js');\n\n var functionExec = null; // break dependencies\n cp.execSync = function execSyncPolyfill(cmd, options) {\n if (!functionExec) functionExec = require('function-exec-sync');\n\n return functionExec({ callbacks: true }, execCallback, cmd, options || {});\n };\n}\n"],"names":["require","cp","execSync","path","execCallback","join","__dirname","functionExec","execSyncPolyfill","cmd","options","callbacks"],"mappings":";AAAAA,QAAQ;AACRA,QAAQ;AAER,IAAIC,KAAKD,QAAQ;AACjB,IAAI,CAACC,GAAGC,QAAQ,EAAE;IAChB,IAAIC,OAAOH,QAAQ;IACnB,IAAII,eAAeD,KAAKE,IAAI,CAACC,WAAW;IAExC,IAAIC,eAAe,MAAM,qBAAqB;IAC9CN,GAAGC,QAAQ,GAAG,SAASM,iBAAiBC,GAAG,EAAEC,OAAO;QAClD,IAAI,CAACH,cAAcA,eAAeP,QAAQ;QAE1C,OAAOO,aAAa;YAAEI,WAAW;QAAK,GAAGP,cAAcK,KAAKC,WAAW,CAAC;IAC1E;AACF"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["require('core-js/actual/object/assign');\nrequire('core-js/actual/promise');\n\nconst cp = require('child_process');\nif (!cp.execSync) {\n const path = require('path');\n const execCallback = path.join(__dirname, 'execCallback.js');\n\n let functionExec = null; // break dependencies\n cp.execSync = function execSyncPolyfill(cmd, options) {\n if (!functionExec) functionExec = require('function-exec-sync');\n\n return functionExec({ callbacks: true }, execCallback, cmd, options || {});\n };\n}\n"],"names":["require","cp","execSync","path","execCallback","join","__dirname","functionExec","execSyncPolyfill","cmd","options","callbacks"],"mappings":";AAAAA,QAAQ;AACRA,QAAQ;AAER,IAAMC,KAAKD,QAAQ;AACnB,IAAI,CAACC,GAAGC,QAAQ,EAAE;IAChB,IAAMC,OAAOH,QAAQ;IACrB,IAAMI,eAAeD,KAAKE,IAAI,CAACC,WAAW;IAE1C,IAAIC,eAAe,MAAM,qBAAqB;IAC9CN,GAAGC,QAAQ,GAAG,SAASM,iBAAiBC,GAAG,EAAEC,OAAO;QAClD,IAAI,CAACH,cAAcA,eAAeP,QAAQ;QAE1C,OAAOO,aAAa;YAAEI,WAAW;QAAK,GAAGP,cAAcK,KAAKC,WAAW,CAAC;IAC1E;AACF"}
@@ -5,9 +5,4 @@ module.exports = function progress(entry) {
5
5
  if (entry.percentage) message += " - ".concat(entry.percentage.toFixed(0), "%");
6
6
  log(message);
7
7
  };
8
-
9
- if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
10
- Object.defineProperty(exports.default, '__esModule', { value: true });
11
- for (var key in exports) exports.default[key] = exports[key];
12
- module.exports = exports.default;
13
- }
8
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) { module.exports = exports.default; for (var key in exports) module.exports[key] = exports[key]; }
@@ -1 +1 @@
1
- {"version":3,"sources":["progress.js"],"sourcesContent":["var log = require('single-line-log2').stdout;\n\nmodule.exports = function progress(entry) {\n var message = `${entry.progress} ${entry.basename}`;\n if (entry.percentage) message += ` - ${entry.percentage.toFixed(0)}%`;\n log(message);\n};\n"],"names":["log","require","stdout","module","exports","progress","entry","message","basename","percentage","toFixed"],"mappings":";AAAA,IAAIA,MAAMC,QAAQ,oBAAoBC,MAAM;AAE5CC,OAAOC,OAAO,GAAG,SAASC,SAASC,KAAK;IACtC,IAAIC,UAAU,AAAC,GAAoBD,OAAlBA,MAAMD,QAAQ,EAAC,KAAkB,OAAfC,MAAME,QAAQ;IACjD,IAAIF,MAAMG,UAAU,EAAEF,WAAW,AAAC,MAAiC,OAA5BD,MAAMG,UAAU,CAACC,OAAO,CAAC,IAAG;IACnEV,IAAIO;AACN"}
1
+ {"version":3,"sources":["progress.js"],"sourcesContent":["const log = require('single-line-log2').stdout;\n\nmodule.exports = function progress(entry) {\n let message = `${entry.progress} ${entry.basename}`;\n if (entry.percentage) message += ` - ${entry.percentage.toFixed(0)}%`;\n log(message);\n};\n"],"names":["log","require","stdout","module","exports","progress","entry","message","basename","percentage","toFixed"],"mappings":";AAAA,IAAMA,MAAMC,QAAQ,oBAAoBC,MAAM;AAE9CC,OAAOC,OAAO,GAAG,SAASC,SAASC,KAAK;IACtC,IAAIC,UAAU,AAAC,GAAoBD,OAAlBA,MAAMD,QAAQ,EAAC,KAAkB,OAAfC,MAAME,QAAQ;IACjD,IAAIF,MAAMG,UAAU,EAAEF,WAAW,AAAC,MAAiC,OAA5BD,MAAMG,UAAU,CAACC,OAAO,CAAC,IAAG;IACnEV,IAAIO;AACN"}
@@ -0,0 +1,2 @@
1
+ declare function _default(argv: any): any;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default function installRelease(versionDetails: any, dest: any, options: any, callback: any): void | Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-install-release",
3
- "version": "0.4.8",
3
+ "version": "1.1.0",
4
4
  "description": "Cross-platform solution for installing releases of Node.js",
5
5
  "keywords": [
6
6
  "node",
@@ -18,26 +18,26 @@
18
18
  "license": "MIT",
19
19
  "main": "dist/cjs/index.js",
20
20
  "types": "dist/types/index.d.ts",
21
+ "bin": {
22
+ "nir": "./bin/cli.js"
23
+ },
21
24
  "files": [
22
25
  "dist"
23
26
  ],
24
- "bin": {
25
- "nir": "./bin/node-install-release.js"
26
- },
27
27
  "scripts": {
28
28
  "build": "tsds build",
29
29
  "deploy": "tsds deploy",
30
- "format": "biome check --apply src/ test/",
31
- "test": "tsds test:node --timeout=40000",
32
- "test:engines": "nvu engines tsds test:node",
30
+ "format": "biome check --apply-unsafe src/ test/",
31
+ "test": "tsds test:node --no-timeouts",
32
+ "test:engines": "nvu engines npm test",
33
33
  "version": "tsds version"
34
34
  },
35
35
  "dependencies": {
36
- "core-js": "^3.35.1",
37
- "cross-spawn-cb": "^0.6.14",
36
+ "core-js": "^3.36.0",
37
+ "cross-spawn-cb": "^0.6.18",
38
38
  "end-with": "^1.0.2",
39
39
  "exit": "^0.1.2",
40
- "fast-extract": "^0.4.8",
40
+ "fast-extract": "^1.0.0",
41
41
  "fs-access-compat": "^1.0.3",
42
42
  "function-exec-sync": "^0.2.11",
43
43
  "get-remote": "^0.8.3",
@@ -47,7 +47,7 @@
47
47
  "lodash.keys": "^4.2.0",
48
48
  "mkpath": "^1.0.0",
49
49
  "node-filename-to-dist-paths": "^0.2.4",
50
- "node-resolve-versions": "^0.3.9",
50
+ "node-resolve-versions": "^0.3.10",
51
51
  "osenv": "^0.1.5",
52
52
  "pump": "^3.0.0",
53
53
  "queue-cb": "^1.1.7",
@@ -57,19 +57,19 @@
57
57
  "devDependencies": {
58
58
  "@biomejs/biome": "^1.5.3",
59
59
  "@types/mocha": "^10.0.6",
60
+ "@types/node": "^20.11.19",
60
61
  "cr": "^0.1.0",
61
62
  "depcheck": "^1.4.7",
62
63
  "fs-access-sync-compat": "^1.0.2",
63
64
  "is-version": "^0.2.1",
64
- "mocha-compat": "^3.5.5",
65
65
  "node-version-utils": "^0.5.6",
66
- "ts-dev-stack": "^0.9.2"
66
+ "ts-dev-stack": "^0.14.0"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=0.8"
70
70
  },
71
71
  "tsds": {
72
- "source": "src/index.js",
72
+ "source": "src/index.mjs",
73
73
  "targets": [
74
74
  "cjs"
75
75
  ]
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- var getopts = require('getopts-compat');
4
- var exit = require('exit');
5
- var nir = require('..');
6
-
7
- (function () {
8
- var options = getopts(process.argv.slice(3), {
9
- alias: { platform: 'p', arch: 'a', filename: 'f', cacheDirectory: 'c', silent: 's' },
10
- boolean: ['silent'],
11
- });
12
-
13
- // define.option('-p, --platform [platform]', 'Platform like darwin');
14
- // define.option('-a, --arch [arch]', 'Architecure x64, x86, arm-pi');
15
- // define.option('-f, --filename [filename]', 'Distribution filename from https://nodejs.org/dist/index.json');
16
- // define.option('-c, --cacheDirectory [cacheDirectory]', 'Cache directory');
17
-
18
- var args = process.argv.slice(2, 3).concat(options._);
19
- if (args.length < 1) {
20
- console.log('Missing command. Example usage: nir version [directory]');
21
- return exit(-1);
22
- }
23
-
24
- var installPath = args.length > 1 ? args[1] : null;
25
- nir(args[0], installPath, Object.assign({ stdio: 'inherit' }, options), function (err, results) {
26
- if (err) {
27
- console.log(err.message);
28
- return exit(err.code || -1);
29
- }
30
- var errors = results.filter(function (result) {
31
- return !!result.error;
32
- });
33
-
34
- if (!options.silent) {
35
- console.log('\n======================');
36
- for (var index = 0; index < results.length; index++) {
37
- var result = results[index];
38
- if (result.error) console.log(result.version + ' not installed. Error: ' + result.error.message);
39
- else console.log(result.version + ' installed in: ' + result.fullPath);
40
- }
41
- console.log('======================');
42
- }
43
-
44
- exit(errors.length ? -1 : 0);
45
- });
46
- })();
@@ -1,2 +0,0 @@
1
- declare function _exports(buildPath: any, dest: any, _options: any, callback: any): void;
2
- export = _exports;
@@ -1,2 +0,0 @@
1
- export = installRelease;
2
- declare function installRelease(versionDetails: any, dest: any, options: any, callback: any): void | Promise<any>;