app-builder-lib 26.6.0 → 26.8.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 (71) hide show
  1. package/out/codeSign/windowsSignToolManager.d.ts +4 -5
  2. package/out/codeSign/windowsSignToolManager.js +76 -86
  3. package/out/codeSign/windowsSignToolManager.js.map +1 -1
  4. package/out/configuration.d.ts +34 -0
  5. package/out/configuration.js.map +1 -1
  6. package/out/index.d.ts +1 -1
  7. package/out/index.js.map +1 -1
  8. package/out/linuxPackager.js +1 -1
  9. package/out/linuxPackager.js.map +1 -1
  10. package/out/macPackager.js +0 -1
  11. package/out/macPackager.js.map +1 -1
  12. package/out/node-module-collector/index.d.ts +1 -2
  13. package/out/node-module-collector/nodeModulesCollector.d.ts +2 -18
  14. package/out/node-module-collector/nodeModulesCollector.js +38 -73
  15. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  16. package/out/node-module-collector/npmNodeModulesCollector.js +11 -7
  17. package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
  18. package/out/node-module-collector/pnpmNodeModulesCollector.js +1 -1
  19. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  20. package/out/node-module-collector/types.d.ts +0 -4
  21. package/out/node-module-collector/types.js.map +1 -1
  22. package/out/node-module-collector/yarnNodeModulesCollector.d.ts +4 -10
  23. package/out/node-module-collector/yarnNodeModulesCollector.js +7 -197
  24. package/out/node-module-collector/yarnNodeModulesCollector.js.map +1 -1
  25. package/out/options/AppXOptions.d.ts +8 -0
  26. package/out/options/AppXOptions.js.map +1 -1
  27. package/out/options/macOptions.d.ts +12 -0
  28. package/out/options/macOptions.js.map +1 -1
  29. package/out/targets/AppxCapabilities.d.ts +8 -0
  30. package/out/targets/AppxCapabilities.js +258 -0
  31. package/out/targets/AppxCapabilities.js.map +1 -0
  32. package/out/targets/AppxTarget.d.ts +1 -0
  33. package/out/targets/AppxTarget.js +32 -14
  34. package/out/targets/AppxTarget.js.map +1 -1
  35. package/out/targets/FpmTarget.js +3 -3
  36. package/out/targets/FpmTarget.js.map +1 -1
  37. package/out/targets/MsiWrappedTarget.js +4 -3
  38. package/out/targets/MsiWrappedTarget.js.map +1 -1
  39. package/out/targets/appimage/AppImageTarget.d.ts +16 -0
  40. package/out/targets/{AppImageTarget.js → appimage/AppImageTarget.js} +65 -28
  41. package/out/targets/appimage/AppImageTarget.js.map +1 -0
  42. package/out/targets/appimage/appImageUtil.d.ts +23 -0
  43. package/out/targets/appimage/appImageUtil.js +266 -0
  44. package/out/targets/appimage/appImageUtil.js.map +1 -0
  45. package/out/targets/appimage/appLauncher.d.ts +3 -0
  46. package/out/targets/appimage/appLauncher.js +91 -0
  47. package/out/targets/appimage/appLauncher.js.map +1 -0
  48. package/out/targets/archive.js +2 -2
  49. package/out/targets/archive.js.map +1 -1
  50. package/out/toolsets/linux.d.ts +9 -0
  51. package/out/toolsets/linux.js +68 -0
  52. package/out/toolsets/linux.js.map +1 -0
  53. package/out/toolsets/windows.d.ts +42 -0
  54. package/out/toolsets/windows.js +143 -0
  55. package/out/toolsets/windows.js.map +1 -0
  56. package/out/util/packageMetadata.js +9 -5
  57. package/out/util/packageMetadata.js.map +1 -1
  58. package/out/version.d.ts +1 -1
  59. package/out/version.js +1 -1
  60. package/out/version.js.map +1 -1
  61. package/out/winPackager.js +4 -3
  62. package/out/winPackager.js.map +1 -1
  63. package/package.json +9 -9
  64. package/scheme.json +78 -1
  65. package/templates/appx/appxmanifest.xml +1 -3
  66. package/templates/linux/after-install.tpl +1 -1
  67. package/out/targets/AppImageTarget.d.ts +0 -14
  68. package/out/targets/AppImageTarget.js.map +0 -1
  69. package/out/targets/tools.d.ts +0 -2
  70. package/out/targets/tools.js +0 -46
  71. package/out/targets/tools.js.map +0 -1
