node-install-release 0.4.7 → 1.0.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 (107) hide show
  1. package/bin/cli.js +3 -0
  2. package/dist/cjs/arch.js +67 -0
  3. package/dist/cjs/arch.js.map +1 -0
  4. package/dist/cjs/checkMissing.js +48 -0
  5. package/dist/cjs/checkMissing.js.map +1 -0
  6. package/dist/cjs/cli.js +69 -0
  7. package/dist/cjs/cli.js.map +1 -0
  8. package/dist/cjs/conditionalCache.js +34 -0
  9. package/dist/cjs/conditionalCache.js.map +1 -0
  10. package/dist/cjs/conditionalCopy.js +27 -0
  11. package/dist/cjs/conditionalCopy.js.map +1 -0
  12. package/dist/cjs/conditionalExtract.js +33 -0
  13. package/dist/cjs/conditionalExtract.js.map +1 -0
  14. package/dist/cjs/copyFile.js +30 -0
  15. package/dist/cjs/copyFile.js.map +1 -0
  16. package/dist/cjs/endsWithFn.js +20 -0
  17. package/dist/cjs/endsWithFn.js.map +1 -0
  18. package/dist/cjs/ensureDestinationParent.js +16 -0
  19. package/dist/cjs/ensureDestinationParent.js.map +1 -0
  20. package/dist/cjs/index.js +35 -0
  21. package/dist/cjs/index.js.map +1 -0
  22. package/dist/cjs/install.js +54 -0
  23. package/dist/cjs/install.js.map +1 -0
  24. package/dist/cjs/installNPM/index.js +15 -0
  25. package/dist/cjs/installNPM/index.js.map +1 -0
  26. package/dist/cjs/installNPM/installBin.js +55 -0
  27. package/dist/cjs/installNPM/installBin.js.map +1 -0
  28. package/dist/cjs/installNPM/installLib.js +40 -0
  29. package/dist/cjs/installNPM/installLib.js.map +1 -0
  30. package/dist/cjs/installNode/filenames.js +41 -0
  31. package/dist/cjs/installNode/filenames.js.map +1 -0
  32. package/dist/cjs/installNode/findDistPaths.js +25 -0
  33. package/dist/cjs/installNode/findDistPaths.js.map +1 -0
  34. package/dist/cjs/installNode/index.js +31 -0
  35. package/dist/cjs/installNode/index.js.map +1 -0
  36. package/dist/cjs/installNode/installCompressed.js +38 -0
  37. package/dist/cjs/installNode/installCompressed.js.map +1 -0
  38. package/dist/cjs/installNode/installExe.js +23 -0
  39. package/dist/cjs/installNode/installExe.js.map +1 -0
  40. package/dist/cjs/installNode/installSource/buildPosix.js +35 -0
  41. package/dist/cjs/installNode/installSource/buildPosix.js.map +1 -0
  42. package/dist/cjs/installNode/installSource/buildWin32.js +31 -0
  43. package/dist/cjs/installNode/installSource/buildWin32.js.map +1 -0
  44. package/dist/cjs/installNode/installSource/index.js +27 -0
  45. package/dist/cjs/installNode/installSource/index.js.map +1 -0
  46. package/dist/cjs/installVersion.js +27 -0
  47. package/dist/cjs/installVersion.js.map +1 -0
  48. package/dist/cjs/package.json +1 -0
  49. package/dist/cjs/polyfills/execCallback.js +11 -0
  50. package/dist/cjs/polyfills/execCallback.js.map +1 -0
  51. package/dist/cjs/polyfills/index.js +21 -0
  52. package/dist/cjs/polyfills/index.js.map +1 -0
  53. package/dist/cjs/progress.js +13 -0
  54. package/dist/cjs/progress.js.map +1 -0
  55. package/dist/types/arch.d.ts +2 -0
  56. package/dist/types/checkMissing.d.ts +2 -0
  57. package/dist/types/cli.d.ts +2 -0
  58. package/dist/types/conditionalCache.d.ts +2 -0
  59. package/dist/types/conditionalCopy.d.ts +2 -0
  60. package/dist/types/conditionalExtract.d.ts +2 -0
  61. package/dist/types/copyFile.d.ts +2 -0
  62. package/dist/types/endsWithFn.d.ts +2 -0
  63. package/dist/types/ensureDestinationParent.d.ts +2 -0
  64. package/dist/types/index.d.mts +1 -0
  65. package/dist/types/install.d.ts +2 -0
  66. package/dist/types/installNPM/index.d.ts +2 -0
  67. package/dist/types/installNPM/installBin.d.ts +2 -0
  68. package/dist/types/installNPM/installLib.d.ts +2 -0
  69. package/dist/types/installNode/filenames.d.ts +2 -0
  70. package/dist/types/installNode/findDistPaths.d.ts +6 -0
  71. package/dist/types/installNode/index.d.ts +2 -0
  72. package/dist/types/installNode/installCompressed.d.ts +2 -0
  73. package/dist/types/installNode/installExe.d.ts +2 -0
  74. package/dist/types/installNode/installSource/buildPosix.d.ts +2 -0
  75. package/dist/types/installNode/installSource/buildWin32.d.ts +2 -0
  76. package/dist/types/installNode/installSource/index.d.ts +2 -0
  77. package/dist/types/installVersion.d.ts +2 -0
  78. package/dist/types/polyfills/execCallback.d.ts +4 -0
  79. package/dist/types/polyfills/index.d.ts +1 -0
  80. package/dist/types/progress.d.ts +2 -0
  81. package/package.json +28 -25
  82. package/bin/node-install-release.js +0 -46
  83. package/lib/arch.js +0 -72
  84. package/lib/checkMissing.js +0 -36
  85. package/lib/conditionalCache.js +0 -28
  86. package/lib/conditionalCopy.js +0 -25
  87. package/lib/conditionalExtract.js +0 -27
  88. package/lib/copyFile.js +0 -28
  89. package/lib/endsWithFn.js +0 -12
  90. package/lib/ensureDestinationParent.js +0 -10
  91. package/lib/index.js +0 -19
  92. package/lib/install.js +0 -45
  93. package/lib/installNPM/index.js +0 -9
  94. package/lib/installNPM/installBin.js +0 -31
  95. package/lib/installNPM/installLib.js +0 -39
  96. package/lib/installNode/filenames.js +0 -31
  97. package/lib/installNode/findDistPaths.js +0 -13
  98. package/lib/installNode/index.js +0 -25
  99. package/lib/installNode/installCompressed.js +0 -31
  100. package/lib/installNode/installExe.js +0 -19
  101. package/lib/installNode/installSource/buildPosix.js +0 -21
  102. package/lib/installNode/installSource/buildWin32.js +0 -25
  103. package/lib/installNode/installSource/index.js +0 -21
  104. package/lib/installVersion.js +0 -24
  105. package/lib/polyfills/execCallback.js +0 -5
  106. package/lib/polyfills/index.js +0 -15
  107. package/lib/progress.js +0 -7
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var get = require("get-remote");
4
+ var conditionalCache = require("../conditionalCache");
5
+ var conditionalExtract = require("../conditionalExtract");
6
+ var NODE_DIST_URL = "https://nodejs.org/dist/index.json";
7
+ var NPM_DIST_TAGS_URL = "https://registry.npmjs.org/-/package/npm/dist-tags";
8
+ var NPM_DIST_URL = "https://registry.npmjs.org/npm";
9
+ var NPM_MIN_VERSION = 3;
10
+ module.exports = function installLib(version, dest, options, callback) {
11
+ var platform = options.platform || process.platform;
12
+ var libPath = platform === "win32" ? dest : path.join(dest, "lib");
13
+ var installPath = path.join(libPath, "node_modules", "npm");
14
+ get(NODE_DIST_URL).json(function(err, res1) {
15
+ if (err) return callback(err);
16
+ var releases = res1.body;
17
+ var found = releases.find(function(record) {
18
+ return record.version === version.version;
19
+ });
20
+ var npmMajorPair = found && found.npm ? +found.npm.split(".")[0] : NPM_MIN_VERSION;
21
+ var npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);
22
+ get(NPM_DIST_TAGS_URL).json(function(err, res2) {
23
+ if (err) return callback(err);
24
+ var distTags = res2.body;
25
+ var installVersion = distTags["latest-".concat(npmMajor)] || distTags["next-".concat(npmMajor)] || distTags.latest;
26
+ var downloadPath = "".concat(NPM_DIST_URL, "/-/npm-").concat(installVersion, ".tgz");
27
+ var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));
28
+ conditionalCache(downloadPath, cachePath, function(err) {
29
+ if (err) return callback(err);
30
+ conditionalExtract(cachePath, installPath, callback);
31
+ });
32
+ });
33
+ });
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var osArch = require("os").arch || require("../arch");
3
+ var PLATFORM_OS = {
4
+ win32: "win",
5
+ darwin: "osx"
6
+ };
7
+ var PLATFORM_FILES = {
8
+ win32: [
9
+ "zip",
10
+ "exe"
11
+ ],
12
+ darwin: [
13
+ "tar"
14
+ ]
15
+ };
16
+ module.exports = function prebuiltFilenames(options) {
17
+ var platform = options.platform || process.platform;
18
+ var os = PLATFORM_OS[platform] || platform;
19
+ var archs = [
20
+ options.arch || osArch()
21
+ ];
22
+ if (platform === "darwin" && archs[0] === "arm64") archs.push("x64"); // fallback
23
+ var files = PLATFORM_FILES[platform];
24
+ var results = [];
25
+ for(var i = 0; i < archs.length; i++){
26
+ if (typeof files === "undefined") {
27
+ results.push("".concat(os, "-").concat(archs[i]));
28
+ } else {
29
+ for(var j = 0; j < files.length; j++){
30
+ results.push("".concat(os, "-").concat(archs[i], "-").concat(files[j]));
31
+ }
32
+ }
33
+ }
34
+ return results;
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var distPaths = require("node-filename-to-dist-paths");
3
+ var prebuiltFilenames = require("./filenames");
4
+ module.exports = function findDistPaths(version, options) {
5
+ var filenames = options.filename ? [
6
+ options.filename
7
+ ] : prebuiltFilenames(options);
8
+ for(var index = 0; index < filenames.length; index++){
9
+ var filename = filenames[index];
10
+ if (!~version.files.indexOf(filename)) continue;
11
+ var relativePaths = distPaths(filename, version.version);
12
+ if (relativePaths && relativePaths.length) return {
13
+ version: version.version,
14
+ filename: filename,
15
+ relativePaths: relativePaths
16
+ };
17
+ }
18
+ return null;
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var find = require("lodash.find");
3
+ var endsWithFn = require("../endsWithFn");
4
+ var findDistPaths = require("./findDistPaths");
5
+ var installCompressed = require("./installCompressed");
6
+ var installExe = require("./installExe");
7
+ var installSource = require("./installSource");
8
+ module.exports = function install(version, dest, options, callback) {
9
+ var record = findDistPaths(version, options);
10
+ if (record) {
11
+ if (record.filename === "src") return installSource(record.relativePaths[0], dest, record, options, callback);
12
+ var relativePath = find(record.relativePaths, endsWithFn([
13
+ ".tar.gz",
14
+ ".zip"
15
+ ]));
16
+ if (relativePath) return installCompressed(relativePath, dest, record, options, callback);
17
+ relativePath = find(record.relativePaths, endsWithFn(".exe"));
18
+ if (relativePath) return installExe(relativePath, dest, record, options, callback);
19
+ }
20
+ record = findDistPaths(version, {
21
+ filename: "src"
22
+ });
23
+ if (record && record.relativePaths.length) return installSource(record.relativePaths[0], dest, record, options, callback);
24
+ callback(new Error("Unable to install ".concat(version)));
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var access = require("fs-access-compat");
4
+ var rimraf = require("rimraf");
5
+ var conditionalCache = require("../conditionalCache");
6
+ var conditionalExtract = require("../conditionalExtract");
7
+ var progress = require("../progress");
8
+ module.exports = function installCompressed(relativePath, dest, _record, options, callback) {
9
+ var downloadPath = options.downloadURL(relativePath);
10
+ var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));
11
+ conditionalCache(downloadPath, cachePath, function(err) {
12
+ if (err) return callback(err);
13
+ access(dest, function(err) {
14
+ if (!err) return callback(); // already exists
15
+ conditionalExtract(cachePath, dest, Object.assign({
16
+ strip: 1,
17
+ progress: progress,
18
+ time: 1000
19
+ }, options), function(err) {
20
+ console.log("");
21
+ if (err) return callback(err);
22
+ // some compressed versions of node come with npm pre-installed, but we want to override with a specific version
23
+ var platform = options.platform || process.platform;
24
+ var libPath = platform === "win32" ? dest : path.join(dest, "lib");
25
+ var installPath = path.join(libPath, "node_modules", "npm");
26
+ rimraf(installPath, function() {
27
+ callback(err);
28
+ });
29
+ });
30
+ });
31
+ });
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var access = require("fs-access-compat");
4
+ var conditionalCache = require("../conditionalCache");
5
+ var copyFile = require("../copyFile");
6
+ module.exports = function installExe(relativePath, dest, record, options, callback) {
7
+ var downloadPath = options.downloadURL(relativePath);
8
+ var cachePath = path.join(options.cacheDirectory, "node-".concat(record.version, ".exe"));
9
+ var destPath = path.join(dest, path.basename(relativePath));
10
+ access(destPath, function(err) {
11
+ if (!err) return callback(); // already exists
12
+ conditionalCache(downloadPath, cachePath, function(err) {
13
+ if (err) return callback(err);
14
+ copyFile(cachePath, destPath, callback);
15
+ });
16
+ });
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var spawn = require("cross-spawn-cb");
4
+ var Queue = require("queue-cb");
5
+ var access = require("fs-access-compat");
6
+ module.exports = function installDefault(buildPath, dest, _options, callback) {
7
+ var buildTarget = path.join(dest, "node");
8
+ access(buildTarget, function(err) {
9
+ if (!err) return callback(); // already exists
10
+ var queue = new Queue(1);
11
+ queue.defer(function(callback) {
12
+ spawn("./configure", [
13
+ "--prefix=".concat(dest)
14
+ ], {
15
+ stdio: "inherit",
16
+ cwd: buildPath
17
+ }, callback);
18
+ });
19
+ queue.defer(function(callback) {
20
+ spawn("make", [
21
+ "install"
22
+ ], {
23
+ stdio: "inherit",
24
+ cwd: buildPath
25
+ }, callback);
26
+ });
27
+ queue.await(callback);
28
+ });
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var spawn = require("cross-spawn-cb");
4
+ var Queue = require("queue-cb");
5
+ var access = require("fs-access-compat");
6
+ var conditionalCopy = require("../../conditionalCopy");
7
+ module.exports = function installWin32(buildPath, dest, _options, callback) {
8
+ var buildSource = path.join(buildPath, "out", "Release", "node.exe");
9
+ var buildTarget = path.join(dest, "node.exe");
10
+ access(buildTarget, function(err) {
11
+ if (!err) return callback(); // already exists
12
+ var queue = new Queue(1);
13
+ queue.defer(function(callback) {
14
+ access(buildSource, function(err) {
15
+ if (!err) return callback(); // already exists
16
+ spawn("./vcbuild", [], {
17
+ stdio: "inherit",
18
+ cwd: buildPath
19
+ }, callback);
20
+ });
21
+ });
22
+ queue.defer(conditionalCopy.bind(null, buildSource, buildTarget));
23
+ queue.await(callback);
24
+ });
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var Queue = require("queue-cb");
4
+ var conditionalCache = require("../../conditionalCache");
5
+ var conditionalExtract = require("../../conditionalExtract");
6
+ var buildPosix = require("./buildPosix");
7
+ var buildWin32 = require("./buildWin32");
8
+ module.exports = function InstallSource(relativePath, dest, _record, options, callback) {
9
+ var platform = options.platform || process.platform;
10
+ var build = platform === "win32" ? buildWin32 : buildPosix;
11
+ var downloadPath = options.downloadURL(relativePath);
12
+ var buildPath = path.join(options.buildDirectory, path.basename(relativePath));
13
+ var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));
14
+ var queue = new Queue(1);
15
+ queue.defer(conditionalCache.bind(null, downloadPath, cachePath));
16
+ queue.defer(conditionalExtract.bind(null, cachePath, buildPath, {
17
+ strip: 1
18
+ }));
19
+ queue.defer(build.bind(null, buildPath, dest, options));
20
+ queue.await(callback);
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var path = require("path");
3
+ var Queue = require("queue-cb");
4
+ var installNode = require("./installNode");
5
+ var installNPM = require("./installNPM");
6
+ var checkMissing = require("./checkMissing");
7
+ var ensureDestinationParent = require("./ensureDestinationParent");
8
+ module.exports = function install(version, dest, options, callback) {
9
+ // use cwd if dest not provided
10
+ if (!dest) dest = path.join(process.cwd(), version.version);
11
+ checkMissing(dest, options, function(err, missing) {
12
+ if (err || !missing.length) return callback(err, dest);
13
+ var queue = new Queue(1);
14
+ queue.defer(ensureDestinationParent.bind(null, dest));
15
+ !~missing.indexOf("node") || queue.defer(installNode.bind(null, version, dest, options));
16
+ !~missing.indexOf("npm") || queue.defer(installNPM.bind(null, version, dest, options));
17
+ queue.await(function(err) {
18
+ err ? callback(err) : callback(null, dest);
19
+ });
20
+ });
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var cp = require("child_process");
3
+ module.exports = function execCallback(cmd, options, callback) {
4
+ return cp.exec(cmd, options, callback);
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ require("core-js/actual/object/assign");
3
+ require("core-js/actual/promise");
4
+ var cp = require("child_process");
5
+ if (!cp.execSync) {
6
+ var path = require("path");
7
+ var execCallback = path.join(__dirname, "execCallback.js");
8
+ var functionExec = null; // break dependencies
9
+ cp.execSync = function execSyncPolyfill(cmd, options) {
10
+ if (!functionExec) functionExec = require("function-exec-sync");
11
+ return functionExec({
12
+ callbacks: true
13
+ }, execCallback, cmd, options || {});
14
+ };
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
+ }
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var log = require("single-line-log2").stdout;
3
+ module.exports = function progress(entry) {
4
+ var message = "".concat(entry.progress, " ").concat(entry.basename);
5
+ if (entry.percentage) message += " - ".concat(entry.percentage.toFixed(0), "%");
6
+ log(message);
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
+ }
@@ -0,0 +1 @@
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 _exports(): "arm64" | "x64" | "x86" | "arm-pi";
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _default(argv: any): any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare function _exports(endpoint: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(src: any, dest: any, optional: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(src: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(src: any, dest: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(endings: any): (string: any) => boolean;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(dest: any, callback: any): any;
2
+ export = _exports;
@@ -0,0 +1 @@
1
+ export default function installRelease(versionDetails: any, dest: any, options: any, callback: any): void | Promise<any>;
@@ -0,0 +1,2 @@
1
+ declare function _exports(versionDetails: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(version: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(_version: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(version: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(options: any): string[];
2
+ export = _exports;
@@ -0,0 +1,6 @@
1
+ declare function _exports(version: any, options: any): {
2
+ version: any;
3
+ filename: any;
4
+ relativePaths: any;
5
+ };
6
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(version: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(relativePath: any, dest: any, _record: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(relativePath: any, dest: any, record: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(buildPath: any, dest: any, _options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(buildPath: any, dest: any, _options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(relativePath: any, dest: any, _record: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(version: any, dest: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ declare function _exports(cmd: any, options: any, callback: any): cp.ChildProcess;
3
+ export = _exports;
4
+ import cp = require("child_process");
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare function _exports(entry: any): void;
2
+ export = _exports;