app-builder-lib 26.4.1 → 26.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/out/binDownload.d.ts +17 -0
  2. package/out/binDownload.js +153 -0
  3. package/out/binDownload.js.map +1 -1
  4. package/out/macPackager.js +2 -1
  5. package/out/macPackager.js.map +1 -1
  6. package/out/node-module-collector/hoist.js +7 -4
  7. package/out/node-module-collector/hoist.js.map +1 -1
  8. package/out/node-module-collector/nodeModulesCollector.d.ts +90 -2
  9. package/out/node-module-collector/nodeModulesCollector.js +143 -4
  10. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  11. package/out/node-module-collector/npmNodeModulesCollector.d.ts +0 -1
  12. package/out/node-module-collector/npmNodeModulesCollector.js +1 -6
  13. package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
  14. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +1 -2
  15. package/out/node-module-collector/pnpmNodeModulesCollector.js +31 -36
  16. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  17. package/out/node-module-collector/traversalNodeModulesCollector.d.ts +0 -1
  18. package/out/node-module-collector/traversalNodeModulesCollector.js +0 -3
  19. package/out/node-module-collector/traversalNodeModulesCollector.js.map +1 -1
  20. package/out/options/macOptions.d.ts +4 -0
  21. package/out/options/macOptions.js.map +1 -1
  22. package/out/platformPackager.d.ts +1 -1
  23. package/out/platformPackager.js.map +1 -1
  24. package/out/targets/FlatpakTarget.js +11 -9
  25. package/out/targets/FlatpakTarget.js.map +1 -1
  26. package/out/targets/archive.js.map +1 -1
  27. package/out/util/packageDependencies.js +2 -1
  28. package/out/util/packageDependencies.js.map +1 -1
  29. package/out/version.d.ts +1 -1
  30. package/out/version.js +1 -1
  31. package/out/version.js.map +1 -1
  32. package/package.json +12 -10
  33. package/scheme.json +7 -0
  34. package/templates/nsis/uninstaller.nsh +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"traversalNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/traversalNodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,+CAAkC;AAClC,iEAA6D;AAC7D,2DAAwC;AAExC,6BAA4B;AAE5B,+KAA+K;AAC/K,MAAa,6BAA8B,SAAQ,2CAA8D;IAAjH;;QACS,mBAAc,GAAG;YACtB,OAAO,EAAE,sBAAE,CAAC,SAAS;YACrB,QAAQ,EAAE,MAAM;SACjB,CAAA;IA+HH,CAAC;IA7HW,OAAO;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IAES,mBAAmB,CAAC,GAAO;QACnC,kBAAG,CAAC,IAAI,CAAC,IAAI,EAAE,iEAAiE,CAAC,CAAA;QACjF,OAAO,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IACnE,CAAC;IAES,KAAK,CAAC,sBAAsB,CAAC,IAAyB,EAAE,cAAsB;QACtF,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC,EAAE,CAAC;YAC/F,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;YACjE,MAAM,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,oHAAoH;IAC1G,KAAK,CAAC,gCAAgC,CAAC,IAAyB,EAAE,YAAoB;QAC9F,IAAI,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,OAAM;QACR,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;QAEzD,MAAM,gBAAgB,GAAG,EAAE,GAAG,CAAC,IA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;gBACxB,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBACrE,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;aACtF,CAAA;QACH,CAAC,CAAA;QAED,OAAO,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAC7C,CAAC;CACF;AAnID,sEAmIC","sourcesContent":["import { log } from \"builder-util\"\nimport { NodeModulesCollector } from \"./nodeModulesCollector\"\nimport { PM } from \"./packageManager.js\"\nimport { TraversedDependency } from \"./types.js\"\nimport * as path from \"path\"\n\n// manual traversal of node_modules for package managers without CLI support for dependency tree extraction (e.g., bun) OR as a fallback (e.g. corepack enabled w/ strict mode)\nexport class TraversalNodeModulesCollector extends NodeModulesCollector<TraversedDependency, TraversedDependency> {\n public installOptions = {\n manager: PM.TRAVERSAL,\n lockfile: \"none\",\n }\n\n protected getArgs(): string[] {\n return []\n }\n\n protected getDependenciesTree(_pm: PM): Promise<TraversedDependency> {\n log.info(null, \"using manual traversal of node_modules to build dependency tree\")\n return this.buildNodeModulesTreeManually(this.rootDir, undefined)\n }\n\n protected async collectAllDependencies(tree: TraversedDependency, appPackageName: string) {\n for (const [, value] of Object.entries({ ...tree.dependencies, ...tree.optionalDependencies })) {\n this.allDependencies.set(this.packageVersionString(value), value)\n await this.collectAllDependencies(value, appPackageName)\n }\n }\n\n // we don't need to check optional dependencies here because they're pre-processed in `buildNodeModulesTreeManually`\n protected async extractProductionDependencyGraph(tree: TraversedDependency, dependencyId: string): Promise<void> {\n if (this.productionGraph[dependencyId]) {\n return\n }\n this.productionGraph[dependencyId] = { dependencies: [] }\n\n const prodDependencies = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) }\n\n const collectedDependencies: string[] = []\n for (const packageName in prodDependencies) {\n const dependency = prodDependencies[packageName]\n const childDependencyId = this.packageVersionString(dependency)\n await this.extractProductionDependencyGraph(dependency, childDependencyId)\n collectedDependencies.push(childDependencyId)\n }\n this.productionGraph[dependencyId] = { dependencies: collectedDependencies }\n }\n\n protected async parseDependenciesTree(jsonBlob: string): Promise<TraversedDependency> {\n return Promise.resolve(JSON.parse(jsonBlob))\n }\n\n /**\n * Builds a dependency tree using only package.json dependencies and optionalDependencies.\n * This skips devDependencies and uses Node.js module resolution (require.resolve).\n */\n private async buildNodeModulesTreeManually(baseDir: string, aliasName: string | undefined): Promise<TraversedDependency> {\n // Track visited packages by their resolved path to prevent infinite loops\n const visited = new Set<string>()\n const resolvedBaseDir = await this.cache.realPath[baseDir]\n\n /**\n * Recursively builds dependency tree starting from a package directory.\n * @param packageDir - The directory of the package to process\n * @param aliasName - Optional alias name for npm aliased dependencies (e.g., \"foo\": \"npm:@scope/bar@1.0.0\")\n * When provided, this name is used instead of the package.json name for the module name,\n * ensuring the package is copied to the correct location in node_modules.\n */\n const buildFromPackage = async (packageDir: string, aliasName: string | undefined): Promise<TraversedDependency> => {\n const pkgPath = path.join(packageDir, \"package.json\")\n\n if (!(await this.cache.exists[pkgPath])) {\n throw new Error(`package.json not found at ${pkgPath}`)\n }\n\n const pkg = (await this.cache.json[pkgPath])!\n const resolvedPackageDir = await this.cache.realPath[packageDir]\n\n // Use the alias name if provided, otherwise fall back to the package.json name\n // This ensures npm aliased packages are copied to the correct location\n const moduleName = aliasName ?? pkg.name\n\n // Use resolved path as the unique identifier to prevent circular dependencies\n if (visited.has(resolvedPackageDir)) {\n log.debug({ name: moduleName, version: pkg.version, path: resolvedPackageDir }, \"skipping already visited package\")\n\n return {\n name: moduleName,\n version: pkg.version,\n path: resolvedPackageDir,\n }\n }\n\n visited.add(resolvedPackageDir)\n\n const buildPackage = async (dependencies: Record<string, string> | undefined, nullHandler: (depName: string, version: string) => void) => {\n const builtPackages: Record<string, TraversedDependency> = {}\n for (const [depName, depVersion] of Object.entries(dependencies || {})) {\n const pkg = await this.locatePackageWithVersion({ name: depName, version: depVersion, path: resolvedPackageDir })\n\n const logFields = { parent: moduleName, dependency: depName, version: depVersion }\n if (pkg == null) {\n nullHandler(depName, depVersion)\n continue\n }\n\n // Skip if this dependency resolves to the base directory or any parent we're already processing\n if (pkg.packageDir === resolvedPackageDir || pkg.packageDir === resolvedBaseDir) {\n log.debug({ ...logFields, resolvedPath: pkg.packageDir }, \"skipping self-referential dependency\")\n continue\n }\n\n log.debug(logFields, \"processing production dependency\")\n builtPackages[depName] = await buildFromPackage(pkg.packageDir, depName)\n }\n return builtPackages\n }\n\n const prodDeps = await buildPackage(pkg.dependencies, (depName: string, version: string) => {\n log.error({ parent: moduleName, dependency: depName, version }, \"production dependency not found\")\n throw new Error(`Production dependency ${depName} not found for package ${moduleName}`)\n })\n\n const optionalDeps = await buildPackage(pkg.optionalDependencies, (depName: string) => {\n log.debug({ parent: moduleName, dependency: depName }, \"optional dependency not installed, skipping\")\n })\n\n return {\n name: moduleName,\n version: pkg.version,\n path: resolvedPackageDir,\n dependencies: Object.keys(prodDeps).length > 0 ? prodDeps : undefined,\n optionalDependencies: Object.keys(optionalDeps).length > 0 ? optionalDeps : undefined,\n }\n }\n\n return buildFromPackage(baseDir, aliasName)\n }\n}\n"]}