package/out/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAwEA,4DAMC;AAED,sBA2D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CAAC,EAAE,CAAC;oBACpD,kBAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,EAAE,iDAAiD,CAAC,CAAA;oBAC5E,SAAQ;gBACV,CAAC;gBACD,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBAC3C,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE,CAAC;oBACzD,MAAM,cAAc,CAAC,cAAc,CACjC,oBAAoB,EACpB;wBACE,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,IAAI;qBACX,EACD,QAAQ,CAAC,OAAO,CACjB,CAAA;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,WAAW,CAAC,aAAa,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,OAAO,IAAA,6BAAc,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE;QAC/C,IAAI,OAAqB,CAAA;QACzB,IAAI,eAAe,EAAE,CAAC;YACpB,cAAc,CAAC,WAAW,EAAE,CAAA;YAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,cAAc,CAAC,UAAU,EAAE,CAAA;QACvC,CAAC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YACvB,QAAQ,CAAC,2BAA2B,EAAE,CAAA;YACtC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { InvalidConfigurationError, executeFinally, log } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { PublishOptions } from \"electron-publish\"\nimport { Packager } from \"./packager\"\nimport { PackagerOptions } from \"./packagerApi\"\nimport { PublishManager } from \"./publish/PublishManager\"\nimport { resolveFunction } from \"./util/resolve\"\n\nexport { Arch, archFromString, getArchSuffix } from \"builder-util\"\nexport { AppInfo } from \"./appInfo\"\nexport {\n AfterExtractContext,\n AfterPackContext,\n BeforePackContext,\n CommonConfiguration,\n Configuration,\n FuseOptionsV1,\n Hook,\n Hooks,\n MetadataDirectories,\n PackContext,\n} from \"./configuration\"\nexport {\n BeforeBuildContext,\n CompressionLevel,\n DEFAULT_TARGET,\n DIR_TARGET,\n Platform,\n SourceRepositoryInfo,\n Target,\n TargetConfigType,\n TargetConfiguration,\n TargetSpecificOptions,\n} from \"./core\"\nexport { ElectronBrandingOptions, ElectronDownloadOptions, ElectronPlatformName } from \"./electron/ElectronFramework\"\nexport { AppXOptions } from \"./options/AppXOptions\"\nexport { CommonWindowsInstallerConfiguration } from \"./options/CommonWindowsInstallerConfiguration\"\nexport { FileAssociation } from \"./options/FileAssociation\"\nexport { AppImageOptions, CommonLinuxOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxDesktopFile, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nexport { DmgContent, DmgOptions, DmgWindow, MacConfiguration, MacOsTargetName, MasConfiguration } from \"./options/macOptions\"\nexport { AuthorMetadata, Metadata, RepositoryInfo } from \"./options/metadata\"\nexport { MsiOptions } from \"./options/MsiOptions\"\nexport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nexport { BackgroundAlignment, BackgroundScaling, PkgBackgroundOptions, PkgOptions } from \"./options/pkgOptions\"\nexport { AsarOptions, FileSet, FilesBuildOptions, PlatformSpecificBuildOptions, Protocol, ReleaseInfo } from \"./options/PlatformSpecificBuildOptions\"\nexport { PlugDescriptor, SlotDescriptor, SnapOptions } from \"./options/SnapOptions\"\nexport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nexport { WindowsAzureSigningConfiguration, WindowsConfiguration, WindowsSigntoolConfiguration } from \"./options/winOptions\"\nexport { BuildResult, Packager } from \"./packager\"\nexport { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from \"./packagerApi\"\nexport { CommonNsisOptions, CustomNsisBinary, NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\nexport { CancellationToken, ProgressInfo } from \"builder-util-runtime\"\nexport { PublishOptions, UploadTask } from \"electron-publish\"\nexport { WindowsSignOptions } from \"./codeSign/windowsCodeSign\"\nexport {\n CertificateFromStoreInfo,\n CustomWindowsSign,\n CustomWindowsSignTaskConfiguration,\n FileCodeSigningInfo,\n WindowsSignTaskConfiguration,\n} from \"./codeSign/windowsSignToolManager\"\nexport { ForgeOptions, buildForge } from \"./forge-maker\"\nexport { Framework, PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nexport { LinuxPackager } from \"./linuxPackager\"\nexport { CustomMacSign, CustomMacSignOptions, MacPackager } from \"./macPackager\"\nexport { PlatformPackager } from \"./platformPackager\"\nexport { PublishManager } from \"./publish/PublishManager\"\nexport { WinPackager } from \"./winPackager\"\n\nconst expectedOptions = new Set([\"publish\", \"targets\", \"mac\", \"win\", \"linux\", \"projectDir\", \"platformPackagerFactory\", \"config\", \"effectiveOptionComputed\", \"prepackaged\"])\n\nexport function checkBuildRequestOptions(options: PackagerOptions & PublishOptions) {\n for (const optionName of Object.keys(options)) {\n if (!expectedOptions.has(optionName) && (options as any)[optionName] !== undefined) {\n throw new InvalidConfigurationError(`Unknown option \"${optionName}\"`)\n }\n }\n}\n\nexport function build(options: PackagerOptions & PublishOptions, packager: Packager = new Packager(options)): Promise<Array<string>> {\n checkBuildRequestOptions(options)\n\n const publishManager = new PublishManager(packager, options)\n const sigIntHandler = () => {\n log.warn(\"cancelled by SIGINT\")\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n }\n process.once(\"SIGINT\", sigIntHandler)\n\n const promise = packager.build().then(async buildResult => {\n const afterAllArtifactBuild = await resolveFunction(packager.appInfo.type, buildResult.configuration.afterAllArtifactBuild, \"afterAllArtifactBuild\")\n if (afterAllArtifactBuild != null) {\n const newArtifacts = asArray(await Promise.resolve(afterAllArtifactBuild(buildResult)))\n if (newArtifacts.length === 0 || !publishManager.isPublish) {\n return buildResult.artifactPaths\n }\n\n const publishConfigurations = await publishManager.getGlobalPublishConfigurations()\n if (publishConfigurations == null || publishConfigurations.length === 0) {\n return buildResult.artifactPaths\n }\n\n for (const newArtifact of newArtifacts) {\n if (buildResult.artifactPaths.includes(newArtifact)) {\n log.warn({ newArtifact }, \"skipping publish of artifact, already published\")\n continue\n }\n buildResult.artifactPaths.push(newArtifact)\n for (const publishConfiguration of publishConfigurations) {\n await publishManager.scheduleUpload(\n publishConfiguration,\n {\n file: newArtifact,\n arch: null,\n },\n packager.appInfo\n )\n }\n }\n }\n return buildResult.artifactPaths\n })\n\n return executeFinally(promise, isErrorOccurred => {\n let promise: Promise<any>\n if (isErrorOccurred) {\n publishManager.cancelTasks()\n promise = Promise.resolve(null)\n } else {\n promise = publishManager.awaitTasks()\n }\n\n return promise.then(() => {\n packager.clearPackagerEventListeners()\n process.removeListener(\"SIGINT\", sigIntHandler)\n })\n })\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAyEA,4DAMC;AAED,sBA2DC;AA5ID,+CAA6E;AAC7E,+DAA8C;AAE9C,yCAAqC;AAErC,6DAAyD;AACzD,4CAAgD;AAEhD,6CAAkE;AAAzD,oGAAA,IAAI,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,6GAAA,aAAa,OAAA;AAC5C,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAchB,+BAWe;AARb,sGAAA,cAAc,OAAA;AACd,kGAAA,UAAU,OAAA;AACV,gGAAA,QAAQ,OAAA;AAER,8FAAA,MAAM,OAAA;AAmBR,uCAAkD;AAA5B,oGAAA,QAAQ,OAAA;AAI9B,6DAAsE;AAA7D,yHAAA,iBAAiB,OAAA;AAU1B,6CAAwD;AAAjC,yGAAA,UAAU,OAAA;AAEjC,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,6CAAgF;AAAlC,0GAAA,WAAW,OAAA;AACzD,uDAAqD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AAqB,CAAA;QACzB,IAAI,eAAe,EAAE,CAAC;YACpB,cAAc,CAAC,WAAW,EAAE,CAAA;YAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,cAAc,CAAC,UAAU,EAAE,CAAA;QACvC,CAAC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YACvB,QAAQ,CAAC,2BAA2B,EAAE,CAAA;YACtC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { InvalidConfigurationError, executeFinally, log } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { PublishOptions } from \"electron-publish\"\nimport { Packager } from \"./packager\"\nimport { PackagerOptions } from \"./packagerApi\"\nimport { PublishManager } from \"./publish/PublishManager\"\nimport { resolveFunction } from \"./util/resolve\"\n\nexport { Arch, archFromString, getArchSuffix } from \"builder-util\"\nexport { AppInfo } from \"./appInfo\"\nexport {\n AfterExtractContext,\n AfterPackContext,\n BeforePackContext,\n CommonConfiguration,\n Configuration,\n FuseOptionsV1,\n Hook,\n Hooks,\n MetadataDirectories,\n PackContext,\n ToolsetConfig,\n} from \"./configuration\"\nexport {\n BeforeBuildContext,\n CompressionLevel,\n DEFAULT_TARGET,\n DIR_TARGET,\n Platform,\n SourceRepositoryInfo,\n Target,\n TargetConfigType,\n TargetConfiguration,\n TargetSpecificOptions,\n} from \"./core\"\nexport { ElectronBrandingOptions, ElectronDownloadOptions, ElectronPlatformName } from \"./electron/ElectronFramework\"\nexport { AppXOptions } from \"./options/AppXOptions\"\nexport { CommonWindowsInstallerConfiguration } from \"./options/CommonWindowsInstallerConfiguration\"\nexport { FileAssociation } from \"./options/FileAssociation\"\nexport { AppImageOptions, CommonLinuxOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxDesktopFile, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nexport { DmgContent, DmgOptions, DmgWindow, MacConfiguration, MacOsTargetName, MasConfiguration } from \"./options/macOptions\"\nexport { AuthorMetadata, Metadata, RepositoryInfo } from \"./options/metadata\"\nexport { MsiOptions } from \"./options/MsiOptions\"\nexport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nexport { BackgroundAlignment, BackgroundScaling, PkgBackgroundOptions, PkgOptions } from \"./options/pkgOptions\"\nexport { AsarOptions, FileSet, FilesBuildOptions, PlatformSpecificBuildOptions, Protocol, ReleaseInfo } from \"./options/PlatformSpecificBuildOptions\"\nexport { PlugDescriptor, SlotDescriptor, SnapOptions } from \"./options/SnapOptions\"\nexport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nexport { WindowsAzureSigningConfiguration, WindowsConfiguration, WindowsSigntoolConfiguration } from \"./options/winOptions\"\nexport { BuildResult, Packager } from \"./packager\"\nexport { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from \"./packagerApi\"\nexport { CommonNsisOptions, CustomNsisBinary, NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\nexport { CancellationToken, ProgressInfo } from \"builder-util-runtime\"\nexport { PublishOptions, UploadTask } from \"electron-publish\"\nexport { WindowsSignOptions } from \"./codeSign/windowsCodeSign\"\nexport {\n CertificateFromStoreInfo,\n CustomWindowsSign,\n CustomWindowsSignTaskConfiguration,\n FileCodeSigningInfo,\n WindowsSignTaskConfiguration,\n} from \"./codeSign/windowsSignToolManager\"\nexport { ForgeOptions, buildForge } from \"./forge-maker\"\nexport { Framework, PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nexport { LinuxPackager } from \"./linuxPackager\"\nexport { CustomMacSign, CustomMacSignOptions, MacPackager } from \"./macPackager\"\nexport { PlatformPackager } from \"./platformPackager\"\nexport { PublishManager } from \"./publish/PublishManager\"\nexport { WinPackager } from \"./winPackager\"\n\nconst expectedOptions = new Set([\"publish\", \"targets\", \"mac\", \"win\", \"linux\", \"projectDir\", \"platformPackagerFactory\", \"config\", \"effectiveOptionComputed\", \"prepackaged\"])\n\nexport function checkBuildRequestOptions(options: PackagerOptions & PublishOptions) {\n for (const optionName of Object.keys(options)) {\n if (!expectedOptions.has(optionName) && (options as any)[optionName] !== undefined) {\n throw new InvalidConfigurationError(`Unknown option \"${optionName}\"`)\n }\n }\n}\n\nexport function build(options: PackagerOptions & PublishOptions, packager: Packager = new Packager(options)): Promise<Array<string>> {\n checkBuildRequestOptions(options)\n\n const publishManager = new PublishManager(packager, options)\n const sigIntHandler = () => {\n log.warn(\"cancelled by SIGINT\")\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n }\n process.once(\"SIGINT\", sigIntHandler)\n\n const promise = packager.build().then(async buildResult => {\n const afterAllArtifactBuild = await resolveFunction(packager.appInfo.type, buildResult.configuration.afterAllArtifactBuild, \"afterAllArtifactBuild\")\n if (afterAllArtifactBuild != null) {\n const newArtifacts = asArray(await Promise.resolve(afterAllArtifactBuild(buildResult)))\n if (newArtifacts.length === 0 || !publishManager.isPublish) {\n return buildResult.artifactPaths\n }\n\n const publishConfigurations = await publishManager.getGlobalPublishConfigurations()\n if (publishConfigurations == null || publishConfigurations.length === 0) {\n return buildResult.artifactPaths\n }\n\n for (const newArtifact of newArtifacts) {\n if (buildResult.artifactPaths.includes(newArtifact)) {\n log.warn({ newArtifact }, \"skipping publish of artifact, already published\")\n continue\n }\n buildResult.artifactPaths.push(newArtifact)\n for (const publishConfiguration of publishConfigurations) {\n await publishManager.scheduleUpload(\n publishConfiguration,\n {\n file: newArtifact,\n arch: null,\n },\n packager.appInfo\n )\n }\n }\n }\n return buildResult.artifactPaths\n })\n\n return executeFinally(promise, isErrorOccurred => {\n let promise: Promise<any>\n if (isErrorOccurred) {\n publishManager.cancelTasks()\n promise = Promise.resolve(null)\n } else {\n promise = publishManager.awaitTasks()\n }\n\n return promise.then(() => {\n packager.clearPackagerEventListeners()\n process.removeListener(\"SIGINT\", sigIntHandler)\n })\n })\n}\n"]}
@@ -33,7 +33,7 @@ class LinuxPackager extends platformPackager_1.PlatformPackager {
33
33
  const targetClass = (() => {
34
34
  switch (name) {
35
35
  case "appimage":
36
- return require("./targets/AppImageTarget").default;
36
+ return require("./targets/appimage/AppImageTarget").default;
37
37
  case "snap":
38
38
  return require("./targets/snap").default;
39
39
  case "flatpak":
@@ -1 +1 @@
1
- {"version":3,"file":"linuxPackager.js","sourceRoot":"","sources":["../src/linuxPackager.ts"],"names":[],"mappings":";;;AAyEA,oDAcC;AAvFD,+CAAmC;AACnC,wDAA4D;AAC5D,iCAAqD;AAGrD,yDAAqD;AAIrD,mEAA+D;AAE/D,2DAA4D;AAE5D,MAAa,aAAc,SAAQ,mCAAoC;IAGrE,YAAY,IAAc;;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,CAAC,CAAA;QAE3B,MAAM,cAAc,GAAG,MAAA,IAAI,CAAC,4BAA4B,CAAC,cAAc,mCAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAA;QACrG,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAA,2BAAgB,EAAC,cAAc,CAAC,CAAA;IAC5H,CAAC;IAED,IAAI,aAAa;QACf,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC7B,CAAC;IAED,aAAa,CAAC,OAAsB,EAAE,MAAmE;QACvG,IAAI,MAAgC,CAAA;QACpC,MAAM,SAAS,GAAG,GAAG,EAAE;YACrB,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,CAAA;YACtC,CAAC;YACD,OAAO,MAAM,CAAA;QACf,CAAC,CAAA;QAED,KAAK,MAAM,IAAI,IAAI,OAAO,EA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,KAAK,CAAA;QACd,KAAK,mBAAI,CAAC,KAAK;YACb,OAAO,aAAa,CAAA;QAEtB;YACE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC","sourcesContent":["import { Arch } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/out/filename\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { LinuxConfiguration } from \"./options/linuxOptions\"\nimport { Packager } from \"./packager\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport AppImageTarget from \"./targets/AppImageTarget\"\nimport FlatpakTarget from \"./targets/FlatpakTarget\"\nimport FpmTarget from \"./targets/FpmTarget\"\nimport { LinuxTargetHelper } from \"./targets/LinuxTargetHelper\"\nimport SnapTarget from \"./targets/snap\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\n\nexport class LinuxPackager extends PlatformPackager<LinuxConfiguration> {\n readonly executableName: string\n\n constructor(info: Packager) {\n super(info, Platform.LINUX)\n\n const executableName = this.platformSpecificBuildOptions.executableName ?? info.config.executableName\n this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : sanitizeFileName(executableName)\n }\n\n get defaultTarget(): Array<string> {\n return [\"snap\", \"appimage\"]\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let helper: LinuxTargetHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new LinuxTargetHelper(this)\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n const targetClass: typeof AppImageTarget | typeof SnapTarget | typeof FlatpakTarget | typeof FpmTarget | null = (() => {\n switch (name) {\n case \"appimage\":\n return require(\"./targets/AppImageTarget\").default\n case \"snap\":\n return require(\"./targets/snap\").default\n case \"flatpak\":\n return require(\"./targets/FlatpakTarget\").default\n case \"deb\":\n case \"rpm\":\n case \"sh\":\n case \"freebsd\":\n case \"pacman\":\n case \"apk\":\n case \"p5p\":\n return require(\"./targets/FpmTarget\").default\n default:\n return null\n }\n })()\n\n mapper(name, outDir => {\n if (targetClass === null) {\n return createCommonTarget(name, outDir, this)\n }\n\n return new targetClass(name, this, getHelper(), outDir)\n })\n }\n }\n}\n\nexport function toAppImageOrSnapArch(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64\"\n case Arch.ia32:\n return \"i386\"\n case Arch.armv7l:\n return \"arm\"\n case Arch.arm64:\n return \"arm_aarch64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n"]}
1
+ {"version":3,"file":"linuxPackager.js","sourceRoot":"","sources":["../src/linuxPackager.ts"],"names":[],"mappings":";;;AAyEA,oDAcC;AAvFD,+CAAmC;AACnC,wDAA4D;AAC5D,iCAAqD;AAGrD,yDAAqD;AAIrD,mEAA+D;AAE/D,2DAA4D;AAE5D,MAAa,aAAc,SAAQ,mCAAoC;IAGrE,YAAY,IAAc;;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,CAAC,CAAA;QAE3B,MAAM,cAAc,GAAG,MAAA,IAAI,CAAC,4BAA4B,CAAC,cAAc,mCAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAA;QACrG,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAA,2BAAgB,EAAC,cAAc,CAAC,CAAA;IAC5H,CAAC;IAED,IAAI,aAAa;QACf,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC7B,CAAC;IAED,aAAa,CAAC,OAAsB,EAAE,MAAmE;QACvG,IAAI,MAAgC,CAAA;QACpC,MAAM,SAAS,GAAG,GAAG,EAAE;YACrB,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,CAAA;YACtC,CAAC;YACD,OA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,IAAI;YACZ,OAAO,MAAM,CAAA;QACf,KAAK,mBAAI,CAAC,MAAM;YACd,OAAO,KAAK,CAAA;QACd,KAAK,mBAAI,CAAC,KAAK;YACb,OAAO,aAAa,CAAA;QAEtB;YACE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC","sourcesContent":["import { Arch } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/out/filename\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { LinuxConfiguration } from \"./options/linuxOptions\"\nimport { Packager } from \"./packager\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport AppImageTarget from \"./targets/appimage/AppImageTarget\"\nimport FlatpakTarget from \"./targets/FlatpakTarget\"\nimport FpmTarget from \"./targets/FpmTarget\"\nimport { LinuxTargetHelper } from \"./targets/LinuxTargetHelper\"\nimport SnapTarget from \"./targets/snap\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\n\nexport class LinuxPackager extends PlatformPackager<LinuxConfiguration> {\n readonly executableName: string\n\n constructor(info: Packager) {\n super(info, Platform.LINUX)\n\n const executableName = this.platformSpecificBuildOptions.executableName ?? info.config.executableName\n this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : sanitizeFileName(executableName)\n }\n\n get defaultTarget(): Array<string> {\n return [\"snap\", \"appimage\"]\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let helper: LinuxTargetHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new LinuxTargetHelper(this)\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n const targetClass: typeof AppImageTarget | typeof SnapTarget | typeof FlatpakTarget | typeof FpmTarget | null = (() => {\n switch (name) {\n case \"appimage\":\n return require(\"./targets/appimage/AppImageTarget\").default\n case \"snap\":\n return require(\"./targets/snap\").default\n case \"flatpak\":\n return require(\"./targets/FlatpakTarget\").default\n case \"deb\":\n case \"rpm\":\n case \"sh\":\n case \"freebsd\":\n case \"pacman\":\n case \"apk\":\n case \"p5p\":\n return require(\"./targets/FpmTarget\").default\n default:\n return null\n }\n })()\n\n mapper(name, outDir => {\n if (targetClass === null) {\n return createCommonTarget(name, outDir, this)\n }\n\n return new targetClass(name, this, getHelper(), outDir)\n })\n }\n }\n}\n\nexport function toAppImageOrSnapArch(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64\"\n case Arch.ia32:\n return \"i386\"\n case Arch.armv7l:\n return \"arm\"\n case Arch.arm64:\n return \"arm_aarch64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n"]}
@@ -388,7 +388,6 @@ class MacPackager extends platformPackager_1.PlatformPackager {
388
388
  requirements: requirements || undefined,
389
389
  additionalArguments: customSignOptions.additionalArguments || [],
390
390
  };
391
- builder_util_1.log.debug({ file: builder_util_1.log.filePath(filePath), ...args }, "selecting signing options");
392
391
  return args;
393
392
  };
394
393
  return optionsForFile;
@@ -1 +1 @@
1
- {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAG7C,iFAAsE;AACtE,+CAcqB;AACrB,+DAAwD;AACxD,kCAAiC;AACjC,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,wDAAyK;AACzK,iCAAqD;AAIrD,yDAAmF;AACnF,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,sDAAuD;AACvD,oDAAoD;AACpD,4CAAgD;AAChD,wDAAmE;AACnE,mDAAsD;AAKtD,MAAa,WAAY,SAAQ,mCAAkC;IAoCjE,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,GAAG,CAAC,CAAA;QApClB,oBAAe,GAAG,IAAI,+BAAQ,CACrC,GAAG,EAAE;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,C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AA;AAC7G,CAAC","sourcesContent":["import { notarize } from \"@electron/notarize\"\nimport { NotarizeOptionsNotaryTool, NotaryToolKeychainCredentials } from \"@electron/notarize/lib/types\"\nimport { PerFileSignOptions, SignOptions } from \"@electron/osx-sign/dist/cjs/types\"\nimport { Identity } from \"@electron/osx-sign/dist/cjs/util-identities\"\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n statOrNull,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { CertType, CodeSigningInfo, createKeychain, CreateKeychainOptions, findIdentity, isSignAllowed, removeKeychain, reportError, sign } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { getTemplatePath } from \"./util/pathManager\"\nimport { resolveFunction } from \"./util/resolve\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nexport class MacPackager extends PlatformPackager<MacConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.info.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // codesign requires the filename to be normalized to the NFD form\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions, true)\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets } = config\n\n switch (arch) {\n default: {\n return super.doPack(config)\n }\n case Arch.universal: {\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\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 const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const sourceCatalogPath = path.join(x64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(arm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n await makeUniversalApp({\n x64AppPath: path.join(x64AppOutDir, appFile),\n arm64AppPath: path.join(arm64AppOutPath, appFile),\n outAppPath: path.join(appOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true, // must be ?? to allow false\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles || undefined,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles || undefined,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, this.config.masDev, {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, `${targetName}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n if (prepackaged == null) {\n await this.doPack({ outDir, appOutDir: targetOutDir, platformName: \"mas\", arch, platformSpecificBuildOptions: masBuildOptions, targets: [target] })\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch)\n } else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions, arch)\n }\n }\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n if (prepackaged == null) {\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: this.platform.nodeName as ElectronPlatformName,\n arch,\n platformSpecificBuildOptions: this.platformSpecificBuildOptions,\n targets,\n })\n }\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null, arch: Arch): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n const isMas = masOptions != null\n const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions\n const qualifier = options.identity\n const fallBackToAdhoc = (arch === Arch.arm64 || arch === Arch.universal) && !this.forceCodeSigning\n\n if (qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n if (fallBackToAdhoc) {\n log.warn(\"arm64 requires signing, but identity is set to null and signing is being skipped\")\n }\n return false\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = options.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateTypes = getCertificateTypes(isMas, isDevelopment)\n\n let identity = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainFile)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n const noIdentity = !options.sign && identity == null\n if (qualifier === \"-\") {\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity && fallBackToAdhoc) {\n log.warn(null, \"falling back to ad-hoc signature for macOS application code signing\")\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning)\n return false\n }\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n let filter = options.signIgnore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = null\n }\n } else if (filter != null) {\n filter = filter.length === 0 ? null : [filter]\n }\n\n const filterRe = filter == null ? null : filter.map(it => new RegExp(it))\n\n let binaries = options.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = (\n await Promise.all(\n binaries.flatMap(async destination => {\n const expandedDestination = this.expandArch(destination, arch)\n return await Promise.all(\n expandedDestination.map(async d => {\n if (await statOrNull(d)) {\n return d\n }\n return path.resolve(appPath, d)\n })\n )\n })\n )\n ).flat()\n log.info({ binaries, arch: arch == null ? null : Arch[arch] }, \"signing additional user-defined binaries for arch\")\n }\n const customSignOptions: MasConfiguration | MacConfiguration = (isMas ? masOptions : this.platformSpecificBuildOptions) || this.platformSpecificBuildOptions\n\n const signOptions: SignOptions = {\n identityValidation: false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity ? identity.hash || identity.name : undefined,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion || undefined,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n // https://github.com/electron-userland/electron-builder/issues/1480\n strictVerify: options.strictVerify,\n preAutoEntitlements: options.preAutoEntitlements,\n optionsForFile: await this.getOptionsForFile(appPath, isMas, customSignOptions),\n provisioningProfile: customSignOptions.provisioningProfile || undefined,\n }\n\n await this.doSign(signOptions, customSignOptions, identity)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainFile)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\", arch)\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.info.emitArtifactBuildCompleted({\n file: artifactPath,\n target: null,\n arch: Arch.x64,\n safeArtifactName: this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch),\n packager: this,\n })\n }\n\n if (!isMas) {\n await this.notarizeIfProvided(appPath)\n }\n return true\n }\n\n private async getOptionsForFile(appPath: string, isMas: boolean, customSignOptions: MacConfiguration) {\n const resourceList = await this.resourceList\n const entitlementsSuffix = isMas ? \"mas\" : \"mac\"\n\n const getEntitlements = (filePath: string) => {\n // check if root app, then use main entitlements\n if (filePath === appPath) {\n if (customSignOptions.entitlements) {\n return customSignOptions.entitlements\n }\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n // It's a login helper...\n if (filePath.includes(\"Library/LoginItems\")) {\n return customSignOptions.entitlementsLoginHelper\n }\n\n // Only remaining option is that it's inherited entitlements\n if (customSignOptions.entitlementsInherit) {\n return customSignOptions.entitlementsInherit\n }\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n const requirements = isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements)\n\n // harden by default for mac builds. Only harden mas builds if explicitly true (backward compatibility)\n const hardenedRuntime = isMas ? customSignOptions.hardenedRuntime === true : customSignOptions.hardenedRuntime !== false\n\n const optionsForFile: (filePath: string) => PerFileSignOptions = filePath => {\n const entitlements = getEntitlements(filePath)\n const args = {\n entitlements: entitlements || undefined,\n hardenedRuntime: hardenedRuntime ?? undefined,\n timestamp: customSignOptions.timestamp || undefined,\n requirements: requirements || undefined,\n additionalArguments: customSignOptions.additionalArguments || [],\n }\n log.debug({ file: log.filePath(filePath), ...args }, \"selecting signing options\")\n return args\n }\n return optionsForFile\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, customSignOptions: MacConfiguration, identity: Identity | null): Promise<void> {\n const customSign = await resolveFunction(this.appInfo.type, customSignOptions.sign, \"sign\")\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(outFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n Object.assign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n await this.sign(path.join(sourceDirectory, file), null, null, packContext.arch)\n }\n })\n )\n return true\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return true\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))\n\n return true\n }\n\n async notarizeIfProvided(appPath: string) {\n const notarizeOptions = this.platformSpecificBuildOptions.notarize\n if (notarizeOptions === false) {\n log.info({ reason: \"`notarize` options were set explicitly `false`\" }, \"skipped macOS notarization\")\n return\n }\n const options = this.getNotarizeOptions(appPath)\n if (!options) {\n log.warn({ reason: \"`notarize` options were unable to be generated\" }, \"skipped macOS notarization\")\n return\n }\n await notarize(options)\n log.info(null, \"notarization successful\")\n }\n\n private getNotarizeOptions(appPath: string): NotarizeOptionsNotaryTool | undefined {\n const teamId = process.env.APPLE_TEAM_ID\n const appleId = process.env.APPLE_ID\n const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD\n const tool = \"notarytool\"\n\n // option 1: app specific password\n if (appleId || appleIdPassword) {\n if (!appleId) {\n throw new InvalidConfigurationError(`APPLE_ID env var needs to be set`)\n }\n if (!appleIdPassword) {\n throw new InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`)\n }\n if (!teamId) {\n throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`)\n }\n return { tool, appPath, appleId, appleIdPassword, teamId }\n }\n\n // option 2: API key\n const appleApiKey = process.env.APPLE_API_KEY\n const appleApiKeyId = process.env.APPLE_API_KEY_ID\n const appleApiIssuer = process.env.APPLE_API_ISSUER\n if (appleApiKey || appleApiKeyId || appleApiIssuer) {\n if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {\n throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`)\n }\n return { tool, appPath, appleApiKey, appleApiKeyId, appleApiIssuer }\n }\n\n // option 3: keychain\n const keychain = process.env.APPLE_KEYCHAIN\n const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE\n if (keychainProfile) {\n let args: NotaryToolKeychainCredentials = { keychainProfile }\n if (keychain) {\n args = { ...args, keychain }\n }\n return { tool, appPath, ...args }\n }\n\n // if no credentials provided, skip silently\n return undefined\n }\n}\n\nfunction getCertificateTypes(isMas: boolean, isDevelopment: boolean): CertType[] {\n if (isDevelopment) {\n return isMas ? [\"Mac Developer\", \"Apple Development\"] : [\"Mac Developer\", \"Developer ID Application\"]\n }\n return isMas ? [\"Apple Distribution\", \"3rd Party Mac Developer Application\"] : [\"Developer ID Application\"]\n}\n"]}
1
+ {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAG7C,iFAAsE;AACtE,+CAcqB;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BC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,aAAsB;IACjE,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAA;IACvG,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,qCAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAA;AAC7G,CAAC","sourcesContent":["import { notarize } from \"@electron/notarize\"\nimport { NotarizeOptionsNotaryTool, NotaryToolKeychainCredentials } from \"@electron/notarize/lib/types\"\nimport { PerFileSignOptions, SignOptions } from \"@electron/osx-sign/dist/cjs/types\"\nimport { Identity } from \"@electron/osx-sign/dist/cjs/util-identities\"\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n statOrNull,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { CertType, CodeSigningInfo, createKeychain, CreateKeychainOptions, findIdentity, isSignAllowed, removeKeychain, reportError, sign } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { getTemplatePath } from \"./util/pathManager\"\nimport { resolveFunction } from \"./util/resolve\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nexport class MacPackager extends PlatformPackager<MacConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.info.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // codesign requires the filename to be normalized to the NFD form\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions, true)\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets } = config\n\n switch (arch) {\n default: {\n return super.doPack(config)\n }\n case Arch.universal: {\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\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 const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const sourceCatalogPath = path.join(x64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(arm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n await makeUniversalApp({\n x64AppPath: path.join(x64AppOutDir, appFile),\n arm64AppPath: path.join(arm64AppOutPath, appFile),\n outAppPath: path.join(appOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true, // must be ?? to allow false\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles || undefined,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles || undefined,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, this.config.masDev, {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, `${targetName}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n if (prepackaged == null) {\n await this.doPack({ outDir, appOutDir: targetOutDir, platformName: \"mas\", arch, platformSpecificBuildOptions: masBuildOptions, targets: [target] })\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch)\n } else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions, arch)\n }\n }\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n if (prepackaged == null) {\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: this.platform.nodeName as ElectronPlatformName,\n arch,\n platformSpecificBuildOptions: this.platformSpecificBuildOptions,\n targets,\n })\n }\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null, arch: Arch): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n const isMas = masOptions != null\n const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions\n const qualifier = options.identity\n const fallBackToAdhoc = (arch === Arch.arm64 || arch === Arch.universal) && !this.forceCodeSigning\n\n if (qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n if (fallBackToAdhoc) {\n log.warn(\"arm64 requires signing, but identity is set to null and signing is being skipped\")\n }\n return false\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = options.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateTypes = getCertificateTypes(isMas, isDevelopment)\n\n let identity = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainFile)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n const noIdentity = !options.sign && identity == null\n if (qualifier === \"-\") {\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity && fallBackToAdhoc) {\n log.warn(null, \"falling back to ad-hoc signature for macOS application code signing\")\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning)\n return false\n }\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n let filter = options.signIgnore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = null\n }\n } else if (filter != null) {\n filter = filter.length === 0 ? null : [filter]\n }\n\n const filterRe = filter == null ? null : filter.map(it => new RegExp(it))\n\n let binaries = options.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = (\n await Promise.all(\n binaries.flatMap(async destination => {\n const expandedDestination = this.expandArch(destination, arch)\n return await Promise.all(\n expandedDestination.map(async d => {\n if (await statOrNull(d)) {\n return d\n }\n return path.resolve(appPath, d)\n })\n )\n })\n )\n ).flat()\n log.info({ binaries, arch: arch == null ? null : Arch[arch] }, \"signing additional user-defined binaries for arch\")\n }\n const customSignOptions: MasConfiguration | MacConfiguration = (isMas ? masOptions : this.platformSpecificBuildOptions) || this.platformSpecificBuildOptions\n\n const signOptions: SignOptions = {\n identityValidation: false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity ? identity.hash || identity.name : undefined,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion || undefined,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n // https://github.com/electron-userland/electron-builder/issues/1480\n strictVerify: options.strictVerify,\n preAutoEntitlements: options.preAutoEntitlements,\n optionsForFile: await this.getOptionsForFile(appPath, isMas, customSignOptions),\n provisioningProfile: customSignOptions.provisioningProfile || undefined,\n }\n\n await this.doSign(signOptions, customSignOptions, identity)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainFile)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\", arch)\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.info.emitArtifactBuildCompleted({\n file: artifactPath,\n target: null,\n arch: Arch.x64,\n safeArtifactName: this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch),\n packager: this,\n })\n }\n\n if (!isMas) {\n await this.notarizeIfProvided(appPath)\n }\n return true\n }\n\n private async getOptionsForFile(appPath: string, isMas: boolean, customSignOptions: MacConfiguration) {\n const resourceList = await this.resourceList\n const entitlementsSuffix = isMas ? \"mas\" : \"mac\"\n\n const getEntitlements = (filePath: string) => {\n // check if root app, then use main entitlements\n if (filePath === appPath) {\n if (customSignOptions.entitlements) {\n return customSignOptions.entitlements\n }\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n // It's a login helper...\n if (filePath.includes(\"Library/LoginItems\")) {\n return customSignOptions.entitlementsLoginHelper\n }\n\n // Only remaining option is that it's inherited entitlements\n if (customSignOptions.entitlementsInherit) {\n return customSignOptions.entitlementsInherit\n }\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n const requirements = isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements)\n\n // harden by default for mac builds. Only harden mas builds if explicitly true (backward compatibility)\n const hardenedRuntime = isMas ? customSignOptions.hardenedRuntime === true : customSignOptions.hardenedRuntime !== false\n\n const optionsForFile: (filePath: string) => PerFileSignOptions = filePath => {\n const entitlements = getEntitlements(filePath)\n const args = {\n entitlements: entitlements || undefined,\n hardenedRuntime: hardenedRuntime ?? undefined,\n timestamp: customSignOptions.timestamp || undefined,\n requirements: requirements || undefined,\n additionalArguments: customSignOptions.additionalArguments || [],\n }\n return args\n }\n return optionsForFile\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, customSignOptions: MacConfiguration, identity: Identity | null): Promise<void> {\n const customSign = await resolveFunction(this.appInfo.type, customSignOptions.sign, \"sign\")\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(outFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n Object.assign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n await this.sign(path.join(sourceDirectory, file), null, null, packContext.arch)\n }\n })\n )\n return true\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return true\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))\n\n return true\n }\n\n async notarizeIfProvided(appPath: string) {\n const notarizeOptions = this.platformSpecificBuildOptions.notarize\n if (notarizeOptions === false) {\n log.info({ reason: \"`notarize` options were set explicitly `false`\" }, \"skipped macOS notarization\")\n return\n }\n const options = this.getNotarizeOptions(appPath)\n if (!options) {\n log.warn({ reason: \"`notarize` options were unable to be generated\" }, \"skipped macOS notarization\")\n return\n }\n await notarize(options)\n log.info(null, \"notarization successful\")\n }\n\n private getNotarizeOptions(appPath: string): NotarizeOptionsNotaryTool | undefined {\n const teamId = process.env.APPLE_TEAM_ID\n const appleId = process.env.APPLE_ID\n const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD\n const tool = \"notarytool\"\n\n // option 1: app specific password\n if (appleId || appleIdPassword) {\n if (!appleId) {\n throw new InvalidConfigurationError(`APPLE_ID env var needs to be set`)\n }\n if (!appleIdPassword) {\n throw new InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`)\n }\n if (!teamId) {\n throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`)\n }\n return { tool, appPath, appleId, appleIdPassword, teamId }\n }\n\n // option 2: API key\n const appleApiKey = process.env.APPLE_API_KEY\n const appleApiKeyId = process.env.APPLE_API_KEY_ID\n const appleApiIssuer = process.env.APPLE_API_ISSUER\n if (appleApiKey || appleApiKeyId || appleApiIssuer) {\n if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {\n throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`)\n }\n return { tool, appPath, appleApiKey, appleApiKeyId, appleApiIssuer }\n }\n\n // option 3: keychain\n const keychain = process.env.APPLE_KEYCHAIN\n const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE\n if (keychainProfile) {\n let args: NotaryToolKeychainCredentials = { keychainProfile }\n if (keychain) {\n args = { ...args, keychain }\n }\n return { tool, appPath, ...args }\n }\n\n // if no credentials provided, skip silently\n return undefined\n }\n}\n\nfunction getCertificateTypes(isMas: boolean, isDevelopment: boolean): CertType[] {\n if (isDevelopment) {\n return isMas ? [\"Mac Developer\", \"Apple Development\"] : [\"Mac Developer\", \"Developer ID Application\"]\n }\n return isMas ? [\"Apple Distribution\", \"3rd Party Mac Developer Application\"] : [\"Developer ID Application\"]\n}\n"]}
@@ -4,12 +4,11 @@ import { NpmNodeModulesCollector } from "./npmNodeModulesCollector";
4
4
  import { getPackageManagerCommand, PM } from "./packageManager";
5
5
  import { PnpmNodeModulesCollector } from "./pnpmNodeModulesCollector";
6
6
  import { NodeModuleInfo } from "./types";
7
- import { YarnNodeModulesCollector } from "./yarnNodeModulesCollector";
8
7
  import { BunNodeModulesCollector } from "./bunNodeModulesCollector";
9
8
  import { Lazy } from "lazy-val";
10
9
  import { TraversalNodeModulesCollector } from "./traversalNodeModulesCollector";
11
10
  export { getPackageManagerCommand, PM };
12
- export declare function getCollectorByPackageManager(pm: PM, rootDir: string, tempDirManager: TmpDir): NpmNodeModulesCollector | PnpmNodeModulesCollector | YarnNodeModulesCollector | TraversalNodeModulesCollector | BunNodeModulesCollector;
11
+ export declare function getCollectorByPackageManager(pm: PM, rootDir: string, tempDirManager: TmpDir): NpmNodeModulesCollector | PnpmNodeModulesCollector | TraversalNodeModulesCollector | BunNodeModulesCollector;
13
12
  export declare function getNodeModules(pm: PM, { rootDir, tempDirManager, packageName, }: {
14
13
  rootDir: string;
15
14
  tempDirManager: TmpDir;
@@ -54,22 +54,6 @@ export declare abstract class NodeModulesCollector<ProdDepType extends Dependenc
54
54
  *
55
55
  **/
56
56
  protected parseDependenciesTree(shellOutput: string): ProdDepType | Promise<ProdDepType>;
57
- /**
58
- *
59
- * This method attempts to extract and parse JSON data from shell output that may contain
60
- * additional non-JSON content (like warnings or informational messages). It first tries
61
- * to parse the entire output as JSON, and if that fails, it intelligently searches for
62
- * JSON content within the output by:
63
- * 1. Finding the first line that starts with `{` or `[`
64
- * 2. Tracking bracket depth to find the matching closing bracket
65
- * 3. Extracting only the valid JSON portion
66
- *
67
- * @param shellOutput - The raw output from a shell command, potentially containing JSON
68
- * @returns The parsed dependencies tree object
69
- * @throws {Error} If no JSON content is found in the output
70
- * @throws {Error} If no matching closing bracket is found in the output
71
- * @throws {SyntaxError} If the extracted content is not valid JSON
72
- */
73
57
  protected extractJsonFromPollutedOutput<T>(shellOutput: string): T;
74
58
  protected cacheKey(pkg: Pick<ProdDepType, "name" | "version" | "path">): string;
75
59
  protected packageVersionString(pkg: Pick<ProdDepType, "name" | "version">): string;
@@ -108,9 +92,9 @@ export declare abstract class NodeModulesCollector<ProdDepType extends Dependenc
108
92
  *
109
93
  * @param tree - The original dependency tree
110
94
  * @param packageName - The name of the package to check for and remove from the tree
111
- * @returns Promise resolving to the pruned dependency tree
95
+ * @returns The extracted dependency subtree
112
96
  */
113
- protected getTreeFromWorkspaces(tree: ProdDepType, packageName: string): Promise<ProdDepType>;
97
+ protected getTreeFromWorkspaces(tree: ProdDepType, packageName: string): ProdDepType;
114
98
  private transformToHoisterTree;
115
99
  private _getNodeModules;
116
100
  asyncExec(command: string, args: string[], cwd?: string): Promise<{
@@ -52,7 +52,7 @@ class NodeModulesCollector {
52
52
  async getNodeModules({ packageName }) {
53
53
  const tree = await this.getDependenciesTree(this.installOptions.manager);
54
54
  await this.collectAllDependencies(tree, packageName);
55
- const realTree = await this.getTreeFromWorkspaces(tree, packageName);
55
+ const realTree = this.getTreeFromWorkspaces(tree, packageName);
56
56
  await this.extractProductionDependencyGraph(realTree, packageName);
57
57
  const hoisterResult = (0, hoist_1.hoist)(this.transformToHoisterTree(this.productionGraph, packageName), {
58
58
  check: builder_util_1.log.isDebugEnabled,
@@ -90,17 +90,27 @@ class NodeModulesCollector {
90
90
  backoff: 2000,
91
91
  shouldRetry: async (error) => {
92
92
  var _a;
93
- const logFields = { error: error.message, tempOutputFile, cwd: this.rootDir };
93
+ const fields = { error: error.message, tempOutputFile, cwd: this.rootDir, packageManager: pm };
94
94
  if (!(await (0, builder_util_1.exists)(tempOutputFile))) {
95
- builder_util_1.log.debug(logFields, "dependency tree output file missing, retrying");
95
+ builder_util_1.log.debug(fields, "dependency tree output file missing, retrying");
96
96
  return true;
97
97
  }
98
98
  const fileContent = await fs.readFile(tempOutputFile, { encoding: "utf8" });
99
- const fields = { ...logFields, fileContent };
99
+ fields.fileContentLength = fileContent.length.toString();
100
100
  if (fileContent.trim().length === 0) {
101
101
  builder_util_1.log.debug(fields, "dependency tree output file empty, retrying");
102
102
  return true;
103
103
  }
104
+ // extract small start/end sample for debugging purposes (e.g. polluted console output)
105
+ const lines = fileContent.split("\n");
106
+ const lineSampleSize = Math.min(5, lines.length / 2);
107
+ if (2 * lineSampleSize > 5) {
108
+ fields.sampleStart = lines.slice(0, lineSampleSize).join("\n");
109
+ fields.sampleEnd = lines.slice(-lineSampleSize).join("\n");
110
+ }
111
+ else {
112
+ fields.content = fileContent;
113
+ }
104
114
  if ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes("Unexpected end of JSON input")) {
105
115
  builder_util_1.log.debug(fields, "JSON parse error in dependency tree, retrying");
106
116
  return true;
@@ -117,69 +127,30 @@ class NodeModulesCollector {
117
127
  parseDependenciesTree(shellOutput) {
118
128
  return this.extractJsonFromPollutedOutput(shellOutput);
119
129
  }
120
- /**
121
- *
122
- * This method attempts to extract and parse JSON data from shell output that may contain
123
- * additional non-JSON content (like warnings or informational messages). It first tries
124
- * to parse the entire output as JSON, and if that fails, it intelligently searches for
125
- * JSON content within the output by:
126
- * 1. Finding the first line that starts with `{` or `[`
127
- * 2. Tracking bracket depth to find the matching closing bracket
128
- * 3. Extracting only the valid JSON portion
129
- *
130
- * @param shellOutput - The raw output from a shell command, potentially containing JSON
131
- * @returns The parsed dependencies tree object
132
- * @throws {Error} If no JSON content is found in the output
133
- * @throws {Error} If no matching closing bracket is found in the output
134
- * @throws {SyntaxError} If the extracted content is not valid JSON
135
- */
136
130
  extractJsonFromPollutedOutput(shellOutput) {
137
131
  const consoleOutput = shellOutput.trim();
138
132
  try {
133
+ // Please for the love of all that is holy, this should cover 99% of cases where npm/pnpm/yarn output is clean JSON
139
134
  return JSON.parse(consoleOutput);
140
135
  }
141
136
  catch {
142
- // Continue
143
- }
144
- const lines = consoleOutput.split("\n");
145
- // Find the first line that starts with { or [
146
- const jsonStartIdx = lines.findIndex(line => {
147
- const trimmed = line.trim();
148
- return trimmed.startsWith("{") || trimmed.startsWith("[");
149
- });
150
- if (jsonStartIdx === -1) {
151
- throw new Error("No JSON content found in output");
137
+ // ignore
152
138
  }
153
- // Find matching closing bracket using bracket counting
154
- let depth = 0;
155
- let jsonEndIdx = -1;
156
- for (let i = jsonStartIdx; i < lines.length; i++) {
157
- const line = lines[i];
158
- for (const char of line) {
159
- if (char === "{" || char === "[") {
160
- depth++;
161
- }
162
- else if (char === "}" || char === "]") {
163
- depth--;
164
- if (depth === 0) {
165
- jsonEndIdx = i;
166
- break;
167
- }
168
- }
139
+ // DEDICATED FALLBACK FOR POLLUTED OUTPUT, non-trivial to implement correctly, not needed in most cases, and highly inefficient
140
+ // Find the first index that starts with { or [
141
+ const bracketOpen = Math.max(consoleOutput.indexOf("{"), 0);
142
+ const bracketOpenSquare = Math.max(consoleOutput.indexOf("["), 0);
143
+ const start = Math.min(bracketOpen, bracketOpenSquare); // always non-negative due to Math.max above
144
+ for (let i = start; i < consoleOutput.length; i++) {
145
+ const slice = consoleOutput.slice(start, i + 1);
146
+ try {
147
+ return JSON.parse(slice);
169
148
  }
170
- if (jsonEndIdx !== -1) {
171
- break;
149
+ catch {
150
+ // ignore, try next
172
151
  }
173
152
  }
174
- if (jsonEndIdx === -1) {
175
- throw new Error("No matching closing bracket found in output");
176
- }
177
- // Parse the matched JSON section
178
- const candidate = lines
179
- .slice(jsonStartIdx, jsonEndIdx + 1)
180
- .join("\n")
181
- .trim();
182
- return JSON.parse(candidate);
153
+ throw new Error("No JSON content found in output");
183
154
  }
184
155
  cacheKey(pkg) {
185
156
  const rel = path.relative(this.rootDir, pkg.path);
@@ -236,23 +207,17 @@ class NodeModulesCollector {
236
207
  *
237
208
  * @param tree - The original dependency tree
238
209
  * @param packageName - The name of the package to check for and remove from the tree
239
- * @returns Promise resolving to the pruned dependency tree
210
+ * @returns The extracted dependency subtree
240
211
  */
241
- async getTreeFromWorkspaces(tree, packageName) {
242
- var _a;
243
- if (!(tree.workspaces && tree.dependencies)) {
244
- return tree;
245
- }
246
- if ((_a = tree.dependencies) === null || _a === void 0 ? void 0 : _a[packageName]) {
247
- const { name, path, dependencies } = tree.dependencies[packageName];
248
- builder_util_1.log.debug({ name, path, dependencies: JSON.stringify(dependencies) }, "pruning root app/self reference from workspace tree");
249
- for (const [name, pkg] of Object.entries(dependencies !== null && dependencies !== void 0 ? dependencies : {})) {
250
- tree.dependencies[name] = pkg;
251
- this.allDependencies.set(this.packageVersionString(pkg), pkg);
212
+ getTreeFromWorkspaces(tree, packageName) {
213
+ if (tree.workspaces && tree.dependencies) {
214
+ for (const [key, value] of Object.entries(tree.dependencies)) {
215
+ if (key === packageName) {
216
+ return value;
217
+ }
252
218
  }
253
- delete tree.dependencies[packageName];
254
219
  }
255
- return Promise.resolve(tree);
220
+ return tree;
256
221
  }
257
222
  transformToHoisterTree(obj, key, nodes = new Map()) {
258
223
  let node = nodes.get(key);
@@ -340,7 +305,7 @@ class NodeModulesCollector {
340
305
  // If the command is a Windows script file (.cmd), we need to wrap it in a .bat file to ensure it runs correctly with cmd.exe
341
306
  // This is necessary because .cmd files are not directly executable in the same way as .bat files.
342
307
  // We create a temporary .bat file that calls the .cmd file with the provided arguments. The .bat file will be executed by cmd.exe.
343
- // Note: This is a workaround for Windows command execution quirks for specifically when `shell: false`
308
+ // Note: This is a workaround for Windows command execution quirks when using `shell: true`
344
309
  const tempBatFile = await this.tempDirManager.getTempFile({
345
310
  prefix: execName,
346
311
  suffix: ".bat",
@@ -348,7 +313,7 @@ class NodeModulesCollector {
348
313
  const batScript = `@echo off\r\n"${command}" %*\r\n`; // <-- CRLF required for .bat
349
314
  await fs.writeFile(tempBatFile, batScript, { encoding: "utf8" });
350
315
  command = "cmd.exe";
351
- args = ["/c", tempBatFile, ...args];
316
+ args = ["/c", `"${tempBatFile}"`, ...args];
352
317
  }
353
318
  await new Promise((resolve, reject) => {
354
319
  const outStream = (0, fs_extra_1.createWriteStream)(tempOutputFile);