app-builder-lib 27.0.0-alpha.5 → 27.0.0-alpha.6

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 (121) hide show
  1. package/dist/appInfo.d.ts +1 -1
  2. package/dist/appInfo.d.ts.map +1 -1
  3. package/dist/appInfo.js +3 -3
  4. package/dist/appInfo.js.map +1 -1
  5. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  6. package/dist/codeSign/win/signtoolBaseSignManager.js +4 -3
  7. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  8. package/dist/configuration.d.ts +47 -0
  9. package/dist/configuration.d.ts.map +1 -1
  10. package/dist/configuration.js +11 -1
  11. package/dist/configuration.js.map +1 -1
  12. package/dist/electron/ElectronFramework.d.ts +2 -1
  13. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  14. package/dist/electron/ElectronFramework.js +30 -26
  15. package/dist/electron/ElectronFramework.js.map +1 -1
  16. package/dist/electron/electronArchSupport.d.ts +12 -0
  17. package/dist/electron/electronArchSupport.d.ts.map +1 -0
  18. package/dist/electron/electronArchSupport.js +58 -0
  19. package/dist/electron/electronArchSupport.js.map +1 -0
  20. package/dist/electron/mac/electronMac.js +12 -21
  21. package/dist/electron/mac/electronMac.js.map +1 -1
  22. package/dist/electron/mac/electronMacUtils.d.ts +24 -0
  23. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
  24. package/dist/electron/mac/electronMacUtils.js +42 -0
  25. package/dist/electron/mac/electronMacUtils.js.map +1 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/indexInternal.d.ts +3 -1
  30. package/dist/indexInternal.d.ts.map +1 -1
  31. package/dist/indexInternal.js +3 -0
  32. package/dist/indexInternal.js.map +1 -1
  33. package/dist/macPackager.d.ts.map +1 -1
  34. package/dist/macPackager.js +15 -3
  35. package/dist/macPackager.js.map +1 -1
  36. package/dist/node-module-collector/moduleManager.d.ts +2 -1
  37. package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
  38. package/dist/node-module-collector/moduleManager.js +2 -0
  39. package/dist/node-module-collector/moduleManager.js.map +1 -1
  40. package/dist/node-module-collector/nodeModulesCollector.d.ts +17 -1
  41. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  42. package/dist/node-module-collector/nodeModulesCollector.js +67 -1
  43. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  44. package/dist/node-module-collector/types.d.ts +2 -0
  45. package/dist/node-module-collector/types.d.ts.map +1 -1
  46. package/dist/node-module-collector/types.js.map +1 -1
  47. package/dist/options/MsixOptions.d.ts +126 -0
  48. package/dist/options/MsixOptions.d.ts.map +1 -0
  49. package/dist/options/MsixOptions.js +2 -0
  50. package/dist/options/MsixOptions.js.map +1 -0
  51. package/dist/options/macOptions.d.ts +4 -4
  52. package/dist/options/macOptions.d.ts.map +1 -1
  53. package/dist/options/macOptions.js.map +1 -1
  54. package/dist/options/winOptions.d.ts +2 -2
  55. package/dist/options/winOptions.js.map +1 -1
  56. package/dist/packager.d.ts.map +1 -1
  57. package/dist/packager.js +7 -0
  58. package/dist/packager.js.map +1 -1
  59. package/dist/publish/PublishManager.d.ts.map +1 -1
  60. package/dist/publish/PublishManager.js +13 -4
  61. package/dist/publish/PublishManager.js.map +1 -1
  62. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  63. package/dist/publish/updateInfoBuilder.js +20 -22
  64. package/dist/publish/updateInfoBuilder.js.map +1 -1
  65. package/dist/targets/archive.d.ts +11 -0
  66. package/dist/targets/archive.d.ts.map +1 -1
  67. package/dist/targets/archive.js +40 -22
  68. package/dist/targets/archive.js.map +1 -1
  69. package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
  70. package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
  71. package/dist/targets/linux/snap/snapcraft.js +11 -0
  72. package/dist/targets/linux/snap/snapcraft.js.map +1 -0
  73. package/dist/targets/mac/MacTargetHelper.d.ts +6 -0
  74. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  75. package/dist/targets/mac/MacTargetHelper.js +22 -1
  76. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  77. package/dist/targets/win/AppxTarget.d.ts +0 -2
  78. package/dist/targets/win/AppxTarget.d.ts.map +1 -1
  79. package/dist/targets/win/AppxTarget.js +37 -325
  80. package/dist/targets/win/AppxTarget.js.map +1 -1
  81. package/dist/targets/win/MsixTarget.d.ts +22 -0
  82. package/dist/targets/win/MsixTarget.d.ts.map +1 -0
  83. package/dist/targets/win/MsixTarget.js +214 -0
  84. package/dist/targets/win/MsixTarget.js.map +1 -0
  85. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  86. package/dist/targets/win/nsis/NsisTarget.js +5 -0
  87. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  88. package/dist/targets/win/winAppUtil.d.ts +115 -0
  89. package/dist/targets/win/winAppUtil.d.ts.map +1 -0
  90. package/dist/targets/win/winAppUtil.js +407 -0
  91. package/dist/targets/win/winAppUtil.js.map +1 -0
  92. package/dist/toolsets/winCodeSign.d.ts +9 -0
  93. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  94. package/dist/toolsets/winCodeSign.js +11 -0
  95. package/dist/toolsets/winCodeSign.js.map +1 -1
  96. package/dist/util/appFileCopier.d.ts.map +1 -1
  97. package/dist/util/appFileCopier.js +22 -2
  98. package/dist/util/appFileCopier.js.map +1 -1
  99. package/dist/util/electronGet.d.ts.map +1 -1
  100. package/dist/util/electronGet.js +17 -11
  101. package/dist/util/electronGet.js.map +1 -1
  102. package/dist/util/flags.d.ts +0 -1
  103. package/dist/util/flags.d.ts.map +1 -1
  104. package/dist/util/flags.js +0 -3
  105. package/dist/util/flags.js.map +1 -1
  106. package/dist/util/packageMetadata.js +0 -10
  107. package/dist/util/packageMetadata.js.map +1 -1
  108. package/dist/version.d.ts +1 -1
  109. package/dist/version.js +1 -1
  110. package/dist/version.js.map +1 -1
  111. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  112. package/dist/vm/ParallelsVm.js +18 -5
  113. package/dist/vm/ParallelsVm.js.map +1 -1
  114. package/dist/winPackager.d.ts.map +1 -1
  115. package/dist/winPackager.js +3 -0
  116. package/dist/winPackager.js.map +1 -1
  117. package/package.json +8 -8
  118. package/scheme.json +462 -8
  119. package/templates/appx/appxmanifest.xml +1 -1
  120. package/templates/msix/appxmanifest.xml +45 -0
  121. package/templates/nsis/installSection.nsh +14 -0
