app-builder-lib 26.9.1 → 26.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/out/binDownload.d.ts +2 -18
  2. package/out/binDownload.js +33 -185
  3. package/out/binDownload.js.map +1 -1
  4. package/out/codeSign/windowsSignToolManager.js +1 -1
  5. package/out/codeSign/windowsSignToolManager.js.map +1 -1
  6. package/out/configuration.d.ts +5 -3
  7. package/out/configuration.js.map +1 -1
  8. package/out/electron/ElectronFramework.d.ts +2 -19
  9. package/out/electron/ElectronFramework.js +41 -37
  10. package/out/electron/ElectronFramework.js.map +1 -1
  11. package/out/electron/injectFFMPEG.d.ts +10 -1
  12. package/out/electron/injectFFMPEG.js +48 -34
  13. package/out/electron/injectFFMPEG.js.map +1 -1
  14. package/out/index.d.ts +2 -1
  15. package/out/index.js +1 -1
  16. package/out/index.js.map +1 -1
  17. package/out/macPackager.js +12 -3
  18. package/out/macPackager.js.map +1 -1
  19. package/out/node-module-collector/nodeModulesCollector.js +2 -1
  20. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  21. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +13 -2
  22. package/out/node-module-collector/pnpmNodeModulesCollector.js +45 -7
  23. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  24. package/out/packager.js +10 -9
  25. package/out/packager.js.map +1 -1
  26. package/out/platformPackager.js +2 -5
  27. package/out/platformPackager.js.map +1 -1
  28. package/out/targets/MsiTarget.js +1 -1
  29. package/out/targets/MsiTarget.js.map +1 -1
  30. package/out/targets/appimage/appImageUtil.d.ts +20 -0
  31. package/out/targets/appimage/appImageUtil.js +24 -19
  32. package/out/targets/appimage/appImageUtil.js.map +1 -1
  33. package/out/targets/appimage/appLauncher.d.ts +1 -1
  34. package/out/targets/appimage/appLauncher.js +7 -3
  35. package/out/targets/appimage/appLauncher.js.map +1 -1
  36. package/out/targets/nsis/nsisUtil.js +2 -2
  37. package/out/targets/nsis/nsisUtil.js.map +1 -1
  38. package/out/toolsets/linux.js +8 -8
  39. package/out/toolsets/linux.js.map +1 -1
  40. package/out/toolsets/windows.d.ts +16 -16
  41. package/out/toolsets/windows.js +29 -21
  42. package/out/toolsets/windows.js.map +1 -1
  43. package/out/util/NodeModuleCopyHelper.js +1 -1
  44. package/out/util/NodeModuleCopyHelper.js.map +1 -1
  45. package/out/util/electronGet.d.ts +56 -0
  46. package/out/util/electronGet.js +330 -0
  47. package/out/util/electronGet.js.map +1 -0
  48. package/out/util/resolve.d.ts +1 -1
  49. package/out/util/resolve.js +6 -1
  50. package/out/util/resolve.js.map +1 -1
  51. package/out/version.d.ts +1 -1
  52. package/out/version.js +1 -1
  53. package/out/version.js.map +1 -1
  54. package/package.json +10 -8
  55. package/scheme.json +61 -2
