node-install-release 1.14.7 → 1.14.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constants.d.cts +3 -3
- package/dist/cjs/constants.d.ts +3 -3
- package/dist/cjs/createResult.d.cts +1 -1
- package/dist/cjs/createResult.d.ts +1 -1
- package/dist/cjs/createStoragePaths.d.cts +1 -1
- package/dist/cjs/createStoragePaths.d.ts +1 -1
- package/dist/cjs/files.d.cts +1 -1
- package/dist/cjs/files.d.ts +1 -1
- package/dist/cjs/index.d.cts +4 -4
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/installNPM/index.d.cts +1 -1
- package/dist/cjs/installNPM/index.d.ts +1 -1
- package/dist/cjs/installNPM/installBin.d.cts +1 -1
- package/dist/cjs/installNPM/installBin.d.ts +1 -1
- package/dist/cjs/installNPM/installBin.js +1 -1
- package/dist/cjs/installNPM/installBin.js.map +1 -1
- package/dist/cjs/installNPM/installLib.d.cts +1 -1
- package/dist/cjs/installNPM/installLib.d.ts +1 -1
- package/dist/cjs/installNode/index.d.cts +1 -1
- package/dist/cjs/installNode/index.d.ts +1 -1
- package/dist/cjs/installNode/index.js +1 -1
- package/dist/cjs/installNode/index.js.map +1 -1
- package/dist/cjs/installNode/installCompressed.d.cts +1 -1
- package/dist/cjs/installNode/installCompressed.d.ts +1 -1
- package/dist/cjs/installNode/installExe.d.cts +1 -1
- package/dist/cjs/installNode/installExe.d.ts +1 -1
- package/dist/cjs/installNode/installFilename.d.cts +1 -1
- package/dist/cjs/installNode/installFilename.d.ts +1 -1
- package/dist/cjs/installNode/installSource/buildPosix.d.cts +1 -1
- package/dist/cjs/installNode/installSource/buildPosix.d.ts +1 -1
- package/dist/cjs/installNode/installSource/buildWin32.d.cts +1 -1
- package/dist/cjs/installNode/installSource/buildWin32.d.ts +1 -1
- package/dist/cjs/installNode/installSource/index.d.cts +1 -1
- package/dist/cjs/installNode/installSource/index.d.ts +1 -1
- package/dist/cjs/installNode/validateDownload.d.cts +1 -1
- package/dist/cjs/installNode/validateDownload.d.ts +1 -1
- package/dist/cjs/lib/checkMissing.d.cts +1 -1
- package/dist/cjs/lib/checkMissing.d.ts +1 -1
- package/dist/cjs/lib/conditionalCache.d.cts +1 -1
- package/dist/cjs/lib/conditionalCache.d.ts +1 -1
- package/dist/cjs/lib/conditionalCopy.d.cts +1 -1
- package/dist/cjs/lib/conditionalCopy.d.ts +1 -1
- package/dist/cjs/lib/conditionalExtract.d.cts +1 -1
- package/dist/cjs/lib/conditionalExtract.d.ts +1 -1
- package/dist/cjs/lib/ensureDestinationParent.d.cts +1 -1
- package/dist/cjs/lib/ensureDestinationParent.d.ts +1 -1
- package/dist/cjs/lib/getTarget.d.cts +1 -1
- package/dist/cjs/lib/getTarget.d.ts +1 -1
- package/dist/cjs/workers/install.d.cts +1 -1
- package/dist/cjs/workers/install.d.ts +1 -1
- package/dist/esm/constants.d.ts +3 -3
- package/dist/esm/createResult.d.ts +1 -1
- package/dist/esm/createStoragePaths.d.ts +1 -1
- package/dist/esm/files.d.ts +1 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/installNPM/index.d.ts +1 -1
- package/dist/esm/installNPM/installBin.d.ts +1 -1
- package/dist/esm/installNPM/installBin.js +3 -1
- package/dist/esm/installNPM/installBin.js.map +1 -1
- package/dist/esm/installNPM/installLib.d.ts +1 -1
- package/dist/esm/installNode/index.d.ts +1 -1
- package/dist/esm/installNode/index.js +3 -1
- package/dist/esm/installNode/index.js.map +1 -1
- package/dist/esm/installNode/installCompressed.d.ts +1 -1
- package/dist/esm/installNode/installExe.d.ts +1 -1
- package/dist/esm/installNode/installFilename.d.ts +1 -1
- package/dist/esm/installNode/installSource/buildPosix.d.ts +1 -1
- package/dist/esm/installNode/installSource/buildWin32.d.ts +1 -1
- package/dist/esm/installNode/installSource/index.d.ts +1 -1
- package/dist/esm/installNode/validateDownload.d.ts +1 -1
- package/dist/esm/lib/checkMissing.d.ts +1 -1
- package/dist/esm/lib/conditionalCache.d.ts +1 -1
- package/dist/esm/lib/conditionalCopy.d.ts +1 -1
- package/dist/esm/lib/conditionalExtract.d.ts +1 -1
- package/dist/esm/lib/ensureDestinationParent.d.ts +1 -1
- package/dist/esm/lib/getTarget.d.ts +1 -1
- package/dist/esm/workers/install.d.ts +1 -1
- package/package.json +17 -17
package/dist/cjs/constants.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { FilePath } from './types.
|
|
2
|
-
export declare const FILES: Record<string, import("./types.
|
|
1
|
+
import type { FilePath } from './types.js';
|
|
2
|
+
export declare const FILES: Record<string, import("./types.js").File[]>;
|
|
3
3
|
export declare const DEFAULT_STORAGE_PATH: string;
|
|
4
|
-
export declare const DEFAULT_STORAGE_PATHS: import("./types.
|
|
4
|
+
export declare const DEFAULT_STORAGE_PATHS: import("./types.js").StorageLocations;
|
|
5
5
|
export declare const FILE_PLATFORMS: string[];
|
|
6
6
|
export declare const FILE_PLATFORM_MAP: {
|
|
7
7
|
win: string;
|
package/dist/cjs/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { FilePath } from './types.
|
|
2
|
-
export declare const FILES: Record<string, import("./types.
|
|
1
|
+
import type { FilePath } from './types.js';
|
|
2
|
+
export declare const FILES: Record<string, import("./types.js").File[]>;
|
|
3
3
|
export declare const DEFAULT_STORAGE_PATH: string;
|
|
4
|
-
export declare const DEFAULT_STORAGE_PATHS: import("./types.
|
|
4
|
+
export declare const DEFAULT_STORAGE_PATHS: import("./types.js").StorageLocations;
|
|
5
5
|
export declare const FILE_PLATFORMS: string[];
|
|
6
6
|
export declare const FILE_PLATFORM_MAP: {
|
|
7
7
|
win: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, InstallResult } from './types.
|
|
1
|
+
import type { InstallOptions, InstallResult } from './types.js';
|
|
2
2
|
export default function createResult(options: InstallOptions, version: string): InstallResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, InstallResult } from './types.
|
|
1
|
+
import type { InstallOptions, InstallResult } from './types.js';
|
|
2
2
|
export default function createResult(options: InstallOptions, version: string): InstallResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StorageLocations } from './types.
|
|
1
|
+
import type { StorageLocations } from './types.js';
|
|
2
2
|
export default function createStoragePaths(storagePath: string): StorageLocations;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StorageLocations } from './types.
|
|
1
|
+
import type { StorageLocations } from './types.js';
|
|
2
2
|
export default function createStoragePaths(storagePath: string): StorageLocations;
|
package/dist/cjs/files.d.cts
CHANGED
package/dist/cjs/files.d.ts
CHANGED
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { InstallCallback, InstallOptions, InstallResult } from './types.
|
|
2
|
-
export type * from './types.
|
|
1
|
+
import type { InstallCallback, InstallOptions, InstallResult } from './types.js';
|
|
2
|
+
export type * from './types.js';
|
|
3
3
|
export default function install(versionExpression: string): Promise<InstallResult>;
|
|
4
4
|
export default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;
|
|
5
5
|
export default function install(versionExpression: string, callback: InstallCallback): undefined;
|
|
6
6
|
export default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined;
|
|
7
|
-
export { default as createResult } from './createResult.
|
|
8
|
-
export { default as createStoragePaths } from './createStoragePaths.
|
|
7
|
+
export { default as createResult } from './createResult.js';
|
|
8
|
+
export { default as createStoragePaths } from './createStoragePaths.js';
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { InstallCallback, InstallOptions, InstallResult } from './types.
|
|
2
|
-
export type * from './types.
|
|
1
|
+
import type { InstallCallback, InstallOptions, InstallResult } from './types.js';
|
|
2
|
+
export type * from './types.js';
|
|
3
3
|
export default function install(versionExpression: string): Promise<InstallResult>;
|
|
4
4
|
export default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;
|
|
5
5
|
export default function install(versionExpression: string, callback: InstallCallback): undefined;
|
|
6
6
|
export default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined;
|
|
7
|
-
export { default as createResult } from './createResult.
|
|
8
|
-
export { default as createStoragePaths } from './createStoragePaths.
|
|
7
|
+
export { default as createResult } from './createResult.js';
|
|
8
|
+
export { default as createStoragePaths } from './createStoragePaths.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void;
|
|
@@ -22,7 +22,7 @@ function installBin(_version, dest, options, callback) {
|
|
|
22
22
|
var files = _constantsts.NPM_FILE_PATHS[platform] || _constantsts.NPM_FILE_PATHS.posix;
|
|
23
23
|
var queue = new _queuecb.default();
|
|
24
24
|
files.forEach(function(file) {
|
|
25
|
-
|
|
25
|
+
queue.defer(_conditionalCopyts.default.bind(null, _path.default.join(dest, file.src), _path.default.join(dest, file.dest), file.optional));
|
|
26
26
|
});
|
|
27
27
|
queue.await(callback);
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installBin.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_FILE_PATHS } from '../constants.ts';\nimport conditionalCopy from '../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\n\nexport default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback) {\n const platform = options.platform;\n const files = NPM_FILE_PATHS[platform] || NPM_FILE_PATHS.posix;\n\n const queue = new Queue();\n files.forEach((file) => queue.defer(conditionalCopy.bind(null, path.join(dest, file.src), path.join(dest, file.dest), file.optional)));\n queue.await(callback);\n}\n"],"names":["installBin","_version","dest","options","callback","platform","files","NPM_FILE_PATHS","posix","queue","Queue","forEach","file","defer","conditionalCopy","bind","path","join","src","optional","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;8DACC;2BACa;wEACH;;;;;;AAIb,SAASA,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,QAAQC,2BAAc,CAACF,SAAS,IAAIE,2BAAc,CAACC,KAAK;IAE9D,IAAMC,QAAQ,IAAIC,gBAAK;IACvBJ,MAAMK,OAAO,CAAC,SAACC;
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installBin.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_FILE_PATHS } from '../constants.ts';\nimport conditionalCopy from '../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\n\nexport default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback) {\n const platform = options.platform;\n const files = NPM_FILE_PATHS[platform] || NPM_FILE_PATHS.posix;\n\n const queue = new Queue();\n files.forEach((file) => {\n queue.defer(conditionalCopy.bind(null, path.join(dest, file.src), path.join(dest, file.dest), file.optional));\n });\n queue.await(callback);\n}\n"],"names":["installBin","_version","dest","options","callback","platform","files","NPM_FILE_PATHS","posix","queue","Queue","forEach","file","defer","conditionalCopy","bind","path","join","src","optional","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;8DACC;2BACa;wEACH;;;;;;AAIb,SAASA,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,QAAQC,2BAAc,CAACF,SAAS,IAAIE,2BAAc,CAACC,KAAK;IAE9D,IAAMC,QAAQ,IAAIC,gBAAK;IACvBJ,MAAMK,OAAO,CAAC,SAACC;QACbH,MAAMI,KAAK,CAACC,0BAAe,CAACC,IAAI,CAAC,MAAMC,aAAI,CAACC,IAAI,CAACf,MAAMU,KAAKM,GAAG,GAAGF,aAAI,CAACC,IAAI,CAACf,MAAMU,KAAKV,IAAI,GAAGU,KAAKO,QAAQ;IAC7G;IACAV,MAAMW,KAAK,CAAChB;AACd"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InstallOptions } from '../types.
|
|
1
|
+
import type { InstallOptions } from '../types.js';
|
|
2
2
|
export type Callback = (error?: Error, npmVersion?: string) => undefined;
|
|
3
3
|
export default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InstallOptions } from '../types.
|
|
1
|
+
import type { InstallOptions } from '../types.js';
|
|
2
2
|
export type Callback = (error?: Error, npmVersion?: string) => undefined;
|
|
3
3
|
export default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -42,7 +42,7 @@ function install(version, dest, options, callback) {
|
|
|
42
42
|
].concat(parts.slice(2)).join('-');
|
|
43
43
|
});
|
|
44
44
|
(_constantsts.FILES[filePlatform] || []).forEach(function(x) {
|
|
45
|
-
|
|
45
|
+
filenames.push(x.filename);
|
|
46
46
|
});
|
|
47
47
|
filenames.push('src');
|
|
48
48
|
filenames = filenames.filter(function(filename, i) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/index.ts"],"sourcesContent":["import { FILE_PLATFORM_MAP, FILES } from '../constants.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined {\n let filenames = null;\n\n // a specific filename\n if (options.filename) filenames = [options.filename];\n // infer with fallbacks\n else {\n const { platform, arch } = options;\n const filePlatform = FILE_PLATFORM_MAP[platform] || platform;\n const parts = [filePlatform, arch];\n if (options.type) parts.push(options.type);\n if (options.compression) parts.push(options.compression);\n\n // generate the files in search order\n const archs = [arch, process.arch];\n filenames = archs.map((a) => [filePlatform, a].concat(parts.slice(2)).join('-'));\n (FILES[filePlatform] || []).forEach((x) => filenames.push(x.filename));\n filenames.push('src');\n filenames = filenames.filter((filename, i) => filenames.indexOf(filename) === i);\n }\n\n const tryNext = (cb) => {\n if (filenames.length === 0) return cb(new Error(`Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`));\n installFilename(filenames.shift(), version, dest, options, (err) => (err ? tryNext(cb) : cb()));\n };\n tryNext((err) => {\n console.log(`node ${version.slice(1)} ${!err ? 'installed' : `install failed. Error: ${err.message}`}`);\n callback(err);\n });\n}\n"],"names":["install","version","dest","options","callback","filenames","filename","platform","arch","filePlatform","FILE_PLATFORM_MAP","parts","type","push","compression","archs","process","map","a","concat","slice","join","FILES","forEach","x","filter","i","indexOf","tryNext","cb","length","Error","installFilename","shift","err","console","log","message"],"mappings":";;;;+BAIA;;;eAAwBA;;;2BAJiB;wEAEb;;;;;;AAEb,SAASA,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,YAAY;IAEhB,sBAAsB;IACtB,IAAIF,QAAQG,QAAQ,EAAED,YAAY;QAACF,QAAQG,QAAQ;KAAC;SAE/C;QACH,IAAQC,WAAmBJ,QAAnBI,UAAUC,OAASL,QAATK;QAClB,IAAMC,eAAeC,8BAAiB,CAACH,SAAS,IAAIA;QACpD,IAAMI,QAAQ;YAACF;YAAcD;SAAK;QAClC,IAAIL,QAAQS,IAAI,EAAED,MAAME,IAAI,CAACV,QAAQS,IAAI;QACzC,IAAIT,QAAQW,WAAW,EAAEH,MAAME,IAAI,CAACV,QAAQW,WAAW;QAEvD,qCAAqC;QACrC,IAAMC,QAAQ;YAACP;YAAMQ,QAAQR,IAAI;SAAC;QAClCH,YAAYU,MAAME,GAAG,CAAC,SAACC;mBAAM;gBAACT;gBAAcS;aAAE,CAACC,MAAM,CAACR,MAAMS,KAAK,CAAC,IAAIC,IAAI,CAAC;;QAC1EC,CAAAA,kBAAK,CAACb,aAAa,IAAI,EAAE,AAAD,EAAGc,OAAO,CAAC,SAACC;
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/index.ts"],"sourcesContent":["import { FILE_PLATFORM_MAP, FILES } from '../constants.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined {\n let filenames = null;\n\n // a specific filename\n if (options.filename) filenames = [options.filename];\n // infer with fallbacks\n else {\n const { platform, arch } = options;\n const filePlatform = FILE_PLATFORM_MAP[platform] || platform;\n const parts = [filePlatform, arch];\n if (options.type) parts.push(options.type);\n if (options.compression) parts.push(options.compression);\n\n // generate the files in search order\n const archs = [arch, process.arch];\n filenames = archs.map((a) => [filePlatform, a].concat(parts.slice(2)).join('-'));\n (FILES[filePlatform] || []).forEach((x) => {\n filenames.push(x.filename);\n });\n filenames.push('src');\n filenames = filenames.filter((filename, i) => filenames.indexOf(filename) === i);\n }\n\n const tryNext = (cb) => {\n if (filenames.length === 0) return cb(new Error(`Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`));\n installFilename(filenames.shift(), version, dest, options, (err) => (err ? tryNext(cb) : cb()));\n };\n tryNext((err) => {\n console.log(`node ${version.slice(1)} ${!err ? 'installed' : `install failed. Error: ${err.message}`}`);\n callback(err);\n });\n}\n"],"names":["install","version","dest","options","callback","filenames","filename","platform","arch","filePlatform","FILE_PLATFORM_MAP","parts","type","push","compression","archs","process","map","a","concat","slice","join","FILES","forEach","x","filter","i","indexOf","tryNext","cb","length","Error","installFilename","shift","err","console","log","message"],"mappings":";;;;+BAIA;;;eAAwBA;;;2BAJiB;wEAEb;;;;;;AAEb,SAASA,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,YAAY;IAEhB,sBAAsB;IACtB,IAAIF,QAAQG,QAAQ,EAAED,YAAY;QAACF,QAAQG,QAAQ;KAAC;SAE/C;QACH,IAAQC,WAAmBJ,QAAnBI,UAAUC,OAASL,QAATK;QAClB,IAAMC,eAAeC,8BAAiB,CAACH,SAAS,IAAIA;QACpD,IAAMI,QAAQ;YAACF;YAAcD;SAAK;QAClC,IAAIL,QAAQS,IAAI,EAAED,MAAME,IAAI,CAACV,QAAQS,IAAI;QACzC,IAAIT,QAAQW,WAAW,EAAEH,MAAME,IAAI,CAACV,QAAQW,WAAW;QAEvD,qCAAqC;QACrC,IAAMC,QAAQ;YAACP;YAAMQ,QAAQR,IAAI;SAAC;QAClCH,YAAYU,MAAME,GAAG,CAAC,SAACC;mBAAM;gBAACT;gBAAcS;aAAE,CAACC,MAAM,CAACR,MAAMS,KAAK,CAAC,IAAIC,IAAI,CAAC;;QAC1EC,CAAAA,kBAAK,CAACb,aAAa,IAAI,EAAE,AAAD,EAAGc,OAAO,CAAC,SAACC;YACnCnB,UAAUQ,IAAI,CAACW,EAAElB,QAAQ;QAC3B;QACAD,UAAUQ,IAAI,CAAC;QACfR,YAAYA,UAAUoB,MAAM,CAAC,SAACnB,UAAUoB;mBAAMrB,UAAUsB,OAAO,CAACrB,cAAcoB;;IAChF;IAEA,IAAME,UAAU,SAACC;QACf,IAAIxB,UAAUyB,MAAM,KAAK,GAAG,OAAOD,GAAG,IAAIE,MAAM,AAAC,kCAA2C5B,OAAVF,SAAmE,OAAzDE,QAAQG,QAAQ,GAAG,AAAC,cAA8B,OAAjBH,QAAQG,QAAQ,IAAK;QAClJ0B,IAAAA,0BAAe,EAAC3B,UAAU4B,KAAK,IAAIhC,SAASC,MAAMC,SAAS,SAAC+B;mBAASA,MAAMN,QAAQC,MAAMA;;IAC3F;IACAD,QAAQ,SAACM;QACPC,QAAQC,GAAG,CAAC,AAAC,QAA2B,OAApBnC,QAAQmB,KAAK,CAAC,IAAG,KAAgE,OAA7D,CAACc,MAAM,cAAc,AAAC,0BAAqC,OAAZA,IAAIG,OAAO;QAClGjC,SAAS8B;IACX;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function validateDownload(distPath: string, installPath: string, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function validateDownload(distPath: string, installPath: string, callback: NoParamCallback): undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InstallOptions } from '../types.
|
|
1
|
+
import type { InstallOptions } from '../types.js';
|
|
2
2
|
export type Callback = (error?: Error, missing?: string[]) => undefined;
|
|
3
3
|
export default function checkMissing(dest: string, options: InstallOptions, callback: Callback): undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InstallOptions } from '../types.
|
|
1
|
+
import type { InstallOptions } from '../types.js';
|
|
2
2
|
export type Callback = (error?: Error, missing?: string[]) => undefined;
|
|
3
3
|
export default function checkMissing(dest: string, options: InstallOptions, callback: Callback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalExtract(src: string, dest: string, options: InstallOptions | NoParamCallback, callback?: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalExtract(src: string, dest: string, options: InstallOptions | NoParamCallback, callback?: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function ensureDestinationParent(dest: string, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function ensureDestinationParent(dest: string, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, Target } from '../types.
|
|
1
|
+
import type { InstallOptions, Target } from '../types.js';
|
|
2
2
|
export default function getTarget(options: InstallOptions): Target;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, Target } from '../types.
|
|
1
|
+
import type { InstallOptions, Target } from '../types.js';
|
|
2
2
|
export default function getTarget(options: InstallOptions): Target;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallCallback, InstallOptions } from '../types.
|
|
1
|
+
import type { InstallCallback, InstallOptions } from '../types.js';
|
|
2
2
|
export default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallCallback, InstallOptions } from '../types.
|
|
1
|
+
import type { InstallCallback, InstallOptions } from '../types.js';
|
|
2
2
|
export default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined;
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { FilePath } from './types.
|
|
2
|
-
export declare const FILES: Record<string, import("./types.
|
|
1
|
+
import type { FilePath } from './types.js';
|
|
2
|
+
export declare const FILES: Record<string, import("./types.js").File[]>;
|
|
3
3
|
export declare const DEFAULT_STORAGE_PATH: string;
|
|
4
|
-
export declare const DEFAULT_STORAGE_PATHS: import("./types.
|
|
4
|
+
export declare const DEFAULT_STORAGE_PATHS: import("./types.js").StorageLocations;
|
|
5
5
|
export declare const FILE_PLATFORMS: string[];
|
|
6
6
|
export declare const FILE_PLATFORM_MAP: {
|
|
7
7
|
win: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, InstallResult } from './types.
|
|
1
|
+
import type { InstallOptions, InstallResult } from './types.js';
|
|
2
2
|
export default function createResult(options: InstallOptions, version: string): InstallResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StorageLocations } from './types.
|
|
1
|
+
import type { StorageLocations } from './types.js';
|
|
2
2
|
export default function createStoragePaths(storagePath: string): StorageLocations;
|
package/dist/esm/files.d.ts
CHANGED
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { InstallCallback, InstallOptions, InstallResult } from './types.
|
|
2
|
-
export type * from './types.
|
|
1
|
+
import type { InstallCallback, InstallOptions, InstallResult } from './types.js';
|
|
2
|
+
export type * from './types.js';
|
|
3
3
|
export default function install(versionExpression: string): Promise<InstallResult>;
|
|
4
4
|
export default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;
|
|
5
5
|
export default function install(versionExpression: string, callback: InstallCallback): undefined;
|
|
6
6
|
export default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined;
|
|
7
|
-
export { default as createResult } from './createResult.
|
|
8
|
-
export { default as createStoragePaths } from './createStoragePaths.
|
|
7
|
+
export { default as createResult } from './createResult.js';
|
|
8
|
+
export { default as createStoragePaths } from './createStoragePaths.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void;
|
|
@@ -6,6 +6,8 @@ export default function installBin(_version, dest, options, callback) {
|
|
|
6
6
|
const platform = options.platform;
|
|
7
7
|
const files = NPM_FILE_PATHS[platform] || NPM_FILE_PATHS.posix;
|
|
8
8
|
const queue = new Queue();
|
|
9
|
-
files.forEach((file)=>
|
|
9
|
+
files.forEach((file)=>{
|
|
10
|
+
queue.defer(conditionalCopy.bind(null, path.join(dest, file.src), path.join(dest, file.dest), file.optional));
|
|
11
|
+
});
|
|
10
12
|
queue.await(callback);
|
|
11
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installBin.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_FILE_PATHS } from '../constants.ts';\nimport conditionalCopy from '../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\n\nexport default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback) {\n const platform = options.platform;\n const files = NPM_FILE_PATHS[platform] || NPM_FILE_PATHS.posix;\n\n const queue = new Queue();\n files.forEach((file) => queue.defer(conditionalCopy.bind(null, path.join(dest, file.src), path.join(dest, file.dest), file.optional)));\n queue.await(callback);\n}\n"],"names":["path","Queue","NPM_FILE_PATHS","conditionalCopy","installBin","_version","dest","options","callback","platform","files","posix","queue","forEach","file","defer","bind","join","src","optional","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,SAASC,cAAc,QAAQ,kBAAkB;AACjD,OAAOC,qBAAqB,4BAA4B;AAIxD,eAAe,SAASC,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,QAAQR,cAAc,CAACO,SAAS,IAAIP,eAAeS,KAAK;IAE9D,MAAMC,QAAQ,IAAIX;IAClBS,MAAMG,OAAO,CAAC,CAACC,
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installBin.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_FILE_PATHS } from '../constants.ts';\nimport conditionalCopy from '../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\n\nexport default function installBin(_version: string, dest: string, options: InstallOptions, callback: NoParamCallback) {\n const platform = options.platform;\n const files = NPM_FILE_PATHS[platform] || NPM_FILE_PATHS.posix;\n\n const queue = new Queue();\n files.forEach((file) => {\n queue.defer(conditionalCopy.bind(null, path.join(dest, file.src), path.join(dest, file.dest), file.optional));\n });\n queue.await(callback);\n}\n"],"names":["path","Queue","NPM_FILE_PATHS","conditionalCopy","installBin","_version","dest","options","callback","platform","files","posix","queue","forEach","file","defer","bind","join","src","optional","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,SAASC,cAAc,QAAQ,kBAAkB;AACjD,OAAOC,qBAAqB,4BAA4B;AAIxD,eAAe,SAASC,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,QAAQR,cAAc,CAACO,SAAS,IAAIP,eAAeS,KAAK;IAE9D,MAAMC,QAAQ,IAAIX;IAClBS,MAAMG,OAAO,CAAC,CAACC;QACbF,MAAMG,KAAK,CAACZ,gBAAgBa,IAAI,CAAC,MAAMhB,KAAKiB,IAAI,CAACX,MAAMQ,KAAKI,GAAG,GAAGlB,KAAKiB,IAAI,CAACX,MAAMQ,KAAKR,IAAI,GAAGQ,KAAKK,QAAQ;IAC7G;IACAP,MAAMQ,KAAK,CAACZ;AACd"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InstallOptions } from '../types.
|
|
1
|
+
import type { InstallOptions } from '../types.js';
|
|
2
2
|
export type Callback = (error?: Error, npmVersion?: string) => undefined;
|
|
3
3
|
export default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -24,7 +24,9 @@ export default function install(version, dest, options, callback) {
|
|
|
24
24
|
filePlatform,
|
|
25
25
|
a
|
|
26
26
|
].concat(parts.slice(2)).join('-'));
|
|
27
|
-
(FILES[filePlatform] || []).forEach((x)=>
|
|
27
|
+
(FILES[filePlatform] || []).forEach((x)=>{
|
|
28
|
+
filenames.push(x.filename);
|
|
29
|
+
});
|
|
28
30
|
filenames.push('src');
|
|
29
31
|
filenames = filenames.filter((filename, i)=>filenames.indexOf(filename) === i);
|
|
30
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/index.ts"],"sourcesContent":["import { FILE_PLATFORM_MAP, FILES } from '../constants.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined {\n let filenames = null;\n\n // a specific filename\n if (options.filename) filenames = [options.filename];\n // infer with fallbacks\n else {\n const { platform, arch } = options;\n const filePlatform = FILE_PLATFORM_MAP[platform] || platform;\n const parts = [filePlatform, arch];\n if (options.type) parts.push(options.type);\n if (options.compression) parts.push(options.compression);\n\n // generate the files in search order\n const archs = [arch, process.arch];\n filenames = archs.map((a) => [filePlatform, a].concat(parts.slice(2)).join('-'));\n (FILES[filePlatform] || []).forEach((x) => filenames.push(x.filename));\n filenames.push('src');\n filenames = filenames.filter((filename, i) => filenames.indexOf(filename) === i);\n }\n\n const tryNext = (cb) => {\n if (filenames.length === 0) return cb(new Error(`Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`));\n installFilename(filenames.shift(), version, dest, options, (err) => (err ? tryNext(cb) : cb()));\n };\n tryNext((err) => {\n console.log(`node ${version.slice(1)} ${!err ? 'installed' : `install failed. Error: ${err.message}`}`);\n callback(err);\n });\n}\n"],"names":["FILE_PLATFORM_MAP","FILES","installFilename","install","version","dest","options","callback","filenames","filename","platform","arch","filePlatform","parts","type","push","compression","archs","process","map","a","concat","slice","join","forEach","x","filter","i","indexOf","tryNext","cb","length","Error","shift","err","console","log","message"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,KAAK,QAAQ,kBAAkB;AAE3D,OAAOC,qBAAqB,uBAAuB;AAEnD,eAAe,SAASC,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,YAAY;IAEhB,sBAAsB;IACtB,IAAIF,QAAQG,QAAQ,EAAED,YAAY;QAACF,QAAQG,QAAQ;KAAC;SAE/C;QACH,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGL;QAC3B,MAAMM,eAAeZ,iBAAiB,CAACU,SAAS,IAAIA;QACpD,MAAMG,QAAQ;YAACD;YAAcD;SAAK;QAClC,IAAIL,QAAQQ,IAAI,EAAED,MAAME,IAAI,CAACT,QAAQQ,IAAI;QACzC,IAAIR,QAAQU,WAAW,EAAEH,MAAME,IAAI,CAACT,QAAQU,WAAW;QAEvD,qCAAqC;QACrC,MAAMC,QAAQ;YAACN;YAAMO,QAAQP,IAAI;SAAC;QAClCH,YAAYS,MAAME,GAAG,CAAC,CAACC,IAAM;gBAACR;gBAAcQ;aAAE,CAACC,MAAM,CAACR,MAAMS,KAAK,CAAC,IAAIC,IAAI,CAAC;QAC1EtB,CAAAA,KAAK,CAACW,aAAa,IAAI,EAAE,AAAD,EAAGY,OAAO,CAAC,CAACC,
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/index.ts"],"sourcesContent":["import { FILE_PLATFORM_MAP, FILES } from '../constants.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined {\n let filenames = null;\n\n // a specific filename\n if (options.filename) filenames = [options.filename];\n // infer with fallbacks\n else {\n const { platform, arch } = options;\n const filePlatform = FILE_PLATFORM_MAP[platform] || platform;\n const parts = [filePlatform, arch];\n if (options.type) parts.push(options.type);\n if (options.compression) parts.push(options.compression);\n\n // generate the files in search order\n const archs = [arch, process.arch];\n filenames = archs.map((a) => [filePlatform, a].concat(parts.slice(2)).join('-'));\n (FILES[filePlatform] || []).forEach((x) => {\n filenames.push(x.filename);\n });\n filenames.push('src');\n filenames = filenames.filter((filename, i) => filenames.indexOf(filename) === i);\n }\n\n const tryNext = (cb) => {\n if (filenames.length === 0) return cb(new Error(`Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`));\n installFilename(filenames.shift(), version, dest, options, (err) => (err ? tryNext(cb) : cb()));\n };\n tryNext((err) => {\n console.log(`node ${version.slice(1)} ${!err ? 'installed' : `install failed. Error: ${err.message}`}`);\n callback(err);\n });\n}\n"],"names":["FILE_PLATFORM_MAP","FILES","installFilename","install","version","dest","options","callback","filenames","filename","platform","arch","filePlatform","parts","type","push","compression","archs","process","map","a","concat","slice","join","forEach","x","filter","i","indexOf","tryNext","cb","length","Error","shift","err","console","log","message"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,KAAK,QAAQ,kBAAkB;AAE3D,OAAOC,qBAAqB,uBAAuB;AAEnD,eAAe,SAASC,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,YAAY;IAEhB,sBAAsB;IACtB,IAAIF,QAAQG,QAAQ,EAAED,YAAY;QAACF,QAAQG,QAAQ;KAAC;SAE/C;QACH,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGL;QAC3B,MAAMM,eAAeZ,iBAAiB,CAACU,SAAS,IAAIA;QACpD,MAAMG,QAAQ;YAACD;YAAcD;SAAK;QAClC,IAAIL,QAAQQ,IAAI,EAAED,MAAME,IAAI,CAACT,QAAQQ,IAAI;QACzC,IAAIR,QAAQU,WAAW,EAAEH,MAAME,IAAI,CAACT,QAAQU,WAAW;QAEvD,qCAAqC;QACrC,MAAMC,QAAQ;YAACN;YAAMO,QAAQP,IAAI;SAAC;QAClCH,YAAYS,MAAME,GAAG,CAAC,CAACC,IAAM;gBAACR;gBAAcQ;aAAE,CAACC,MAAM,CAACR,MAAMS,KAAK,CAAC,IAAIC,IAAI,CAAC;QAC1EtB,CAAAA,KAAK,CAACW,aAAa,IAAI,EAAE,AAAD,EAAGY,OAAO,CAAC,CAACC;YACnCjB,UAAUO,IAAI,CAACU,EAAEhB,QAAQ;QAC3B;QACAD,UAAUO,IAAI,CAAC;QACfP,YAAYA,UAAUkB,MAAM,CAAC,CAACjB,UAAUkB,IAAMnB,UAAUoB,OAAO,CAACnB,cAAckB;IAChF;IAEA,MAAME,UAAU,CAACC;QACf,IAAItB,UAAUuB,MAAM,KAAK,GAAG,OAAOD,GAAG,IAAIE,MAAM,CAAC,+BAA+B,EAAE5B,UAAUE,QAAQG,QAAQ,GAAG,CAAC,WAAW,EAAEH,QAAQG,QAAQ,EAAE,GAAG,IAAI;QACtJP,gBAAgBM,UAAUyB,KAAK,IAAI7B,SAASC,MAAMC,SAAS,CAAC4B,MAASA,MAAML,QAAQC,MAAMA;IAC3F;IACAD,QAAQ,CAACK;QACPC,QAAQC,GAAG,CAAC,CAAC,KAAK,EAAEhC,QAAQkB,KAAK,CAAC,GAAG,CAAC,EAAE,CAACY,MAAM,cAAc,CAAC,uBAAuB,EAAEA,IAAIG,OAAO,EAAE,EAAE;QACtG9B,SAAS2B;IACX;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../../types.js';
|
|
2
2
|
export default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function validateDownload(distPath: string, installPath: string, callback: NoParamCallback): undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InstallOptions } from '../types.
|
|
1
|
+
import type { InstallOptions } from '../types.js';
|
|
2
2
|
export type Callback = (error?: Error, missing?: string[]) => undefined;
|
|
3
3
|
export default function checkMissing(dest: string, options: InstallOptions, callback: Callback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, NoParamCallback } from '../types.
|
|
1
|
+
import type { InstallOptions, NoParamCallback } from '../types.js';
|
|
2
2
|
export default function conditionalExtract(src: string, dest: string, options: InstallOptions | NoParamCallback, callback?: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NoParamCallback } from '../types.
|
|
1
|
+
import type { NoParamCallback } from '../types.js';
|
|
2
2
|
export default function ensureDestinationParent(dest: string, callback: NoParamCallback): undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallOptions, Target } from '../types.
|
|
1
|
+
import type { InstallOptions, Target } from '../types.js';
|
|
2
2
|
export default function getTarget(options: InstallOptions): Target;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InstallCallback, InstallOptions } from '../types.
|
|
1
|
+
import type { InstallCallback, InstallOptions } from '../types.js';
|
|
2
2
|
export default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-install-release",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.9",
|
|
4
4
|
"description": "Cross-platform solution for installing releases of Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
"version": "tsds version"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"cross-spawn-cb": "
|
|
45
|
-
"exit": "
|
|
46
|
-
"fast-extract": "
|
|
47
|
-
"function-exec-sync": "
|
|
48
|
-
"get-remote": "
|
|
49
|
-
"getopts-compat": "
|
|
50
|
-
"homedir-polyfill": "
|
|
51
|
-
"is-version": "
|
|
52
|
-
"lodash.keys": "
|
|
53
|
-
"mkdirp-classic": "
|
|
54
|
-
"node-filename-to-dist-paths": "
|
|
55
|
-
"node-resolve-versions": "
|
|
56
|
-
"on-one": "
|
|
57
|
-
"pump": "
|
|
58
|
-
"queue-cb": "
|
|
59
|
-
"rimraf2": "
|
|
44
|
+
"cross-spawn-cb": "*",
|
|
45
|
+
"exit": "*",
|
|
46
|
+
"fast-extract": "*",
|
|
47
|
+
"function-exec-sync": "*",
|
|
48
|
+
"get-remote": "*",
|
|
49
|
+
"getopts-compat": "*",
|
|
50
|
+
"homedir-polyfill": "*",
|
|
51
|
+
"is-version": "*",
|
|
52
|
+
"lodash.keys": "*",
|
|
53
|
+
"mkdirp-classic": "*",
|
|
54
|
+
"node-filename-to-dist-paths": "*",
|
|
55
|
+
"node-resolve-versions": "*",
|
|
56
|
+
"on-one": "*",
|
|
57
|
+
"pump": "*",
|
|
58
|
+
"queue-cb": "*",
|
|
59
|
+
"rimraf2": "*"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/mocha": "*",
|