node-install-release 1.7.6 → 1.7.7

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 (102) hide show
  1. package/dist/cjs/constants.cjs +65 -0
  2. package/dist/cjs/constants.cjs.map +1 -1
  3. package/dist/cjs/index.cjs +0 -1
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/installNPM/installBin.cjs +2 -34
  6. package/dist/cjs/installNPM/installBin.cjs.map +1 -1
  7. package/dist/cjs/installNPM/installLib.cjs +12 -20
  8. package/dist/cjs/installNPM/installLib.cjs.map +1 -1
  9. package/dist/cjs/installNode/index.cjs +35 -21
  10. package/dist/cjs/installNode/index.cjs.map +1 -1
  11. package/dist/cjs/installNode/installCompressed.cjs +24 -22
  12. package/dist/cjs/installNode/installCompressed.cjs.map +1 -1
  13. package/dist/cjs/installNode/installExe.cjs +12 -8
  14. package/dist/cjs/installNode/installExe.cjs.map +1 -1
  15. package/dist/cjs/installNode/installFilename.cjs +31 -0
  16. package/dist/cjs/installNode/installFilename.cjs.map +1 -0
  17. package/dist/cjs/installNode/installSource/buildPosix.cjs +14 -18
  18. package/dist/cjs/installNode/installSource/buildPosix.cjs.map +1 -1
  19. package/dist/cjs/installNode/installSource/buildWin32.cjs +5 -8
  20. package/dist/cjs/installNode/installSource/buildWin32.cjs.map +1 -1
  21. package/dist/cjs/installNode/installSource/index.cjs +6 -3
  22. package/dist/cjs/installNode/installSource/index.cjs.map +1 -1
  23. package/dist/cjs/installNode/validateDownload.cjs +42 -0
  24. package/dist/cjs/installNode/validateDownload.cjs.map +1 -0
  25. package/dist/cjs/lib/checkMissing.cjs +11 -3
  26. package/dist/cjs/lib/checkMissing.cjs.map +1 -1
  27. package/dist/cjs/{lib → machine}/arch.cjs +3 -2
  28. package/dist/cjs/machine/arch.cjs.map +1 -0
  29. package/dist/cjs/{polyfills.cjs → machine/execSync/polyfill.cjs} +1 -1
  30. package/dist/cjs/machine/execSync/polyfill.cjs.map +1 -0
  31. package/dist/cjs/machine/execSync/worker.cjs.map +1 -0
  32. package/dist/cjs/workers/install.cjs +2 -33
  33. package/dist/cjs/workers/install.cjs.map +1 -1
  34. package/dist/esm/constants.mjs +44 -0
  35. package/dist/esm/constants.mjs.map +1 -1
  36. package/dist/esm/index.mjs +0 -1
  37. package/dist/esm/index.mjs.map +1 -1
  38. package/dist/esm/installNPM/installBin.mjs +2 -34
  39. package/dist/esm/installNPM/installBin.mjs.map +1 -1
  40. package/dist/esm/installNPM/installLib.mjs +12 -18
  41. package/dist/esm/installNPM/installLib.mjs.map +1 -1
  42. package/dist/esm/installNode/index.mjs +32 -22
  43. package/dist/esm/installNode/index.mjs.map +1 -1
  44. package/dist/esm/installNode/installCompressed.mjs +24 -24
  45. package/dist/esm/installNode/installCompressed.mjs.map +1 -1
  46. package/dist/esm/installNode/installExe.mjs +12 -8
  47. package/dist/esm/installNode/installExe.mjs.map +1 -1
  48. package/dist/esm/installNode/installFilename.mjs +15 -0
  49. package/dist/esm/installNode/installFilename.mjs.map +1 -0
  50. package/dist/esm/installNode/installSource/buildPosix.mjs +13 -17
  51. package/dist/esm/installNode/installSource/buildPosix.mjs.map +1 -1
  52. package/dist/esm/installNode/installSource/buildWin32.mjs +4 -9
  53. package/dist/esm/installNode/installSource/buildWin32.mjs.map +1 -1
  54. package/dist/esm/installNode/installSource/index.mjs +6 -3
  55. package/dist/esm/installNode/installSource/index.mjs.map +1 -1
  56. package/dist/esm/installNode/validateDownload.mjs +24 -0
  57. package/dist/esm/installNode/validateDownload.mjs.map +1 -0
  58. package/dist/esm/lib/checkMissing.mjs +1 -1
  59. package/dist/esm/lib/checkMissing.mjs.map +1 -1
  60. package/dist/esm/{lib → machine}/arch.cjs +1 -0
  61. package/dist/esm/machine/arch.cjs.map +1 -0
  62. package/dist/esm/{polyfills.cjs → machine/execSync/polyfill.cjs} +1 -1
  63. package/dist/esm/machine/execSync/polyfill.cjs.map +1 -0
  64. package/dist/esm/machine/execSync/worker.cjs.map +1 -0
  65. package/dist/esm/workers/install.mjs +2 -9
  66. package/dist/esm/workers/install.mjs.map +1 -1
  67. package/dist/types/constants.d.ts +26 -0
  68. package/dist/types/index.d.ts +0 -1
  69. package/dist/types/installNode/installCompressed.d.ts +1 -1
  70. package/dist/types/installNode/installExe.d.ts +1 -1
  71. package/dist/types/installNode/installFilename.d.ts +1 -0
  72. package/dist/types/installNode/installSource/buildPosix.d.ts +1 -1
  73. package/dist/types/installNode/installSource/index.d.ts +1 -1
  74. package/dist/types/installNode/validateDownload.d.ts +1 -0
  75. package/dist/types/lib/checkMissing.d.ts +10 -0
  76. package/package.json +6 -9
  77. package/dist/cjs/installNode/findDistPaths.cjs +0 -34
  78. package/dist/cjs/installNode/findDistPaths.cjs.map +0 -1
  79. package/dist/cjs/installNode/prebuilts.cjs +0 -53
  80. package/dist/cjs/installNode/prebuilts.cjs.map +0 -1
  81. package/dist/cjs/lib/arch.cjs.map +0 -1
  82. package/dist/cjs/lib/endsWithFn.cjs +0 -29
  83. package/dist/cjs/lib/endsWithFn.cjs.map +0 -1
  84. package/dist/cjs/polyfills/execCallback.cjs.map +0 -1
  85. package/dist/cjs/polyfills.cjs.map +0 -1
  86. package/dist/esm/installNode/findDistPaths.mjs +0 -18
  87. package/dist/esm/installNode/findDistPaths.mjs.map +0 -1
  88. package/dist/esm/installNode/prebuilts.mjs +0 -37
  89. package/dist/esm/installNode/prebuilts.mjs.map +0 -1
  90. package/dist/esm/lib/arch.cjs.map +0 -1
  91. package/dist/esm/lib/endsWithFn.mjs +0 -13
  92. package/dist/esm/lib/endsWithFn.mjs.map +0 -1
  93. package/dist/esm/polyfills/execCallback.cjs.map +0 -1
  94. package/dist/esm/polyfills.cjs.map +0 -1
  95. package/dist/types/installNode/findDistPaths.d.ts +0 -5
  96. package/dist/types/installNode/prebuilts.d.ts +0 -1
  97. package/dist/types/lib/endsWithFn.d.ts +0 -1
  98. /package/dist/cjs/{polyfills/execCallback.cjs → machine/execSync/worker.cjs} +0 -0
  99. /package/dist/esm/{polyfills/execCallback.cjs → machine/execSync/worker.cjs} +0 -0
  100. /package/dist/types/{lib → machine}/arch.d.cts +0 -0
  101. /package/dist/types/{polyfills.d.cts → machine/execSync/polyfill.d.cts} +0 -0
  102. /package/dist/types/{polyfills/execCallback.d.cts → machine/execSync/worker.d.cts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/findDistPaths.ts"],"sourcesContent":["import distPaths from 'node-filename-to-dist-paths';\nimport prebuilts from './prebuilts';\n\nexport default function findDistPaths(version, options) {\n const filenames = options.filename ? [options.filename] : prebuilts(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":["findDistPaths","version","options","filenames","filename","prebuilts","index","length","files","indexOf","relativePaths","distPaths"],"mappings":";;;;+BAGA;;;eAAwBA;;;8EAHF;gEACA;;;;;;AAEP,SAASA,cAAcC,OAAO,EAAEC,OAAO;IACpD,IAAMC,YAAYD,QAAQE,QAAQ,GAAG;QAACF,QAAQE,QAAQ;KAAC,GAAGC,IAAAA,kBAAS,EAACH;IACpE,IAAK,IAAII,QAAQ,GAAGA,QAAQH,UAAUI,MAAM,EAAED,QAAS;QACrD,IAAMF,WAAWD,SAAS,CAACG,MAAM;QACjC,IAAI,CAAC,CAACL,QAAQO,KAAK,CAACC,OAAO,CAACL,WAAW;QACvC,IAAMM,gBAAgBC,IAAAA,gCAAS,EAACP,UAAUH,QAAQA,OAAO;QACzD,IAAIS,iBAAiBA,cAAcH,MAAM,EAAE,OAAO;YAAEN,SAASA,QAAQA,OAAO;YAAEG,UAAUA;YAAUM,eAAeA;QAAc;IACjI;IACA,OAAO;AACT"}
@@ -1,53 +0,0 @@
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 prebuilts;
9
- }
10
- });
11
- var _archcjs = /*#__PURE__*/ _interop_require_default(require("../lib/arch.cjs"));
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- var PLATFORM_OS = {
18
- win32: 'win',
19
- darwin: 'osx'
20
- };
21
- var PLATFORM_FILES = {
22
- win32: [
23
- 'zip',
24
- 'exe'
25
- ],
26
- darwin: [
27
- 'tar'
28
- ]
29
- };
30
- var machineArch = null;
31
- function prebuilts(options) {
32
- if (!machineArch) machineArch = (0, _archcjs.default)();
33
- var platform = options.platform || process.platform;
34
- var os = PLATFORM_OS[platform] || platform;
35
- var archs = [];
36
- if (options.arch) archs.push(options.arch);
37
- archs.push(machineArch);
38
- if (os.arch) archs.push(os.arch());
39
- if (platform === 'darwin' && machineArch === 'arm64') archs.push('x64'); // fallback
40
- var files = PLATFORM_FILES[platform];
41
- var results = [];
42
- for(var i = 0; i < archs.length; i++){
43
- if (typeof files === 'undefined') {
44
- results.push("".concat(os, "-").concat(archs[i]));
45
- } else {
46
- for(var j = 0; j < files.length; j++){
47
- results.push("".concat(os, "-").concat(archs[i], "-").concat(files[j]));
48
- }
49
- }
50
- }
51
- return results;
52
- }
53
- /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/prebuilts.ts"],"sourcesContent":["import os from 'os';\nimport arch from '../lib/arch.cjs';\n\nconst PLATFORM_OS = {\n win32: 'win',\n darwin: 'osx',\n};\n\nconst PLATFORM_FILES = {\n win32: ['zip', 'exe'],\n darwin: ['tar'],\n};\nlet machineArch = null;\n\nexport default function prebuilts(options) {\n if (!machineArch) machineArch = arch();\n const platform = options.platform || process.platform;\n const os = PLATFORM_OS[platform] || platform;\n const archs = [];\n if (options.arch) archs.push(options.arch);\n archs.push(machineArch);\n if (os.arch) archs.push(os.arch());\n if (platform === 'darwin' && machineArch === '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":["prebuilts","PLATFORM_OS","win32","darwin","PLATFORM_FILES","machineArch","options","arch","platform","process","os","archs","push","files","results","i","length","j"],"mappings":";;;;+BAcA;;;eAAwBA;;;8DAbP;;;;;;AAEjB,IAAMC,cAAc;IAClBC,OAAO;IACPC,QAAQ;AACV;AAEA,IAAMC,iBAAiB;IACrBF,OAAO;QAAC;QAAO;KAAM;IACrBC,QAAQ;QAAC;KAAM;AACjB;AACA,IAAIE,cAAc;AAEH,SAASL,UAAUM,OAAO;IACvC,IAAI,CAACD,aAAaA,cAAcE,IAAAA,gBAAI;IACpC,IAAMC,WAAWF,QAAQE,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,IAAME,KAAKT,WAAW,CAACO,SAAS,IAAIA;IACpC,IAAMG,QAAQ,EAAE;IAChB,IAAIL,QAAQC,IAAI,EAAEI,MAAMC,IAAI,CAACN,QAAQC,IAAI;IACzCI,MAAMC,IAAI,CAACP;IACX,IAAIK,GAAGH,IAAI,EAAEI,MAAMC,IAAI,CAACF,GAAGH,IAAI;IAC/B,IAAIC,aAAa,YAAYH,gBAAgB,SAASM,MAAMC,IAAI,CAAC,QAAQ,WAAW;IAEpF,IAAMC,QAAQT,cAAc,CAACI,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"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/arch.cjs"],"sourcesContent":["// <<<<****************************>>>>\n// Inline until merged: https://github.com/jakejarvis/arch/blob/detect-arm/index.js\n// <<<<****************************>>>>\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// <<<<****************************>>>>\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n// <<<<****************************>>>>\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 // <<<<****************************>>>>\n if (isWindows) {\n // <<<<****************************>>>>\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 /**\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 /**\n * If none of the above, assume the architecture is 32-bit.\n */\n return 'x86';\n};\n"],"names":["cp","require","fs","path","isWindows","process","platform","test","env","OSTYPE","module","exports","arch","nativeArm","rosettaArm","execSync","encoding","useEnv","SYSTEMROOT","statSync","_err","sysRoot","isWOW64","join","output1","indexOf","output"],"mappings":"AAAA,uCAAuC;AACvC,mFAAmF;AACnF,uCAAuC;AAEvC,2EAA2E;AAC3E,IAAMA,KAAKC,QAAQ;AACnB,IAAMC,KAAKD,QAAQ;AACnB,IAAME,OAAOF,QAAQ;AAErB,uCAAuC;AACvC,IAAMG,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,uCAAuC;AAEvC;;;;CAIC,GACDC,OAAOC,OAAO,GAAG,SAASC;IACxB;;;;GAIC,GACD,IAAIP,QAAQC,QAAQ,KAAK,UAAU;QACjC,IAAMO,YAAYR,QAAQO,IAAI,KAAK;QACnC,IAAME,aAAad,GAAGe,QAAQ,CAAC,qCAAqC;YAAEC,UAAU;QAAO,OAAO;QAE9F,OAAOH,aAAaC,aAAa,UAAU;IAC7C;IAEA;;;;GAIC,GACD,uCAAuC;IACvC,IAAIV,WAAW;QACb,uCAAuC;QACvC,IAAIa,SAAS;QACb,IAAI;YACFA,SAAS,CAAC,CAAEZ,CAAAA,QAAQG,GAAG,CAACU,UAAU,IAAIhB,GAAGiB,QAAQ,CAACd,QAAQG,GAAG,CAACU,UAAU,CAAA;QAC1E,EAAE,OAAOE,MAAM,CAAC;QAEhB,IAAMC,UAAUJ,SAASZ,QAAQG,GAAG,CAACU,UAAU,GAAG;QAElD,iFAAiF;QACjF,IAAII,UAAU;QACd,IAAI;YACFA,UAAU,CAAC,CAACpB,GAAGiB,QAAQ,CAAChB,KAAKoB,IAAI,CAACF,SAAS;QAC7C,EAAE,OAAOD,MAAM,CAAC;QAEhB,OAAOE,UAAU,QAAQ;IAC3B;IAEA;;GAEC,GACD,IAAIjB,QAAQC,QAAQ,KAAK,SAAS;QAChC,IAAI;YACF,IAAMkB,UAAUxB,GAAGe,QAAQ,CAAC,YAAY;gBAAEC,UAAU;YAAO;YAC3D,IAAI,CAACQ,QAAQC,OAAO,CAAC,gBAAgB,OAAO;QAC9C,EAAE,OAAOL,MAAM,CAAC;QAEhB,IAAMM,SAAS1B,GAAGe,QAAQ,CAAC,oBAAoB;YAAEC,UAAU;QAAO;QAClE,OAAOU,WAAW,SAAS,QAAQ;IACrC;IAEA,uCAAuC;IACvC;;GAEC,GACD,IAAIrB,QAAQO,IAAI,KAAK,OAAO;QAC1B,OAAO;IACT;IACA,uCAAuC;IAEvC;;GAEC,GACD,OAAO;AACT"}
@@ -1,29 +0,0 @@
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 endsWithFn;
9
- }
10
- });
11
- var _endwith = /*#__PURE__*/ _interop_require_default(require("end-with"));
12
- var _isarray = /*#__PURE__*/ _interop_require_default(require("isarray"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function endsWithFn(endings) {
19
- if (!(0, _isarray.default)(endings)) endings = [
20
- endings
21
- ];
22
- return function(string) {
23
- for(var index = 0; index < endings.length; index++){
24
- if ((0, _endwith.default)(string, endings[index])) return true;
25
- }
26
- return false;
27
- };
28
- }
29
- /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/endsWithFn.ts"],"sourcesContent":["import endsWith from 'end-with';\nimport isArray from 'isarray';\n\nexport default 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":["endsWithFn","endings","isArray","string","index","length","endsWith"],"mappings":";;;;+BAGA;;;eAAwBA;;;8DAHH;8DACD;;;;;;AAEL,SAASA,WAAWC,OAAO;IACxC,IAAI,CAACC,IAAAA,gBAAO,EAACD,UAAUA,UAAU;QAACA;KAAQ;IAC1C,OAAO,SAACE;QACN,IAAK,IAAIC,QAAQ,GAAGA,QAAQH,QAAQI,MAAM,EAAED,QAAS;YACnD,IAAIE,IAAAA,gBAAQ,EAACH,QAAQF,OAAO,CAACG,MAAM,GAAG,OAAO;QAC/C;QACA,OAAO;IACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/polyfills/execCallback.cjs"],"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"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/polyfills.cjs"],"sourcesContent":["const cp = require('child_process');\nif (!cp.execSync) {\n const path = require('path');\n const execCallback = path.join(__dirname, 'polyfills', 'execCallback.cjs');\n\n let functionExec = null; // break dependencies\n cp.execSync = function execSyncPolyfill(cmd, options = {}) {\n if (!functionExec) functionExec = require('function-exec-sync');\n return functionExec({ callbacks: true }, execCallback, cmd, options);\n };\n}\n"],"names":["cp","require","execSync","path","execCallback","join","__dirname","functionExec","execSyncPolyfill","cmd","options","callbacks"],"mappings":";AAAA,IAAMA,KAAKC,QAAQ;AACnB,IAAI,CAACD,GAAGE,QAAQ,EAAE;IAChB,IAAMC,OAAOF,QAAQ;IACrB,IAAMG,eAAeD,KAAKE,IAAI,CAACC,WAAW,aAAa;IAEvD,IAAIC,eAAe,MAAM,qBAAqB;IAC9CP,GAAGE,QAAQ,GAAG,SAASM,iBAAiBC,GAAG;YAAEC,UAAAA,iEAAU,CAAC;QACtD,IAAI,CAACH,cAAcA,eAAeN,QAAQ;QAC1C,OAAOM,aAAa;YAAEI,WAAW;QAAK,GAAGP,cAAcK,KAAKC;IAC9D;AACF"}
@@ -1,18 +0,0 @@
1
- import distPaths from 'node-filename-to-dist-paths';
2
- import prebuilts from './prebuilts.mjs';
3
- export default function findDistPaths(version, options) {
4
- const filenames = options.filename ? [
5
- options.filename
6
- ] : prebuilts(options);
7
- for(let index = 0; index < filenames.length; index++){
8
- const filename = filenames[index];
9
- if (!~version.files.indexOf(filename)) continue;
10
- const relativePaths = distPaths(filename, version.version);
11
- if (relativePaths && relativePaths.length) return {
12
- version: version.version,
13
- filename: filename,
14
- relativePaths: relativePaths
15
- };
16
- }
17
- return null;
18
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/findDistPaths.ts"],"sourcesContent":["import distPaths from 'node-filename-to-dist-paths';\nimport prebuilts from './prebuilts';\n\nexport default function findDistPaths(version, options) {\n const filenames = options.filename ? [options.filename] : prebuilts(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","prebuilts","findDistPaths","version","options","filenames","filename","index","length","files","indexOf","relativePaths"],"mappings":"AAAA,OAAOA,eAAe,8BAA8B;AACpD,OAAOC,eAAe,cAAc;AAEpC,eAAe,SAASC,cAAcC,OAAO,EAAEC,OAAO;IACpD,MAAMC,YAAYD,QAAQE,QAAQ,GAAG;QAACF,QAAQE,QAAQ;KAAC,GAAGL,UAAUG;IACpE,IAAK,IAAIG,QAAQ,GAAGA,QAAQF,UAAUG,MAAM,EAAED,QAAS;QACrD,MAAMD,WAAWD,SAAS,CAACE,MAAM;QACjC,IAAI,CAAC,CAACJ,QAAQM,KAAK,CAACC,OAAO,CAACJ,WAAW;QACvC,MAAMK,gBAAgBX,UAAUM,UAAUH,QAAQA,OAAO;QACzD,IAAIQ,iBAAiBA,cAAcH,MAAM,EAAE,OAAO;YAAEL,SAASA,QAAQA,OAAO;YAAEG,UAAUA;YAAUK,eAAeA;QAAc;IACjI;IACA,OAAO;AACT"}
@@ -1,37 +0,0 @@
1
- import arch from '../lib/arch.cjs';
2
- const PLATFORM_OS = {
3
- win32: 'win',
4
- darwin: 'osx'
5
- };
6
- const PLATFORM_FILES = {
7
- win32: [
8
- 'zip',
9
- 'exe'
10
- ],
11
- darwin: [
12
- 'tar'
13
- ]
14
- };
15
- let machineArch = null;
16
- export default function prebuilts(options) {
17
- if (!machineArch) machineArch = arch();
18
- const platform = options.platform || process.platform;
19
- const os = PLATFORM_OS[platform] || platform;
20
- const archs = [];
21
- if (options.arch) archs.push(options.arch);
22
- archs.push(machineArch);
23
- if (os.arch) archs.push(os.arch());
24
- if (platform === 'darwin' && machineArch === 'arm64') archs.push('x64'); // fallback
25
- const files = PLATFORM_FILES[platform];
26
- const results = [];
27
- for(let i = 0; i < archs.length; i++){
28
- if (typeof files === 'undefined') {
29
- results.push(`${os}-${archs[i]}`);
30
- } else {
31
- for(let j = 0; j < files.length; j++){
32
- results.push(`${os}-${archs[i]}-${files[j]}`);
33
- }
34
- }
35
- }
36
- return results;
37
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/prebuilts.ts"],"sourcesContent":["import os from 'os';\nimport arch from '../lib/arch.cjs';\n\nconst PLATFORM_OS = {\n win32: 'win',\n darwin: 'osx',\n};\n\nconst PLATFORM_FILES = {\n win32: ['zip', 'exe'],\n darwin: ['tar'],\n};\nlet machineArch = null;\n\nexport default function prebuilts(options) {\n if (!machineArch) machineArch = arch();\n const platform = options.platform || process.platform;\n const os = PLATFORM_OS[platform] || platform;\n const archs = [];\n if (options.arch) archs.push(options.arch);\n archs.push(machineArch);\n if (os.arch) archs.push(os.arch());\n if (platform === 'darwin' && machineArch === '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":["arch","PLATFORM_OS","win32","darwin","PLATFORM_FILES","machineArch","prebuilts","options","platform","process","os","archs","push","files","results","i","length","j"],"mappings":"AACA,OAAOA,UAAU,kBAAkB;AAEnC,MAAMC,cAAc;IAClBC,OAAO;IACPC,QAAQ;AACV;AAEA,MAAMC,iBAAiB;IACrBF,OAAO;QAAC;QAAO;KAAM;IACrBC,QAAQ;QAAC;KAAM;AACjB;AACA,IAAIE,cAAc;AAElB,eAAe,SAASC,UAAUC,OAAO;IACvC,IAAI,CAACF,aAAaA,cAAcL;IAChC,MAAMQ,WAAWD,QAAQC,QAAQ,IAAIC,QAAQD,QAAQ;IACrD,MAAME,KAAKT,WAAW,CAACO,SAAS,IAAIA;IACpC,MAAMG,QAAQ,EAAE;IAChB,IAAIJ,QAAQP,IAAI,EAAEW,MAAMC,IAAI,CAACL,QAAQP,IAAI;IACzCW,MAAMC,IAAI,CAACP;IACX,IAAIK,GAAGV,IAAI,EAAEW,MAAMC,IAAI,CAACF,GAAGV,IAAI;IAC/B,IAAIQ,aAAa,YAAYH,gBAAgB,SAASM,MAAMC,IAAI,CAAC,QAAQ,WAAW;IAEpF,MAAMC,QAAQT,cAAc,CAACI,SAAS;IACtC,MAAMM,UAAU,EAAE;IAClB,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,MAAMK,MAAM,EAAED,IAAK;QACrC,IAAI,OAAOF,UAAU,aAAa;YAChCC,QAAQF,IAAI,CAAC,GAAGF,GAAG,CAAC,EAAEC,KAAK,CAACI,EAAE,EAAE;QAClC,OAAO;YACL,IAAK,IAAIE,IAAI,GAAGA,IAAIJ,MAAMG,MAAM,EAAEC,IAAK;gBACrCH,QAAQF,IAAI,CAAC,GAAGF,GAAG,CAAC,EAAEC,KAAK,CAACI,EAAE,CAAC,CAAC,EAAEF,KAAK,CAACI,EAAE,EAAE;YAC9C;QACF;IACF;IACA,OAAOH;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/arch.cjs"],"sourcesContent":["// <<<<****************************>>>>\n// Inline until merged: https://github.com/jakejarvis/arch/blob/detect-arm/index.js\n// <<<<****************************>>>>\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// <<<<****************************>>>>\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n// <<<<****************************>>>>\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 // <<<<****************************>>>>\n if (isWindows) {\n // <<<<****************************>>>>\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 /**\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 /**\n * If none of the above, assume the architecture is 32-bit.\n */\n return 'x86';\n};\n"],"names":["cp","require","fs","path","isWindows","process","platform","test","env","OSTYPE","module","exports","arch","nativeArm","rosettaArm","execSync","encoding","useEnv","SYSTEMROOT","statSync","_err","sysRoot","isWOW64","join","output1","indexOf","output"],"mappings":"AAAA,uCAAuC;AACvC,mFAAmF;AACnF,uCAAuC;AAEvC,2EAA2E,GAC3E,MAAMA,KAAKC,QAAQ;AACnB,MAAMC,KAAKD,QAAQ;AACnB,MAAME,OAAOF,QAAQ;AAErB,uCAAuC;AACvC,MAAMG,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,uCAAuC;AAEvC;;;;CAIC,GACDC,OAAOC,OAAO,GAAG,SAASC;IACxB;;;;GAIC,GACD,IAAIP,QAAQC,QAAQ,KAAK,UAAU;QACjC,MAAMO,YAAYR,QAAQO,IAAI,KAAK;QACnC,MAAME,aAAad,GAAGe,QAAQ,CAAC,qCAAqC;YAAEC,UAAU;QAAO,OAAO;QAE9F,OAAOH,aAAaC,aAAa,UAAU;IAC7C;IAEA;;;;GAIC,GACD,uCAAuC;IACvC,IAAIV,WAAW;QACb,uCAAuC;QACvC,IAAIa,SAAS;QACb,IAAI;YACFA,SAAS,CAAC,CAAEZ,CAAAA,QAAQG,GAAG,CAACU,UAAU,IAAIhB,GAAGiB,QAAQ,CAACd,QAAQG,GAAG,CAACU,UAAU,CAAA;QAC1E,EAAE,OAAOE,MAAM,CAAC;QAEhB,MAAMC,UAAUJ,SAASZ,QAAQG,GAAG,CAACU,UAAU,GAAG;QAElD,iFAAiF;QACjF,IAAII,UAAU;QACd,IAAI;YACFA,UAAU,CAAC,CAACpB,GAAGiB,QAAQ,CAAChB,KAAKoB,IAAI,CAACF,SAAS;QAC7C,EAAE,OAAOD,MAAM,CAAC;QAEhB,OAAOE,UAAU,QAAQ;IAC3B;IAEA;;GAEC,GACD,IAAIjB,QAAQC,QAAQ,KAAK,SAAS;QAChC,IAAI;YACF,MAAMkB,UAAUxB,GAAGe,QAAQ,CAAC,YAAY;gBAAEC,UAAU;YAAO;YAC3D,IAAI,CAACQ,QAAQC,OAAO,CAAC,gBAAgB,OAAO;QAC9C,EAAE,OAAOL,MAAM,CAAC;QAEhB,MAAMM,SAAS1B,GAAGe,QAAQ,CAAC,oBAAoB;YAAEC,UAAU;QAAO;QAClE,OAAOU,WAAW,SAAS,QAAQ;IACrC;IAEA,uCAAuC;IACvC;;GAEC,GACD,IAAIrB,QAAQO,IAAI,KAAK,OAAO;QAC1B,OAAO;IACT;IACA,uCAAuC;IAEvC;;GAEC,GACD,OAAO;AACT"}
@@ -1,13 +0,0 @@
1
- import endsWith from 'end-with';
2
- import isArray from 'isarray';
3
- export default function endsWithFn(endings) {
4
- if (!isArray(endings)) endings = [
5
- endings
6
- ];
7
- return (string)=>{
8
- for(let index = 0; index < endings.length; index++){
9
- if (endsWith(string, endings[index])) return true;
10
- }
11
- return false;
12
- };
13
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/endsWithFn.ts"],"sourcesContent":["import endsWith from 'end-with';\nimport isArray from 'isarray';\n\nexport default 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":["endsWith","isArray","endsWithFn","endings","string","index","length"],"mappings":"AAAA,OAAOA,cAAc,WAAW;AAChC,OAAOC,aAAa,UAAU;AAE9B,eAAe,SAASC,WAAWC,OAAO;IACxC,IAAI,CAACF,QAAQE,UAAUA,UAAU;QAACA;KAAQ;IAC1C,OAAO,CAACC;QACN,IAAK,IAAIC,QAAQ,GAAGA,QAAQF,QAAQG,MAAM,EAAED,QAAS;YACnD,IAAIL,SAASI,QAAQD,OAAO,CAACE,MAAM,GAAG,OAAO;QAC/C;QACA,OAAO;IACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/polyfills/execCallback.cjs"],"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,MAAMA,KAAKC,QAAQ;AAEnBC,OAAOC,OAAO,GAAG,SAASC,aAAaC,GAAG,EAAEC,OAAO,EAAEC,QAAQ;IAC3D,OAAOP,GAAGQ,IAAI,CAACH,KAAKC,SAASC;AAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/polyfills.cjs"],"sourcesContent":["const cp = require('child_process');\nif (!cp.execSync) {\n const path = require('path');\n const execCallback = path.join(__dirname, 'polyfills', 'execCallback.cjs');\n\n let functionExec = null; // break dependencies\n cp.execSync = function execSyncPolyfill(cmd, options = {}) {\n if (!functionExec) functionExec = require('function-exec-sync');\n return functionExec({ callbacks: true }, execCallback, cmd, options);\n };\n}\n"],"names":["cp","require","execSync","path","execCallback","join","__dirname","functionExec","execSyncPolyfill","cmd","options","callbacks"],"mappings":"AAAA,MAAMA,KAAKC,QAAQ;AACnB,IAAI,CAACD,GAAGE,QAAQ,EAAE;IAChB,MAAMC,OAAOF,QAAQ;IACrB,MAAMG,eAAeD,KAAKE,IAAI,CAACC,WAAW,aAAa;IAEvD,IAAIC,eAAe,MAAM,qBAAqB;IAC9CP,GAAGE,QAAQ,GAAG,SAASM,iBAAiBC,GAAG,EAAEC,UAAU,CAAC,CAAC;QACvD,IAAI,CAACH,cAAcA,eAAeN,QAAQ;QAC1C,OAAOM,aAAa;YAAEI,WAAW;QAAK,GAAGP,cAAcK,KAAKC;IAC9D;AACF"}
@@ -1,5 +0,0 @@
1
- export default function findDistPaths(version: any, options: any): {
2
- version: any;
3
- filename: any;
4
- relativePaths: any;
5
- };
@@ -1 +0,0 @@
1
- export default function prebuilts(options: any): any[];
@@ -1 +0,0 @@
1
- export default function endsWithFn(endings: any): (string: any) => boolean;
File without changes