app-builder-lib 26.16.1 → 26.18.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 (57) hide show
  1. package/out/asar/asarUtil.js +7 -2
  2. package/out/asar/asarUtil.js.map +1 -1
  3. package/out/forge-maker.d.ts +64 -0
  4. package/out/forge-maker.js +108 -2
  5. package/out/forge-maker.js.map +1 -1
  6. package/out/index.d.ts +1 -1
  7. package/out/index.js +3 -1
  8. package/out/index.js.map +1 -1
  9. package/out/node-module-collector/index.js +48 -15
  10. package/out/node-module-collector/index.js.map +1 -1
  11. package/out/node-module-collector/moduleManager.d.ts +7 -1
  12. package/out/node-module-collector/moduleManager.js +2 -2
  13. package/out/node-module-collector/moduleManager.js.map +1 -1
  14. package/out/node-module-collector/nodeModulesCollector.d.ts +7 -3
  15. package/out/node-module-collector/nodeModulesCollector.js +14 -5
  16. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  17. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +79 -0
  18. package/out/node-module-collector/pnpmNodeModulesCollector.js +248 -24
  19. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  20. package/out/targets/FlatpakTarget.js +6 -1
  21. package/out/targets/FlatpakTarget.js.map +1 -1
  22. package/out/targets/archive.d.ts +12 -0
  23. package/out/targets/archive.js +45 -1
  24. package/out/targets/archive.js.map +1 -1
  25. package/out/targets/blockmap/blockmap.d.ts +43 -3
  26. package/out/targets/blockmap/blockmap.js +143 -16
  27. package/out/targets/blockmap/blockmap.js.map +1 -1
  28. package/out/targets/blockmap/verbatimRange.d.ts +43 -0
  29. package/out/targets/blockmap/verbatimRange.js +122 -0
  30. package/out/targets/blockmap/verbatimRange.js.map +1 -0
  31. package/out/targets/differentialUpdateInfoBuilder.d.ts +27 -2
  32. package/out/targets/differentialUpdateInfoBuilder.js +77 -5
  33. package/out/targets/differentialUpdateInfoBuilder.js.map +1 -1
  34. package/out/targets/nsis/NsisTarget.d.ts +35 -2
  35. package/out/targets/nsis/NsisTarget.js +121 -25
  36. package/out/targets/nsis/NsisTarget.js.map +1 -1
  37. package/out/targets/nsis/nsisOptions.d.ts +21 -3
  38. package/out/targets/nsis/nsisOptions.js.map +1 -1
  39. package/out/targets/nsis/nsisUtil.d.ts +7 -0
  40. package/out/targets/nsis/nsisUtil.js +14 -3
  41. package/out/targets/nsis/nsisUtil.js.map +1 -1
  42. package/out/targets/pkg.d.ts +16 -0
  43. package/out/targets/pkg.js +27 -0
  44. package/out/targets/pkg.js.map +1 -1
  45. package/out/targets/snap/core24.d.ts +2 -0
  46. package/out/targets/snap/core24.js +30 -7
  47. package/out/targets/snap/core24.js.map +1 -1
  48. package/out/targets/snap/coreLegacy.js +1 -2
  49. package/out/targets/snap/coreLegacy.js.map +1 -1
  50. package/out/util/appFileCopier.d.ts +5 -0
  51. package/out/util/appFileCopier.js +20 -2
  52. package/out/util/appFileCopier.js.map +1 -1
  53. package/out/version.d.ts +1 -1
  54. package/out/version.js +1 -1
  55. package/out/version.js.map +1 -1
  56. package/package.json +9 -7
  57. package/scheme.json +19 -7
