node-install-release 1.18.0 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/cjs/cli.js.map +1 -1
  2. package/dist/cjs/compat.js.map +1 -1
  3. package/dist/cjs/constants.js.map +1 -1
  4. package/dist/cjs/createResult.js.map +1 -1
  5. package/dist/cjs/createStoragePaths.js.map +1 -1
  6. package/dist/cjs/files.js.map +1 -1
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/installNPM/index.js.map +1 -1
  9. package/dist/cjs/installNPM/installBin.js.map +1 -1
  10. package/dist/cjs/installNPM/installLib.js.map +1 -1
  11. package/dist/cjs/installNode/index.js.map +1 -1
  12. package/dist/cjs/installNode/installCompressed.js.map +1 -1
  13. package/dist/cjs/installNode/installExe.js.map +1 -1
  14. package/dist/cjs/installNode/installFilename.js.map +1 -1
  15. package/dist/cjs/installNode/installSource/buildPosix.js.map +1 -1
  16. package/dist/cjs/installNode/installSource/buildWin32.js.map +1 -1
  17. package/dist/cjs/installNode/installSource/index.js.map +1 -1
  18. package/dist/cjs/installNode/validateDownload.js.map +1 -1
  19. package/dist/cjs/lib/checkMissing.js.map +1 -1
  20. package/dist/cjs/lib/conditionalCache.js.map +1 -1
  21. package/dist/cjs/lib/conditionalCopy.js.map +1 -1
  22. package/dist/cjs/lib/copyFile.js.map +1 -1
  23. package/dist/cjs/lib/ensureDestinationParent.js.map +1 -1
  24. package/dist/cjs/lib/extract.js.map +1 -1
  25. package/dist/cjs/lib/getTarget.js.map +1 -1
  26. package/dist/cjs/workers/install.js.map +1 -1
  27. package/dist/esm/cli.js.map +1 -1
  28. package/dist/esm/compat.js.map +1 -1
  29. package/dist/esm/constants.js.map +1 -1
  30. package/dist/esm/createResult.js.map +1 -1
  31. package/dist/esm/createStoragePaths.js.map +1 -1
  32. package/dist/esm/files.js.map +1 -1
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/installNPM/index.js.map +1 -1
  35. package/dist/esm/installNPM/installBin.js.map +1 -1
  36. package/dist/esm/installNPM/installLib.js.map +1 -1
  37. package/dist/esm/installNode/index.js.map +1 -1
  38. package/dist/esm/installNode/installCompressed.js.map +1 -1
  39. package/dist/esm/installNode/installExe.js.map +1 -1
  40. package/dist/esm/installNode/installFilename.js.map +1 -1
  41. package/dist/esm/installNode/installSource/buildPosix.js.map +1 -1
  42. package/dist/esm/installNode/installSource/buildWin32.js.map +1 -1
  43. package/dist/esm/installNode/installSource/index.js.map +1 -1
  44. package/dist/esm/installNode/validateDownload.js.map +1 -1
  45. package/dist/esm/lib/checkMissing.js.map +1 -1
  46. package/dist/esm/lib/conditionalCache.js.map +1 -1
  47. package/dist/esm/lib/conditionalCopy.js.map +1 -1
  48. package/dist/esm/lib/copyFile.js.map +1 -1
  49. package/dist/esm/lib/ensureDestinationParent.js.map +1 -1
  50. package/dist/esm/lib/extract.js.map +1 -1
  51. package/dist/esm/lib/getTarget.js.map +1 -1
  52. package/dist/esm/types.js.map +1 -1
  53. package/dist/esm/workers/install.js.map +1 -1
  54. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport install, { type InstallOptions } from './index.ts';\n\nconst ERROR_CODE = 9;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getPackageVersion(): string {\n const packagePath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getPackageVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} <version> [options]`);\n console.log('');\n console.log('Arguments:');\n console.log(' version Node.js version to install (e.g., 18.0.0, lts, stable)');\n console.log('');\n console.log('Options:');\n console.log(' -p, --platform Target platform (default: current platform)');\n console.log(' -a, --arch Target architecture (default: current architecture)');\n console.log(' -f, --filename Specific filename to download');\n console.log(' -i, --installPath Installation directory');\n console.log(' -c, --storagePath Cache storage directory');\n console.log(' -si, --silent Suppress output');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n const cliName = name || 'nir';\n const options = getopts(argv, {\n alias: { platform: 'p', arch: 'a', filename: 'f', installPath: 'i', storagePath: 'c', silent: 'si', version: 'v', help: 'h' },\n boolean: ['silent', 'version', 'help'],\n });\n\n if (options.version) {\n console.log(getPackageVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(cliName);\n exit(0);\n return;\n }\n\n const args = options._;\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${cliName} <version> [directory]`);\n exit(ERROR_CODE);\n return;\n }\n install(args[0], options as InstallOptions, (err, result) => {\n if (!options.silent) {\n console.log('\\n======================');\n if (err) console.log(`${args[0]} not installed. Error: ${err.message}`);\n else console.log(`${result.version} installed in: ${result.installPath}`);\n console.log('======================');\n }\n exit(err ? ERROR_CODE : 0);\n });\n};\n"],"names":["ERROR_CODE","__dirname","path","dirname","__filename","url","fileURLToPath","getPackageVersion","packagePath","join","packageJson","JSON","parse","fs","readFileSync","version","printHelp","name","console","log","argv","cliName","options","getopts","alias","platform","arch","filename","installPath","storagePath","silent","help","boolean","exit","args","_","length","install","err","result","message"],"mappings":";;;;+BAoCA;;;eAAA;;;iEApCiB;yDACF;oEACK;2DACH;0DACD;8DAC6B;;;;;;AAE7C,IAAMA,aAAa;AACnB,IAAMC,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AAElG,SAASC;IACP,IAAMC,cAAcN,aAAI,CAACO,IAAI,CAACR,WAAW,MAAM,MAAM;IACrD,IAAMS,cAAcC,KAAKC,K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AAAA,gBAAO,EAACH,IAAI,CAAC,EAAE,EAAEZ,SAA2B,SAACgB,KAAKC;QAChD,IAAI,CAACjB,QAAQQ,MAAM,EAAE;YACnBZ,QAAQC,GAAG,CAAC;YACZ,IAAImB,KAAKpB,QAAQC,GAAG,CAAC,AAAC,GAAmCmB,OAAjCJ,IAAI,CAAC,EAAE,EAAC,2BAAqC,OAAZI,IAAIE,OAAO;iBAC/DtB,QAAQC,GAAG,CAAC,AAAC,GAAkCoB,OAAhCA,OAAOxB,OAAO,EAAC,mBAAoC,OAAnBwB,OAAOX,WAAW;YACtEV,QAAQC,GAAG,CAAC;QACd;QACAc,IAAAA,mBAAI,EAACK,MAAMtC,aAAa;IAC1B;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport install, { type InstallOptions } from './index.ts';\n\nconst ERROR_CODE = 9;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getPackageVersion(): string {\n const packagePath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getPackageVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} <version> [options]`);\n console.log('');\n console.log('Arguments:');\n console.log(' version Node.js version to install (e.g., 18.0.0, lts, stable)');\n console.log('');\n console.log('Options:');\n console.log(' -p, --platform Target platform (default: current platform)');\n console.log(' -a, --arch Target architecture (default: current architecture)');\n console.log(' -f, --filename Specific filename to download');\n console.log(' -i, --installPath Installation directory');\n console.log(' -c, --storagePath Cache storage directory');\n console.log(' -si, --silent Suppress output');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n const cliName = name || 'nir';\n const options = getopts(argv, {\n alias: { platform: 'p', arch: 'a', filename: 'f', installPath: 'i', storagePath: 'c', silent: 'si', version: 'v', help: 'h' },\n boolean: ['silent', 'version', 'help'],\n });\n\n if (options.version) {\n console.log(getPackageVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(cliName);\n exit(0);\n return;\n }\n\n const args = options._;\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${cliName} <version> [directory]`);\n exit(ERROR_CODE);\n return;\n }\n install(args[0], options as InstallOptions, (err, result) => {\n if (!options.silent) {\n console.log('\\n======================');\n if (err) console.log(`${args[0]} not installed. Error: ${err.message}`);\n else console.log(`${result.version} installed in: ${result.installPath}`);\n console.log('======================');\n }\n exit(err ? ERROR_CODE : 0);\n });\n};\n"],"names":["ERROR_CODE","__dirname","path","dirname","__filename","url","fileURLToPath","getPackageVersion","packagePath","join","packageJson","JSON","parse","fs","readFileSync","version","printHelp","name","console","log","argv","cliName","options","getopts","alias","platform","arch","filename","installPath","storagePath","silent","help","boolean","exit","args","_","length","install","err","result","message"],"mappings":";;;;+BAoCA;;;eAAA;;;iEApCiB;yDACF;oEACK;2DACH;0DACD;8DAC6B;;;;;;AAE7C,IAAMA,aAAa;AACnB,IAAMC,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AAElG,SAASC;IACP,IAAMC,cAAcN,aAAI,CAACO,IAAI,CAACR,WAAW,MAAM,MAAM;IACrD,IAAMS,cAAcC,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACN,aAAa;IAC5D,OAAOE,YAAYK,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,IAAMF,UAAUR;IAChBW,QAAQC,GAAG,CAAC,AAAC,GAAWJ,OAATE,MAAK,MAAY,OAARF;IACxBG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,AAAC,UAAc,OAALF,MAAK;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,QAAQC,GAAG,CAAC,AAAC,GAAkCoB,OAAhCA,OAAOxB,OAAO,EAAC,mBAAoC,OAAnBwB,OAAOX,WAAW;YACtEV,QAAQC,GAAG,CAAC;QACd;QACAc,IAAAA,mBAAI,EAACK,MAAMtC,aAAa;IAC1B;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport os from 'os';\n\nexport function homedir(): string {\n return typeof os.homedir === 'function' ? os.homedir() : require('homedir-polyfill')();\n}\n"],"names":["homedir","os","require"],"mappings":"AAAA;;;CAGC;;;;+BAGeA;;;eAAAA;;;yDAFD;;;;;;AAER,SAASA;IACd,OAAO,OAAOC,WAAE,CAACD,OAAO,KAAK,aAAaC,WAAE,CAACD,OAAO,KAAKE,QAAQ;AACnE"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport os from 'os';\n\nexport function homedir(): string {\n return typeof os.homedir === 'function' ? os.homedir() : require('homedir-polyfill')();\n}\n"],"names":["homedir","os","require"],"mappings":"AAAA;;;CAGC;;;;+BAGeA;;;eAAAA;;;yDAFD;;;;;;AAER,SAASA;IACd,OAAO,OAAOC,WAAE,CAACD,OAAO,KAAK,aAAaC,WAAE,CAACD,OAAO,KAAKE,QAAQ;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/constants.ts"],"sourcesContent":["import keys from 'lodash.keys';\nimport path from 'path';\nimport { homedir } from './compat.ts';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_PACKAGE_PATH = {\n win32: path.join('node_modules', 'npm') as string,\n posix: path.join('lib', 'node_modules', 'npm') as string,\n};\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm'), dest: 'npm' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["DEFAULT_STORAGE_PATH","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","FILES","FILE_PLATFORMS","FILE_PLATFORM_MAP","NODE_DIST_BASE_URL","NODE_FILE_PATHS","NODE_SCHEDULES_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_FILE_PATHS","NPM_MIN_VERSION","NPM_PACKAGE_PATH","files","path","join","homedir","createStoragePaths","keys","filter","file","indexOf","win","win32","osx","darwin","posix","src","dest","optional"],"mappings":";;;;;;;;;;;QASaA;eAAAA;;QACAC;eAAAA;;QAWAC;eAAAA;;QAbAC;eAAAA;;QAIAC;eAAAA;;QAEAC;eAAAA;;QAaAC;eAAAA;;QAJAC;eAAAA;;QAKAC;eAAAA;;QAGAC;eAAAA;;QADAC;eAAAA;;QASAC;eAAAA;;QAPAC;eAAAA;;QAEAC;eAAAA;;;iEAlCI;2DACA;wBACO;2EACO;8DACb;;;;;;AAIX,IAAMV,QAAQW,gBAAK;AACnB,IAAMd,uBAAuBe,aAAI,CAACC,IAAI,CAACC,IAAAA,iBAAO,KAAI;AAClD,IAAMhB,wBAAwBiB,IAAAA,6BAAkB,EAAClB;AAEjD,IAAMI,iBAAiBe,IAAAA,mBAAI,EAAChB,OAAOiB,MAAM,CAAC,SAACC;WAAS;QAAC;QAAO;KAAU,CAACC,OAAO,CAACD,QAAQ;;AAEvF,IAAMhB,oBAAoB;IAC/BkB,KAAK;IACLC,OAAO;IACPC,KAAK;IACLC,QAAQ;AACV;AAEO,IAAMxB,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM;AAE3D,IAAMK,kBAAkB;IAC7BiB,OAAO;IACPG,OAAOZ,aAAI,CAACC,IAAI,CAAC,OAAO;AAC1B;AACO,IAAMV,qBAAqB;AAC3B,IAAME,qBAAqB;AAE3B,IAAME,eAAe;AACrB,IAAMD,oBAAoB;AAC1B,IAAMG,kBAAkB;AAExB,IAAMC,mBAAmB;IAC9BW,OAAOT,aAAI,CAACC,IAAI,CAAC,gBAAgB;IACjCW,OAAOZ,aAAI,CAACC,IAAI,CAAC,OAAO,gBAAgB;AAC1C;AAEO,IAAML,iBAAiB;IAC5Ba,OAAO;QACL;YAAEI,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBW,KAAK,EAAE,OAAO;YAAQK,MAAM;QAAM;QACpE;YAAED,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBW,KAAK,EAAE,OAAO;YAAYK,MAAM;QAAU;QAC5E;YAAED,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBW,KAAK,EAAE,OAAO;YAAQK,MAAM;YAAOC,UAAU;QAAK;QACpF;YAAEF,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBW,KAAK,EAAE,OAAO;YAAYK,MAAM;YAAWC,UAAU;QAAK;KAC7F;IACDH,OAAO;QACL;YAAEC,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBc,KAAK,EAAE,OAAO;YAAeE,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;QAAO;QAC7F;YAAEY,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBc,KAAK,EAAE,OAAO;YAAeE,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;YAAQc,UAAU;QAAK;KAC9G;AACH"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import keys from 'lodash.keys';\nimport path from 'path';\nimport { homedir } from './compat.ts';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_PACKAGE_PATH = {\n win32: path.join('node_modules', 'npm') as string,\n posix: path.join('lib', 'node_modules', 'npm') as string,\n};\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm'), dest: 'npm' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["DEFAULT_STORAGE_PATH","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","FILES","FILE_PLATFORMS","FILE_PLATFORM_MAP","NODE_DIST_BASE_URL","NODE_FILE_PATHS","NODE_SCHEDULES_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_FILE_PATHS","NPM_MIN_VERSION","NPM_PACKAGE_PATH","files","path","join","homedir","createStoragePaths","keys","filter","file","indexOf","win","win32","osx","darwin","posix","src","dest","optional"],"mappings":";;;;;;;;;;;QASaA;eAAAA;;QACAC;eAAAA;;QAWAC;eAAAA;;QAbAC;eAAAA;;QAIAC;eAAAA;;QAEAC;eAAAA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Kb,aAAI,CAACC,IAAI,CAACH,iBAAiBW,KAAK,EAAE,OAAO;YAAYK,MAAM;YAAWC,UAAU;QAAK;KAC7F;IACDH,OAAO;QACL;YAAEC,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBc,KAAK,EAAE,OAAO;YAAeE,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;QAAO;QAC7F;YAAEY,KAAKb,aAAI,CAACC,IAAI,CAACH,iBAAiBc,KAAK,EAAE,OAAO;YAAeE,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;YAAQc,UAAU;QAAK;KAC9G;AACH"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/createResult.ts"],"sourcesContent":["import path from 'path';\nimport { DEFAULT_STORAGE_PATHS, NODE_FILE_PATHS } from './constants.ts';\n\nimport createStoragePaths from './createStoragePaths.ts';\nimport getTarget from './lib/getTarget.ts';\nimport type { InstallOptions, InstallResult } from './types.ts';\n\nexport default function createResult(options: InstallOptions, version: string): InstallResult {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n let installPath = options.installPath || storagePaths.installPath;\n\n if (options.name) installPath = path.join(installPath, options.name);\n else if (!options.installPath) installPath = path.join(installPath, version);\n const { platform } = getTarget(options);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(installPath, nodePath);\n return { version, installPath, execPath, platform };\n}\n"],"names":["createResult","options","version","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","installPath","name","path","join","platform","getTarget","nodePath","NODE_FILE_PATHS","posix","execPath"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;2BACsC;2EAExB;kEACT;;;;;;AAGP,SAASA,aAAaC,OAAuB,EAAEC,OAAe;IAC3E,IAAMC,eAAeF,QAAQG,WAAW,GAAGC,IAAAA,6BAAkB,EAACJ,QAAQG,WAAW,IAAIE,kCAAqB;IAC1G,IAAIC,cAAcN,QAAQM,WAAW,IAAIJ,aAAaI,WAAW;IAEjE,IAAIN,QAAQO,IAAI,EAAED,cAAcE,aAAI,CAACC,IAAI,CAACH,aAAaN,QAAQO,IAAI;SAC9D,IAAI,CAACP,QAAQM,WAAW,EAAEA,cAAcE,aAAI,CAACC,IAAI,CAACH,aAAaL;IACpE,IAAM,AAAES,WAAaC,IAAAA,oBAAS,EAACX,SAAvBU;IACR,IAAME,WAAWC,4BAAe,CAACH,SAAS,IAAIG,4BAAe,CAACC,KAAK;IACnE,IAAMC,WAAWP,aAAI,CAACC,IAAI,CAACH,aAAaM;IACxC,OAAO;QAAEX,SAAAA;QAASK,aAAAA;QAAaS,UAAAA;QAAUL,UAAAA;IAAS;AACpD"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/createResult.ts"],"sourcesContent":["import path from 'path';\nimport { DEFAULT_STORAGE_PATHS, NODE_FILE_PATHS } from './constants.ts';\n\nimport createStoragePaths from './createStoragePaths.ts';\nimport getTarget from './lib/getTarget.ts';\nimport type { InstallOptions, InstallResult } from './types.ts';\n\nexport default function createResult(options: InstallOptions, version: string): InstallResult {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n let installPath = options.installPath || storagePaths.installPath;\n\n if (options.name) installPath = path.join(installPath, options.name);\n else if (!options.installPath) installPath = path.join(installPath, version);\n const { platform } = getTarget(options);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(installPath, nodePath);\n return { version, installPath, execPath, platform };\n}\n"],"names":["createResult","options","version","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","installPath","name","path","join","platform","getTarget","nodePath","NODE_FILE_PATHS","posix","execPath"],"mappings":";;;;+BAOA;;;eAAwBA;;;2DAPP;2BACsC;2EAExB;kEACT;;;;;;AAGP,SAASA,aAAaC,OAAuB,EAAEC,OAAe;IAC3E,IAAMC,eAAeF,QAAQG,WAAW,GAAGC,IAAAA,6BAAkB,EAACJ,QAAQG,WAAW,IAAIE,kCAAqB;IAC1G,IAAIC,cAAcN,QAAQM,WAAW,IAAIJ,aAAaI,WAAW;IAEjE,IAAIN,QAAQO,IAAI,EAAED,cAAcE,aAAI,CAACC,IAAI,CAACH,aAAaN,QAAQO,IAAI;SAC9D,IAAI,CAACP,QAAQM,WAAW,EAAEA,cAAcE,aAAI,CAACC,IAAI,CAACH,aAAaL;IACpE,IAAM,AAAES,WAAaC,IAAAA,oBAAS,EAACX,SAAvBU;IACR,IAAME,WAAWC,4BAAe,CAACH,SAAS,IAAIG,4BAAe,CAACC,KAAK;IACnE,IAAMC,WAAWP,aAAI,CAACC,IAAI,CAACH,aAAaM;IACxC,OAAO;QAAEX,SAAAA;QAASK,aAAAA;QAAaS,UAAAA;QAAUL,UAAAA;IAAS;AACpD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/createStoragePaths.ts"],"sourcesContent":["import path from 'path';\n\nimport type { StorageLocations } from './types.ts';\n\nexport default function createStoragePaths(storagePath: string): StorageLocations {\n return {\n cachePath: path.join(storagePath, 'cache') as string,\n buildPath: path.join(storagePath, 'build') as string,\n installPath: path.join(storagePath, 'installed') as string,\n };\n}\n"],"names":["createStoragePaths","storagePath","cachePath","path","join","buildPath","installPath"],"mappings":";;;;+BAIA;;;eAAwBA;;;2DAJP;;;;;;AAIF,SAASA,mBAAmBC,WAAmB;IAC5D,OAAO;QACLC,WAAWC,aAAI,CAACC,IAAI,CAACH,aAAa;QAClCI,WAAWF,aAAI,CAACC,IAAI,CAACH,aAAa;QAClCK,aAAaH,aAAI,CAACC,IAAI,CAACH,aAAa;IACtC;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/createStoragePaths.ts"],"sourcesContent":["import path from 'path';\n\nimport type { StorageLocations } from './types.ts';\n\nexport default function createStoragePaths(storagePath: string): StorageLocations {\n return {\n cachePath: path.join(storagePath, 'cache') as string,\n buildPath: path.join(storagePath, 'build') as string,\n installPath: path.join(storagePath, 'installed') as string,\n };\n}\n"],"names":["createStoragePaths","storagePath","cachePath","path","join","buildPath","installPath"],"mappings":";;;;+BAIA;;;eAAwBA;;;2DAJP;;;;;;AAIF,SAASA,mBAAmBC,WAAmB;IAC5D,OAAO;QACLC,WAAWC,aAAI,CAACC,IAAI,CAACH,aAAa;QAClCI,WAAWF,aAAI,CAACC,IAAI,CAACH,aAAa;QAClCK,aAAaH,aAAI,CAACC,IAAI,CAACH,aAAa;IACtC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/files.ts"],"sourcesContent":["import Module from 'module';\nimport type { File } from './types.ts';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nexport default _require('../../assets/files.cjs') as Record<string, File[]>;\n"],"names":["_require","require","Module","createRequire"],"mappings":";;;;+BAIA;;;eAAA;;;6DAJmB;;;;;;AAGnB,IAAMA,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;IAC1F,WAAeD,SAAS"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/files.ts"],"sourcesContent":["import Module from 'module';\nimport type { File } from './types.ts';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nexport default _require('../../assets/files.cjs') as Record<string, File[]>;\n"],"names":["_require","require","Module","createRequire"],"mappings":";;;;+BAIA;;;eAAA;;;6DAJmB;;;;;;AAGnB,IAAMA,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;IAC1F,WAAeD,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions, InstallResult } from './types.ts';\nimport worker from './workers/install.ts';\n\nexport type * from './types.ts';\n\nexport default function install(versionExpression: string): Promise<InstallResult>;\nexport default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;\n\nexport default function install(versionExpression: string, callback: InstallCallback): void;\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void;\n\nexport default function install(versionExpression: string, optionsOrCallback?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<InstallResult> {\n const options = typeof optionsOrCallback === 'function' ? {} : ((optionsOrCallback || {}) as InstallOptions);\n const cb = typeof optionsOrCallback === 'function' ? optionsOrCallback : callback;\n\n if (typeof cb === 'function') return worker(versionExpression, options, cb);\n return new Promise((resolve, reject) => worker(versionExpression, options, (err, result) => (err ? reject(err) : resolve(result))));\n}\nexport { default as createResult } from './createResult.ts';\nexport { default as createStoragePaths } from './createStoragePaths.ts';\n"],"names":["createResult","createStoragePaths","install","versionExpression","optionsOrCallback","callback","options","cb","worker","Promise","resolve","reject","err","result"],"mappings":";;;;;;;;;;;QAkBoBA;eAAAA,uBAAY;;QACZC;eAAAA,6BAAkB;;QARtC;eAAwBC;;;gEAVL;qEAiBqB;2EACM;;;;;;AAR/B,SAASA,QAAQC,iBAAyB,EAAEC,iBAAoD,EAAEC,QAA0B;IACzI,IAAMC,UAAU,OAAOF,sBAAsB,aAAa,CAAC,IAAMA,qBAAqB,CAAC;IACvF,IAAMG,KAAK,OAAOH,sBAAsB,aAAaA,oBAAoBC;IAEzE,IAAI,OAAOE,OAAO,YAAY,OAAOC,IAAAA,kBAAM,EAACL,mBAAmBG,SAASC;IACxE,OAAO,IAAIE,QAAQ,SAACC,SAASC;eAAWH,IAAAA,kBAAM,EAACL,mBAAmBG,SAAS,SAACM,KAAKC;mBAAYD,MAAMD,OAAOC,OAAOF,QAAQG;;;AAC3H"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions, InstallResult } from './types.ts';\nimport worker from './workers/install.ts';\n\nexport type * from './types.ts';\n\nexport default function install(versionExpression: string): Promise<InstallResult>;\nexport default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;\n\nexport default function install(versionExpression: string, callback: InstallCallback): void;\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void;\n\nexport default function install(versionExpression: string, optionsOrCallback?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<InstallResult> {\n const options = typeof optionsOrCallback === 'function' ? {} : ((optionsOrCallback || {}) as InstallOptions);\n const cb = typeof optionsOrCallback === 'function' ? optionsOrCallback : callback;\n\n if (typeof cb === 'function') return worker(versionExpression, options, cb);\n return new Promise((resolve, reject) => worker(versionExpression, options, (err, result) => (err ? reject(err) : resolve(result))));\n}\nexport { default as createResult } from './createResult.ts';\nexport { default as createStoragePaths } from './createStoragePaths.ts';\n"],"names":["createResult","createStoragePaths","install","versionExpression","optionsOrCallback","callback","options","cb","worker","Promise","resolve","reject","err","result"],"mappings":";;;;;;;;;;;QAkBoBA;eAAAA,uBAAY;;QACZC;eAAAA,6BAAkB;;QARtC;eAAwBC;;;gEAVL;qEAiBqB;2EACM;;;;;;AAR/B,SAASA,QAAQC,iBAAyB,EAAEC,iBAAoD,EAAEC,QAA0B;IACzI,IAAMC,UAAU,OAAOF,sBAAsB,aAAa,CAAC,IAAMA,qBAAqB,CAAC;IACvF,IAAMG,KAAK,OAAOH,sBAAsB,aAAaA,oBAAoBC;IAEzE,IAAI,OAAOE,OAAO,YAAY,OAAOC,IAAAA,kBAAM,EAACL,mBAAmBG,SAASC;IACxE,OAAO,IAAIE,QAAQ,SAACC,SAASC;eAAWH,IAAAA,kBAAM,EAACL,mBAAmBG,SAAS,SAACM,KAAKC;mBAAYD,MAAMD,OAAOC,OAAOF,QAAQG;;;AAC3H"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNPM/index.ts"],"sourcesContent":["import Queue from 'queue-cb';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installBin from './installBin.ts';\nimport installLib from './installLib.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n let npmVersion: string | null = null;\n let checksum: string | undefined;\n\n const queue = new Queue(1);\n queue.defer((cb) =>\n installLib(version, dest, options, (err, _npmVersion, _checksum) => {\n npmVersion = _npmVersion;\n checksum = _checksum;\n cb(err);\n })\n );\n queue.defer(installBin.bind(null, version, dest, options));\n queue.await((err) => {\n let message = `npm ${npmVersion || ''}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.slice(0, 8)})`;\n } else {\n message += ` install failed. Error: ${err.message}`;\n }\n console.log(message);\n callback(err);\n });\n}\n"],"names":["install","version","dest","options","callback","npmVersion","checksum","queue","Queue","defer","cb","installLib","err","_npmVersion","_checksum","installBin","bind","await","message","slice","console","log"],"mappings":";;;;+BAKA;;;eAAwBA;;;8DALN;mEAEK;mEACA;;;;;;AAER,SAASA,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,aAA4B;IAChC,IAAIC;IAEJ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAAC,SAACC;eACXC,IAAAA,qBAAU,EAACV,SAASC,MAAMC,SAAS,SAACS,KAAKC,aAAaC;YACpDT,aAAaQ;YACbP,WAAWQ;YACXJ,GAAGE;QACL;;IAEFL,MAAME,KAAK,CAACM,qBAAU,CAACC,IAAI,CAAC,MAAMf,SAASC,MAAMC;IACjDI,MAAMU,KAAK,CAAC,SAACL;QACX,IAAIM,UAAU,AAAC,OAAuB,OAAjBb,cAAc;QACnC,IAAI,CAACO,KAAK;YACRM,WAAW;YACX,IAAIZ,UAAUY,WAAW,AAAC,KAAyB,OAArBZ,SAASa,KAAK,CAAC,GAAG,IAAG;QACrD,OAAO;YACLD,WAAW,AAAC,2BAAsC,OAAZN,IAAIM,OAAO;QACnD;QACAE,QAAQC,GAAG,CAACH;QACZd,SAASQ;IACX;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/index.ts"],"sourcesContent":["import Queue from 'queue-cb';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installBin from './installBin.ts';\nimport installLib from './installLib.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n let npmVersion: string | null = null;\n let checksum: string | undefined;\n\n const queue = new Queue(1);\n queue.defer((cb) =>\n installLib(version, dest, options, (err, _npmVersion, _checksum) => {\n npmVersion = _npmVersion;\n checksum = _checksum;\n cb(err);\n })\n );\n queue.defer(installBin.bind(null, version, dest, options));\n queue.await((err) => {\n let message = `npm ${npmVersion || ''}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.slice(0, 8)})`;\n } else {\n message += ` install failed. Error: ${err.message}`;\n }\n console.log(message);\n callback(err);\n });\n}\n"],"names":["install","version","dest","options","callback","npmVersion","checksum","queue","Queue","defer","cb","installLib","err","_npmVersion","_checksum","installBin","bind","await","message","slice","console","log"],"mappings":";;;;+BAKA;;;eAAwBA;;;8DALN;mEAEK;mEACA;;;;;;AAER,SAASA,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,aAA4B;IAChC,IAAIC;IAEJ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAAC,SAACC;eACXC,IAAAA,qBAAU,EAACV,SAASC,MAAMC,SAAS,SAACS,KAAKC,aAAaC;YACpDT,aAAaQ;YACbP,WAAWQ;YACXJ,GAAGE;QACL;;IAEFL,MAAME,KAAK,CAACM,qBAAU,CAACC,IAAI,CAAC,MAAMf,SAASC,MAAMC;IACjDI,MAAMU,KAAK,CAAC,SAACL;QACX,IAAIM,UAAU,AAAC,OAAuB,OAAjBb,cAAc;QACnC,IAAI,CAACO,KAAK;YACRM,WAAW;YACX,IAAIZ,UAAUY,WAAW,AAAC,KAAyB,OAArBZ,SAASa,KAAK,CAAC,GAAG,IAAG;QACrD,OAAO;YACLD,WAAW,AAAC,2BAAsC,OAAZN,IAAIM,OAAO;QACnD;QACAE,QAAQC,GAAG,CAACH;QACZd,SAASQ;IACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/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