@@ -1 +1 @@
1
- {"version":3,"file":"NodeModuleCopyHelper.js","sourceRoot":"","sources":["../../src/util/NodeModuleCopyHelper.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAC7D,2BAAiC;AACjC,uCAAoD;AACpD,6BAA4B;AAC5B,qDAAuC;AACvC,gDAA2D;AAE3D,mDAAgD;AAEhD,uCAA2C;AAE3C,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B;IACE,WAAW;IACX,cAAc,CAAC,0BAA0B;IACzC,cAAc;IACd,WAAW;IACX,cAAc;IACd,cAAc;IACd,WAAW;IACX,aAAa;IACb,YAAY;IACZ,eAAe;CAChB,CAAC,MAAM,CAAC,2BAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CACnC,CAAA;AAED,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,eAAe;IACf,gBAAgB;IAChB,WAAW;IACX,iBAAiB;IACjB,QAAQ;IACR,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,WAAW;IACX,cAAc;IACd,SAAS;IACT,UAAU;IACV,MAAM;CACP,CAAC,CAAA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,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;oBAC5C,CAAC;oBACD,OAAO,GAAG,KAAK,CAAA;gBACjB,CAAC;YACH,CAAC;YAED,IAAI,OAAO,EAAE,CAAC;gBACZ,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACxB,CAAC;YAED,IAAI,CAAC,IAAI,EAAE,CAAA;YACX,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;gBACzB,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAA;YACxC,CAAC;QACH,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC;YACzC,MAAM,YAAY,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAA;YACvC,IAAI,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAChC,+CAA+C;gBAC/C,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAA;IAC9D,CAAC;CACF;AAlID,oDAkIC","sourcesContent":["import { FilterStats, MAX_FILE_REQUESTS } from \"builder-util\"\nimport { realpathSync } from \"fs\"\nimport { lstat, lstatSync, readdir } from \"fs-extra\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { excludedNames, FileMatcher } from \"../fileMatcher\"\nimport { Packager } from \"../packager\"\nimport { FileCopyHelper } from \"./AppFileWalker\"\nimport { NodeModuleInfo } from \"./packageDependencies\"\nimport { resolveFunction } from \"./resolve\"\n\nconst excludedFiles = new Set(\n [\n \".DS_Store\",\n \"node_modules\" /* already in the queue */,\n \"CHANGELOG.md\",\n \"ChangeLog\",\n \"changelog.md\",\n \"Changelog.md\",\n \"Changelog\",\n \"binding.gyp\",\n \".npmignore\",\n \"node_gyp_bins\",\n ].concat(excludedNames.split(\",\"))\n)\n\nconst topLevelExcludedFiles = new Set([\n \"karma.conf.js\",\n \".coveralls.yml\",\n \"README.md\",\n \"readme.markdown\",\n \"README\",\n \"readme.md\",\n \"Readme.md\",\n \"Readme\",\n \"readme\",\n \"test\",\n \"tests\",\n \"__tests__\",\n \"powered-test\",\n \"example\",\n \"examples\",\n \".bin\",\n])\n\n/** @internal */\nexport class NodeModuleCopyHelper extends FileCopyHelper {\n constructor(matcher: FileMatcher, packager: Packager) {\n super(matcher, matcher.isEmpty() ? null : matcher.createFilter(), packager)\n }\n\n async collectNodeModules(moduleInfo: NodeModuleInfo, nodeModuleExcludedExts: Array<string>, destination: string): Promise<Array<string>> {\n const filter = this.filter\n const metadata = this.metadata\n\n const onNodeModuleFile = await resolveFunction(this.packager.appInfo.type, this.packager.config.onNodeModuleFile, \"onNodeModuleFile\")\n\n const result: Array<string | undefined> = []\n const queue: Array<string> = []\n const emptyDirs: Set<string> = new Set()\n const symlinkFiles: Map<string, number> = new Map()\n const tmpPath = moduleInfo.dir\n const moduleName = moduleInfo.name\n queue.length = 1\n // The path should be corrected in Windows that when the moduleName is Scoped packages named.\n const depPath = path.normalize(tmpPath)\n queue[0] = depPath\n\n while (queue.length > 0) {\n const dirPath = queue.pop()!\n\n const childNames = await readdir(dirPath)\n childNames.sort()\n\n const isTopLevel = dirPath === depPath\n const dirs: Array<string> = []\n // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map\n const sortedFilePaths = await asyncPool(MAX_FILE_REQUESTS, childNames, async name => {\n const filePath = path.join(dirPath, name)\n\n const forceIncluded = onNodeModuleFile != null && !!onNodeModuleFile(filePath)\n\n if (excludedFiles.has(name) || name.startsWith(\"._\")) {\n return null\n }\n\n // check if filematcher matches the files array as more important than the default excluded files.\n const fileMatched = filter != null && filter(dirPath, lstatSync(dirPath))\n if (!fileMatched || !forceIncluded || !!this.packager.config.disableDefaultIgnoredFiles) {\n for (const ext of nodeModuleExcludedExts) {\n if (name.endsWith(ext)) {\n return null\n }\n }\n\n // noinspection SpellCheckingInspection\n if (isTopLevel && (topLevelExcludedFiles.has(name) || (moduleName === \"libui-node\" && (name === \"build\" || name === \"docs\" || name === \"src\")))) {\n return null\n }\n\n if (dirPath.endsWith(\"build\")) {\n if (name === \"gyp-mac-tool\" || name === \"Makefile\" || name.endsWith(\".mk\") || name.endsWith(\".gypi\") || name.endsWith(\".Makefile\")) {\n return null\n }\n } else if (dirPath.endsWith(\"Release\") && (name === \".deps\" || name === \"obj.target\")) {\n return null\n } else if (name === \"src\" && (dirPath.endsWith(\"keytar\") || dirPath.endsWith(\"keytar-prebuild\"))) {\n return null\n } else if (dirPath.endsWith(\"lzma-native\") && (name === \"build\" || name === \"deps\")) {\n return null\n }\n }\n\n return lstat(filePath).then((stat: FilterStats) => {\n stat.moduleName = moduleName\n stat.moduleRootPath = destination\n stat.moduleFullFilePath = path.join(destination, path.relative(depPath, filePath))\n if (filter != null && !filter(filePath, stat)) {\n return null\n }\n\n if (!stat.isDirectory()) {\n metadata.set(filePath, stat)\n }\n const consumerResult = this.handleFile(filePath, dirPath, stat)\n if (consumerResult == null) {\n if (stat.isDirectory()) {\n dirs.push(name)\n return null\n } else {\n return filePath\n }\n } else {\n return consumerResult.then(it => {\n // asarUtil can return modified stat (symlink handling)\n if ((it == null ? stat : it).isDirectory()) {\n dirs.push(name)\n return null\n } else {\n return filePath\n }\n })\n }\n })\n })\n\n let isEmpty = true\n for (const child of sortedFilePaths) {\n if (child != null) {\n result.push(child)\n if (this.metadata.get(child)?.isSymbolicLink()) {\n symlinkFiles.set(child, result.length - 1)\n }\n isEmpty = false\n }\n }\n\n if (isEmpty) {\n emptyDirs.add(dirPath)\n }\n\n dirs.sort()\n for (const child of dirs) {\n queue.push(dirPath + path.sep + child)\n }\n }\n\n for (const [file, index] of symlinkFiles) {\n const resolvedPath = realpathSync(file)\n if (emptyDirs.has(resolvedPath)) {\n // delete symlink file if target is a empty dir\n result[index] = undefined\n }\n }\n return result.filter((it): it is string => it !== undefined)\n }\n}\n"]}
1
+ {"version":3,"file":"NodeModuleCopyHelper.js","sourceRoot":"","sources":["../../src/util/NodeModuleCopyHelper.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAC7D,2BAAiC;AACjC,uCAAoD;AACpD,6BAA4B;AAC5B,qDAAuC;AACvC,gDAA2D;AAE3D,mDAAgD;AAEhD,uCAA2C;AAE3C,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B;IACE,WAAW;IACX,cAAc,CAAC,0BAA0B;IACzC,cAAc;IACd,WAAW;IACX,cAAc;IACd,cAAc;IACd,WAAW;IACX,aAAa;IACb,YAAY;IACZ,eAAe;CAChB,CAAC,MAAM,CAAC,2BAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CACnC,CAAA;AAED,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,eAAe;IACf,gBAAgB;IAChB,WAAW;IACX,iBAAiB;IACjB,QAAQ;IACR,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,WAAW;IACX,cAAc;IACd,SAAS;IACT,UAAU;IACV,MAAM;CACP,CAAC,CAAA;AAEF,gBAAgB;AAChB,MAAa,oBAAqB,SAAQ,8BAAc;IACtD,YAAY,OAAoB,EAAE,QAAkB;QAClD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,QAAQ,CAAC,CAAA;IAC7E,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,UAA0B,EAAE,sBAAqC,EAAE,WAAmB;;QAC7G,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAE9B,MAAM,gBAAgB,GAAG,MAAM,IA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AED,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC;YACzC,MAAM,YAAY,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAA;YACvC,IAAI,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAChC,+CAA+C;gBAC/C,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAA;IAC9D,CAAC;CACF;AAlID,oDAkIC","sourcesContent":["import { FilterStats, MAX_FILE_REQUESTS } from \"builder-util\"\nimport { realpathSync } from \"fs\"\nimport { lstat, lstatSync, readdir } from \"fs-extra\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { excludedNames, FileMatcher } from \"../fileMatcher\"\nimport { Packager } from \"../packager\"\nimport { FileCopyHelper } from \"./AppFileWalker\"\nimport { NodeModuleInfo } from \"./packageDependencies\"\nimport { resolveFunction } from \"./resolve\"\n\nconst excludedFiles = new Set(\n [\n \".DS_Store\",\n \"node_modules\" /* already in the queue */,\n \"CHANGELOG.md\",\n \"ChangeLog\",\n \"changelog.md\",\n \"Changelog.md\",\n \"Changelog\",\n \"binding.gyp\",\n \".npmignore\",\n \"node_gyp_bins\",\n ].concat(excludedNames.split(\",\"))\n)\n\nconst topLevelExcludedFiles = new Set([\n \"karma.conf.js\",\n \".coveralls.yml\",\n \"README.md\",\n \"readme.markdown\",\n \"README\",\n \"readme.md\",\n \"Readme.md\",\n \"Readme\",\n \"readme\",\n \"test\",\n \"tests\",\n \"__tests__\",\n \"powered-test\",\n \"example\",\n \"examples\",\n \".bin\",\n])\n\n/** @internal */\nexport class NodeModuleCopyHelper extends FileCopyHelper {\n constructor(matcher: FileMatcher, packager: Packager) {\n super(matcher, matcher.isEmpty() ? null : matcher.createFilter(), packager)\n }\n\n async collectNodeModules(moduleInfo: NodeModuleInfo, nodeModuleExcludedExts: Array<string>, destination: string): Promise<Array<string>> {\n const filter = this.filter\n const metadata = this.metadata\n\n const onNodeModuleFile = await resolveFunction(this.packager.appInfo.type, this.packager.config.onNodeModuleFile, \"onNodeModuleFile\", await this.packager.getWorkspaceRoot())\n\n const result: Array<string | undefined> = []\n const queue: Array<string> = []\n const emptyDirs: Set<string> = new Set()\n const symlinkFiles: Map<string, number> = new Map()\n const tmpPath = moduleInfo.dir\n const moduleName = moduleInfo.name\n queue.length = 1\n // The path should be corrected in Windows that when the moduleName is Scoped packages named.\n const depPath = path.normalize(tmpPath)\n queue[0] = depPath\n\n while (queue.length > 0) {\n const dirPath = queue.pop()!\n\n const childNames = await readdir(dirPath)\n childNames.sort()\n\n const isTopLevel = dirPath === depPath\n const dirs: Array<string> = []\n // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map\n const sortedFilePaths = await asyncPool(MAX_FILE_REQUESTS, childNames, async name => {\n const filePath = path.join(dirPath, name)\n\n const forceIncluded = onNodeModuleFile != null && !!onNodeModuleFile(filePath)\n\n if (excludedFiles.has(name) || name.startsWith(\"._\")) {\n return null\n }\n\n // check if filematcher matches the files array as more important than the default excluded files.\n const fileMatched = filter != null && filter(dirPath, lstatSync(dirPath))\n if (!fileMatched || !forceIncluded || !!this.packager.config.disableDefaultIgnoredFiles) {\n for (const ext of nodeModuleExcludedExts) {\n if (name.endsWith(ext)) {\n return null\n }\n }\n\n // noinspection SpellCheckingInspection\n if (isTopLevel && (topLevelExcludedFiles.has(name) || (moduleName === \"libui-node\" && (name === \"build\" || name === \"docs\" || name === \"src\")))) {\n return null\n }\n\n if (dirPath.endsWith(\"build\")) {\n if (name === \"gyp-mac-tool\" || name === \"Makefile\" || name.endsWith(\".mk\") || name.endsWith(\".gypi\") || name.endsWith(\".Makefile\")) {\n return null\n }\n } else if (dirPath.endsWith(\"Release\") && (name === \".deps\" || name === \"obj.target\")) {\n return null\n } else if (name === \"src\" && (dirPath.endsWith(\"keytar\") || dirPath.endsWith(\"keytar-prebuild\"))) {\n return null\n } else if (dirPath.endsWith(\"lzma-native\") && (name === \"build\" || name === \"deps\")) {\n return null\n }\n }\n\n return lstat(filePath).then((stat: FilterStats) => {\n stat.moduleName = moduleName\n stat.moduleRootPath = destination\n stat.moduleFullFilePath = path.join(destination, path.relative(depPath, filePath))\n if (filter != null && !filter(filePath, stat)) {\n return null\n }\n\n if (!stat.isDirectory()) {\n metadata.set(filePath, stat)\n }\n const consumerResult = this.handleFile(filePath, dirPath, stat)\n if (consumerResult == null) {\n if (stat.isDirectory()) {\n dirs.push(name)\n return null\n } else {\n return filePath\n }\n } else {\n return consumerResult.then(it => {\n // asarUtil can return modified stat (symlink handling)\n if ((it == null ? stat : it).isDirectory()) {\n dirs.push(name)\n return null\n } else {\n return filePath\n }\n })\n }\n })\n })\n\n let isEmpty = true\n for (const child of sortedFilePaths) {\n if (child != null) {\n result.push(child)\n if (this.metadata.get(child)?.isSymbolicLink()) {\n symlinkFiles.set(child, result.length - 1)\n }\n isEmpty = false\n }\n }\n\n if (isEmpty) {\n emptyDirs.add(dirPath)\n }\n\n dirs.sort()\n for (const child of dirs) {\n queue.push(dirPath + path.sep + child)\n }\n }\n\n for (const [file, index] of symlinkFiles) {\n const resolvedPath = realpathSync(file)\n if (emptyDirs.has(resolvedPath)) {\n // delete symlink file if target is a empty dir\n result[index] = undefined\n }\n }\n return result.filter((it): it is string => it !== undefined)\n }\n}\n"]}
@@ -0,0 +1,56 @@
1
+ import { ElectronPlatformArtifactDetails, MirrorOptions } from "@electron/get";
2
+ import { ElectronPlatformName } from "../electron/ElectronFramework";
3
+ export type ElectronGetOptions = Omit<ElectronPlatformArtifactDetails, "platform" | "arch" | "version" | "artifactName" | "artifactSuffix" | "customFilename" | "tempDirectory" | "downloader" | "cacheMode" | "cacheRoot" | "downloadOptions" | "isGeneric" | "mirrorOptions"> & {
4
+ mirrorOptions?: Omit<MirrorOptions, "customDir" | "customFilename" | "customVersion">;
5
+ };
6
+ export type ArtifactDownloadOptions = {
7
+ electronDownload?: ElectronGetOptions | ElectronDownloadOptions | null;
8
+ artifactName: string;
9
+ platformName: string;
10
+ arch: string;
11
+ version: string;
12
+ cacheDir?: string;
13
+ };
14
+ export interface ElectronDownloadOptions {
15
+ version?: string;
16
+ /**
17
+ * The [cache location](https://github.com/electron-userland/electron-download#cache-location).
18
+ */
19
+ cache?: string | null;
20
+ /**
21
+ * The mirror.
22
+ */
23
+ mirror?: string | null;
24
+ /** @private */
25
+ customDir?: string | null;
26
+ /** @private */
27
+ customFilename?: string | null;
28
+ strictSSL?: boolean;
29
+ isVerifyChecksum?: boolean;
30
+ platform?: ElectronPlatformName;
31
+ arch?: string;
32
+ }
33
+ export declare function getCacheDirectory(isAvoidSystemOnWindows?: boolean): string;
34
+ export declare function extractArchive(file: string, dir: string): Promise<void>;
35
+ /**
36
+ * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.
37
+ * Used for electron-builder-binaries tools (appimage, etc.).
38
+ */
39
+ export declare function downloadBuilderToolset(options: {
40
+ releaseName: string;
41
+ filenameWithExt: string;
42
+ checksums?: Record<string, string>;
43
+ githubOrgRepo?: string;
44
+ overrideUrl?: string;
45
+ }): Promise<string>;
46
+ /**
47
+ * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.
48
+ * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).
49
+ */
50
+ export declare function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string>;
51
+ export declare function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string>;
52
+ /**
53
+ * Get the binaries mirror URL from environment variables.
54
+ * Supports various npm config formats and falls back to GitHub.
55
+ */
56
+ export declare function getBinariesMirrorUrl(githubOrgRepo: string): string;
@@ -0,0 +1,330 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCacheDirectory = getCacheDirectory;
4
+ exports.extractArchive = extractArchive;
5
+ exports.downloadBuilderToolset = downloadBuilderToolset;
6
+ exports.downloadElectronArtifactZip = downloadElectronArtifactZip;
7
+ exports.downloadElectronArtifact = downloadElectronArtifact;
8
+ exports.getBinariesMirrorUrl = getBinariesMirrorUrl;
9
+ const get = require("@electron/get");
10
+ const get_1 = require("@electron/get");
11
+ const builder_util_1 = require("builder-util");
12
+ const multiProgress_1 = require("electron-publish/out/multiProgress");
13
+ const fs_1 = require("fs");
14
+ const fs = require("fs/promises");
15
+ const os = require("os");
16
+ const path = require("path");
17
+ const lockfile = require("proper-lockfile");
18
+ const promises_1 = require("stream/promises");
19
+ const tar = require("tar");
20
+ const unzipper = require("unzipper");
21
+ function hashUrlSafe(input, length = 6) {
22
+ let hash = 5381;
23
+ for (let i = 0; i < input.length; i++) {
24
+ hash = ((hash << 5) + hash) ^ input.charCodeAt(i);
25
+ }
26
+ hash >>>= 0;
27
+ const out = hash.toString(36);
28
+ return out.length >= length ? out.slice(0, length) : out.padStart(length, "0");
29
+ }
30
+ function getCacheDirectory(isAvoidSystemOnWindows = false) {
31
+ var _a, _b, _c, _d, _e;
32
+ const env = (_a = process.env.ELECTRON_BUILDER_CACHE) === null || _a === void 0 ? void 0 : _a.trim();
33
+ if (env && path.parse(env).root) {
34
+ return env;
35
+ }
36
+ const appName = "electron-builder";
37
+ const platform = os.platform();
38
+ const homeDir = os.homedir();
39
+ if (platform === "darwin") {
40
+ return path.join(homeDir, "Library", "Caches", appName);
41
+ }
42
+ if (platform === "win32") {
43
+ const localAppData = (_b = process.env.LOCALAPPDATA) === null || _b === void 0 ? void 0 : _b.trim();
44
+ const username = (_d = (_c = process.env.USERNAME) === null || _c === void 0 ? void 0 : _c.trim()) === null || _d === void 0 ? void 0 : _d.toLowerCase();
45
+ const isSystemUser = isAvoidSystemOnWindows && (((_e = localAppData === null || localAppData === void 0 ? void 0 : localAppData.toLowerCase()) === null || _e === void 0 ? void 0 : _e.includes("\\windows\\system32\\")) || username === "system");
46
+ if (!localAppData || isSystemUser) {
47
+ return path.join(os.tmpdir(), `${appName}-cache`);
48
+ }
49
+ return path.join(localAppData, appName, "Cache");
50
+ }
51
+ const xdgCache = process.env.XDG_CACHE_HOME;
52
+ return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, ".cache", appName);
53
+ }
54
+ function resolveCacheMode() {
55
+ var _a;
56
+ const varName = "ELECTRON_DOWNLOAD_CACHE_MODE";
57
+ const cacheOverride = (_a = process.env[varName]) === null || _a === void 0 ? void 0 : _a.trim();
58
+ if (cacheOverride && Number(cacheOverride) in get_1.ElectronDownloadCacheMode) {
59
+ const mode = Number(cacheOverride);
60
+ builder_util_1.log.debug({ mode }, `cache mode overridden via env var ${varName}`);
61
+ return mode;
62
+ }
63
+ return get_1.ElectronDownloadCacheMode.ReadWrite;
64
+ }
65
+ async function extractZipStreaming(file, dir) {
66
+ var _a;
67
+ // Pass 1: read central directory once to collect Unix modes (one seek to EOF)
68
+ const zipDir = await unzipper.Open.file(file);
69
+ const entryModes = new Map();
70
+ for (const entry of zipDir.files) {
71
+ const mode = (entry.externalFileAttributes >> 16) & 0xffff;
72
+ if (mode > 0) {
73
+ entryModes.set(entry.path, mode);
74
+ }
75
+ }
76
+ const isSymlink = (mode) => (mode & 0o170000) === 0o120000;
77
+ // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang
78
+ const entries = (0, fs_1.createReadStream)(file).pipe(unzipper.Parse({ forceStream: true }));
79
+ for await (const entry of entries) {
80
+ const destPath = path.resolve(dir, entry.path);
81
+ if (!destPath.startsWith(dir + path.sep) && destPath !== dir) {
82
+ throw new Error(`Path traversal blocked: ${entry.path}`);
83
+ }
84
+ const mode = (_a = entryModes.get(entry.path)) !== null && _a !== void 0 ? _a : 0;
85
+ if (mode > 0 && isSymlink(mode)) {
86
+ const target = (await entry.buffer()).toString();
87
+ if (path.isAbsolute(target)) {
88
+ throw new Error(`Absolute symlink target blocked: ${target}`);
89
+ }
90
+ const resolvedTarget = path.resolve(path.dirname(destPath), target);
91
+ if (!resolvedTarget.startsWith(dir + path.sep) && resolvedTarget !== dir) {
92
+ throw new Error(`Symlink target escapes extraction dir: ${target}`);
93
+ }
94
+ await fs.mkdir(path.dirname(destPath), { recursive: true });
95
+ await fs.symlink(target, destPath);
96
+ }
97
+ else if (entry.type === "Directory") {
98
+ await fs.mkdir(destPath, { recursive: true });
99
+ entry.autodrain();
100
+ }
101
+ else {
102
+ await fs.mkdir(path.dirname(destPath), { recursive: true });
103
+ await (0, promises_1.pipeline)(entry, (0, fs_1.createWriteStream)(destPath));
104
+ if (mode > 0) {
105
+ await fs.chmod(destPath, mode & 0o7777);
106
+ }
107
+ }
108
+ }
109
+ }
110
+ async function extractArchive(file, dir) {
111
+ const tmpDir = `${dir}.tmp`;
112
+ await fs.mkdir(tmpDir, { recursive: true });
113
+ const release = await lockfile.lock(tmpDir, {
114
+ retries: { retries: 5, minTimeout: 1000, maxTimeout: 5000 },
115
+ stale: 60000,
116
+ });
117
+ try {
118
+ // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction
119
+ await fs.rm(tmpDir, { recursive: true, force: true });
120
+ await fs.mkdir(tmpDir, { recursive: true });
121
+ if (file.endsWith(".tar.gz") || file.endsWith(".tgz")) {
122
+ await tar.extract({ file, cwd: tmpDir, strip: 1 });
123
+ }
124
+ else if (file.endsWith(".zip")) {
125
+ await extractZipStreaming(file, tmpDir);
126
+ }
127
+ else if (file.endsWith(".7z")) {
128
+ await (0, builder_util_1.exec)(await (0, builder_util_1.getPath7za)(), ["x", "-bd", file, `-o${tmpDir}`, "-y"]);
129
+ }
130
+ else {
131
+ throw new Error(`Unsupported archive format: ${path.basename(file)}`);
132
+ }
133
+ await fs.rm(dir, { recursive: true, force: true });
134
+ await fs.rename(tmpDir, dir);
135
+ }
136
+ finally {
137
+ await release().catch(err => builder_util_1.log.warn({ err }, "failed to release lockfile"));
138
+ }
139
+ }
140
+ async function downloadArtifactToFile(config, label) {
141
+ const progress = process.stdout.isTTY ? new multiProgress_1.MultiProgress() : null;
142
+ const progressBar = progress === null || progress === void 0 ? void 0 : progress.createBar(`${" ".repeat(builder_util_1.PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 });
143
+ progressBar === null || progressBar === void 0 ? void 0 : progressBar.render();
144
+ let lastLoggedMilestone = -1;
145
+ const downloadOptions = {
146
+ timeout: { request: 10 * 60 * 1000 }, // prevent indefinite hang on stalled connections
147
+ ...config.downloadOptions,
148
+ getProgressCallback: info => {
149
+ const pct = info.percent != null ? Math.floor(info.percent * 100) : 0;
150
+ if (progressBar) {
151
+ progressBar.update(pct);
152
+ }
153
+ else {
154
+ // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates
155
+ const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25;
156
+ if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {
157
+ lastLoggedMilestone = percentCompleted;
158
+ builder_util_1.log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? "downloading" : "downloaded");
159
+ }
160
+ }
161
+ return Promise.resolve();
162
+ },
163
+ };
164
+ builder_util_1.log.info({ label }, "downloading");
165
+ const configWithProgress = { ...config, downloadOptions };
166
+ try {
167
+ let filePath;
168
+ try {
169
+ filePath = await get.downloadArtifact(configWithProgress);
170
+ }
171
+ catch (err) {
172
+ if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("dest already exists")) {
173
+ filePath = await get.downloadArtifact(configWithProgress);
174
+ }
175
+ else {
176
+ throw err;
177
+ }
178
+ }
179
+ if (!(await (0, builder_util_1.exists)(filePath))) {
180
+ builder_util_1.log.warn({ filePath, label }, "cached artifact missing from disk; retrying with cache write");
181
+ filePath = await get.downloadArtifact({ ...configWithProgress, cacheMode: get_1.ElectronDownloadCacheMode.WriteOnly });
182
+ }
183
+ return filePath;
184
+ }
185
+ finally {
186
+ progressBar === null || progressBar === void 0 ? void 0 : progressBar.update(100);
187
+ progressBar === null || progressBar === void 0 ? void 0 : progressBar.terminate();
188
+ }
189
+ }
190
+ /**
191
+ * Core download + extract engine. Handles lockfile, cache-hit short-circuit,
192
+ * progress bar, extraction (.zip or .tar.gz), and completion marker.
193
+ * Both public download functions delegate here after building their respective configs.
194
+ */
195
+ async function downloadAndExtract(config, extractDir, label) {
196
+ const completeMarker = `${extractDir}.complete`;
197
+ const isCached = async () => (0, builder_util_1.exists)(completeMarker);
198
+ await fs.mkdir(extractDir, { recursive: true });
199
+ if (await isCached()) {
200
+ builder_util_1.log.debug({ file: label, path: extractDir }, "using cached artifact - skipping download/extract");
201
+ return extractDir;
202
+ }
203
+ const release = await lockfile.lock(extractDir, {
204
+ retries: { retries: 5, minTimeout: 1000, maxTimeout: 5000 },
205
+ stale: 60000,
206
+ });
207
+ let downloadedFile = null;
208
+ try {
209
+ // Re-check after acquiring lock: another worker may have completed while we waited.
210
+ if (await isCached()) {
211
+ builder_util_1.log.debug({ file: label, path: extractDir }, "using cached artifact - skipping download/extract");
212
+ return extractDir;
213
+ }
214
+ downloadedFile = await downloadArtifactToFile(config, label);
215
+ }
216
+ finally {
217
+ await release().catch(err => builder_util_1.log.warn({ err }, "failed to release lockfile"));
218
+ }
219
+ await extractArchive(downloadedFile, extractDir);
220
+ await fs.writeFile(completeMarker, "");
221
+ return extractDir;
222
+ }
223
+ // ─── Public API ───────────────────────────────────────────────────────────────
224
+ /**
225
+ * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.
226
+ * Used for electron-builder-binaries tools (appimage, etc.).
227
+ */
228
+ async function downloadBuilderToolset(options) {
229
+ const { releaseName, filenameWithExt, checksums, githubOrgRepo = "electron-userland/electron-builder-binaries", overrideUrl } = options;
230
+ const baseUrl = getBinariesMirrorUrl(githubOrgRepo);
231
+ const hashInput = overrideUrl ? `${overrideUrl}/${filenameWithExt}` : `${baseUrl}${releaseName}/${filenameWithExt}`;
232
+ const suffix = hashUrlSafe(hashInput, 5);
233
+ const folderName = `${filenameWithExt.replace(/\.(tar\.gz|tgz|zip|7z)$/, "")}-${suffix}`;
234
+ const extractDir = path.join(getCacheDirectory(), releaseName, folderName);
235
+ const mirrorOptions = overrideUrl
236
+ ? { resolveAssetURL: async () => Promise.resolve(`${overrideUrl}/${filenameWithExt}`) }
237
+ : {
238
+ // `${mirror}${customDir}/${customFilename}`
239
+ mirror: baseUrl,
240
+ customDir: releaseName,
241
+ customFilename: filenameWithExt,
242
+ };
243
+ const config = {
244
+ version: "9.9.9", // must be >1.3.2 to bypass @electron/get validation shortcut
245
+ artifactName: filenameWithExt,
246
+ cacheRoot: path.resolve(getCacheDirectory(), "downloads"),
247
+ cacheMode: resolveCacheMode(),
248
+ ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),
249
+ mirrorOptions,
250
+ isGeneric: true,
251
+ };
252
+ return downloadAndExtract(config, extractDir, filenameWithExt);
253
+ }
254
+ // Keys present in ElectronGetOptions but absent from ElectronDownloadOptions.
255
+ // Used to discriminate between the two config shapes at runtime.
256
+ const ELECTRON_GET_EXCLUSIVE_KEYS = ["mirrorOptions", "force", "unsafelyDisableChecksums"];
257
+ function isElectronGetOptions(dl) {
258
+ return ELECTRON_GET_EXCLUSIVE_KEYS.some(k => Object.hasOwnProperty.call(dl, k));
259
+ }
260
+ /**
261
+ * Downloads and extracts an electron platform artifact (e.g. ffmpeg) using @electron/get.
262
+ * Deduplicates concurrent calls for the same artifact within the same process.
263
+ */
264
+ function buildElectronArtifactConfig(options) {
265
+ const { electronDownload, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = options;
266
+ let artifactConfig = { cacheRoot, platform, arch, version, artifactName };
267
+ if (electronDownload != null) {
268
+ if (isElectronGetOptions(electronDownload)) {
269
+ const { mirrorOptions, ...rest } = electronDownload;
270
+ artifactConfig = { ...artifactConfig, ...rest, cacheRoot, mirrorOptions };
271
+ }
272
+ else {
273
+ const { mirror, customDir, cache, customFilename, isVerifyChecksum, strictSSL, platform: overridePlatform, arch: overrideArch } = electronDownload;
274
+ artifactConfig = {
275
+ ...artifactConfig,
276
+ unsafelyDisableChecksums: isVerifyChecksum === false,
277
+ cacheRoot: cache !== null && cache !== void 0 ? cache : cacheRoot,
278
+ mirrorOptions: {
279
+ mirror: mirror || undefined,
280
+ customDir: customDir || undefined,
281
+ customFilename: customFilename || undefined,
282
+ },
283
+ ...(strictSSL === false ? { downloadOptions: { https: { rejectUnauthorized: false } } } : {}),
284
+ };
285
+ if (overridePlatform != null) {
286
+ artifactConfig.platform = overridePlatform;
287
+ }
288
+ if (overrideArch != null) {
289
+ artifactConfig.arch = overrideArch;
290
+ }
291
+ }
292
+ }
293
+ artifactConfig.cacheMode = resolveCacheMode();
294
+ return artifactConfig;
295
+ }
296
+ /**
297
+ * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.
298
+ * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).
299
+ */
300
+ function downloadElectronArtifactZip(options) {
301
+ const config = buildElectronArtifactConfig(options);
302
+ return downloadArtifactToFile(config, config.artifactName);
303
+ }
304
+ async function downloadElectronArtifact(options) {
305
+ const { arch, version, platformName: platform, artifactName } = options;
306
+ const artifactConfig = buildElectronArtifactConfig(options);
307
+ const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5);
308
+ const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`;
309
+ const extractDir = path.join(getCacheDirectory(), `${artifactName}-v${version}`, folderName);
310
+ return downloadAndExtract(artifactConfig, extractDir, artifactName);
311
+ }
312
+ /**
313
+ * Get the binaries mirror URL from environment variables.
314
+ * Supports various npm config formats and falls back to GitHub.
315
+ */
316
+ function getBinariesMirrorUrl(githubOrgRepo) {
317
+ for (const envVar of [
318
+ "NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR",
319
+ "npm_config_electron_builder_binaries_mirror",
320
+ "npm_package_config_electron_builder_binaries_mirror",
321
+ "ELECTRON_BUILDER_BINARIES_MIRROR",
322
+ ]) {
323
+ const url = (0, builder_util_1.parseValidEnvVarUrl)(envVar);
324
+ if (url) {
325
+ return url.endsWith("/") ? url : `${url}/`;
326
+ }
327
+ }
328
+ return `https://github.com/${githubOrgRepo}/releases/download/`;
329
+ }
330
+ //# sourceMappingURL=electronGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":";;AAsFA,8CAyBC;AAyDD,wCA4BC;AA8FD,wDAkCC;AAqDD,kEAGC;AAED,4DASC;AAMD,oDAaC;AA1ZD,qCAAoC;AACpC,uCAOsB;AACtB,+CAA0F;AAC1F,sEAAkE;AAClE,2BAAwD;AACxD,kCAAiC;AACjC,yBAAwB;AACxB,6BAA4B;AAC5B,4CAA2C;AAC3C,8CAA0C;AAC1C,2BAA0B;AAC1B,qCAAoC;AA0DpC,SAAS,WAAW,CAAC,KAAa,EAAE,MAAM,GAAG,CAAC;IAC5C,IAAI,IAAI,GAAG,IAAI,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACnD,CAAC;IACD,IAAI,MAAM,CAAC,CAAA;IACX,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC7B,OAAO,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAChF,CAAC;AAED,SAAgB,iBAAiB,CAAC,sBAAsB,GAAG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ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n GotDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, getPath7za, log, PADDING, parseValidEnvVarUrl } from \"builder-util\"\nimport { MultiProgress } from \"electron-publish/out/multiProgress\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { ElectronPlatformName } from \"../electron/ElectronFramework\"\n\nexport type ElectronGetOptions = Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\" // to be added below\n> & {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n electronDownload?: ElectronGetOptions | ElectronDownloadOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport interface ElectronDownloadOptions {\n // https://github.com/electron-userland/electron-builder/issues/3077\n // must be optional\n version?: string\n\n /**\n * The [cache location](https://github.com/electron-userland/electron-download#cache-location).\n */\n cache?: string | null\n\n /**\n * The mirror.\n */\n mirror?: string | null\n\n /** @private */\n customDir?: string | null\n /** @private */\n customFilename?: string | null\n\n strictSSL?: boolean\n isVerifyChecksum?: boolean\n\n platform?: ElectronPlatformName\n arch?: string\n}\n\nfunction hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\nexport function getCacheDirectory(isAvoidSystemOnWindows = false): string {\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (env && path.parse(env).root) {\n return env\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang\n const entries = createReadStream(file).pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!destPath.startsWith(dir + path.sep) && destPath !== dir) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!resolvedTarget.startsWith(dir + path.sep) && resolvedTarget !== dir) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n}\n\nexport async function extractArchive(file: string, dir: string) {\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n retries: { retries: 5, minTimeout: 1000, maxTimeout: 5000 },\n stale: 60000,\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n await exec(await getPath7za(), [\"x\", \"-bd\", file, `-o${tmpDir}`, \"-y\"])\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n await fs.rm(dir, { recursive: true, force: true })\n await fs.rename(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nasync function downloadArtifactToFile(config: Parameters<typeof get.downloadArtifact>[0], label: string): Promise<string> {\n const progress = process.stdout.isTTY ? new MultiProgress() : null\n const progressBar = progress?.createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n progressBar?.render()\n\n let lastLoggedMilestone = -1\n const downloadOptions: GotDownloaderOptions = {\n timeout: { request: 10 * 60 * 1000 }, // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n getProgressCallback: info => {\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (progressBar) {\n progressBar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n log.info({ label }, \"downloading\")\n const configWithProgress = { ...config, downloadOptions }\n try {\n let filePath: string\n try {\n filePath = await get.downloadArtifact(configWithProgress)\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(configWithProgress)\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...configWithProgress, cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n return filePath\n } finally {\n progressBar?.update(100)\n progressBar?.terminate()\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(config: Parameters<typeof get.downloadArtifact>[0], extractDir: string, label: string): Promise<string> {\n const completeMarker = `${extractDir}.complete`\n const isCached = async () => exists(completeMarker)\n\n await fs.mkdir(extractDir, { recursive: true })\n\n if (await isCached()) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n\n const release = await lockfile.lock(extractDir, {\n retries: { retries: 5, minTimeout: 1000, maxTimeout: 5000 },\n stale: 60000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n if (await isCached()) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n\n downloadedFile = await downloadArtifactToFile(config, label)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n await extractArchive(downloadedFile, extractDir)\n await fs.writeFile(completeMarker, \"\")\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const hashInput = overrideUrl ? `${overrideUrl}/${filenameWithExt}` : `${baseUrl}${releaseName}/${filenameWithExt}`\n const suffix = hashUrlSafe(hashInput, 5)\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|zip|7z)$/, \"\")}-${suffix}`\n const extractDir = path.join(getCacheDirectory(), releaseName, folderName)\n\n const mirrorOptions: MirrorOptions = overrideUrl\n ? { resolveAssetURL: async () => Promise.resolve(`${overrideUrl}/${filenameWithExt}`) }\n : {\n // `${mirror}${customDir}/${customFilename}`\n mirror: baseUrl,\n customDir: releaseName,\n customFilename: filenameWithExt,\n }\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(getCacheDirectory(), \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt)\n}\n\n// Keys present in ElectronGetOptions but absent from ElectronDownloadOptions.\n// Used to discriminate between the two config shapes at runtime.\nconst ELECTRON_GET_EXCLUSIVE_KEYS: readonly string[] = [\"mirrorOptions\", \"force\", \"unsafelyDisableChecksums\"]\n\nfunction isElectronGetOptions(dl: ElectronGetOptions | ElectronDownloadOptions): dl is ElectronGetOptions {\n return ELECTRON_GET_EXCLUSIVE_KEYS.some(k => Object.hasOwnProperty.call(dl, k))\n}\n\n/**\n * Downloads and extracts an electron platform artifact (e.g. ffmpeg) using @electron/get.\n * Deduplicates concurrent calls for the same artifact within the same process.\n */\nfunction buildElectronArtifactConfig(options: ArtifactDownloadOptions): ElectronPlatformArtifactDetails {\n const { electronDownload, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = options\n\n let artifactConfig: ElectronPlatformArtifactDetails = { cacheRoot, platform, arch, version, artifactName }\n\n if (electronDownload != null) {\n if (isElectronGetOptions(electronDownload)) {\n const { mirrorOptions, ...rest } = electronDownload\n artifactConfig = { ...artifactConfig, ...rest, cacheRoot, mirrorOptions }\n } else {\n const { mirror, customDir, cache, customFilename, isVerifyChecksum, strictSSL, platform: overridePlatform, arch: overrideArch } = electronDownload\n artifactConfig = {\n ...artifactConfig,\n unsafelyDisableChecksums: isVerifyChecksum === false,\n cacheRoot: cache ?? cacheRoot,\n mirrorOptions: {\n mirror: mirror || undefined,\n customDir: customDir || undefined,\n customFilename: customFilename || undefined,\n },\n ...(strictSSL === false ? { downloadOptions: { https: { rejectUnauthorized: false } } } : {}),\n }\n if (overridePlatform != null) {\n artifactConfig.platform = overridePlatform\n }\n if (overrideArch != null) {\n artifactConfig.arch = overrideArch\n }\n }\n }\n\n artifactConfig.cacheMode = resolveCacheMode()\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(getCacheDirectory(), `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  export declare function resolveModule<T>(type: string | undefined, name: string): Promise<T>;
2
- export declare function resolveFunction<T>(type: string | undefined, executor: T | string, name: string): Promise<T>;
2
+ export declare function resolveFunction<T>(type: string | undefined, executor: T | string, name: string, rootSearchDir: string): Promise<T>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveModule = resolveModule;
4
4
  exports.resolveFunction = resolveFunction;
5
+ const builder_util_1 = require("builder-util");
5
6
  const log_1 = require("builder-util/out/log");
6
7
  const debug_1 = require("debug");
7
8
  const path = require("path");
@@ -16,7 +17,7 @@ async function resolveModule(type, name) {
16
17
  throw error;
17
18
  }
18
19
  }
19
- async function resolveFunction(type, executor, name) {
20
+ async function resolveFunction(type, executor, name, rootSearchDir) {
20
21
  if (executor == null || typeof executor !== "string") {
21
22
  // is already function or explicitly ignored by user
22
23
  return executor;
@@ -24,6 +25,10 @@ async function resolveFunction(type, executor, name) {
24
25
  let p = executor;
25
26
  if (p.startsWith(".")) {
26
27
  p = path.resolve(p);
28
+ const relative = path.relative(rootSearchDir, p);
29
+ if (relative.startsWith("..") || path.isAbsolute(relative)) {
30
+ throw new builder_util_1.InvalidConfigurationError(`Hook module path "${executor}" resolves outside the workspace root ("${rootSearchDir}")`);
31
+ }
27
32
  }
28
33
  try {
29
34
  p = require.resolve(p);
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/util/resolve.ts"],"names":[],"mappings":";;AAKA,sCAOC;AAED,0CAyBC;AAvCD,8CAA0C;AAC1C,iCAAyB;AACzB,6BAA4B;AAC5B,6DAA4D;AAErD,KAAK,UAAU,aAAa,CAAI,IAAwB,EAAE,IAAY;;IAC3E,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,SAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,KAAK,EAAE,EAAE,6CAA6C,CAAC,CAAA;QACrH,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,eAAe,CAAI,IAAwB,EAAE,QAAoB,EAAE,IAAY;IACnG,IAAI,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACrD,oDAAoD;QACpD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,GAAG,QAAkB,CAAA;IAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;IAED,IAAI,CAAC;QACH,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAA,eAAK,EAAC,CAAC,CAAC,CAAA;QACR,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;IAED,MAAM,CAAC,GAAQ,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC3C,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAA;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAA;IACpB,CAAC;AACH,CAAC","sourcesContent":["import { log } from \"builder-util/out/log\"\nimport debug from \"debug\"\nimport * as path from \"path\"\nimport * as requireMaybe from \"../../helpers/dynamic-import\"\n\nexport async function resolveModule<T>(type: string | undefined, name: string): Promise<T> {\n try {\n return requireMaybe.dynamicImportMaybe(name)\n } catch (error: any) {\n log.error({ moduleName: name, message: error.message ?? error.stack }, \"Unable to dynamically `import` or `require`\")\n throw error\n }\n}\n\nexport async function resolveFunction<T>(type: string | undefined, executor: T | string, name: string): Promise<T> {\n if (executor == null || typeof executor !== \"string\") {\n // is already function or explicitly ignored by user\n return executor\n }\n\n let p = executor as string\n if (p.startsWith(\".\")) {\n p = path.resolve(p)\n }\n\n try {\n p = require.resolve(p)\n } catch (e: any) {\n debug(e)\n p = path.resolve(p)\n }\n\n const m: any = await resolveModule(type, p)\n const namedExport = m[name]\n if (namedExport == null) {\n return m.default || m\n } else {\n return namedExport\n }\n}\n"]}
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/util/resolve.ts"],"names":[],"mappings":";;AAMA,sCAOC;AAED,0CA6BC;AA5CD,+CAAwD;AACxD,8CAA0C;AAC1C,iCAAyB;AACzB,6BAA4B;AAC5B,6DAA4D;AAErD,KAAK,UAAU,aAAa,CAAI,IAAwB,EAAE,IAAY;;IAC3E,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,SAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,KAAK,EAAE,EAAE,6CAA6C,CAAC,CAAA;QACrH,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,eAAe,CAAI,IAAwB,EAAE,QAAoB,EAAE,IAAY,EAAE,aAAqB;IAC1H,IAAI,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACrD,oDAAoD;QACpD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,GAAG,QAAkB,CAAA;IAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;QAChD,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,wCAAyB,CAAC,qBAAqB,QAAQ,2CAA2C,aAAa,IAAI,CAAC,CAAA;QAChI,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAA,eAAK,EAAC,CAAC,CAAC,CAAA;QACR,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;IAED,MAAM,CAAC,GAAQ,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC3C,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAA;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAA;IACpB,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\nimport { log } from \"builder-util/out/log\"\nimport debug from \"debug\"\nimport * as path from \"path\"\nimport * as requireMaybe from \"../../helpers/dynamic-import\"\n\nexport async function resolveModule<T>(type: string | undefined, name: string): Promise<T> {\n try {\n return requireMaybe.dynamicImportMaybe(name)\n } catch (error: any) {\n log.error({ moduleName: name, message: error.message ?? error.stack }, \"Unable to dynamically `import` or `require`\")\n throw error\n }\n}\n\nexport async function resolveFunction<T>(type: string | undefined, executor: T | string, name: string, rootSearchDir: string): Promise<T> {\n if (executor == null || typeof executor !== \"string\") {\n // is already function or explicitly ignored by user\n return executor\n }\n\n let p = executor as string\n if (p.startsWith(\".\")) {\n p = path.resolve(p)\n const relative = path.relative(rootSearchDir, p)\n if (relative.startsWith(\"..\") || path.isAbsolute(relative)) {\n throw new InvalidConfigurationError(`Hook module path \"${executor}\" resolves outside the workspace root (\"${rootSearchDir}\")`)\n }\n }\n\n try {\n p = require.resolve(p)\n } catch (e: any) {\n debug(e)\n p = path.resolve(p)\n }\n\n const m: any = await resolveModule(type, p)\n const namedExport = m[name]\n if (namedExport == null) {\n return m.default || m\n } else {\n return namedExport\n }\n}\n"]}
package/out/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "26.9.1";
1
+ export declare const PACKAGE_VERSION = "26.10.0";
package/out/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PACKAGE_VERSION = void 0;
4
- exports.PACKAGE_VERSION = "26.9.1";
4
+ exports.PACKAGE_VERSION = "26.10.0";
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.9.1\"\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,SAAS,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.10.0\"\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "app-builder-lib",
3
3
  "description": "electron-builder lib",
4
- "version": "26.9.1",
4
+ "version": "26.10.0",
5
5
  "main": "out/index.js",
6
6
  "files": [
7
7
  "out",
@@ -53,7 +53,7 @@
53
53
  "@electron/get": "^3.0.0",
54
54
  "@electron/notarize": "2.5.0",
55
55
  "@electron/osx-sign": "1.3.3",
56
- "@electron/rebuild": "^4.0.3",
56
+ "@electron/rebuild": "4.0.3",
57
57
  "@electron/universal": "2.0.3",
58
58
  "@malept/flatpak-bundler": "^0.4.0",
59
59
  "@types/fs-extra": "9.0.13",
@@ -79,10 +79,11 @@
79
79
  "tar": "^7.5.7",
80
80
  "temp-file": "^3.4.0",
81
81
  "tiny-async-pool": "1.3.0",
82
+ "unzipper": "^0.12.3",
82
83
  "which": "^5.0.0",
83
- "builder-util": "26.9.0",
84
+ "builder-util": "26.10.0",
84
85
  "builder-util-runtime": "9.6.0",
85
- "electron-publish": "26.9.0"
86
+ "electron-publish": "26.10.0"
86
87
  },
87
88
  "///": "babel in devDependencies for proton tests",
88
89
  "devDependencies": {
@@ -113,14 +114,15 @@
113
114
  "@types/proper-lockfile": "^4.1.4",
114
115
  "@types/semver": "7.7.1",
115
116
  "@types/tiny-async-pool": "^1",
117
+ "@types/unzipper": "^0.10.11",
116
118
  "@types/which": "^3.0.4",
117
119
  "toml": "^3.0.0",
118
- "dmg-builder": "26.9.1",
119
- "electron-builder-squirrel-windows": "26.9.1"
120
+ "dmg-builder": "26.10.0",
121
+ "electron-builder-squirrel-windows": "26.10.0"
120
122
  },
121
123
  "peerDependencies": {
122
- "dmg-builder": "26.9.1",
123
- "electron-builder-squirrel-windows": "26.9.1"
124
+ "dmg-builder": "26.10.0",
125
+ "electron-builder-squirrel-windows": "26.10.0"
124
126
  },
125
127
  "//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
126
128
  "typings": "./out/index.d.ts"