@@ -1 +1 @@
1
- {"version":3,"file":"nodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/nodeModulesCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,qBAAqB,EAAU,MAAM,cAAc,CAAA;AAChF,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAwC,MAAM,YAAY,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAM,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAQlE,MAAM,OAAgB,oBAAoB;IAsBxC,YACqB,OAAe,EACjB,cAAsB;QADpB,YAAO,GAAP,OAAO,CAAQ;QACjB,mBAAc,GAAd,cAAc,CAAQ;QAvBxB,gBAAW,GAAqB,EAAE,CAAA;QAChC,oBAAe,GAA6B,IAAI,GAAG,EAAE,CAAA;QACrD,oBAAe,GAAoB,EAAE,CAAA;QACrC,UAAK,GAAkB,IAAI,aAAa,EAAE,CAAA;QAE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Q,CAAC,MAAM,CAAC,CAAA;QAC5F,IAAI,YAAY,EAAE,CAAC;YACjB,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,uIAAuI,CAAC,CAAA;QAC1J,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,wDAAwD,CAAC,CAAA;YAC/E,yFAAyF;YACzF,qFAAqF;YACrF,uFAAuF;YACvF,yEAAyE;YACzE,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC1E,CAAC;QACH,CAAC;QACD,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kDAAkD,IAAI,MAAM,MAAM,EAAE,CAAC,CAAA;QACvF,CAAC;IACH,CAAC;CACF","sourcesContent":["import { exists, log, retry, stripSensitiveEnvVars, TmpDir } from \"builder-util\"\nimport _fsExtra from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { hoist, type HoisterResult, type HoisterTree } from \"./hoist.js\"\nimport { LogMessageByKey, ModuleManager } from \"./moduleManager.js\"\nimport { getPackageManagerCommand, PM } from \"./packageManager.js\"\nimport { streamSpawnToFile } from \"../util/streamSpawnToFile.js\"\nimport type { Dependency, DependencyGraph, NodeModuleInfo, PackageJson } from \"./types.js\"\nimport { isPackageCompatible } from \"../util/archCompatibility.js\"\n\n/** Target arch/platform used to drop `cpu`/`os`-incompatible packages while collecting. */\nexport interface ArchFilter {\n cpu: string | null\n os: string\n}\n\nexport abstract class NodeModulesCollector<ProdDepType extends Dependency<ProdDepType, OptionalDepType>, OptionalDepType> {\n private readonly nodeModules: NodeModuleInfo[] = []\n protected readonly allDependencies: Map<string, ProdDepType> = new Map()\n protected readonly productionGraph: DependencyGraph = {}\n protected readonly cache: ModuleManager = new ModuleManager()\n\n protected isHoisted = new Lazy<boolean>(async () => {\n const { manager } = this.installOptions\n const command = getPackageManagerCommand(manager)\n const config = (await this.asyncExec(command, [\"config\", \"list\"])).stdout\n if (config == null) {\n log.debug({ manager }, \"unable to determine node-linker setting; assuming non-hoisted (virtual store) layout\")\n return false\n }\n const lines = Object.fromEntries(config.split(\"\\n\").map(line => line.split(\"=\").map(s => s.trim())))\n if (lines[\"node-linker\"] === \"hoisted\") {\n log.debug({ manager }, \"node_modules are hoisted\")\n return true\n }\n return false\n })\n\n constructor(\n protected readonly rootDir: string,\n private readonly tempDirManager: TmpDir\n ) {}\n\n /**\n * Retrieves and collects all Node.js modules for a given package.\n *\n * This method orchestrates the entire module collection process by:\n * 1. Fetching the dependency tree from the package manager\n * 2. Collecting all dependencies recursively\n * 3. Extracting workspace references if applicable\n * 4. Building a production dependency graph\n * 5. Hoisting the dependencies to their final locations\n * 6. Resolving and returning module information\n */\n public async getNodeModules({ packageName, archFilter }: { packageName: string; archFilter?: ArchFilter }): Promise<{\n nodeModules: NodeModuleInfo[]\n logSummary: ModuleManager[\"logSummary\"]\n }> {\n const tree: ProdDepType = await this.getDependenciesTree(this.installOptions.manager)\n\n await this.collectAllDependencies(tree, packageName)\n const realTree: ProdDepType = this.getTreeFromWorkspaces(tree, packageName)\n await this.extractProductionDependencyGraph(realTree, packageName)\n\n const hoisterResult: HoisterResult = hoist(this.transformToHoisterTree(this.productionGraph, packageName), {\n check: log.isDebugEnabled,\n })\n\n await this._getNodeModules(hoisterResult.dependencies, this.nodeModules, archFilter)\n\n log.debug({ packageName, depCount: this.nodeModules.length }, \"node modules collection complete\")\n\n return { nodeModules: this.nodeModules, logSummary: this.cache.logSummary }\n }\n\n public abstract readonly installOptions: {\n manager: PM\n lockfile: string\n }\n\n protected abstract getArgs(): string[]\n protected abstract extractProductionDependencyGraph(tree: Dependency<ProdDepType, OptionalDepType>, dependencyId: string): Promise<void>\n protected abstract collectAllDependencies(tree: Dependency<ProdDepType, OptionalDepType>, appPackageName: string): Promise<void>\n\n /**\n * Retrieves the dependency tree from the package manager.\n *\n * Executes the appropriate package manager command to fetch the dependency tree and writes\n * the output to a temporary file. Includes retry logic to handle transient failures such as\n * incomplete JSON output or missing files. Will retry up to 1 time with exponential backoff.\n */\n protected async getDependenciesTree(pm: PM): Promise<ProdDepType> {\n const command = getPackageManagerCommand(pm)\n const args = this.getArgs()\n\n const tempOutputFile = await this.tempDirManager.getTempFile({\n prefix: path.basename(command, path.extname(command)),\n suffix: \"output.json\",\n })\n\n return retry(\n async () => {\n await this.streamCollectorCommandToFile(command, args, this.rootDir, tempOutputFile)\n const shellOutput = await _fsExtra.readFile(tempOutputFile, { encoding: \"utf8\" })\n const result = await Promise.resolve(this.parseDependenciesTree(shellOutput))\n return result\n },\n {\n retries: 1,\n interval: 2000,\n backoff: 2000,\n shouldRetry: async (error: any) => {\n const fields: Record<string, string> = { error: error.message, tempOutputFile, cwd: this.rootDir, packageManager: pm }\n\n if (!(await exists(tempOutputFile))) {\n log.debug(fields, \"dependency tree output file missing, retrying\")\n return true\n }\n\n const fileContent = await _fsExtra.readFile(tempOutputFile, { encoding: \"utf8\" })\n fields.fileContentLength = fileContent.length.toString()\n\n if (fileContent.trim().length === 0) {\n log.debug(fields, \"dependency tree output file empty, retrying\")\n return true\n }\n\n // extract small start/end sample for debugging purposes (e.g. polluted console output)\n const lines = fileContent.split(\"\\n\")\n const lineSampleSize = Math.min(5, lines.length / 2)\n if (2 * lineSampleSize > 5) {\n fields.sampleStart = lines.slice(0, lineSampleSize).join(\"\\n\")\n fields.sampleEnd = lines.slice(-lineSampleSize).join(\"\\n\")\n } else {\n fields.content = fileContent\n }\n\n // Both indicate truncated/polluted PM output (a transient that re-running the command clears).\n if (error.message?.includes(\"Unexpected end of JSON input\") || error.message?.includes(\"No JSON content found in output\")) {\n log.debug(fields, \"JSON parse error in dependency tree, retrying\")\n return true\n }\n\n log.error(fields, \"error parsing dependencies tree\")\n return false\n },\n }\n )\n }\n\n /**\n * Parses the dependencies tree from shell command output.\n *\n **/\n protected parseDependenciesTree(shellOutput: string): ProdDepType | Promise<ProdDepType> {\n return this.extractJsonFromPollutedOutput<ProdDepType>(shellOutput)\n }\n\n protected extractJsonFromPollutedOutput<T>(shellOutput: string): T {\n const consoleOutput = shellOutput.trim()\n try {\n // Please for the love of all that is holy, this should cover 99% of cases where npm/pnpm/yarn output is clean JSON\n return JSON.parse(consoleOutput)\n } catch {\n // ignore\n }\n\n // DEDICATED FALLBACK FOR POLLUTED OUTPUT, non-trivial to implement correctly, not needed in most cases, and highly inefficient\n\n // Find the first index that starts with { or [\n const bracketOpen = Math.max(consoleOutput.indexOf(\"{\"), 0)\n const bracketOpenSquare = Math.max(consoleOutput.indexOf(\"[\"), 0)\n const start = Math.min(bracketOpen, bracketOpenSquare) // always non-negative due to Math.max above\n\n for (let i = start; i < consoleOutput.length; i++) {\n const slice = consoleOutput.slice(start, i + 1)\n try {\n return JSON.parse(slice)\n } catch {\n // ignore, try next\n }\n }\n throw new Error(\"No JSON content found in output\")\n }\n\n protected cacheKey(pkg: Pick<ProdDepType, \"name\" | \"version\" | \"path\">): string {\n const rel = path.relative(this.rootDir, pkg.path)\n return `${pkg.name}::${pkg.version}::${rel ?? \".\"}`\n }\n\n // We use the key (alias name) instead of value.name for npm aliased packages\n // e.g., { \"foo\": { name: \"@scope/bar\", ... } } should be stored as \"foo@version\"\n protected normalizePackageVersion(key: string, pkg: ProdDepType) {\n return { id: `${key}@${pkg.version}`, pkgOverride: { ...pkg, name: key } }\n }\n\n /**\n * Determines if a given dependency is a production dependency of a package.\n *\n * Checks both the dependencies and optionalDependencies of a package to see if\n * the specified dependency name is listed.\n *\n * @param depName - The name of the dependency to check\n * @param pkg - The package to search for the dependency in\n * @returns True if the dependency is found in either dependencies or optionalDependencies, false otherwise\n */\n protected isProdDependency(depName: string, pkg: ProdDepType): boolean {\n const prodDeps = { ...pkg.dependencies, ...pkg.optionalDependencies }\n return prodDeps[depName] != null\n }\n\n protected async locatePackageWithVersion(depTree: Pick<ProdDepType, \"name\" | \"version\" | \"path\">): Promise<{ packageDir: string; packageJson: PackageJson } | null> {\n const result = await this.cache.locatePackageVersion({\n parentDir: depTree.path,\n pkgName: depTree.name,\n requiredRange: depTree.version,\n })\n return result\n }\n /**\n * Parses a dependency identifier string into name and version components.\n *\n * Handles both scoped packages (e.g., \"@scope/pkg@1.2.3\") and regular packages (e.g., \"pkg@1.2.3\").\n * If the identifier is malformed or cannot be parsed, defaults to treating the entire string as\n * the package name with an \"unknown\" version.\n */\n protected parseNameVersion(identifier: string): { name: string; version: string } {\n let at: number\n if (identifier.startsWith(\"@\")) {\n // Scoped package: find the version separator after the scope (e.g. \"@scope/pkg@1.2.3\")\n const slashIndex = identifier.indexOf(\"/\")\n if (slashIndex === -1) {\n return { name: identifier, version: \"unknown\" }\n }\n at = identifier.indexOf(\"@\", slashIndex + 1)\n } else {\n at = identifier.indexOf(\"@\")\n }\n if (at <= 0) {\n return { name: identifier, version: \"unknown\" }\n }\n return { name: identifier.slice(0, at), version: identifier.slice(at + 1) }\n }\n\n /**\n * Retrieves the dependency tree and handles workspace package self-references.\n *\n * If the project is a workspace project, this method removes the root package's self-reference\n * from the dependency tree to avoid circular dependencies. It promotes the root package's\n * direct dependencies to the top level of the tree.\n *\n * @param tree - The original dependency tree\n * @param packageName - The name of the package to check for and remove from the tree\n * @returns The extracted dependency subtree\n */\n protected getTreeFromWorkspaces(tree: ProdDepType, packageName: string): ProdDepType {\n if (tree.workspaces && tree.dependencies) {\n for (const [key, value] of Object.entries(tree.dependencies)) {\n if (key === packageName) {\n return value\n }\n }\n }\n\n return tree\n }\n\n private transformToHoisterTree(obj: DependencyGraph, key: string, nodes: Map<string, HoisterTree> = new Map()): HoisterTree {\n let node = nodes.get(key)\n const { name, version } = this.parseNameVersion(key)\n\n if (!node) {\n node = {\n name,\n identName: name,\n reference: version,\n dependencies: new Set<HoisterTree>(),\n peerNames: new Set<string>(),\n }\n\n nodes.set(key, node)\n\n const deps = (obj[key] || {}).dependencies || []\n for (const dep of deps) {\n const child = this.transformToHoisterTree(obj, dep, nodes)\n node.dependencies.add(child)\n }\n }\n\n return node\n }\n\n private async _getNodeModules(dependencies: Set<HoisterResult>, result: NodeModuleInfo[], archFilter?: ArchFilter) {\n if (dependencies.size === 0) {\n return\n }\n\n for (const d of dependencies.values()) {\n const reference = [...d.references][0]\n const key = `${d.name}@${reference}`\n // Normalize the path to handle mixed separators from pnpm JSON output on Windows\n const rawPath = this.allDependencies.get(key)?.path\n const p = rawPath != null ? path.normalize(rawPath) : undefined\n if (p === undefined) {\n this.cache.logSummary[LogMessageByKey.PKG_NOT_FOUND].push(key)\n continue\n }\n\n // fix npm list issue\n // https://github.com/npm/cli/issues/8535\n if (!(await this.cache.exists[p])) {\n this.logMissingDependency(key)\n continue\n }\n\n const dir = await this.cache.realPath[p]\n\n // Drop packages whose declared `cpu`/`os` is incompatible with the target arch/platform (and their\n // subtree). npm/pnpm install only the host's platform-specific optional packages, so without this an\n // arm64-only binary (e.g. `@esbuild/darwin-arm64`) would be bundled into the x64 build too — and into\n // both slices of a universal build, which `@electron/universal` then refuses to merge. Reuses the\n // memoized `package.json` cache populated during collection.\n if (archFilter != null) {\n const pkgJson = await this.cache.json[path.join(dir, \"package.json\")]\n if (pkgJson != null && !isPackageCompatible(pkgJson, archFilter.cpu, archFilter.os)) {\n this.cache.logSummary[LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM].push(key)\n continue\n }\n }\n\n const node: NodeModuleInfo = {\n name: d.name,\n version: reference,\n dir,\n }\n result.push(node)\n if (d.dependencies.size > 0) {\n node.dependencies = []\n await this._getNodeModules(d.dependencies, node.dependencies, archFilter)\n }\n }\n result.sort((a, b) => a.name.localeCompare(b.name))\n }\n\n protected logMissingDependency(pkgName: string) {\n const PLATFORM_PACKAGE_RE = /(linux|win32|darwin|freebsd|android)[-_](x64|arm64|ia32|arm|ppc64|s390x|loong64|riscv64|universal)/\n const diskLogKey = PLATFORM_PACKAGE_RE.test(pkgName) ? LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED : LogMessageByKey.PKG_NOT_ON_DISK\n this.cache.logSummary[diskLogKey].push(pkgName)\n }\n\n protected async asyncExec(command: string, args: string[], cwd: string = this.rootDir): Promise<{ stdout: string | undefined; stderr: string | undefined }> {\n const file = await this.tempDirManager.getTempFile({ prefix: \"exec-\", suffix: \".txt\" })\n try {\n await this.streamCollectorCommandToFile(command, args, cwd, file)\n const result = await _fsExtra.readFile(file, { encoding: \"utf8\" })\n return { stdout: result?.trim(), stderr: undefined }\n } catch (error: any) {\n log.debug({ error: error.message }, \"failed to execute command\")\n return { stdout: undefined, stderr: error.message }\n }\n }\n\n /**\n * Executes a package-manager command and streams its stdout to a file.\n *\n * Delegates the spawn/stream/flush mechanics (including the Windows `powershell.exe -EncodedCommand`\n * wrapping) to {@link streamSpawnToFile}, and layers on the collector-specific interpretation of the\n * result: corepack is silenced for these invocations, `npm list` exit code 1 is tolerated, and any\n * stderr is surfaced as a collector warning only when the exit code is genuinely unexpected.\n *\n * @param command - The command to execute\n * @param args - Array of command-line arguments\n * @param cwd - The working directory to execute the command in\n * @param tempOutputFile - The path to the temporary file where stdout will be written\n * @returns Promise that resolves when the command completes successfully or rejects if it fails\n * @throws {Error} If the child process spawn fails or exits with a non-zero, unexpected code\n */\n protected async streamCollectorCommandToFile(command: string, args: string[], cwd: string, tempOutputFile: string) {\n // Derive execName from the original command so the npm-list shouldIgnore check below keys off the\n // real invocation (e.g. \"npm\"), not the \"powershell\" wrapper streamSpawnToFile uses on Windows.\n const execName = path.basename(command, path.extname(command))\n\n const { code, stderr } = await streamSpawnToFile(command, args, cwd, tempOutputFile, {\n // Package manager invocations do not need signing/publishing credentials. Silence corepack:\n // strict=0 so a project's `packageManager` pin can't abort our read-only queries, and the\n // download prompt/notice off so corepack doesn't flood stdout/stderr with activation chatter.\n ...stripSensitiveEnvVars(process.env),\n COREPACK_ENABLE_STRICT: \"0\",\n COREPACK_ENABLE_DOWNLOAD_PROMPT: \"0\",\n })\n\n // https://github.com/npm/npm/issues/17624\n const shouldIgnore = code === 1 && \"npm\" === execName.toLowerCase() && args.includes(\"list\")\n if (shouldIgnore) {\n log.debug(null, \"`npm list` returned non-zero exit code, but it MIGHT be expected (https://github.com/npm/npm/issues/17624). Check stderr for details.\")\n }\n if (stderr.length > 0) {\n log.debug({ stderr }, \"note: there was node module collector output on stderr\")\n // Only surface stderr as a user-visible warning when the exit code itself is unexpected.\n // When shouldIgnore is true (npm list exit code 1) the stderr is an anticipated side\n // effect of package-manager features like yarn resolutions or npm overrides that cause\n // npm to report ELSPROBLEMS for aliased packages it considers \"invalid\".\n if (!shouldIgnore) {\n this.cache.logSummary[LogMessageByKey.PKG_COLLECTOR_OUTPUT].push(stderr)\n }\n }\n if (code !== 0 && !shouldIgnore) {\n throw new Error(`Node module collector process exited with code ${code}:\\n${stderr}`)\n }\n }\n}\n"]}
1
+ {"version":3,"file":"nodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/nodeModulesCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,qBAAqB,EAAU,MAAM,cAAc,CAAA;AAChF,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAwC,MAAM,YAAY,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAM,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAQ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;QAEF,0CAA0C;QAC1C,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,QAAQ,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC5F,IAAI,YAAY,EAAE,CAAC;YACjB,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,uIAAuI,CAAC,CAAA;QAC1J,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,wDAAwD,CAAC,CAAA;YAC/E,yFAAyF;YACzF,qFAAqF;YACrF,uFAAuF;YACvF,yEAAyE;YACzE,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC1E,CAAC;QACH,CAAC;QACD,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kDAAkD,IAAI,MAAM,MAAM,EAAE,CAAC,CAAA;QACvF,CAAC;IACH,CAAC;CACF","sourcesContent":["import { exists, log, retry, stripSensitiveEnvVars, TmpDir } from \"builder-util\"\nimport _fsExtra from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { hoist, type HoisterResult, type HoisterTree } from \"./hoist.js\"\nimport { LogMessageByKey, ModuleManager } from \"./moduleManager.js\"\nimport { getPackageManagerCommand, PM } from \"./packageManager.js\"\nimport { streamSpawnToFile } from \"../util/streamSpawnToFile.js\"\nimport type { Dependency, DependencyGraph, NodeModuleInfo, PackageJson } from \"./types.js\"\nimport { isPackageCompatible } from \"../util/archCompatibility.js\"\n\n/** Target arch/platform used to drop `cpu`/`os`-incompatible packages while collecting. */\nexport interface ArchFilter {\n cpu: string | null\n os: string\n}\n\nexport abstract class NodeModulesCollector<ProdDepType extends Dependency<ProdDepType, OptionalDepType>, OptionalDepType> {\n private readonly nodeModules: NodeModuleInfo[] = []\n protected readonly allDependencies: Map<string, ProdDepType> = new Map()\n protected readonly productionGraph: DependencyGraph = {}\n protected readonly cache: ModuleManager = new ModuleManager()\n\n protected isHoisted = new Lazy<boolean>(async () => {\n const { manager } = this.installOptions\n const command = getPackageManagerCommand(manager)\n const config = (await this.asyncExec(command, [\"config\", \"list\"])).stdout\n if (config == null) {\n log.debug({ manager }, \"unable to determine node-linker setting; assuming non-hoisted (virtual store) layout\")\n return false\n }\n const lines = Object.fromEntries(config.split(\"\\n\").map(line => line.split(\"=\").map(s => s.trim())))\n if (lines[\"node-linker\"] === \"hoisted\") {\n log.debug({ manager }, \"node_modules are hoisted\")\n return true\n }\n return false\n })\n\n constructor(\n protected readonly rootDir: string,\n private readonly tempDirManager: TmpDir\n ) {}\n\n /**\n * Retrieves and collects all Node.js modules for a given package.\n *\n * This method orchestrates the entire module collection process by:\n * 1. Fetching the dependency tree from the package manager\n * 2. Collecting all dependencies recursively\n * 3. Extracting workspace references if applicable\n * 4. Building a production dependency graph\n * 5. Hoisting the dependencies to their final locations\n * 6. Resolving and returning module information\n */\n public async getNodeModules({\n packageName,\n archFilter,\n ignoredDependencies,\n }: {\n packageName: string\n archFilter?: ArchFilter\n ignoredDependencies?: ReadonlyArray<string>\n }): Promise<{\n nodeModules: NodeModuleInfo[]\n logSummary: ModuleManager[\"logSummary\"]\n }> {\n const tree: ProdDepType = await this.getDependenciesTree(this.installOptions.manager)\n\n await this.collectAllDependencies(tree, packageName)\n const realTree: ProdDepType = this.getTreeFromWorkspaces(tree, packageName)\n await this.extractProductionDependencyGraph(realTree, packageName)\n\n this.markExcludedModules(this.productionGraph, packageName, ignoredDependencies ?? [])\n\n const hoisterResult: HoisterResult = hoist(this.transformToHoisterTree(this.productionGraph, packageName), {\n check: log.isDebugEnabled,\n })\n\n await this._getNodeModules(hoisterResult.dependencies, this.nodeModules, archFilter)\n\n log.debug({ packageName, depCount: this.nodeModules.length }, \"node modules collection complete\")\n\n return { nodeModules: this.nodeModules, logSummary: this.cache.logSummary }\n }\n\n public abstract readonly installOptions: {\n manager: PM\n lockfile: string\n }\n\n protected abstract getArgs(): string[]\n protected abstract extractProductionDependencyGraph(tree: Dependency<ProdDepType, OptionalDepType>, dependencyId: string): Promise<void>\n protected abstract collectAllDependencies(tree: Dependency<ProdDepType, OptionalDepType>, appPackageName: string): Promise<void>\n\n /**\n * Retrieves the dependency tree from the package manager.\n *\n * Executes the appropriate package manager command to fetch the dependency tree and writes\n * the output to a temporary file. Includes retry logic to handle transient failures such as\n * incomplete JSON output or missing files. Will retry up to 1 time with exponential backoff.\n */\n protected async getDependenciesTree(pm: PM): Promise<ProdDepType> {\n const command = getPackageManagerCommand(pm)\n const args = this.getArgs()\n\n const tempOutputFile = await this.tempDirManager.getTempFile({\n prefix: path.basename(command, path.extname(command)),\n suffix: \"output.json\",\n })\n\n return retry(\n async () => {\n await this.streamCollectorCommandToFile(command, args, this.rootDir, tempOutputFile)\n const shellOutput = await _fsExtra.readFile(tempOutputFile, { encoding: \"utf8\" })\n const result = await Promise.resolve(this.parseDependenciesTree(shellOutput))\n return result\n },\n {\n retries: 1,\n interval: 2000,\n backoff: 2000,\n shouldRetry: async (error: any) => {\n const fields: Record<string, string> = { error: error.message, tempOutputFile, cwd: this.rootDir, packageManager: pm }\n\n if (!(await exists(tempOutputFile))) {\n log.debug(fields, \"dependency tree output file missing, retrying\")\n return true\n }\n\n const fileContent = await _fsExtra.readFile(tempOutputFile, { encoding: \"utf8\" })\n fields.fileContentLength = fileContent.length.toString()\n\n if (fileContent.trim().length === 0) {\n log.debug(fields, \"dependency tree output file empty, retrying\")\n return true\n }\n\n // extract small start/end sample for debugging purposes (e.g. polluted console output)\n const lines = fileContent.split(\"\\n\")\n const lineSampleSize = Math.min(5, lines.length / 2)\n if (2 * lineSampleSize > 5) {\n fields.sampleStart = lines.slice(0, lineSampleSize).join(\"\\n\")\n fields.sampleEnd = lines.slice(-lineSampleSize).join(\"\\n\")\n } else {\n fields.content = fileContent\n }\n\n // Both indicate truncated/polluted PM output (a transient that re-running the command clears).\n if (error.message?.includes(\"Unexpected end of JSON input\") || error.message?.includes(\"No JSON content found in output\")) {\n log.debug(fields, \"JSON parse error in dependency tree, retrying\")\n return true\n }\n\n log.error(fields, \"error parsing dependencies tree\")\n return false\n },\n }\n )\n }\n\n /**\n * Parses the dependencies tree from shell command output.\n *\n **/\n protected parseDependenciesTree(shellOutput: string): ProdDepType | Promise<ProdDepType> {\n return this.extractJsonFromPollutedOutput<ProdDepType>(shellOutput)\n }\n\n protected extractJsonFromPollutedOutput<T>(shellOutput: string): T {\n const consoleOutput = shellOutput.trim()\n try {\n // Please for the love of all that is holy, this should cover 99% of cases where npm/pnpm/yarn output is clean JSON\n return JSON.parse(consoleOutput)\n } catch {\n // ignore\n }\n\n // DEDICATED FALLBACK FOR POLLUTED OUTPUT, non-trivial to implement correctly, not needed in most cases, and highly inefficient\n\n // Find the first index that starts with { or [\n const bracketOpen = Math.max(consoleOutput.indexOf(\"{\"), 0)\n const bracketOpenSquare = Math.max(consoleOutput.indexOf(\"[\"), 0)\n const start = Math.min(bracketOpen, bracketOpenSquare) // always non-negative due to Math.max above\n\n for (let i = start; i < consoleOutput.length; i++) {\n const slice = consoleOutput.slice(start, i + 1)\n try {\n return JSON.parse(slice)\n } catch {\n // ignore, try next\n }\n }\n throw new Error(\"No JSON content found in output\")\n }\n\n protected cacheKey(pkg: Pick<ProdDepType, \"name\" | \"version\" | \"path\">): string {\n const rel = path.relative(this.rootDir, pkg.path)\n return `${pkg.name}::${pkg.version}::${rel ?? \".\"}`\n }\n\n // We use the key (alias name) instead of value.name for npm aliased packages\n // e.g., { \"foo\": { name: \"@scope/bar\", ... } } should be stored as \"foo@version\"\n protected normalizePackageVersion(key: string, pkg: ProdDepType) {\n return { id: `${key}@${pkg.version}`, pkgOverride: { ...pkg, name: key } }\n }\n\n /**\n * Determines if a given dependency is a production dependency of a package.\n *\n * Checks both the dependencies and optionalDependencies of a package to see if\n * the specified dependency name is listed.\n *\n * @param depName - The name of the dependency to check\n * @param pkg - The package to search for the dependency in\n * @returns True if the dependency is found in either dependencies or optionalDependencies, false otherwise\n */\n protected isProdDependency(depName: string, pkg: ProdDepType): boolean {\n const prodDeps = { ...pkg.dependencies, ...pkg.optionalDependencies }\n return prodDeps[depName] != null\n }\n\n protected async locatePackageWithVersion(depTree: Pick<ProdDepType, \"name\" | \"version\" | \"path\">): Promise<{ packageDir: string; packageJson: PackageJson } | null> {\n const result = await this.cache.locatePackageVersion({\n parentDir: depTree.path,\n pkgName: depTree.name,\n requiredRange: depTree.version,\n })\n return result\n }\n /**\n * Parses a dependency identifier string into name and version components.\n *\n * Handles both scoped packages (e.g., \"@scope/pkg@1.2.3\") and regular packages (e.g., \"pkg@1.2.3\").\n * If the identifier is malformed or cannot be parsed, defaults to treating the entire string as\n * the package name with an \"unknown\" version.\n */\n protected parseNameVersion(identifier: string): { name: string; version: string } {\n let at: number\n if (identifier.startsWith(\"@\")) {\n // Scoped package: find the version separator after the scope (e.g. \"@scope/pkg@1.2.3\")\n const slashIndex = identifier.indexOf(\"/\")\n if (slashIndex === -1) {\n return { name: identifier, version: \"unknown\" }\n }\n at = identifier.indexOf(\"@\", slashIndex + 1)\n } else {\n at = identifier.indexOf(\"@\")\n }\n if (at <= 0) {\n return { name: identifier, version: \"unknown\" }\n }\n return { name: identifier.slice(0, at), version: identifier.slice(at + 1) }\n }\n\n /**\n * Retrieves the dependency tree and handles workspace package self-references.\n *\n * If the project is a workspace project, this method removes the root package's self-reference\n * from the dependency tree to avoid circular dependencies. It promotes the root package's\n * direct dependencies to the top level of the tree.\n *\n * @param tree - The original dependency tree\n * @param packageName - The name of the package to check for and remove from the tree\n * @returns The extracted dependency subtree\n */\n protected getTreeFromWorkspaces(tree: ProdDepType, packageName: string): ProdDepType {\n if (tree.workspaces && tree.dependencies) {\n for (const [key, value] of Object.entries(tree.dependencies)) {\n if (key === packageName) {\n return value\n }\n }\n }\n\n return tree\n }\n\n /**\n * Flags which modules must be omitted from the *copied* app output for the given `ignoredNames` by\n * setting an `excluded` marker on the pre-hoist graph nodes.\n *\n * Only a *top-level* production dependency (one the app itself declares) can be excluded, together\n * with its exclusively-owned transitive subtree. A package that is merely a transitive dependency of\n * a non-excluded production dependency is never excluded, even if its name is in `ignoredNames`:\n * only the root's own edges to ignored names are severed, so anything still reachable through another\n * production dependency stays reachable and is kept.\n *\n * Runs on the pre-hoist graph, where the true parent->child edges still exist, so a shared (deduped)\n * transitive dependency remains reachable and is kept while an ignored package's exclusive subtree\n * becomes unreachable and is flagged.\n */\n private markExcludedModules(graph: DependencyGraph, rootId: string, ignoredNames: ReadonlyArray<string>): void {\n const ignored = new Set(ignoredNames)\n if (ignored.size === 0) {\n return\n }\n\n const rootDeps = graph[rootId]?.dependencies ?? []\n const ignoredRootEdges = new Set(rootDeps.filter(dep => ignored.has(this.parseNameVersion(dep).name)))\n if (ignoredRootEdges.size === 0) {\n return\n }\n\n const reachable = new Set<string>()\n const stack: string[] = [rootId]\n while (stack.length > 0) {\n const id = stack.pop()!\n if (reachable.has(id)) {\n continue\n }\n reachable.add(id)\n const node = graph[id]\n if (node != null) {\n for (const dep of node.dependencies) {\n if (id === rootId && ignoredRootEdges?.has(dep)) {\n continue\n }\n if (!reachable.has(dep)) {\n stack.push(dep)\n }\n }\n }\n }\n for (const id of Object.keys(graph)) {\n if (!reachable.has(id)) {\n graph[id].excluded = true\n }\n }\n\n // Only directly-declared deps that actually ended up excluded (i.e. not still reachable via a kept\n // dependency) are surfaced to the user; their exclusive transitive subtree is omitted from the log.\n // Report the full `name@version` graph id — like the other logSummary buckets — so the log stays\n // truthful when another version of the same name still ships via a kept dependency (e.g. `debug@4`\n // excluded while `debug@3` remains bundled).\n const topLevelExcluded = new Set<string>()\n for (const dep of ignoredRootEdges) {\n if (!reachable.has(dep)) {\n topLevelExcluded.add(dep)\n }\n }\n if (topLevelExcluded.size > 0) {\n this.cache.logSummary[LogMessageByKey.PKG_EXCLUDED_IGNORED].push(...Array.from(topLevelExcluded).sort())\n }\n }\n\n private transformToHoisterTree(obj: DependencyGraph, key: string, nodes: Map<string, HoisterTree> = new Map()): HoisterTree {\n let node = nodes.get(key)\n const { name, version } = this.parseNameVersion(key)\n\n if (!node) {\n node = {\n name,\n identName: name,\n reference: version,\n dependencies: new Set<HoisterTree>(),\n peerNames: new Set<string>(),\n }\n\n nodes.set(key, node)\n\n const deps = (obj[key] || {}).dependencies || []\n for (const dep of deps) {\n const child = this.transformToHoisterTree(obj, dep, nodes)\n node.dependencies.add(child)\n }\n }\n\n return node\n }\n\n private async _getNodeModules(dependencies: Set<HoisterResult>, result: NodeModuleInfo[], archFilter?: ArchFilter) {\n if (dependencies.size === 0) {\n return\n }\n\n for (const d of dependencies.values()) {\n const reference = [...d.references][0]\n const key = `${d.name}@${reference}`\n // Normalize the path to handle mixed separators from pnpm JSON output on Windows\n const rawPath = this.allDependencies.get(key)?.path\n const p = rawPath != null ? path.normalize(rawPath) : undefined\n if (p === undefined) {\n this.cache.logSummary[LogMessageByKey.PKG_NOT_FOUND].push(key)\n continue\n }\n\n // fix npm list issue\n // https://github.com/npm/cli/issues/8535\n if (!(await this.cache.exists[p])) {\n this.logMissingDependency(key)\n continue\n }\n\n const dir = await this.cache.realPath[p]\n\n // Drop packages whose declared `cpu`/`os` is incompatible with the target arch/platform (and their\n // subtree). npm/pnpm install only the host's platform-specific optional packages, so without this an\n // arm64-only binary (e.g. `@esbuild/darwin-arm64`) would be bundled into the x64 build too — and into\n // both slices of a universal build, which `@electron/universal` then refuses to merge. Reuses the\n // memoized `package.json` cache populated during collection.\n if (archFilter != null) {\n const pkgJson = await this.cache.json[path.join(dir, \"package.json\")]\n if (pkgJson != null && !isPackageCompatible(pkgJson, archFilter.cpu, archFilter.os)) {\n this.cache.logSummary[LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM].push(key)\n continue\n }\n }\n\n const node: NodeModuleInfo = {\n name: d.name,\n version: reference,\n dir,\n excluded: this.productionGraph[key]?.excluded,\n }\n result.push(node)\n if (d.dependencies.size > 0) {\n node.dependencies = []\n await this._getNodeModules(d.dependencies, node.dependencies, archFilter)\n }\n }\n result.sort((a, b) => a.name.localeCompare(b.name))\n }\n\n protected logMissingDependency(pkgName: string) {\n const PLATFORM_PACKAGE_RE = /(linux|win32|darwin|freebsd|android)[-_](x64|arm64|ia32|arm|ppc64|s390x|loong64|riscv64|universal)/\n const diskLogKey = PLATFORM_PACKAGE_RE.test(pkgName) ? LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED : LogMessageByKey.PKG_NOT_ON_DISK\n this.cache.logSummary[diskLogKey].push(pkgName)\n }\n\n protected async asyncExec(command: string, args: string[], cwd: string = this.rootDir): Promise<{ stdout: string | undefined; stderr: string | undefined }> {\n const file = await this.tempDirManager.getTempFile({ prefix: \"exec-\", suffix: \".txt\" })\n try {\n await this.streamCollectorCommandToFile(command, args, cwd, file)\n const result = await _fsExtra.readFile(file, { encoding: \"utf8\" })\n return { stdout: result?.trim(), stderr: undefined }\n } catch (error: any) {\n log.debug({ error: error.message }, \"failed to execute command\")\n return { stdout: undefined, stderr: error.message }\n }\n }\n\n /**\n * Executes a package-manager command and streams its stdout to a file.\n *\n * Delegates the spawn/stream/flush mechanics (including the Windows `powershell.exe -EncodedCommand`\n * wrapping) to {@link streamSpawnToFile}, and layers on the collector-specific interpretation of the\n * result: corepack is silenced for these invocations, `npm list` exit code 1 is tolerated, and any\n * stderr is surfaced as a collector warning only when the exit code is genuinely unexpected.\n *\n * @param command - The command to execute\n * @param args - Array of command-line arguments\n * @param cwd - The working directory to execute the command in\n * @param tempOutputFile - The path to the temporary file where stdout will be written\n * @returns Promise that resolves when the command completes successfully or rejects if it fails\n * @throws {Error} If the child process spawn fails or exits with a non-zero, unexpected code\n */\n protected async streamCollectorCommandToFile(command: string, args: string[], cwd: string, tempOutputFile: string) {\n // Derive execName from the original command so the npm-list shouldIgnore check below keys off the\n // real invocation (e.g. \"npm\"), not the \"powershell\" wrapper streamSpawnToFile uses on Windows.\n const execName = path.basename(command, path.extname(command))\n\n const { code, stderr } = await streamSpawnToFile(command, args, cwd, tempOutputFile, {\n // Package manager invocations do not need signing/publishing credentials. Silence corepack:\n // strict=0 so a project's `packageManager` pin can't abort our read-only queries, and the\n // download prompt/notice off so corepack doesn't flood stdout/stderr with activation chatter.\n ...stripSensitiveEnvVars(process.env),\n COREPACK_ENABLE_STRICT: \"0\",\n COREPACK_ENABLE_DOWNLOAD_PROMPT: \"0\",\n })\n\n // https://github.com/npm/npm/issues/17624\n const shouldIgnore = code === 1 && \"npm\" === execName.toLowerCase() && args.includes(\"list\")\n if (shouldIgnore) {\n log.debug(null, \"`npm list` returned non-zero exit code, but it MIGHT be expected (https://github.com/npm/npm/issues/17624). Check stderr for details.\")\n }\n if (stderr.length > 0) {\n log.debug({ stderr }, \"note: there was node module collector output on stderr\")\n // Only surface stderr as a user-visible warning when the exit code itself is unexpected.\n // When shouldIgnore is true (npm list exit code 1) the stderr is an anticipated side\n // effect of package-manager features like yarn resolutions or npm overrides that cause\n // npm to report ELSPROBLEMS for aliased packages it considers \"invalid\".\n if (!shouldIgnore) {\n this.cache.logSummary[LogMessageByKey.PKG_COLLECTOR_OUTPUT].push(stderr)\n }\n }\n if (code !== 0 && !shouldIgnore) {\n throw new Error(`Node module collector process exited with code ${code}:\\n${stderr}`)\n }\n }\n}\n"]}
@@ -16,6 +16,7 @@ export interface NodeModuleInfo {
16
16
  version: string;
17
17
  dir: string;
18
18
  dependencies?: Array<NodeModuleInfo>;
19
+ excluded?: boolean;
19
20
  }