1
+ {"version":3,"file":"traversalNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/traversalNodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,+CAAkC;AAClC,iEAA6D;AAC7D,2DAAwC;AAExC,6BAA4B;AAE5B,+KAA+K;AAC/K,MAAa,6BAA8B,SAAQ,2CAA8D;IAAjH;;QACS,mBAAc,GAAG;YACtB,OAAO,EAAE,sBAAE,CAAC,SAAS;YACrB,QAAQ,EAAE,MAAM;SACjB,CAAA;IA2HH,CAAC;IAzHW,OAAO;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IAES,mBAAmB,CAAC,GAAO;QAC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,CAAC;gBACD,OAAO,aAAa,CAAA;YACtB,CAAC,CAAA;YAED,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,OAAe,EAAE,OAAe,EAAE,EAAE;gBACzF,kBAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,iCAAiC,CAAC,CAAA;gBAClG,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,0BAA0B,UAAU,EAAE,CAAC,CAAA;YACzF,CAAC,CAAC,CAAA;YAEF,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC,OAAe,EAAE,EAAE;gBACpF,kBAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,6CAA6C,CAAC,CAAA;YACvG,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,IAAI,EAAE,kBAAkB;gBACxB,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBACrE,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;aACtF,CAAA;QACH,CAAC,CAAA;QAED,OAAO,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAC7C,CAAC;CACF;AA/HD,sEA+HC","sourcesContent":["import { log } from \"builder-util\"\nimport { NodeModulesCollector } from \"./nodeModulesCollector\"\nimport { PM } from \"./packageManager.js\"\nimport { TraversedDependency } from \"./types.js\"\nimport * as path from \"path\"\n\n// manual traversal of node_modules for package managers without CLI support for dependency tree extraction (e.g., bun) OR as a fallback (e.g. corepack enabled w/ strict mode)\nexport class TraversalNodeModulesCollector extends NodeModulesCollector<TraversedDependency, TraversedDependency> {\n public installOptions = {\n manager: PM.TRAVERSAL,\n lockfile: \"none\",\n }\n\n protected getArgs(): string[] {\n return []\n }\n\n protected getDependenciesTree(_pm: PM): Promise<TraversedDependency> {\n log.info(null, \"using manual traversal of node_modules to build dependency tree\")\n return this.buildNodeModulesTreeManually(this.rootDir, undefined)\n }\n\n protected async collectAllDependencies(tree: TraversedDependency, appPackageName: string) {\n for (const [, value] of Object.entries({ ...tree.dependencies, ...tree.optionalDependencies })) {\n this.allDependencies.set(this.packageVersionString(value), value)\n await this.collectAllDependencies(value, appPackageName)\n }\n }\n\n // we don't need to check optional dependencies here because they're pre-processed in `buildNodeModulesTreeManually`\n protected async extractProductionDependencyGraph(tree: TraversedDependency, dependencyId: string): Promise<void> {\n if (this.productionGraph[dependencyId]) {\n return\n }\n this.productionGraph[dependencyId] = { dependencies: [] }\n\n const prodDependencies = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) }\n\n const collectedDependencies: string[] = []\n for (const packageName in prodDependencies) {\n const dependency = prodDependencies[packageName]\n const childDependencyId = this.packageVersionString(dependency)\n await this.extractProductionDependencyGraph(dependency, childDependencyId)\n collectedDependencies.push(childDependencyId)\n }\n this.productionGraph[dependencyId] = { dependencies: collectedDependencies }\n }\n\n /**\n * Builds a dependency tree using only package.json dependencies and optionalDependencies.\n * This skips devDependencies and uses Node.js module resolution (require.resolve).\n */\n private async buildNodeModulesTreeManually(baseDir: string, aliasName: string | undefined): Promise<TraversedDependency> {\n // Track visited packages by their resolved path to prevent infinite loops\n const visited = new Set<string>()\n const resolvedBaseDir = await this.cache.realPath[baseDir]\n\n /**\n * Recursively builds dependency tree starting from a package directory.\n * @param packageDir - The directory of the package to process\n * @param aliasName - Optional alias name for npm aliased dependencies (e.g., \"foo\": \"npm:@scope/bar@1.0.0\")\n * When provided, this name is used instead of the package.json name for the module name,\n * ensuring the package is copied to the correct location in node_modules.\n */\n const buildFromPackage = async (packageDir: string, aliasName: string | undefined): Promise<TraversedDependency> => {\n const pkgPath = path.join(packageDir, \"package.json\")\n\n if (!(await this.cache.exists[pkgPath])) {\n throw new Error(`package.json not found at ${pkgPath}`)\n }\n\n const pkg = (await this.cache.json[pkgPath])!\n const resolvedPackageDir = await this.cache.realPath[packageDir]\n\n // Use the alias name if provided, otherwise fall back to the package.json name\n // This ensures npm aliased packages are copied to the correct location\n const moduleName = aliasName ?? pkg.name\n\n // Use resolved path as the unique identifier to prevent circular dependencies\n if (visited.has(resolvedPackageDir)) {\n log.debug({ name: moduleName, version: pkg.version, path: resolvedPackageDir }, \"skipping already visited package\")\n\n return {\n name: moduleName,\n version: pkg.version,\n path: resolvedPackageDir,\n }\n }\n\n visited.add(resolvedPackageDir)\n\n const buildPackage = async (dependencies: Record<string, string> | undefined, nullHandler: (depName: string, version: string) => void) => {\n const builtPackages: Record<string, TraversedDependency> = {}\n for (const [depName, depVersion] of Object.entries(dependencies || {})) {\n const pkg = await this.locatePackageWithVersion({ name: depName, version: depVersion, path: resolvedPackageDir })\n\n const logFields = { parent: moduleName, dependency: depName, version: depVersion }\n if (pkg == null) {\n nullHandler(depName, depVersion)\n continue\n }\n\n // Skip if this dependency resolves to the base directory or any parent we're already processing\n if (pkg.packageDir === resolvedPackageDir || pkg.packageDir === resolvedBaseDir) {\n log.debug({ ...logFields, resolvedPath: pkg.packageDir }, \"skipping self-referential dependency\")\n continue\n }\n\n log.debug(logFields, \"processing production dependency\")\n builtPackages[depName] = await buildFromPackage(pkg.packageDir, depName)\n }\n return builtPackages\n }\n\n const prodDeps = await buildPackage(pkg.dependencies, (depName: string, version: string) => {\n log.error({ parent: moduleName, dependency: depName, version }, \"production dependency not found\")\n throw new Error(`Production dependency ${depName} not found for package ${moduleName}`)\n })\n\n const optionalDeps = await buildPackage(pkg.optionalDependencies, (depName: string) => {\n log.debug({ parent: moduleName, dependency: depName }, \"optional dependency not installed, skipping\")\n })\n\n return {\n name: moduleName,\n version: pkg.version,\n path: resolvedPackageDir,\n dependencies: Object.keys(prodDeps).length > 0 ? prodDeps : undefined,\n optionalDependencies: Object.keys(optionalDeps).length > 0 ? optionalDeps : undefined,\n }\n }\n\n return buildFromPackage(baseDir, aliasName)\n }\n}\n"]}
@@ -211,6 +211,10 @@ export interface DmgOptions extends TargetSpecificOptions {
211
211
  * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.
212
212
  */
213
213
  backgroundColor?: string | null;
214
+ /**
215
+ * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.
216
+ */
217
+ badgeIcon?: string | null;
214
218
  /**
215
219
  * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.
216
220
  * Defaults to the application icon (`build/icon.icns`).
@@ -1 +1 @@
1
- {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\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`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). 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 */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | 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 path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: 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 * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\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 /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: 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 * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | 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). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#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 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 * @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\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
1
+ {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\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`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). 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 */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | 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 path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: 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 * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\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 /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: 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 * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | 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). Defaults to `#ffffff` (white) if no background image.\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](./contents.md#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](./contents.md#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 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 * @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\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
@@ -89,7 +89,7 @@ export declare abstract class PlatformPackager<DC extends PlatformSpecificBuildO
89
89
  private assetCatalogResults;
90
90
  protected generateAssetCatalogData(iconPath: string): Promise<AssetCatalogResult>;
91
91
  private cachedIcnsFromIconFile;
92
- private generateIcnsFromIcon;
92
+ generateIcnsFromIcon(iconPath: string): Promise<string>;
93
93
  protected getOrConvertIcon(format: IconFormat): Promise<string | null>;
94
94
  getDefaultFrameworkIcon(): string | null;
95
95
  resolveIcon(sources: Array<string>, fallbackSources: Array<string>, outputFormat: IconFormat): Promise<Array<IconInfo>>;
@@ -1 +1 @@
1
- {"version":3,"file":"platformPackager.js","sourceRoot":"","sources":["../src/platformPackager.ts"],"names":[],"mappings":";;;AA44BA,4CAEC;AAED,0EAeC;AAGD,oCAEC;AAED,sCAEC;AAx6BD,2CAAiG;AACjG,+CAeqB;AAErB,0CAAqC;AACrC,uCAA+B;AAE/B,6BAA4B;AAC5B,kCAAiC;AACjC,yBAAwB;AACxB,uCAAmC;AACnC,4DAA2D;AAC3D,8CAA8C;AAC9C,gDAA6D;AAE7D,+CAA8I;AAC9I,uDAA4E;AAC5E,2CAAwD;AACxD,mCAcgB;AAChB,kDAA2D;AAC3D,wDAA+I;AAC/I,wDAAmE;AACnE,gEAA0F;AAgB1F,MAAsB,gBAAgB;IACpC,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;IAC1B,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAA;IACpC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA;IAC7B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,CAAC;IAID,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAA;IACjC,CAAC;IAMD,YACW,IAAc,EACd,QAAkB;QADlB,SAAI,GAAJ,IAAI,CAAU;QACd,aAAQ,GAAR,QAAQ,CAAU;QANZ,kBAAa,GAAG,IAAI,eAAI,CAAgB,GAAG,EAAE,CAAC,IAAA,+BAAgB,EAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QAurBlH,wBAAmB,GAAG,IAAI,GAAG,EAAuC,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import {\n Arch,\n asArray,\n AsyncTaskManager,\n DebugLogger,\n deepAssign,\n defaultArchFromString,\n FileTransformer,\n getArchSuffix,\n getArtifactArchName,\n InvalidConfigurationError,\n isEmptyOrSpaces,\n log,\n orIfFileNotExist,\n statOrNull,\n} from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport { AppInfo } from \"./appInfo\"\nimport { checkFileInArchive } from \"./asar/asarFileChecker\"\nimport { AsarPackager } from \"./asar/asarUtil\"\nimport { AsarIntegrity, computeData } from \"./asar/integrity\"\nimport { FuseOptionsV1 } from \"./configuration\"\nimport { copyFiles, FileMatcher, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getNodeModuleFileMatcher } from \"./fileMatcher\"\nimport { createTransformer, isElectronCompileUsed } from \"./fileTransformer\"\nimport { Framework, isElectronBased } from \"./Framework\"\nimport {\n AfterPackContext,\n AsarOptions,\n CompressionLevel,\n Configuration,\n ElectronPlatformName,\n FileAssociation,\n LinuxPackager,\n Packager,\n PackagerOptions,\n Platform,\n PlatformSpecificBuildOptions,\n Target,\n TargetSpecificOptions,\n} from \"./index\"\nimport { executeAppBuilderAsJson } from \"./util/appBuilder\"\nimport { computeFileSets, computeNodeModuleFileSets, copyAppFiles, ELECTRON_COMPILE_SHIM_FILENAME, transformFiles } from \"./util/appFileCopier\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\nimport { AssetCatalogResult, generateAssetCatalogForIcon } from \"./util/macosIconComposer\"\n\nexport type DoPackOptions<DC extends PlatformSpecificBuildOptions> = {\n outDir: string\n appOutDir: string\n platformName: ElectronPlatformName\n arch: Arch\n platformSpecificBuildOptions: DC\n targets: Array<Target>\n options?: {\n sign?: boolean\n disableAsarIntegrity?: boolean\n disableFuses?: boolean\n }\n}\n\nexport abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions> {\n get packagerOptions(): PackagerOptions {\n return this.info.options\n }\n\n get buildResourcesDir(): string {\n return this.info.buildResourcesDir\n }\n\n get projectDir(): string {\n return this.info.projectDir\n }\n\n get config(): Configuration {\n return this.info.config\n }\n\n readonly platformSpecificBuildOptions: DC\n\n get resourceList(): Promise<Array<string>> {\n return this._resourceList.value\n }\n\n private readonly _resourceList = new Lazy<Array<string>>(() => orIfFileNotExist(readdir(this.info.buildResourcesDir), []))\n\n readonly appInfo: AppInfo\n\n protected constructor(\n readonly info: Packager,\n readonly platform: Platform\n ) {\n this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions((this.config as any)[platform.buildConfigurationKey])\n this.appInfo = this.prepareAppInfo(info.appInfo)\n }\n\n get compression(): CompressionLevel {\n const compression = this.platformSpecificBuildOptions.compression\n // explicitly set to null - request to use default value instead of parent (in the config)\n if (compression === null) {\n return \"normal\"\n }\n return compression || this.config.compression || \"normal\"\n }\n\n get debugLogger(): DebugLogger {\n return this.info.debugLogger\n }\n\n abstract get defaultTarget(): Array<string>\n\n // eslint-disable-next-line\n protected prepareAppInfo(appInfo: AppInfo) {\n return new AppInfo(this.info, null, this.platformSpecificBuildOptions)\n }\n\n private static normalizePlatformSpecificBuildOptions(options: any | Nullish): any {\n return options == null ? Object.create(null) : options\n }\n\n abstract createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void\n\n getCscPassword(): string {\n const password = this.doGetCscPassword()\n if (isEmptyOrSpaces(password)) {\n log.info({ reason: \"CSC_KEY_PASSWORD is not defined\" }, \"empty password will be used for code signing\")\n return \"\"\n } else {\n return password.trim()\n }\n }\n\n getCscLink(extraEnvName?: string | null): string | Nullish {\n // allow to specify as empty string\n const envValue = chooseNotNull(extraEnvName == null ? null : process.env[extraEnvName], process.env.CSC_LINK)\n return chooseNotNull(chooseNotNull(this.info.config.cscLink, this.platformSpecificBuildOptions.cscLink), envValue)\n }\n\n doGetCscPassword(): string | Nullish {\n // allow to specify as empty string\n return chooseNotNull(chooseNotNull(this.info.config.cscKeyPassword, this.platformSpecificBuildOptions.cscKeyPassword), process.env.CSC_KEY_PASSWORD)\n }\n\n protected computeAppOutDir(outDir: string, arch: Arch): string {\n return (\n this.packagerOptions.prepackaged ||\n path.join(\n outDir,\n `${this.platform.buildConfigurationKey}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}${this.platform === Platform.MAC ? \"\" : \"-unpacked\"}`\n )\n )\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any> {\n const appOutDir = this.computeAppOutDir(outDir, arch)\n await this.doPack({\n outDir,\n appOutDir,\n platformName: this.platform.nodeName as ElectronPlatformName,\n arch,\n platformSpecificBuildOptions: this.platformSpecificBuildOptions,\n targets,\n })\n this.packageInDistributableFormat(appOutDir, arch, targets, taskManager)\n }\n\n protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): void {\n if (targets.find(it => !it.isAsyncSupported) == null) {\n PlatformPackager.buildAsyncTargets(targets, taskManager, appOutDir, arch)\n return\n }\n\n taskManager.add(async () => {\n // BluebirdPromise.map doesn't invoke target.build immediately, but for RemoteTarget it is very critical to call build() before finishBuild()\n const subTaskManager = new AsyncTaskManager(this.info.cancellationToken)\n PlatformPackager.buildAsyncTargets(targets, subTaskManager, appOutDir, arch)\n await subTaskManager.awaitTasks()\n\n for (const target of targets) {\n if (!target.isAsyncSupported && !this.info.cancellationToken.cancelled) {\n await target.build(appOutDir, arch)\n }\n }\n })\n }\n\n private static buildAsyncTargets(targets: Array<Target>, taskManager: AsyncTaskManager, appOutDir: string, arch: Arch) {\n for (const target of targets) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.build(appOutDir, arch))\n }\n }\n }\n\n private getExtraFileMatchers(isResources: boolean, appOutDir: string, options: GetFileMatchersOptions): Array<FileMatcher> | null {\n const base = isResources\n ? this.getResourcesDir(appOutDir)\n : this.platform === Platform.MAC\n ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\")\n : appOutDir\n return getFileMatchers(this.config, isResources ? \"extraResources\" : \"extraFiles\", base, options)\n }\n\n createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions {\n return {\n macroExpander: it => this.expandMacro(it, arch == null ? null : Arch[arch], { \"/*\": \"{,/**/*}\" }),\n customBuildOptions,\n globalOutDir: outDir,\n defaultSrc: this.projectDir,\n }\n }\n\n protected async doPack(packOptions: DoPackOptions<DC>) {\n if (this.packagerOptions.prepackaged != null) {\n return\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n // Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256\n delete process.env.GYP_MSVS_VERSION\n\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets, options } = packOptions\n\n await this.info.emitBeforePack({\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n })\n\n await this.info.installAppDependencies(this.platform, arch)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n\n await framework.prepareApplicationStageDirectory({\n packager: this,\n appOutDir,\n platformName,\n arch: Arch[arch],\n version: framework.version,\n })\n\n await this.info.emitAfterExtract({\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n })\n\n const excludePatterns: Array<Minimatch> = []\n\n const computeParsedPatterns = (patterns: Array<FileMatcher> | null) => {\n if (patterns != null) {\n for (const pattern of patterns) {\n pattern.computeParsedPatterns(excludePatterns, this.info.projectDir)\n }\n }\n }\n\n const getFileMatchersOptions = this.createGetFileMatchersOptions(outDir, arch, platformSpecificBuildOptions)\n const macroExpander = getFileMatchersOptions.macroExpander\n const extraResourceMatchers = this.getExtraFileMatchers(true, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraResourceMatchers)\n const extraFileMatchers = this.getExtraFileMatchers(false, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraFileMatchers)\n\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const resourcesPath =\n this.platform === Platform.MAC\n ? path.join(appOutDir, framework.distMacOsAppName, \"Contents\", \"Resources\")\n : isElectronBased(framework)\n ? path.join(appOutDir, \"resources\")\n : appOutDir\n const taskManager = new AsyncTaskManager(this.info.cancellationToken)\n this.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, \"app\"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander)\n await taskManager.awaitTasks()\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n if (framework.beforeCopyExtraFiles != null) {\n const resourcesRelativePath = this.platform === Platform.MAC ? \"Resources\" : isElectronBased(framework) ? \"resources\" : \"\"\n\n let asarIntegrity: AsarIntegrity | null = null\n if (!(asarOptions == null || options?.disableAsarIntegrity)) {\n asarIntegrity = await computeData({ resourcesPath, resourcesRelativePath, resourcesDestinationPath: this.getResourcesDir(appOutDir), extraResourceMatchers })\n }\n\n await framework.beforeCopyExtraFiles({\n packager: this,\n appOutDir,\n asarIntegrity,\n platformName,\n })\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n await copyFiles(extraResourceMatchers, transformerForExtraFiles)\n await copyFiles(extraFileMatchers, transformerForExtraFiles)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.info.emitAfterPack(packContext)\n\n if (framework.afterPack != null) {\n await framework.afterPack(packContext)\n }\n\n const isAsar = asarOptions != null\n await this.sanityCheckPackage(appOutDir, isAsar, framework, !!this.config.disableSanityCheckAsar)\n\n if (!options?.disableFuses) {\n await this.doAddElectronFuses(packContext)\n }\n if (options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n // the fuses MUST be flipped right before signing\n protected async doAddElectronFuses(packContext: AfterPackContext) {\n if (this.config.electronFuses == null) {\n return\n }\n const fuseConfig = this.generateFuseConfig(this.config.electronFuses)\n await this.addElectronFuses(packContext, fuseConfig)\n }\n\n private generateFuseConfig(fuses: FuseOptionsV1): FuseV1Config {\n const config: FuseV1Config = {\n version: FuseVersion.V1,\n resetAdHocDarwinSignature: fuses.resetAdHocDarwinSignature,\n }\n // this is annoying, but we must filter out undefined entries because some older electron versions will receive `the fuse wire in this version of Electron is not long enough` even if entry is set undefined\n if (fuses.runAsNode != null) {\n config[FuseV1Options.RunAsNode] = fuses.runAsNode\n }\n if (fuses.enableCookieEncryption != null) {\n config[FuseV1Options.EnableCookieEncryption] = fuses.enableCookieEncryption\n }\n if (fuses.enableNodeOptionsEnvironmentVariable != null) {\n config[FuseV1Options.EnableNodeOptionsEnvironmentVariable] = fuses.enableNodeOptionsEnvironmentVariable\n }\n if (fuses.enableNodeCliInspectArguments != null) {\n config[FuseV1Options.EnableNodeCliInspectArguments] = fuses.enableNodeCliInspectArguments\n }\n if (fuses.enableEmbeddedAsarIntegrityValidation != null) {\n config[FuseV1Options.EnableEmbeddedAsarIntegrityValidation] = fuses.enableEmbeddedAsarIntegrityValidation\n }\n if (fuses.onlyLoadAppFromAsar != null) {\n config[FuseV1Options.OnlyLoadAppFromAsar] = fuses.onlyLoadAppFromAsar\n }\n if (fuses.loadBrowserProcessSpecificV8Snapshot != null) {\n config[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot] = fuses.loadBrowserProcessSpecificV8Snapshot\n }\n if (fuses.grantFileProtocolExtraPrivileges != null) {\n config[FuseV1Options.GrantFileProtocolExtraPrivileges] = fuses.grantFileProtocolExtraPrivileges\n }\n return config\n }\n\n /**\n * Use `AfterPackContext` here to keep available for public API\n * @param {AfterPackContext} context\n * @param {FuseConfig} fuses\n *\n * Can be used in `afterPack` hook for custom fuse logic like below. It's an alternative approach if one wants to override electron-builder's @electron/fuses version\n * ```\n * await context.packager.addElectronFuses(context, { ... })\n * ```\n */\n public addElectronFuses(context: AfterPackContext, fuses: FuseConfig) {\n const { appOutDir, electronPlatformName } = context\n\n const ext = {\n darwin: \".app\",\n mas: \".app\",\n win32: \".exe\",\n linux: \"\",\n }[electronPlatformName]\n\n const executableName = this instanceof LinuxPackager ? this.executableName : this.appInfo.productFilename\n const electronBinaryPath = path.join(appOutDir, `${executableName}${ext}`)\n\n log.info({ electronPath: log.filePath(electronBinaryPath) }, \"executing @electron/fuses\")\n return flipFuses(electronBinaryPath, fuses)\n }\n\n protected async doSignAfterPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array<Target>) {\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const isAsar = asarOptions != null\n const packContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n const didSign = await this.signApp(packContext, isAsar)\n if (didSign) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n }\n\n // eslint-disable-next-line\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n return null\n }\n\n private copyAppFiles(\n taskManager: AsyncTaskManager,\n asarOptions: AsarOptions | null,\n resourcePath: string,\n defaultDestination: string,\n packContext: AfterPackContext,\n platformSpecificBuildOptions: DC,\n excludePatterns: Array<Minimatch>,\n macroExpander: (it: string) => string\n ) {\n const appDir = this.info.appDir\n const config = this.config\n const isElectronCompile = asarOptions != null && isElectronCompileUsed(this.info)\n\n const mainMatchers = getMainFileMatchers(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this, packContext.outDir, isElectronCompile)\n if (excludePatterns.length > 0) {\n for (const matcher of mainMatchers) {\n matcher.excludePatterns = excludePatterns\n }\n }\n\n const framework = this.info.framework\n const transformer = createTransformer(\n appDir,\n config,\n isElectronCompile\n ? {\n originalMain: this.info.metadata.main,\n main: ELECTRON_COMPILE_SHIM_FILENAME,\n ...config.extraMetadata,\n }\n : config.extraMetadata,\n framework.createTransformer == null ? null : framework.createTransformer()\n )\n\n const _computeFileSets = (matchers: Array<FileMatcher>) => {\n return computeFileSets(matchers, this.info.isPrepackedAppAsar ? null : transformer, this, isElectronCompile).then(async result => {\n if (!this.info.isPrepackedAppAsar && !this.info.areNodeModulesHandledExternally) {\n const moduleFileMatcher = getNodeModuleFileMatcher(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this.info)\n result = result.concat(await computeNodeModuleFileSets(this, moduleFileMatcher))\n }\n return result.filter(it => it.files.length > 0)\n })\n }\n\n if (this.info.isPrepackedAppAsar) {\n taskManager.add(async () => {\n const fileSets = await _computeFileSets([new FileMatcher(appDir, resourcePath, macroExpander)])\n fileSets.forEach(it => taskManager.addTask(copyAppFiles(it, this.info, transformer)))\n await taskManager.awaitTasks()\n })\n } else if (asarOptions == null) {\n // for ASAR all asar unpacked files will be extra transformed (e.g. sign of EXE and DLL) later,\n // for prepackaged asar extra transformation not supported yet,\n // so, extra transform if asar is disabled\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n const combinedTransformer: FileTransformer = file => {\n if (transformerForExtraFiles != null) {\n const result = transformerForExtraFiles(file)\n if (result != null) {\n return result\n }\n }\n return transformer(file)\n }\n taskManager.add(async () => {\n const fileSets = await _computeFileSets(mainMatchers)\n fileSets.forEach(it => taskManager.addTask(copyAppFiles(it, this.info, combinedTransformer)))\n await taskManager.awaitTasks()\n })\n } else {\n const unpackPattern = getFileMatchers(config, \"asarUnpack\", defaultDestination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: packContext.outDir,\n defaultSrc: appDir,\n })\n const fileMatcher = unpackPattern == null ? null : unpackPattern[0]\n taskManager.addTask(\n _computeFileSets(mainMatchers).then(async fileSets => {\n for (const fileSet of fileSets) {\n await transformFiles(transformer, fileSet)\n }\n\n await new AsarPackager(this, {\n defaultDestination,\n resourcePath,\n options: asarOptions,\n unpackPattern: fileMatcher?.createFilter(),\n }).pack(fileSets)\n })\n )\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n return Promise.resolve(false)\n }\n\n getIconPath(): Promise<string | null> {\n return Promise.resolve(null)\n }\n\n private async computeAsarOptions(customBuildOptions: DC): Promise<AsarOptions | null> {\n if (!isElectronBased(this.info.framework)) {\n return null\n }\n\n function errorMessage(name: string) {\n return `${name} is deprecated is deprecated and not supported — please use asarUnpack`\n }\n\n const buildMetadata = this.config as any\n if (buildMetadata[\"asar-unpack\"] != null) {\n throw new Error(errorMessage(\"asar-unpack\"))\n }\n if (buildMetadata[\"asar-unpack-dir\"] != null) {\n throw new Error(errorMessage(\"asar-unpack-dir\"))\n }\n\n const platformSpecific = customBuildOptions.asar\n const result = platformSpecific == null ? this.config.asar : platformSpecific\n if (result === false) {\n const appAsarStat = await statOrNull(path.join(this.info.appDir, \"app.asar\"))\n //noinspection ES6MissingAwait\n if (appAsarStat == null || !appAsarStat.isFile()) {\n log.warn(\n {\n solution: \"enable asar and use asarUnpack to unpack files that must be externally available\",\n },\n \"asar usage is disabled — this is strongly not recommended\"\n )\n }\n return null\n }\n\n if (result == null || result === true) {\n return {}\n }\n\n for (const name of [\"unpackDir\", \"unpack\"]) {\n if ((result as any)[name] != null) {\n throw new Error(errorMessage(`asar.${name}`))\n }\n }\n return deepAssign({}, result)\n }\n\n public getElectronSrcDir(dist: string): string {\n return path.resolve(this.projectDir, dist)\n }\n\n public getElectronDestinationDir(appOutDir: string): string {\n return appOutDir\n }\n\n getResourcesDir(appOutDir: string): string {\n if (this.platform === Platform.MAC) {\n return this.getMacOsResourcesDir(appOutDir)\n }\n if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n }\n return appOutDir\n }\n\n public getMacOsElectronFrameworkResourcesDir(appOutDir: string): string {\n const electronFrameworkName = path.basename(this.info.framework.distMacOsAppName, \".app\") + \" \" + \"Framework.framework\"\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Frameworks\", electronFrameworkName, \"Resources\")\n }\n public getMacOsResourcesDir(appOutDir: string): string {\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Resources\")\n }\n\n private async checkFileInPackage(resourcesDir: string, file: string, messagePrefix: string, isAsar: boolean, disableSanityCheckAsar: boolean) {\n if (isAsar && disableSanityCheckAsar) {\n return\n }\n const relativeFile = path.relative(this.info.appDir, path.resolve(this.info.appDir, file))\n if (isAsar) {\n checkFileInArchive(path.join(resourcesDir, \"app.asar\"), relativeFile, messagePrefix)\n return\n }\n\n const pathParsed = path.parse(file)\n // Even when packaging to asar is disabled, it does not imply that the main file can not be inside an .asar archive.\n // This may occur when the packaging is done manually before processing with electron-builder.\n if (pathParsed.dir.includes(\".asar\")) {\n // The path needs to be split to the part with an asar archive which acts like a directory and the part with\n // the path to main file itself. (e.g. path/arch.asar/dir/index.js -> path/arch.asar, dir/index.js)\n // noinspection TypeScriptValidateJSTypes\n const pathSplit: Array<string> = pathParsed.dir.split(path.sep)\n let partWithAsarIndex = 0\n pathSplit.some((pathPart: string, index: number) => {\n partWithAsarIndex = index\n return pathPart.endsWith(\".asar\")\n })\n const asarPath = path.join(...pathSplit.slice(0, partWithAsarIndex + 1))\n let mainPath = pathSplit.length > partWithAsarIndex + 1 ? path.join.apply(pathSplit.slice(partWithAsarIndex + 1)) : \"\"\n mainPath += path.join(mainPath, pathParsed.base)\n checkFileInArchive(path.join(resourcesDir, \"app\", asarPath), mainPath, messagePrefix)\n } else {\n const fullPath = path.join(resourcesDir, \"app\", relativeFile)\n const outStat = await statOrNull(fullPath)\n if (outStat == null) {\n throw new Error(`${messagePrefix} \"${fullPath}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isFile()) {\n throw new Error(`${messagePrefix} \"${fullPath}\" is not a file. Seems like a wrong configuration.`)\n }\n }\n }\n }\n\n private async sanityCheckPackage(appOutDir: string, isAsar: boolean, framework: Framework, disableSanityCheckAsar: boolean): Promise<any> {\n const outStat = await statOrNull(appOutDir)\n if (outStat == null) {\n throw new Error(`Output directory \"${appOutDir}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isDirectory()) {\n throw new Error(`Output directory \"${appOutDir}\" is not a directory. Seems like a wrong configuration.`)\n }\n }\n\n const resourcesDir = this.getResourcesDir(appOutDir)\n const mainFile = (framework.getMainFile == null ? null : framework.getMainFile(this.platform)) || this.info.metadata.main || \"index.js\"\n await this.checkFileInPackage(resourcesDir, mainFile, \"Application entry file\", isAsar, disableSanityCheckAsar)\n await this.checkFileInPackage(resourcesDir, \"package.json\", \"Application\", isAsar, disableSanityCheckAsar)\n }\n\n // tslint:disable-next-line:no-invalid-template-strings\n computeSafeArtifactName(\n suggestedName: string | null,\n ext: string,\n arch?: Arch | null,\n skipDefaultArch = true,\n defaultArch?: string,\n safePattern = \"${name}-${version}-${arch}.${ext}\"\n ): string | null {\n return computeSafeArtifactNameIfNeeded(suggestedName, () =>\n this.computeArtifactName(safePattern, ext, skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n )\n }\n\n expandArtifactNamePattern(\n targetSpecificOptions: TargetSpecificOptions | Nullish,\n ext: string,\n arch?: Arch | null,\n defaultPattern?: string,\n skipDefaultArch = true,\n defaultArch?: string\n ): string {\n const { pattern, isUserForced } = this.artifactPatternConfig(targetSpecificOptions, defaultPattern)\n return this.computeArtifactName(pattern, ext, !isUserForced && skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n }\n\n artifactPatternConfig(targetSpecificOptions: TargetSpecificOptions | Nullish, defaultPattern: string | undefined) {\n const userSpecifiedPattern = targetSpecificOptions?.artifactName || this.platformSpecificBuildOptions.artifactName || this.config.artifactName\n return {\n isUserForced: !!userSpecifiedPattern,\n pattern: userSpecifiedPattern || defaultPattern || \"${productName}-${version}-${arch}.${ext}\",\n }\n }\n\n expandArtifactBeautyNamePattern(targetSpecificOptions: TargetSpecificOptions | Nullish, ext: string, arch?: Arch | null): string {\n // tslint:disable-next-line:no-invalid-template-strings\n return this.expandArtifactNamePattern(targetSpecificOptions, ext, arch, \"${productName} ${version} ${arch}.${ext}\", true)\n }\n\n private computeArtifactName(pattern: any, ext: string, arch: Arch | Nullish): string {\n const archName = arch == null ? null : getArtifactArchName(arch, ext)\n return this.expandMacro(pattern, archName, {\n ext,\n })\n }\n\n expandMacro(pattern: string, arch?: string | null, extra: any = {}, isProductNameSanitized = true): string {\n return doExpandMacro(pattern, arch, this.appInfo, { os: this.platform.buildConfigurationKey, ...extra }, isProductNameSanitized)\n }\n\n generateName2(ext: string | null, classifier: string | Nullish, deployment: boolean): string {\n const dotExt = ext == null ? \"\" : `.${ext}`\n const separator = ext === \"deb\" ? \"_\" : \"-\"\n return `${deployment ? this.appInfo.name : this.appInfo.productFilename}${separator}${this.appInfo.version}${classifier == null ? \"\" : `${separator}${classifier}`}${dotExt}`\n }\n\n getTempFile(suffix: string): Promise<string> {\n return this.info.tempDirManager.getTempFile({ suffix })\n }\n\n get fileAssociations(): Array<FileAssociation> {\n return asArray(this.config.fileAssociations).concat(asArray(this.platformSpecificBuildOptions.fileAssociations))\n }\n\n async getResource(custom: string | Nullish, ...names: Array<string>): Promise<string | null> {\n const resourcesDir = this.info.buildResourcesDir\n if (custom === undefined) {\n const resourceList = await this.resourceList\n for (const name of names) {\n if (resourceList.includes(name)) {\n return path.join(resourcesDir, name)\n }\n }\n } else if (custom != null && !isEmptyOrSpaces(custom)) {\n const resourceList = await this.resourceList\n if (resourceList.includes(custom)) {\n return path.join(resourcesDir, custom)\n }\n\n let p = path.resolve(resourcesDir, custom)\n if ((await statOrNull(p)) == null) {\n p = path.resolve(this.projectDir, custom)\n if ((await statOrNull(p)) == null) {\n throw new InvalidConfigurationError(\n `cannot find specified resource \"${custom}\", nor relative to \"${resourcesDir}\", neither relative to project dir (\"${this.projectDir}\")`\n )\n }\n }\n return p\n }\n return null\n }\n\n get forceCodeSigning(): boolean {\n const forceCodeSigningPlatform = this.platformSpecificBuildOptions.forceCodeSigning\n return (forceCodeSigningPlatform == null ? this.config.forceCodeSigning : forceCodeSigningPlatform) || false\n }\n\n private assetCatalogResults = new Map<string, Promise<AssetCatalogResult>>()\n protected generateAssetCatalogData(iconPath: string): Promise<AssetCatalogResult> {\n // Cache results\n const cachedPromise = this.assetCatalogResults.get(iconPath)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = generateAssetCatalogForIcon(iconPath)\n this.assetCatalogResults.set(iconPath, promise)\n return promise\n }\n\n private cachedIcnsFromIconFile = new Map<string, Promise<string>>()\n private async generateIcnsFromIcon(iconPath: string): Promise<string> {\n const cachedPromise = this.cachedIcnsFromIconFile.get(iconPath)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const runner = async () => {\n const { icnsFile } = await this.generateAssetCatalogData(iconPath)\n\n // Generate icns file\n const tempDir = await fs.mkdtemp(path.resolve(os.tmpdir(), \"icon-compile-\"))\n const tempIcnsPath = path.resolve(tempDir, \"Icon.icns\")\n await fs.writeFile(tempIcnsPath, icnsFile)\n\n return tempIcnsPath\n }\n const promise = runner()\n this.cachedIcnsFromIconFile.set(iconPath, promise)\n return promise\n }\n\n protected async getOrConvertIcon(format: IconFormat): Promise<string | null> {\n if (format === \"icns\") {\n const configuredIcon = this.platformSpecificBuildOptions.icon\n // If it is a .icon file, generate the icns file and return the path to the icns file\n if (configuredIcon?.endsWith(\".icon\")) {\n const iconPath = await this.getResource(configuredIcon)\n if (iconPath) {\n return this.generateIcnsFromIcon(iconPath)\n }\n }\n }\n\n const result = await this.resolveIcon(asArray(this.platformSpecificBuildOptions.icon || this.config.icon), [], format)\n if (result.length === 0) {\n const framework = this.info.framework\n if (framework.getDefaultIcon != null) {\n return framework.getDefaultIcon(this.platform)\n }\n\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(framework.name)} icon is used`)\n return this.getDefaultFrameworkIcon()\n } else {\n return result[0].file\n }\n }\n\n getDefaultFrameworkIcon(): string | null {\n const framework = this.info.framework\n return framework.getDefaultIcon == null ? null : framework.getDefaultIcon(this.platform)\n }\n\n // convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example))\n async resolveIcon(sources: Array<string>, fallbackSources: Array<string>, outputFormat: IconFormat): Promise<Array<IconInfo>> {\n const output = this.expandMacro(this.config.directories!.output!)\n const args = [\n \"icon\",\n \"--format\",\n outputFormat,\n \"--root\",\n this.buildResourcesDir,\n \"--root\",\n this.projectDir,\n \"--out\",\n path.resolve(this.projectDir, output, `.icon-${outputFormat}`),\n ]\n for (const source of sources) {\n if (source.endsWith(\".icon\")) {\n // Ignore .icon files: they will cause the format conversion to fail\n continue\n }\n args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\n if (source.endsWith(\".icon\")) {\n // Ignore .icon files: they will cause the format conversion to fail\n continue\n }\n args.push(\"--fallback-input\", source)\n }\n\n const result: IconConvertResult = await executeAppBuilderAsJson(args)\n const errorMessage = result.error\n if (errorMessage != null) {\n throw new InvalidConfigurationError(errorMessage, result.errorCode)\n }\n\n if (result.isFallback) {\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(this.info.framework.name)} icon is used`)\n }\n\n return result.icons || []\n }\n}\n\nexport interface IconInfo {\n file: string\n size: number\n}\n\ninterface IconConvertResult {\n icons?: Array<IconInfo>\n\n error?: string\n errorCode?: string\n isFallback?: boolean\n}\n\nexport type IconFormat = \"icns\" | \"ico\" | \"set\"\n\nexport function isSafeGithubName(name: string) {\n return /^[0-9A-Za-z._-]+$/.test(name)\n}\n\nexport function computeSafeArtifactNameIfNeeded(suggestedName: string | null, safeNameProducer: () => string): string | null {\n // GitHub only allows the listed characters in file names.\n if (suggestedName != null) {\n if (isSafeGithubName(suggestedName)) {\n return null\n }\n\n // prefer to use suggested name - so, if space is the only problem, just replace only space to dash\n suggestedName = suggestedName.replace(/ /g, \"-\")\n if (isSafeGithubName(suggestedName)) {\n return suggestedName\n }\n }\n\n return safeNameProducer()\n}\n\n// remove leading dot\nexport function normalizeExt(ext: string) {\n return ext.startsWith(\".\") ? ext.substring(1) : ext\n}\n\nexport function chooseNotNull<T>(v1: T | Nullish, v2: T | Nullish): T | Nullish {\n return v1 == null ? v2 : v1\n}\n\nfunction capitalizeFirstLetter(text: string) {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n"]}
1
+ {"version":3,"file":"platformPackager.js","sourceRoot":"","sources":["../src/platformPackager.ts"],"names":[],"mappings":";;;AA44BA,4CAEC;AAED,0EAeC;AAGD,oCAEC;AAED,sCAEC;AAx6BD,2CAAiG;AACjG,+CAeqB;AAErB,0CAAqC;AACrC,uCAA+B;AAE/B,6BAA4B;AAC5B,kCAAiC;AACjC,yBAAwB;AACxB,uCAAmC;AACnC,4DAA2D;AAC3D,8CAA8C;AAC9C,gDAA6D;AAE7D,+CAA8I;AAC9I,uDAA4E;AAC5E,2CAAwD;AACxD,mCAcgB;AAChB,kDAA2D;AAC3D,wDAA+I;AAC/I,wDAAmE;AACnE,gEAA0F;AAgB1F,MAAsB,gBAAgB;IACpC,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;IAC1B,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAA;IACpC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA;IAC7B,CAAC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C,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;AACrD,CAAC;AAED,SAAgB,aAAa,CAAI,EAAe,EAAE,EAAe;IAC/D,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AAC7B,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC","sourcesContent":["import { flipFuses, FuseConfig, FuseV1Config, FuseV1Options, FuseVersion } from \"@electron/fuses\"\nimport {\n Arch,\n asArray,\n AsyncTaskManager,\n DebugLogger,\n deepAssign,\n defaultArchFromString,\n FileTransformer,\n getArchSuffix,\n getArtifactArchName,\n InvalidConfigurationError,\n isEmptyOrSpaces,\n log,\n orIfFileNotExist,\n statOrNull,\n} from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport { AppInfo } from \"./appInfo\"\nimport { checkFileInArchive } from \"./asar/asarFileChecker\"\nimport { AsarPackager } from \"./asar/asarUtil\"\nimport { AsarIntegrity, computeData } from \"./asar/integrity\"\nimport { FuseOptionsV1 } from \"./configuration\"\nimport { copyFiles, FileMatcher, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getNodeModuleFileMatcher } from \"./fileMatcher\"\nimport { createTransformer, isElectronCompileUsed } from \"./fileTransformer\"\nimport { Framework, isElectronBased } from \"./Framework\"\nimport {\n AfterPackContext,\n AsarOptions,\n CompressionLevel,\n Configuration,\n ElectronPlatformName,\n FileAssociation,\n LinuxPackager,\n Packager,\n PackagerOptions,\n Platform,\n PlatformSpecificBuildOptions,\n Target,\n TargetSpecificOptions,\n} from \"./index\"\nimport { executeAppBuilderAsJson } from \"./util/appBuilder\"\nimport { computeFileSets, computeNodeModuleFileSets, copyAppFiles, ELECTRON_COMPILE_SHIM_FILENAME, transformFiles } from \"./util/appFileCopier\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\nimport { AssetCatalogResult, generateAssetCatalogForIcon } from \"./util/macosIconComposer\"\n\nexport type DoPackOptions<DC extends PlatformSpecificBuildOptions> = {\n outDir: string\n appOutDir: string\n platformName: ElectronPlatformName\n arch: Arch\n platformSpecificBuildOptions: DC\n targets: Array<Target>\n options?: {\n sign?: boolean\n disableAsarIntegrity?: boolean\n disableFuses?: boolean\n }\n}\n\nexport abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions> {\n get packagerOptions(): PackagerOptions {\n return this.info.options\n }\n\n get buildResourcesDir(): string {\n return this.info.buildResourcesDir\n }\n\n get projectDir(): string {\n return this.info.projectDir\n }\n\n get config(): Configuration {\n return this.info.config\n }\n\n readonly platformSpecificBuildOptions: DC\n\n get resourceList(): Promise<Array<string>> {\n return this._resourceList.value\n }\n\n private readonly _resourceList = new Lazy<Array<string>>(() => orIfFileNotExist(readdir(this.info.buildResourcesDir), []))\n\n readonly appInfo: AppInfo\n\n protected constructor(\n readonly info: Packager,\n readonly platform: Platform\n ) {\n this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions((this.config as any)[platform.buildConfigurationKey])\n this.appInfo = this.prepareAppInfo(info.appInfo)\n }\n\n get compression(): CompressionLevel {\n const compression = this.platformSpecificBuildOptions.compression\n // explicitly set to null - request to use default value instead of parent (in the config)\n if (compression === null) {\n return \"normal\"\n }\n return compression || this.config.compression || \"normal\"\n }\n\n get debugLogger(): DebugLogger {\n return this.info.debugLogger\n }\n\n abstract get defaultTarget(): Array<string>\n\n // eslint-disable-next-line\n protected prepareAppInfo(appInfo: AppInfo) {\n return new AppInfo(this.info, null, this.platformSpecificBuildOptions)\n }\n\n private static normalizePlatformSpecificBuildOptions(options: any | Nullish): any {\n return options == null ? Object.create(null) : options\n }\n\n abstract createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void\n\n getCscPassword(): string {\n const password = this.doGetCscPassword()\n if (isEmptyOrSpaces(password)) {\n log.info({ reason: \"CSC_KEY_PASSWORD is not defined\" }, \"empty password will be used for code signing\")\n return \"\"\n } else {\n return password.trim()\n }\n }\n\n getCscLink(extraEnvName?: string | null): string | Nullish {\n // allow to specify as empty string\n const envValue = chooseNotNull(extraEnvName == null ? null : process.env[extraEnvName], process.env.CSC_LINK)\n return chooseNotNull(chooseNotNull(this.info.config.cscLink, this.platformSpecificBuildOptions.cscLink), envValue)\n }\n\n doGetCscPassword(): string | Nullish {\n // allow to specify as empty string\n return chooseNotNull(chooseNotNull(this.info.config.cscKeyPassword, this.platformSpecificBuildOptions.cscKeyPassword), process.env.CSC_KEY_PASSWORD)\n }\n\n protected computeAppOutDir(outDir: string, arch: Arch): string {\n return (\n this.packagerOptions.prepackaged ||\n path.join(\n outDir,\n `${this.platform.buildConfigurationKey}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}${this.platform === Platform.MAC ? \"\" : \"-unpacked\"}`\n )\n )\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any> {\n const appOutDir = this.computeAppOutDir(outDir, arch)\n await this.doPack({\n outDir,\n appOutDir,\n platformName: this.platform.nodeName as ElectronPlatformName,\n arch,\n platformSpecificBuildOptions: this.platformSpecificBuildOptions,\n targets,\n })\n this.packageInDistributableFormat(appOutDir, arch, targets, taskManager)\n }\n\n protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): void {\n if (targets.find(it => !it.isAsyncSupported) == null) {\n PlatformPackager.buildAsyncTargets(targets, taskManager, appOutDir, arch)\n return\n }\n\n taskManager.add(async () => {\n // BluebirdPromise.map doesn't invoke target.build immediately, but for RemoteTarget it is very critical to call build() before finishBuild()\n const subTaskManager = new AsyncTaskManager(this.info.cancellationToken)\n PlatformPackager.buildAsyncTargets(targets, subTaskManager, appOutDir, arch)\n await subTaskManager.awaitTasks()\n\n for (const target of targets) {\n if (!target.isAsyncSupported && !this.info.cancellationToken.cancelled) {\n await target.build(appOutDir, arch)\n }\n }\n })\n }\n\n private static buildAsyncTargets(targets: Array<Target>, taskManager: AsyncTaskManager, appOutDir: string, arch: Arch) {\n for (const target of targets) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.build(appOutDir, arch))\n }\n }\n }\n\n private getExtraFileMatchers(isResources: boolean, appOutDir: string, options: GetFileMatchersOptions): Array<FileMatcher> | null {\n const base = isResources\n ? this.getResourcesDir(appOutDir)\n : this.platform === Platform.MAC\n ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\")\n : appOutDir\n return getFileMatchers(this.config, isResources ? \"extraResources\" : \"extraFiles\", base, options)\n }\n\n createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions {\n return {\n macroExpander: it => this.expandMacro(it, arch == null ? null : Arch[arch], { \"/*\": \"{,/**/*}\" }),\n customBuildOptions,\n globalOutDir: outDir,\n defaultSrc: this.projectDir,\n }\n }\n\n protected async doPack(packOptions: DoPackOptions<DC>) {\n if (this.packagerOptions.prepackaged != null) {\n return\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n // Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256\n delete process.env.GYP_MSVS_VERSION\n\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets, options } = packOptions\n\n await this.info.emitBeforePack({\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n })\n\n await this.info.installAppDependencies(this.platform, arch)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n\n await framework.prepareApplicationStageDirectory({\n packager: this,\n appOutDir,\n platformName,\n arch: Arch[arch],\n version: framework.version,\n })\n\n await this.info.emitAfterExtract({\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n })\n\n const excludePatterns: Array<Minimatch> = []\n\n const computeParsedPatterns = (patterns: Array<FileMatcher> | null) => {\n if (patterns != null) {\n for (const pattern of patterns) {\n pattern.computeParsedPatterns(excludePatterns, this.info.projectDir)\n }\n }\n }\n\n const getFileMatchersOptions = this.createGetFileMatchersOptions(outDir, arch, platformSpecificBuildOptions)\n const macroExpander = getFileMatchersOptions.macroExpander\n const extraResourceMatchers = this.getExtraFileMatchers(true, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraResourceMatchers)\n const extraFileMatchers = this.getExtraFileMatchers(false, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraFileMatchers)\n\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const resourcesPath =\n this.platform === Platform.MAC\n ? path.join(appOutDir, framework.distMacOsAppName, \"Contents\", \"Resources\")\n : isElectronBased(framework)\n ? path.join(appOutDir, \"resources\")\n : appOutDir\n const taskManager = new AsyncTaskManager(this.info.cancellationToken)\n this.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, \"app\"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander)\n await taskManager.awaitTasks()\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n if (framework.beforeCopyExtraFiles != null) {\n const resourcesRelativePath = this.platform === Platform.MAC ? \"Resources\" : isElectronBased(framework) ? \"resources\" : \"\"\n\n let asarIntegrity: AsarIntegrity | null = null\n if (!(asarOptions == null || options?.disableAsarIntegrity)) {\n asarIntegrity = await computeData({ resourcesPath, resourcesRelativePath, resourcesDestinationPath: this.getResourcesDir(appOutDir), extraResourceMatchers })\n }\n\n await framework.beforeCopyExtraFiles({\n packager: this,\n appOutDir,\n asarIntegrity,\n platformName,\n })\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n await copyFiles(extraResourceMatchers, transformerForExtraFiles)\n await copyFiles(extraFileMatchers, transformerForExtraFiles)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.info.emitAfterPack(packContext)\n\n if (framework.afterPack != null) {\n await framework.afterPack(packContext)\n }\n\n const isAsar = asarOptions != null\n await this.sanityCheckPackage(appOutDir, isAsar, framework, !!this.config.disableSanityCheckAsar)\n\n if (!options?.disableFuses) {\n await this.doAddElectronFuses(packContext)\n }\n if (options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n // the fuses MUST be flipped right before signing\n protected async doAddElectronFuses(packContext: AfterPackContext) {\n if (this.config.electronFuses == null) {\n return\n }\n const fuseConfig = this.generateFuseConfig(this.config.electronFuses)\n await this.addElectronFuses(packContext, fuseConfig)\n }\n\n private generateFuseConfig(fuses: FuseOptionsV1): FuseV1Config {\n const config: FuseV1Config = {\n version: FuseVersion.V1,\n resetAdHocDarwinSignature: fuses.resetAdHocDarwinSignature,\n }\n // this is annoying, but we must filter out undefined entries because some older electron versions will receive `the fuse wire in this version of Electron is not long enough` even if entry is set undefined\n if (fuses.runAsNode != null) {\n config[FuseV1Options.RunAsNode] = fuses.runAsNode\n }\n if (fuses.enableCookieEncryption != null) {\n config[FuseV1Options.EnableCookieEncryption] = fuses.enableCookieEncryption\n }\n if (fuses.enableNodeOptionsEnvironmentVariable != null) {\n config[FuseV1Options.EnableNodeOptionsEnvironmentVariable] = fuses.enableNodeOptionsEnvironmentVariable\n }\n if (fuses.enableNodeCliInspectArguments != null) {\n config[FuseV1Options.EnableNodeCliInspectArguments] = fuses.enableNodeCliInspectArguments\n }\n if (fuses.enableEmbeddedAsarIntegrityValidation != null) {\n config[FuseV1Options.EnableEmbeddedAsarIntegrityValidation] = fuses.enableEmbeddedAsarIntegrityValidation\n }\n if (fuses.onlyLoadAppFromAsar != null) {\n config[FuseV1Options.OnlyLoadAppFromAsar] = fuses.onlyLoadAppFromAsar\n }\n if (fuses.loadBrowserProcessSpecificV8Snapshot != null) {\n config[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot] = fuses.loadBrowserProcessSpecificV8Snapshot\n }\n if (fuses.grantFileProtocolExtraPrivileges != null) {\n config[FuseV1Options.GrantFileProtocolExtraPrivileges] = fuses.grantFileProtocolExtraPrivileges\n }\n return config\n }\n\n /**\n * Use `AfterPackContext` here to keep available for public API\n * @param {AfterPackContext} context\n * @param {FuseConfig} fuses\n *\n * Can be used in `afterPack` hook for custom fuse logic like below. It's an alternative approach if one wants to override electron-builder's @electron/fuses version\n * ```\n * await context.packager.addElectronFuses(context, { ... })\n * ```\n */\n public addElectronFuses(context: AfterPackContext, fuses: FuseConfig) {\n const { appOutDir, electronPlatformName } = context\n\n const ext = {\n darwin: \".app\",\n mas: \".app\",\n win32: \".exe\",\n linux: \"\",\n }[electronPlatformName]\n\n const executableName = this instanceof LinuxPackager ? this.executableName : this.appInfo.productFilename\n const electronBinaryPath = path.join(appOutDir, `${executableName}${ext}`)\n\n log.info({ electronPath: log.filePath(electronBinaryPath) }, \"executing @electron/fuses\")\n return flipFuses(electronBinaryPath, fuses)\n }\n\n protected async doSignAfterPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array<Target>) {\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const isAsar = asarOptions != null\n const packContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n const didSign = await this.signApp(packContext, isAsar)\n if (didSign) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n }\n\n // eslint-disable-next-line\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n return null\n }\n\n private copyAppFiles(\n taskManager: AsyncTaskManager,\n asarOptions: AsarOptions | null,\n resourcePath: string,\n defaultDestination: string,\n packContext: AfterPackContext,\n platformSpecificBuildOptions: DC,\n excludePatterns: Array<Minimatch>,\n macroExpander: (it: string) => string\n ) {\n const appDir = this.info.appDir\n const config = this.config\n const isElectronCompile = asarOptions != null && isElectronCompileUsed(this.info)\n\n const mainMatchers = getMainFileMatchers(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this, packContext.outDir, isElectronCompile)\n if (excludePatterns.length > 0) {\n for (const matcher of mainMatchers) {\n matcher.excludePatterns = excludePatterns\n }\n }\n\n const framework = this.info.framework\n const transformer = createTransformer(\n appDir,\n config,\n isElectronCompile\n ? {\n originalMain: this.info.metadata.main,\n main: ELECTRON_COMPILE_SHIM_FILENAME,\n ...config.extraMetadata,\n }\n : config.extraMetadata,\n framework.createTransformer == null ? null : framework.createTransformer()\n )\n\n const _computeFileSets = (matchers: Array<FileMatcher>) => {\n return computeFileSets(matchers, this.info.isPrepackedAppAsar ? null : transformer, this, isElectronCompile).then(async result => {\n if (!this.info.isPrepackedAppAsar && !this.info.areNodeModulesHandledExternally) {\n const moduleFileMatcher = getNodeModuleFileMatcher(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this.info)\n result = result.concat(await computeNodeModuleFileSets(this, moduleFileMatcher))\n }\n return result.filter(it => it.files.length > 0)\n })\n }\n\n if (this.info.isPrepackedAppAsar) {\n taskManager.add(async () => {\n const fileSets = await _computeFileSets([new FileMatcher(appDir, resourcePath, macroExpander)])\n fileSets.forEach(it => taskManager.addTask(copyAppFiles(it, this.info, transformer)))\n await taskManager.awaitTasks()\n })\n } else if (asarOptions == null) {\n // for ASAR all asar unpacked files will be extra transformed (e.g. sign of EXE and DLL) later,\n // for prepackaged asar extra transformation not supported yet,\n // so, extra transform if asar is disabled\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n const combinedTransformer: FileTransformer = file => {\n if (transformerForExtraFiles != null) {\n const result = transformerForExtraFiles(file)\n if (result != null) {\n return result\n }\n }\n return transformer(file)\n }\n taskManager.add(async () => {\n const fileSets = await _computeFileSets(mainMatchers)\n fileSets.forEach(it => taskManager.addTask(copyAppFiles(it, this.info, combinedTransformer)))\n await taskManager.awaitTasks()\n })\n } else {\n const unpackPattern = getFileMatchers(config, \"asarUnpack\", defaultDestination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: packContext.outDir,\n defaultSrc: appDir,\n })\n const fileMatcher = unpackPattern == null ? null : unpackPattern[0]\n taskManager.addTask(\n _computeFileSets(mainMatchers).then(async fileSets => {\n for (const fileSet of fileSets) {\n await transformFiles(transformer, fileSet)\n }\n\n await new AsarPackager(this, {\n defaultDestination,\n resourcePath,\n options: asarOptions,\n unpackPattern: fileMatcher?.createFilter(),\n }).pack(fileSets)\n })\n )\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n return Promise.resolve(false)\n }\n\n getIconPath(): Promise<string | null> {\n return Promise.resolve(null)\n }\n\n private async computeAsarOptions(customBuildOptions: DC): Promise<AsarOptions | null> {\n if (!isElectronBased(this.info.framework)) {\n return null\n }\n\n function errorMessage(name: string) {\n return `${name} is deprecated is deprecated and not supported — please use asarUnpack`\n }\n\n const buildMetadata = this.config as any\n if (buildMetadata[\"asar-unpack\"] != null) {\n throw new Error(errorMessage(\"asar-unpack\"))\n }\n if (buildMetadata[\"asar-unpack-dir\"] != null) {\n throw new Error(errorMessage(\"asar-unpack-dir\"))\n }\n\n const platformSpecific = customBuildOptions.asar\n const result = platformSpecific == null ? this.config.asar : platformSpecific\n if (result === false) {\n const appAsarStat = await statOrNull(path.join(this.info.appDir, \"app.asar\"))\n //noinspection ES6MissingAwait\n if (appAsarStat == null || !appAsarStat.isFile()) {\n log.warn(\n {\n solution: \"enable asar and use asarUnpack to unpack files that must be externally available\",\n },\n \"asar usage is disabled — this is strongly not recommended\"\n )\n }\n return null\n }\n\n if (result == null || result === true) {\n return {}\n }\n\n for (const name of [\"unpackDir\", \"unpack\"]) {\n if ((result as any)[name] != null) {\n throw new Error(errorMessage(`asar.${name}`))\n }\n }\n return deepAssign({}, result)\n }\n\n public getElectronSrcDir(dist: string): string {\n return path.resolve(this.projectDir, dist)\n }\n\n public getElectronDestinationDir(appOutDir: string): string {\n return appOutDir\n }\n\n getResourcesDir(appOutDir: string): string {\n if (this.platform === Platform.MAC) {\n return this.getMacOsResourcesDir(appOutDir)\n }\n if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n }\n return appOutDir\n }\n\n public getMacOsElectronFrameworkResourcesDir(appOutDir: string): string {\n const electronFrameworkName = path.basename(this.info.framework.distMacOsAppName, \".app\") + \" \" + \"Framework.framework\"\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Frameworks\", electronFrameworkName, \"Resources\")\n }\n public getMacOsResourcesDir(appOutDir: string): string {\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Resources\")\n }\n\n private async checkFileInPackage(resourcesDir: string, file: string, messagePrefix: string, isAsar: boolean, disableSanityCheckAsar: boolean) {\n if (isAsar && disableSanityCheckAsar) {\n return\n }\n const relativeFile = path.relative(this.info.appDir, path.resolve(this.info.appDir, file))\n if (isAsar) {\n checkFileInArchive(path.join(resourcesDir, \"app.asar\"), relativeFile, messagePrefix)\n return\n }\n\n const pathParsed = path.parse(file)\n // Even when packaging to asar is disabled, it does not imply that the main file can not be inside an .asar archive.\n // This may occur when the packaging is done manually before processing with electron-builder.\n if (pathParsed.dir.includes(\".asar\")) {\n // The path needs to be split to the part with an asar archive which acts like a directory and the part with\n // the path to main file itself. (e.g. path/arch.asar/dir/index.js -> path/arch.asar, dir/index.js)\n // noinspection TypeScriptValidateJSTypes\n const pathSplit: Array<string> = pathParsed.dir.split(path.sep)\n let partWithAsarIndex = 0\n pathSplit.some((pathPart: string, index: number) => {\n partWithAsarIndex = index\n return pathPart.endsWith(\".asar\")\n })\n const asarPath = path.join(...pathSplit.slice(0, partWithAsarIndex + 1))\n let mainPath = pathSplit.length > partWithAsarIndex + 1 ? path.join.apply(pathSplit.slice(partWithAsarIndex + 1)) : \"\"\n mainPath += path.join(mainPath, pathParsed.base)\n checkFileInArchive(path.join(resourcesDir, \"app\", asarPath), mainPath, messagePrefix)\n } else {\n const fullPath = path.join(resourcesDir, \"app\", relativeFile)\n const outStat = await statOrNull(fullPath)\n if (outStat == null) {\n throw new Error(`${messagePrefix} \"${fullPath}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isFile()) {\n throw new Error(`${messagePrefix} \"${fullPath}\" is not a file. Seems like a wrong configuration.`)\n }\n }\n }\n }\n\n private async sanityCheckPackage(appOutDir: string, isAsar: boolean, framework: Framework, disableSanityCheckAsar: boolean): Promise<any> {\n const outStat = await statOrNull(appOutDir)\n if (outStat == null) {\n throw new Error(`Output directory \"${appOutDir}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isDirectory()) {\n throw new Error(`Output directory \"${appOutDir}\" is not a directory. Seems like a wrong configuration.`)\n }\n }\n\n const resourcesDir = this.getResourcesDir(appOutDir)\n const mainFile = (framework.getMainFile == null ? null : framework.getMainFile(this.platform)) || this.info.metadata.main || \"index.js\"\n await this.checkFileInPackage(resourcesDir, mainFile, \"Application entry file\", isAsar, disableSanityCheckAsar)\n await this.checkFileInPackage(resourcesDir, \"package.json\", \"Application\", isAsar, disableSanityCheckAsar)\n }\n\n // tslint:disable-next-line:no-invalid-template-strings\n computeSafeArtifactName(\n suggestedName: string | null,\n ext: string,\n arch?: Arch | null,\n skipDefaultArch = true,\n defaultArch?: string,\n safePattern = \"${name}-${version}-${arch}.${ext}\"\n ): string | null {\n return computeSafeArtifactNameIfNeeded(suggestedName, () =>\n this.computeArtifactName(safePattern, ext, skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n )\n }\n\n expandArtifactNamePattern(\n targetSpecificOptions: TargetSpecificOptions | Nullish,\n ext: string,\n arch?: Arch | null,\n defaultPattern?: string,\n skipDefaultArch = true,\n defaultArch?: string\n ): string {\n const { pattern, isUserForced } = this.artifactPatternConfig(targetSpecificOptions, defaultPattern)\n return this.computeArtifactName(pattern, ext, !isUserForced && skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n }\n\n artifactPatternConfig(targetSpecificOptions: TargetSpecificOptions | Nullish, defaultPattern: string | undefined) {\n const userSpecifiedPattern = targetSpecificOptions?.artifactName || this.platformSpecificBuildOptions.artifactName || this.config.artifactName\n return {\n isUserForced: !!userSpecifiedPattern,\n pattern: userSpecifiedPattern || defaultPattern || \"${productName}-${version}-${arch}.${ext}\",\n }\n }\n\n expandArtifactBeautyNamePattern(targetSpecificOptions: TargetSpecificOptions | Nullish, ext: string, arch?: Arch | null): string {\n // tslint:disable-next-line:no-invalid-template-strings\n return this.expandArtifactNamePattern(targetSpecificOptions, ext, arch, \"${productName} ${version} ${arch}.${ext}\", true)\n }\n\n private computeArtifactName(pattern: any, ext: string, arch: Arch | Nullish): string {\n const archName = arch == null ? null : getArtifactArchName(arch, ext)\n return this.expandMacro(pattern, archName, {\n ext,\n })\n }\n\n expandMacro(pattern: string, arch?: string | null, extra: any = {}, isProductNameSanitized = true): string {\n return doExpandMacro(pattern, arch, this.appInfo, { os: this.platform.buildConfigurationKey, ...extra }, isProductNameSanitized)\n }\n\n generateName2(ext: string | null, classifier: string | Nullish, deployment: boolean): string {\n const dotExt = ext == null ? \"\" : `.${ext}`\n const separator = ext === \"deb\" ? \"_\" : \"-\"\n return `${deployment ? this.appInfo.name : this.appInfo.productFilename}${separator}${this.appInfo.version}${classifier == null ? \"\" : `${separator}${classifier}`}${dotExt}`\n }\n\n getTempFile(suffix: string): Promise<string> {\n return this.info.tempDirManager.getTempFile({ suffix })\n }\n\n get fileAssociations(): Array<FileAssociation> {\n return asArray(this.config.fileAssociations).concat(asArray(this.platformSpecificBuildOptions.fileAssociations))\n }\n\n async getResource(custom: string | Nullish, ...names: Array<string>): Promise<string | null> {\n const resourcesDir = this.info.buildResourcesDir\n if (custom === undefined) {\n const resourceList = await this.resourceList\n for (const name of names) {\n if (resourceList.includes(name)) {\n return path.join(resourcesDir, name)\n }\n }\n } else if (custom != null && !isEmptyOrSpaces(custom)) {\n const resourceList = await this.resourceList\n if (resourceList.includes(custom)) {\n return path.join(resourcesDir, custom)\n }\n\n let p = path.resolve(resourcesDir, custom)\n if ((await statOrNull(p)) == null) {\n p = path.resolve(this.projectDir, custom)\n if ((await statOrNull(p)) == null) {\n throw new InvalidConfigurationError(\n `cannot find specified resource \"${custom}\", nor relative to \"${resourcesDir}\", neither relative to project dir (\"${this.projectDir}\")`\n )\n }\n }\n return p\n }\n return null\n }\n\n get forceCodeSigning(): boolean {\n const forceCodeSigningPlatform = this.platformSpecificBuildOptions.forceCodeSigning\n return (forceCodeSigningPlatform == null ? this.config.forceCodeSigning : forceCodeSigningPlatform) || false\n }\n\n private assetCatalogResults = new Map<string, Promise<AssetCatalogResult>>()\n protected generateAssetCatalogData(iconPath: string): Promise<AssetCatalogResult> {\n // Cache results\n const cachedPromise = this.assetCatalogResults.get(iconPath)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = generateAssetCatalogForIcon(iconPath)\n this.assetCatalogResults.set(iconPath, promise)\n return promise\n }\n\n private cachedIcnsFromIconFile = new Map<string, Promise<string>>()\n async generateIcnsFromIcon(iconPath: string): Promise<string> {\n const cachedPromise = this.cachedIcnsFromIconFile.get(iconPath)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const runner = async () => {\n const { icnsFile } = await this.generateAssetCatalogData(iconPath)\n\n // Generate icns file\n const tempDir = await fs.mkdtemp(path.resolve(os.tmpdir(), \"icon-compile-\"))\n const tempIcnsPath = path.resolve(tempDir, \"Icon.icns\")\n await fs.writeFile(tempIcnsPath, icnsFile)\n\n return tempIcnsPath\n }\n const promise = runner()\n this.cachedIcnsFromIconFile.set(iconPath, promise)\n return promise\n }\n\n protected async getOrConvertIcon(format: IconFormat): Promise<string | null> {\n if (format === \"icns\") {\n const configuredIcon = this.platformSpecificBuildOptions.icon\n // If it is a .icon file, generate the icns file and return the path to the icns file\n if (configuredIcon?.endsWith(\".icon\")) {\n const iconPath = await this.getResource(configuredIcon)\n if (iconPath) {\n return this.generateIcnsFromIcon(iconPath)\n }\n }\n }\n\n const result = await this.resolveIcon(asArray(this.platformSpecificBuildOptions.icon || this.config.icon), [], format)\n if (result.length === 0) {\n const framework = this.info.framework\n if (framework.getDefaultIcon != null) {\n return framework.getDefaultIcon(this.platform)\n }\n\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(framework.name)} icon is used`)\n return this.getDefaultFrameworkIcon()\n } else {\n return result[0].file\n }\n }\n\n getDefaultFrameworkIcon(): string | null {\n const framework = this.info.framework\n return framework.getDefaultIcon == null ? null : framework.getDefaultIcon(this.platform)\n }\n\n // convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example))\n async resolveIcon(sources: Array<string>, fallbackSources: Array<string>, outputFormat: IconFormat): Promise<Array<IconInfo>> {\n const output = this.expandMacro(this.config.directories!.output!)\n const args = [\n \"icon\",\n \"--format\",\n outputFormat,\n \"--root\",\n this.buildResourcesDir,\n \"--root\",\n this.projectDir,\n \"--out\",\n path.resolve(this.projectDir, output, `.icon-${outputFormat}`),\n ]\n for (const source of sources) {\n if (source.endsWith(\".icon\")) {\n // Ignore .icon files: they will cause the format conversion to fail\n continue\n }\n args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\n if (source.endsWith(\".icon\")) {\n // Ignore .icon files: they will cause the format conversion to fail\n continue\n }\n args.push(\"--fallback-input\", source)\n }\n\n const result: IconConvertResult = await executeAppBuilderAsJson(args)\n const errorMessage = result.error\n if (errorMessage != null) {\n throw new InvalidConfigurationError(errorMessage, result.errorCode)\n }\n\n if (result.isFallback) {\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(this.info.framework.name)} icon is used`)\n }\n\n return result.icons || []\n }\n}\n\nexport interface IconInfo {\n file: string\n size: number\n}\n\ninterface IconConvertResult {\n icons?: Array<IconInfo>\n\n error?: string\n errorCode?: string\n isFallback?: boolean\n}\n\nexport type IconFormat = \"icns\" | \"ico\" | \"set\"\n\nexport function isSafeGithubName(name: string) {\n return /^[0-9A-Za-z._-]+$/.test(name)\n}\n\nexport function computeSafeArtifactNameIfNeeded(suggestedName: string | null, safeNameProducer: () => string): string | null {\n // GitHub only allows the listed characters in file names.\n if (suggestedName != null) {\n if (isSafeGithubName(suggestedName)) {\n return null\n }\n\n // prefer to use suggested name - so, if space is the only problem, just replace only space to dash\n suggestedName = suggestedName.replace(/ /g, \"-\")\n if (isSafeGithubName(suggestedName)) {\n return suggestedName\n }\n }\n\n return safeNameProducer()\n}\n\n// remove leading dot\nexport function normalizeExt(ext: string) {\n return ext.startsWith(\".\") ? ext.substring(1) : ext\n}\n\nexport function chooseNotNull<T>(v1: T | Nullish, v2: T | Nullish): T | Nullish {\n return v1 == null ? v2 : v1\n}\n\nfunction capitalizeFirstLetter(text: string) {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n"]}
@@ -51,7 +51,7 @@ class FlatpakTarget extends core_1.Target {
51
51
  async createSandboxBinWrapper(stageDir) {
52
52
  const useWaylandFlags = !!this.options.useWaylandFlags;
53
53
  const electronWrapperPath = stageDir.getTempFile(path.join("bin", "electron-wrapper"));
54
- await (0, fs_extra_1.outputFile)(electronWrapperPath, getElectronWrapperScript(this.packager.executableName, useWaylandFlags));
54
+ await (0, fs_extra_1.outputFile)(electronWrapperPath, getElectronWrapperScript(this.packager.executableName, this.options.executableArgs, useWaylandFlags));
55
55
  await (0, fs_extra_1.chmod)(electronWrapperPath, 0o755);
56
56
  }
57
57
  async createDesktopFile(stageDir) {
@@ -132,23 +132,25 @@ const flatpakBuilderDefaults = {
132
132
  "--talk-name=org.freedesktop.Notifications",
133
133
  ],
134
134
  };
135
- function getElectronWrapperScript(executableName, useWaylandFlags) {
136
- return useWaylandFlags
137
- ? `#!/bin/sh
135
+ function getElectronWrapperScript(executableName, executableArgs, useWaylandFlags) {
136
+ const stringifiedExecutableArgs = (executableArgs === null || executableArgs === void 0 ? void 0 : executableArgs.join(" ")) || "";
137
+ if (useWaylandFlags) {
138
+ return `#!/bin/sh
138
139
 
139
140
  export TMPDIR="$XDG_RUNTIME_DIR/app/$FLATPAK_ID"
140
141
 
141
142
  if [ "\${XDG_SESSION_TYPE}" == "wayland" ]; then
142
- zypak-wrapper "${executableName}" --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"
143
+ zypak-wrapper "${executableName}" ${stringifiedExecutableArgs} --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"
143
144
  else
144
- zypak-wrapper "${executableName}" "$@"
145
+ zypak-wrapper "${executableName}" ${stringifiedExecutableArgs} "$@"
145
146
  fi
146
- `
147
- : `#!/bin/sh
147
+ `;
148
+ }
149
+ return `#!/bin/sh
148
150
 
149
151
  export TMPDIR="$XDG_RUNTIME_DIR/app/$FLATPAK_ID"
150
152
 
151
- zypak-wrapper "${executableName}" "$@"
153
+ zypak-wrapper "${executableName}" ${stringifiedExecutableArgs} "$@"
152
154
  `;
153
155
  }
154
156
  function filterFlatpakAppIdentifier(identifier) {
@@ -1 +1 @@
1
- {"version":3,"file":"FlatpakTarget.js","sourceRoot":"","sources":["../../src/targets/FlatpakTarget.ts"],"names":[],"mappings":";;AAAA,6DAA8G;AAC9G,+CAAgE;AAChE,uCAA4C;AAC5C,6BAA4B;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kBAAkB;QAClB,cAAc;QACd,aAAa;QACb,UAAU;QACV,cAAc;QACd,eAAe;QACf,qBAAqB;QACrB,mCAAmC;QACnC,mBAAmB;QACnB,mCAAmC;QACnC,iBAAiB;QACjB,sCAAsC;QACtC,2CAA2C;KAC5C;CACF,CAAA;AAED,SAAS,wBAAwB,CAAC,cAAsB,EAAE,eAAwB;IAChF,OAAO,eAAe;QACpB,CAAC,CAAC;;;;;qBAKe,cAAc;;qBAEd,cAAc;;CAElC;QACG,CAAC,CAAC;;;;iBAIW,cAAc;CAC9B,CAAA;AACD,CAAC;AAED,SAAS,0BAA0B,CAAC,UAAkB;IACpD,sGAAsG;IACtG,6FAA6F;IAC7F,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC","sourcesContent":["import { bundle as bundleFlatpak, FlatpakBundlerBuildOptions, FlatpakManifest } from \"@malept/flatpak-bundler\"\nimport { Arch, copyFile, toLinuxArchString } from \"builder-util\"\nimport { chmod, outputFile } from \"fs-extra\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { FlatpakOptions } from \"../options/linuxOptions\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDir, StageDir } from \"./targetUtil\"\n\nexport default class FlatpakTarget extends Target {\n readonly options: FlatpakOptions = {\n ...this.packager.platformSpecificBuildOptions,\n ...(this.packager.config as any)[this.name],\n }\n\n constructor(\n name: string,\n private readonly packager: LinuxPackager,\n private helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(name)\n }\n\n get appId(): string {\n return filterFlatpakAppIdentifier(this.packager.appInfo.id)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const { packager, options } = this\n const artifactName = packager.expandArtifactNamePattern(options, \"flatpak\", arch, undefined, false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.emitArtifactBuildStarted({\n targetPresentableName: \"flatpak\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await this.prepareStageDir(arch)\n\n const { manifest, buildOptions } = this.getFlatpakBuilderOptions(appOutDir, stageDir.dir, artifactName, arch)\n await bundleFlatpak(manifest, buildOptions)\n\n await stageDir.cleanup()\n\n await packager.info.emitArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"flatpak\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: false,\n })\n }\n\n private async prepareStageDir(arch: Arch): Promise<StageDir> {\n const stageDir = await createStageDir(this, this.packager, arch)\n\n await Promise.all([this.createSandboxBinWrapper(stageDir), this.createDesktopFile(stageDir), this.copyLicenseFile(stageDir), this.copyIcons(stageDir)])\n\n return stageDir\n }\n\n private async createSandboxBinWrapper(stageDir: StageDir) {\n const useWaylandFlags = !!this.options.useWaylandFlags\n const electronWrapperPath = stageDir.getTempFile(path.join(\"bin\", \"electron-wrapper\"))\n await outputFile(electronWrapperPath, getElectronWrapperScript(this.packager.executableName, useWaylandFlags))\n await chmod(electronWrapperPath, 0o755)\n }\n\n private async createDesktopFile(stageDir: StageDir) {\n const appIdentifier = this.appId\n const desktopFile = stageDir.getTempFile(path.join(\"share\", \"applications\", `${appIdentifier}.desktop`))\n await this.helper.writeDesktopEntry(this.options, \"electron-wrapper %U\", desktopFile, { Icon: appIdentifier })\n }\n\n private async copyLicenseFile(stageDir: StageDir) {\n const licenseSrc = await getNotLocalizedLicenseFile(this.options.license, this.packager, [\"txt\", \"html\"])\n if (licenseSrc) {\n const licenseDst = stageDir.getTempFile(path.join(\"share\", \"doc\", this.appId, \"copyright\"))\n await copyFile(licenseSrc, licenseDst)\n }\n }\n\n private async copyIcons(stageDir: StageDir) {\n const icons = await this.helper.icons\n const copyIcons = icons.map(async icon => {\n if (icon.size > 512) {\n // Flatpak does not allow icons larger than 512 pixels\n return Promise.resolve()\n }\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n const iconDst = stageDir.getTempFile(path.join(\"share\", \"icons\", \"hicolor\", sizeName, \"apps\", `${this.appId}${extWithDot}`))\n\n return copyFile(icon.file, iconDst)\n })\n\n await Promise.all(copyIcons)\n }\n\n private getFlatpakBuilderOptions(appOutDir: string, stageDir: string, artifactName: string, arch: Arch): { manifest: FlatpakManifest; buildOptions: FlatpakBundlerBuildOptions } {\n const appIdentifier = this.appId\n const { executableName } = this.packager\n const flatpakArch = toLinuxArchString(arch, \"flatpak\")\n\n const manifest: FlatpakManifest = {\n id: appIdentifier,\n command: \"electron-wrapper\",\n runtime: this.options.runtime || flatpakBuilderDefaults.runtime,\n runtimeVersion: this.options.runtimeVersion || flatpakBuilderDefaults.runtimeVersion,\n sdk: this.options.sdk || flatpakBuilderDefaults.sdk,\n base: this.options.base || flatpakBuilderDefaults.base,\n baseVersion: this.options.baseVersion || flatpakBuilderDefaults.baseVersion,\n finishArgs: this.options.finishArgs || flatpakBuilderDefaults.finishArgs,\n branch: this.options.branch,\n modules: this.options.modules,\n }\n\n const buildOptions: FlatpakBundlerBuildOptions = {\n baseFlatpakref: `app/${manifest.base}/${flatpakArch}/${manifest.baseVersion}`,\n runtimeFlatpakref: `runtime/${manifest.runtime}/${flatpakArch}/${manifest.runtimeVersion}`,\n sdkFlatpakref: `runtime/${manifest.sdk}/${flatpakArch}/${manifest.runtimeVersion}`,\n arch: flatpakArch as any,\n bundlePath: path.join(this.outDir, artifactName),\n files: [[stageDir, \"/\"], [appOutDir, path.join(\"/lib\", appIdentifier)], ...(this.options.files || [])],\n symlinks: [[path.join(\"/lib\", appIdentifier, executableName), path.join(\"/bin\", executableName)], ...(this.options.symlinks || [])],\n }\n\n return { manifest, buildOptions }\n }\n}\n\nconst flatpakBuilderDefaults: Omit<FlatpakManifest, \"id\" | \"command\"> = {\n runtime: \"org.freedesktop.Platform\",\n runtimeVersion: \"20.08\",\n sdk: \"org.freedesktop.Sdk\",\n base: \"org.electronjs.Electron2.BaseApp\",\n baseVersion: \"20.08\",\n finishArgs: [\n // Wayland/X11 Rendering\n \"--socket=wayland\",\n \"--socket=x11\",\n \"--share=ipc\",\n // Open GL\n \"--device=dri\",\n // Audio output\n \"--socket=pulseaudio\",\n // Read/write home directory access\n \"--filesystem=home\",\n // Allow communication with network\n \"--share=network\",\n // System notifications with libnotify\n \"--talk-name=org.freedesktop.Notifications\",\n ],\n}\n\nfunction getElectronWrapperScript(executableName: string, useWaylandFlags: boolean): string {\n return useWaylandFlags\n ? `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nif [ \"\\${XDG_SESSION_TYPE}\" == \"wayland\" ]; then\n zypak-wrapper \"${executableName}\" --enable-features=UseOzonePlatform --ozone-platform=wayland \"$@\"\nelse\n zypak-wrapper \"${executableName}\" \"$@\"\nfi\n`\n : `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nzypak-wrapper \"${executableName}\" \"$@\"\n`\n}\n\nfunction filterFlatpakAppIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.)\n // Flatpak documentation: https://docs.flatpak.org/en/latest/conventions.html#application-ids\n return identifier.replace(/-/g, \"_\").replace(/[^a-zA-Z0-9._]/g, \"\")\n}\n"]}
1
+ {"version":3,"file":"FlatpakTarget.js","sourceRoot":"","sources":["../../src/targets/FlatpakTarget.ts"],"names":[],"mappings":";;AAAA,6DAA8G;AAC9G,+CAAgE;AAChE,uCAA4C;AAC5C,6BAA4B;AAC5B,kCAAgC;AAGhC,6CAA4D;AAE5D,6CAAuD;AAGvD,MAAqB,aAAc,SAAQ,aAAM;IAM/C,YACE,IAAY,EACK,QAAuB,EAChC,MAAyB,EACxB,MAAc;QAEvB,KAAK,CAAC,IAAI,CAAC,C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B;QACjB,sCAAsC;QACtC,2CAA2C;KAC5C;CACF,CAAA;AAED,SAAS,wBAAwB,CAAC,cAAsB,EAAE,cAAkC,EAAE,eAAwB;IACpH,MAAM,yBAAyB,GAAG,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAAC,GAAG,CAAC,KAAI,EAAE,CAAA;IACjE,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO;;;;;qBAKU,cAAc,KAAK,yBAAyB;;qBAE5C,cAAc,KAAK,yBAAyB;;CAEhE,CAAA;IACC,CAAC;IACD,OAAO;;;;iBAIQ,cAAc,KAAK,yBAAyB;CAC5D,CAAA;AACD,CAAC;AAED,SAAS,0BAA0B,CAAC,UAAkB;IACpD,sGAAsG;IACtG,6FAA6F;IAC7F,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC","sourcesContent":["import { bundle as bundleFlatpak, FlatpakBundlerBuildOptions, FlatpakManifest } from \"@malept/flatpak-bundler\"\nimport { Arch, copyFile, toLinuxArchString } from \"builder-util\"\nimport { chmod, outputFile } from \"fs-extra\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { FlatpakOptions } from \"../options/linuxOptions\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDir, StageDir } from \"./targetUtil\"\nimport { Nullish } from \"builder-util-runtime\"\n\nexport default class FlatpakTarget extends Target {\n readonly options: FlatpakOptions = {\n ...this.packager.platformSpecificBuildOptions,\n ...(this.packager.config as any)[this.name],\n }\n\n constructor(\n name: string,\n private readonly packager: LinuxPackager,\n private helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(name)\n }\n\n get appId(): string {\n return filterFlatpakAppIdentifier(this.packager.appInfo.id)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const { packager, options } = this\n const artifactName = packager.expandArtifactNamePattern(options, \"flatpak\", arch, undefined, false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.emitArtifactBuildStarted({\n targetPresentableName: \"flatpak\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await this.prepareStageDir(arch)\n\n const { manifest, buildOptions } = this.getFlatpakBuilderOptions(appOutDir, stageDir.dir, artifactName, arch)\n await bundleFlatpak(manifest, buildOptions)\n\n await stageDir.cleanup()\n\n await packager.info.emitArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"flatpak\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: false,\n })\n }\n\n private async prepareStageDir(arch: Arch): Promise<StageDir> {\n const stageDir = await createStageDir(this, this.packager, arch)\n\n await Promise.all([this.createSandboxBinWrapper(stageDir), this.createDesktopFile(stageDir), this.copyLicenseFile(stageDir), this.copyIcons(stageDir)])\n\n return stageDir\n }\n\n private async createSandboxBinWrapper(stageDir: StageDir) {\n const useWaylandFlags = !!this.options.useWaylandFlags\n const electronWrapperPath = stageDir.getTempFile(path.join(\"bin\", \"electron-wrapper\"))\n await outputFile(electronWrapperPath, getElectronWrapperScript(this.packager.executableName, this.options.executableArgs, useWaylandFlags))\n await chmod(electronWrapperPath, 0o755)\n }\n\n private async createDesktopFile(stageDir: StageDir) {\n const appIdentifier = this.appId\n const desktopFile = stageDir.getTempFile(path.join(\"share\", \"applications\", `${appIdentifier}.desktop`))\n await this.helper.writeDesktopEntry(this.options, \"electron-wrapper %U\", desktopFile, { Icon: appIdentifier })\n }\n\n private async copyLicenseFile(stageDir: StageDir) {\n const licenseSrc = await getNotLocalizedLicenseFile(this.options.license, this.packager, [\"txt\", \"html\"])\n if (licenseSrc) {\n const licenseDst = stageDir.getTempFile(path.join(\"share\", \"doc\", this.appId, \"copyright\"))\n await copyFile(licenseSrc, licenseDst)\n }\n }\n\n private async copyIcons(stageDir: StageDir) {\n const icons = await this.helper.icons\n const copyIcons = icons.map(async icon => {\n if (icon.size > 512) {\n // Flatpak does not allow icons larger than 512 pixels\n return Promise.resolve()\n }\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n const iconDst = stageDir.getTempFile(path.join(\"share\", \"icons\", \"hicolor\", sizeName, \"apps\", `${this.appId}${extWithDot}`))\n\n return copyFile(icon.file, iconDst)\n })\n\n await Promise.all(copyIcons)\n }\n\n private getFlatpakBuilderOptions(appOutDir: string, stageDir: string, artifactName: string, arch: Arch): { manifest: FlatpakManifest; buildOptions: FlatpakBundlerBuildOptions } {\n const appIdentifier = this.appId\n const { executableName } = this.packager\n const flatpakArch = toLinuxArchString(arch, \"flatpak\")\n\n const manifest: FlatpakManifest = {\n id: appIdentifier,\n command: \"electron-wrapper\",\n runtime: this.options.runtime || flatpakBuilderDefaults.runtime,\n runtimeVersion: this.options.runtimeVersion || flatpakBuilderDefaults.runtimeVersion,\n sdk: this.options.sdk || flatpakBuilderDefaults.sdk,\n base: this.options.base || flatpakBuilderDefaults.base,\n baseVersion: this.options.baseVersion || flatpakBuilderDefaults.baseVersion,\n finishArgs: this.options.finishArgs || flatpakBuilderDefaults.finishArgs,\n branch: this.options.branch,\n modules: this.options.modules,\n }\n\n const buildOptions: FlatpakBundlerBuildOptions = {\n baseFlatpakref: `app/${manifest.base}/${flatpakArch}/${manifest.baseVersion}`,\n runtimeFlatpakref: `runtime/${manifest.runtime}/${flatpakArch}/${manifest.runtimeVersion}`,\n sdkFlatpakref: `runtime/${manifest.sdk}/${flatpakArch}/${manifest.runtimeVersion}`,\n arch: flatpakArch as any,\n bundlePath: path.join(this.outDir, artifactName),\n files: [[stageDir, \"/\"], [appOutDir, path.join(\"/lib\", appIdentifier)], ...(this.options.files || [])],\n symlinks: [[path.join(\"/lib\", appIdentifier, executableName), path.join(\"/bin\", executableName)], ...(this.options.symlinks || [])],\n }\n\n return { manifest, buildOptions }\n }\n}\n\nconst flatpakBuilderDefaults: Omit<FlatpakManifest, \"id\" | \"command\"> = {\n runtime: \"org.freedesktop.Platform\",\n runtimeVersion: \"20.08\",\n sdk: \"org.freedesktop.Sdk\",\n base: \"org.electronjs.Electron2.BaseApp\",\n baseVersion: \"20.08\",\n finishArgs: [\n // Wayland/X11 Rendering\n \"--socket=wayland\",\n \"--socket=x11\",\n \"--share=ipc\",\n // Open GL\n \"--device=dri\",\n // Audio output\n \"--socket=pulseaudio\",\n // Read/write home directory access\n \"--filesystem=home\",\n // Allow communication with network\n \"--share=network\",\n // System notifications with libnotify\n \"--talk-name=org.freedesktop.Notifications\",\n ],\n}\n\nfunction getElectronWrapperScript(executableName: string, executableArgs: string[] | Nullish, useWaylandFlags: boolean): string {\n const stringifiedExecutableArgs = executableArgs?.join(\" \") || \"\"\n if (useWaylandFlags) {\n return `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nif [ \"\\${XDG_SESSION_TYPE}\" == \"wayland\" ]; then\n zypak-wrapper \"${executableName}\" ${stringifiedExecutableArgs} --enable-features=UseOzonePlatform --ozone-platform=wayland \"$@\"\nelse\n zypak-wrapper \"${executableName}\" ${stringifiedExecutableArgs} \"$@\"\nfi\n`\n }\n return `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nzypak-wrapper \"${executableName}\" ${stringifiedExecutableArgs} \"$@\"\n`\n}\n\nfunction filterFlatpakAppIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.)\n // Flatpak documentation: https://docs.flatpak.org/en/latest/conventions.html#application-ids\n return identifier.replace(/-/g, \"_\").replace(/[^a-zA-Z0-9._]/g, \"\")\n}\n"]}