+ {"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 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNPM/installLib.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport oo from 'on-one';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_DIST_TAGS_URL, NPM_DIST_URL, NPM_MIN_VERSION } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\n\ninterface DistRecord {\n latest: string;\n}\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, npmVersion?: string, checksum?: string) => void;\n\nfunction calculateChecksum(filePath: string, callback: (err?: Error, checksum?: string) => void): void {\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(filePath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n callback(null, hash.digest('hex'));\n });\n}\n\nexport default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n\n const dist = getDist(version);\n const npmMajorPair = dist && dist.npm ? +dist.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n getContent(NPM_DIST_TAGS_URL, 'utf8', (err, res) => {\n if (err) return callback(err);\n try {\n const distTags = JSON.parse(res.content) as DistRecord;\n const npmVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n const downloadPath = `${NPM_DIST_URL}/-/npm-${npmVersion}.tgz`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: string | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n calculateChecksum(cachePath, (err, hash) => {\n checksum = hash;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, installPath));\n queue.await((err) => {\n err ? callback(err) : callback(null, npmVersion, checksum);\n });\n } catch (_e) {\n return callback(new Error('Failed to parse npm dist-tags'));\n }\n });\n}\n"],"names":["installLib","calculateChecksum","filePath","callback","hash","crypto","createHash","stream","fs","createReadStream","on","data","update","oo","err","digest","version","dest","options","platform","libPath","path","join","installPath","dist","getDist","npmMajorPair","npm","split","NPM_MIN_VERSION","npmMajor","Math","max","getContent","NPM_DIST_TAGS_URL","res","distTags","JSON","parse","content","npmVersion","latest","downloadPath","NPM_DIST_URL","cachePath","basename","checksum","queue","Queue","defer","conditionalCache","bind","cb","extract","await","_e","Error"],"mappings":";;;;+BA6BA;;;eAAwBA;;;6DA7BL;yDACJ;6BACY;uCACH;4DACT;2DACE;8DACC;2BAC+C;yEACpC;gEACT;;;;;;AAUpB,SAASC,kBAAkBC,QAAgB,EAAEC,QAAkD;IAC7F,IAAMC,OAAOC,eAAM,CAACC,UAAU,CAAC;IAC/B,IAAMC,SAASC,WAAE,CAACC,gBAAgB,CAACP;IACnCK,OAAOG,EAAE,CAAC,QAAQ,SAACC;eAASP,KAAKQ,MAAM,CAACD;;IACxCE,IAAAA,cAAE,EAACN,QAAQ;QAAC;QAAS;QAAO;QAAS;KAAS,EAAE,SAACO;QAC/C,IAAIA,KAAK,OAAOX,SAASW;QACzBX,SAAS,MAAMC,KAAKW,MAAM,CAAC;IAC7B;AACF;AAEe,SAASf,WAAWgB,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEf,QAAkB;IAC3G,IAAMgB,WAAWD,QAAQC,QAAQ;IACjC,IAAMC,UAAUD,aAAa,UAAUF,OAAOI,aAAI,CAACC,IAAI,CAACL,MAAM;IAC9D,IAAMM,cAAcF,aAAI,CAACC,IAAI,CAACF,SAAS,gBAAgB;IAEvD,IAAMI,OAAOC,IAAAA,gCAAO,EAACT;IACrB,IAAMU,eAAeF,QAAQA,KAAKG,GAAG,GAAG,CAACH,KAAKG,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGC,4BAAe;IACjF,IAAMC,WAAWC,KAAKC,GAAG,CAACN,cAAcG,4BAAe;IAEvDI,IAAAA,yBAAU,EAACC,8BAAiB,EAAE,QAAQ,SAACpB,KAAKqB;QAC1C,IAAIrB,KAAK,OAAOX,SAASW;QACzB,IAAI;YACF,IAAMsB,WAAWC,KAAKC,KAAK,CAACH,IAAII,OAAO;YACvC,IAAMC,aAAaJ,QAAQ,CAAC,AAAC,UAAkB,OAATN,UAAW,IAAIM,QAAQ,CAAC,AAAC,QAAgB,OAATN,UAAW,IAAIM,SAASK,MAAM;YACpG,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,yBAAY,EAAC,WAAoB,OAAXH,YAAW;YACzD,IAAMI,YAAYvB,aAAI,CAACC,IAAI,CAACJ,QAAQ0B,SAAS,EAAEvB,aAAI,CAACwB,QAAQ,CAACH;YAE7D,IAAII;YACJ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;YACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMT,cAAcE;YACtDG,MAAME,KAAK,CAAC,SAACG;gBACXnD,kBAAkB2C,WAAW,SAAC9B,KAAKV;oBACjC0C,WAAW1C;oBACXgD,GAAGtC;gBACL;YACF;YACAiC,MAAME,KAAK,CAACI,kBAAO,CAACF,IAAI,CAAC,MAAMP,WAAWrB;YAC1CwB,MAAMO,KAAK,CAAC,SAACxC;gBACXA,MAAMX,SAASW,OAAOX,SAAS,MAAMqC,YAAYM;YACnD;QACF,EAAE,OAAOS,IAAI;YACX,OAAOpD,SAAS,IAAIqD,MAAM;QAC5B;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installLib.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport oo from 'on-one';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_DIST_TAGS_URL, NPM_DIST_URL, NPM_MIN_VERSION } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\n\ninterface DistRecord {\n latest: string;\n}\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, npmVersion?: string, checksum?: string) => void;\n\nfunction calculateChecksum(filePath: string, callback: (err?: Error, checksum?: string) => void): void {\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(filePath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n callback(null, hash.digest('hex'));\n });\n}\n\nexport default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n\n const dist = getDist(version);\n const npmMajorPair = dist && dist.npm ? +dist.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n getContent(NPM_DIST_TAGS_URL, 'utf8', (err, res) => {\n if (err) return callback(err);\n try {\n const distTags = JSON.parse(res.content) as DistRecord;\n const npmVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n const downloadPath = `${NPM_DIST_URL}/-/npm-${npmVersion}.tgz`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: string | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n calculateChecksum(cachePath, (err, hash) => {\n checksum = hash;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, installPath));\n queue.await((err) => {\n err ? callback(err) : callback(null, npmVersion, checksum);\n });\n } catch (_e) {\n return callback(new Error('Failed to parse npm dist-tags'));\n }\n });\n}\n"],"names":["installLib","calculateChecksum","filePath","callback","hash","crypto","createHash","stream","fs","createReadStream","on","data","update","oo","err","digest","version","dest","options","platform","libPath","path","join","installPath","dist","getDist","npmMajorPair","npm","split","NPM_MIN_VERSION","npmMajor","Math","max","getContent","NPM_DIST_TAGS_URL","res","distTags","JSON","parse","content","npmVersion","latest","downloadPath","NPM_DIST_URL","cachePath","basename","checksum","queue","Queue","defer","conditionalCache","bind","cb","extract","await","_e","Error"],"mappings":";;;;+BA6BA;;;eAAwBA;;;6DA7BL;yDACJ;6BACY;uCACH;4DACT;2DACE;8DACC;2BAC+C;yEACpC;gEACT;;;;;;AAUpB,SAASC,kBAAkBC,QAAgB,EAAEC,QAAkD;IAC7F,IAAMC,OAAOC,eAAM,CAACC,UAAU,CAAC;IAC/B,IAAMC,SAASC,WAAE,CAACC,gBAAgB,CAACP;IACnCK,OAAOG,EAAE,CAAC,QAAQ,SAACC;eAASP,KAAKQ,MAAM,CAACD;;IACxCE,IAAAA,cAAE,EAACN,QAAQ;QAAC;QAAS;QAAO;QAAS;KAAS,EAAE,SAACO;QAC/C,IAAIA,KAAK,OAAOX,SAASW;QACzBX,SAAS,MAAMC,KAAKW,MAAM,CAAC;IAC7B;AACF;AAEe,SAASf,WAAWgB,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEf,QAAkB;IAC3G,IAAMgB,WAAWD,QAAQC,QAAQ;IACjC,IAAMC,UAAUD,aAAa,UAAUF,OAAOI,aAAI,CAACC,IAAI,CAACL,MAAM;IAC9D,IAAMM,cAAcF,aAAI,CAACC,IAAI,CAACF,SAAS,gBAAgB;IAEvD,IAAMI,OAAOC,IAAAA,gCAAO,EAACT;IACrB,IAAMU,eAAeF,QAAQA,KAAKG,GAAG,GAAG,CAACH,KAAKG,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGC,4BAAe;IACjF,IAAMC,WAAWC,KAAKC,GAAG,CAACN,cAAcG,4BAAe;IAEvDI,IAAAA,yBAAU,EAACC,8BAAiB,EAAE,QAAQ,SAACpB,KAAKqB;QAC1C,IAAIrB,KAAK,OAAOX,SAASW;QACzB,IAAI;YACF,IAAMsB,WAAWC,KAAKC,KAAK,CAACH,IAAII,OAAO;YACvC,IAAMC,aAAaJ,QAAQ,CAAC,AAAC,UAAkB,OAATN,UAAW,IAAIM,QAAQ,CAAC,AAAC,QAAgB,OAATN,UAAW,IAAIM,SAASK,MAAM;YACpG,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,yBAAY,EAAC,WAAoB,OAAXH,YAAW;YACzD,IAAMI,YAAYvB,aAAI,CAACC,IAAI,CAACJ,QAAQ0B,SAAS,EAAEvB,aAAI,CAACwB,QAAQ,CAACH;YAE7D,IAAII;YACJ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;YACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMT,cAAcE;YACtDG,MAAME,KAAK,CAAC,SAACG;gBACXnD,kBAAkB2C,WAAW,SAAC9B,KAAKV;oBACjC0C,WAAW1C;oBACXgD,GAAGtC;gBACL;YACF;YACAiC,MAAME,KAAK,CAACI,kBAAO,CAACF,IAAI,CAAC,MAAMP,WAAWrB;YAC1CwB,MAAMO,KAAK,CAAC,SAACxC;gBACXA,MAAMX,SAASW,OAAOX,SAAS,MAAMqC,YAAYM;YACnD;QACF,EAAE,OAAOS,IAAI;YACX,OAAOpD,SAAS,IAAIqD,MAAM;QAC5B;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/index.ts"],"sourcesContent":["import { FILE_PLATFORM_MAP, FILES } from '../constants.ts';\nimport type { ChecksumResult, InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\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: (err?: Error, checksum?: ChecksumResult) => void, lastErr?: Error) => {\n if (filenames.length === 0) {\n const msg = `Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`;\n return cb(new Error(lastErr ? `${msg}: ${lastErr.message}` : msg));\n }\n installFilename(filenames.shift(), version, dest, options, (err, checksum) => (err ? tryNext(cb, err) : cb(null, checksum)));\n };\n tryNext((err, checksum) => {\n let message = `node ${version.slice(1)}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.actual.slice(0, 8)})`;\n } else {\n message += ' install failed';\n if (checksum) message += ` (${checksum.actual} expecting ${checksum.expected})`;\n message += `. Error: ${err.message}`;\n }\n console.log(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","lastErr","length","msg","Error","message","installFilename","shift","err","checksum","actual","expected","console","log"],"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,MAA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eAA+B,OAAlBD,SAASE,QAAQ,EAAC;YAC7EN,WAAW,AAAC,YAAuB,OAAZG,IAAIH,OAAO;QACpC;QACAO,QAAQC,GAAG,CAACR;QACZ9B,SAASiC;IACX;AACF"}
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 { ChecksumResult, InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\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: (err?: Error, checksum?: ChecksumResult) => void, lastErr?: Error) => {\n if (filenames.length === 0) {\n const msg = `Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`;\n return cb(new Error(lastErr ? `${msg}: ${lastErr.message}` : msg));\n }\n installFilename(filenames.shift(), version, dest, options, (err, checksum) => (err ? tryNext(cb, err) : cb(null, checksum)));\n };\n tryNext((err, checksum) => {\n let message = `node ${version.slice(1)}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.actual.slice(0, 8)})`;\n } else {\n message += ' install failed';\n if (checksum) message += ` (${checksum.actual} expecting ${checksum.expected})`;\n message += `. Error: ${err.message}`;\n }\n console.log(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","lastErr","length","msg","Error","message","installFilename","shift","err","checksum","actual","expected","console","log"],"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,IAAsDC;QACrE,IAAIzB,UAAU0B,MAAM,KAAK,GAAG;YAC1B,IAAMC,MAAM,AAAC,kCAA2C7B,OAAVF,SAAmE,OAAzDE,QAAQG,QAAQ,GAAG,AAAC,cAA8B,OAAjBH,QAAQG,QAAQ,IAAK;YAC9G,OAAOuB,GAAG,IAAII,MAAMH,UAAU,AAAC,GAAUA,OAARE,KAAI,MAAoB,OAAhBF,QAAQI,OAAO,IAAKF;QAC/D;QACAG,IAAAA,0BAAe,EAAC9B,UAAU+B,KAAK,IAAInC,SAASC,MAAMC,SAAS,SAACkC,KAAKC;mBAAcD,MAAMT,QAAQC,IAAIQ,OAAOR,GAAG,MAAMS;;IACnH;IACAV,QAAQ,SAACS,KAAKC;QACZ,IAAIJ,UAAU,AAAC,QAAwB,OAAjBjC,QAAQmB,KAAK,CAAC;QACpC,IAAI,CAACiB,KAAK;YACRH,WAAW;YACX,IAAII,UAAUJ,WAAW,AAAC,KAAgC,OAA5BI,SAASC,MAAM,CAACnB,KAAK,CAAC,GAAG,IAAG;QAC5D,OAAO;YACLc,WAAW;YACX,IAAII,UAAUJ,WAAW,AAAC,KAAiCI,OAA7BA,SAASC,MAAM,EAAC,eAA+B,OAAlBD,SAASE,QAAQ,EAAC;YAC7EN,WAAW,AAAC,YAAuB,OAAZG,IAAIH,OAAO;QACpC;QACAO,QAAQC,GAAG,CAACR;QACZ9B,SAASiC;IACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installCompressed.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\nimport type { ChecksumCallback, ChecksumResult, InstallOptions } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: ChecksumResult | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n validateDownload(distPath, cachePath, (err, result) => {\n checksum = result;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, dest, { strip: 1, time: 1000 }));\n queue.await((err) => callback(err, checksum));\n}\n"],"names":["installCompressed","distPath","dest","options","callback","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","basename","checksum","queue","Queue","defer","conditionalCache","bind","cb","validateDownload","err","result","extract","strip","time","await"],"mappings":";;;;+BASA;;;eAAwBA;;;2DATP;8DACC;2BAEiB;yEACN;gEACT;yEAES;;;;;;AAEd,SAASA,kBAAkBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC3H,IAAMC,eAAe,AAAC,GAAwBJ,OAAtBK,+BAAkB,EAAC,KAAY,OAATL;IAC9C,IAAMM,YAAYC,aAAI,CAACC,IAAI,CAACN,QAAQI,SAAS,EAAEC,aAAI,CAACE,QAAQ,CAACL;IAE7D,IAAIM;IACJ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMX,cAAcE;IACtDK,MAAME,KAAK,CAAC,SAACG;QACXC,IAAAA,2BAAgB,EAACjB,UAAUM,WAAW,SAACY,KAAKC;YAC1CT,WAAWS;YACXH,GAAGE;QACL;IACF;IACAP,MAAME,KAAK,CAACO,kBAAO,CAACL,IAAI,CAAC,MAAMT,WAAWL,MAAM;QAAEoB,OAAO;QAAGC,MAAM;IAAK;IACvEX,MAAMY,KAAK,CAAC,SAACL;eAAQf,SAASe,KAAKR;;AACrC"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installCompressed.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\nimport type { ChecksumCallback, ChecksumResult, InstallOptions } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: ChecksumResult | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n validateDownload(distPath, cachePath, (err, result) => {\n checksum = result;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, dest, { strip: 1, time: 1000 }));\n queue.await((err) => callback(err, checksum));\n}\n"],"names":["installCompressed","distPath","dest","options","callback","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","basename","checksum","queue","Queue","defer","conditionalCache","bind","cb","validateDownload","err","result","extract","strip","time","await"],"mappings":";;;;+BASA;;;eAAwBA;;;2DATP;8DACC;2BAEiB;yEACN;gEACT;yEAES;;;;;;AAEd,SAASA,kBAAkBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC3H,IAAMC,eAAe,AAAC,GAAwBJ,OAAtBK,+BAAkB,EAAC,KAAY,OAATL;IAC9C,IAAMM,YAAYC,aAAI,CAACC,IAAI,CAACN,QAAQI,SAAS,EAAEC,aAAI,CAACE,QAAQ,CAACL;IAE7D,IAAIM;IACJ,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMX,cAAcE;IACtDK,MAAME,KAAK,CAAC,SAACG;QACXC,IAAAA,2BAAgB,EAACjB,UAAUM,WAAW,SAACY,KAAKC;YAC1CT,WAAWS;YACXH,GAAGE;QACL;IACF;IACAP,MAAME,KAAK,CAACO,kBAAO,CAACL,IAAI,CAAC,MAAMT,WAAWL,MAAM;QAAEoB,OAAO;QAAGC,MAAM;IAAK;IACvEX,MAAMY,KAAK,CAAC,SAACL;eAAQf,SAASe,KAAKR;;AACrC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installExe.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL, NODE_FILE_PATHS } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport copyFile from '../lib/copyFile.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, `node-${distPath}.exe`);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(dest, nodePath);\n\n fs.stat(execPath, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(copyFile.bind(null, cachePath, execPath));\n queue.await(callback);\n });\n}\n"],"names":["installExe","distPath","dest","options","callback","platform","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","nodePath","NODE_FILE_PATHS","posix","execPath","fs","stat","err","queue","Queue","defer","conditionalCache","bind","validateDownload","copyFile","await"],"mappings":";;;;+BAUA;;;eAAwBA;;;yDAVT;2DACE;8DACC;2BAEkC;yEACvB;iEACR;yEAEQ;;;;;;AAEd,SAASA,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,eAAe,AAAC,GAAwBL,OAAtBM,+BAAkB,EAAC,KAAY,OAATN;IAC9C,IAAMO,YAAYC,aAAI,CAACC,IAAI,CAACP,QAAQK,SAAS,EAAE,AAAC,QAAgB,OAATP,UAAS;IAChE,IAAMU,WAAWC,4BAAe,CAACP,SAAS,IAAIO,4BAAe,CAACC,KAAK;IACnE,IAAMC,WAAWL,aAAI,CAACC,IAAI,CAACR,MAAMS;IAEjCI,WAAE,CAACC,IAAI,CAACF,UAAU,SAACG;QACjB,IAAI,CAACA,KAAK,OAAOb,YAAY,iBAAiB;QAE9C,IAAMc,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMhB,cAAcE;QACtDU,MAAME,KAAK,CAACG,2BAAgB,CAACD,IAAI,CAAC,MAAMrB,UAAUO;QAClDU,MAAME,KAAK,CAACI,mBAAQ,CAACF,IAAI,CAAC,MAAMd,WAAWM;QAC3CI,MAAMO,KAAK,CAACrB;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installExe.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL, NODE_FILE_PATHS } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport copyFile from '../lib/copyFile.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, `node-${distPath}.exe`);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(dest, nodePath);\n\n fs.stat(execPath, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(copyFile.bind(null, cachePath, execPath));\n queue.await(callback);\n });\n}\n"],"names":["installExe","distPath","dest","options","callback","platform","downloadPath","NODE_DIST_BASE_URL","cachePath","path","join","nodePath","NODE_FILE_PATHS","posix","execPath","fs","stat","err","queue","Queue","defer","conditionalCache","bind","validateDownload","copyFile","await"],"mappings":";;;;+BAUA;;;eAAwBA;;;yDAVT;2DACE;8DACC;2BAEkC;yEACvB;iEACR;yEAEQ;;;;;;AAEd,SAASA,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,eAAe,AAAC,GAAwBL,OAAtBM,+BAAkB,EAAC,KAAY,OAATN;IAC9C,IAAMO,YAAYC,aAAI,CAACC,IAAI,CAACP,QAAQK,SAAS,EAAE,AAAC,QAAgB,OAATP,UAAS;IAChE,IAAMU,WAAWC,4BAAe,CAACP,SAAS,IAAIO,4BAAe,CAACC,KAAK;IACnE,IAAMC,WAAWL,aAAI,CAACC,IAAI,CAACR,MAAMS;IAEjCI,WAAE,CAACC,IAAI,CAACF,UAAU,SAACG;QACjB,IAAI,CAACA,KAAK,OAAOb,YAAY,iBAAiB;QAE9C,IAAMc,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMhB,cAAcE;QACtDU,MAAME,KAAK,CAACG,2BAAgB,CAACD,IAAI,CAAC,MAAMrB,UAAUO;QAClDU,MAAME,KAAK,CAACI,mBAAQ,CAACF,IAAI,CAAC,MAAMd,WAAWM;QAC3CI,MAAMO,KAAK,CAACrB;IACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installFilename.ts"],"sourcesContent":["import fromFilename from 'node-filename-to-dist-paths';\nimport path from 'path';\nimport { EXTENSIONS_COMPRESSED } from '../constants.ts';\nimport type { ChecksumCallback, InstallOptions } from '../types.ts';\nimport installCompressed from './installCompressed.ts';\nimport installExe from './installExe.ts';\nimport installSource from './installSource/index.ts';\n\nexport default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const distPath = fromFilename(filename, version);\n if (!distPath) {\n callback(new Error('Not found'));\n return;\n }\n const ext = path.extname(distPath);\n\n if (filename === 'src') return installSource(distPath, dest, options, callback);\n if (ext === '.exe') return installExe(distPath, dest, options, callback);\n if (EXTENSIONS_COMPRESSED.indexOf(ext) >= 0) {\n return installCompressed(distPath, dest, options, callback);\n }\n callback(new Error(`Unable to install ${version} distPath: ${distPath}`));\n}\n"],"names":["installFilename","filename","version","dest","options","callback","distPath","fromFilename","Error","ext","path","extname","installSource","installExe","EXTENSIONS_COMPRESSED","indexOf","installCompressed"],"mappings":";;;;+BAQA;;;eAAwBA;;;8EARC;2DACR;2BACqB;0EAER;mEACP;8DACG;;;;;;AAEX,SAASA,gBAAgBC,QAAgB,EAAEC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1I,IAAMC,WAAWC,IAAAA,gCAAY,EAACN,UAAUC;IACxC,IAAI,CAACI,UAAU;QACbD,SAAS,IAAIG,MAAM;QACnB;IACF;IACA,IAAMC,MAAMC,aAAI,CAACC,OAAO,CAACL;IAEzB,IAAIL,aAAa,OAAO,OAAOW,IAAAA,gBAAa,EAACN,UAAUH,MAAMC,SAASC;IACtE,IAAII,QAAQ,QAAQ,OAAOI,IAAAA,qBAAU,EAACP,UAAUH,MAAMC,SAASC;IAC/D,IAAIS,kCAAqB,CAACC,OAAO,CAACN,QAAQ,GAAG;QAC3C,OAAOO,IAAAA,4BAAiB,EAACV,UAAUH,MAAMC,SAASC;IACpD;IACAA,SAAS,IAAIG,MAAM,AAAC,qBAAyCF,OAArBJ,SAAQ,eAAsB,OAATI;AAC/D"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installFilename.ts"],"sourcesContent":["import fromFilename from 'node-filename-to-dist-paths';\nimport path from 'path';\nimport { EXTENSIONS_COMPRESSED } from '../constants.ts';\nimport type { ChecksumCallback, InstallOptions } from '../types.ts';\nimport installCompressed from './installCompressed.ts';\nimport installExe from './installExe.ts';\nimport installSource from './installSource/index.ts';\n\nexport default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const distPath = fromFilename(filename, version);\n if (!distPath) {\n callback(new Error('Not found'));\n return;\n }\n const ext = path.extname(distPath);\n\n if (filename === 'src') return installSource(distPath, dest, options, callback);\n if (ext === '.exe') return installExe(distPath, dest, options, callback);\n if (EXTENSIONS_COMPRESSED.indexOf(ext) >= 0) {\n return installCompressed(distPath, dest, options, callback);\n }\n callback(new Error(`Unable to install ${version} distPath: ${distPath}`));\n}\n"],"names":["installFilename","filename","version","dest","options","callback","distPath","fromFilename","Error","ext","path","extname","installSource","installExe","EXTENSIONS_COMPRESSED","indexOf","installCompressed"],"mappings":";;;;+BAQA;;;eAAwBA;;;8EARC;2DACR;2BACqB;0EAER;mEACP;8DACG;;;;;;AAEX,SAASA,gBAAgBC,QAAgB,EAAEC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1I,IAAMC,WAAWC,IAAAA,gCAAY,EAACN,UAAUC;IACxC,IAAI,CAACI,UAAU;QACbD,SAAS,IAAIG,MAAM;QACnB;IACF;IACA,IAAMC,MAAMC,aAAI,CAACC,OAAO,CAACL;IAEzB,IAAIL,aAAa,OAAO,OAAOW,IAAAA,gBAAa,EAACN,UAAUH,MAAMC,SAASC;IACtE,IAAII,QAAQ,QAAQ,OAAOI,IAAAA,qBAAU,EAACP,UAAUH,MAAMC,SAASC;IAC/D,IAAIS,kCAAqB,CAACC,OAAO,CAACN,QAAQ,GAAG;QAC3C,OAAOO,IAAAA,4BAAiB,EAACV,UAAUH,MAAMC,SAASC;IACpD;IACAA,SAAS,IAAIG,MAAM,AAAC,qBAAyCF,OAArBJ,SAAQ,eAAsB,OAATI;AAC/D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installSource/buildPosix.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildTarget = path.join(dest, 'node');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, './configure', [`--prefix=${dest}`], { stdio: 'inherit', cwd: buildPath }));\n queue.defer(spawn.bind(null, 'make', ['install'], { stdio: 'inherit', cwd: buildPath }, callback));\n queue.await(callback);\n });\n}\n"],"names":["installPosix","buildPath","dest","_options","callback","buildTarget","path","join","fs","stat","err","queue","Queue","defer","spawn","bind","stdio","cwd","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;mEAPN;yDACH;2DACE;8DACC;;;;;;AAIH,SAASA,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACL,MAAM;IAEpCM,WAAE,CAACC,IAAI,CAACJ,aAAa,SAACK;QACpB,IAAI,CAACA,KAAK,OAAON,YAAY,iBAAiB;QAE9C,IAAMO,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,qBAAK,CAACC,IAAI,CAAC,MAAM,eAAe;YAAE,YAAgB,OAALb;SAAO,EAAE;YAAEc,OAAO;YAAWC,KAAKhB;QAAU;QACrGU,MAAME,KAAK,CAACC,qBAAK,CAACC,IAAI,CAAC,MAAM,QAAQ;YAAC;SAAU,EAAE;YAAEC,OAAO;YAAWC,KAAKhB;QAAU,GAAGG;QACxFO,MAAMO,KAAK,CAACd;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/buildPosix.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildTarget = path.join(dest, 'node');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, './configure', [`--prefix=${dest}`], { stdio: 'inherit', cwd: buildPath }));\n queue.defer(spawn.bind(null, 'make', ['install'], { stdio: 'inherit', cwd: buildPath }, callback));\n queue.await(callback);\n });\n}\n"],"names":["installPosix","buildPath","dest","_options","callback","buildTarget","path","join","fs","stat","err","queue","Queue","defer","spawn","bind","stdio","cwd","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;mEAPN;yDACH;2DACE;8DACC;;;;;;AAIH,SAASA,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACL,MAAM;IAEpCM,WAAE,CAACC,IAAI,CAACJ,aAAa,SAACK;QACpB,IAAI,CAACA,KAAK,OAAON,YAAY,iBAAiB;QAE9C,IAAMO,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,qBAAK,CAACC,IAAI,CAAC,MAAM,eAAe;YAAE,YAAgB,OAALb;SAAO,EAAE;YAAEc,OAAO;YAAWC,KAAKhB;QAAU;QACrGU,MAAME,KAAK,CAACC,qBAAK,CAACC,IAAI,CAAC,MAAM,QAAQ;YAAC;SAAU,EAAE;YAAEC,OAAO;YAAWC,KAAKhB;QAAU,GAAGG;QACxFO,MAAMO,KAAK,CAACd;IACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installSource/buildWin32.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport conditionalCopy from '../../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n const buildTarget = path.join(dest, 'node.exe');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(fs.stat.bind(null, buildSource, (err) => (!err ? callback() : spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }))));\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget, false));\n queue.await(callback);\n });\n}\n"],"names":["installWin32","buildPath","dest","_options","callback","buildSource","path","join","buildTarget","fs","stat","err","queue","Queue","defer","bind","spawn","stdio","cwd","conditionalCopy","await"],"mappings":";;;;+BAQA;;;eAAwBA;;;mEARN;yDACH;2DACE;8DACC;wEACU;;;;;;AAIb,SAASA,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACN,WAAW,OAAO,WAAW;IAC3D,IAAMO,cAAcF,aAAI,CAACC,IAAI,CAACL,MAAM;IAEpCO,WAAE,CAACC,IAAI,CAACF,aAAa,SAACG;QACpB,IAAI,CAACA,KAAK,OAAOP,YAAY,iBAAiB;QAE9C,IAAMQ,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACL,WAAE,CAACC,IAAI,CAACK,IAAI,CAAC,MAAMV,aAAa,SAACM;mBAAS,CAACA,MAAMP,aAAaY,IAAAA,qBAAK,EAAC,aAAa,EAAE,EAAE;gBAAEC,OAAO;gBAAWC,KAAKjB;YAAU;;QACpIW,MAAME,KAAK,CAACK,0BAAe,CAACJ,IAAI,CAAC,MAAMV,aAAaG,aAAa;QACjEI,MAAMQ,KAAK,CAAChB;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/buildWin32.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport conditionalCopy from '../../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n const buildTarget = path.join(dest, 'node.exe');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(fs.stat.bind(null, buildSource, (err) => (!err ? callback() : spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }))));\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget, false));\n queue.await(callback);\n });\n}\n"],"names":["installWin32","buildPath","dest","_options","callback","buildSource","path","join","buildTarget","fs","stat","err","queue","Queue","defer","bind","spawn","stdio","cwd","conditionalCopy","await"],"mappings":";;;;+BAQA;;;eAAwBA;;;mEARN;yDACH;2DACE;8DACC;wEACU;;;;;;AAIb,SAASA,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACN,WAAW,OAAO,WAAW;IAC3D,IAAMO,cAAcF,aAAI,CAACC,IAAI,CAACL,MAAM;IAEpCO,WAAE,CAACC,IAAI,CAACF,aAAa,SAACG;QACpB,IAAI,CAACA,KAAK,OAAOP,YAAY,iBAAiB;QAE9C,IAAMQ,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACL,WAAE,CAACC,IAAI,CAACK,IAAI,CAAC,MAAMV,aAAa,SAACM;mBAAS,CAACA,MAAMP,aAAaY,IAAAA,qBAAK,EAAC,aAAa,EAAE,EAAE;gBAAEC,OAAO;gBAAWC,KAAKjB;YAAU;;QACpIW,MAAME,KAAK,CAACK,0BAAe,CAACJ,IAAI,CAAC,MAAMV,aAAaG,aAAa;QACjEI,MAAMQ,KAAK,CAAChB;IACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installSource/index.ts"],"sourcesContent":["import { safeRm } from 'fs-remove-compat';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { NODE_DIST_BASE_URL } from '../../constants.ts';\nimport conditionalCache from '../../lib/conditionalCache.ts';\nimport extract from '../../lib/extract.ts';\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\nimport validateDownload from '../validateDownload.ts';\nimport buildPosix from './buildPosix.ts';\nimport buildWin32 from './buildWin32.ts';\n\nexport default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const build = platform === 'win32' ? buildWin32 : buildPosix;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n // Use temp build path to avoid race conditions with parallel builds\n const tempBuildPath = tempSuffix(path.join(options.buildPath, path.basename(distPath)));\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(extract.bind(null, cachePath, tempBuildPath));\n queue.defer(build.bind(null, tempBuildPath, dest, options));\n queue.await((err) => {\n // Always clean up temp build directory\n safeRm(tempBuildPath, () => callback(err));\n });\n}\n"],"names":["InstallSource","distPath","dest","options","callback","platform","build","buildWin32","buildPosix","downloadPath","NODE_DIST_BASE_URL","tempBuildPath","tempSuffix","path","join","buildPath","basename","cachePath","queue","Queue","defer","conditionalCache","bind","validateDownload","extract","await","err","safeRm"],"mappings":";;;;+BAaA;;;eAAwBA;;;8BAbD;2DACN;8DACC;iEACK;2BAEY;yEACN;gEACT;yEAES;mEACN;mEACA;;;;;;AAER,SAASA,cAAcC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACtH,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,QAAQD,aAAa,UAAUE,qBAAU,GAAGC,qBAAU;IAC5D,IAAMC,eAAe,AAAC,GAAwBR,OAAtBS,+BAAkB,EAAC,KAAY,OAATT;IAC9C,oEAAoE;IACpE,IAAMU,gBAAgBC,IAAAA,mBAAU,EAACC,aAAI,CAACC,IAAI,CAACX,QAAQY,SAAS,EAAEF,aAAI,CAACG,QAAQ,CAACf;IAC5E,IAAMgB,YAAYJ,aAAI,CAACC,IAAI,CAACX,QAAQc,SAAS,EAAEJ,aAAI,CAACG,QAAQ,CAACP;IAE7D,IAAMS,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMb,cAAcQ;IACtDC,MAAME,KAAK,CAACG,2BAAgB,CAACD,IAAI,CAAC,MAAMrB,UAAUgB;IAClDC,MAAME,KAAK,CAACI,kBAAO,CAACF,IAAI,CAAC,MAAML,WAAWN;IAC1CO,MAAME,KAAK,CAACd,MAAMgB,IAAI,CAAC,MAAMX,eAAeT,MAAMC;IAClDe,MAAMO,KAAK,CAAC,SAACC;QACX,uCAAuC;QACvCC,IAAAA,sBAAM,EAAChB,eAAe;mBAAMP,SAASsB;;IACvC;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/index.ts"],"sourcesContent":["import { safeRm } from 'fs-remove-compat';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { NODE_DIST_BASE_URL } from '../../constants.ts';\nimport conditionalCache from '../../lib/conditionalCache.ts';\nimport extract from '../../lib/extract.ts';\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\nimport validateDownload from '../validateDownload.ts';\nimport buildPosix from './buildPosix.ts';\nimport buildWin32 from './buildWin32.ts';\n\nexport default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const build = platform === 'win32' ? buildWin32 : buildPosix;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n // Use temp build path to avoid race conditions with parallel builds\n const tempBuildPath = tempSuffix(path.join(options.buildPath, path.basename(distPath)));\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(extract.bind(null, cachePath, tempBuildPath));\n queue.defer(build.bind(null, tempBuildPath, dest, options));\n queue.await((err) => {\n // Always clean up temp build directory\n safeRm(tempBuildPath, () => callback(err));\n });\n}\n"],"names":["InstallSource","distPath","dest","options","callback","platform","build","buildWin32","buildPosix","downloadPath","NODE_DIST_BASE_URL","tempBuildPath","tempSuffix","path","join","buildPath","basename","cachePath","queue","Queue","defer","conditionalCache","bind","validateDownload","extract","await","err","safeRm"],"mappings":";;;;+BAaA;;;eAAwBA;;;8BAbD;2DACN;8DACC;iEACK;2BAEY;yEACN;gEACT;yEAES;mEACN;mEACA;;;;;;AAER,SAASA,cAAcC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACtH,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,QAAQD,aAAa,UAAUE,qBAAU,GAAGC,qBAAU;IAC5D,IAAMC,eAAe,AAAC,GAAwBR,OAAtBS,+BAAkB,EAAC,KAAY,OAATT;IAC9C,oEAAoE;IACpE,IAAMU,gBAAgBC,IAAAA,mBAAU,EAACC,aAAI,CAACC,IAAI,CAACX,QAAQY,SAAS,EAAEF,aAAI,CAACG,QAAQ,CAACf;IAC5E,IAAMgB,YAAYJ,aAAI,CAACC,IAAI,CAACX,QAAQc,SAAS,EAAEJ,aAAI,CAACG,QAAQ,CAACP;IAE7D,IAAMS,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAACC,2BAAgB,CAACC,IAAI,CAAC,MAAMb,cAAcQ;IACtDC,MAAME,KAAK,CAACG,2BAAgB,CAACD,IAAI,CAAC,MAAMrB,UAAUgB;IAClDC,MAAME,KAAK,CAACI,kBAAO,CAACF,IAAI,CAAC,MAAML,WAAWN;IAC1CO,MAAME,KAAK,CAACd,MAAMgB,IAAI,CAAC,MAAMX,eAAeT,MAAMC;IAClDe,MAAMO,KAAK,CAAC,SAACC;QACX,uCAAuC;QACvCC,IAAAA,sBAAM,EAAChB,eAAe;mBAAMP,SAASsB;;IACvC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/validateDownload.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport oo from 'on-one';\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\n\nimport type { ChecksumCallback, ChecksumResult } from '../types.ts';\n\nexport default function validateDownload(distPath: string, installPath: string, callback: ChecksumCallback): void {\n const version = distPath.split('/')[0];\n const downloadPath = `${NODE_DIST_BASE_URL}/${version}/SHASUMS256.txt`;\n getContent(downloadPath, 'utf8', (err, res) => {\n if (err) return callback(err);\n const text = res.content;\n const filename = distPath.split('/').slice(1).join('/');\n const expected = text.split(filename)[0].split('\\n').pop().trim();\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(installPath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n const actual = hash.digest('hex');\n const match = actual === expected;\n const checksum: ChecksumResult = { actual, expected, match };\n match ? callback(null, checksum) : callback(new Error(`${filename} checksum failed`), checksum);\n });\n });\n}\n"],"names":["validateDownload","distPath","installPath","callback","version","split","downloadPath","NODE_DIST_BASE_URL","getContent","err","res","text","content","filename","slice","join","expected","pop","trim","hash","crypto","createHash","stream","fs","createReadStream","on","data","update","oo","actual","digest","match","checksum","Error"],"mappings":";;;;+BAQA;;;eAAwBA;;;6DARL;yDACJ;6BACY;4DACZ;2BACoB;;;;;;AAIpB,SAASA,iBAAiBC,QAAgB,EAAEC,WAAmB,EAAEC,QAA0B;IACxG,IAAMC,UAAUH,SAASI,KAAK,CAAC,IAAI,CAAC,EAAE;IACtC,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,+BAAkB,EAAC,KAAW,OAARH,SAAQ;IACtDI,IAAAA,yBAAU,EAACF,cAAc,QAAQ,SAACG,KAAKC;QACrC,IAAID,KAAK,OAAON,SAASM;QACzB,IAAME,OAAOD,IAAIE,OAAO;QACxB,IAAMC,WAAWZ,SAASI,KAAK,CAAC,KAAKS,KAAK,CAAC,GAAGC,IAAI,CAAC;QACnD,IAAMC,WAAWL,KAAKN,KAAK,CAACQ,SAAS,CAAC,EAAE,CAACR,KAAK,CAAC,MAAMY,GAAG,GAAGC,IAAI;QAC/D,IAAMC,OAAOC,eAAM,CAACC,UAAU,CAAC;QAC/B,IAAMC,SAASC,WAAE,CAACC,gBAAgB,CAACtB;QACnCoB,OAAOG,EAAE,CAAC,QAAQ,SAACC;mBAASP,KAAKQ,MAAM,CAACD;;QACxCE,IAAAA,cAAE,EAACN,QAAQ;YAAC;YAAS;YAAO;YAAS;SAAS,EAAE,SAACb;YAC/C,IAAIA,KAAK,OAAON,SAASM;YACzB,IAAMoB,SAASV,KAAKW,MAAM,CAAC;YAC3B,IAAMC,QAAQF,WAAWb;YACzB,IAAMgB,WAA2B;gBAAEH,QAAAA;gBAAQb,UAAAA;gBAAUe,OAAAA;YAAM;YAC3DA,QAAQ5B,SAAS,MAAM6B,YAAY7B,SAAS,IAAI8B,MAAM,AAAC,GAAW,OAATpB,UAAS,sBAAoBmB;QACxF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/validateDownload.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport oo from 'on-one';\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\n\nimport type { ChecksumCallback, ChecksumResult } from '../types.ts';\n\nexport default function validateDownload(distPath: string, installPath: string, callback: ChecksumCallback): void {\n const version = distPath.split('/')[0];\n const downloadPath = `${NODE_DIST_BASE_URL}/${version}/SHASUMS256.txt`;\n getContent(downloadPath, 'utf8', (err, res) => {\n if (err) return callback(err);\n const text = res.content;\n const filename = distPath.split('/').slice(1).join('/');\n const expected = text.split(filename)[0].split('\\n').pop().trim();\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(installPath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n const actual = hash.digest('hex');\n const match = actual === expected;\n const checksum: ChecksumResult = { actual, expected, match };\n match ? callback(null, checksum) : callback(new Error(`${filename} checksum failed`), checksum);\n });\n });\n}\n"],"names":["validateDownload","distPath","installPath","callback","version","split","downloadPath","NODE_DIST_BASE_URL","getContent","err","res","text","content","filename","slice","join","expected","pop","trim","hash","crypto","createHash","stream","fs","createReadStream","on","data","update","oo","actual","digest","match","checksum","Error"],"mappings":";;;;+BAQA;;;eAAwBA;;;6DARL;yDACJ;6BACY;4DACZ;2BACoB;;;;;;AAIpB,SAASA,iBAAiBC,QAAgB,EAAEC,WAAmB,EAAEC,QAA0B;IACxG,IAAMC,UAAUH,SAASI,KAAK,CAAC,IAAI,CAAC,EAAE;IACtC,IAAMC,eAAe,AAAC,GAAwBF,OAAtBG,+BAAkB,EAAC,KAAW,OAARH,SAAQ;IACtDI,IAAAA,yBAAU,EAACF,cAAc,QAAQ,SAACG,KAAKC;QACrC,IAAID,KAAK,OAAON,SAASM;QACzB,IAAME,OAAOD,IAAIE,OAAO;QACxB,IAAMC,WAAWZ,SAASI,KAAK,CAAC,KAAKS,KAAK,CAAC,GAAGC,IAAI,CAAC;QACnD,IAAMC,WAAWL,KAAKN,KAAK,CAACQ,SAAS,CAAC,EAAE,CAACR,KAAK,CAAC,MAAMY,GAAG,GAAGC,IAAI;QAC/D,IAAMC,OAAOC,eAAM,CAACC,UAAU,CAAC;QAC/B,IAAMC,SAASC,WAAE,CAACC,gBAAgB,CAACtB;QACnCoB,OAAOG,EAAE,CAAC,QAAQ,SAACC;mBAASP,KAAKQ,MAAM,CAACD;;QACxCE,IAAAA,cAAE,EAACN,QAAQ;YAAC;YAAS;YAAO;YAAS;SAAS,EAAE,SAACb;YAC/C,IAAIA,KAAK,OAAON,SAASM;YACzB,IAAMoB,SAASV,KAAKW,MAAM,CAAC;YAC3B,IAAMC,QAAQF,WAAWb;YACzB,IAAMgB,WAA2B;gBAAEH,QAAAA;gBAAQb,UAAAA;gBAAUe,OAAAA;YAAM;YAC3DA,QAAQ5B,SAAS,MAAM6B,YAAY7B,SAAS,IAAI8B,MAAM,AAAC,GAAW,OAATpB,UAAS,sBAAoBmB;QACxF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/checkMissing.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_FILE_PATHS, NPM_PACKAGE_PATH } from '../constants.ts';\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, missing?: string[]) => void;\n\nexport default function checkMissing(dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const npmPackagePath = NPM_PACKAGE_PATH[platform] || NPM_PACKAGE_PATH.posix;\n\n const missing: string[] = [];\n function check(filePath, key, cb) {\n fs.stat(path.join(dest, filePath), (err) => {\n if (err && missing.indexOf(key) < 0) missing.push(key);\n cb();\n });\n }\n\n const queue = new Queue();\n queue.defer(check.bind(null, nodePath, 'node'));\n queue.defer(check.bind(null, npmPackagePath, 'npm'));\n queue.await(() => callback(null, missing));\n}\n"],"names":["checkMissing","dest","options","callback","platform","nodePath","NODE_FILE_PATHS","posix","npmPackagePath","NPM_PACKAGE_PATH","missing","check","filePath","key","cb","fs","stat","path","join","err","indexOf","push","queue","Queue","defer","bind","await"],"mappings":";;;;+BAUA;;;eAAwBA;;;yDAVT;2DACE;8DACC;2BAEgC;;;;;;AAMnC,SAASA,aAAaC,IAAY,EAAEC,OAAuB,EAAEC,QAAkB;IAC5F,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,WAAWC,4BAAe,CAACF,SAAS,IAAIE,4BAAe,CAACC,KAAK;IACnE,IAAMC,iBAAiBC,6BAAgB,CAACL,SAAS,IAAIK,6BAAgB,CAACF,KAAK;IAE3E,IAAMG,UAAoB,EAAE;IAC5B,SAASC,MAAMC,QAAQ,EAAEC,GAAG,EAAEC,EAAE;QAC9BC,WAAE,CAACC,IAAI,CAACC,aAAI,CAACC,IAAI,CAACjB,MAAMW,WAAW,SAACO;YAClC,IAAIA,OAAOT,QAAQU,OAAO,CAACP,OAAO,GAAGH,QAAQW,IAAI,CAACR;YAClDC;QACF;IACF;IAEA,IAAMQ,QAAQ,IAAIC,gBAAK;IACvBD,MAAME,KAAK,CAACb,MAAMc,IAAI,CAAC,MAAMpB,UAAU;IACvCiB,MAAME,KAAK,CAACb,MAAMc,IAAI,CAAC,MAAMjB,gBAAgB;IAC7Cc,MAAMI,KAAK,CAAC;eAAMvB,SAAS,MAAMO;;AACnC"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/checkMissing.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_FILE_PATHS, NPM_PACKAGE_PATH } from '../constants.ts';\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, missing?: string[]) => void;\n\nexport default function checkMissing(dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const npmPackagePath = NPM_PACKAGE_PATH[platform] || NPM_PACKAGE_PATH.posix;\n\n const missing: string[] = [];\n function check(filePath, key, cb) {\n fs.stat(path.join(dest, filePath), (err) => {\n if (err && missing.indexOf(key) < 0) missing.push(key);\n cb();\n });\n }\n\n const queue = new Queue();\n queue.defer(check.bind(null, nodePath, 'node'));\n queue.defer(check.bind(null, npmPackagePath, 'npm'));\n queue.await(() => callback(null, missing));\n}\n"],"names":["checkMissing","dest","options","callback","platform","nodePath","NODE_FILE_PATHS","posix","npmPackagePath","NPM_PACKAGE_PATH","missing","check","filePath","key","cb","fs","stat","path","join","err","indexOf","push","queue","Queue","defer","bind","await"],"mappings":";;;;+BAUA;;;eAAwBA;;;yDAVT;2DACE;8DACC;2BAEgC;;;;;;AAMnC,SAASA,aAAaC,IAAY,EAAEC,OAAuB,EAAEC,QAAkB;IAC5F,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,WAAWC,4BAAe,CAACF,SAAS,IAAIE,4BAAe,CAACC,KAAK;IACnE,IAAMC,iBAAiBC,6BAAgB,CAACL,SAAS,IAAIK,6BAAgB,CAACF,KAAK;IAE3E,IAAMG,UAAoB,EAAE;IAC5B,SAASC,MAAMC,QAAQ,EAAEC,GAAG,EAAEC,EAAE;QAC9BC,WAAE,CAACC,IAAI,CAACC,aAAI,CAACC,IAAI,CAACjB,MAAMW,WAAW,SAACO;YAClC,IAAIA,OAAOT,QAAQU,OAAO,CAACP,OAAO,GAAGH,QAAQW,IAAI,CAACR;YAClDC;QACF;IACF;IAEA,IAAMQ,QAAQ,IAAIC,gBAAK;IACvBD,MAAME,KAAK,CAACb,MAAMc,IAAI,CAAC,MAAMpB,UAAU;IACvCiB,MAAME,KAAK,CAACb,MAAMc,IAAI,CAAC,MAAMjB,gBAAgB;IAC7Cc,MAAMI,KAAK,CAAC;eAAMvB,SAAS,MAAMO;;AACnC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/conditionalCache.ts"],"sourcesContent":["import fs from 'fs';\nimport { getFile } from 'get-file-compat';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): void {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n ensureDestinationParent(dest, (err) => {\n err ? callback(err) : getFile(endpoint, dest, callback);\n });\n });\n}\n"],"names":["conditionalCache","endpoint","dest","options","callback","fs","stat","err","ensureDestinationParent","getFile"],"mappings":";;;;+BAKA;;;eAAwBA;;;yDALT;6BACS;gFAEY;;;;;;AAErB,SAASA,iBAAiBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1HA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;IACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DE,WAAE,CAACC,IAAI,CAACJ,MAAM,SAACK;QACb,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAC9CI,IAAAA,kCAAuB,EAACN,MAAM,SAACK;YAC7BA,MAAMH,SAASG,OAAOE,IAAAA,sBAAO,EAACR,UAAUC,MAAME;QAChD;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCache.ts"],"sourcesContent":["import fs from 'fs';\nimport { getFile } from 'get-file-compat';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): void {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n ensureDestinationParent(dest, (err) => {\n err ? callback(err) : getFile(endpoint, dest, callback);\n });\n });\n}\n"],"names":["conditionalCache","endpoint","dest","options","callback","fs","stat","err","ensureDestinationParent","getFile"],"mappings":";;;;+BAKA;;;eAAwBA;;;yDALT;6BACS;gFAEY;;;;;;AAErB,SAASA,iBAAiBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1HA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;IACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DE,WAAE,CAACC,IAAI,CAACJ,MAAM,SAACK;QACb,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAC9CI,IAAAA,kCAAuB,EAACN,MAAM,SAACK;YAC7BA,MAAMH,SAASG,OAAOE,IAAAA,sBAAO,EAACR,UAAUC,MAAME;QAChD;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/conditionalCopy.ts"],"sourcesContent":["import fs from 'fs';\nimport type { NoParamCallback } from '../types.ts';\nimport copyFile from './copyFile.ts';\n\nexport default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): void {\n if (typeof optional === 'function') {\n callback(new Error('conditionalCopy missing options'));\n return;\n }\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n\n fs.stat(src, (err) => {\n err && optional ? callback() : copyFile(src, dest, callback); // optional file missing\n });\n });\n}\n"],"names":["conditionalCopy","src","dest","optional","callback","Error","fs","stat","err","copyFile"],"mappings":";;;;+BAIA;;;eAAwBA;;;yDAJT;iEAEM;;;;;;AAEN,SAASA,gBAAgBC,GAAW,EAAEC,IAAY,EAAEC,QAAiB,EAAEC,QAAyB;IAC7G,IAAI,OAAOD,aAAa,YAAY;QAClCC,SAAS,IAAIC,MAAM;QACnB;IACF;IAEAC,WAAE,CAACC,IAAI,CAACL,MAAM,SAACM;QACb,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;QAE9CE,WAAE,CAACC,IAAI,CAACN,KAAK,SAACO;YACZA,OAAOL,WAAWC,aAAaK,IAAAA,mBAAQ,EAACR,KAAKC,MAAME,WAAW,wBAAwB;QACxF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCopy.ts"],"sourcesContent":["import fs from 'fs';\nimport type { NoParamCallback } from '../types.ts';\nimport copyFile from './copyFile.ts';\n\nexport default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): void {\n if (typeof optional === 'function') {\n callback(new Error('conditionalCopy missing options'));\n return;\n }\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n\n fs.stat(src, (err) => {\n err && optional ? callback() : copyFile(src, dest, callback); // optional file missing\n });\n });\n}\n"],"names":["conditionalCopy","src","dest","optional","callback","Error","fs","stat","err","copyFile"],"mappings":";;;;+BAIA;;;eAAwBA;;;yDAJT;iEAEM;;;;;;AAEN,SAASA,gBAAgBC,GAAW,EAAEC,IAAY,EAAEC,QAAiB,EAAEC,QAAyB;IAC7G,IAAI,OAAOD,aAAa,YAAY;QAClCC,SAAS,IAAIC,MAAM;QACnB;IACF;IAEAC,WAAE,CAACC,IAAI,CAACL,MAAM,SAACM;QACb,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;QAE9CE,WAAE,CAACC,IAAI,CAACN,KAAK,SAACO;YACZA,OAAOL,WAAWC,aAAaK,IAAAA,mBAAQ,EAACR,KAAKC,MAAME,WAAW,wBAAwB;QACxF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import type { NoParamCallback } from 'fs';\nimport { copyFile } from 'fs-copy-compat';\nimport { safeRm } from 'fs-remove-compat';\nimport Queue from 'queue-cb';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n safeRm(dest, callback);\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["safeCopyFile","src","dest","callback","queue","Queue","defer","ensureDestinationParent","bind","safeRm","copyFile","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;4BANC;8BACF;8DACL;gFAEkB;;;;;;AAErB,SAASA,aAAaC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IAExBD,MAAME,KAAK,CAACC,kCAAuB,CAACC,IAAI,CAAC,MAAMN;IAC/CE,MAAME,KAAK,CAAC,SAACH;QACXM,IAAAA,sBAAM,EAACP,MAAMC;IACf;IACAC,MAAME,KAAK,CAACI,sBAAQ,CAACF,IAAI,CAAC,MAAMP,KAAKC;IACrCE,MAAMO,KAAK,CAACR;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import type { NoParamCallback } from 'fs';\nimport { copyFile } from 'fs-copy-compat';\nimport { safeRm } from 'fs-remove-compat';\nimport Queue from 'queue-cb';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n safeRm(dest, callback);\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["safeCopyFile","src","dest","callback","queue","Queue","defer","ensureDestinationParent","bind","safeRm","copyFile","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;4BANC;8BACF;8DACL;gFAEkB;;;;;;AAErB,SAASA,aAAaC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IAExBD,MAAME,KAAK,CAACC,kCAAuB,CAACC,IAAI,CAAC,MAAMN;IAC/CE,MAAME,KAAK,CAAC,SAACH;QACXM,IAAAA,sBAAM,EAACP,MAAMC;IACf;IACAC,MAAME,KAAK,CAACI,sBAAQ,CAACF,IAAI,CAAC,MAAMP,KAAKC;IACrCE,MAAMO,KAAK,CAACR;AACd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/ensureDestinationParent.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\n\nimport type { NoParamCallback } from '../types.ts';\n\nexport default function ensureDestinationParent(dest: string, callback: NoParamCallback): void {\n const parent = path.dirname(dest);\n if (parent === '.' || parent === '/') return callback();\n mkdirp(parent, callback);\n}\n"],"names":["ensureDestinationParent","dest","callback","parent","path","dirname","mkdirp"],"mappings":";;;;+BAKA;;;eAAwBA;;;oEALL;2DACF;;;;;;AAIF,SAASA,wBAAwBC,IAAY,EAAEC,QAAyB;IACrF,IAAMC,SAASC,aAAI,CAACC,OAAO,CAACJ;IAC5B,IAAIE,WAAW,OAAOA,WAAW,KAAK,OAAOD;IAC7CI,IAAAA,sBAAM,EAACH,QAAQD;AACjB"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/ensureDestinationParent.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\n\nimport type { NoParamCallback } from '../types.ts';\n\nexport default function ensureDestinationParent(dest: string, callback: NoParamCallback): void {\n const parent = path.dirname(dest);\n if (parent === '.' || parent === '/') return callback();\n mkdirp(parent, callback);\n}\n"],"names":["ensureDestinationParent","dest","callback","parent","path","dirname","mkdirp"],"mappings":";;;;+BAKA;;;eAAwBA;;;oEALL;2DACF;;;;;;AAIF,SAASA,wBAAwBC,IAAY,EAAEC,QAAyB;IACrF,IAAMC,SAASC,aAAI,CAACC,OAAO,CAACJ;IAC5B,IAAIE,WAAW,OAAOA,WAAW,KAAK,OAAOD;IAC7CI,IAAAA,sBAAM,EAACH,QAAQD;AACjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/extract.ts"],"sourcesContent":["import fastExtract from 'fast-extract';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { NoParamCallback } from '../types.ts';\n\ninterface ExtractOptions {\n strip?: number;\n time?: number;\n}\n\nexport default function extract(src: string, dest: string, options: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const extractOptions = { strip: 1, time: 1000, ...options };\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, path.dirname(dest)));\n queue.defer(fastExtract.bind(null, src, dest, extractOptions));\n queue.await(callback);\n}\n"],"names":["extract","src","dest","options","callback","extractOptions","strip","time","queue","Queue","defer","mkdirp","bind","path","dirname","fastExtract","await"],"mappings":";;;;+BAYA;;;eAAwBA;;;kEAZA;oEACL;2DACF;8DACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASH,SAASA,QAAQC,GAAW,EAAEC,IAAY,EAAEC,OAAyC,EAAEC,QAA0B;IAC9H,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IAEA,IAAME,iBAAiB;QAAEC,OAAO;QAAGC,MAAM;OAASJ;IAElD,IAAMK,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAACC,sBAAM,CAACC,IAAI,CAAC,MAAMC,aAAI,CAACC,OAAO,CAACZ;IAC3CM,MAAME,KAAK,CAACK,oBAAW,CAACH,IAAI,CAAC,MAAMX,KAAKC,MAAMG;IAC9CG,MAAMQ,KAAK,CAACZ;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/extract.ts"],"sourcesContent":["import fastExtract from 'fast-extract';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { NoParamCallback } from '../types.ts';\n\ninterface ExtractOptions {\n strip?: number;\n time?: number;\n}\n\nexport default function extract(src: string, dest: string, options: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const extractOptions = { strip: 1, time: 1000, ...options };\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, path.dirname(dest)));\n queue.defer(fastExtract.bind(null, src, dest, extractOptions));\n queue.await(callback);\n}\n"],"names":["extract","src","dest","options","callback","extractOptions","strip","time","queue","Queue","defer","mkdirp","bind","path","dirname","fastExtract","await"],"mappings":";;;;+BAYA;;;eAAwBA;;;kEAZA;oEACL;2DACF;8DACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASH,SAASA,QAAQC,GAAW,EAAEC,IAAY,EAAEC,OAAyC,EAAEC,QAA0B;IAC9H,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IAEA,IAAME,iBAAiB;QAAEC,OAAO;QAAGC,MAAM;OAASJ;IAElD,IAAMK,QAAQ,IAAIC,gBAAK,CAAC;IACxBD,MAAME,KAAK,CAACC,sBAAM,CAACC,IAAI,CAAC,MAAMC,aAAI,CAACC,OAAO,CAACZ;IAC3CM,MAAME,KAAK,CAACK,oBAAW,CAACH,IAAI,CAAC,MAAMX,KAAKC,MAAMG;IAC9CG,MAAMQ,KAAK,CAACZ;AACd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/getTarget.ts"],"sourcesContent":["import cpuArch from 'cpu-arch';\nimport { FILE_PLATFORM_MAP, FILE_PLATFORMS } from '../constants.ts';\n\nimport type { InstallOptions, Target } from '../types.ts';\n\nconst archCPU = cpuArch();\n\nexport default function getTarget(options: InstallOptions): Target {\n let platform = options.platform;\n let arch = options.arch;\n if (options.filename) {\n const filePlatform = options.filename.split('-')[0];\n if (FILE_PLATFORMS.indexOf(filePlatform) >= 0) platform = FILE_PLATFORM_MAP[filePlatform] || filePlatform;\n arch = options.filename.split('-')[1] as NodeJS.Architecture;\n }\n if (!platform) platform = process.platform;\n if (!arch) arch = archCPU as NodeJS.Architecture;\n return { platform, arch };\n}\n"],"names":["getTarget","archCPU","cpuArch","options","platform","arch","filename","filePlatform","split","FILE_PLATFORMS","indexOf","FILE_PLATFORM_MAP","process"],"mappings":";;;;+BAOA;;;eAAwBA;;;8DAPJ;2BAC8B;;;;;;AAIlD,IAAMC,UAAUC,IAAAA,gBAAO;AAER,SAASF,UAAUG,OAAuB;IACvD,IAAIC,WAAWD,QAAQC,QAAQ;IAC/B,IAAIC,OAAOF,QAAQE,IAAI;IACvB,IAAIF,QAAQG,QAAQ,EAAE;QACpB,IAAMC,eAAeJ,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;QACnD,IAAIC,2BAAc,CAACC,OAAO,CAACH,iBAAiB,GAAGH,WAAWO,8BAAiB,CAACJ,aAAa,IAAIA;QAC7FF,OAAOF,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;IACvC;IACA,IAAI,CAACJ,UAAUA,WAAWQ,QAAQR,QAAQ;IAC1C,IAAI,CAACC,MAAMA,OAAOJ;IAClB,OAAO;QAAEG,UAAAA;QAAUC,MAAAA;IAAK;AAC1B"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/getTarget.ts"],"sourcesContent":["import cpuArch from 'cpu-arch';\nimport { FILE_PLATFORM_MAP, FILE_PLATFORMS } from '../constants.ts';\n\nimport type { InstallOptions, Target } from '../types.ts';\n\nconst archCPU = cpuArch();\n\nexport default function getTarget(options: InstallOptions): Target {\n let platform = options.platform;\n let arch = options.arch;\n if (options.filename) {\n const filePlatform = options.filename.split('-')[0];\n if (FILE_PLATFORMS.indexOf(filePlatform) >= 0) platform = FILE_PLATFORM_MAP[filePlatform] || filePlatform;\n arch = options.filename.split('-')[1] as NodeJS.Architecture;\n }\n if (!platform) platform = process.platform;\n if (!arch) arch = archCPU as NodeJS.Architecture;\n return { platform, arch };\n}\n"],"names":["getTarget","archCPU","cpuArch","options","platform","arch","filename","filePlatform","split","FILE_PLATFORMS","indexOf","FILE_PLATFORM_MAP","process"],"mappings":";;;;+BAOA;;;eAAwBA;;;8DAPJ;2BAC8B;;;;;;AAIlD,IAAMC,UAAUC,IAAAA,gBAAO;AAER,SAASF,UAAUG,OAAuB;IACvD,IAAIC,WAAWD,QAAQC,QAAQ;IAC/B,IAAIC,OAAOF,QAAQE,IAAI;IACvB,IAAIF,QAAQG,QAAQ,EAAE;QACpB,IAAMC,eAAeJ,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;QACnD,IAAIC,2BAAc,CAACC,OAAO,CAACH,iBAAiB,GAAGH,WAAWO,8BAAiB,CAACJ,aAAa,IAAIA;QAC7FF,OAAOF,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;IACvC;IACA,IAAI,CAACJ,UAAUA,WAAWQ,QAAQR,QAAQ;IAC1C,IAAI,CAACC,MAAMA,OAAOJ;IAClB,OAAO;QAAEG,UAAAA;QAAUC,MAAAA;IAAK;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => void;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback) {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): void => {\n if (err) return callback(err);\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: with atomic installs, folder exists = complete installation\n fs.stat(result.installPath, (err) => {\n if (!err) return callback(null, result);\n\n // Folder doesn't exist - do atomic install with temp folder\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): void => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n}\n"],"names":["install","getVersions","versionExpression","options","callback","isVersion","resolveVersions","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","getTarget","err","versions","length","Error","map","x","version","result","createResult","fs","stat","installPath","tempPath","tempSuffix","queue","Queue","defer","mkdirp","bind","cachePath","ensureDestinationParent","installNode","cb","checkMissing","npmMissing","indexOf","dist","getDist","bundledNpmMajor","npm","split","platform","libPath","path","join","npmPath","safeRm","installNPM","rename","code","await"],"mappings":";;;;+BA6BA;;;eAAwBA;;;yDA7BT;8BACQ;gEACD;oEACH;uCACK;0EACI;2DACX;8DACC;iEACK;2BAEe;qEAEb;2EACM;8DACP;+DAED;qEACE;gFACW;kEACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKtB,SAASC,YAAYC,iBAAyB,EAAEC,OAAuB,EAAEC,QAA6B;IACpG,gBAAgB;IAChBC,IAAAA,kBAAS,EAACH,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAII,IAAAA,4BAAe,EAACJ,mBAAmBC,SAASC;AACnH;AAEe,SAASJ,QAAQE,iBAAyB,EAAEC,OAAuB,EAAEC,QAAyB;IAC3G,IAAMG,eAAeJ,QAAQK,WAAW,GAAGC,IAAAA,6BAAkB,EAACN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A,gCAAO,EAACrB;wBACrB,IAAMsB,kBAAkBF,QAAQA,KAAKG,GAAG,GAAG,CAACH,KAAKG,GAAG,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG;wBACrE,IAAIF,mBAAmB,GAAG;4BACxBN,MAAM,kCAAkC;4BACxC;wBACF;wBACA,+DAA+D;wBAC/D,IAAMS,WAAWxC,QAAQwC,QAAQ;wBACjC,IAAMC,UAAUD,aAAa,UAAUnB,WAAWqB,aAAI,CAACC,IAAI,CAACtB,UAAU;wBACtE,IAAMuB,UAAUF,aAAI,CAACC,IAAI,CAACF,SAAS,gBAAgB;wBACnDI,IAAAA,sBAAM,EAACD,SAAS;mCAAME,IAAAA,iBAAU,EAAC/B,SAASM,UAAUrB,SAAS+B;;wBAC7D;oBACF;oBACAe,IAAAA,iBAAU,EAAC/B,SAASM,UAAUrB,SAAS+B;gBACzC;YACF;YAEA,uDAAuD;YACvDR,MAAME,KAAK,CAAC,SAACM;gBACXb,WAAE,CAAC6B,MAAM,CAAC1B,UAAUL,OAAOI,WAAW,EAAE,SAACX;oBACvC,IAAI,CAACA,KAAK,OAAOsB;oBACjB,gEAAgE;oBAChE,IAAItB,IAAIuC,IAAI,KAAK,YAAYvC,IAAIuC,IAAI,KAAK,eAAevC,IAAIuC,IAAI,KAAK,SAAS;wBAC7E,2DAA2D;wBAC3DH,IAAAA,sBAAM,EAACxB,UAAU;mCAAMU;;wBACvB;oBACF;oBACAA,GAAGtB;gBACL;YACF;YAEAc,MAAM0B,KAAK,CAAC,SAACxC;gBACX,IAAIA,KAAK;oBACP,gCAAgC;oBAChCoC,IAAAA,sBAAM,EAACxB,UAAU;+BAAMpB,SAASQ;;oBAChC;gBACF;gBACAR,SAAS,MAAMe;YACjB;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => void;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback) {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): void => {\n if (err) return callback(err);\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: with atomic installs, folder exists = complete installation\n fs.stat(result.installPath, (err) => {\n if (!err) return callback(null, result);\n\n // Folder doesn't exist - do atomic install with temp folder\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): void => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n}\n"],"names":["install","getVersions","versionExpression","options","callback","isVersion","resolveVersions","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","getTarget","err","versions","length","Error","map","x","version","result","createResult","fs","stat","installPath","tempPath","tempSuffix","queue","Queue","defer","mkdirp","bind","cachePath","ensureDestinationParent","installNode","cb","checkMissing","npmMissing","indexOf","dist","getDist","bundledNpmMajor","npm","split","platform","libPath","path","join","npmPath","safeRm","installNPM","rename","code","await"],"mappings":";;;;+BA6BA;;;eAAwBA;;;yDA7BT;8BACQ;gEACD;oEACH;uCACK;0EACI;2DACX;8DACC;iEACK;2BAEe;qEAEb;2EACM;8DACP;+DAED;qEACE;gFACW;kEACd;;;;;;;;;;;;;;;;;;;;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BACL;YACF;YAEAc,MAAM0B,KAAK,CAAC,SAACxC;gBACX,IAAIA,KAAK;oBACP,gCAAgC;oBAChCoC,IAAAA,sBAAM,EAACxB,UAAU;+BAAMpB,SAASQ;;oBAChC;gBACF;gBACAR,SAAS,MAAMe;YACjB;QACF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport install, { type InstallOptions } from './index.ts';\n\nconst ERROR_CODE = 9;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getPackageVersion(): string {\n const packagePath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getPackageVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} <version> [options]`);\n console.log('');\n console.log('Arguments:');\n console.log(' version Node.js version to install (e.g., 18.0.0, lts, stable)');\n console.log('');\n console.log('Options:');\n console.log(' -p, --platform Target platform (default: current platform)');\n console.log(' -a, --arch Target architecture (default: current architecture)');\n console.log(' -f, --filename Specific filename to download');\n console.log(' -i, --installPath Installation directory');\n console.log(' -c, --storagePath Cache storage directory');\n console.log(' -si, --silent Suppress output');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n const cliName = name || 'nir';\n const options = getopts(argv, {\n alias: { platform: 'p', arch: 'a', filename: 'f', installPath: 'i', storagePath: 'c', silent: 'si', version: 'v', help: 'h' },\n boolean: ['silent', 'version', 'help'],\n });\n\n if (options.version) {\n console.log(getPackageVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(cliName);\n exit(0);\n return;\n }\n\n const args = options._;\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${cliName} <version> [directory]`);\n exit(ERROR_CODE);\n return;\n }\n install(args[0], options as InstallOptions, (err, result) => {\n if (!options.silent) {\n console.log('\\n======================');\n if (err) console.log(`${args[0]} not installed. Error: ${err.message}`);\n else console.log(`${result.version} installed in: ${result.installPath}`);\n console.log('======================');\n }\n exit(err ? ERROR_CODE : 0);\n });\n};\n"],"names":["exit","fs","getopts","path","url","install","ERROR_CODE","__dirname","dirname","__filename","fileURLToPath","getPackageVersion","packagePath","join","packageJson","JSON","parse","readFileSync","version","printHelp","name","console","log","argv","cliName","options","alias","platform","arch","filename","installPath","storagePath","silent","help","boolean","args","_","length","err","result","message"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,aAAsC,aAAa;AAE1D,MAAMC,aAAa;AACnB,MAAMC,YAAYJ,KAAKK,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaL,IAAIM,aAAa,CAAC,YAAYN,GAAG;AAEjH,SAASO;IACP,MAAMC,cAAcT,KAAKU,IAAI,CAACN,WAAW,MAAM,MAAM;IACrD,MAAMO,cAAcC,KAAKC,KAAK,CAACf,GAAGgB,YAAY,CAACL,aAAa;IAC5D,OAAOE,YAAYI,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,MAAMF,UAAUP;IAChBU,QAAQC,GAAG,CAAC,GAAGF,KAAK,EAAE,EAAEF,SAAS;IACjCG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAEF,KAAK,oBAAoB,CAAC;IAChDC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CA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version/node-install-release/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport install, { type InstallOptions } from './index.ts';\n\nconst ERROR_CODE = 9;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getPackageVersion(): string {\n const packagePath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getPackageVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} <version> [options]`);\n console.log('');\n console.log('Arguments:');\n console.log(' version Node.js version to install (e.g., 18.0.0, lts, stable)');\n console.log('');\n console.log('Options:');\n console.log(' -p, --platform Target platform (default: current platform)');\n console.log(' -a, --arch Target architecture (default: current architecture)');\n console.log(' -f, --filename Specific filename to download');\n console.log(' -i, --installPath Installation directory');\n console.log(' -c, --storagePath Cache storage directory');\n console.log(' -si, --silent Suppress output');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n const cliName = name || 'nir';\n const options = getopts(argv, {\n alias: { platform: 'p', arch: 'a', filename: 'f', installPath: 'i', storagePath: 'c', silent: 'si', version: 'v', help: 'h' },\n boolean: ['silent', 'version', 'help'],\n });\n\n if (options.version) {\n console.log(getPackageVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(cliName);\n exit(0);\n return;\n }\n\n const args = options._;\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${cliName} <version> [directory]`);\n exit(ERROR_CODE);\n return;\n }\n install(args[0], options as InstallOptions, (err, result) => {\n if (!options.silent) {\n console.log('\\n======================');\n if (err) console.log(`${args[0]} not installed. Error: ${err.message}`);\n else console.log(`${result.version} installed in: ${result.installPath}`);\n console.log('======================');\n }\n exit(err ? ERROR_CODE : 0);\n });\n};\n"],"names":["exit","fs","getopts","path","url","install","ERROR_CODE","__dirname","dirname","__filename","fileURLToPath","getPackageVersion","packagePath","join","packageJson","JSON","parse","readFileSync","version","printHelp","name","console","log","argv","cliName","options","alias","platform","arch","filename","installPath","storagePath","silent","help","boolean","args","_","length","err","result","message"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,aAAsC,aAAa;AAE1D,MAAMC,aAAa;AACnB,MAAMC,YAAYJ,KAAKK,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaL,IAAIM,aAAa,CAAC,YAAYN,GAAG;AAEjH,SAASO;IACP,MAAMC,cAAcT,KAAKU,IAAI,CAACN,WAAW,MAAM,MAAM;IACrD,MAAMO,cAAcC,KAAKC,KAAK,CAACf,GAAGgB,YAAY,CAACL,aAAa;IAC5D,OAAOE,YAAYI,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,MAAMF,UAAUP;IAChBU,QAAQC,GAAG,CAAC,GAAGF,KAAK,EAAE,EAAEF,SAAS;IACjCG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAEF,KAAK,oBAAoB,CAAC;IAChDC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd;AAEA,eAAe,CAAA,CAACC,MAAgBH;IAC9B,MAAMI,UAAUJ,QAAQ;IACxB,MAAMK,UAAUvB,QAAQqB,MAAM;QAC5BG,OAAO;YAAEC,UAAU;YAAKC,MAAM;YAAKC,UAAU;YAAKC,aAAa;YAAKC,aAAa;YAAKC,QAAQ;YAAMd,SAAS;YAAKe,MAAM;QAAI;QAC5HC,SAAS;YAAC;YAAU;YAAW;SAAO;IACxC;IAEA,IAAIT,QAAQP,OAAO,EAAE;QACnBG,QAAQC,GAAG,CAACX;QACZX,KAAK;QACL;IACF;IAEA,IAAIyB,QAAQQ,IAAI,EAAE;QAChBd,UAAUK;QACVxB,KAAK;QACL;IACF;IAEA,MAAMmC,OAAOV,QAAQW,CAAC;IACtB,IAAID,KAAKE,MAAM,GAAG,GAAG;QACnBhB,QAAQC,GAAG,CAAC,CAAC,gCAAgC,EAAEE,QAAQ,sBAAsB,CAAC;QAC9ExB,KAAKM;QACL;IACF;IACAD,QAAQ8B,IAAI,CAAC,EAAE,EAAEV,SAA2B,CAACa,KAAKC;QAChD,IAAI,CAACd,QAAQO,MAAM,EAAE;YACnBX,QAAQC,GAAG,CAAC;YACZ,IAAIgB,KAAKjB,QAAQC,GAAG,CAAC,GAAGa,IAAI,CAAC,EAAE,CAAC,uBAAuB,EAAEG,IAAIE,OAAO,EAAE;iBACjEnB,QAAQC,GAAG,CAAC,GAAGiB,OAAOrB,OAAO,CAAC,eAAe,EAAEqB,OAAOT,WAAW,EAAE;YACxET,QAAQC,GAAG,CAAC;QACd;QACAtB,KAAKsC,MAAMhC,aAAa;IAC1B;AACF,CAAA,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport os from 'os';\n\nexport function homedir(): string {\n return typeof os.homedir === 'function' ? os.homedir() : require('homedir-polyfill')();\n}\n"],"names":["os","homedir","require"],"mappings":"AAAA;;;CAGC,GACD,OAAOA,QAAQ,KAAK;AAEpB,OAAO,SAASC;IACd,OAAO,OAAOD,GAAGC,OAAO,KAAK,aAAaD,GAAGC,OAAO,KAAKC,QAAQ;AACnE"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport os from 'os';\n\nexport function homedir(): string {\n return typeof os.homedir === 'function' ? os.homedir() : require('homedir-polyfill')();\n}\n"],"names":["os","homedir","require"],"mappings":"AAAA;;;CAGC,GACD,OAAOA,QAAQ,KAAK;AAEpB,OAAO,SAASC;IACd,OAAO,OAAOD,GAAGC,OAAO,KAAK,aAAaD,GAAGC,OAAO,KAAKC,QAAQ;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/constants.ts"],"sourcesContent":["import keys from 'lodash.keys';\nimport path from 'path';\nimport { homedir } from './compat.ts';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_PACKAGE_PATH = {\n win32: path.join('node_modules', 'npm') as string,\n posix: path.join('lib', 'node_modules', 'npm') as string,\n};\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm'), dest: 'npm' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["keys","path","homedir","createStoragePaths","files","FILES","DEFAULT_STORAGE_PATH","join","DEFAULT_STORAGE_PATHS","FILE_PLATFORMS","filter","file","indexOf","FILE_PLATFORM_MAP","win","win32","osx","darwin","EXTENSIONS_COMPRESSED","NODE_FILE_PATHS","posix","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_URL","NPM_DIST_TAGS_URL","NPM_MIN_VERSION","NPM_PACKAGE_PATH","NPM_FILE_PATHS","src","dest","optional"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,UAAU,OAAO;AACxB,SAASC,OAAO,QAAQ,cAAc;AACtC,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,WAAW,aAAa;AAI/B,OAAO,MAAMC,QAAQD,MAAM;AAC3B,OAAO,MAAME,uBAAuBL,KAAKM,IAAI,CAACL,WAAW,QAAkB;AAC3E,OAAO,MAAMM,wBAAwBL,mBAAmBG,sBAAsB;AAE9E,OAAO,MAAMG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YAAEqB,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBN,KAAK,EAAE,OAAO;YAAeS,MAAM5B,KAAKM,IAAI,CAAC,OAAO;YAAQuB,UAAU;QAAK;KAC9G;AACH,EAAE"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import keys from 'lodash.keys';\nimport path from 'path';\nimport { homedir } from './compat.ts';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_PACKAGE_PATH = {\n win32: path.join('node_modules', 'npm') as string,\n posix: path.join('lib', 'node_modules', 'npm') as string,\n};\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm'), dest: 'npm' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join(NPM_PACKAGE_PATH.win32, 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join(NPM_PACKAGE_PATH.posix, 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["keys","path","homedir","createStoragePaths","files","FILES","DEFAULT_STORAGE_PATH","join","DEFAULT_STORAGE_PATHS","FILE_PLATFORMS","filter","file","indexOf","FILE_PLATFORM_MAP","win","win32","osx","darwin","EXTENSIONS_COMPRESSED","NODE_FILE_PATHS","posix","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_URL","NPM_DIST_TAGS_URL","NPM_MIN_VERSION","NPM_PACKAGE_PATH","NPM_FILE_PATHS","src","dest","optional"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,UAAU,OAAO;AACxB,SAASC,OAAO,QAAQ,cAAc;AACtC,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,WAAW,aAAa;AAI/B,OAAO,MAAMC,QAAQD,MAAM;AAC3B,OAAO,MAAME,uBAAuBL,KAAKM,IAAI,CAACL,WAAW,QAAkB;AAC3E,OAAO,MAAMM,wBAAwBL,mBAAmBG,sBAAsB;AAE9E,OAAO,MAAMG,iBAAiBT,KAAKK,OAAOK,MAAM,CAAC,CAACC,OAAS;QAAC;QAAO;KAAU,CAACC,OAAO,CAACD,QAAQ,GAAe;AAE7G,OAAO,MAAME,oBAAoB;IAC/BC,KAAK;IACLC,OAAO;IACPC,KAAK;IACLC,QAAQ;AACV,EAAE;AAEF,OAAO,MAAMC,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM,CAAC;AAEnE,OAAO,MAAMC,kBAAkB;IAC7BJ,OAAO;IACPK,OAAOnB,KAAKM,IAAI,CAAC,OAAO;AAC1B,EAAE;AACF,OAAO,MAAMc,qBAAqB,0BAA0B;AAC5D,OAAO,MAAMC,qBAAqB,wEAAwE;AAE1G,OAAO,MAAMC,eAAe,iCAAiC;AAC7D,OAAO,MAAMC,oBAAoB,qDAAqD;AACtF,OAAO,MAAMC,kBAAkB,EAAE;AAEjC,OAAO,MAAMC,mBAAmB;IAC9BX,OAAOd,KAAKM,IAAI,CAAC,gBAAgB;IACjCa,OAAOnB,KAAKM,IAAI,CAAC,OAAO,gBAAgB;AAC1C,EAAE;AAEF,OAAO,MAAMoB,iBAAiB;IAC5BZ,OAAO;QACL;YAAEa,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBX,KAAK,EAAE,OAAO;YAAQc,MAAM;QAAM;QACpE;YAAED,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBX,KAAK,EAAE,OAAO;YAAYc,MAAM;QAAU;QAC5E;YAAED,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBX,KAAK,EAAE,OAAO;YAAQc,MAAM;YAAOC,UAAU;QAAK;QACpF;YAAEF,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBX,KAAK,EAAE,OAAO;YAAYc,MAAM;YAAWC,UAAU;QAAK;KAC7F;IACDV,OAAO;QACL;YAAEQ,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBN,KAAK,EAAE,OAAO;YAAeS,MAAM5B,KAAKM,IAAI,CAAC,OAAO;QAAO;QAC7F;YAAEqB,KAAK3B,KAAKM,IAAI,CAACmB,iBAAiBN,KAAK,EAAE,OAAO;YAAeS,MAAM5B,KAAKM,IAAI,CAAC,OAAO;YAAQuB,UAAU;QAAK;KAC9G;AACH,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/createResult.ts"],"sourcesContent":["import path from 'path';\nimport { DEFAULT_STORAGE_PATHS, NODE_FILE_PATHS } from './constants.ts';\n\nimport createStoragePaths from './createStoragePaths.ts';\nimport getTarget from './lib/getTarget.ts';\nimport type { InstallOptions, InstallResult } from './types.ts';\n\nexport default function createResult(options: InstallOptions, version: string): InstallResult {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n let installPath = options.installPath || storagePaths.installPath;\n\n if (options.name) installPath = path.join(installPath, options.name);\n else if (!options.installPath) installPath = path.join(installPath, version);\n const { platform } = getTarget(options);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(installPath, nodePath);\n return { version, installPath, execPath, platform };\n}\n"],"names":["path","DEFAULT_STORAGE_PATHS","NODE_FILE_PATHS","createStoragePaths","getTarget","createResult","options","version","storagePaths","storagePath","installPath","name","join","platform","nodePath","posix","execPath"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,SAASC,qBAAqB,EAAEC,eAAe,QAAQ,iBAAiB;AAExE,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,eAAe,qBAAqB;AAG3C,eAAe,SAASC,aAAaC,OAAuB,EAAEC,OAAe;IAC3E,MAAMC,eAAeF,QAAQG,WAAW,GAAGN,mBAAmBG,QAAQG,WAAW,IAAIR;IACrF,IAAIS,cAAcJ,QAAQI,WAAW,IAAIF,aAAaE,WAAW;IAEjE,IAAIJ,QAAQK,IAAI,EAAED,cAAcV,KAAKY,IAAI,CAACF,aAAaJ,QAAQK,IAAI;SAC9D,IAAI,CAACL,QAAQI,WAAW,EAAEA,cAAcV,KAAKY,IAAI,CAACF,aAAaH;IACpE,MAAM,EAAEM,QAAQ,EAAE,GAAGT,UAAUE;IAC/B,MAAMQ,WAAWZ,eAAe,CAACW,SAAS,IAAIX,gBAAgBa,KAAK;IACnE,MAAMC,WAAWhB,KAAKY,IAAI,CAACF,aAAaI;IACxC,OAAO;QAAEP;QAASG;QAAaM;QAAUH;IAAS;AACpD"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/createResult.ts"],"sourcesContent":["import path from 'path';\nimport { DEFAULT_STORAGE_PATHS, NODE_FILE_PATHS } from './constants.ts';\n\nimport createStoragePaths from './createStoragePaths.ts';\nimport getTarget from './lib/getTarget.ts';\nimport type { InstallOptions, InstallResult } from './types.ts';\n\nexport default function createResult(options: InstallOptions, version: string): InstallResult {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n let installPath = options.installPath || storagePaths.installPath;\n\n if (options.name) installPath = path.join(installPath, options.name);\n else if (!options.installPath) installPath = path.join(installPath, version);\n const { platform } = getTarget(options);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(installPath, nodePath);\n return { version, installPath, execPath, platform };\n}\n"],"names":["path","DEFAULT_STORAGE_PATHS","NODE_FILE_PATHS","createStoragePaths","getTarget","createResult","options","version","storagePaths","storagePath","installPath","name","join","platform","nodePath","posix","execPath"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,SAASC,qBAAqB,EAAEC,eAAe,QAAQ,iBAAiB;AAExE,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,eAAe,qBAAqB;AAG3C,eAAe,SAASC,aAAaC,OAAuB,EAAEC,OAAe;IAC3E,MAAMC,eAAeF,QAAQG,WAAW,GAAGN,mBAAmBG,QAAQG,WAAW,IAAIR;IACrF,IAAIS,cAAcJ,QAAQI,WAAW,IAAIF,aAAaE,WAAW;IAEjE,IAAIJ,QAAQK,IAAI,EAAED,cAAcV,KAAKY,IAAI,CAACF,aAAaJ,QAAQK,IAAI;SAC9D,IAAI,CAACL,QAAQI,WAAW,EAAEA,cAAcV,KAAKY,IAAI,CAACF,aAAaH;IACpE,MAAM,EAAEM,QAAQ,EAAE,GAAGT,UAAUE;IAC/B,MAAMQ,WAAWZ,eAAe,CAACW,SAAS,IAAIX,gBAAgBa,KAAK;IACnE,MAAMC,WAAWhB,KAAKY,IAAI,CAACF,aAAaI;IACxC,OAAO;QAAEP;QAASG;QAAaM;QAAUH;IAAS;AACpD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/createStoragePaths.ts"],"sourcesContent":["import path from 'path';\n\nimport type { StorageLocations } from './types.ts';\n\nexport default function createStoragePaths(storagePath: string): StorageLocations {\n return {\n cachePath: path.join(storagePath, 'cache') as string,\n buildPath: path.join(storagePath, 'build') as string,\n installPath: path.join(storagePath, 'installed') as string,\n };\n}\n"],"names":["path","createStoragePaths","storagePath","cachePath","join","buildPath","installPath"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AAIxB,eAAe,SAASC,mBAAmBC,WAAmB;IAC5D,OAAO;QACLC,WAAWH,KAAKI,IAAI,CAACF,aAAa;QAClCG,WAAWL,KAAKI,IAAI,CAACF,aAAa;QAClCI,aAAaN,KAAKI,IAAI,CAACF,aAAa;IACtC;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/createStoragePaths.ts"],"sourcesContent":["import path from 'path';\n\nimport type { StorageLocations } from './types.ts';\n\nexport default function createStoragePaths(storagePath: string): StorageLocations {\n return {\n cachePath: path.join(storagePath, 'cache') as string,\n buildPath: path.join(storagePath, 'build') as string,\n installPath: path.join(storagePath, 'installed') as string,\n };\n}\n"],"names":["path","createStoragePaths","storagePath","cachePath","join","buildPath","installPath"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AAIxB,eAAe,SAASC,mBAAmBC,WAAmB;IAC5D,OAAO;QACLC,WAAWH,KAAKI,IAAI,CAACF,aAAa;QAClCG,WAAWL,KAAKI,IAAI,CAACF,aAAa;QAClCI,aAAaN,KAAKI,IAAI,CAACF,aAAa;IACtC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/files.ts"],"sourcesContent":["import Module from 'module';\nimport type { File } from './types.ts';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nexport default _require('../../assets/files.cjs') as Record<string, File[]>;\n"],"names":["Module","_require","require","createRequire","url"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAG5B,MAAMC,WAAW,OAAOC,YAAY,cAAcF,OAAOG,aAAa,CAAC,YAAYC,GAAG,IAAIF;AAC1F,eAAeD,SAAS,0BAAoD"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/files.ts"],"sourcesContent":["import Module from 'module';\nimport type { File } from './types.ts';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nexport default _require('../../assets/files.cjs') as Record<string, File[]>;\n"],"names":["Module","_require","require","createRequire","url"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAG5B,MAAMC,WAAW,OAAOC,YAAY,cAAcF,OAAOG,aAAa,CAAC,YAAYC,GAAG,IAAIF;AAC1F,eAAeD,SAAS,0BAAoD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions, InstallResult } from './types.ts';\nimport worker from './workers/install.ts';\n\nexport type * from './types.ts';\n\nexport default function install(versionExpression: string): Promise<InstallResult>;\nexport default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;\n\nexport default function install(versionExpression: string, callback: InstallCallback): void;\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void;\n\nexport default function install(versionExpression: string, optionsOrCallback?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<InstallResult> {\n const options = typeof optionsOrCallback === 'function' ? {} : ((optionsOrCallback || {}) as InstallOptions);\n const cb = typeof optionsOrCallback === 'function' ? optionsOrCallback : callback;\n\n if (typeof cb === 'function') return worker(versionExpression, options, cb);\n return new Promise((resolve, reject) => worker(versionExpression, options, (err, result) => (err ? reject(err) : resolve(result))));\n}\nexport { default as createResult } from './createResult.ts';\nexport { default as createStoragePaths } from './createStoragePaths.ts';\n"],"names":["worker","install","versionExpression","optionsOrCallback","callback","options","cb","Promise","resolve","reject","err","result","default","createResult","createStoragePaths"],"mappings":"AACA,OAAOA,YAAY,uBAAuB;AAU1C,eAAe,SAASC,QAAQC,iBAAyB,EAAEC,iBAAoD,EAAEC,QAA0B;IACzI,MAAMC,UAAU,OAAOF,sBAAsB,aAAa,CAAC,IAAMA,qBAAqB,CAAC;IACvF,MAAMG,KAAK,OAAOH,sBAAsB,aAAaA,oBAAoBC;IAEzE,IAAI,OAAOE,OAAO,YAAY,OAAON,OAAOE,mBAAmBG,SAASC;IACxE,OAAO,IAAIC,QAAQ,CAACC,SAASC,SAAWT,OAAOE,mBAAmBG,SAAS,CAACK,KAAKC,SAAYD,MAAMD,OAAOC,OAAOF,QAAQG;AAC3H;AACA,SAASC,WAAWC,YAAY,QAAQ,oBAAoB;AAC5D,SAASD,WAAWE,kBAAkB,QAAQ,0BAA0B"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions, InstallResult } from './types.ts';\nimport worker from './workers/install.ts';\n\nexport type * from './types.ts';\n\nexport default function install(versionExpression: string): Promise<InstallResult>;\nexport default function install(versionExpression: string, options: InstallOptions): Promise<InstallResult>;\n\nexport default function install(versionExpression: string, callback: InstallCallback): void;\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void;\n\nexport default function install(versionExpression: string, optionsOrCallback?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<InstallResult> {\n const options = typeof optionsOrCallback === 'function' ? {} : ((optionsOrCallback || {}) as InstallOptions);\n const cb = typeof optionsOrCallback === 'function' ? optionsOrCallback : callback;\n\n if (typeof cb === 'function') return worker(versionExpression, options, cb);\n return new Promise((resolve, reject) => worker(versionExpression, options, (err, result) => (err ? reject(err) : resolve(result))));\n}\nexport { default as createResult } from './createResult.ts';\nexport { default as createStoragePaths } from './createStoragePaths.ts';\n"],"names":["worker","install","versionExpression","optionsOrCallback","callback","options","cb","Promise","resolve","reject","err","result","default","createResult","createStoragePaths"],"mappings":"AACA,OAAOA,YAAY,uBAAuB;AAU1C,eAAe,SAASC,QAAQC,iBAAyB,EAAEC,iBAAoD,EAAEC,QAA0B;IACzI,MAAMC,UAAU,OAAOF,sBAAsB,aAAa,CAAC,IAAMA,qBAAqB,CAAC;IACvF,MAAMG,KAAK,OAAOH,sBAAsB,aAAaA,oBAAoBC;IAEzE,IAAI,OAAOE,OAAO,YAAY,OAAON,OAAOE,mBAAmBG,SAASC;IACxE,OAAO,IAAIC,QAAQ,CAACC,SAASC,SAAWT,OAAOE,mBAAmBG,SAAS,CAACK,KAAKC,SAAYD,MAAMD,OAAOC,OAAOF,QAAQG;AAC3H;AACA,SAASC,WAAWC,YAAY,QAAQ,oBAAoB;AAC5D,SAASD,WAAWE,kBAAkB,QAAQ,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNPM/index.ts"],"sourcesContent":["import Queue from 'queue-cb';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installBin from './installBin.ts';\nimport installLib from './installLib.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n let npmVersion: string | null = null;\n let checksum: string | undefined;\n\n const queue = new Queue(1);\n queue.defer((cb) =>\n installLib(version, dest, options, (err, _npmVersion, _checksum) => {\n npmVersion = _npmVersion;\n checksum = _checksum;\n cb(err);\n })\n );\n queue.defer(installBin.bind(null, version, dest, options));\n queue.await((err) => {\n let message = `npm ${npmVersion || ''}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.slice(0, 8)})`;\n } else {\n message += ` install failed. Error: ${err.message}`;\n }\n console.log(message);\n callback(err);\n });\n}\n"],"names":["Queue","installBin","installLib","install","version","dest","options","callback","npmVersion","checksum","queue","defer","cb","err","_npmVersion","_checksum","bind","await","message","slice","console","log"],"mappings":"AAAA,OAAOA,WAAW,WAAW;AAE7B,OAAOC,gBAAgB,kBAAkB;AACzC,OAAOC,gBAAgB,kBAAkB;AAEzC,eAAe,SAASC,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,aAA4B;IAChC,IAAIC;IAEJ,MAAMC,QAAQ,IAAIV,MAAM;IACxBU,MAAMC,KAAK,CAAC,CAACC,KACXV,WAAWE,SAASC,MAAMC,SAAS,CAACO,KAAKC,aAAaC;YACpDP,aAAaM;YACbL,WAAWM;YACXH,GAAGC;QACL;IAEFH,MAAMC,KAAK,CAACV,WAAWe,IAAI,CAAC,MAAMZ,SAASC,MAAMC;IACjDI,MAAMO,KAAK,CAAC,CAACJ;QACX,IAAIK,UAAU,CAAC,IAAI,EAAEV,cAAc,IAAI;QACvC,IAAI,CAACK,KAAK;YACRK,WAAW;YACX,IAAIT,UAAUS,WAAW,CAAC,EAAE,EAAET,SAASU,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QACvD,OAAO;YACLD,WAAW,CAAC,wBAAwB,EAAEL,IAAIK,OAAO,EAAE;QACrD;QACAE,QAAQC,GAAG,CAACH;QACZX,SAASM;IACX;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/index.ts"],"sourcesContent":["import Queue from 'queue-cb';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport installBin from './installBin.ts';\nimport installLib from './installLib.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n let npmVersion: string | null = null;\n let checksum: string | undefined;\n\n const queue = new Queue(1);\n queue.defer((cb) =>\n installLib(version, dest, options, (err, _npmVersion, _checksum) => {\n npmVersion = _npmVersion;\n checksum = _checksum;\n cb(err);\n })\n );\n queue.defer(installBin.bind(null, version, dest, options));\n queue.await((err) => {\n let message = `npm ${npmVersion || ''}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.slice(0, 8)})`;\n } else {\n message += ` install failed. Error: ${err.message}`;\n }\n console.log(message);\n callback(err);\n });\n}\n"],"names":["Queue","installBin","installLib","install","version","dest","options","callback","npmVersion","checksum","queue","defer","cb","err","_npmVersion","_checksum","bind","await","message","slice","console","log"],"mappings":"AAAA,OAAOA,WAAW,WAAW;AAE7B,OAAOC,gBAAgB,kBAAkB;AACzC,OAAOC,gBAAgB,kBAAkB;AAEzC,eAAe,SAASC,QAAQC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IAC/G,IAAIC,aAA4B;IAChC,IAAIC;IAEJ,MAAMC,QAAQ,IAAIV,MAAM;IACxBU,MAAMC,KAAK,CAAC,CAACC,KACXV,WAAWE,SAASC,MAAMC,SAAS,CAACO,KAAKC,aAAaC;YACpDP,aAAaM;YACbL,WAAWM;YACXH,GAAGC;QACL;IAEFH,MAAMC,KAAK,CAACV,WAAWe,IAAI,CAAC,MAAMZ,SAASC,MAAMC;IACjDI,MAAMO,KAAK,CAAC,CAACJ;QACX,IAAIK,UAAU,CAAC,IAAI,EAAEV,cAAc,IAAI;QACvC,IAAI,CAACK,KAAK;YACRK,WAAW;YACX,IAAIT,UAAUS,WAAW,CAAC,EAAE,EAAET,SAASU,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QACvD,OAAO;YACLD,WAAW,CAAC,wBAAwB,EAAEL,IAAIK,OAAO,EAAE;QACrD;QACAE,QAAQC,GAAG,CAACH;QACZX,SAASM;IACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/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
+ {"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 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNPM/installLib.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport oo from 'on-one';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_DIST_TAGS_URL, NPM_DIST_URL, NPM_MIN_VERSION } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\n\ninterface DistRecord {\n latest: string;\n}\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, npmVersion?: string, checksum?: string) => void;\n\nfunction calculateChecksum(filePath: string, callback: (err?: Error, checksum?: string) => void): void {\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(filePath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n callback(null, hash.digest('hex'));\n });\n}\n\nexport default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n\n const dist = getDist(version);\n const npmMajorPair = dist && dist.npm ? +dist.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n getContent(NPM_DIST_TAGS_URL, 'utf8', (err, res) => {\n if (err) return callback(err);\n try {\n const distTags = JSON.parse(res.content) as DistRecord;\n const npmVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n const downloadPath = `${NPM_DIST_URL}/-/npm-${npmVersion}.tgz`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: string | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n calculateChecksum(cachePath, (err, hash) => {\n checksum = hash;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, installPath));\n queue.await((err) => {\n err ? callback(err) : callback(null, npmVersion, checksum);\n });\n } catch (_e) {\n return callback(new Error('Failed to parse npm dist-tags'));\n }\n });\n}\n"],"names":["crypto","fs","getContent","getDist","oo","path","Queue","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_MIN_VERSION","conditionalCache","extract","calculateChecksum","filePath","callback","hash","createHash","stream","createReadStream","on","data","update","err","digest","installLib","version","dest","options","platform","libPath","join","installPath","dist","npmMajorPair","npm","split","npmMajor","Math","max","res","distTags","JSON","parse","content","npmVersion","latest","downloadPath","cachePath","basename","checksum","queue","defer","bind","cb","await","_e","Error"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAC5B,OAAOC,QAAQ,KAAK;AACpB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,OAAO,QAAQ,8BAA8B;AACtD,OAAOC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II,SAASK,MAAM;YACpG,MAAMC,eAAe,GAAGtC,aAAa,OAAO,EAAEoC,WAAW,IAAI,CAAC;YAC9D,MAAMG,YAAY1C,KAAKyB,IAAI,CAACH,QAAQoB,SAAS,EAAE1C,KAAK2C,QAAQ,CAACF;YAE7D,IAAIG;YACJ,MAAMC,QAAQ,IAAI5C,MAAM;YACxB4C,MAAMC,KAAK,CAACzC,iBAAiB0C,IAAI,CAAC,MAAMN,cAAcC;YACtDG,MAAMC,KAAK,CAAC,CAACE;gBACXzC,kBAAkBmC,WAAW,CAACzB,KAAKP;oBACjCkC,WAAWlC;oBACXsC,GAAG/B;gBACL;YACF;YACA4B,MAAMC,KAAK,CAACxC,QAAQyC,IAAI,CAAC,MAAML,WAAWhB;YAC1CmB,MAAMI,KAAK,CAAC,CAAChC;gBACXA,MAAMR,SAASQ,OAAOR,SAAS,MAAM8B,YAAYK;YACnD;QACF,EAAE,OAAOM,IAAI;YACX,OAAOzC,SAAS,IAAI0C,MAAM;QAC5B;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNPM/installLib.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport oo from 'on-one';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NPM_DIST_TAGS_URL, NPM_DIST_URL, NPM_MIN_VERSION } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\n\ninterface DistRecord {\n latest: string;\n}\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, npmVersion?: string, checksum?: string) => void;\n\nfunction calculateChecksum(filePath: string, callback: (err?: Error, checksum?: string) => void): void {\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(filePath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n callback(null, hash.digest('hex'));\n });\n}\n\nexport default function installLib(version: string, dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const libPath = platform === 'win32' ? dest : path.join(dest, 'lib');\n const installPath = path.join(libPath, 'node_modules', 'npm');\n\n const dist = getDist(version);\n const npmMajorPair = dist && dist.npm ? +dist.npm.split('.')[0] : NPM_MIN_VERSION;\n const npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);\n\n getContent(NPM_DIST_TAGS_URL, 'utf8', (err, res) => {\n if (err) return callback(err);\n try {\n const distTags = JSON.parse(res.content) as DistRecord;\n const npmVersion = distTags[`latest-${npmMajor}`] || distTags[`next-${npmMajor}`] || distTags.latest;\n const downloadPath = `${NPM_DIST_URL}/-/npm-${npmVersion}.tgz`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: string | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n calculateChecksum(cachePath, (err, hash) => {\n checksum = hash;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, installPath));\n queue.await((err) => {\n err ? callback(err) : callback(null, npmVersion, checksum);\n });\n } catch (_e) {\n return callback(new Error('Failed to parse npm dist-tags'));\n }\n });\n}\n"],"names":["crypto","fs","getContent","getDist","oo","path","Queue","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_MIN_VERSION","conditionalCache","extract","calculateChecksum","filePath","callback","hash","createHash","stream","createReadStream","on","data","update","err","digest","installLib","version","dest","options","platform","libPath","join","installPath","dist","npmMajorPair","npm","split","npmMajor","Math","max","res","distTags","JSON","parse","content","npmVersion","latest","downloadPath","cachePath","basename","checksum","queue","defer","bind","cb","await","_e","Error"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAC5B,OAAOC,QAAQ,KAAK;AACpB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,OAAO,QAAQ,8BAA8B;AACtD,OAAOC,QAAQ,SA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AM;YACpG,MAAMC,eAAe,GAAGtC,aAAa,OAAO,EAAEoC,WAAW,IAAI,CAAC;YAC9D,MAAMG,YAAY1C,KAAKyB,IAAI,CAACH,QAAQoB,SAAS,EAAE1C,KAAK2C,QAAQ,CAACF;YAE7D,IAAIG;YACJ,MAAMC,QAAQ,IAAI5C,MAAM;YACxB4C,MAAMC,KAAK,CAACzC,iBAAiB0C,IAAI,CAAC,MAAMN,cAAcC;YACtDG,MAAMC,KAAK,CAAC,CAACE;gBACXzC,kBAAkBmC,WAAW,CAACzB,KAAKP;oBACjCkC,WAAWlC;oBACXsC,GAAG/B;gBACL;YACF;YACA4B,MAAMC,KAAK,CAACxC,QAAQyC,IAAI,CAAC,MAAML,WAAWhB;YAC1CmB,MAAMI,KAAK,CAAC,CAAChC;gBACXA,MAAMR,SAASQ,OAAOR,SAAS,MAAM8B,YAAYK;YACnD;QACF,EAAE,OAAOM,IAAI;YACX,OAAOzC,SAAS,IAAI0C,MAAM;QAC5B;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/index.ts"],"sourcesContent":["import { FILE_PLATFORM_MAP, FILES } from '../constants.ts';\nimport type { ChecksumResult, InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\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: (err?: Error, checksum?: ChecksumResult) => void, lastErr?: Error) => {\n if (filenames.length === 0) {\n const msg = `Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`;\n return cb(new Error(lastErr ? `${msg}: ${lastErr.message}` : msg));\n }\n installFilename(filenames.shift(), version, dest, options, (err, checksum) => (err ? tryNext(cb, err) : cb(null, checksum)));\n };\n tryNext((err, checksum) => {\n let message = `node ${version.slice(1)}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.actual.slice(0, 8)})`;\n } else {\n message += ' install failed';\n if (checksum) message += ` (${checksum.actual} expecting ${checksum.expected})`;\n message += `. Error: ${err.message}`;\n }\n console.log(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","lastErr","length","msg","Error","message","shift","err","checksum","actual","expected","console","log"],"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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ACAM,QAAQC,GAAG,CAACP;QACZ5B,SAAS8B;IACX;AACF"}
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 { ChecksumResult, InstallOptions, NoParamCallback } from '../types.ts';\nimport installFilename from './installFilename.ts';\n\nexport default function install(version: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\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: (err?: Error, checksum?: ChecksumResult) => void, lastErr?: Error) => {\n if (filenames.length === 0) {\n const msg = `Failed to find installable for ${version}${options.filename ? ` Filename: ${options.filename}` : ''}`;\n return cb(new Error(lastErr ? `${msg}: ${lastErr.message}` : msg));\n }\n installFilename(filenames.shift(), version, dest, options, (err, checksum) => (err ? tryNext(cb, err) : cb(null, checksum)));\n };\n tryNext((err, checksum) => {\n let message = `node ${version.slice(1)}`;\n if (!err) {\n message += ' installed';\n if (checksum) message += ` (${checksum.actual.slice(0, 8)})`;\n } else {\n message += ' install failed';\n if (checksum) message += ` (${checksum.actual} expecting ${checksum.expected})`;\n message += `. Error: ${err.message}`;\n }\n console.log(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","lastErr","length","msg","Error","message","shift","err","checksum","actual","expected","console","log"],"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,IAAsDC;QACrE,IAAIvB,UAAUwB,MAAM,KAAK,GAAG;YAC1B,MAAMC,MAAM,CAAC,+BAA+B,EAAE7B,UAAUE,QAAQG,QAAQ,GAAG,CAAC,WAAW,EAAEH,QAAQG,QAAQ,EAAE,GAAG,IAAI;YAClH,OAAOqB,GAAG,IAAII,MAAMH,UAAU,GAAGE,IAAI,EAAE,EAAEF,QAAQI,OAAO,EAAE,GAAGF;QAC/D;QACA/B,gBAAgBM,UAAU4B,KAAK,IAAIhC,SAASC,MAAMC,SAAS,CAAC+B,KAAKC,WAAcD,MAAMR,QAAQC,IAAIO,OAAOP,GAAG,MAAMQ;IACnH;IACAT,QAAQ,CAACQ,KAAKC;QACZ,IAAIH,UAAU,CAAC,KAAK,EAAE/B,QAAQkB,KAAK,CAAC,IAAI;QACxC,IAAI,CAACe,KAAK;YACRF,WAAW;YACX,IAAIG,UAAUH,WAAW,CAAC,EAAE,EAAEG,SAASC,MAAM,CAACjB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QAC9D,OAAO;YACLa,WAAW;YACX,IAAIG,UAAUH,WAAW,CAAC,EAAE,EAAEG,SAASC,MAAM,CAAC,WAAW,EAAED,SAASE,QAAQ,CAAC,CAAC,CAAC;YAC/EL,WAAW,CAAC,SAAS,EAAEE,IAAIF,OAAO,EAAE;QACtC;QACAM,QAAQC,GAAG,CAACP;QACZ5B,SAAS8B;IACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installCompressed.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\nimport type { ChecksumCallback, ChecksumResult, InstallOptions } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: ChecksumResult | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n validateDownload(distPath, cachePath, (err, result) => {\n checksum = result;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, dest, { strip: 1, time: 1000 }));\n queue.await((err) => callback(err, checksum));\n}\n"],"names":["path","Queue","NODE_DIST_BASE_URL","conditionalCache","extract","validateDownload","installCompressed","distPath","dest","options","callback","downloadPath","cachePath","join","basename","checksum","queue","defer","bind","cb","err","result","strip","time","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAE7B,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,OAAOC,sBAAsB,6BAA6B;AAC1D,OAAOC,aAAa,oBAAoB;AAExC,OAAOC,sBAAsB,wBAAwB;AAErD,eAAe,SAASC,kBAAkBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC3H,MAAMC,eAAe,GAAGT,mBAAmB,CAAC,EAAEK,UAAU;IACxD,MAAMK,YAAYZ,KAAKa,IAAI,CAACJ,QAAQG,SAAS,EAAEZ,KAAKc,QAAQ,CAACH;IAE7D,IAAII;IACJ,MAAMC,QAAQ,IAAIf,MAAM;IACxBe,MAAMC,KAAK,CAACd,iBAAiBe,IAAI,CAAC,MAAMP,cAAcC;IACtDI,MAAMC,KAAK,CAAC,CAACE;QACXd,iBAAiBE,UAAUK,WAAW,CAACQ,KAAKC;YAC1CN,WAAWM;YACXF,GAAGC;QACL;IACF;IACAJ,MAAMC,KAAK,CAACb,QAAQc,IAAI,CAAC,MAAMN,WAAWJ,MAAM;QAAEc,OAAO;QAAGC,MAAM;IAAK;IACvEP,MAAMQ,KAAK,CAAC,CAACJ,MAAQV,SAASU,KAAKL;AACrC"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installCompressed.ts"],"sourcesContent":["import path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport extract from '../lib/extract.ts';\nimport type { ChecksumCallback, ChecksumResult, InstallOptions } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installCompressed(distPath: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n let checksum: ChecksumResult | undefined;\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer((cb) => {\n validateDownload(distPath, cachePath, (err, result) => {\n checksum = result;\n cb(err);\n });\n });\n queue.defer(extract.bind(null, cachePath, dest, { strip: 1, time: 1000 }));\n queue.await((err) => callback(err, checksum));\n}\n"],"names":["path","Queue","NODE_DIST_BASE_URL","conditionalCache","extract","validateDownload","installCompressed","distPath","dest","options","callback","downloadPath","cachePath","join","basename","checksum","queue","defer","bind","cb","err","result","strip","time","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAE7B,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,OAAOC,sBAAsB,6BAA6B;AAC1D,OAAOC,aAAa,oBAAoB;AAExC,OAAOC,sBAAsB,wBAAwB;AAErD,eAAe,SAASC,kBAAkBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC3H,MAAMC,eAAe,GAAGT,mBAAmB,CAAC,EAAEK,UAAU;IACxD,MAAMK,YAAYZ,KAAKa,IAAI,CAACJ,QAAQG,SAAS,EAAEZ,KAAKc,QAAQ,CAACH;IAE7D,IAAII;IACJ,MAAMC,QAAQ,IAAIf,MAAM;IACxBe,MAAMC,KAAK,CAACd,iBAAiBe,IAAI,CAAC,MAAMP,cAAcC;IACtDI,MAAMC,KAAK,CAAC,CAACE;QACXd,iBAAiBE,UAAUK,WAAW,CAACQ,KAAKC;YAC1CN,WAAWM;YACXF,GAAGC;QACL;IACF;IACAJ,MAAMC,KAAK,CAACb,QAAQc,IAAI,CAAC,MAAMN,WAAWJ,MAAM;QAAEc,OAAO;QAAGC,MAAM;IAAK;IACvEP,MAAMQ,KAAK,CAAC,CAACJ,MAAQV,SAASU,KAAKL;AACrC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installExe.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL, NODE_FILE_PATHS } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport copyFile from '../lib/copyFile.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, `node-${distPath}.exe`);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(dest, nodePath);\n\n fs.stat(execPath, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(copyFile.bind(null, cachePath, execPath));\n queue.await(callback);\n });\n}\n"],"names":["fs","path","Queue","NODE_DIST_BASE_URL","NODE_FILE_PATHS","conditionalCache","copyFile","validateDownload","installExe","distPath","dest","options","callback","platform","downloadPath","cachePath","join","nodePath","posix","execPath","stat","err","queue","defer","bind","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAE7B,SAASC,kBAAkB,EAAEC,eAAe,QAAQ,kBAAkB;AACtE,OAAOC,sBAAsB,6BAA6B;AAC1D,OAAOC,cAAc,qBAAqB;AAE1C,OAAOC,sBAAsB,wBAAwB;AAErD,eAAe,SAASC,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,eAAe,GAAGX,mBAAmB,CAAC,EAAEM,UAAU;IACxD,MAAMM,YAAYd,KAAKe,IAAI,CAACL,QAAQI,SAAS,EAAE,CAAC,KAAK,EAAEN,SAAS,IAAI,CAAC;IACrE,MAAMQ,WAAWb,eAAe,CAACS,SAAS,IAAIT,gBAAgBc,KAAK;IACnE,MAAMC,WAAWlB,KAAKe,IAAI,CAACN,MAAMO;IAEjCjB,GAAGoB,IAAI,CAACD,UAAU,CAACE;QACjB,IAAI,CAACA,KAAK,OAAOT,YAAY,iBAAiB;QAE9C,MAAMU,QAAQ,IAAIpB,MAAM;QACxBoB,MAAMC,KAAK,CAAClB,iBAAiBmB,IAAI,CAAC,MAAMV,cAAcC;QACtDO,MAAMC,KAAK,CAAChB,iBAAiBiB,IAAI,CAAC,MAAMf,UAAUM;QAClDO,MAAMC,KAAK,CAACjB,SAASkB,IAAI,CAAC,MAAMT,WAAWI;QAC3CG,MAAMG,KAAK,CAACb;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installExe.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_DIST_BASE_URL, NODE_FILE_PATHS } from '../constants.ts';\nimport conditionalCache from '../lib/conditionalCache.ts';\nimport copyFile from '../lib/copyFile.ts';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport validateDownload from './validateDownload.ts';\n\nexport default function installExe(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n const cachePath = path.join(options.cachePath, `node-${distPath}.exe`);\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const execPath = path.join(dest, nodePath);\n\n fs.stat(execPath, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(copyFile.bind(null, cachePath, execPath));\n queue.await(callback);\n });\n}\n"],"names":["fs","path","Queue","NODE_DIST_BASE_URL","NODE_FILE_PATHS","conditionalCache","copyFile","validateDownload","installExe","distPath","dest","options","callback","platform","downloadPath","cachePath","join","nodePath","posix","execPath","stat","err","queue","defer","bind","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAE7B,SAASC,kBAAkB,EAAEC,eAAe,QAAQ,kBAAkB;AACtE,OAAOC,sBAAsB,6BAA6B;AAC1D,OAAOC,cAAc,qBAAqB;AAE1C,OAAOC,sBAAsB,wBAAwB;AAErD,eAAe,SAASC,WAAWC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACnH,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,eAAe,GAAGX,mBAAmB,CAAC,EAAEM,UAAU;IACxD,MAAMM,YAAYd,KAAKe,IAAI,CAACL,QAAQI,SAAS,EAAE,CAAC,KAAK,EAAEN,SAAS,IAAI,CAAC;IACrE,MAAMQ,WAAWb,eAAe,CAACS,SAAS,IAAIT,gBAAgBc,KAAK;IACnE,MAAMC,WAAWlB,KAAKe,IAAI,CAACN,MAAMO;IAEjCjB,GAAGoB,IAAI,CAACD,UAAU,CAACE;QACjB,IAAI,CAACA,KAAK,OAAOT,YAAY,iBAAiB;QAE9C,MAAMU,QAAQ,IAAIpB,MAAM;QACxBoB,MAAMC,KAAK,CAAClB,iBAAiBmB,IAAI,CAAC,MAAMV,cAAcC;QACtDO,MAAMC,KAAK,CAAChB,iBAAiBiB,IAAI,CAAC,MAAMf,UAAUM;QAClDO,MAAMC,KAAK,CAACjB,SAASkB,IAAI,CAAC,MAAMT,WAAWI;QAC3CG,MAAMG,KAAK,CAACb;IACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installFilename.ts"],"sourcesContent":["import fromFilename from 'node-filename-to-dist-paths';\nimport path from 'path';\nimport { EXTENSIONS_COMPRESSED } from '../constants.ts';\nimport type { ChecksumCallback, InstallOptions } from '../types.ts';\nimport installCompressed from './installCompressed.ts';\nimport installExe from './installExe.ts';\nimport installSource from './installSource/index.ts';\n\nexport default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const distPath = fromFilename(filename, version);\n if (!distPath) {\n callback(new Error('Not found'));\n return;\n }\n const ext = path.extname(distPath);\n\n if (filename === 'src') return installSource(distPath, dest, options, callback);\n if (ext === '.exe') return installExe(distPath, dest, options, callback);\n if (EXTENSIONS_COMPRESSED.indexOf(ext) >= 0) {\n return installCompressed(distPath, dest, options, callback);\n }\n callback(new Error(`Unable to install ${version} distPath: ${distPath}`));\n}\n"],"names":["fromFilename","path","EXTENSIONS_COMPRESSED","installCompressed","installExe","installSource","installFilename","filename","version","dest","options","callback","distPath","Error","ext","extname","indexOf"],"mappings":"AAAA,OAAOA,kBAAkB,8BAA8B;AACvD,OAAOC,UAAU,OAAO;AACxB,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAOC,uBAAuB,yBAAyB;AACvD,OAAOC,gBAAgB,kBAAkB;AACzC,OAAOC,mBAAmB,2BAA2B;AAErD,eAAe,SAASC,gBAAgBC,QAAgB,EAAEC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1I,MAAMC,WAAWZ,aAAaO,UAAUC;IACxC,IAAI,CAACI,UAAU;QACbD,SAAS,IAAIE,MAAM;QACnB;IACF;IACA,MAAMC,MAAMb,KAAKc,OAAO,CAACH;IAEzB,IAAIL,aAAa,OAAO,OAAOF,cAAcO,UAAUH,MAAMC,SAASC;IACtE,IAAIG,QAAQ,QAAQ,OAAOV,WAAWQ,UAAUH,MAAMC,SAASC;IAC/D,IAAIT,sBAAsBc,OAAO,CAACF,QAAQ,GAAG;QAC3C,OAAOX,kBAAkBS,UAAUH,MAAMC,SAASC;IACpD;IACAA,SAAS,IAAIE,MAAM,CAAC,kBAAkB,EAAEL,QAAQ,WAAW,EAAEI,UAAU;AACzE"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installFilename.ts"],"sourcesContent":["import fromFilename from 'node-filename-to-dist-paths';\nimport path from 'path';\nimport { EXTENSIONS_COMPRESSED } from '../constants.ts';\nimport type { ChecksumCallback, InstallOptions } from '../types.ts';\nimport installCompressed from './installCompressed.ts';\nimport installExe from './installExe.ts';\nimport installSource from './installSource/index.ts';\n\nexport default function installFilename(filename: string, version: string, dest: string, options: InstallOptions, callback: ChecksumCallback): void {\n const distPath = fromFilename(filename, version);\n if (!distPath) {\n callback(new Error('Not found'));\n return;\n }\n const ext = path.extname(distPath);\n\n if (filename === 'src') return installSource(distPath, dest, options, callback);\n if (ext === '.exe') return installExe(distPath, dest, options, callback);\n if (EXTENSIONS_COMPRESSED.indexOf(ext) >= 0) {\n return installCompressed(distPath, dest, options, callback);\n }\n callback(new Error(`Unable to install ${version} distPath: ${distPath}`));\n}\n"],"names":["fromFilename","path","EXTENSIONS_COMPRESSED","installCompressed","installExe","installSource","installFilename","filename","version","dest","options","callback","distPath","Error","ext","extname","indexOf"],"mappings":"AAAA,OAAOA,kBAAkB,8BAA8B;AACvD,OAAOC,UAAU,OAAO;AACxB,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAOC,uBAAuB,yBAAyB;AACvD,OAAOC,gBAAgB,kBAAkB;AACzC,OAAOC,mBAAmB,2BAA2B;AAErD,eAAe,SAASC,gBAAgBC,QAAgB,EAAEC,OAAe,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1I,MAAMC,WAAWZ,aAAaO,UAAUC;IACxC,IAAI,CAACI,UAAU;QACbD,SAAS,IAAIE,MAAM;QACnB;IACF;IACA,MAAMC,MAAMb,KAAKc,OAAO,CAACH;IAEzB,IAAIL,aAAa,OAAO,OAAOF,cAAcO,UAAUH,MAAMC,SAASC;IACtE,IAAIG,QAAQ,QAAQ,OAAOV,WAAWQ,UAAUH,MAAMC,SAASC;IAC/D,IAAIT,sBAAsBc,OAAO,CAACF,QAAQ,GAAG;QAC3C,OAAOX,kBAAkBS,UAAUH,MAAMC,SAASC;IACpD;IACAA,SAAS,IAAIE,MAAM,CAAC,kBAAkB,EAAEL,QAAQ,WAAW,EAAEI,UAAU;AACzE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installSource/buildPosix.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildTarget = path.join(dest, 'node');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, './configure', [`--prefix=${dest}`], { stdio: 'inherit', cwd: buildPath }));\n queue.defer(spawn.bind(null, 'make', ['install'], { stdio: 'inherit', cwd: buildPath }, callback));\n queue.await(callback);\n });\n}\n"],"names":["spawn","fs","path","Queue","installPosix","buildPath","dest","_options","callback","buildTarget","join","stat","err","queue","defer","bind","stdio","cwd","await"],"mappings":"AAAA,OAAOA,WAAW,iBAAiB;AACnC,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAI7B,eAAe,SAASC,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,MAAMC,cAAcP,KAAKQ,IAAI,CAACJ,MAAM;IAEpCL,GAAGU,IAAI,CAACF,aAAa,CAACG;QACpB,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;QAE9C,MAAMK,QAAQ,IAAIV,MAAM;QACxBU,MAAMC,KAAK,CAACd,MAAMe,IAAI,CAAC,MAAM,eAAe;YAAC,CAAC,SAAS,EAAET,MAAM;SAAC,EAAE;YAAEU,OAAO;YAAWC,KAAKZ;QAAU;QACrGQ,MAAMC,KAAK,CAACd,MAAMe,IAAI,CAAC,MAAM,QAAQ;YAAC;SAAU,EAAE;YAAEC,OAAO;YAAWC,KAAKZ;QAAU,GAAGG;QACxFK,MAAMK,KAAK,CAACV;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/buildPosix.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installPosix(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildTarget = path.join(dest, 'node');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, './configure', [`--prefix=${dest}`], { stdio: 'inherit', cwd: buildPath }));\n queue.defer(spawn.bind(null, 'make', ['install'], { stdio: 'inherit', cwd: buildPath }, callback));\n queue.await(callback);\n });\n}\n"],"names":["spawn","fs","path","Queue","installPosix","buildPath","dest","_options","callback","buildTarget","join","stat","err","queue","defer","bind","stdio","cwd","await"],"mappings":"AAAA,OAAOA,WAAW,iBAAiB;AACnC,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAI7B,eAAe,SAASC,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,MAAMC,cAAcP,KAAKQ,IAAI,CAACJ,MAAM;IAEpCL,GAAGU,IAAI,CAACF,aAAa,CAACG;QACpB,IAAI,CAACA,KAAK,OAAOJ,YAAY,iBAAiB;QAE9C,MAAMK,QAAQ,IAAIV,MAAM;QACxBU,MAAMC,KAAK,CAACd,MAAMe,IAAI,CAAC,MAAM,eAAe;YAAC,CAAC,SAAS,EAAET,MAAM;SAAC,EAAE;YAAEU,OAAO;YAAWC,KAAKZ;QAAU;QACrGQ,MAAMC,KAAK,CAACd,MAAMe,IAAI,CAAC,MAAM,QAAQ;YAAC;SAAU,EAAE;YAAEC,OAAO;YAAWC,KAAKZ;QAAU,GAAGG;QACxFK,MAAMK,KAAK,CAACV;IACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installSource/buildWin32.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport conditionalCopy from '../../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n const buildTarget = path.join(dest, 'node.exe');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(fs.stat.bind(null, buildSource, (err) => (!err ? callback() : spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }))));\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget, false));\n queue.await(callback);\n });\n}\n"],"names":["spawn","fs","path","Queue","conditionalCopy","installWin32","buildPath","dest","_options","callback","buildSource","join","buildTarget","stat","err","queue","defer","bind","stdio","cwd","await"],"mappings":"AAAA,OAAOA,WAAW,iBAAiB;AACnC,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,qBAAqB,+BAA+B;AAI3D,eAAe,SAASC,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,MAAMC,cAAcR,KAAKS,IAAI,CAACL,WAAW,OAAO,WAAW;IAC3D,MAAMM,cAAcV,KAAKS,IAAI,CAACJ,MAAM;IAEpCN,GAAGY,IAAI,CAACD,aAAa,CAACE;QACpB,IAAI,CAACA,KAAK,OAAOL,YAAY,iBAAiB;QAE9C,MAAMM,QAAQ,IAAIZ,MAAM;QACxBY,MAAMC,KAAK,CAACf,GAAGY,IAAI,CAACI,IAAI,CAAC,MAAMP,aAAa,CAACI,MAAS,CAACA,MAAML,aAAaT,MAAM,aAAa,EAAE,EAAE;gBAAEkB,OAAO;gBAAWC,KAAKb;YAAU;QACpIS,MAAMC,KAAK,CAACZ,gBAAgBa,IAAI,CAAC,MAAMP,aAAaE,aAAa;QACjEG,MAAMK,KAAK,CAACX;IACd;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/buildWin32.ts"],"sourcesContent":["import spawn from 'cross-spawn-cb';\nimport fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport conditionalCopy from '../../lib/conditionalCopy.ts';\n\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\n\nexport default function installWin32(buildPath: string, dest: string, _options: InstallOptions, callback: NoParamCallback): void {\n const buildSource = path.join(buildPath, 'out', 'Release', 'node.exe');\n const buildTarget = path.join(dest, 'node.exe');\n\n fs.stat(buildTarget, (err) => {\n if (!err) return callback(); // already exists\n\n const queue = new Queue(1);\n queue.defer(fs.stat.bind(null, buildSource, (err) => (!err ? callback() : spawn('./vcbuild', [], { stdio: 'inherit', cwd: buildPath }))));\n queue.defer(conditionalCopy.bind(null, buildSource, buildTarget, false));\n queue.await(callback);\n });\n}\n"],"names":["spawn","fs","path","Queue","conditionalCopy","installWin32","buildPath","dest","_options","callback","buildSource","join","buildTarget","stat","err","queue","defer","bind","stdio","cwd","await"],"mappings":"AAAA,OAAOA,WAAW,iBAAiB;AACnC,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,qBAAqB,+BAA+B;AAI3D,eAAe,SAASC,aAAaC,SAAiB,EAAEC,IAAY,EAAEC,QAAwB,EAAEC,QAAyB;IACvH,MAAMC,cAAcR,KAAKS,IAAI,CAACL,WAAW,OAAO,WAAW;IAC3D,MAAMM,cAAcV,KAAKS,IAAI,CAACJ,MAAM;IAEpCN,GAAGY,IAAI,CAACD,aAAa,CAACE;QACpB,IAAI,CAACA,KAAK,OAAOL,YAAY,iBAAiB;QAE9C,MAAMM,QAAQ,IAAIZ,MAAM;QACxBY,MAAMC,KAAK,CAACf,GAAGY,IAAI,CAACI,IAAI,CAAC,MAAMP,aAAa,CAACI,MAAS,CAACA,MAAML,aAAaT,MAAM,aAAa,EAAE,EAAE;gBAAEkB,OAAO;gBAAWC,KAAKb;YAAU;QACpIS,MAAMC,KAAK,CAACZ,gBAAgBa,IAAI,CAAC,MAAMP,aAAaE,aAAa;QACjEG,MAAMK,KAAK,CAACX;IACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/installSource/index.ts"],"sourcesContent":["import { safeRm } from 'fs-remove-compat';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { NODE_DIST_BASE_URL } from '../../constants.ts';\nimport conditionalCache from '../../lib/conditionalCache.ts';\nimport extract from '../../lib/extract.ts';\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\nimport validateDownload from '../validateDownload.ts';\nimport buildPosix from './buildPosix.ts';\nimport buildWin32 from './buildWin32.ts';\n\nexport default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const build = platform === 'win32' ? buildWin32 : buildPosix;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n // Use temp build path to avoid race conditions with parallel builds\n const tempBuildPath = tempSuffix(path.join(options.buildPath, path.basename(distPath)));\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(extract.bind(null, cachePath, tempBuildPath));\n queue.defer(build.bind(null, tempBuildPath, dest, options));\n queue.await((err) => {\n // Always clean up temp build directory\n safeRm(tempBuildPath, () => callback(err));\n });\n}\n"],"names":["safeRm","path","Queue","tempSuffix","NODE_DIST_BASE_URL","conditionalCache","extract","validateDownload","buildPosix","buildWin32","InstallSource","distPath","dest","options","callback","platform","build","downloadPath","tempBuildPath","join","buildPath","basename","cachePath","queue","defer","bind","await","err"],"mappings":"AAAA,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,cAAc;AAErC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,OAAOC,sBAAsB,gCAAgC;AAC7D,OAAOC,aAAa,uBAAuB;AAE3C,OAAOC,sBAAsB,yBAAyB;AACtD,OAAOC,gBAAgB,kBAAkB;AACzC,OAAOC,gBAAgB,kBAAkB;AAEzC,eAAe,SAASC,cAAcC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACtH,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,QAAQD,aAAa,UAAUN,aAAaD;IAClD,MAAMS,eAAe,GAAGb,mBAAmB,CAAC,EAAEO,UAAU;IACxD,oEAAoE;IACpE,MAAMO,gBAAgBf,WAAWF,KAAKkB,IAAI,CAACN,QAAQO,SAAS,EAAEnB,KAAKoB,QAAQ,CAACV;IAC5E,MAAMW,YAAYrB,KAAKkB,IAAI,CAACN,QAAQS,SAAS,EAAErB,KAAKoB,QAAQ,CAACJ;IAE7D,MAAMM,QAAQ,IAAIrB,MAAM;IACxBqB,MAAMC,KAAK,CAACnB,iBAAiBoB,IAAI,CAAC,MAAMR,cAAcK;IACtDC,MAAMC,KAAK,CAACjB,iBAAiBkB,IAAI,CAAC,MAAMd,UAAUW;IAClDC,MAAMC,KAAK,CAAClB,QAAQmB,IAAI,CAAC,MAAMH,WAAWJ;IAC1CK,MAAMC,KAAK,CAACR,MAAMS,IAAI,CAAC,MAAMP,eAAeN,MAAMC;IAClDU,MAAMG,KAAK,CAAC,CAACC;QACX,uCAAuC;QACvC3B,OAAOkB,eAAe,IAAMJ,SAASa;IACvC;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/installSource/index.ts"],"sourcesContent":["import { safeRm } from 'fs-remove-compat';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { NODE_DIST_BASE_URL } from '../../constants.ts';\nimport conditionalCache from '../../lib/conditionalCache.ts';\nimport extract from '../../lib/extract.ts';\nimport type { InstallOptions, NoParamCallback } from '../../types.ts';\nimport validateDownload from '../validateDownload.ts';\nimport buildPosix from './buildPosix.ts';\nimport buildWin32 from './buildWin32.ts';\n\nexport default function InstallSource(distPath: string, dest: string, options: InstallOptions, callback: NoParamCallback): void {\n const platform = options.platform;\n const build = platform === 'win32' ? buildWin32 : buildPosix;\n const downloadPath = `${NODE_DIST_BASE_URL}/${distPath}`;\n // Use temp build path to avoid race conditions with parallel builds\n const tempBuildPath = tempSuffix(path.join(options.buildPath, path.basename(distPath)));\n const cachePath = path.join(options.cachePath, path.basename(downloadPath));\n\n const queue = new Queue(1);\n queue.defer(conditionalCache.bind(null, downloadPath, cachePath));\n queue.defer(validateDownload.bind(null, distPath, cachePath));\n queue.defer(extract.bind(null, cachePath, tempBuildPath));\n queue.defer(build.bind(null, tempBuildPath, dest, options));\n queue.await((err) => {\n // Always clean up temp build directory\n safeRm(tempBuildPath, () => callback(err));\n });\n}\n"],"names":["safeRm","path","Queue","tempSuffix","NODE_DIST_BASE_URL","conditionalCache","extract","validateDownload","buildPosix","buildWin32","InstallSource","distPath","dest","options","callback","platform","build","downloadPath","tempBuildPath","join","buildPath","basename","cachePath","queue","defer","bind","await","err"],"mappings":"AAAA,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,cAAc;AAErC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,OAAOC,sBAAsB,gCAAgC;AAC7D,OAAOC,aAAa,uBAAuB;AAE3C,OAAOC,sBAAsB,yBAAyB;AACtD,OAAOC,gBAAgB,kBAAkB;AACzC,OAAOC,gBAAgB,kBAAkB;AAEzC,eAAe,SAASC,cAAcC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAAyB;IACtH,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,QAAQD,aAAa,UAAUN,aAAaD;IAClD,MAAMS,eAAe,GAAGb,mBAAmB,CAAC,EAAEO,UAAU;IACxD,oEAAoE;IACpE,MAAMO,gBAAgBf,WAAWF,KAAKkB,IAAI,CAACN,QAAQO,SAAS,EAAEnB,KAAKoB,QAAQ,CAACV;IAC5E,MAAMW,YAAYrB,KAAKkB,IAAI,CAACN,QAAQS,SAAS,EAAErB,KAAKoB,QAAQ,CAACJ;IAE7D,MAAMM,QAAQ,IAAIrB,MAAM;IACxBqB,MAAMC,KAAK,CAACnB,iBAAiBoB,IAAI,CAAC,MAAMR,cAAcK;IACtDC,MAAMC,KAAK,CAACjB,iBAAiBkB,IAAI,CAAC,MAAMd,UAAUW;IAClDC,MAAMC,KAAK,CAAClB,QAAQmB,IAAI,CAAC,MAAMH,WAAWJ;IAC1CK,MAAMC,KAAK,CAACR,MAAMS,IAAI,CAAC,MAAMP,eAAeN,MAAMC;IAClDU,MAAMG,KAAK,CAAC,CAACC;QACX,uCAAuC;QACvC3B,OAAOkB,eAAe,IAAMJ,SAASa;IACvC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/installNode/validateDownload.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport oo from 'on-one';\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\n\nimport type { ChecksumCallback, ChecksumResult } from '../types.ts';\n\nexport default function validateDownload(distPath: string, installPath: string, callback: ChecksumCallback): void {\n const version = distPath.split('/')[0];\n const downloadPath = `${NODE_DIST_BASE_URL}/${version}/SHASUMS256.txt`;\n getContent(downloadPath, 'utf8', (err, res) => {\n if (err) return callback(err);\n const text = res.content;\n const filename = distPath.split('/').slice(1).join('/');\n const expected = text.split(filename)[0].split('\\n').pop().trim();\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(installPath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n const actual = hash.digest('hex');\n const match = actual === expected;\n const checksum: ChecksumResult = { actual, expected, match };\n match ? callback(null, checksum) : callback(new Error(`${filename} checksum failed`), checksum);\n });\n });\n}\n"],"names":["crypto","fs","getContent","oo","NODE_DIST_BASE_URL","validateDownload","distPath","installPath","callback","version","split","downloadPath","err","res","text","content","filename","slice","join","expected","pop","trim","hash","createHash","stream","createReadStream","on","data","update","actual","digest","match","checksum","Error"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAC5B,OAAOC,QAAQ,KAAK;AACpB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,QAAQ,SAAS;AACxB,SAASC,kBAAkB,QAAQ,kBAAkB;AAIrD,eAAe,SAASC,iBAAiBC,QAAgB,EAAEC,WAAmB,EAAEC,QAA0B;IACxG,MAAMC,UAAUH,SAASI,KAAK,CAAC,IAAI,CAAC,EAAE;IACtC,MAAMC,eAAe,GAAGP,mBAAmB,CAAC,EAAEK,QAAQ,eAAe,CAAC;IACtEP,WAAWS,cAAc,QAAQ,CAACC,KAAKC;QACrC,IAAID,KAAK,OAAOJ,SAASI;QACzB,MAAME,OAAOD,IAAIE,OAAO;QACxB,MAAMC,WAAWV,SAASI,KAAK,CAAC,KAAKO,KAAK,CAAC,GAAGC,IAAI,CAAC;QACnD,MAAMC,WAAWL,KAAKJ,KAAK,CAACM,SAAS,CAAC,EAAE,CAACN,KAAK,CAAC,MAAMU,GAAG,GAAGC,IAAI;QAC/D,MAAMC,OAAOtB,OAAOuB,UAAU,CAAC;QAC/B,MAAMC,SAASvB,GAAGwB,gBAAgB,CAAClB;QACnCiB,OAAOE,EAAE,CAAC,QAAQ,CAACC,OAASL,KAAKM,MAAM,CAACD;QACxCxB,GAAGqB,QAAQ;YAAC;YAAS;YAAO;YAAS;SAAS,EAAE,CAACZ;YAC/C,IAAIA,KAAK,OAAOJ,SAASI;YACzB,MAAMiB,SAASP,KAAKQ,MAAM,CAAC;YAC3B,MAAMC,QAAQF,WAAWV;YACzB,MAAMa,WAA2B;gBAAEH;gBAAQV;gBAAUY;YAAM;YAC3DA,QAAQvB,SAAS,MAAMwB,YAAYxB,SAAS,IAAIyB,MAAM,GAAGjB,SAAS,gBAAgB,CAAC,GAAGgB;QACxF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/installNode/validateDownload.ts"],"sourcesContent":["import crypto from 'crypto';\nimport fs from 'fs';\nimport { getContent } from 'get-file-compat';\nimport oo from 'on-one';\nimport { NODE_DIST_BASE_URL } from '../constants.ts';\n\nimport type { ChecksumCallback, ChecksumResult } from '../types.ts';\n\nexport default function validateDownload(distPath: string, installPath: string, callback: ChecksumCallback): void {\n const version = distPath.split('/')[0];\n const downloadPath = `${NODE_DIST_BASE_URL}/${version}/SHASUMS256.txt`;\n getContent(downloadPath, 'utf8', (err, res) => {\n if (err) return callback(err);\n const text = res.content;\n const filename = distPath.split('/').slice(1).join('/');\n const expected = text.split(filename)[0].split('\\n').pop().trim();\n const hash = crypto.createHash('sha256');\n const stream = fs.createReadStream(installPath);\n stream.on('data', (data) => hash.update(data));\n oo(stream, ['error', 'end', 'close', 'finish'], (err?: Error) => {\n if (err) return callback(err);\n const actual = hash.digest('hex');\n const match = actual === expected;\n const checksum: ChecksumResult = { actual, expected, match };\n match ? callback(null, checksum) : callback(new Error(`${filename} checksum failed`), checksum);\n });\n });\n}\n"],"names":["crypto","fs","getContent","oo","NODE_DIST_BASE_URL","validateDownload","distPath","installPath","callback","version","split","downloadPath","err","res","text","content","filename","slice","join","expected","pop","trim","hash","createHash","stream","createReadStream","on","data","update","actual","digest","match","checksum","Error"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAC5B,OAAOC,QAAQ,KAAK;AACpB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,QAAQ,SAAS;AACxB,SAASC,kBAAkB,QAAQ,kBAAkB;AAIrD,eAAe,SAASC,iBAAiBC,QAAgB,EAAEC,WAAmB,EAAEC,QAA0B;IACxG,MAAMC,UAAUH,SAASI,KAAK,CAAC,IAAI,CAAC,EAAE;IACtC,MAAMC,eAAe,GAAGP,mBAAmB,CAAC,EAAEK,QAAQ,eAAe,CAAC;IACtEP,WAAWS,cAAc,QAAQ,CAACC,KAAKC;QACrC,IAAID,KAAK,OAAOJ,SAASI;QACzB,MAAME,OAAOD,IAAIE,OAAO;QACxB,MAAMC,WAAWV,SAASI,KAAK,CAAC,KAAKO,KAAK,CAAC,GAAGC,IAAI,CAAC;QACnD,MAAMC,WAAWL,KAAKJ,KAAK,CAACM,SAAS,CAAC,EAAE,CAACN,KAAK,CAAC,MAAMU,GAAG,GAAGC,IAAI;QAC/D,MAAMC,OAAOtB,OAAOuB,UAAU,CAAC;QAC/B,MAAMC,SAASvB,GAAGwB,gBAAgB,CAAClB;QACnCiB,OAAOE,EAAE,CAAC,QAAQ,CAACC,OAASL,KAAKM,MAAM,CAACD;QACxCxB,GAAGqB,QAAQ;YAAC;YAAS;YAAO;YAAS;SAAS,EAAE,CAACZ;YAC/C,IAAIA,KAAK,OAAOJ,SAASI;YACzB,MAAMiB,SAASP,KAAKQ,MAAM,CAAC;YAC3B,MAAMC,QAAQF,WAAWV;YACzB,MAAMa,WAA2B;gBAAEH;gBAAQV;gBAAUY;YAAM;YAC3DA,QAAQvB,SAAS,MAAMwB,YAAYxB,SAAS,IAAIyB,MAAM,GAAGjB,SAAS,gBAAgB,CAAC,GAAGgB;QACxF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/checkMissing.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_FILE_PATHS, NPM_PACKAGE_PATH } from '../constants.ts';\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, missing?: string[]) => void;\n\nexport default function checkMissing(dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const npmPackagePath = NPM_PACKAGE_PATH[platform] || NPM_PACKAGE_PATH.posix;\n\n const missing: string[] = [];\n function check(filePath, key, cb) {\n fs.stat(path.join(dest, filePath), (err) => {\n if (err && missing.indexOf(key) < 0) missing.push(key);\n cb();\n });\n }\n\n const queue = new Queue();\n queue.defer(check.bind(null, nodePath, 'node'));\n queue.defer(check.bind(null, npmPackagePath, 'npm'));\n queue.await(() => callback(null, missing));\n}\n"],"names":["fs","path","Queue","NODE_FILE_PATHS","NPM_PACKAGE_PATH","checkMissing","dest","options","callback","platform","nodePath","posix","npmPackagePath","missing","check","filePath","key","cb","stat","join","err","indexOf","push","queue","defer","bind","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAE7B,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,kBAAkB;AAMpE,eAAe,SAASC,aAAaC,IAAY,EAAEC,OAAuB,EAAEC,QAAkB;IAC5F,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,WAAWP,eAAe,CAACM,SAAS,IAAIN,gBAAgBQ,KAAK;IACnE,MAAMC,iBAAiBR,gBAAgB,CAACK,SAAS,IAAIL,iBAAiBO,KAAK;IAE3E,MAAME,UAAoB,EAAE;IAC5B,SAASC,MAAMC,QAAQ,EAAEC,GAAG,EAAEC,EAAE;QAC9BjB,GAAGkB,IAAI,CAACjB,KAAKkB,IAAI,CAACb,MAAMS,WAAW,CAACK;YAClC,IAAIA,OAAOP,QAAQQ,OAAO,CAACL,OAAO,GAAGH,QAAQS,IAAI,CAACN;YAClDC;QACF;IACF;IAEA,MAAMM,QAAQ,IAAIrB;IAClBqB,MAAMC,KAAK,CAACV,MAAMW,IAAI,CAAC,MAAMf,UAAU;IACvCa,MAAMC,KAAK,CAACV,MAAMW,IAAI,CAAC,MAAMb,gBAAgB;IAC7CW,MAAMG,KAAK,CAAC,IAAMlB,SAAS,MAAMK;AACnC"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/checkMissing.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport { NODE_FILE_PATHS, NPM_PACKAGE_PATH } from '../constants.ts';\n\nimport type { InstallOptions } from '../types.ts';\n\nexport type Callback = (error?: Error, missing?: string[]) => void;\n\nexport default function checkMissing(dest: string, options: InstallOptions, callback: Callback): void {\n const platform = options.platform;\n const nodePath = NODE_FILE_PATHS[platform] || NODE_FILE_PATHS.posix;\n const npmPackagePath = NPM_PACKAGE_PATH[platform] || NPM_PACKAGE_PATH.posix;\n\n const missing: string[] = [];\n function check(filePath, key, cb) {\n fs.stat(path.join(dest, filePath), (err) => {\n if (err && missing.indexOf(key) < 0) missing.push(key);\n cb();\n });\n }\n\n const queue = new Queue();\n queue.defer(check.bind(null, nodePath, 'node'));\n queue.defer(check.bind(null, npmPackagePath, 'npm'));\n queue.await(() => callback(null, missing));\n}\n"],"names":["fs","path","Queue","NODE_FILE_PATHS","NPM_PACKAGE_PATH","checkMissing","dest","options","callback","platform","nodePath","posix","npmPackagePath","missing","check","filePath","key","cb","stat","join","err","indexOf","push","queue","defer","bind","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAE7B,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,kBAAkB;AAMpE,eAAe,SAASC,aAAaC,IAAY,EAAEC,OAAuB,EAAEC,QAAkB;IAC5F,MAAMC,WAAWF,QAAQE,QAAQ;IACjC,MAAMC,WAAWP,eAAe,CAACM,SAAS,IAAIN,gBAAgBQ,KAAK;IACnE,MAAMC,iBAAiBR,gBAAgB,CAACK,SAAS,IAAIL,iBAAiBO,KAAK;IAE3E,MAAME,UAAoB,EAAE;IAC5B,SAASC,MAAMC,QAAQ,EAAEC,GAAG,EAAEC,EAAE;QAC9BjB,GAAGkB,IAAI,CAACjB,KAAKkB,IAAI,CAACb,MAAMS,WAAW,CAACK;YAClC,IAAIA,OAAOP,QAAQQ,OAAO,CAACL,OAAO,GAAGH,QAAQS,IAAI,CAACN;YAClDC;QACF;IACF;IAEA,MAAMM,QAAQ,IAAIrB;IAClBqB,MAAMC,KAAK,CAACV,MAAMW,IAAI,CAAC,MAAMf,UAAU;IACvCa,MAAMC,KAAK,CAACV,MAAMW,IAAI,CAAC,MAAMb,gBAAgB;IAC7CW,MAAMG,KAAK,CAAC,IAAMlB,SAAS,MAAMK;AACnC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/conditionalCache.ts"],"sourcesContent":["import fs from 'fs';\nimport { getFile } from 'get-file-compat';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): void {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n ensureDestinationParent(dest, (err) => {\n err ? callback(err) : getFile(endpoint, dest, callback);\n });\n });\n}\n"],"names":["fs","getFile","ensureDestinationParent","conditionalCache","endpoint","dest","options","callback","stat","err"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,OAAO,QAAQ,kBAAkB;AAE1C,OAAOC,6BAA6B,+BAA+B;AAEnE,eAAe,SAASC,iBAAiBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1HA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;IACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DN,GAAGQ,IAAI,CAACH,MAAM,CAACI;QACb,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAC9CL,wBAAwBG,MAAM,CAACI;YAC7BA,MAAMF,SAASE,OAAOR,QAAQG,UAAUC,MAAME;QAChD;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCache.ts"],"sourcesContent":["import fs from 'fs';\nimport { getFile } from 'get-file-compat';\nimport type { InstallOptions, NoParamCallback } from '../types.ts';\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function conditionalCache(endpoint: string, dest: string, options: InstallOptions, callback?: NoParamCallback): void {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n ensureDestinationParent(dest, (err) => {\n err ? callback(err) : getFile(endpoint, dest, callback);\n });\n });\n}\n"],"names":["fs","getFile","ensureDestinationParent","conditionalCache","endpoint","dest","options","callback","stat","err"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,OAAO,QAAQ,kBAAkB;AAE1C,OAAOC,6BAA6B,+BAA+B;AAEnE,eAAe,SAASC,iBAAiBC,QAAgB,EAAEC,IAAY,EAAEC,OAAuB,EAAEC,QAA0B;IAC1HA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;IACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DN,GAAGQ,IAAI,CAACH,MAAM,CAACI;QACb,IAAI,CAACA,KAAK,OAAOF,YAAY,iBAAiB;QAC9CL,wBAAwBG,MAAM,CAACI;YAC7BA,MAAMF,SAASE,OAAOR,QAAQG,UAAUC,MAAME;QAChD;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/conditionalCopy.ts"],"sourcesContent":["import fs from 'fs';\nimport type { NoParamCallback } from '../types.ts';\nimport copyFile from './copyFile.ts';\n\nexport default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): void {\n if (typeof optional === 'function') {\n callback(new Error('conditionalCopy missing options'));\n return;\n }\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n\n fs.stat(src, (err) => {\n err && optional ? callback() : copyFile(src, dest, callback); // optional file missing\n });\n });\n}\n"],"names":["fs","copyFile","conditionalCopy","src","dest","optional","callback","Error","stat","err"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AAEpB,OAAOC,cAAc,gBAAgB;AAErC,eAAe,SAASC,gBAAgBC,GAAW,EAAEC,IAAY,EAAEC,QAAiB,EAAEC,QAAyB;IAC7G,IAAI,OAAOD,aAAa,YAAY;QAClCC,SAAS,IAAIC,MAAM;QACnB;IACF;IAEAP,GAAGQ,IAAI,CAACJ,MAAM,CAACK;QACb,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAE9CN,GAAGQ,IAAI,CAACL,KAAK,CAACM;YACZA,OAAOJ,WAAWC,aAAaL,SAASE,KAAKC,MAAME,WAAW,wBAAwB;QACxF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/conditionalCopy.ts"],"sourcesContent":["import fs from 'fs';\nimport type { NoParamCallback } from '../types.ts';\nimport copyFile from './copyFile.ts';\n\nexport default function conditionalCopy(src: string, dest: string, optional: boolean, callback: NoParamCallback): void {\n if (typeof optional === 'function') {\n callback(new Error('conditionalCopy missing options'));\n return;\n }\n\n fs.stat(dest, (err) => {\n if (!err) return callback(); // already exists\n\n fs.stat(src, (err) => {\n err && optional ? callback() : copyFile(src, dest, callback); // optional file missing\n });\n });\n}\n"],"names":["fs","copyFile","conditionalCopy","src","dest","optional","callback","Error","stat","err"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AAEpB,OAAOC,cAAc,gBAAgB;AAErC,eAAe,SAASC,gBAAgBC,GAAW,EAAEC,IAAY,EAAEC,QAAiB,EAAEC,QAAyB;IAC7G,IAAI,OAAOD,aAAa,YAAY;QAClCC,SAAS,IAAIC,MAAM;QACnB;IACF;IAEAP,GAAGQ,IAAI,CAACJ,MAAM,CAACK;QACb,IAAI,CAACA,KAAK,OAAOH,YAAY,iBAAiB;QAE9CN,GAAGQ,IAAI,CAACL,KAAK,CAACM;YACZA,OAAOJ,WAAWC,aAAaL,SAASE,KAAKC,MAAME,WAAW,wBAAwB;QACxF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import type { NoParamCallback } from 'fs';\nimport { copyFile } from 'fs-copy-compat';\nimport { safeRm } from 'fs-remove-compat';\nimport Queue from 'queue-cb';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n safeRm(dest, callback);\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["copyFile","safeRm","Queue","ensureDestinationParent","safeCopyFile","src","dest","callback","queue","defer","bind","await"],"mappings":"AACA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,WAAW;AAE7B,OAAOC,6BAA6B,+BAA+B;AAEnE,eAAe,SAASC,aAAaC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,MAAMC,QAAQ,IAAIN,MAAM;IAExBM,MAAMC,KAAK,CAACN,wBAAwBO,IAAI,CAAC,MAAMJ;IAC/CE,MAAMC,KAAK,CAAC,CAACF;QACXN,OAAOK,MAAMC;IACf;IACAC,MAAMC,KAAK,CAACT,SAASU,IAAI,CAAC,MAAML,KAAKC;IACrCE,MAAMG,KAAK,CAACJ;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import type { NoParamCallback } from 'fs';\nimport { copyFile } from 'fs-copy-compat';\nimport { safeRm } from 'fs-remove-compat';\nimport Queue from 'queue-cb';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n safeRm(dest, callback);\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["copyFile","safeRm","Queue","ensureDestinationParent","safeCopyFile","src","dest","callback","queue","defer","bind","await"],"mappings":"AACA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,WAAW;AAE7B,OAAOC,6BAA6B,+BAA+B;AAEnE,eAAe,SAASC,aAAaC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,MAAMC,QAAQ,IAAIN,MAAM;IAExBM,MAAMC,KAAK,CAACN,wBAAwBO,IAAI,CAAC,MAAMJ;IAC/CE,MAAMC,KAAK,CAAC,CAACF;QACXN,OAAOK,MAAMC;IACf;IACAC,MAAMC,KAAK,CAACT,SAASU,IAAI,CAAC,MAAML,KAAKC;IACrCE,MAAMG,KAAK,CAACJ;AACd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/ensureDestinationParent.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\n\nimport type { NoParamCallback } from '../types.ts';\n\nexport default function ensureDestinationParent(dest: string, callback: NoParamCallback): void {\n const parent = path.dirname(dest);\n if (parent === '.' || parent === '/') return callback();\n mkdirp(parent, callback);\n}\n"],"names":["mkdirp","path","ensureDestinationParent","dest","callback","parent","dirname"],"mappings":"AAAA,OAAOA,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AAIxB,eAAe,SAASC,wBAAwBC,IAAY,EAAEC,QAAyB;IACrF,MAAMC,SAASJ,KAAKK,OAAO,CAACH;IAC5B,IAAIE,WAAW,OAAOA,WAAW,KAAK,OAAOD;IAC7CJ,OAAOK,QAAQD;AACjB"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/ensureDestinationParent.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\n\nimport type { NoParamCallback } from '../types.ts';\n\nexport default function ensureDestinationParent(dest: string, callback: NoParamCallback): void {\n const parent = path.dirname(dest);\n if (parent === '.' || parent === '/') return callback();\n mkdirp(parent, callback);\n}\n"],"names":["mkdirp","path","ensureDestinationParent","dest","callback","parent","dirname"],"mappings":"AAAA,OAAOA,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AAIxB,eAAe,SAASC,wBAAwBC,IAAY,EAAEC,QAAyB;IACrF,MAAMC,SAASJ,KAAKK,OAAO,CAACH;IAC5B,IAAIE,WAAW,OAAOA,WAAW,KAAK,OAAOD;IAC7CJ,OAAOK,QAAQD;AACjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/extract.ts"],"sourcesContent":["import fastExtract from 'fast-extract';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { NoParamCallback } from '../types.ts';\n\ninterface ExtractOptions {\n strip?: number;\n time?: number;\n}\n\nexport default function extract(src: string, dest: string, options: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const extractOptions = { strip: 1, time: 1000, ...options };\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, path.dirname(dest)));\n queue.defer(fastExtract.bind(null, src, dest, extractOptions));\n queue.await(callback);\n}\n"],"names":["fastExtract","mkdirp","path","Queue","extract","src","dest","options","callback","extractOptions","strip","time","queue","defer","bind","dirname","await"],"mappings":"AAAA,OAAOA,iBAAiB,eAAe;AACvC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAS7B,eAAe,SAASC,QAAQC,GAAW,EAAEC,IAAY,EAAEC,OAAyC,EAAEC,QAA0B;IAC9H,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IAEA,MAAME,iBAAiB;QAAEC,OAAO;QAAGC,MAAM;QAAM,GAAGJ,OAAO;IAAC;IAE1D,MAAMK,QAAQ,IAAIT,MAAM;IACxBS,MAAMC,KAAK,CAACZ,OAAOa,IAAI,CAAC,MAAMZ,KAAKa,OAAO,CAACT;IAC3CM,MAAMC,KAAK,CAACb,YAAYc,IAAI,CAAC,MAAMT,KAAKC,MAAMG;IAC9CG,MAAMI,KAAK,CAACR;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/extract.ts"],"sourcesContent":["import fastExtract from 'fast-extract';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\n\nimport type { NoParamCallback } from '../types.ts';\n\ninterface ExtractOptions {\n strip?: number;\n time?: number;\n}\n\nexport default function extract(src: string, dest: string, options: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n const extractOptions = { strip: 1, time: 1000, ...options };\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, path.dirname(dest)));\n queue.defer(fastExtract.bind(null, src, dest, extractOptions));\n queue.await(callback);\n}\n"],"names":["fastExtract","mkdirp","path","Queue","extract","src","dest","options","callback","extractOptions","strip","time","queue","defer","bind","dirname","await"],"mappings":"AAAA,OAAOA,iBAAiB,eAAe;AACvC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAS7B,eAAe,SAASC,QAAQC,GAAW,EAAEC,IAAY,EAAEC,OAAyC,EAAEC,QAA0B;IAC9H,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IAEA,MAAME,iBAAiB;QAAEC,OAAO;QAAGC,MAAM;QAAM,GAAGJ,OAAO;IAAC;IAE1D,MAAMK,QAAQ,IAAIT,MAAM;IACxBS,MAAMC,KAAK,CAACZ,OAAOa,IAAI,CAAC,MAAMZ,KAAKa,OAAO,CAACT;IAC3CM,MAAMC,KAAK,CAACb,YAAYc,IAAI,CAAC,MAAMT,KAAKC,MAAMG;IAC9CG,MAAMI,KAAK,CAACR;AACd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/lib/getTarget.ts"],"sourcesContent":["import cpuArch from 'cpu-arch';\nimport { FILE_PLATFORM_MAP, FILE_PLATFORMS } from '../constants.ts';\n\nimport type { InstallOptions, Target } from '../types.ts';\n\nconst archCPU = cpuArch();\n\nexport default function getTarget(options: InstallOptions): Target {\n let platform = options.platform;\n let arch = options.arch;\n if (options.filename) {\n const filePlatform = options.filename.split('-')[0];\n if (FILE_PLATFORMS.indexOf(filePlatform) >= 0) platform = FILE_PLATFORM_MAP[filePlatform] || filePlatform;\n arch = options.filename.split('-')[1] as NodeJS.Architecture;\n }\n if (!platform) platform = process.platform;\n if (!arch) arch = archCPU as NodeJS.Architecture;\n return { platform, arch };\n}\n"],"names":["cpuArch","FILE_PLATFORM_MAP","FILE_PLATFORMS","archCPU","getTarget","options","platform","arch","filename","filePlatform","split","indexOf","process"],"mappings":"AAAA,OAAOA,aAAa,WAAW;AAC/B,SAASC,iBAAiB,EAAEC,cAAc,QAAQ,kBAAkB;AAIpE,MAAMC,UAAUH;AAEhB,eAAe,SAASI,UAAUC,OAAuB;IACvD,IAAIC,WAAWD,QAAQC,QAAQ;IAC/B,IAAIC,OAAOF,QAAQE,IAAI;IACvB,IAAIF,QAAQG,QAAQ,EAAE;QACpB,MAAMC,eAAeJ,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;QACnD,IAAIR,eAAeS,OAAO,CAACF,iBAAiB,GAAGH,WAAWL,iBAAiB,CAACQ,aAAa,IAAIA;QAC7FF,OAAOF,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;IACvC;IACA,IAAI,CAACJ,UAAUA,WAAWM,QAAQN,QAAQ;IAC1C,IAAI,CAACC,MAAMA,OAAOJ;IAClB,OAAO;QAAEG;QAAUC;IAAK;AAC1B"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/getTarget.ts"],"sourcesContent":["import cpuArch from 'cpu-arch';\nimport { FILE_PLATFORM_MAP, FILE_PLATFORMS } from '../constants.ts';\n\nimport type { InstallOptions, Target } from '../types.ts';\n\nconst archCPU = cpuArch();\n\nexport default function getTarget(options: InstallOptions): Target {\n let platform = options.platform;\n let arch = options.arch;\n if (options.filename) {\n const filePlatform = options.filename.split('-')[0];\n if (FILE_PLATFORMS.indexOf(filePlatform) >= 0) platform = FILE_PLATFORM_MAP[filePlatform] || filePlatform;\n arch = options.filename.split('-')[1] as NodeJS.Architecture;\n }\n if (!platform) platform = process.platform;\n if (!arch) arch = archCPU as NodeJS.Architecture;\n return { platform, arch };\n}\n"],"names":["cpuArch","FILE_PLATFORM_MAP","FILE_PLATFORMS","archCPU","getTarget","options","platform","arch","filename","filePlatform","split","indexOf","process"],"mappings":"AAAA,OAAOA,aAAa,WAAW;AAC/B,SAASC,iBAAiB,EAAEC,cAAc,QAAQ,kBAAkB;AAIpE,MAAMC,UAAUH;AAEhB,eAAe,SAASI,UAAUC,OAAuB;IACvD,IAAIC,WAAWD,QAAQC,QAAQ;IAC/B,IAAIC,OAAOF,QAAQE,IAAI;IACvB,IAAIF,QAAQG,QAAQ,EAAE;QACpB,MAAMC,eAAeJ,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;QACnD,IAAIR,eAAeS,OAAO,CAACF,iBAAiB,GAAGH,WAAWL,iBAAiB,CAACQ,aAAa,IAAIA;QAC7FF,OAAOF,QAAQG,QAAQ,CAACE,KAAK,CAAC,IAAI,CAAC,EAAE;IACvC;IACA,IAAI,CAACJ,UAAUA,WAAWM,QAAQN,QAAQ;IAC1C,IAAI,CAACC,MAAMA,OAAOJ;IAClB,OAAO;QAAEG;QAAUC;IAAK;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/types.ts"],"sourcesContent":["import type { VersionOptions } from 'node-resolve-versions';\n\nexport interface File {\n filename: string;\n starting: string;\n}\n\nexport interface FilePath {\n src: string;\n dest: string;\n optional?: boolean;\n}\n\nexport type StorageLocations = {\n cachePath: string;\n buildPath: string;\n installPath: string;\n};\n\nexport type InstallResult = {\n version: string;\n installPath: string;\n execPath: string;\n platform: NodeJS.Platform;\n};\n\nexport interface InstallOptions extends VersionOptions {\n type?: string;\n compression?: boolean;\n installPath?: string;\n buildPath?: string;\n name?: string;\n storagePath?: string;\n filename?: string;\n platform?: NodeJS.Platform;\n arch?: NodeJS.Architecture;\n cachePath?: string;\n}\n\nexport interface Target {\n platform: NodeJS.Platform;\n arch: NodeJS.Architecture;\n}\n\nexport type ChecksumResult = {\n actual: string;\n expected: string;\n match: boolean;\n};\n\nexport type InstallCallback = (err?: Error, result?: InstallResult) => void;\nexport type NoParamCallback = (err?: Error) => void;\nexport type ChecksumCallback = (err?: Error, checksum?: ChecksumResult) => void;\n"],"names":[],"mappings":"AAoDA,WAAgF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/types.ts"],"sourcesContent":["import type { VersionOptions } from 'node-resolve-versions';\n\nexport interface File {\n filename: string;\n starting: string;\n}\n\nexport interface FilePath {\n src: string;\n dest: string;\n optional?: boolean;\n}\n\nexport type StorageLocations = {\n cachePath: string;\n buildPath: string;\n installPath: string;\n};\n\nexport type InstallResult = {\n version: string;\n installPath: string;\n execPath: string;\n platform: NodeJS.Platform;\n};\n\nexport interface InstallOptions extends VersionOptions {\n type?: string;\n compression?: boolean;\n installPath?: string;\n buildPath?: string;\n name?: string;\n storagePath?: string;\n filename?: string;\n platform?: NodeJS.Platform;\n arch?: NodeJS.Architecture;\n cachePath?: string;\n}\n\nexport interface Target {\n platform: NodeJS.Platform;\n arch: NodeJS.Architecture;\n}\n\nexport type ChecksumResult = {\n actual: string;\n expected: string;\n match: boolean;\n};\n\nexport type InstallCallback = (err?: Error, result?: InstallResult) => void;\nexport type NoParamCallback = (err?: Error) => void;\nexport type ChecksumCallback = (err?: Error, checksum?: ChecksumResult) => void;\n"],"names":[],"mappings":"AAoDA,WAAgF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/_later/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => void;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback) {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): void => {\n if (err) return callback(err);\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: with atomic installs, folder exists = complete installation\n fs.stat(result.installPath, (err) => {\n if (!err) return callback(null, result);\n\n // Folder doesn't exist - do atomic install with temp folder\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): void => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n}\n"],"names":["fs","safeRm","isVersion","mkdirp","getDist","resolveVersions","path","Queue","tempSuffix","DEFAULT_STORAGE_PATHS","createResult","createStoragePaths","installNode","installNPM","checkMissing","ensureDestinationParent","getTarget","getVersions","versionExpression","options","callback","install","storagePaths","storagePath","err","versions","length","Error","map","x","version","result","stat","installPath","tempPath","queue","defer","bind","cachePath","cb","npmMissing","indexOf","dist","bundledNpmMajor","npm","split","platform","libPath","join","npmPath","rename","code","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,eAAe,aAAa;AACnC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,OAAO,QAAQ,8BAA8B;AACtD,OAAOC,qBAAqB,wBAAwB;AACpD,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,cAAc;AAErC,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAOC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AAOiC,UAAU,IAAMK;wBACvB;oBACF;oBACAA,GAAGf;gBACL;YACF;YAEAW,MAAMiB,KAAK,CAAC,CAAC5B;gBACX,IAAIA,KAAK;oBACP,gCAAgC;oBAChCvB,OAAOiC,UAAU,IAAMd,SAASI;oBAChC;gBACF;gBACAJ,SAAS,MAAMW;YACjB;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => void;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback) {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): void {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): void => {\n if (err) return callback(err);\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: with atomic installs, folder exists = complete installation\n fs.stat(result.installPath, (err) => {\n if (!err) return callback(null, result);\n\n // Folder doesn't exist - do atomic install with temp folder\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): void => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n}\n"],"names":["fs","safeRm","isVersion","mkdirp","getDist","resolveVersions","path","Queue","tempSuffix","DEFAULT_STORAGE_PATHS","createResult","createStoragePaths","installNode","installNPM","checkMissing","ensureDestinationParent","getTarget","getVersions","versionExpression","options","callback","install","storagePaths","storagePath","err","versions","length","Error","map","x","version","result","stat","installPath","tempPath","queue","defer","bind","cachePath","cb","npmMissing","indexOf","dist","bundledNpmMajor","npm","split","platform","libPath","join","npmPath","rename","code","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,eAAe,aAAa;AACnC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,OAAO,QAAQ,8BAA8B;AACtD,OAAOC,qBAAqB,wBAAwB;AACpD,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,cAAc;AAErC,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAOC,kBAAkB,qBAAqB;AAC9C,OAAOC,wBAAwB,2BAA2B;AAC1D,OAAOC,iBAAiB,0BAA0B;AAElD,OAAOC,gBAAgB,yBAAyB;AAChD,OAAOC,kBAAkB,yBAAyB;AAClD,OAAOC,6BAA6B,oCAAoC;AACxE,OAAOC,eAAe,sBAAsB;AAK5C,SAASC,YAAYC,iBAAyB,EAAEC,OAAuB,EAAEC,QAA6B;IACpG,gBAAgB;IAChBlB,UAAUgB,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAIb,gBAAgBa,mBAAmBC,SAASC;AACnH;AAEA,eAAe,SAASC,QAAQH,iBAAyB,EAAEC,OAAuB,EAAEC,QAAyB;IAC3G,MAAME,eAAeH,QAAQI,WAAW,GAAGZ,mBAAmBQ,QAAQI,WAAW,IAAId;IACrFU,UAAU;QAAE,GAAGG,YAAY;QAAE,GAAGH,OAAO;QAAE,GAAGH,UAAUG,QAAQ;IAAC;IAC/DF,YAAYC,mBAAmBC,SAAS,CAACK,KAAaC;QACpD,IAAID,KAAK,OAAOJ,SAASI;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE;YACpBN,SAAS,IAAIO,MAAM,CAAC,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,WAAW5B,KAAK0C,IAAI,CAACd,UAAU;wBACtE,MAAMe,UAAU3C,KAAK0C,IAAI,CAACD,SAAS,gBAAgB;wBACnD9C,OAAOgD,SAAS,IAAMpC,WAAWiB,SAASI,UAAUf,SAASoB;wBAC7D;oBACF;oBACA1B,WAAWiB,SAASI,UAAUf,SAASoB;gBACzC;YACF;YAEA,uDAAuD;YACvDJ,MAAMC,KAAK,CAAC,CAACG;gBACXvC,GAAGkD,MAAM,CAAChB,UAAUH,OAAOE,WAAW,EAAE,CAACT;oBACvC,IAAI,CAACA,KAAK,OAAOe;oBACjB,gEAAgE;oBAChE,IAAIf,IAAI2B,IAAI,KAAK,YAAY3B,IAAI2B,IAAI,KAAK,eAAe3B,IAAI2B,IAAI,KAAK,SAAS;wBAC7E,2DAA2D;wBAC3DlD,OAAOiC,UAAU,IAAMK;wBACvB;oBACF;oBACAA,GAAGf;gBACL;YACF;YAEAW,MAAMiB,KAAK,CAAC,CAAC5B;gBACX,IAAIA,KAAK;oBACP,gCAAgC;oBAChCvB,OAAOiC,UAAU,IAAMd,SAASI;oBAChC;gBACF;gBACAJ,SAAS,MAAMW;YACjB;QACF;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-install-release",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Cross-platform solution for installing releases of Node.js",
5
5
  "keywords": [
6
6
  "node",