20
21
  export type ParsedDependencyTree = {
21
22
  readonly name: string;
@@ -50,6 +51,7 @@ export type Dependencies<T, V> = {
50
51
  export interface DependencyGraph {
51
52
  [packageNameAndVersion: string]: {
52
53
  readonly dependencies: string[];
54
+ excluded?: boolean;
53
55
  };
54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EAAE,MAAM,GAAG,MAAM,CAAA;KAC9B,CAAA;CACF;AAGD,MAAM,WAAW,mBAAoB,SAAQ,UAAU,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAAG;AAEpG,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,oBAAoB,CAAA;AAExE,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtB,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,CAAA;KACzB,CAAA;IACD,QAAQ,CAAC,oBAAoB,CAAC,EAAE;QAC9B,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,CAAA;KACzB,CAAA;CACF,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,qBAAqB,EAAE,MAAM,GAAG;QAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;QAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/node-module-collector/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PackageJson = {\n name: string\n version: string\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n peerDependencies?: Record<string, string>\n optionalDependencies?: Record<string, string>\n workspaces?: string[] | { packages: string[] }\n // npm platform constraints (e.g. `@esbuild/darwin-arm64` declares `cpu: [\"arm64\"], os: [\"darwin\"]`)\n os?: string | string[]\n cpu?: string | string[]\n}\n\nexport interface NodeModuleInfo {\n name: string\n version: string\n dir: string\n dependencies?: Array<NodeModuleInfo>\n}\n\nexport type ParsedDependencyTree = {\n readonly name: string\n readonly version: string\n readonly path: string\n readonly workspaces?: string[] | { packages: string[] } // we only use this at root level\n}\n\n// Note: `PnpmDependency` and `NpmDependency` include the output of `JSON.parse(...)` of `pnpm list` and `npm list` respectively\n// This object has a TON of info - a majority, if not all, of each dependency's package.json\n// We extract only what we need when constructing DependencyTree in `extractProductionDependencyTree`\nexport interface PnpmDependency extends Dependency<PnpmDependency, PnpmDependency> {\n readonly from: string\n readonly resolved: string\n // Present in pnpm 10.29.3+ `pnpm list --json` output for deduped references.\n // Context: https://github.com/pnpm/pnpm/issues/10601\n readonly dedupedDependenciesCount?: number\n}\n\nexport interface NpmDependency extends Dependency<NpmDependency, string> {\n readonly resolved?: string\n // implicit dependencies, returned only through `npm list`\n readonly _dependencies?: {\n [packageName: string]: string\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TraversedDependency extends Dependency<TraversedDependency, TraversedDependency> {}\n\nexport type Dependency<T, V> = Dependencies<T, V> & ParsedDependencyTree\n\nexport type Dependencies<T, V> = {\n readonly dependencies?: {\n [packageName: string]: T\n }\n readonly optionalDependencies?: {\n [packageName: string]: V\n }\n}\n\nexport interface DependencyGraph {\n [packageNameAndVersion: string]: {\n readonly dependencies: string[]\n }\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/node-module-collector/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PackageJson = {\n name: string\n version: string\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n peerDependencies?: Record<string, string>\n optionalDependencies?: Record<string, string>\n workspaces?: string[] | { packages: string[] }\n // npm platform constraints (e.g. `@esbuild/darwin-arm64` declares `cpu: [\"arm64\"], os: [\"darwin\"]`)\n os?: string | string[]\n cpu?: string | string[]\n}\n\nexport interface NodeModuleInfo {\n name: string\n version: string\n dir: string\n dependencies?: Array<NodeModuleInfo>\n excluded?: boolean\n}\n\nexport type ParsedDependencyTree = {\n readonly name: string\n readonly version: string\n readonly path: string\n readonly workspaces?: string[] | { packages: string[] } // we only use this at root level\n}\n\n// Note: `PnpmDependency` and `NpmDependency` include the output of `JSON.parse(...)` of `pnpm list` and `npm list` respectively\n// This object has a TON of info - a majority, if not all, of each dependency's package.json\n// We extract only what we need when constructing DependencyTree in `extractProductionDependencyTree`\nexport interface PnpmDependency extends Dependency<PnpmDependency, PnpmDependency> {\n readonly from: string\n readonly resolved: string\n // Present in pnpm 10.29.3+ `pnpm list --json` output for deduped references.\n // Context: https://github.com/pnpm/pnpm/issues/10601\n readonly dedupedDependenciesCount?: number\n}\n\nexport interface NpmDependency extends Dependency<NpmDependency, string> {\n readonly resolved?: string\n // implicit dependencies, returned only through `npm list`\n readonly _dependencies?: {\n [packageName: string]: string\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TraversedDependency extends Dependency<TraversedDependency, TraversedDependency> {}\n\nexport type Dependency<T, V> = Dependencies<T, V> & ParsedDependencyTree\n\nexport type Dependencies<T, V> = {\n readonly dependencies?: {\n [packageName: string]: T\n }\n readonly optionalDependencies?: {\n [packageName: string]: V\n }\n}\n\nexport interface DependencyGraph {\n [packageNameAndVersion: string]: {\n readonly dependencies: string[]\n excluded?: boolean\n }\n}\n"]}
@@ -0,0 +1,126 @@
1
+ import { TargetSpecificOptions } from "../core.js";
2
+ export interface MsixWindowsService {
3
+ /** The service name used in the Windows Service Control Manager. */
4
+ readonly name: string;
5
+ /**
6
+ * Relative path to the service executable within the package.
7
+ * Defaults to the main app executable.
8
+ */
9
+ readonly executable?: string;
10
+ /**
11
+ * How Windows starts the service. Required by the desktop6 schema.
12
+ * @default "manual"
13
+ */
14
+ readonly startupType?: "auto" | "manual" | "disabled";
15
+ /**
16
+ * The account the service runs under. Required by the desktop6 schema.
17
+ * @default "localSystem"
18
+ */
19
+ readonly startAccount?: "localSystem" | "localService" | "networkService";
20
+ /**
21
+ * Optional command-line arguments passed to the service executable.
22
+ */
23
+ readonly arguments?: string;
24
+ }
25
+ export interface MsixOptions extends TargetSpecificOptions {
26
+ /**
27
+ * The application id. Defaults to `identityName`. This string contains alpha-numeric fields separated by periods.
28
+ * Each field must begin with an ASCII alphabetic character.
29
+ */
30
+ readonly applicationId?: string;
31
+ /**
32
+ * The background color of the app tile.
33
+ * @default #464646
34
+ */
35
+ readonly backgroundColor?: string | null;
36
+ /**
37
+ * A friendly name displayed to users. Corresponds to Properties.DisplayName. Defaults to the application product name.
38
+ */
39
+ readonly displayName?: string | null;
40
+ /**
41
+ * The package identity name. Corresponds to Identity.Name. Defaults to the application name.
42
+ */
43
+ readonly identityName?: string | null;
44
+ /**
45
+ * The Windows Store publisher. Not used if MSIX is built for testing.
46
+ */
47
+ readonly publisher?: string | null;
48
+ /**
49
+ * A friendly name for the publisher displayed to users. Corresponds to Properties.PublisherDisplayName.
50
+ * Defaults to company name from the application metadata.
51
+ */
52
+ readonly publisherDisplayName?: string | null;
53
+ /**
54
+ * The list of supported languages listed in the Windows Store. The first entry (index 0) will be the default language.
55
+ * @default ["en-US"]
56
+ */
57
+ readonly languages?: Array<string> | string | null;
58
+ /**
59
+ * Whether to add auto launch extension. Defaults to `true` if electron-winstore-auto-launch is in the dependencies.
60
+ */
61
+ readonly addAutoLaunchExtension?: boolean;
62
+ /**
63
+ * Relative path to custom extensions xml to be included in the AppxManifest.xml.
64
+ */
65
+ readonly customExtensionsPath?: string;
66
+ /**
67
+ * The list of capabilities to be added to the AppxManifest.xml.
68
+ * The `runFullTrust` capability is obligatory for Electron apps and will be auto-added if not specified.
69
+ * @default ["runFullTrust"]
70
+ */
71
+ readonly capabilities?: Array<string> | null;
72
+ /**
73
+ * Relative path to a custom AppxManifest.xml template located in the build resources directory.
74
+ * Supports the same `${}` template macros as the default template, including the MSIX-specific
75
+ * `${packageIntegrity}` macro. Windows services are injected via the `${extensions}` macro
76
+ * alongside protocol/file-association extensions.
77
+ */
78
+ readonly customManifestPath?: string;
79
+ /**
80
+ * Whether to overlay the app's name on top of tile images on the Start screen.
81
+ * @default false
82
+ */
83
+ readonly showNameOnTiles?: boolean;
84
+ /** @private */
85
+ readonly electronUpdaterAware?: boolean;
86
+ /**
87
+ * Whether to set the build number in the version field.
88
+ * @default false
89
+ */
90
+ readonly setBuildNumber?: boolean;
91
+ /**
92
+ * Set the MinVersion field in the AppxManifest.xml.
93
+ * @default "10.0.17763.0" (Windows 10 version 1809 — minimum for Store submissions)
94
+ */
95
+ readonly minVersion?: string | null;
96
+ /**
97
+ * Set the MaxVersionTested field in the AppxManifest.xml.
98
+ * @default same as minVersion
99
+ */
100
+ readonly maxVersionTested?: string | null;
101
+ /** @private */
102
+ readonly makeappxArgs?: Array<string> | null;
103
+ /**
104
+ * Whether to produce a .msixbundle when more than one architecture is built.
105
+ * @default true
106
+ */
107
+ readonly createMsixbundle?: boolean;
108
+ /**
109
+ * Whether to produce a .msixupload archive suitable for submission to the Microsoft Store Partner Center.
110
+ * @default false
111
+ */
112
+ readonly createMsixupload?: boolean;
113
+ /**
114
+ * Enforce package integrity (uap10:PackageIntegrity). Requires Windows 10 version 2004 (build 19041) or later.
115
+ * When enabled, Windows verifies that no files have been tampered with after the package was signed.
116
+ * @default false
117
+ */
118
+ readonly enforcePackageIntegrity?: boolean;
119
+ /**
120
+ * Windows Services to register with the MSIX package (desktop6 namespace).
121
+ * Requires Windows 10 version 1903 or later, and the `packagedServices` (or `localSystemServices`)
122
+ * restricted capability declared via `capabilities`.
123
+ */
124
+ readonly windowsServices?: Array<MsixWindowsService>;
125
+ }
126
+ //# sourceMappingURL=MsixOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MsixOptions.d.ts","sourceRoot":"","sources":["../../src/options/MsixOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAA;IACrD;;;OAGG;IACH,QAAQ,CAAC,YAAY,C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,MAAM,GAAG,IAAI,CAAA;IAEnC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzC,eAAe;IACf,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAE5C;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAEnC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAEnC;;;;OAIG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAA;IAE1C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;CACrD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MsixOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MsixOptions.js","sourceRoot":"","sources":["../../src/options/MsixOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core.js\"\n\nexport interface MsixWindowsService {\n /** The service name used in the Windows Service Control Manager. */\n readonly name: string\n /**\n * Relative path to the service executable within the package.\n * Defaults to the main app executable.\n */\n readonly executable?: string\n /**\n * How Windows starts the service. Required by the desktop6 schema.\n * @default \"manual\"\n */\n readonly startupType?: \"auto\" | \"manual\" | \"disabled\"\n /**\n * The account the service runs under. Required by the desktop6 schema.\n * @default \"localSystem\"\n */\n readonly startAccount?: \"localSystem\" | \"localService\" | \"networkService\"\n /**\n * Optional command-line arguments passed to the service executable.\n */\n readonly arguments?: string\n}\n\nexport interface MsixOptions extends TargetSpecificOptions {\n /**\n * The application id. Defaults to `identityName`. This string contains alpha-numeric fields separated by periods.\n * Each field must begin with an ASCII alphabetic character.\n */\n readonly applicationId?: string\n\n /**\n * The background color of the app tile.\n * @default #464646\n */\n readonly backgroundColor?: string | null\n\n /**\n * A friendly name displayed to users. Corresponds to Properties.DisplayName. Defaults to the application product name.\n */\n readonly displayName?: string | null\n\n /**\n * The package identity name. Corresponds to Identity.Name. Defaults to the application name.\n */\n readonly identityName?: string | null\n\n /**\n * The Windows Store publisher. Not used if MSIX is built for testing.\n */\n readonly publisher?: string | null\n\n /**\n * A friendly name for the publisher displayed to users. Corresponds to Properties.PublisherDisplayName.\n * Defaults to company name from the application metadata.\n */\n readonly publisherDisplayName?: string | null\n\n /**\n * The list of supported languages listed in the Windows Store. The first entry (index 0) will be the default language.\n * @default [\"en-US\"]\n */\n readonly languages?: Array<string> | string | null\n\n /**\n * Whether to add auto launch extension. Defaults to `true` if electron-winstore-auto-launch is in the dependencies.\n */\n readonly addAutoLaunchExtension?: boolean\n\n /**\n * Relative path to custom extensions xml to be included in the AppxManifest.xml.\n */\n readonly customExtensionsPath?: string\n\n /**\n * The list of capabilities to be added to the AppxManifest.xml.\n * The `runFullTrust` capability is obligatory for Electron apps and will be auto-added if not specified.\n * @default [\"runFullTrust\"]\n */\n readonly capabilities?: Array<string> | null\n\n /**\n * Relative path to a custom AppxManifest.xml template located in the build resources directory.\n * Supports the same `${}` template macros as the default template, including the MSIX-specific\n * `${packageIntegrity}` macro. Windows services are injected via the `${extensions}` macro\n * alongside protocol/file-association extensions.\n */\n readonly customManifestPath?: string\n\n /**\n * Whether to overlay the app's name on top of tile images on the Start screen.\n * @default false\n */\n readonly showNameOnTiles?: boolean\n\n /** @private */\n readonly electronUpdaterAware?: boolean\n\n /**\n * Whether to set the build number in the version field.\n * @default false\n */\n readonly setBuildNumber?: boolean\n\n /**\n * Set the MinVersion field in the AppxManifest.xml.\n * @default \"10.0.17763.0\" (Windows 10 version 1809 — minimum for Store submissions)\n */\n readonly minVersion?: string | null\n\n /**\n * Set the MaxVersionTested field in the AppxManifest.xml.\n * @default same as minVersion\n */\n readonly maxVersionTested?: string | null\n\n /** @private */\n readonly makeappxArgs?: Array<string> | null\n\n /**\n * Whether to produce a .msixbundle when more than one architecture is built.\n * @default true\n */\n readonly createMsixbundle?: boolean\n\n /**\n * Whether to produce a .msixupload archive suitable for submission to the Microsoft Store Partner Center.\n * @default false\n */\n readonly createMsixupload?: boolean\n\n /**\n * Enforce package integrity (uap10:PackageIntegrity). Requires Windows 10 version 2004 (build 19041) or later.\n * When enabled, Windows verifies that no files have been tampered with after the package was signed.\n * @default false\n */\n readonly enforcePackageIntegrity?: boolean\n\n /**\n * Windows Services to register with the MSIX package (desktop6 namespace).\n * Requires Windows 10 version 1903 or later, and the `packagedServices` (or `localSystemServices`)\n * restricted capability declared via `capabilities`.\n */\n readonly windowsServices?: Array<MsixWindowsService>\n}\n"]}
@@ -239,14 +239,14 @@ export interface DmgOptions extends TargetSpecificOptions {
239
239
  */
240
240
  contents?: Array<DmgContent>;
241
241
  /**
242
- * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).
242
+ * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)). `ULMO` (lzma-compressed image (macOS 10.15+ only)).
243
243
  * @default UDZO
244
244
  */
245
- format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
245
+ format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO" | "ULMO";
246
246
  /**
247
247
  * The filesystem for the DMG volume (e.g. `"APFS"` or `"HFS+"`)
248
- * This will be changed to APFS in the next major release, so it is recommended to set it explicitly to HFS+ if you want to keep using HFS+ (e.g. for better compatibility with older macOS versions).
249
- * @default HFS+
248
+ * As of v27 this defaults to APFS. Set it explicitly to `"HFS+"` if you need compatibility with older macOS versions (pre-10.13 High Sierra cannot mount APFS volumes).
249
+ * @default APFS
250
250
  */
251
251
  readonly filesystem?: "HFS+" | "APFS" | null;
252
252
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"macOptions.d.ts","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CA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
@@ -1 +1 @@
1
- {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetConfiguration, TargetSpecificOptions } from \"../core.js\"\nimport { PlatformSpecificBuildOptions } from \"./PlatformSpecificBuildOptions.js\"\nimport { CustomMacSign } from \"../macPackager.js\"\nimport type { OnlySignOptions } from \"@electron/osx-sign\"\nimport type { MakeUniversalOpts } from \"@electron/universal\"\n\n/**\n * Options forwarded to `@electron/universal`'s `makeUniversalApp`.\n * Electron-builder fills in the app paths and `force`; everything else is configurable here\n * and auto-tracks upstream additions to `MakeUniversalOpts`.\n *\n * @see https://github.com/electron/universal\n */\nexport interface ElectronUniversalOptions extends Omit<MakeUniversalOpts, \"x64AppPath\" | \"arm64AppPath\" | \"outAppPath\" | \"force\"> {\n /**\n * Whether to merge x64 and arm64 ASARs into one.\n *\n * @default true\n */\n mergeASARs?: boolean\n}\n\n/**\n * Signing options passed to `@electron/osx-sign`. Electron-builder owns the fields it must control\n * itself — `app`, `keychain`, `platform`, `version`, `optionsForFile`, and `type` (derived from the\n * build flavor: `mas-dev` → `development`, otherwise `distribution`) — and forwards everything else.\n *\n * Additionally exposes a small set of per-file convenience fields that electron-builder maps\n * internally through `optionsForFile`.\n *\n * @see https://packages.electronjs.org/osx-sign\n */\nexport interface ElectronSignOptions extends Omit<OnlySignOptions, \"optionsForFile\" | \"version\" | \"type\"> {\n /**\n * The signing identity (certificate name or SHA-1 hash). Applies to both app signing and DMG signing.\n * Prefer the environment variables `CSC_LINK` / `CSC_NAME` over hardcoding this value.\n *\n * - **Not set** (default): electron-builder searches the keychain for a valid certificate.\n * - **`null`**: skip signing entirely.\n * - **`\"-\"`**: ad-hoc signing (requires disabling library validation — see `hardenedRuntime`).\n */\n readonly identity?: string | null\n /**\n * Path to the main app entitlements file.\n * Falls back to `build/entitlements.mac.plist` if it exists, then to `@electron/osx-sign`'s\n * built-in defaults.\n */\n readonly entitlements?: string | null\n /**\n * Path to child entitlements inherited by embedded frameworks and bundles.\n * Falls back to `build/entitlements.mac.inherit.plist` if it exists.\n */\n readonly entitlementsInherit?: string | null\n /**\n * Path to entitlements for the Login Helper.\n * Required when using App Sandbox, because the Login Helper cannot inherit entitlements.\n * Defaults to the value of `entitlements`.\n */\n readonly entitlementsLoginHelper?: string | null\n /**\n * Whether to enable [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime).\n *\n * Hardened Runtime is a prerequisite for notarization (mandatory on macOS 10.15+).\n * Defaults to `true` for `darwin` builds and `false` for `mas-dev`.\n *\n * @see https://github.com/electron/fuses\n */\n readonly hardenedRuntime?: boolean\n /**\n * Path to a [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html).\n * Not applicable for MAS.\n */\n readonly requirements?: string | null\n /**\n * URL of the timestamp authority server. Passed per-file to `codesign --timestamp=<url>`.\n */\n readonly timestamp?: string | null\n /**\n * Extra arguments passed to each `codesign` invocation.\n * @example [\"--deep\"]\n */\n readonly additionalArguments?: Array<string> | null\n}\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n * @default default (dmg and zip for Squirrel.Mac)\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Codesigning configuration. The signing certificate is selected via `sign.identity` (or the\n * `CSC_LINK` / `CSC_NAME` environment variables).\n *\n * - **Not set** (default): electron-builder auto-discovers a valid certificate in the keychain. If none is found, signing is skipped.\n * - **`null`**: skip signing entirely.\n * - **`string`**: path or module ID of a file that exports a {@link CustomMacSign} function.\n * - **{@link CustomMacSign}**: inline custom signing function (JS/TS config only).\n * - **{@link ElectronSignOptions}**: options forwarded directly to `@electron/osx-sign`.\n *\n * @see {@link ElectronSignOptions}\n * @see https://www.electron.build/code-signing\n */\n readonly sign?: CustomMacSign | ElectronSignOptions | string | null\n\n /**\n * Options forwarded to `@electron/universal` when building a universal (multi-arch) app.\n * Has no effect unless the target arch is `universal`.\n *\n * @see {@link ElectronUniversalOptions}\n * @see https://github.com/electron/universal\n */\n readonly universal?: ElectronUniversalOptions | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Used when no background image is set.\n * @default #ffffff\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The filesystem for the DMG volume (e.g. `\"APFS\"` or `\"HFS+\"`)\n * This will be changed to APFS in the next major release, so it is recommended to set it explicitly to HFS+ if you want to keep using HFS+ (e.g. for better compatibility with older macOS versions).\n * @default HFS+\n */\n readonly filesystem?: \"HFS+\" | \"APFS\" | null\n\n /**\n * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `\"150m\"`, `\"4g\"`.\n * If not specified, the size is calculated automatically.\n * Set this explicitly for large apps or apps with sparse files to avoid \"No space left on device\" errors.\n */\n readonly size?: string | null\n\n /**\n * Whether to shrink the DMG filesystem to the minimum size after copying files.\n * Set to `false` to preserve the explicit `size` you specified.\n * @default true\n */\n readonly shrink?: boolean\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * License agreement to display when the DMG is mounted.\n *\n * Accepts a single file path (`.rtf`, `.txt`, or `.html`) used as the English/default license,\n * or a language-code → file-path map for multi-language builds.\n *\n * When set, this takes precedence over the file-naming convention\n * (`license_en.txt`, etc. in the build resources directory).\n * Paths are resolved relative to the build resources directory or project root.\n *\n * @example Single language\n * ```yaml\n * dmg:\n * license: \"build/license.rtf\"\n * ```\n *\n * @example Multi-language\n * ```yaml\n * dmg:\n * license:\n * en_US: \"build/license.rtf\"\n * de_DE: \"build/license_de.txt\"\n * ja_JP: \"build/license_ja.txt\"\n * ```\n *\n * If not set, electron-builder scans the build resources directory for\n * `license_LANG.{rtf,txt,html}` files automatically.\n */\n license?: string | Record<string, string> | null\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface MasConfiguration extends MacConfiguration {}\n"]}
1
+ {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetConfiguration, TargetSpecificOptions } from \"../core.js\"\nimport { PlatformSpecificBuildOptions } from \"./PlatformSpecificBuildOptions.js\"\nimport { CustomMacSign } from \"../macPackager.js\"\nimport type { OnlySignOptions } from \"@electron/osx-sign\"\nimport type { MakeUniversalOpts } from \"@electron/universal\"\n\n/**\n * Options forwarded to `@electron/universal`'s `makeUniversalApp`.\n * Electron-builder fills in the app paths and `force`; everything else is configurable here\n * and auto-tracks upstream additions to `MakeUniversalOpts`.\n *\n * @see https://github.com/electron/universal\n */\nexport interface ElectronUniversalOptions extends Omit<MakeUniversalOpts, \"x64AppPath\" | \"arm64AppPath\" | \"outAppPath\" | \"force\"> {\n /**\n * Whether to merge x64 and arm64 ASARs into one.\n *\n * @default true\n */\n mergeASARs?: boolean\n}\n\n/**\n * Signing options passed to `@electron/osx-sign`. Electron-builder owns the fields it must control\n * itself — `app`, `keychain`, `platform`, `version`, `optionsForFile`, and `type` (derived from the\n * build flavor: `mas-dev` → `development`, otherwise `distribution`) — and forwards everything else.\n *\n * Additionally exposes a small set of per-file convenience fields that electron-builder maps\n * internally through `optionsForFile`.\n *\n * @see https://packages.electronjs.org/osx-sign\n */\nexport interface ElectronSignOptions extends Omit<OnlySignOptions, \"optionsForFile\" | \"version\" | \"type\"> {\n /**\n * The signing identity (certificate name or SHA-1 hash). Applies to both app signing and DMG signing.\n * Prefer the environment variables `CSC_LINK` / `CSC_NAME` over hardcoding this value.\n *\n * - **Not set** (default): electron-builder searches the keychain for a valid certificate.\n * - **`null`**: skip signing entirely.\n * - **`\"-\"`**: ad-hoc signing (requires disabling library validation — see `hardenedRuntime`).\n */\n readonly identity?: string | null\n /**\n * Path to the main app entitlements file.\n * Falls back to `build/entitlements.mac.plist` if it exists, then to `@electron/osx-sign`'s\n * built-in defaults.\n */\n readonly entitlements?: string | null\n /**\n * Path to child entitlements inherited by embedded frameworks and bundles.\n * Falls back to `build/entitlements.mac.inherit.plist` if it exists.\n */\n readonly entitlementsInherit?: string | null\n /**\n * Path to entitlements for the Login Helper.\n * Required when using App Sandbox, because the Login Helper cannot inherit entitlements.\n * Defaults to the value of `entitlements`.\n */\n readonly entitlementsLoginHelper?: string | null\n /**\n * Whether to enable [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime).\n *\n * Hardened Runtime is a prerequisite for notarization (mandatory on macOS 10.15+).\n * Defaults to `true` for `darwin` builds and `false` for `mas-dev`.\n *\n * @see https://github.com/electron/fuses\n */\n readonly hardenedRuntime?: boolean\n /**\n * Path to a [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html).\n * Not applicable for MAS.\n */\n readonly requirements?: string | null\n /**\n * URL of the timestamp authority server. Passed per-file to `codesign --timestamp=<url>`.\n */\n readonly timestamp?: string | null\n /**\n * Extra arguments passed to each `codesign` invocation.\n * @example [\"--deep\"]\n */\n readonly additionalArguments?: Array<string> | null\n}\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n * @default default (dmg and zip for Squirrel.Mac)\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Codesigning configuration. The signing certificate is selected via `sign.identity` (or the\n * `CSC_LINK` / `CSC_NAME` environment variables).\n *\n * - **Not set** (default): electron-builder auto-discovers a valid certificate in the keychain. If none is found, signing is skipped.\n * - **`null`**: skip signing entirely.\n * - **`string`**: path or module ID of a file that exports a {@link CustomMacSign} function.\n * - **{@link CustomMacSign}**: inline custom signing function (JS/TS config only).\n * - **{@link ElectronSignOptions}**: options forwarded directly to `@electron/osx-sign`.\n *\n * @see {@link ElectronSignOptions}\n * @see https://www.electron.build/code-signing\n */\n readonly sign?: CustomMacSign | ElectronSignOptions | string | null\n\n /**\n * Options forwarded to `@electron/universal` when building a universal (multi-arch) app.\n * Has no effect unless the target arch is `universal`.\n *\n * @see {@link ElectronUniversalOptions}\n * @see https://github.com/electron/universal\n */\n readonly universal?: ElectronUniversalOptions | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Used when no background image is set.\n * @default #ffffff\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)). `ULMO` (lzma-compressed image (macOS 10.15+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\" | \"ULMO\"\n\n /**\n * The filesystem for the DMG volume (e.g. `\"APFS\"` or `\"HFS+\"`)\n * As of v27 this defaults to APFS. Set it explicitly to `\"HFS+\"` if you need compatibility with older macOS versions (pre-10.13 High Sierra cannot mount APFS volumes).\n * @default APFS\n */\n readonly filesystem?: \"HFS+\" | \"APFS\" | null\n\n /**\n * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `\"150m\"`, `\"4g\"`.\n * If not specified, the size is calculated automatically.\n * Set this explicitly for large apps or apps with sparse files to avoid \"No space left on device\" errors.\n */\n readonly size?: string | null\n\n /**\n * Whether to shrink the DMG filesystem to the minimum size after copying files.\n * Set to `false` to preserve the explicit `size` you specified.\n * @default true\n */\n readonly shrink?: boolean\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * License agreement to display when the DMG is mounted.\n *\n * Accepts a single file path (`.rtf`, `.txt`, or `.html`) used as the English/default license,\n * or a language-code → file-path map for multi-language builds.\n *\n * When set, this takes precedence over the file-naming convention\n * (`license_en.txt`, etc. in the build resources directory).\n * Paths are resolved relative to the build resources directory or project root.\n *\n * @example Single language\n * ```yaml\n * dmg:\n * license: \"build/license.rtf\"\n * ```\n *\n * @example Multi-language\n * ```yaml\n * dmg:\n * license:\n * en_US: \"build/license.rtf\"\n * de_DE: \"build/license_de.txt\"\n * ja_JP: \"build/license_ja.txt\"\n * ```\n *\n * If not set, electron-builder scans the build resources directory for\n * `license_LANG.{rtf,txt,html}` files automatically.\n */\n license?: string | Record<string, string> | null\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface MasConfiguration extends MacConfiguration {}\n"]}
@@ -3,8 +3,8 @@ import { TargetConfigType } from "../core.js";
3
3
  import { PlatformSpecificBuildOptions } from "./PlatformSpecificBuildOptions.js";
4
4
  export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
5
5
  /**
6
- * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable]https://www.electron.build/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
7
- * AppX package can be built only on Windows 10.
6
+ * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable app](https://www.electron.build/nsis#portable) without installation), `appx`, `msix`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
7
+ * AppX and MSIX packages can be built on Windows 10 or Windows Server 2012 R2 (version 6.3+) or later, and on macOS via Parallels Desktop.
8
8
  *
9
9
  * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"AA8ZA;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,MAA4B;IAC7E,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;IACvB,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,wBAAwB,CAAC,MAA4B;IACnE,OAAO,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,CAAA;AACtD,CAAC","sourcesContent":["import { CustomWindowsSign } from \"../codeSign/win/windowsSignToolManager.js\"\nimport { TargetConfigType } from \"../core.js\"\nimport { PlatformSpecificBuildOptions } from \"./PlatformSpecificBuildOptions.js\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable]https://www.electron.build/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX package can be built only on Windows 10.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Code signing configuration. Code signing stamps every installer and executable\n * electron-builder produces with an Authenticode signature, so that Windows (SmartScreen / UAC)\n * and your auto-updater can verify the publisher and that the files were not tampered with.\n *\n * How this option behaves:\n * - Leave **unset** to sign using credentials discovered from the environment — primarily a\n * certificate supplied via `WIN_CSC_LINK` (or `CSC_LINK`) with its password in\n * `WIN_CSC_KEY_PASSWORD` (or `CSC_KEY_PASSWORD`). `WIN_CSC_LINK` accepts a file path, an\n * `https://` URL, or a base64-encoded certificate. This is the recommended setup for CI.\n * - Set to `false` or `null` to **disable** code signing entirely (executable resources such as\n * the icon and metadata are still edited).\n * - Set to an **object** to configure signing explicitly. The `type` field selects the signing\n * backend (`signtool` is the implicit default) and dispatches to a dedicated sign manager;\n * provide exactly one of the modes below. Each output artifact is signed individually, and by\n * default executables are dual-signed (see `signingHashAlgorithms`).\n *\n * - `{ type: \"signtool\", ... }` — Sign with a local certificate file (.pfx/.p12) or a\n * certificate from the Windows certificate store. Uses Microsoft `signtool.exe` on Windows and\n * `osslsigncode` on macOS/Linux.\n * - `{ type: \"hsm\", ... }` — Sign using a Hardware Security Module (HSM) or FIPS-compliant\n * hardware token via signtool's `/csp` (cryptographic service provider) and `/kc` (key\n * container) flags. Requires a modern `winCodeSign` toolset (the default — only the legacy\n * `\"0.0.0\"` pin is unsupported). Windows-only.\n * - `{ type: \"pkcs11\", ... }` — Sign using a PKCS#11 hardware token via osslsigncode.\n * Available on macOS and Linux CI without a Windows VM.\n * - `{ type: \"azure\", ... }` — Sign via Azure Trusted Signing (cloud service). Requires\n * Azure Entra ID environment variables for authentication.\n *\n * See [Code Signing](https://www.electron.build/code-signing).\n */\n readonly sign?: WindowsSigningConfiguration | false | null\n\n /**\n * Whether the NSIS auto-updater should verify the Authenticode signature of a downloaded update\n * before installing it. This is a **runtime** check performed by your app via electron-updater,\n * not a build-time check.\n *\n * When enabled (the default), the resolved [publisher name](#publisherName) is embedded into\n * `app-update.yml` at build time. At update time electron-updater inspects the certificate that\n * signed the downloaded installer and compares its subject (Distinguished Name / Common Name)\n * against that publisher name, refusing to install on a mismatch. This prevents a tampered or\n * maliciously substituted update from being installed.\n *\n * Set to `false` to skip verification — in which case the publisher name is **not** embedded.\n * Disable this only if your updates are not Authenticode-signed.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Additional file name suffixes to code sign, beyond the default. By default electron-builder\n * only signs `.exe` files; list extra suffixes here to also sign e.g. `.dll`, `.node`, or\n * specific file names. Advanced option — most apps do not need it.\n *\n * Each entry is matched with `String.endsWith`, so both bare extensions (`\".dll\"`) and full file\n * names (`\"mybinary.dll\"`) work. Prefix a pattern with `!` to *exclude* a suffix that would\n * otherwise be signed. Positive patterns are evaluated first, then negative ones. For example,\n * `[\"somefilename\", \".dll\", \"!.appx\"]` signs `.dll` files (and anything ending in `somefilename`)\n * but never signs `.appx` files.\n *\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\n// ─── Shared base for signtool-family signing modes ───────────────────────────\n\n/**\n * Options shared by every certificate-based signing mode (`signtool`, `hsm`, `pkcs11`). These\n * control the signature itself — publisher identity, digest algorithms, timestamping, and the\n * extra certificates added to the signature block — independently of where the private key lives.\n */\ninterface WindowsSigningSharedOptions {\n /**\n * The publisher name(s) to associate with the signature, written exactly as the subject appears\n * in your code signing certificate. May be a single string or an array — an array is useful when\n * rotating certificates, so updates signed by either the old or the new certificate still verify.\n *\n * This value is not a `signtool` argument; it is consumed in two places:\n * - **Update verification** — when [verifyUpdateCodeSignature](#verifyUpdateCodeSignature) is\n * enabled, it is written into `app-update.yml` and electron-updater checks it against the\n * certificate that signed each downloaded update.\n * - **AppX / MSIX identity** — the package `Publisher` attribute must equal the certificate\n * subject, so electron-builder derives it from this value (or the certificate) to keep them\n * in sync; a mismatch makes packaging fail with `ERROR_BAD_FORMAT`.\n *\n * Defaults to the Common Name (CN) extracted from your code signing certificate. Set to `null`\n * to opt out.\n *\n * @see https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073\n */\n readonly publisherName?: string | Array<string> | null\n\n /**\n * The digest (hash) algorithms to sign with, applied via signtool's `/fd` flag (or\n * osslsigncode's `-h`). One signing pass runs per entry, in order; listing more than one\n * **dual-signs** the file, with each additional signature appended as a nested signature\n * (signtool `/as`). Signing with both `sha1` and `sha256` lets a single binary validate on\n * legacy (pre-SHA-2) Windows as well as modern Windows.\n *\n * Some targets override this: `.msi` cannot be dual-signed (a single hash is used) and AppX/MSIX\n * is always `sha256` only.\n *\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * The URL of the [RFC 3161](https://www.ietf.org/rfc/rfc3161.txt) timestamp server, used for\n * SHA-256 and nested/appended signatures (signtool's `/tr` flag). Timestamping records *when*\n * the file was signed so the signature stays valid after the signing certificate expires.\n * Ignored when the build runs with `ELECTRON_BUILDER_OFFLINE=true`.\n *\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the legacy Authenticode timestamp server, used for SHA-1 signatures (signtool's\n * `/t` flag). This is also the timestamp server used by `osslsigncode` (`-t`) when signing on\n * macOS/Linux. See [rfc3161TimeStampServer](#rfc3161TimeStampServer) for SHA-256 / nested\n * signatures. Ignored when the build runs with `ELECTRON_BUILDER_OFFLINE=true`.\n *\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * Path to an additional certificate file (typically an intermediate / cross-signing CA\n * certificate) whose contents are added to the signature block via signtool's `/ac` flag. Use\n * this when the signing certificate's full chain is not already present on target machines and\n * you want it embedded in the signature so the chain can be validated.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * A custom signing hook that **replaces** electron-builder's built-in `signtool` /\n * `osslsigncode` invocation. Provide a function, or the path / module id of a file that exports\n * a `sign` function (resolved relative to the project, then as a module).\n *\n * The hook is invoked once per signing pass (i.e. once per entry in\n * [signingHashAlgorithms](#signingHashAlgorithms)) and receives a configuration object describing\n * the file to sign (`path`), the resolved certificate info (`cscInfo`), the current `hash`, and\n * whether this pass is a nested signature (`isNest`), plus a `computeSignToolArgs(isWin)` helper\n * that returns the default arguments electron-builder would otherwise have used. Use this to\n * integrate an external or cloud signing service. See\n * [Code Signing](https://www.electron.build/code-signing).\n */\n readonly sign?: CustomWindowsSign | string | null\n}\n\n// ─── Signing mode: signtool (file or Windows certificate store) ──────────────\n\n/**\n * Sign with a certificate file (`.pfx` / `.p12`) or with a certificate from the Windows\n * certificate store, using Microsoft `signtool.exe` on Windows and `osslsigncode` on macOS/Linux.\n * This is the default mode when `win.sign` is unset. Supply the certificate one of four ways:\n * a file via `certificateFile` (or the `WIN_CSC_LINK` env var), or a store lookup via\n * `certificateSubjectName` or `certificateSha1`.\n */\nexport interface WindowsSigntoolSigningConfig extends WindowsSigningSharedOptions {\n /** Discriminator selecting the default file/store signing mode. */\n readonly type: \"signtool\"\n\n /**\n * Path to the PKCS#12 certificate file (`.pfx` or `.p12`) holding both the signing certificate\n * and its private key. Passed to signtool via `/f` (or osslsigncode via `-pkcs12`).\n *\n * Prefer supplying this out-of-band via the `WIN_CSC_LINK` (or `CSC_LINK`) environment variable\n * instead of hardcoding a path — that variable also accepts an `https://` URL or a base64-encoded\n * certificate, which is safer and more convenient on CI. See\n * [Code Signing](https://www.electron.build/code-signing).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password protecting the private key in `certificateFile`. Passed to signtool via `/p`\n * (or osslsigncode via `-pass`).\n *\n * Prefer the `WIN_CSC_KEY_PASSWORD` (or `CSC_KEY_PASSWORD`) environment variable so the secret\n * never lands in your build configuration.\n */\n readonly certificatePassword?: string | null\n\n /**\n * Select the signing certificate from the Windows certificate store by (a substring of) its\n * subject name, instead of pointing at a `.pfx` file. electron-builder enumerates the installed\n * code-signing certificates, picks the match, and signs by its thumbprint\n * (`/sha1 <thumbprint> /s <store>`). **Required for EV (Extended Validation) certificates**,\n * whose private keys live on a hardware token and cannot be exported to a file.\n *\n * Works only on Windows (or macOS with Parallels Desktop, via the bundled Windows VM).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * Select the signing certificate from the Windows certificate store by its SHA-1 thumbprint,\n * instead of pointing at a `.pfx` file. electron-builder looks the certificate up in the store\n * and signs with `/sha1 <thumbprint> /s <store>`. Like\n * [certificateSubjectName](#certificateSubjectName), this suits EV certificates backed by a\n * hardware token; if both are set, both must resolve to the same certificate.\n *\n * Works only on Windows (or macOS with Parallels Desktop, via the bundled Windows VM).\n */\n readonly certificateSha1?: string | null\n}\n\n// ─── Signing mode: hsm (Hardware Security Module via signtool /csp /kc) ──────\n\n/**\n * @beta HSM signing is available in v27 as a beta feature. The interface is stable but\n * real-hardware test coverage is limited.\n */\nexport interface WindowsHsmSigningConfig extends WindowsSigningSharedOptions {\n /** Discriminator selecting HSM / hardware-token signing via signtool's `/csp` and `/kc` flags. */\n readonly type: \"hsm\"\n\n /**\n * The name of the cryptographic service provider (CSP) that holds the private key.\n * Maps to signtool's `/csp` flag. Examples:\n * - Google Cloud KMS: `\"Google Cloud KMS Provider\"`\n * - Smart card / FIPS token: `\"Microsoft Base Smart Card Crypto Provider\"`\n *\n * Requires a modern `winCodeSign` toolset (the default; only the legacy `\"0.0.0\"` pin is\n * unsupported). Windows-only — use `type: \"pkcs11\"` on macOS/Linux.\n */\n readonly cryptoServiceProvider: string\n\n /**\n * The key container name within the CSP. Maps to signtool's `/kc` flag.\n *\n * Example for Google Cloud KMS:\n * `\"projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME/cryptoKeyVersions/1\"`\n */\n readonly keyContainer: string\n\n /**\n * Path to the certificate file containing the public certificate chain (.crt / .cer / .pfx).\n * The private key is NOT read from this file — it is provided by the HSM via `cryptoServiceProvider`.\n */\n readonly certificateFile?: string | null\n\n /**\n * Alternative to `certificateFile`: locate the public certificate in the Windows certificate\n * store by its SHA-1 thumbprint. The private key still comes from the HSM via\n * `cryptoServiceProvider` / `keyContainer`; this only identifies which public certificate to sign\n * with.\n */\n readonly certificateSha1?: string | null\n\n /**\n * Alternative to `certificateFile`: locate the public certificate in the Windows certificate\n * store by (a substring of) its subject name. The private key still comes from the HSM via\n * `cryptoServiceProvider` / `keyContainer`; this only identifies which public certificate to sign\n * with.\n */\n readonly certificateSubjectName?: string | null\n}\n\n// ─── Signing mode: pkcs11 (cross-platform PKCS#11 via osslsigncode) ──────────\n\n/**\n * Sign with a PKCS#11 hardware token (smart card, USB HSM, cloud KMS exposed via a PKCS#11\n * provider) using `osslsigncode`. Unlike `hsm`, this mode does **not** require Windows or a\n * Windows VM, so it can sign Windows binaries directly from macOS/Linux CI. The token PIN is read\n * from the `WIN_CSC_KEY_PASSWORD` (or `CSC_KEY_PASSWORD`) environment variable.\n *\n * @beta PKCS#11 signing is available in v27 as a beta feature. The interface is stable but\n * real-hardware test coverage is limited.\n */\nexport interface WindowsPkcs11SigningConfig extends WindowsSigningSharedOptions {\n /** Discriminator selecting cross-platform PKCS#11 token signing via `osslsigncode`. */\n readonly type: \"pkcs11\"\n\n /**\n * Path to the PKCS#11 shared library (`.so` on Linux, `.dylib` on macOS).\n * The library must be installed separately — electron-builder does not bundle it.\n *\n * Example: `\"/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so\"`\n *\n * Must be paired with `pkcs11KeyUri`.\n */\n readonly pkcs11Module: string\n\n /**\n * RFC 7512 PKCS#11 URI identifying the private key within the module.\n * Maps to osslsigncode's `-key` parameter.\n *\n * Example: `\"pkcs11:token=MyToken;object=MyKey;type=private\"`\n *\n * Must be paired with `pkcs11Module`.\n */\n readonly pkcs11KeyUri: string\n\n /**\n * Optional path to a certificate chain file to accompany the PKCS#11 key.\n * If omitted the certificate embedded in the token is used.\n */\n readonly certificateFile?: string | null\n}\n\n// ─── Signing mode: azure (Azure Trusted Signing) ──────────────────────────────\n\n/**\n * The `signtool /dlib` Azure Trusted Signing integration was introduced in `toolsets.winCodeSign: 1.3.0`.\n * The legacy PowerShell integration is deprecated, but leverages the same underlying Azure APIs, so both interfaces share the same config shape.\n */\nexport interface WindowsAzureSigningConfig {\n /** Discriminator selecting Azure Trusted Signing (cloud signing — no local certificate). */\n readonly type: \"azure\"\n\n /**\n * The publisher name to associate with the signature, exactly as it appears in the certificate\n * issued by your Trusted Signing certificate profile. Required. Used for\n * [update verification](#verifyUpdateCodeSignature) (embedded in `app-update.yml` and checked by\n * electron-updater) and must match the certificate subject.\n *\n * @see https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073\n */\n readonly publisherName: string\n\n /**\n * The Trusted Signing Account endpoint. The URI value must align to the region your Trusted\n * Signing Account and Certificate Profile were created in.\n *\n * Requires Azure Entra ID environment variables per\n * [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition).\n */\n readonly endpoint: string\n\n /**\n * The name of the Trusted Signing Certificate Profile to sign with, as created in your Azure\n * Code Signing Account. Maps to the DLib metadata field `CertificateProfileName`.\n */\n readonly certificateProfileName: string\n\n /**\n * The name of the Azure Trusted Signing (Code Signing) Account that owns the certificate profile.\n * Maps to the DLib metadata field `CodeSigningAccountName`.\n */\n readonly codeSigningAccountName: string\n\n /**\n * The digest algorithm used to hash the files being signed. Maps to the DLib metadata field\n * `FileDigest`.\n * @default SHA256\n */\n readonly fileDigest?: string\n\n /**\n * The RFC3161 timestamp server. Translates to field: TimestampRfc3161.\n * @default http://timestamp.acs.microsoft.com\n */\n readonly timestampRfc3161?: string\n\n /**\n * The timestamp digest algorithm. Translates to field: TimestampDigest.\n * @default SHA256\n */\n readonly timestampDigest?: string\n\n /**\n * Additional fields to include verbatim in the `metadata.json` file passed to\n * `Azure.CodeSigning.Dlib.dll` via `signtool /dmdf`. Use this for DLib-specific options\n * not covered by the typed fields above (e.g. `ExcludeCredentials`, `CorrelationId`).\n */\n readonly additionalMetadata?: Record<string, string>\n}\n\n// ─── Discriminated union ──────────────────────────────────────────────────────\n\nexport type WindowsSigningConfiguration = WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | WindowsPkcs11SigningConfig | WindowsAzureSigningConfig\n\n/** Signing modes that use signtool.exe or osslsigncode (not Azure). */\nexport type WindowsSigntoolFamilyConfig = WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | WindowsPkcs11SigningConfig\n\n/**\n * Resolves the active signing configuration object. `false`, `null`, and unset all mean\n * \"no explicit signing config object\" (env-based discovery still applies when unset).\n */\nexport function resolveWindowsSigningConfiguration(config: WindowsConfiguration): WindowsSigningConfiguration | null {\n const { sign } = config\n return sign == null || sign === false ? null : sign\n}\n\n/** Whether Windows code signing has been explicitly disabled via `sign: false | null`. */\nexport function isWindowsSigningDisabled(config: WindowsConfiguration): boolean {\n return config.sign === false || config.sign === null\n}\n"]}
1
+ {"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"AA8ZA;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,MAA4B;IAC7E,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;IACvB,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,wBAAwB,CAAC,MAA4B;IACnE,OAAO,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,CAAA;AACtD,CAAC","sourcesContent":["import { CustomWindowsSign } from \"../codeSign/win/windowsSignToolManager.js\"\nimport { TargetConfigType } from \"../core.js\"\nimport { PlatformSpecificBuildOptions } from \"./PlatformSpecificBuildOptions.js\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable app](https://www.electron.build/nsis#portable) without installation), `appx`, `msix`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX and MSIX packages can be built on Windows 10 or Windows Server 2012 R2 (version 6.3+) or later, and on macOS via Parallels Desktop.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Code signing configuration. Code signing stamps every installer and executable\n * electron-builder produces with an Authenticode signature, so that Windows (SmartScreen / UAC)\n * and your auto-updater can verify the publisher and that the files were not tampered with.\n *\n * How this option behaves:\n * - Leave **unset** to sign using credentials discovered from the environment — primarily a\n * certificate supplied via `WIN_CSC_LINK` (or `CSC_LINK`) with its password in\n * `WIN_CSC_KEY_PASSWORD` (or `CSC_KEY_PASSWORD`). `WIN_CSC_LINK` accepts a file path, an\n * `https://` URL, or a base64-encoded certificate. This is the recommended setup for CI.\n * - Set to `false` or `null` to **disable** code signing entirely (executable resources such as\n * the icon and metadata are still edited).\n * - Set to an **object** to configure signing explicitly. The `type` field selects the signing\n * backend (`signtool` is the implicit default) and dispatches to a dedicated sign manager;\n * provide exactly one of the modes below. Each output artifact is signed individually, and by\n * default executables are dual-signed (see `signingHashAlgorithms`).\n *\n * - `{ type: \"signtool\", ... }` — Sign with a local certificate file (.pfx/.p12) or a\n * certificate from the Windows certificate store. Uses Microsoft `signtool.exe` on Windows and\n * `osslsigncode` on macOS/Linux.\n * - `{ type: \"hsm\", ... }` — Sign using a Hardware Security Module (HSM) or FIPS-compliant\n * hardware token via signtool's `/csp` (cryptographic service provider) and `/kc` (key\n * container) flags. Requires a modern `winCodeSign` toolset (the default — only the legacy\n * `\"0.0.0\"` pin is unsupported). Windows-only.\n * - `{ type: \"pkcs11\", ... }` — Sign using a PKCS#11 hardware token via osslsigncode.\n * Available on macOS and Linux CI without a Windows VM.\n * - `{ type: \"azure\", ... }` — Sign via Azure Trusted Signing (cloud service). Requires\n * Azure Entra ID environment variables for authentication.\n *\n * See [Code Signing](https://www.electron.build/code-signing).\n */\n readonly sign?: WindowsSigningConfiguration | false | null\n\n /**\n * Whether the NSIS auto-updater should verify the Authenticode signature of a downloaded update\n * before installing it. This is a **runtime** check performed by your app via electron-updater,\n * not a build-time check.\n *\n * When enabled (the default), the resolved [publisher name](#publisherName) is embedded into\n * `app-update.yml` at build time. At update time electron-updater inspects the certificate that\n * signed the downloaded installer and compares its subject (Distinguished Name / Common Name)\n * against that publisher name, refusing to install on a mismatch. This prevents a tampered or\n * maliciously substituted update from being installed.\n *\n * Set to `false` to skip verification — in which case the publisher name is **not** embedded.\n * Disable this only if your updates are not Authenticode-signed.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Additional file name suffixes to code sign, beyond the default. By default electron-builder\n * only signs `.exe` files; list extra suffixes here to also sign e.g. `.dll`, `.node`, or\n * specific file names. Advanced option — most apps do not need it.\n *\n * Each entry is matched with `String.endsWith`, so both bare extensions (`\".dll\"`) and full file\n * names (`\"mybinary.dll\"`) work. Prefix a pattern with `!` to *exclude* a suffix that would\n * otherwise be signed. Positive patterns are evaluated first, then negative ones. For example,\n * `[\"somefilename\", \".dll\", \"!.appx\"]` signs `.dll` files (and anything ending in `somefilename`)\n * but never signs `.appx` files.\n *\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\n// ─── Shared base for signtool-family signing modes ───────────────────────────\n\n/**\n * Options shared by every certificate-based signing mode (`signtool`, `hsm`, `pkcs11`). These\n * control the signature itself — publisher identity, digest algorithms, timestamping, and the\n * extra certificates added to the signature block — independently of where the private key lives.\n */\ninterface WindowsSigningSharedOptions {\n /**\n * The publisher name(s) to associate with the signature, written exactly as the subject appears\n * in your code signing certificate. May be a single string or an array — an array is useful when\n * rotating certificates, so updates signed by either the old or the new certificate still verify.\n *\n * This value is not a `signtool` argument; it is consumed in two places:\n * - **Update verification** — when [verifyUpdateCodeSignature](#verifyUpdateCodeSignature) is\n * enabled, it is written into `app-update.yml` and electron-updater checks it against the\n * certificate that signed each downloaded update.\n * - **AppX / MSIX identity** — the package `Publisher` attribute must equal the certificate\n * subject, so electron-builder derives it from this value (or the certificate) to keep them\n * in sync; a mismatch makes packaging fail with `ERROR_BAD_FORMAT`.\n *\n * Defaults to the Common Name (CN) extracted from your code signing certificate. Set to `null`\n * to opt out.\n *\n * @see https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073\n */\n readonly publisherName?: string | Array<string> | null\n\n /**\n * The digest (hash) algorithms to sign with, applied via signtool's `/fd` flag (or\n * osslsigncode's `-h`). One signing pass runs per entry, in order; listing more than one\n * **dual-signs** the file, with each additional signature appended as a nested signature\n * (signtool `/as`). Signing with both `sha1` and `sha256` lets a single binary validate on\n * legacy (pre-SHA-2) Windows as well as modern Windows.\n *\n * Some targets override this: `.msi` cannot be dual-signed (a single hash is used) and AppX/MSIX\n * is always `sha256` only.\n *\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * The URL of the [RFC 3161](https://www.ietf.org/rfc/rfc3161.txt) timestamp server, used for\n * SHA-256 and nested/appended signatures (signtool's `/tr` flag). Timestamping records *when*\n * the file was signed so the signature stays valid after the signing certificate expires.\n * Ignored when the build runs with `ELECTRON_BUILDER_OFFLINE=true`.\n *\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the legacy Authenticode timestamp server, used for SHA-1 signatures (signtool's\n * `/t` flag). This is also the timestamp server used by `osslsigncode` (`-t`) when signing on\n * macOS/Linux. See [rfc3161TimeStampServer](#rfc3161TimeStampServer) for SHA-256 / nested\n * signatures. Ignored when the build runs with `ELECTRON_BUILDER_OFFLINE=true`.\n *\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * Path to an additional certificate file (typically an intermediate / cross-signing CA\n * certificate) whose contents are added to the signature block via signtool's `/ac` flag. Use\n * this when the signing certificate's full chain is not already present on target machines and\n * you want it embedded in the signature so the chain can be validated.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * A custom signing hook that **replaces** electron-builder's built-in `signtool` /\n * `osslsigncode` invocation. Provide a function, or the path / module id of a file that exports\n * a `sign` function (resolved relative to the project, then as a module).\n *\n * The hook is invoked once per signing pass (i.e. once per entry in\n * [signingHashAlgorithms](#signingHashAlgorithms)) and receives a configuration object describing\n * the file to sign (`path`), the resolved certificate info (`cscInfo`), the current `hash`, and\n * whether this pass is a nested signature (`isNest`), plus a `computeSignToolArgs(isWin)` helper\n * that returns the default arguments electron-builder would otherwise have used. Use this to\n * integrate an external or cloud signing service. See\n * [Code Signing](https://www.electron.build/code-signing).\n */\n readonly sign?: CustomWindowsSign | string | null\n}\n\n// ─── Signing mode: signtool (file or Windows certificate store) ──────────────\n\n/**\n * Sign with a certificate file (`.pfx` / `.p12`) or with a certificate from the Windows\n * certificate store, using Microsoft `signtool.exe` on Windows and `osslsigncode` on macOS/Linux.\n * This is the default mode when `win.sign` is unset. Supply the certificate one of four ways:\n * a file via `certificateFile` (or the `WIN_CSC_LINK` env var), or a store lookup via\n * `certificateSubjectName` or `certificateSha1`.\n */\nexport interface WindowsSigntoolSigningConfig extends WindowsSigningSharedOptions {\n /** Discriminator selecting the default file/store signing mode. */\n readonly type: \"signtool\"\n\n /**\n * Path to the PKCS#12 certificate file (`.pfx` or `.p12`) holding both the signing certificate\n * and its private key. Passed to signtool via `/f` (or osslsigncode via `-pkcs12`).\n *\n * Prefer supplying this out-of-band via the `WIN_CSC_LINK` (or `CSC_LINK`) environment variable\n * instead of hardcoding a path — that variable also accepts an `https://` URL or a base64-encoded\n * certificate, which is safer and more convenient on CI. See\n * [Code Signing](https://www.electron.build/code-signing).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password protecting the private key in `certificateFile`. Passed to signtool via `/p`\n * (or osslsigncode via `-pass`).\n *\n * Prefer the `WIN_CSC_KEY_PASSWORD` (or `CSC_KEY_PASSWORD`) environment variable so the secret\n * never lands in your build configuration.\n */\n readonly certificatePassword?: string | null\n\n /**\n * Select the signing certificate from the Windows certificate store by (a substring of) its\n * subject name, instead of pointing at a `.pfx` file. electron-builder enumerates the installed\n * code-signing certificates, picks the match, and signs by its thumbprint\n * (`/sha1 <thumbprint> /s <store>`). **Required for EV (Extended Validation) certificates**,\n * whose private keys live on a hardware token and cannot be exported to a file.\n *\n * Works only on Windows (or macOS with Parallels Desktop, via the bundled Windows VM).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * Select the signing certificate from the Windows certificate store by its SHA-1 thumbprint,\n * instead of pointing at a `.pfx` file. electron-builder looks the certificate up in the store\n * and signs with `/sha1 <thumbprint> /s <store>`. Like\n * [certificateSubjectName](#certificateSubjectName), this suits EV certificates backed by a\n * hardware token; if both are set, both must resolve to the same certificate.\n *\n * Works only on Windows (or macOS with Parallels Desktop, via the bundled Windows VM).\n */\n readonly certificateSha1?: string | null\n}\n\n// ─── Signing mode: hsm (Hardware Security Module via signtool /csp /kc) ──────\n\n/**\n * @beta HSM signing is available in v27 as a beta feature. The interface is stable but\n * real-hardware test coverage is limited.\n */\nexport interface WindowsHsmSigningConfig extends WindowsSigningSharedOptions {\n /** Discriminator selecting HSM / hardware-token signing via signtool's `/csp` and `/kc` flags. */\n readonly type: \"hsm\"\n\n /**\n * The name of the cryptographic service provider (CSP) that holds the private key.\n * Maps to signtool's `/csp` flag. Examples:\n * - Google Cloud KMS: `\"Google Cloud KMS Provider\"`\n * - Smart card / FIPS token: `\"Microsoft Base Smart Card Crypto Provider\"`\n *\n * Requires a modern `winCodeSign` toolset (the default; only the legacy `\"0.0.0\"` pin is\n * unsupported). Windows-only — use `type: \"pkcs11\"` on macOS/Linux.\n */\n readonly cryptoServiceProvider: string\n\n /**\n * The key container name within the CSP. Maps to signtool's `/kc` flag.\n *\n * Example for Google Cloud KMS:\n * `\"projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME/cryptoKeyVersions/1\"`\n */\n readonly keyContainer: string\n\n /**\n * Path to the certificate file containing the public certificate chain (.crt / .cer / .pfx).\n * The private key is NOT read from this file — it is provided by the HSM via `cryptoServiceProvider`.\n */\n readonly certificateFile?: string | null\n\n /**\n * Alternative to `certificateFile`: locate the public certificate in the Windows certificate\n * store by its SHA-1 thumbprint. The private key still comes from the HSM via\n * `cryptoServiceProvider` / `keyContainer`; this only identifies which public certificate to sign\n * with.\n */\n readonly certificateSha1?: string | null\n\n /**\n * Alternative to `certificateFile`: locate the public certificate in the Windows certificate\n * store by (a substring of) its subject name. The private key still comes from the HSM via\n * `cryptoServiceProvider` / `keyContainer`; this only identifies which public certificate to sign\n * with.\n */\n readonly certificateSubjectName?: string | null\n}\n\n// ─── Signing mode: pkcs11 (cross-platform PKCS#11 via osslsigncode) ──────────\n\n/**\n * Sign with a PKCS#11 hardware token (smart card, USB HSM, cloud KMS exposed via a PKCS#11\n * provider) using `osslsigncode`. Unlike `hsm`, this mode does **not** require Windows or a\n * Windows VM, so it can sign Windows binaries directly from macOS/Linux CI. The token PIN is read\n * from the `WIN_CSC_KEY_PASSWORD` (or `CSC_KEY_PASSWORD`) environment variable.\n *\n * @beta PKCS#11 signing is available in v27 as a beta feature. The interface is stable but\n * real-hardware test coverage is limited.\n */\nexport interface WindowsPkcs11SigningConfig extends WindowsSigningSharedOptions {\n /** Discriminator selecting cross-platform PKCS#11 token signing via `osslsigncode`. */\n readonly type: \"pkcs11\"\n\n /**\n * Path to the PKCS#11 shared library (`.so` on Linux, `.dylib` on macOS).\n * The library must be installed separately — electron-builder does not bundle it.\n *\n * Example: `\"/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so\"`\n *\n * Must be paired with `pkcs11KeyUri`.\n */\n readonly pkcs11Module: string\n\n /**\n * RFC 7512 PKCS#11 URI identifying the private key within the module.\n * Maps to osslsigncode's `-key` parameter.\n *\n * Example: `\"pkcs11:token=MyToken;object=MyKey;type=private\"`\n *\n * Must be paired with `pkcs11Module`.\n */\n readonly pkcs11KeyUri: string\n\n /**\n * Optional path to a certificate chain file to accompany the PKCS#11 key.\n * If omitted the certificate embedded in the token is used.\n */\n readonly certificateFile?: string | null\n}\n\n// ─── Signing mode: azure (Azure Trusted Signing) ──────────────────────────────\n\n/**\n * The `signtool /dlib` Azure Trusted Signing integration was introduced in `toolsets.winCodeSign: 1.3.0`.\n * The legacy PowerShell integration is deprecated, but leverages the same underlying Azure APIs, so both interfaces share the same config shape.\n */\nexport interface WindowsAzureSigningConfig {\n /** Discriminator selecting Azure Trusted Signing (cloud signing — no local certificate). */\n readonly type: \"azure\"\n\n /**\n * The publisher name to associate with the signature, exactly as it appears in the certificate\n * issued by your Trusted Signing certificate profile. Required. Used for\n * [update verification](#verifyUpdateCodeSignature) (embedded in `app-update.yml` and checked by\n * electron-updater) and must match the certificate subject.\n *\n * @see https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073\n */\n readonly publisherName: string\n\n /**\n * The Trusted Signing Account endpoint. The URI value must align to the region your Trusted\n * Signing Account and Certificate Profile were created in.\n *\n * Requires Azure Entra ID environment variables per\n * [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition).\n */\n readonly endpoint: string\n\n /**\n * The name of the Trusted Signing Certificate Profile to sign with, as created in your Azure\n * Code Signing Account. Maps to the DLib metadata field `CertificateProfileName`.\n */\n readonly certificateProfileName: string\n\n /**\n * The name of the Azure Trusted Signing (Code Signing) Account that owns the certificate profile.\n * Maps to the DLib metadata field `CodeSigningAccountName`.\n */\n readonly codeSigningAccountName: string\n\n /**\n * The digest algorithm used to hash the files being signed. Maps to the DLib metadata field\n * `FileDigest`.\n * @default SHA256\n */\n readonly fileDigest?: string\n\n /**\n * The RFC3161 timestamp server. Translates to field: TimestampRfc3161.\n * @default http://timestamp.acs.microsoft.com\n */\n readonly timestampRfc3161?: string\n\n /**\n * The timestamp digest algorithm. Translates to field: TimestampDigest.\n * @default SHA256\n */\n readonly timestampDigest?: string\n\n /**\n * Additional fields to include verbatim in the `metadata.json` file passed to\n * `Azure.CodeSigning.Dlib.dll` via `signtool /dmdf`. Use this for DLib-specific options\n * not covered by the typed fields above (e.g. `ExcludeCredentials`, `CorrelationId`).\n */\n readonly additionalMetadata?: Record<string, string>\n}\n\n// ─── Discriminated union ──────────────────────────────────────────────────────\n\nexport type WindowsSigningConfiguration = WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | WindowsPkcs11SigningConfig | WindowsAzureSigningConfig\n\n/** Signing modes that use signtool.exe or osslsigncode (not Azure). */\nexport type WindowsSigntoolFamilyConfig = WindowsSigntoolSigningConfig | WindowsHsmSigningConfig | WindowsPkcs11SigningConfig\n\n/**\n * Resolves the active signing configuration object. `false`, `null`, and unset all mean\n * \"no explicit signing config object\" (env-based discovery still applies when unset).\n */\nexport function resolveWindowsSigningConfiguration(config: WindowsConfiguration): WindowsSigningConfiguration | null {\n const { sign } = config\n return sign == null || sign === false ? null : sign\n}\n\n/** Whether Windows code signing has been explicitly disabled via `sign: false | null`. */\nexport function isWindowsSigningDisabled(config: WindowsConfiguration): boolean {\n return config.sign === false || config.sign === null\n}\n"]}