@@ -1 +1 @@
1
- {"version":3,"file":"coreLegacy.js","sourceRoot":"","sources":["../../../src/targets/snap/coreLegacy.ts"],"names":[],"mappings":";;;AA6cA,sDAUC;AAvdD,+CAA8H;AAC9H,+DAA+E;AAC/E,uCAA+C;AAC/C,0CAAoF;AACpF,qCAA8B;AAC9B,6BAA4B;AAC5B,oEAAyE;AAEzE,gDAAuD;AACvD,wDAA+D;AAC/D,wDAAwD;AACxD,6CAAuC;AACvC,qDAA6C;AAKpC,2FALA,2BAAU,OAKA;AAHnB,yDAA2D;AAK3D,8EAA8E;AAC9E,MAAM,cAAc,GAAG;IACrB,KAAK,EAAE;QACL,WAAW,EAAE,qBAAqB;QAClC,eAAe,EAAE,2CAA2C;QAC5D,SAAS,EAAE,EAAE,2CAA2C,EAAE,kEAAkE,EAAE;KAC/H;IACD,KAAK,EAAE;QACL,WAAW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,CAAA;IACzD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAC1C,IAAI,OAAO,GAAG,mHAAmH,SAAS,GAAG,cAAc,GAAG,CAAA;IAC9J,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,2BAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzD,CAAC;IACD,OAAO,IAAI,OAAO,CAAA;IAClB,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { replaceDefault as _replaceDefault, Arch, copyDir, exec, log, serializeToYaml, toLinuxArchString } from \"builder-util\"\nimport { asArray, deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport { outputFile, readFile } from \"fs-extra\"\nimport { chmod, copyFile, mkdir, readdir, rename, rm, writeFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { validateShellEmbeddable } from \"../../frameworks/LibUiFramework\"\nimport { PlugDescriptor, SnapOptions } from \"../../options/SnapOptions\"\nimport { getAppImageTools } from \"../../toolsets/linux\"\nimport { downloadBuilderToolset } from \"../../util/electronGet\"\nimport { getTemplatePath } from \"../../util/pathManager\"\nimport { SnapCore } from \"./SnapTarget\"\nimport { shellQuote } from \"./snapCommand.js\"\nimport { SnapcraftYAML } from \"./snapcraft\"\nimport { DEFAULT_STAGE_PACKAGES } from \"./snapcraftBuilder\"\n\n// Re-exported for backwards compatibility with existing imports/tests.\nexport { shellQuote }\n\n// Snap template release info from electron-userland/electron-builder-binaries\nconst SNAP_TEMPLATES = {\n amd64: {\n releaseName: \"snap-template-4.0-2\",\n filenameWithExt: \"snap-template-electron-4.0-2-amd64.tar.7z\",\n checksums: { \"snap-template-electron-4.0-2-amd64.tar.7z\": \"5e3ab4e09364ac06f0072b1c2dab9138318c933f6b2c7374f893b5ec44d19e6f\" },\n },\n armhf: {\n releaseName: \"snap-template-4.0-1\",\n filenameWithExt: \"snap-template-electron-4.0-1-armhf.tar.7z\",\n checksums: { \"snap-template-electron-4.0-1-armhf.tar.7z\": \"6f7553e904f4e043bc3019f0899d05e01a283b00b61fec22e932296490e3be6b\" },\n },\n} as const\n\n// Handles core18/core20/core22 snaps via mksquashfs (template) or snapcraft CLI (no-template).\n// See: https://github.com/develar/app-builder/blob/master/pkg/package-format/snap\nexport class SnapCoreLegacy extends SnapCore<SnapOptions> {\n private isUseTemplateApp = false\n\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n private replaceDefault(inList: Array<string> | Nullish, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = this.normalizePlugConfiguration(this.options.plugs)\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), this.defaultPlugs)\n\n const slots = this.normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const stagePackages = this.replaceDefault(options.stagePackages, DEFAULT_STAGE_PACKAGES)\n\n const stageSet = new Set(stagePackages)\n const stageMatchesDefaults = stagePackages.length === DEFAULT_STAGE_PACKAGES.length && DEFAULT_STAGE_PACKAGES.every((p: string) => stageSet.has(p))\n\n // Template app is only available for x64/armv7l, and only when no packages are customised.\n this.isUseTemplateApp = this.options.useTemplateApp !== false && (arch === Arch.x64 || arch === Arch.armv7l) && buildPackages.length === 0 && stageMatchesDefaults\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n if (!isValidKey(slotName)) {\n throw new Error(`Invalid plug/slot name: ${slotName}`)\n }\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${this.helper.getDesktopFileName(snap.name)}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = this.archNameToTriplet(arch)\n const environment: Record<string, string> = {\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n const allow = options.allowNativeWayland\n const isOldElectron = !this.helper.isElectronVersionGreaterOrEqualThan(\"38.0.0\", \"7.0.0\")\n if ((allow == null && isOldElectron) || allow === false) {\n environment.DISABLE_WAYLAND = \"1\"\n }\n\n appDescriptor.environment = environment\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n if (!isValidKey(plugName)) {\n throw new Error(`Invalid plug/slot name: ${plugName}`)\n }\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n if (!snap.plugs) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async buildSnap(props: { snap: any; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<void> {\n const { snap, appOutDir, stageDir, snapArch, artifactPath } = props\n\n // Build the args array for effectiveOptionComputed compatibility — tests inspect this.\n const args = [\n \"snap\",\n \"--app\",\n appOutDir,\n \"--stage\",\n stageDir,\n \"--arch\",\n toLinuxArchString(snapArch, \"snap\"),\n \"--output\",\n artifactPath,\n \"--executable\",\n this.packager.executableName,\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, this.packager.executableName + \" %U\", desktopFile, {\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = this.options.executableArgs ?? []\n if (this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n // Capture compression BEFORE it gets stripped from snap for template builds.\n const compression = this.options.compression ?? \"xz\"\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && (await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await this.packager.getResource(this.options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n args.push(\"--template-url\", `electron4:${templateArch}`)\n await this.buildWithTemplate({ appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs })\n } else {\n await this.buildWithoutTemplate({ appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs })\n }\n }\n\n private async buildWithTemplate(opts: {\n appOutDir: string\n stageDir: string\n snapArch: Arch\n artifactPath: string\n compression: string\n hooksDir: string | null\n extraAppArgs: string[]\n }): Promise<void> {\n const { appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs } = opts\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n const { releaseName, filenameWithExt, checksums } = SNAP_TEMPLATES[templateArch]\n\n log.info({ releaseName }, \"downloading snap template\")\n const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: \"electron-userland/electron-builder-binaries\" })\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true })\n\n // Best-effort: remove chrome-sandbox from app dir before mksquashfs scans it.\n await rm(path.join(appOutDir, \"chrome-sandbox\"), { force: true })\n\n // chmod -R g-s to avoid setgid bits in final image\n for (const dir of [stageDir, appOutDir, templateDir]) {\n await exec(\"chmod\", [\"-R\", \"g-s\", dir]).catch(err => log.warn({ error: err.message }, \"chmod g-s failed\"))\n }\n\n const mksquashfsPath = await getMksquashfsPath(snapArch)\n\n // Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)\n const mksquashfsArgs: string[] = [\n ...(await readDirPaths(templateDir)),\n ...(await readDirPaths(stageDir)),\n ...(await readDirPaths(appOutDir, name => name !== \"LICENSES.chromium.html\" && name !== \"LICENSE.electron.txt\" && name !== \"chrome-sandbox\")),\n artifactPath,\n \"-no-progress\",\n \"-quiet\",\n \"-noappend\",\n \"-comp\",\n compression,\n \"-no-xattrs\",\n \"-no-fragments\",\n \"-all-root\",\n ]\n\n await exec(mksquashfsPath, mksquashfsArgs, { cwd: stageDir })\n }\n\n private async buildWithoutTemplate(opts: { appOutDir: string; stageDir: string; artifactPath: string; hooksDir: string | null; extraAppArgs: string[] }): Promise<void> {\n const { appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs } = opts\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: false })\n\n // Write desktop integration scripts (embedded in the Go binary, now in our templates)\n const snapTemplateDir = getTemplatePath(\"snap\")\n for (const script of [\"desktop-init.sh\", \"desktop-common.sh\", \"desktop-gnome-specific.sh\"]) {\n const src = path.join(snapTemplateDir, script)\n const dest = path.join(stageDir, \"scripts\", script)\n await copyFile(src, dest)\n // copyFile doesn't preserve mode; chmod 755 explicitly\n await chmod(dest, 0o755)\n }\n\n // Copy app dir into stage/app/ so snapcraft can pick it up\n await copyDir(appOutDir, path.join(stageDir, \"app\"))\n\n // Run snapcraft (legacy `snap` subcommand)\n const isDestructiveMode = process.env.SNAP_DESTRUCTIVE_MODE === \"true\"\n const snapOutputName = \"out.snap\"\n const snapArgs = [\"snap\", \"--output\", isDestructiveMode ? artifactPath : snapOutputName]\n if (isDestructiveMode) {\n snapArgs.push(\"--destructive-mode\")\n }\n\n await exec(\"snapcraft\", snapArgs, {\n cwd: stageDir,\n env: { ...process.env, SNAPCRAFT_HAS_TTY: \"false\" },\n })\n\n if (!isDestructiveMode) {\n await rename(path.join(stageDir, snapOutputName), artifactPath)\n }\n }\n\n private async stageSnapFiles(opts: { stageDir: string; appOutDir: string; hooksDir: string | null; extraAppArgs: string[]; isTemplate: boolean }): Promise<void> {\n const { stageDir, hooksDir, extraAppArgs, isTemplate } = opts\n\n const snapMetaDir = path.join(stageDir, isTemplate ? \"meta\" : \"snap\")\n // No-template builds place command.sh + desktop scripts in scripts/ which snapcraft stages to snap root.\n // Template builds write command.sh to the stage root directly; no scripts/ dir is needed.\n const scriptDir = path.join(stageDir, \"scripts\")\n if (!isTemplate) {\n await mkdir(scriptDir, { recursive: true })\n }\n\n if (this.helper.maxIconPath != null) {\n const iconDest = path.join(snapMetaDir, \"gui\", `icon${path.extname(this.helper.maxIconPath)}`)\n await mkdir(path.dirname(iconDest), { recursive: true })\n await copyFile(this.helper.maxIconPath, iconDest)\n }\n\n if (hooksDir != null) {\n await copyDir(hooksDir, path.join(snapMetaDir, \"hooks\"))\n }\n\n // command.sh — template builds write to stage root; no-template writes to scripts/\n const commandWrapperPath = isTemplate ? path.join(stageDir, \"command.sh\") : path.join(scriptDir, \"command.sh\")\n const commandContent = buildCommandShContent({ isTemplate, executableName: this.packager.executableName, extraAppArgs })\n await writeFile(commandWrapperPath, commandContent, { mode: 0o755 })\n await chmod(commandWrapperPath, 0o755)\n }\n\n private normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | Nullish): Record<string, Record<string, any> | null> | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n if (!isValidKey(item)) {\n throw new Error(`Invalid plug/slot name: ${item}`)\n }\n result[item] = null\n } else {\n deepAssign(result, item)\n }\n }\n return result\n }\n\n private isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n }\n\n private archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n }\n}\n\nasync function getMksquashfsPath(arch: Arch): Promise<string> {\n const envPath = process.env.MKSQUASHFS_PATH\n if (envPath) {\n return envPath\n }\n const { mksquashfs } = await getAppImageTools(\"0.0.0\", arch)\n return mksquashfs\n}\n\nasync function readDirPaths(dir: string, filter?: (name: string) => boolean): Promise<string[]> {\n const entries = await readdir(dir)\n const result: string[] = []\n for (const name of entries) {\n if (!filter || filter(name)) {\n result.push(path.join(dir, name))\n }\n }\n return result\n}\n\n/**\n * Builds the content of command.sh for a snap package.\n *\n * For both template and no-template builds, the desktop-integration scripts are\n * sourced from the snap root ($SNAP):\n * - Template: scripts are embedded in the template tarball at the snap root.\n * - No-template: the snapcraft.yaml `launch-scripts` part uses `plugin: dump,\n * source: scripts`, which stages stageDir/scripts/ contents directly into the\n * snap root — so $SNAP/desktop-init.sh is correct in both cases.\n *\n * The only difference between template and no-template is the app executable prefix:\n * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.\n */\nexport function buildCommandShContent(opts: { isTemplate: boolean; executableName: string; extraAppArgs: string[] }): string {\n const { isTemplate, executableName, extraAppArgs } = opts\n validateShellEmbeddable(executableName, \"executableName\")\n const appPrefix = isTemplate ? \"\" : \"app/\"\n let content = `#!/bin/bash -e\\nexec \"$SNAP/desktop-init.sh\" \"$SNAP/desktop-common.sh\" \"$SNAP/desktop-gnome-specific.sh\" \"$SNAP/${appPrefix}${executableName}\"`\n if (extraAppArgs.length > 0) {\n content += \" \" + extraAppArgs.map(shellQuote).join(\" \")\n }\n content += ' \"$@\"'\n return content\n}\n"]}
1
+ {"version":3,"file":"coreLegacy.js","sourceRoot":"","sources":["../../../src/targets/snap/coreLegacy.ts"],"names":[],"mappings":";;;AA2cA,sDAUC;AArdD,+CAA8H;AAC9H,+DAA+E;AAC/E,uCAA+C;AAC/C,0CAAgF;AAChF,qCAA8B;AAC9B,6BAA4B;AAC5B,oEAAyE;AAEzE,gDAAuD;AACvD,wDAA+D;AAC/D,wDAAwD;AACxD,6CAAuC;AACvC,qDAA6C;AAKpC,2FALA,2BAAU,OAKA;AAHnB,yDAA2D;AAK3D,8EAA8E;AAC9E,MAAM,cAAc,GAAG;IACrB,KAAK,EAAE;QACL,WAAW,EAAE,qBAAqB;QAClC,eAAe,EAAE,2CAA2C;QAC5D,SAAS,EAAE,EAAE,2CAA2C,EAAE,kEAAkE,EAAE;KAC/H;IACD,KAAK,EAAE;QACL,WAAW,EAAE,qBAAqB;QAClC,eAAe,EAAE,2CAA2C;QAC5D,SAAS,EAAE,EAAE,2CAA2C,EAAE,kEAAkE,EAAE;KAC/H;CACO,CAAA;AAEV,+FAA+F;AAC/F,kFAAkF;AAClF,MAAa,cAAe,SAAQ,qBAAqB;IAAzD;;QACU,qBAAgB,GAAG,KAAK,CAAA;QAEhC,iBAAY,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,EA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ault as _replaceDefault, Arch, copyDir, exec, log, serializeToYaml, toLinuxArchString } from \"builder-util\"\nimport { asArray, deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport { outputFile, readFile } from \"fs-extra\"\nimport { chmod, copyFile, mkdir, readdir, rename, writeFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { validateShellEmbeddable } from \"../../frameworks/LibUiFramework\"\nimport { PlugDescriptor, SnapOptions } from \"../../options/SnapOptions\"\nimport { getAppImageTools } from \"../../toolsets/linux\"\nimport { downloadBuilderToolset } from \"../../util/electronGet\"\nimport { getTemplatePath } from \"../../util/pathManager\"\nimport { SnapCore } from \"./SnapTarget\"\nimport { shellQuote } from \"./snapCommand.js\"\nimport { SnapcraftYAML } from \"./snapcraft\"\nimport { DEFAULT_STAGE_PACKAGES } from \"./snapcraftBuilder\"\n\n// Re-exported for backwards compatibility with existing imports/tests.\nexport { shellQuote }\n\n// Snap template release info from electron-userland/electron-builder-binaries\nconst SNAP_TEMPLATES = {\n amd64: {\n releaseName: \"snap-template-4.0-2\",\n filenameWithExt: \"snap-template-electron-4.0-2-amd64.tar.7z\",\n checksums: { \"snap-template-electron-4.0-2-amd64.tar.7z\": \"5e3ab4e09364ac06f0072b1c2dab9138318c933f6b2c7374f893b5ec44d19e6f\" },\n },\n armhf: {\n releaseName: \"snap-template-4.0-1\",\n filenameWithExt: \"snap-template-electron-4.0-1-armhf.tar.7z\",\n checksums: { \"snap-template-electron-4.0-1-armhf.tar.7z\": \"6f7553e904f4e043bc3019f0899d05e01a283b00b61fec22e932296490e3be6b\" },\n },\n} as const\n\n// Handles core18/core20/core22 snaps via mksquashfs (template) or snapcraft CLI (no-template).\n// See: https://github.com/develar/app-builder/blob/master/pkg/package-format/snap\nexport class SnapCoreLegacy extends SnapCore<SnapOptions> {\n private isUseTemplateApp = false\n\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n private replaceDefault(inList: Array<string> | Nullish, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = this.normalizePlugConfiguration(this.options.plugs)\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), this.defaultPlugs)\n\n const slots = this.normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const stagePackages = this.replaceDefault(options.stagePackages, DEFAULT_STAGE_PACKAGES)\n\n const stageSet = new Set(stagePackages)\n const stageMatchesDefaults = stagePackages.length === DEFAULT_STAGE_PACKAGES.length && DEFAULT_STAGE_PACKAGES.every((p: string) => stageSet.has(p))\n\n // Template app is only available for x64/armv7l, and only when no packages are customised.\n this.isUseTemplateApp = this.options.useTemplateApp !== false && (arch === Arch.x64 || arch === Arch.armv7l) && buildPackages.length === 0 && stageMatchesDefaults\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n if (!isValidKey(slotName)) {\n throw new Error(`Invalid plug/slot name: ${slotName}`)\n }\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${this.helper.getDesktopFileName(snap.name)}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = this.archNameToTriplet(arch)\n const environment: Record<string, string> = {\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n const allow = options.allowNativeWayland\n const isOldElectron = !this.helper.isElectronVersionGreaterOrEqualThan(\"38.0.0\", \"7.0.0\")\n if ((allow == null && isOldElectron) || allow === false) {\n environment.DISABLE_WAYLAND = \"1\"\n }\n\n appDescriptor.environment = environment\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n if (!isValidKey(plugName)) {\n throw new Error(`Invalid plug/slot name: ${plugName}`)\n }\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n if (!snap.plugs) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async buildSnap(props: { snap: any; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<void> {\n const { snap, appOutDir, stageDir, snapArch, artifactPath } = props\n\n // Build the args array for effectiveOptionComputed compatibility — tests inspect this.\n const args = [\n \"snap\",\n \"--app\",\n appOutDir,\n \"--stage\",\n stageDir,\n \"--arch\",\n toLinuxArchString(snapArch, \"snap\"),\n \"--output\",\n artifactPath,\n \"--executable\",\n this.packager.executableName,\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, this.packager.executableName + \" %U\", desktopFile, {\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = this.options.executableArgs ?? []\n if (this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n // Capture compression BEFORE it gets stripped from snap for template builds.\n const compression = this.options.compression ?? \"xz\"\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && (await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await this.packager.getResource(this.options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n args.push(\"--template-url\", `electron4:${templateArch}`)\n await this.buildWithTemplate({ appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs })\n } else {\n await this.buildWithoutTemplate({ appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs })\n }\n }\n\n private async buildWithTemplate(opts: {\n appOutDir: string\n stageDir: string\n snapArch: Arch\n artifactPath: string\n compression: string\n hooksDir: string | null\n extraAppArgs: string[]\n }): Promise<void> {\n const { appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs } = opts\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n const { releaseName, filenameWithExt, checksums } = SNAP_TEMPLATES[templateArch]\n\n log.info({ releaseName }, \"downloading snap template\")\n const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: \"electron-userland/electron-builder-binaries\" })\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true })\n\n // chmod -R g-s to avoid setgid bits in final image\n for (const dir of [stageDir, appOutDir, templateDir]) {\n await exec(\"chmod\", [\"-R\", \"g-s\", dir]).catch(err => log.warn({ error: err.message }, \"chmod g-s failed\"))\n }\n\n const mksquashfsPath = await getMksquashfsPath(snapArch)\n\n // Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)\n // chrome-sandbox is filtered out here, not deleted: appOutDir is shared with the other Linux targets (deb, rpm, AppImage), which pack from it concurrently.\n const mksquashfsArgs: string[] = [\n ...(await readDirPaths(templateDir)),\n ...(await readDirPaths(stageDir)),\n ...(await readDirPaths(appOutDir, name => name !== \"LICENSES.chromium.html\" && name !== \"LICENSE.electron.txt\" && name !== \"chrome-sandbox\")),\n artifactPath,\n \"-no-progress\",\n \"-quiet\",\n \"-noappend\",\n \"-comp\",\n compression,\n \"-no-xattrs\",\n \"-no-fragments\",\n \"-all-root\",\n ]\n\n await exec(mksquashfsPath, mksquashfsArgs, { cwd: stageDir })\n }\n\n private async buildWithoutTemplate(opts: { appOutDir: string; stageDir: string; artifactPath: string; hooksDir: string | null; extraAppArgs: string[] }): Promise<void> {\n const { appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs } = opts\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: false })\n\n // Write desktop integration scripts (embedded in the Go binary, now in our templates)\n const snapTemplateDir = getTemplatePath(\"snap\")\n for (const script of [\"desktop-init.sh\", \"desktop-common.sh\", \"desktop-gnome-specific.sh\"]) {\n const src = path.join(snapTemplateDir, script)\n const dest = path.join(stageDir, \"scripts\", script)\n await copyFile(src, dest)\n // copyFile doesn't preserve mode; chmod 755 explicitly\n await chmod(dest, 0o755)\n }\n\n // Copy app dir into stage/app/ so snapcraft can pick it up\n await copyDir(appOutDir, path.join(stageDir, \"app\"))\n\n // Run snapcraft (legacy `snap` subcommand)\n const isDestructiveMode = process.env.SNAP_DESTRUCTIVE_MODE === \"true\"\n const snapOutputName = \"out.snap\"\n const snapArgs = [\"snap\", \"--output\", isDestructiveMode ? artifactPath : snapOutputName]\n if (isDestructiveMode) {\n snapArgs.push(\"--destructive-mode\")\n }\n\n await exec(\"snapcraft\", snapArgs, {\n cwd: stageDir,\n env: { ...process.env, SNAPCRAFT_HAS_TTY: \"false\" },\n })\n\n if (!isDestructiveMode) {\n await rename(path.join(stageDir, snapOutputName), artifactPath)\n }\n }\n\n private async stageSnapFiles(opts: { stageDir: string; appOutDir: string; hooksDir: string | null; extraAppArgs: string[]; isTemplate: boolean }): Promise<void> {\n const { stageDir, hooksDir, extraAppArgs, isTemplate } = opts\n\n const snapMetaDir = path.join(stageDir, isTemplate ? \"meta\" : \"snap\")\n // No-template builds place command.sh + desktop scripts in scripts/ which snapcraft stages to snap root.\n // Template builds write command.sh to the stage root directly; no scripts/ dir is needed.\n const scriptDir = path.join(stageDir, \"scripts\")\n if (!isTemplate) {\n await mkdir(scriptDir, { recursive: true })\n }\n\n if (this.helper.maxIconPath != null) {\n const iconDest = path.join(snapMetaDir, \"gui\", `icon${path.extname(this.helper.maxIconPath)}`)\n await mkdir(path.dirname(iconDest), { recursive: true })\n await copyFile(this.helper.maxIconPath, iconDest)\n }\n\n if (hooksDir != null) {\n await copyDir(hooksDir, path.join(snapMetaDir, \"hooks\"))\n }\n\n // command.sh — template builds write to stage root; no-template writes to scripts/\n const commandWrapperPath = isTemplate ? path.join(stageDir, \"command.sh\") : path.join(scriptDir, \"command.sh\")\n const commandContent = buildCommandShContent({ isTemplate, executableName: this.packager.executableName, extraAppArgs })\n await writeFile(commandWrapperPath, commandContent, { mode: 0o755 })\n await chmod(commandWrapperPath, 0o755)\n }\n\n private normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | Nullish): Record<string, Record<string, any> | null> | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n if (!isValidKey(item)) {\n throw new Error(`Invalid plug/slot name: ${item}`)\n }\n result[item] = null\n } else {\n deepAssign(result, item)\n }\n }\n return result\n }\n\n private isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n }\n\n private archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n }\n}\n\nasync function getMksquashfsPath(arch: Arch): Promise<string> {\n const envPath = process.env.MKSQUASHFS_PATH\n if (envPath) {\n return envPath\n }\n const { mksquashfs } = await getAppImageTools(\"0.0.0\", arch)\n return mksquashfs\n}\n\nasync function readDirPaths(dir: string, filter?: (name: string) => boolean): Promise<string[]> {\n const entries = await readdir(dir)\n const result: string[] = []\n for (const name of entries) {\n if (!filter || filter(name)) {\n result.push(path.join(dir, name))\n }\n }\n return result\n}\n\n/**\n * Builds the content of command.sh for a snap package.\n *\n * For both template and no-template builds, the desktop-integration scripts are\n * sourced from the snap root ($SNAP):\n * - Template: scripts are embedded in the template tarball at the snap root.\n * - No-template: the snapcraft.yaml `launch-scripts` part uses `plugin: dump,\n * source: scripts`, which stages stageDir/scripts/ contents directly into the\n * snap root — so $SNAP/desktop-init.sh is correct in both cases.\n *\n * The only difference between template and no-template is the app executable prefix:\n * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.\n */\nexport function buildCommandShContent(opts: { isTemplate: boolean; executableName: string; extraAppArgs: string[] }): string {\n const { isTemplate, executableName, extraAppArgs } = opts\n validateShellEmbeddable(executableName, \"executableName\")\n const appPrefix = isTemplate ? \"\" : \"app/\"\n let content = `#!/bin/bash -e\\nexec \"$SNAP/desktop-init.sh\" \"$SNAP/desktop-common.sh\" \"$SNAP/desktop-gnome-specific.sh\" \"$SNAP/${appPrefix}${executableName}\"`\n if (extraAppArgs.length > 0) {\n content += \" \" + extraAppArgs.map(shellQuote).join(\" \")\n }\n content += ' \"$@\"'\n return content\n}\n"]}
@@ -45,6 +45,11 @@ export declare function collectionMatchesAppDependencies(nodeModules: NodeModule
45
45
  * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a
46
46
  * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a
47
47
  * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.
48
+ *
49
+ * An approach that throws (e.g. the package manager exited without producing its dependency tree,
50
+ * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every
51
+ * approach fails to produce a collection and at least one threw, the first error is rethrown rather
52
+ * than silently reporting "no node modules".
48
53
  */
49
54
  export declare function resolveFirstMatchingCollection(options: {
50
55
  pmApproaches: PM[];
@@ -33,7 +33,7 @@ function getDestinationPath(file, fileSet) {
33
33
  const src = fileSet.src;
34
34
  const dest = fileSet.destination;
35
35
  // get node_modules path relative to src and then append to dest
36
- if (file.startsWith(src)) {
36
+ if (file.startsWith(src + path.sep)) {
37
37
  return path.join(dest, path.relative(src, file));
38
38
  }
39
39
  return dest;
@@ -209,14 +209,29 @@ function collectionMatchesAppDependencies(nodeModules, dependencies) {
209
209
  * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a
210
210
  * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a
211
211
  * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.
212
+ *
213
+ * An approach that throws (e.g. the package manager exited without producing its dependency tree,
214
+ * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every
215
+ * approach fails to produce a collection and at least one threw, the first error is rethrown rather
216
+ * than silently reporting "no node modules".
212
217
  */
213
218
  async function resolveFirstMatchingCollection(options) {
219
+ var _a;
214
220
  const { pmApproaches, searchDirectories, dependencies, run } = options;
215
221
  let fallback;
222
+ let firstError;
216
223
  for (const pm of pmApproaches) {
217
224
  for (const dir of searchDirectories) {
218
225
  builder_util_1.log.info({ pm, searchDir: dir }, "searching for node modules");
219
- const deps = await run(pm, dir);
226
+ let deps;
227
+ try {
228
+ deps = await run(pm, dir);
229
+ }
230
+ catch (error) {
231
+ builder_util_1.log.warn({ pm, searchDir: dir, error: (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : String(error) }, "node module collection failed, trying next search directory/approach");
232
+ firstError !== null && firstError !== void 0 ? firstError : (firstError = error instanceof Error ? error : new Error(String(error)));
233
+ continue;
234
+ }
220
235
  if (deps.nodeModules.length === 0) {
221
236
  builder_util_1.log.info({ pm, searchDir: dir }, "no node modules found in collection, trying next search directory");
222
237
  continue;
@@ -229,6 +244,9 @@ async function resolveFirstMatchingCollection(options) {
229
244
  fallback !== null && fallback !== void 0 ? fallback : (fallback = deps);
230
245
  }
231
246
  }
247
+ if (fallback == null && firstError != null) {
248
+ throw firstError;
249
+ }
232
250
  return fallback;
233
251
  }
234
252
  /** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */
@@ -1 +1 @@
1
- {"version":3,"file":"appFileCopier.js","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":";;;AAsBA,gDAYC;AAED,oCAyCC;AAaD,wCAoCC;AAED,0CA4BC;AAwBD,8DA8BC;AA2BD,4EASC;AASD,wEA0BC;AAoCD,0EAkBC;AAGD,sEAgCC;AAlXD,+CAAwK;AAExK,uCAAwC;AACxC,0CAA6C;AAC7C,6BAA4B;AAC5B,qDAAuC;AACvC,2DAAmD;AACnD,kCAAkC;AAClC,gDAA0D;AAC1D,wDAAqF;AACrF,oEAA2E;AAC3E,0EAA6G;AAG7G,mDAA+C;AAC/C,iEAA6D;AAG7D,MAAM,wBAAwB,GAAG,GAAG,IAAI,CAAC,GAAG,mBAAmB,IAAI,CAAC,GAAG,EAAE,CAAA;AACzE,gBAAgB;AACH,QAAA,8BAA8B,GAAG,WAAW,CAAA;AAEzD,SAAgB,kBAAkB,CAAC,IAAY,EAAE,OAAwB;IACvE,IAAI,IAAI,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC,WAAW,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AE,CAAC;QACzC,WAAW,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAA;IAC1C,CAAC;IACD,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAC9B,WAAW,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAC5B;;kFAE8E,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,OAAO;CAClH,CACE,CAAA;IACD,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,CAAA;AACzG,CAAC","sourcesContent":["import { AsyncTaskManager, FileCopier, FileTransformer, InvalidConfigurationError, isEmptyOrSpaces, Link, log, MAX_FILE_REQUESTS, statOrNull, walk } from \"builder-util\"\nimport { Stats } from \"fs\"\nimport { ensureSymlink } from \"fs-extra\"\nimport { mkdir, readlink } from \"fs/promises\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { isLibOrExe } from \"../asar/unpackDetector\"\nimport { Platform } from \"../core\"\nimport { excludedExts, FileMatcher } from \"../fileMatcher\"\nimport { createElectronCompilerHost, NODE_MODULES_PATTERN } from \"../fileTransformer\"\nimport { getCollectorByPackageManager, PM } from \"../node-module-collector\"\nimport { LogMessageByKey, logMessageLevelByKey, ModuleManager } from \"../node-module-collector/moduleManager\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { AppFileWalker } from \"./AppFileWalker\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper\"\nimport { NodeModuleInfo } from \"./packageDependencies\"\n\nconst BOWER_COMPONENTS_PATTERN = `${path.sep}bower_components${path.sep}`\n/** @internal */\nexport const ELECTRON_COMPILE_SHIM_FILENAME = \"__shim.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n\n const src = fileSet.src\n const dest = fileSet.destination\n // get node_modules path relative to src and then append to dest\n if (file.startsWith(src)) {\n return path.join(dest, path.relative(src, file))\n }\n return dest\n}\n\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const createdParentDirs = new Set<string>()\n\n const fileCopier = new FileCopier(file => {\n return !isLibOrExe(file)\n }, transformer)\n const links: Array<Link> = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({ file: destinationFile, link: await readlink(sourceFile) })\n continue\n }\n\n const fileParent = path.dirname(destinationFile)\n if (!createdParentDirs.has(fileParent)) {\n createdParentDirs.add(fileParent)\n await mkdir(fileParent, { recursive: true })\n }\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n await asyncPool(MAX_FILE_REQUESTS, links, it => ensureSymlink(it.link, it.file))\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array<string>\n metadata: Map<string, Stats>\n transformedFiles?: Map<number, string | Buffer> | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void> {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n const filesPromise = fileSet.files.map(async (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise<any>).then(it => {\n if (it != null) {\n transformedFiles!.set(index, it)\n }\n return\n })\n }\n transformedFiles!.set(index, transformedValue as string | Buffer)\n return\n })\n // `asyncPool` doesn't provide `index` in it's handler, so we `map` first before using it\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n}\n\nexport async function computeFileSets(\n matchers: Array<FileMatcher>,\n transformer: FileTransformer | null,\n platformPackager: PlatformPackager<any>,\n isElectronCompile: boolean\n): Promise<Array<ResolvedFileSet>> {\n const fileSets: Array<ResolvedFileSet> = []\n const packager = platformPackager.info\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, packager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({ directory: matcher.from, reason: \"doesn't exist\" }, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({ src: matcher.from, files, metadata, destination: matcher.to }))\n }\n\n if (isElectronCompile) {\n // cache files should be first (better IO)\n fileSets.unshift(await compileUsingElectronCompile(fileSets[0], packager))\n }\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager<any>) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = [\".o\", \".obj\"].concat(excludedExts.split(\",\").map(it => `.${it}`))\n if (platformPackager.config.includePdb !== true) {\n result.push(\".pdb\")\n }\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(platformPackager: PlatformPackager<any>, mainMatcher: FileMatcher): Promise<Array<ResolvedFileSet>> {\n const deps = await collectNodeModulesWithLogging(platformPackager)\n\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager)\n // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure\n const result = new Array<ResolvedFileSet>()\n let index = 0\n const NODE_MODULES = \"node_modules\"\n\n const collectNodeModules = async (dep: NodeModuleInfo, destination: string) => {\n const source = dep.dir\n const matcher = new FileMatcher(source, destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager.info)\n const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts, path.relative(mainMatcher.to, destination))\n result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })\n\n log.debug({ dep: dep.name, from: log.filePath(source), to: log.filePath(destination), filesCount: files.length }, \"identified module\")\n\n if (dep.dependencies) {\n for (const c of dep.dependencies) {\n await collectNodeModules(c, path.join(destination, NODE_MODULES, c.name))\n }\n }\n }\n\n for (const dep of deps) {\n const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name)\n await collectNodeModules(dep, destination)\n }\n return result\n}\n\ntype CollectedNodeModules = { nodeModules: NodeModuleInfo[]; logSummary: ModuleManager[\"logSummary\"] }\n\n/** Runs a single package-manager collector against a single directory. */\ntype CollectorRunner = (pm: PM, dir: string) => Promise<CollectedNodeModules>\n\n// `workspace:`/`file:`/`link:`/`portal:` dependencies are symlinked into place rather than\n// installed as standalone, hoistable packages, so they may legitimately be absent from a\n// collected tree and cannot be used to validate it.\nconst LOCAL_DEPENDENCY_SPEC = /^(?:workspace|file|link|portal):/\n\n/**\n * Determines whether a collected module tree actually describes the package being built.\n *\n * A package-manager `list` invocation can resolve to the wrong project root — most notably when\n * electron-builder is run from a workspace sub-package whose dependencies are hoisted to the\n * workspace root. In that case the collector returns a non-empty but unrelated tree. Accepting it\n * would suppress the manual-traversal fallback that resolves the correct modules, so we need to\n * tell a matching collection from a mismatched one.\n *\n * A collection matches when at least one of the package's declared external (registry-installed,\n * non-`workspace:`/`file:`/`link:`/`portal:`) production dependencies is present at the top level —\n * those direct dependencies are always hoisted to the top level of a correct collection. When the\n * package declares no external production dependencies there is nothing to validate against, so any\n * non-empty collection is accepted.\n */\nexport function collectionMatchesAppDependencies(nodeModules: NodeModuleInfo[], dependencies: Record<string, string> | undefined): boolean {\n const requiredExternalDeps = Object.entries(dependencies ?? {})\n .filter(([, spec]) => !LOCAL_DEPENDENCY_SPEC.test(spec))\n .map(([name]) => name)\n if (requiredExternalDeps.length === 0) {\n return true\n }\n const collected = new Set(nodeModules.map(it => it.name))\n return requiredExternalDeps.some(name => collected.has(name))\n}\n\n/**\n * Walks the candidate (package-manager, directory) combinations and returns the first collection\n * that both contains modules and matches the package being built (see\n * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a\n * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a\n * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.\n */\nexport async function resolveFirstMatchingCollection(options: {\n pmApproaches: PM[]\n searchDirectories: string[]\n dependencies: Record<string, string> | undefined\n run: CollectorRunner\n}): Promise<CollectedNodeModules | undefined> {\n const { pmApproaches, searchDirectories, dependencies, run } = options\n let fallback: CollectedNodeModules | undefined\n\n for (const pm of pmApproaches) {\n for (const dir of searchDirectories) {\n log.info({ pm, searchDir: dir }, \"searching for node modules\")\n const deps = await run(pm, dir)\n if (deps.nodeModules.length === 0) {\n log.info({ pm, searchDir: dir }, \"no node modules found in collection, trying next search directory\")\n continue\n }\n if (collectionMatchesAppDependencies(deps.nodeModules, dependencies)) {\n log.debug({ pm, searchDir: dir, depCount: deps.nodeModules.length }, \"collected node modules\")\n return deps\n }\n log.info({ pm, searchDir: dir }, \"collected node modules do not match the target package, trying next search directory/approach\")\n fallback ??= deps\n }\n }\n return fallback\n}\n\n/** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */\nfunction dependencyNameFromSummaryId(id: string): string {\n let at: number\n if (id.startsWith(\"@\")) {\n // Scoped package: the version separator is the first `@` after the scope's `/`\n const slashIndex = id.indexOf(\"/\")\n if (slashIndex === -1) {\n return id\n }\n at = id.indexOf(\"@\", slashIndex + 1)\n } else {\n at = id.indexOf(\"@\")\n }\n return at > 0 ? id.slice(0, at) : id\n}\n\n/**\n * Enforces `allowMissingDependencies` against the finished collection summary (issue #10058).\n * Runs only after collection completes, so the error reports the COMPLETE set of missing\n * production dependencies at once instead of failing on the first one.\n *\n * v26 defaults to warn-only: `true` and omitted keep the historical warning behavior of the\n * stable 26.x line, while `false`/`null` fail the build on any missing production dependency\n * (the electron-builder 27+ default). When the option is a `string[]`, only the listed dependency\n * names are allowed to be missing — matched against the package name parsed from the summary's\n * `name@version` entries (scoped names included), with an exact-entry match accepted as well.\n *\n * Only genuinely missing production dependencies (`PKG_NOT_FOUND` / `PKG_NOT_ON_DISK`) are fatal;\n * missing optional dependencies (`PKG_OPTIONAL_NOT_INSTALLED` / `PKG_OPTIONAL_PLATFORM_NOT_INSTALLED`)\n * never fail the build.\n *\n * Exported for tests (an internal-tagged export would be stripped from the declarations the test\n * project consumes).\n */\nexport function enforceAllowMissingDependencies(allowMissingDependencies: boolean | Array<string> | null | undefined, logSummary: ModuleManager[\"logSummary\"] | undefined): void {\n // v26 default: omitted behaves like `true` (warn-only) so existing 26.x builds keep working.\n if (allowMissingDependencies === true || allowMissingDependencies === undefined) {\n return\n }\n const missing = new Set<string>([...(logSummary?.[LogMessageByKey.PKG_NOT_FOUND] ?? []), ...(logSummary?.[LogMessageByKey.PKG_NOT_ON_DISK] ?? [])])\n const allowed = new Set(Array.isArray(allowMissingDependencies) ? allowMissingDependencies : [])\n const fatal = Array.from(missing)\n .filter(id => !allowed.has(dependencyNameFromSummaryId(id)) && !allowed.has(id))\n .sort()\n if (fatal.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The following production dependencies could not be resolved during node-module collection:\\n` +\n fatal.map(id => ` - ${id}`).join(\"\\n\") +\n `\\nInstall the missing dependencies, list names in \\`allowMissingDependencies\\` to allow specific ones to be missing, or set \\`allowMissingDependencies\\` to true to only warn.`\n )\n}\n\n/** Exported for tests (an internal-tagged export would be stripped from the declarations the test project consumes). */\nexport async function collectNodeModulesWithLogging(platformPackager: PlatformPackager<any>) {\n const packager = platformPackager.info\n const { tempDirManager, appDir, projectDir } = packager\n\n const searchDirectories = Array.from(new Set([appDir, projectDir, await packager.getWorkspaceRoot()])).filter((it): it is string => isEmptyOrSpaces(it) === false)\n const pmApproaches = [await packager.getPackageManager(), PM.TRAVERSAL]\n\n // Validate against the as-declared (pre-extraMetadata) production dependencies so a configured\n // `extraMetadata.dependencies` entry that isn't installed cannot reject a correct collection.\n const deps = await resolveFirstMatchingCollection({\n pmApproaches,\n searchDirectories,\n dependencies: packager.originalMetadata.dependencies,\n run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({ packageName: packager.nodePackageName }),\n })\n\n if (!deps?.nodeModules?.length) {\n log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, \"no node modules returned while searching directories\")\n return []\n }\n\n const summary = Object.entries(deps.logSummary ?? {}).filter(([, dependencies]) => Array.isArray(dependencies) && dependencies.length > 0)\n for (const [errorMessage, dependencies] of summary) {\n const logLevel = logMessageLevelByKey[errorMessage as LogMessageByKey] || \"debug\"\n log[logLevel]({ dependencies }, errorMessage)\n }\n\n // Enforcement (issue #10058): collection is complete and the summary above has reached the log,\n // so failing here reports every missing production dependency at once.\n enforceAllowMissingDependencies(packager.config.allowMissingDependencies, deps.logSummary)\n\n return deps.nodeModules\n}\n\nasync function compileUsingElectronCompile(mainFileSet: ResolvedFileSet, packager: Packager): Promise<ResolvedFileSet> {\n log.info(\"compiling using electron-compile\")\n\n const electronCompileCache = await packager.tempDirManager.getTempDir({ prefix: \"electron-compile-cache\" })\n const cacheDir = path.join(electronCompileCache, \".cache\")\n // clear and create cache dir\n await mkdir(cacheDir, { recursive: true })\n const compilerHost = await createElectronCompilerHost(mainFileSet.src, cacheDir)\n const nextSlashIndex = mainFileSet.src.length + 1\n // pre-compute electron-compile to cache dir - we need to process only subdirectories, not direct files of app dir\n const filesPromise: Promise<any>[] = mainFileSet.files.map(file => {\n if (\n file.includes(NODE_MODULES_PATTERN) ||\n file.includes(BOWER_COMPONENTS_PATTERN) ||\n !file.includes(path.sep, nextSlashIndex) || // ignore not root files\n !mainFileSet.metadata.get(file)!.isFile()\n ) {\n return\n }\n return compilerHost.compile(file)\n })\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n await compilerHost.saveConfiguration()\n\n const metadata = new Map<string, Stats>()\n const cacheFiles = await walk(cacheDir, file => !file.startsWith(\".\"), {\n consume: (file, fileStat) => {\n if (fileStat.isFile()) {\n metadata.set(file, fileStat)\n }\n return null\n },\n })\n\n // add shim\n const shimPath = `${mainFileSet.src}${path.sep}${ELECTRON_COMPILE_SHIM_FILENAME}`\n mainFileSet.files.push(shimPath)\n mainFileSet.metadata.set(shimPath, { isFile: () => true, isDirectory: () => false, isSymbolicLink: () => false } as any)\n if (mainFileSet.transformedFiles == null) {\n mainFileSet.transformedFiles = new Map()\n }\n mainFileSet.transformedFiles.set(\n mainFileSet.files.length - 1,\n `\n'use strict';\nrequire('electron-compile').init(__dirname, require('path').resolve(__dirname, '${packager.metadata.main || \"index\"}'), true);\n`\n )\n return { src: electronCompileCache, files: cacheFiles, metadata, destination: mainFileSet.destination }\n}\n"]}
1
+ {"version":3,"file":"appFileCopier.js","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":";;;AAsBA,gDAYC;AAED,oCAyCC;AAaD,wCAoCC;AAED,0CA4BC;AAwBD,8DA8BC;AA2BD,4EASC;AAcD,wEAqCC;AAoCD,0EAkBC;AAGD,sEAgCC;AAlYD,+CAAwK;AAExK,uCAAwC;AACxC,0CAA6C;AAC7C,6BAA4B;AAC5B,qDAAuC;AACvC,2DAAmD;AACnD,kCAAkC;AA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,CACE,CAAA;IACD,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,CAAA;AACzG,CAAC","sourcesContent":["import { AsyncTaskManager, FileCopier, FileTransformer, InvalidConfigurationError, isEmptyOrSpaces, Link, log, MAX_FILE_REQUESTS, statOrNull, walk } from \"builder-util\"\nimport { Stats } from \"fs\"\nimport { ensureSymlink } from \"fs-extra\"\nimport { mkdir, readlink } from \"fs/promises\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { isLibOrExe } from \"../asar/unpackDetector\"\nimport { Platform } from \"../core\"\nimport { excludedExts, FileMatcher } from \"../fileMatcher\"\nimport { createElectronCompilerHost, NODE_MODULES_PATTERN } from \"../fileTransformer\"\nimport { getCollectorByPackageManager, PM } from \"../node-module-collector\"\nimport { LogMessageByKey, logMessageLevelByKey, ModuleManager } from \"../node-module-collector/moduleManager\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { AppFileWalker } from \"./AppFileWalker\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper\"\nimport { NodeModuleInfo } from \"./packageDependencies\"\n\nconst BOWER_COMPONENTS_PATTERN = `${path.sep}bower_components${path.sep}`\n/** @internal */\nexport const ELECTRON_COMPILE_SHIM_FILENAME = \"__shim.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n\n const src = fileSet.src\n const dest = fileSet.destination\n // get node_modules path relative to src and then append to dest\n if (file.startsWith(src + path.sep)) {\n return path.join(dest, path.relative(src, file))\n }\n return dest\n}\n\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const createdParentDirs = new Set<string>()\n\n const fileCopier = new FileCopier(file => {\n return !isLibOrExe(file)\n }, transformer)\n const links: Array<Link> = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({ file: destinationFile, link: await readlink(sourceFile) })\n continue\n }\n\n const fileParent = path.dirname(destinationFile)\n if (!createdParentDirs.has(fileParent)) {\n createdParentDirs.add(fileParent)\n await mkdir(fileParent, { recursive: true })\n }\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n await asyncPool(MAX_FILE_REQUESTS, links, it => ensureSymlink(it.link, it.file))\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array<string>\n metadata: Map<string, Stats>\n transformedFiles?: Map<number, string | Buffer> | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void> {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n const filesPromise = fileSet.files.map(async (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise<any>).then(it => {\n if (it != null) {\n transformedFiles!.set(index, it)\n }\n return\n })\n }\n transformedFiles!.set(index, transformedValue as string | Buffer)\n return\n })\n // `asyncPool` doesn't provide `index` in it's handler, so we `map` first before using it\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n}\n\nexport async function computeFileSets(\n matchers: Array<FileMatcher>,\n transformer: FileTransformer | null,\n platformPackager: PlatformPackager<any>,\n isElectronCompile: boolean\n): Promise<Array<ResolvedFileSet>> {\n const fileSets: Array<ResolvedFileSet> = []\n const packager = platformPackager.info\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, packager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({ directory: matcher.from, reason: \"doesn't exist\" }, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({ src: matcher.from, files, metadata, destination: matcher.to }))\n }\n\n if (isElectronCompile) {\n // cache files should be first (better IO)\n fileSets.unshift(await compileUsingElectronCompile(fileSets[0], packager))\n }\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager<any>) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = [\".o\", \".obj\"].concat(excludedExts.split(\",\").map(it => `.${it}`))\n if (platformPackager.config.includePdb !== true) {\n result.push(\".pdb\")\n }\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(platformPackager: PlatformPackager<any>, mainMatcher: FileMatcher): Promise<Array<ResolvedFileSet>> {\n const deps = await collectNodeModulesWithLogging(platformPackager)\n\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager)\n // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure\n const result = new Array<ResolvedFileSet>()\n let index = 0\n const NODE_MODULES = \"node_modules\"\n\n const collectNodeModules = async (dep: NodeModuleInfo, destination: string) => {\n const source = dep.dir\n const matcher = new FileMatcher(source, destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager.info)\n const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts, path.relative(mainMatcher.to, destination))\n result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })\n\n log.debug({ dep: dep.name, from: log.filePath(source), to: log.filePath(destination), filesCount: files.length }, \"identified module\")\n\n if (dep.dependencies) {\n for (const c of dep.dependencies) {\n await collectNodeModules(c, path.join(destination, NODE_MODULES, c.name))\n }\n }\n }\n\n for (const dep of deps) {\n const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name)\n await collectNodeModules(dep, destination)\n }\n return result\n}\n\ntype CollectedNodeModules = { nodeModules: NodeModuleInfo[]; logSummary: ModuleManager[\"logSummary\"] }\n\n/** Runs a single package-manager collector against a single directory. */\ntype CollectorRunner = (pm: PM, dir: string) => Promise<CollectedNodeModules>\n\n// `workspace:`/`file:`/`link:`/`portal:` dependencies are symlinked into place rather than\n// installed as standalone, hoistable packages, so they may legitimately be absent from a\n// collected tree and cannot be used to validate it.\nconst LOCAL_DEPENDENCY_SPEC = /^(?:workspace|file|link|portal):/\n\n/**\n * Determines whether a collected module tree actually describes the package being built.\n *\n * A package-manager `list` invocation can resolve to the wrong project root — most notably when\n * electron-builder is run from a workspace sub-package whose dependencies are hoisted to the\n * workspace root. In that case the collector returns a non-empty but unrelated tree. Accepting it\n * would suppress the manual-traversal fallback that resolves the correct modules, so we need to\n * tell a matching collection from a mismatched one.\n *\n * A collection matches when at least one of the package's declared external (registry-installed,\n * non-`workspace:`/`file:`/`link:`/`portal:`) production dependencies is present at the top level —\n * those direct dependencies are always hoisted to the top level of a correct collection. When the\n * package declares no external production dependencies there is nothing to validate against, so any\n * non-empty collection is accepted.\n */\nexport function collectionMatchesAppDependencies(nodeModules: NodeModuleInfo[], dependencies: Record<string, string> | undefined): boolean {\n const requiredExternalDeps = Object.entries(dependencies ?? {})\n .filter(([, spec]) => !LOCAL_DEPENDENCY_SPEC.test(spec))\n .map(([name]) => name)\n if (requiredExternalDeps.length === 0) {\n return true\n }\n const collected = new Set(nodeModules.map(it => it.name))\n return requiredExternalDeps.some(name => collected.has(name))\n}\n\n/**\n * Walks the candidate (package-manager, directory) combinations and returns the first collection\n * that both contains modules and matches the package being built (see\n * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a\n * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a\n * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.\n *\n * An approach that throws (e.g. the package manager exited without producing its dependency tree,\n * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every\n * approach fails to produce a collection and at least one threw, the first error is rethrown rather\n * than silently reporting \"no node modules\".\n */\nexport async function resolveFirstMatchingCollection(options: {\n pmApproaches: PM[]\n searchDirectories: string[]\n dependencies: Record<string, string> | undefined\n run: CollectorRunner\n}): Promise<CollectedNodeModules | undefined> {\n const { pmApproaches, searchDirectories, dependencies, run } = options\n let fallback: CollectedNodeModules | undefined\n let firstError: Error | undefined\n\n for (const pm of pmApproaches) {\n for (const dir of searchDirectories) {\n log.info({ pm, searchDir: dir }, \"searching for node modules\")\n let deps: CollectedNodeModules\n try {\n deps = await run(pm, dir)\n } catch (error: any) {\n log.warn({ pm, searchDir: dir, error: error?.message ?? String(error) }, \"node module collection failed, trying next search directory/approach\")\n firstError ??= error instanceof Error ? error : new Error(String(error))\n continue\n }\n if (deps.nodeModules.length === 0) {\n log.info({ pm, searchDir: dir }, \"no node modules found in collection, trying next search directory\")\n continue\n }\n if (collectionMatchesAppDependencies(deps.nodeModules, dependencies)) {\n log.debug({ pm, searchDir: dir, depCount: deps.nodeModules.length }, \"collected node modules\")\n return deps\n }\n log.info({ pm, searchDir: dir }, \"collected node modules do not match the target package, trying next search directory/approach\")\n fallback ??= deps\n }\n }\n if (fallback == null && firstError != null) {\n throw firstError\n }\n return fallback\n}\n\n/** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */\nfunction dependencyNameFromSummaryId(id: string): string {\n let at: number\n if (id.startsWith(\"@\")) {\n // Scoped package: the version separator is the first `@` after the scope's `/`\n const slashIndex = id.indexOf(\"/\")\n if (slashIndex === -1) {\n return id\n }\n at = id.indexOf(\"@\", slashIndex + 1)\n } else {\n at = id.indexOf(\"@\")\n }\n return at > 0 ? id.slice(0, at) : id\n}\n\n/**\n * Enforces `allowMissingDependencies` against the finished collection summary (issue #10058).\n * Runs only after collection completes, so the error reports the COMPLETE set of missing\n * production dependencies at once instead of failing on the first one.\n *\n * v26 defaults to warn-only: `true` and omitted keep the historical warning behavior of the\n * stable 26.x line, while `false`/`null` fail the build on any missing production dependency\n * (the electron-builder 27+ default). When the option is a `string[]`, only the listed dependency\n * names are allowed to be missing — matched against the package name parsed from the summary's\n * `name@version` entries (scoped names included), with an exact-entry match accepted as well.\n *\n * Only genuinely missing production dependencies (`PKG_NOT_FOUND` / `PKG_NOT_ON_DISK`) are fatal;\n * missing optional dependencies (`PKG_OPTIONAL_NOT_INSTALLED` / `PKG_OPTIONAL_PLATFORM_NOT_INSTALLED`)\n * never fail the build.\n *\n * Exported for tests (an internal-tagged export would be stripped from the declarations the test\n * project consumes).\n */\nexport function enforceAllowMissingDependencies(allowMissingDependencies: boolean | Array<string> | null | undefined, logSummary: ModuleManager[\"logSummary\"] | undefined): void {\n // v26 default: omitted behaves like `true` (warn-only) so existing 26.x builds keep working.\n if (allowMissingDependencies === true || allowMissingDependencies === undefined) {\n return\n }\n const missing = new Set<string>([...(logSummary?.[LogMessageByKey.PKG_NOT_FOUND] ?? []), ...(logSummary?.[LogMessageByKey.PKG_NOT_ON_DISK] ?? [])])\n const allowed = new Set(Array.isArray(allowMissingDependencies) ? allowMissingDependencies : [])\n const fatal = Array.from(missing)\n .filter(id => !allowed.has(dependencyNameFromSummaryId(id)) && !allowed.has(id))\n .sort()\n if (fatal.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The following production dependencies could not be resolved during node-module collection:\\n` +\n fatal.map(id => ` - ${id}`).join(\"\\n\") +\n `\\nInstall the missing dependencies, list names in \\`allowMissingDependencies\\` to allow specific ones to be missing, or set \\`allowMissingDependencies\\` to true to only warn.`\n )\n}\n\n/** Exported for tests (an internal-tagged export would be stripped from the declarations the test project consumes). */\nexport async function collectNodeModulesWithLogging(platformPackager: PlatformPackager<any>) {\n const packager = platformPackager.info\n const { tempDirManager, appDir, projectDir } = packager\n\n const searchDirectories = Array.from(new Set([appDir, projectDir, await packager.getWorkspaceRoot()])).filter((it): it is string => isEmptyOrSpaces(it) === false)\n const pmApproaches = [await packager.getPackageManager(), PM.TRAVERSAL]\n\n // Validate against the as-declared (pre-extraMetadata) production dependencies so a configured\n // `extraMetadata.dependencies` entry that isn't installed cannot reject a correct collection.\n const deps = await resolveFirstMatchingCollection({\n pmApproaches,\n searchDirectories,\n dependencies: packager.originalMetadata.dependencies,\n run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({ packageName: packager.nodePackageName }),\n })\n\n if (!deps?.nodeModules?.length) {\n log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, \"no node modules returned while searching directories\")\n return []\n }\n\n const summary = Object.entries(deps.logSummary ?? {}).filter(([, dependencies]) => Array.isArray(dependencies) && dependencies.length > 0)\n for (const [errorMessage, dependencies] of summary) {\n const logLevel = logMessageLevelByKey[errorMessage as LogMessageByKey] || \"debug\"\n log[logLevel]({ dependencies }, errorMessage)\n }\n\n // Enforcement (issue #10058): collection is complete and the summary above has reached the log,\n // so failing here reports every missing production dependency at once.\n enforceAllowMissingDependencies(packager.config.allowMissingDependencies, deps.logSummary)\n\n return deps.nodeModules\n}\n\nasync function compileUsingElectronCompile(mainFileSet: ResolvedFileSet, packager: Packager): Promise<ResolvedFileSet> {\n log.info(\"compiling using electron-compile\")\n\n const electronCompileCache = await packager.tempDirManager.getTempDir({ prefix: \"electron-compile-cache\" })\n const cacheDir = path.join(electronCompileCache, \".cache\")\n // clear and create cache dir\n await mkdir(cacheDir, { recursive: true })\n const compilerHost = await createElectronCompilerHost(mainFileSet.src, cacheDir)\n const nextSlashIndex = mainFileSet.src.length + 1\n // pre-compute electron-compile to cache dir - we need to process only subdirectories, not direct files of app dir\n const filesPromise: Promise<any>[] = mainFileSet.files.map(file => {\n if (\n file.includes(NODE_MODULES_PATTERN) ||\n file.includes(BOWER_COMPONENTS_PATTERN) ||\n !file.includes(path.sep, nextSlashIndex) || // ignore not root files\n !mainFileSet.metadata.get(file)!.isFile()\n ) {\n return\n }\n return compilerHost.compile(file)\n })\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n await compilerHost.saveConfiguration()\n\n const metadata = new Map<string, Stats>()\n const cacheFiles = await walk(cacheDir, file => !file.startsWith(\".\"), {\n consume: (file, fileStat) => {\n if (fileStat.isFile()) {\n metadata.set(file, fileStat)\n }\n return null\n },\n })\n\n // add shim\n const shimPath = `${mainFileSet.src}${path.sep}${ELECTRON_COMPILE_SHIM_FILENAME}`\n mainFileSet.files.push(shimPath)\n mainFileSet.metadata.set(shimPath, { isFile: () => true, isDirectory: () => false, isSymbolicLink: () => false } as any)\n if (mainFileSet.transformedFiles == null) {\n mainFileSet.transformedFiles = new Map()\n }\n mainFileSet.transformedFiles.set(\n mainFileSet.files.length - 1,\n `\n'use strict';\nrequire('electron-compile').init(__dirname, require('path').resolve(__dirname, '${packager.metadata.main || \"index\"}'), true);\n`\n )\n return { src: electronCompileCache, files: cacheFiles, metadata, destination: mainFileSet.destination }\n}\n"]}
package/out/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "26.16.1";
1
+ export declare const PACKAGE_VERSION = "26.18.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.16.1";
4
+ exports.PACKAGE_VERSION = "26.18.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,SAAS,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.16.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.18.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.16.1",
4
+ "version": "26.18.0",
5
5
  "main": "out/index.js",
6
6
  "files": [
7
7
  "out",
@@ -52,7 +52,7 @@
52
52
  "@electron/get": "^3.0.0",
53
53
  "@electron/notarize": "2.5.0",
54
54
  "@electron/osx-sign": "1.3.3",
55
- "@electron/rebuild": "^4.0.4",
55
+ "@electron/rebuild": "^4.2.1",
56
56
  "@electron/universal": "2.0.3",
57
57
  "@malept/flatpak-bundler": "^0.4.0",
58
58
  "@noble/hashes": "^1.8.0",
@@ -87,7 +87,7 @@
87
87
  "which": "^5.0.0",
88
88
  "builder-util": "26.16.0",
89
89
  "builder-util-runtime": "9.7.0",
90
- "electron-publish": "26.16.0"
90
+ "electron-publish": "26.18.0"
91
91
  },
92
92
  "///": "babel in devDependencies for proton tests",
93
93
  "devDependencies": {
@@ -110,6 +110,8 @@
110
110
  "@babel/plugin-syntax-import-meta": "7.10.4",
111
111
  "@babel/preset-env": "7.24.8",
112
112
  "@babel/preset-react": "7.24.7",
113
+ "@electron-forge/maker-base": "8.0.1",
114
+ "@electron-forge/shared-types": "8.0.1",
113
115
  "@types/debug": "4.1.7",
114
116
  "@types/ejs": "3.1.0",
115
117
  "@types/hosted-git-info": "3.0.2",
@@ -121,12 +123,12 @@
121
123
  "@types/unzipper": "^0.10.11",
122
124
  "@types/which": "^3.0.4",
123
125
  "toml": "^3.0.0",
124
- "dmg-builder": "26.16.1",
125
- "electron-builder-squirrel-windows": "26.16.1"
126
+ "dmg-builder": "26.18.0",
127
+ "electron-builder-squirrel-windows": "26.18.0"
126
128
  },
127
129
  "peerDependencies": {
128
- "dmg-builder": "26.16.1",
129
- "electron-builder-squirrel-windows": "26.16.1"
130
+ "dmg-builder": "26.18.0",
131
+ "electron-builder-squirrel-windows": "26.18.0"
130
132
  },
131
133
  "//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
132
134
  "typings": "./out/index.d.ts"
package/scheme.json CHANGED
@@ -4274,8 +4274,14 @@
4274
4274
  "type": "boolean"
4275
4275
  },
4276
4276
  "differentialPackage": {
4277
- "description": "Marks the package as built with differential download support for the update server.",
4278
- "type": "boolean"
4277
+ "default": true,
4278
+ "description": "Marks the package as built with differential download support for the update server, and selects how the\napp package is compressed:\n\n- `false` — no differential download support.\n- `\"store-asar\"` — differential-aware, with the app's `resources/app.asar` stored uncompressed (7-Zip\n `Copy`) inside the package. The differential updater diffs the *compressed* package with a\n content-defined blockmap, and the asar is a single compressed member — so any change to app code\n re-downloads the entire compressed asar (~100% of the member; its header rewrite alone diverges every\n block). Storing it keeps unchanged regions byte-identical between releases, making the delta\n proportional to what actually changed (measured on a ~32 MB asar: a one-line source change cost 0.2%\n instead of 100%). The stored asar's byte range is also chunked with finer content-defined blocks\n (4/8/16 KiB instead of the 8/16/32 KiB used for the rest of the installer), so a small change costs\n proportionally fewer bytes still. Trade-off: the installer and full package grow by roughly what\n compressing the asar saved. Without an `app.asar` (e.g. `asar` is disabled) there is nothing to store,\n so it behaves like `true`. Upgrading from an electron-builder without the finer chunking changes the\n block boundaries once: the first differential update from an installer built before it re-downloads\n close to the whole asar, and updates between installers built with it are proportional again.\n- anything else (`true`, `\"compressed\"`, unset) — differential-aware, whole package compressed.",
4279
+ "enum": [
4280
+ "compressed",
4281
+ false,
4282
+ "store-asar",
4283
+ true
4284
+ ]
4279
4285
  },
4280
4286
  "displayLanguageSelector": {
4281
4287
  "default": false,
@@ -4540,7 +4546,7 @@
4540
4546
  },
4541
4547
  "useZip": {
4542
4548
  "default": false,
4543
- "description": "Forces zip compression format instead of LZMA. Used internally for differential update packages.",
4549
+ "description": "Use zip instead of 7z (LZMA) for the embedded app package. Only applies to portable targets and to installers built with `differentialPackage: false`; ignored (with a warning) when `differentialPackage` is enabled and for `nsis-web`, which always use 7z.",
4544
4550
  "type": "boolean"
4545
4551
  },
4546
4552
  "warningsAsErrors": {
@@ -4627,8 +4633,14 @@
4627
4633
  "type": "boolean"
4628
4634
  },
4629
4635
  "differentialPackage": {
4630
- "description": "Marks the package as built with differential download support for the update server.",
4631
- "type": "boolean"
4636
+ "default": true,
4637
+ "description": "Marks the package as built with differential download support for the update server, and selects how the\napp package is compressed:\n\n- `false` — no differential download support.\n- `\"store-asar\"` — differential-aware, with the app's `resources/app.asar` stored uncompressed (7-Zip\n `Copy`) inside the package. The differential updater diffs the *compressed* package with a\n content-defined blockmap, and the asar is a single compressed member — so any change to app code\n re-downloads the entire compressed asar (~100% of the member; its header rewrite alone diverges every\n block). Storing it keeps unchanged regions byte-identical between releases, making the delta\n proportional to what actually changed (measured on a ~32 MB asar: a one-line source change cost 0.2%\n instead of 100%). The stored asar's byte range is also chunked with finer content-defined blocks\n (4/8/16 KiB instead of the 8/16/32 KiB used for the rest of the installer), so a small change costs\n proportionally fewer bytes still. Trade-off: the installer and full package grow by roughly what\n compressing the asar saved. Without an `app.asar` (e.g. `asar` is disabled) there is nothing to store,\n so it behaves like `true`. Upgrading from an electron-builder without the finer chunking changes the\n block boundaries once: the first differential update from an installer built before it re-downloads\n close to the whole asar, and updates between installers built with it are proportional again.\n- anything else (`true`, `\"compressed\"`, unset) — differential-aware, whole package compressed.",
4638
+ "enum": [
4639
+ "compressed",
4640
+ false,
4641
+ "store-asar",
4642
+ true
4643
+ ]
4632
4644
  },
4633
4645
  "displayLanguageSelector": {
4634
4646
  "default": false,
@@ -4893,7 +4905,7 @@
4893
4905
  },
4894
4906
  "useZip": {
4895
4907
  "default": false,
4896
- "description": "Forces zip compression format instead of LZMA. Used internally for differential update packages.",
4908
+ "description": "Use zip instead of 7z (LZMA) for the embedded app package. Only applies to portable targets and to installers built with `differentialPackage: false`; ignored (with a warning) when `differentialPackage` is enabled and for `nsis-web`, which always use 7z.",
4897
4909
  "type": "boolean"
4898
4910
  },
4899
4911
  "warningsAsErrors": {
@@ -5925,7 +5937,7 @@
5925
5937
  },
5926
5938
  "useZip": {
5927
5939
  "default": false,
5928
- "description": "Forces zip compression format instead of LZMA. Used internally for differential update packages.",
5940
+ "description": "Use zip instead of 7z (LZMA) for the embedded app package. Only applies to portable targets and to installers built with `differentialPackage: false`; ignored (with a warning) when `differentialPackage` is enabled and for `nsis-web`, which always use 7z.",
5929
5941
  "type": "boolean"
5930
5942
  },
5931
5943
  "warningsAsErrors": {