app-builder-lib 26.0.10 → 26.0.12

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.
@@ -104,7 +104,8 @@ class WindowsSignAzureManager {
104
104
  const paramsString = Object.entries(params)
105
105
  .filter(([_, value]) => value != null)
106
106
  .reduce((res, [field, value]) => {
107
- return [...res, `-${field}`, value];
107
+ const escapedValue = String(value).replace(/'/g, "''");
108
+ return [...res, `-${field}`, `'${escapedValue}'`];
108
109
  }, [])
109
110
  .join(" ");
110
111
  await vm.exec(ps, ["-NoProfile", "-NonInteractive", "-Command", `Invoke-TrustedSigning ${paramsString}`]);
@@ -1 +1 @@
1
- {"version":3,"file":"windowsSignAzureManager.js","sourceRoot":"","sources":["../../src/codeSign/windowsSignAzureManager.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AACtE,+DAA+C;AAC/C,uCAA+B;AAO/B,MAAa,uBAAuB;IAgBlC,YAA6B,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QAbzC,0BAAqB,GAAG,IAAI,eAAI,CAAuB,GAAG,EAAE;;YACnE,MAAM,aAAa,GAAG,MAAA,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,0CAAE,aAAa,CAAA;YACvF,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;gBAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC9B,CAAC;iBAAM,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBACjC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,sBAAO,EAAC,aAAa,CAAC,CAAC,CAAA;YAChD,CAAC;YAED,6FAA6F;YAC7F,uBAAuB;YACvB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;QA6EO,YAAO,GAAG,IAAI,+BAAQ,CAC7B,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAChD,S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AAG,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9B,OAAO,CAAC,GAAG,GAAG,EAAE,IAAI,KAAK,EAAE,EAAE,KAAK,CAAC,CAAA;QACrC,CAAC,EAAE,EAAc,CAAC;aACjB,IAAI,CAAC,GAAG,CAAC,CAAA;QACZ,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,yBAAyB,YAAY,EAAE,CAAC,CAAC,CAAA;QAEzG,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAlID,0DAkIC","sourcesContent":["import { asArray, InvalidConfigurationError, log } from \"builder-util\"\nimport { MemoLazy } from \"builder-util-runtime\"\nimport { Lazy } from \"lazy-val\"\nimport { WindowsAzureSigningConfiguration, WindowsConfiguration } from \"../options/winOptions\"\nimport { WinPackager } from \"../winPackager\"\nimport { SignManager } from \"./signManager\"\nimport { WindowsSignOptions } from \"./windowsCodeSign\"\nimport { CertificateFromStoreInfo, FileCodeSigningInfo } from \"./windowsSignToolManager\"\n\nexport class WindowsSignAzureManager implements SignManager {\n private readonly platformSpecificBuildOptions: WindowsConfiguration\n\n readonly computedPublisherName = new Lazy<Array<string> | null>(() => {\n const publisherName = this.platformSpecificBuildOptions.azureSignOptions?.publisherName\n if (publisherName === null) {\n return Promise.resolve(null)\n } else if (publisherName != null) {\n return Promise.resolve(asArray(publisherName))\n }\n\n // TODO: Is there another way to automatically pull Publisher Name from AzureTrusted service?\n // For now return null.\n return Promise.resolve(null)\n })\n\n constructor(private readonly packager: WinPackager) {\n this.platformSpecificBuildOptions = packager.platformSpecificBuildOptions\n }\n\n async initialize() {\n const vm = await this.packager.vm.value\n const ps = await vm.powershellCommand.value\n\n log.info(null, \"installing required module (TrustedSigning) with scope CurrentUser\")\n try {\n await vm.exec(ps, [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser\"])\n } catch (error: any) {\n // Might not be needed, seems GH runners already have NuGet set up.\n // Logging to debug just in case users run into this. If NuGet isn't present, Install-Module -Name TrustedSigning will fail, so we'll get the logs at that point\n log.debug({ message: error.message || error.stack }, \"unable to install PackageProvider Nuget. Might be a false alarm though as some systems already have it installed\")\n }\n await vm.exec(ps, [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Install-Module -Name TrustedSigning -MinimumVersion 0.5.0 -Force -Repository PSGallery -Scope CurrentUser\"])\n\n // Preemptively check env vars once during initialization\n // Options: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition\n log.info(null, \"verifying env vars for authenticating to Microsoft Entra ID\")\n this.verifyRequiredEnvVars()\n if (!(this.verifyPrincipleSecretEnv() || this.verifyPrincipleCertificateEnv() || this.verifyUsernamePasswordEnv())) {\n throw new InvalidConfigurationError(\n `Unable to find valid azure env configuration for signing. Missing field(s) can be debugged via \"DEBUG=electron-builder\". Please refer to: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition`\n )\n }\n }\n\n verifyRequiredEnvVars() {\n ;[\"AZURE_TENANT_ID\", \"AZURE_CLIENT_ID\"].forEach(field => {\n if (!process.env[field]) {\n throw new InvalidConfigurationError(\n `Unable to find valid azure env field ${field} for signing. Please refer to: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition`\n )\n }\n })\n }\n\n verifyPrincipleSecretEnv() {\n if (!process.env.AZURE_CLIENT_SECRET) {\n log.debug({ envVar: \"AZURE_CLIENT_SECRET\" }, \"no secret found for authenticating to Microsoft Entra ID\")\n return false\n }\n return true\n }\n\n verifyPrincipleCertificateEnv() {\n if (!process.env.AZURE_CLIENT_CERTIFICATE_PATH) {\n log.debug({ envVar: \"AZURE_CLIENT_CERTIFICATE_PATH\" }, \"no path found for signing certificate for authenticating to Microsoft Entra ID\")\n return false\n }\n if (!process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD) {\n log.debug({ envVar: \"AZURE_CLIENT_CERTIFICATE_PASSWORD\" }, \"(optional) certificate password not found, assuming no password\")\n }\n if (!process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN) {\n log.debug({ envVar: \"AZURE_CLIENT_SEND_CERTIFICATE_CHAIN\" }, \"(optional) certificate chain not found\")\n }\n return true\n }\n\n verifyUsernamePasswordEnv() {\n if (!process.env.AZURE_USERNAME) {\n log.debug({ envVar: \"AZURE_USERNAME\" }, \"no username found for authenticating to Microsoft Entra ID\")\n if (!process.env.AZURE_PASSWORD) {\n log.debug({ envVar: \"AZURE_PASSWORD\" }, \"no password found for authenticating to Microsoft Entra ID\")\n }\n return false\n }\n return true\n }\n\n computePublisherName(): Promise<string> {\n return Promise.resolve(this.packager.platformSpecificBuildOptions.azureSignOptions!.publisherName)\n }\n readonly cscInfo = new MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>(\n () => this.packager.platformSpecificBuildOptions,\n _selected => Promise.resolve(null)\n )\n // prerequisite: requires `initializeProviderModules` to already have been executed\n async signFile(options: WindowsSignOptions): Promise<boolean> {\n const vm = await this.packager.vm.value\n const ps = await vm.powershellCommand.value\n\n const {\n publisherName: _publisher, // extract from `extraSigningArgs`\n endpoint,\n certificateProfileName,\n codeSigningAccountName,\n fileDigest,\n timestampRfc3161,\n timestampDigest,\n ...extraSigningArgs\n }: WindowsAzureSigningConfiguration = options.options.azureSignOptions!\n const params = {\n ...extraSigningArgs,\n Endpoint: endpoint,\n CertificateProfileName: certificateProfileName,\n CodeSigningAccountName: codeSigningAccountName,\n TimestampRfc3161: timestampRfc3161 || \"http://timestamp.acs.microsoft.com\",\n TimestampDigest: timestampDigest || \"SHA256\",\n FileDigest: fileDigest || \"SHA256\",\n Files: `\"${options.path}\"`,\n }\n const paramsString = Object.entries(params)\n .filter(([_, value]) => value != null)\n .reduce((res, [field, value]) => {\n return [...res, `-${field}`, value]\n }, [] as string[])\n .join(\" \")\n await vm.exec(ps, [\"-NoProfile\", \"-NonInteractive\", \"-Command\", `Invoke-TrustedSigning ${paramsString}`])\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"windowsSignAzureManager.js","sourceRoot":"","sources":["../../src/codeSign/windowsSignAzureManager.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AACtE,+DAA+C;AAC/C,uCAA+B;AAO/B,MAAa,uBAAuB;IAgBlC,YAA6B,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QAbzC,0BAAqB,GAAG,IAAI,eAAI,CAAuB,GAAG,EAAE;;YACnE,MAAM,aAAa,GAAG,MAAA,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,0CAAE,aAAa,CAAA;YACvF,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;gBAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC9B,CAAC;iBAAM,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBACjC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,sBAAO,EAAC,aAAa,CAAC,CAAC,CAAA;YAChD,CAAC;YAED,6FAA6F;YAC7F,uBAAuB;YACvB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;QA6EO,YAAO,GAAG,IAAI,+BAAQ,CAC7B,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAChD,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACnC,CAAA;QA7EC,IAAI,CAAC,4BAA4B,GAAG,QAAQ,CAAC,4BAA4B,CAAA;IAC3E,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAA;QACvC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAA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MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,yBAAyB,YAAY,EAAE,CAAC,CAAC,CAAA;QAEzG,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAnID,0DAmIC","sourcesContent":["import { asArray, InvalidConfigurationError, log } from \"builder-util\"\nimport { MemoLazy } from \"builder-util-runtime\"\nimport { Lazy } from \"lazy-val\"\nimport { WindowsAzureSigningConfiguration, WindowsConfiguration } from \"../options/winOptions\"\nimport { WinPackager } from \"../winPackager\"\nimport { SignManager } from \"./signManager\"\nimport { WindowsSignOptions } from \"./windowsCodeSign\"\nimport { CertificateFromStoreInfo, FileCodeSigningInfo } from \"./windowsSignToolManager\"\n\nexport class WindowsSignAzureManager implements SignManager {\n private readonly platformSpecificBuildOptions: WindowsConfiguration\n\n readonly computedPublisherName = new Lazy<Array<string> | null>(() => {\n const publisherName = this.platformSpecificBuildOptions.azureSignOptions?.publisherName\n if (publisherName === null) {\n return Promise.resolve(null)\n } else if (publisherName != null) {\n return Promise.resolve(asArray(publisherName))\n }\n\n // TODO: Is there another way to automatically pull Publisher Name from AzureTrusted service?\n // For now return null.\n return Promise.resolve(null)\n })\n\n constructor(private readonly packager: WinPackager) {\n this.platformSpecificBuildOptions = packager.platformSpecificBuildOptions\n }\n\n async initialize() {\n const vm = await this.packager.vm.value\n const ps = await vm.powershellCommand.value\n\n log.info(null, \"installing required module (TrustedSigning) with scope CurrentUser\")\n try {\n await vm.exec(ps, [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser\"])\n } catch (error: any) {\n // Might not be needed, seems GH runners already have NuGet set up.\n // Logging to debug just in case users run into this. If NuGet isn't present, Install-Module -Name TrustedSigning will fail, so we'll get the logs at that point\n log.debug({ message: error.message || error.stack }, \"unable to install PackageProvider Nuget. Might be a false alarm though as some systems already have it installed\")\n }\n await vm.exec(ps, [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Install-Module -Name TrustedSigning -MinimumVersion 0.5.0 -Force -Repository PSGallery -Scope CurrentUser\"])\n\n // Preemptively check env vars once during initialization\n // Options: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition\n log.info(null, \"verifying env vars for authenticating to Microsoft Entra ID\")\n this.verifyRequiredEnvVars()\n if (!(this.verifyPrincipleSecretEnv() || this.verifyPrincipleCertificateEnv() || this.verifyUsernamePasswordEnv())) {\n throw new InvalidConfigurationError(\n `Unable to find valid azure env configuration for signing. Missing field(s) can be debugged via \"DEBUG=electron-builder\". Please refer to: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition`\n )\n }\n }\n\n verifyRequiredEnvVars() {\n ;[\"AZURE_TENANT_ID\", \"AZURE_CLIENT_ID\"].forEach(field => {\n if (!process.env[field]) {\n throw new InvalidConfigurationError(\n `Unable to find valid azure env field ${field} for signing. Please refer to: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition`\n )\n }\n })\n }\n\n verifyPrincipleSecretEnv() {\n if (!process.env.AZURE_CLIENT_SECRET) {\n log.debug({ envVar: \"AZURE_CLIENT_SECRET\" }, \"no secret found for authenticating to Microsoft Entra ID\")\n return false\n }\n return true\n }\n\n verifyPrincipleCertificateEnv() {\n if (!process.env.AZURE_CLIENT_CERTIFICATE_PATH) {\n log.debug({ envVar: \"AZURE_CLIENT_CERTIFICATE_PATH\" }, \"no path found for signing certificate for authenticating to Microsoft Entra ID\")\n return false\n }\n if (!process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD) {\n log.debug({ envVar: \"AZURE_CLIENT_CERTIFICATE_PASSWORD\" }, \"(optional) certificate password not found, assuming no password\")\n }\n if (!process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN) {\n log.debug({ envVar: \"AZURE_CLIENT_SEND_CERTIFICATE_CHAIN\" }, \"(optional) certificate chain not found\")\n }\n return true\n }\n\n verifyUsernamePasswordEnv() {\n if (!process.env.AZURE_USERNAME) {\n log.debug({ envVar: \"AZURE_USERNAME\" }, \"no username found for authenticating to Microsoft Entra ID\")\n if (!process.env.AZURE_PASSWORD) {\n log.debug({ envVar: \"AZURE_PASSWORD\" }, \"no password found for authenticating to Microsoft Entra ID\")\n }\n return false\n }\n return true\n }\n\n computePublisherName(): Promise<string> {\n return Promise.resolve(this.packager.platformSpecificBuildOptions.azureSignOptions!.publisherName)\n }\n readonly cscInfo = new MemoLazy<WindowsConfiguration, FileCodeSigningInfo | CertificateFromStoreInfo | null>(\n () => this.packager.platformSpecificBuildOptions,\n _selected => Promise.resolve(null)\n )\n // prerequisite: requires `initializeProviderModules` to already have been executed\n async signFile(options: WindowsSignOptions): Promise<boolean> {\n const vm = await this.packager.vm.value\n const ps = await vm.powershellCommand.value\n\n const {\n publisherName: _publisher, // extract from `extraSigningArgs`\n endpoint,\n certificateProfileName,\n codeSigningAccountName,\n fileDigest,\n timestampRfc3161,\n timestampDigest,\n ...extraSigningArgs\n }: WindowsAzureSigningConfiguration = options.options.azureSignOptions!\n const params = {\n ...extraSigningArgs,\n Endpoint: endpoint,\n CertificateProfileName: certificateProfileName,\n CodeSigningAccountName: codeSigningAccountName,\n TimestampRfc3161: timestampRfc3161 || \"http://timestamp.acs.microsoft.com\",\n TimestampDigest: timestampDigest || \"SHA256\",\n FileDigest: fileDigest || \"SHA256\",\n Files: `\"${options.path}\"`,\n }\n const paramsString = Object.entries(params)\n .filter(([_, value]) => value != null)\n .reduce((res, [field, value]) => {\n const escapedValue = String(value).replace(/'/g, \"''\")\n return [...res, `-${field}`, `'${escapedValue}'`]\n }, [] as string[])\n .join(\" \")\n await vm.exec(ps, [\"-NoProfile\", \"-NonInteractive\", \"-Command\", `Invoke-TrustedSigning ${paramsString}`])\n\n return true\n }\n}\n"]}
@@ -120,8 +120,10 @@ class NodeModulesCollector {
120
120
  }
121
121
  getTreeFromWorkspaces(tree) {
122
122
  if (tree.workspaces && tree.dependencies) {
123
+ const packageJson = require(path.join(this.rootDir, "package.json"));
124
+ const dependencyName = packageJson.name;
123
125
  for (const [key, value] of Object.entries(tree.dependencies)) {
124
- if (this.rootDir.endsWith(path.normalize(key))) {
126
+ if (key === dependencyName) {
125
127
  return value;
126
128
  }
127
129
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/nodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,mCAAqE;AACrE,6BAA4B;AAC5B,yBAAwB;AAExB,+CAAwC;AAGxC,MAAsB,oBAAoB;IAKxC,YAA6B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;QAJpC,gBAAW,GAAqB,EAAE,CAAA;QAChC,sBAAiB,GAAwB,IAAI,GAAG,EAAE,CAAA;QAClD,oBAAe,GAAmB,IAAI,GAAG,EAAE,CAAA;IAEN,CAAC;IAEzC,KAAK,CAAC,cAAc;QACzB,MAAM,IAAI,GAAM,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAChD,MAAM,QAAQ,GAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;QACpD,MAAM,UAAU,GAAiC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;QAEnF,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;QAEvC,MAAM,cAAc,GAAmB,IAAI,CAAC,+BAA+B,CAAC,UAAU,CAAC,CAAA;QACvF,MAAM,eAAe,GAAoB,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAA;QAEtF,MAAM,aAAa,GAAkB,IAAA,aAAK,EAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QACrG,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,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E,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACrD,CAAC;CACF;AApMD,oDAoMC","sourcesContent":["import { hoist, type HoisterTree, type HoisterResult } from \"./hoist\"\nimport * as path from \"path\"\nimport * as fs from \"fs\"\nimport type { NodeModuleInfo, DependencyTree, DependencyGraph, Dependency } from \"./types\"\nimport { exec, log } from \"builder-util\"\nimport { Lazy } from \"lazy-val\"\n\nexport abstract class NodeModulesCollector<T extends Dependency<T, OptionalsType>, OptionalsType> {\n private nodeModules: NodeModuleInfo[] = []\n protected dependencyPathMap: Map<string, string> = new Map()\n protected allDependencies: Map<string, T> = new Map()\n\n constructor(private readonly rootDir: string) {}\n\n public async getNodeModules(): Promise<NodeModuleInfo[]> {\n const tree: T = await this.getDependenciesTree()\n const realTree: T = this.getTreeFromWorkspaces(tree)\n const parsedTree: Dependency<T, OptionalsType> = this.extractRelevantData(realTree)\n\n this.collectAllDependencies(parsedTree)\n\n const productionTree: DependencyTree = this.extractProductionDependencyTree(parsedTree)\n const dependencyGraph: DependencyGraph = this.convertToDependencyGraph(productionTree)\n\n const hoisterResult: HoisterResult = hoist(this.transToHoisterTree(dependencyGraph), { check: true })\n this._getNodeModules(hoisterResult.dependencies, this.nodeModules)\n\n return this.nodeModules\n }\n\n public abstract readonly installOptions: Promise<{\n cmd: string\n args: string[]\n lockfile: string\n }>\n protected abstract readonly pmCommand: Lazy<string>\n protected abstract getArgs(): string[]\n protected abstract parseDependenciesTree(jsonBlob: string): T\n protected abstract extractProductionDependencyTree(tree: Dependency<T, OptionalsType>): DependencyTree\n\n protected async getDependenciesTree(): Promise<T> {\n const command = await this.pmCommand.value\n const args = this.getArgs()\n const dependencies = await exec(command, args, {\n cwd: this.rootDir,\n shell: true,\n })\n return this.parseDependenciesTree(dependencies)\n }\n\n protected extractRelevantData(npmTree: T): Dependency<T, OptionalsType> {\n // Do not use `...npmTree` as we are explicitly extracting the data we need\n const { name, version, path, workspaces, dependencies } = npmTree\n const tree: Dependency<T, OptionalsType> = {\n name,\n version,\n path,\n workspaces,\n // DFS extract subtree\n dependencies: this.extractInternal(dependencies),\n }\n\n return tree\n }\n\n protected extractInternal(deps: T[\"dependencies\"]): T[\"dependencies\"] {\n return deps && Object.keys(deps).length > 0\n ? Object.entries(deps).reduce((accum, [packageName, depObjectOrVersionString]) => {\n return {\n ...accum,\n [packageName]:\n typeof depObjectOrVersionString === \"object\" && Object.keys(depObjectOrVersionString).length > 0\n ? this.extractRelevantData(depObjectOrVersionString)\n : depObjectOrVersionString,\n }\n }, {})\n : undefined\n }\n\n protected resolvePath(filePath: string): string {\n try {\n const stats = fs.lstatSync(filePath)\n if (stats.isSymbolicLink()) {\n return fs.realpathSync(filePath)\n } else {\n return filePath\n }\n } catch (error: any) {\n log.debug({ message: error.message || error.stack }, \"error resolving path\")\n return filePath\n }\n }\n\n private convertToDependencyGraph(tree: DependencyTree, parentKey = \".\"): DependencyGraph {\n return Object.entries(tree.dependencies || {}).reduce<DependencyGraph>((acc, curr) => {\n const [packageName, dependencies] = curr\n // Skip empty dependencies (like some optionalDependencies)\n if (Object.keys(dependencies).length === 0) {\n return acc\n }\n const version = dependencies.version || \"\"\n const newKey = `${packageName}@${version}`\n if (!dependencies.path) {\n log.error(\n {\n packageName,\n data: dependencies,\n parentModule: tree.name,\n parentVersion: tree.version,\n },\n \"dependency path is undefined\"\n )\n throw new Error(\"unable to parse `path` during `tree.dependencies` reduce\")\n }\n // Map dependency details: name, version and path to the dependency tree\n this.dependencyPathMap.set(newKey, path.normalize(this.resolvePath(dependencies.path)))\n if (!acc[parentKey]) {\n acc[parentKey] = { dependencies: [] }\n }\n acc[parentKey].dependencies.push(newKey)\n if (tree.implicitDependenciesInjected) {\n log.debug(\n {\n dependency: packageName,\n version,\n path: dependencies.path,\n parentModule: tree.name,\n parentVersion: tree.version,\n },\n \"converted implicit dependency\"\n )\n return acc\n }\n\n return { ...acc, ...this.convertToDependencyGraph(dependencies, newKey) }\n }, {})\n }\n\n private collectAllDependencies(tree: Dependency<T, OptionalsType>) {\n for (const [key, value] of Object.entries(tree.dependencies || {})) {\n if (Object.keys(value.dependencies ?? {}).length > 0) {\n this.allDependencies.set(`${key}@${value.version}`, value)\n this.collectAllDependencies(value)\n }\n }\n }\n\n private getTreeFromWorkspaces(tree: T): T {\n if (tree.workspaces && tree.dependencies) {\n for (const [key, value] of Object.entries(tree.dependencies)) {\n if (this.rootDir.endsWith(path.normalize(key))) {\n return value\n }\n }\n }\n return tree\n }\n\n private transToHoisterTree(obj: DependencyGraph, key: string = `.`, nodes: Map<string, HoisterTree> = new Map()): HoisterTree {\n let node = nodes.get(key)\n const name = key.match(/@?[^@]+/)![0]\n if (!node) {\n node = {\n name,\n identName: name,\n reference: key.match(/@?[^@]+@?(.+)?/)![1] || ``,\n dependencies: new Set<HoisterTree>(),\n peerNames: new Set<string>([]),\n }\n nodes.set(key, node)\n\n for (const dep of (obj[key] || {}).dependencies || []) {\n node.dependencies.add(this.transToHoisterTree(obj, dep, nodes))\n }\n }\n return node\n }\n\n private _getNodeModules(dependencies: Set<HoisterResult>, result: NodeModuleInfo[]) {\n if (dependencies.size === 0) {\n return\n }\n\n for (const d of dependencies.values()) {\n const reference = [...d.references][0]\n const p = this.dependencyPathMap.get(`${d.name}@${reference}`)\n if (p === undefined) {\n log.debug({ name: d.name, reference }, \"cannot find path for dependency\")\n continue\n }\n const node: NodeModuleInfo = {\n name: d.name,\n version: reference,\n dir: p,\n }\n result.push(node)\n if (d.dependencies.size > 0) {\n node.dependencies = []\n this._getNodeModules(d.dependencies, node.dependencies)\n }\n }\n result.sort((a, b) => a.name.localeCompare(b.name))\n }\n}\n"]}
1
+ {"version":3,"file":"nodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/nodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,mCAAqE;AACrE,6BAA4B;AAC5B,yBAAwB;AAExB,+CAAwC;AAGxC,MAAsB,oBAA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YAC5B,OAAM;QACR,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;YACtC,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;YACtC,MAAM,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC,CAAA;YAC9D,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBACpB,kBAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,iCAAiC,CAAC,CAAA;gBACzE,SAAQ;YACV,CAAC;YACD,MAAM,IAAI,GAAmB;gBAC3B,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,OAAO,EAAE,SAAS;gBAClB,GAAG,EAAE,CAAC;aACP,CAAA;YACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACjB,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;gBACtB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;YACzD,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACrD,CAAC;CACF;AAvMD,oDAuMC","sourcesContent":["import { hoist, type HoisterTree, type HoisterResult } from \"./hoist\"\nimport * as path from \"path\"\nimport * as fs from \"fs\"\nimport type { NodeModuleInfo, DependencyTree, DependencyGraph, Dependency } from \"./types\"\nimport { exec, log } from \"builder-util\"\nimport { Lazy } from \"lazy-val\"\n\nexport abstract class NodeModulesCollector<T extends Dependency<T, OptionalsType>, OptionalsType> {\n private nodeModules: NodeModuleInfo[] = []\n protected dependencyPathMap: Map<string, string> = new Map()\n protected allDependencies: Map<string, T> = new Map()\n\n constructor(private readonly rootDir: string) {}\n\n public async getNodeModules(): Promise<NodeModuleInfo[]> {\n const tree: T = await this.getDependenciesTree()\n const realTree: T = this.getTreeFromWorkspaces(tree)\n const parsedTree: Dependency<T, OptionalsType> = this.extractRelevantData(realTree)\n\n this.collectAllDependencies(parsedTree)\n\n const productionTree: DependencyTree = this.extractProductionDependencyTree(parsedTree)\n const dependencyGraph: DependencyGraph = this.convertToDependencyGraph(productionTree)\n\n const hoisterResult: HoisterResult = hoist(this.transToHoisterTree(dependencyGraph), { check: true })\n this._getNodeModules(hoisterResult.dependencies, this.nodeModules)\n\n return this.nodeModules\n }\n\n public abstract readonly installOptions: Promise<{\n cmd: string\n args: string[]\n lockfile: string\n }>\n protected abstract readonly pmCommand: Lazy<string>\n protected abstract getArgs(): string[]\n protected abstract parseDependenciesTree(jsonBlob: string): T\n protected abstract extractProductionDependencyTree(tree: Dependency<T, OptionalsType>): DependencyTree\n\n protected async getDependenciesTree(): Promise<T> {\n const command = await this.pmCommand.value\n const args = this.getArgs()\n const dependencies = await exec(command, args, {\n cwd: this.rootDir,\n shell: true,\n })\n return this.parseDependenciesTree(dependencies)\n }\n\n protected extractRelevantData(npmTree: T): Dependency<T, OptionalsType> {\n // Do not use `...npmTree` as we are explicitly extracting the data we need\n const { name, version, path, workspaces, dependencies } = npmTree\n const tree: Dependency<T, OptionalsType> = {\n name,\n version,\n path,\n workspaces,\n // DFS extract subtree\n dependencies: this.extractInternal(dependencies),\n }\n\n return tree\n }\n\n protected extractInternal(deps: T[\"dependencies\"]): T[\"dependencies\"] {\n return deps && Object.keys(deps).length > 0\n ? Object.entries(deps).reduce((accum, [packageName, depObjectOrVersionString]) => {\n return {\n ...accum,\n [packageName]:\n typeof depObjectOrVersionString === \"object\" && Object.keys(depObjectOrVersionString).length > 0\n ? this.extractRelevantData(depObjectOrVersionString)\n : depObjectOrVersionString,\n }\n }, {})\n : undefined\n }\n\n protected resolvePath(filePath: string): string {\n try {\n const stats = fs.lstatSync(filePath)\n if (stats.isSymbolicLink()) {\n return fs.realpathSync(filePath)\n } else {\n return filePath\n }\n } catch (error: any) {\n log.debug({ message: error.message || error.stack }, \"error resolving path\")\n return filePath\n }\n }\n\n private convertToDependencyGraph(tree: DependencyTree, parentKey = \".\"): DependencyGraph {\n return Object.entries(tree.dependencies || {}).reduce<DependencyGraph>((acc, curr) => {\n const [packageName, dependencies] = curr\n // Skip empty dependencies (like some optionalDependencies)\n if (Object.keys(dependencies).length === 0) {\n return acc\n }\n const version = dependencies.version || \"\"\n const newKey = `${packageName}@${version}`\n if (!dependencies.path) {\n log.error(\n {\n packageName,\n data: dependencies,\n parentModule: tree.name,\n parentVersion: tree.version,\n },\n \"dependency path is undefined\"\n )\n throw new Error(\"unable to parse `path` during `tree.dependencies` reduce\")\n }\n // Map dependency details: name, version and path to the dependency tree\n this.dependencyPathMap.set(newKey, path.normalize(this.resolvePath(dependencies.path)))\n if (!acc[parentKey]) {\n acc[parentKey] = { dependencies: [] }\n }\n acc[parentKey].dependencies.push(newKey)\n if (tree.implicitDependenciesInjected) {\n log.debug(\n {\n dependency: packageName,\n version,\n path: dependencies.path,\n parentModule: tree.name,\n parentVersion: tree.version,\n },\n \"converted implicit dependency\"\n )\n return acc\n }\n\n return { ...acc, ...this.convertToDependencyGraph(dependencies, newKey) }\n }, {})\n }\n\n private collectAllDependencies(tree: Dependency<T, OptionalsType>) {\n for (const [key, value] of Object.entries(tree.dependencies || {})) {\n if (Object.keys(value.dependencies ?? {}).length > 0) {\n this.allDependencies.set(`${key}@${value.version}`, value)\n this.collectAllDependencies(value)\n }\n }\n }\n\n private getTreeFromWorkspaces(tree: T): T {\n if (tree.workspaces && tree.dependencies) {\n const packageJson: Dependency<string, string> = require(path.join(this.rootDir, \"package.json\"))\n const dependencyName = packageJson.name\n for (const [key, value] of Object.entries(tree.dependencies)) {\n if (key === dependencyName) {\n return value\n }\n }\n }\n\n return tree\n }\n\n private transToHoisterTree(obj: DependencyGraph, key: string = `.`, nodes: Map<string, HoisterTree> = new Map()): HoisterTree {\n let node = nodes.get(key)\n const name = key.match(/@?[^@]+/)![0]\n if (!node) {\n node = {\n name,\n identName: name,\n reference: key.match(/@?[^@]+@?(.+)?/)![1] || ``,\n dependencies: new Set<HoisterTree>(),\n peerNames: new Set<string>([]),\n }\n nodes.set(key, node)\n\n for (const dep of (obj[key] || {}).dependencies || []) {\n node.dependencies.add(this.transToHoisterTree(obj, dep, nodes))\n }\n }\n return node\n }\n\n private _getNodeModules(dependencies: Set<HoisterResult>, result: NodeModuleInfo[]) {\n if (dependencies.size === 0) {\n return\n }\n\n for (const d of dependencies.values()) {\n const reference = [...d.references][0]\n const p = this.dependencyPathMap.get(`${d.name}@${reference}`)\n if (p === undefined) {\n log.debug({ name: d.name, reference }, \"cannot find path for dependency\")\n continue\n }\n const node: NodeModuleInfo = {\n name: d.name,\n version: reference,\n dir: p,\n }\n result.push(node)\n if (d.dependencies.size > 0) {\n node.dependencies = []\n this._getNodeModules(d.dependencies, node.dependencies)\n }\n }\n result.sort((a, b) => a.name.localeCompare(b.name))\n }\n}\n"]}
@@ -18,7 +18,7 @@ function hasGlobalInstallation(pm) {
18
18
  if (globalInstallationCache.has(key)) {
19
19
  return Promise.resolve(globalInstallationCache.get(key));
20
20
  }
21
- return (0, builder_util_1.exec)(pm, ["--version"])
21
+ return (0, builder_util_1.exec)(pm, ["--version"], { shell: true })
22
22
  .then(res => {
23
23
  return /^\d+.\d+.\d+$/.test(res);
24
24
  })
@@ -82,7 +82,7 @@ const detect = async ({ cwd, includeGlobalBun } = {}) => {
82
82
  };
83
83
  exports.detect = detect;
84
84
  function getPackageManagerVersion(pm) {
85
- return (0, builder_util_1.exec)(pm, ["--version"]).then(res => res.trim());
85
+ return (0, builder_util_1.exec)(pm, ["--version"], { shell: true }).then(res => res.trim());
86
86
  }
87
87
  function clearCache() {
88
88
  return cache.clear();
@@ -1 +1 @@
1
- {"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../src/node-module-collector/packageManager.ts"],"names":[],"mappings":";;;AAwFA,4DAEC;AAED,gCAEC;AA9FD,oFAAoF;AACpF,wFAAwF;AACxF,+BAAuC;AACvC,+CAA2C;AAI3C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;AACvB,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAmB,CAAA;AAC1D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAc,CAAA;AAE3C;;GAEG;AACH,SAAS,qBAAqB,CAAC,EAAM;IACnC,MAAM,GAAG,GAAG,cAAc,EAAE,EAAE,CAAA;IAC9B,IAAI,uBAAuB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,CAAA;IAC3D,CAAC;IAED,OAAO,IAAA,mBAAI,EAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC;SAC3B,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC,CAAC;SACD,IAAI,CAAC,KAAK,CAAC,EAAE;QACZ,uBAAuB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACvC,OAAO,KAAK,CAAA;IACd,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;AACvB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IAC5C,MAAM,GAAG,GAAG,YAAY,GAAG,EAAE,CAAA;IAC7B,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,aAA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C,EAAE,EAAE,CAAC;QAC5B,MAAM,GAAG,IAAA,cAAO,EAAC,MAAM,CAAC,CAAA;QACxB,IAAI,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IAED,IAAI,MAAM,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAI,MAAM,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,gBAAgB,IAAI,CAAC,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AA1BY,QAAA,MAAM,UA0BlB;AAED,SAAgB,wBAAwB,CAAC,EAAM;IAC7C,OAAO,IAAA,mBAAI,EAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;AACxD,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,KAAK,CAAC,KAAK,EAAE,CAAA;AACtB,CAAC","sourcesContent":["// copy from https://github.com/egoist/detect-package-manager/blob/main/src/index.ts\n// and merge https://github.com/egoist/detect-package-manager/pull/9 to support Monorepo\nimport { resolve, dirname } from \"path\"\nimport { exec, exists } from \"builder-util\"\n\nexport type PM = \"npm\" | \"yarn\" | \"pnpm\" | \"bun\"\n\nconst cache = new Map()\nconst globalInstallationCache = new Map<string, boolean>()\nconst lockfileCache = new Map<string, PM>()\n\n/**\n * Check if a global pm is available\n */\nfunction hasGlobalInstallation(pm: PM): Promise<boolean> {\n const key = `has_global_${pm}`\n if (globalInstallationCache.has(key)) {\n return Promise.resolve(globalInstallationCache.get(key)!)\n }\n\n return exec(pm, [\"--version\"])\n .then(res => {\n return /^\\d+.\\d+.\\d+$/.test(res)\n })\n .then(value => {\n globalInstallationCache.set(key, value)\n return value\n })\n .catch(() => false)\n}\n\nfunction getTypeofLockFile(cwd = process.cwd()): Promise<PM> {\n const key = `lockfile_${cwd}`\n if (lockfileCache.has(key)) {\n return Promise.resolve(lockfileCache.get(key)!)\n }\n\n return Promise.all([\n exists(resolve(cwd, \"yarn.lock\")),\n exists(resolve(cwd, \"package-lock.json\")),\n exists(resolve(cwd, \"pnpm-lock.yaml\")),\n exists(resolve(cwd, \"bun.lockb\")),\n ]).then(([isYarn, _, isPnpm, isBun]) => {\n let value: PM\n\n if (isYarn) {\n value = \"yarn\"\n } else if (isPnpm) {\n value = \"pnpm\"\n } else if (isBun) {\n value = \"bun\"\n } else {\n value = \"npm\"\n }\n\n cache.set(key, value)\n return value\n })\n}\n\nexport const detect = async ({ cwd, includeGlobalBun }: { cwd?: string; includeGlobalBun?: boolean } = {}) => {\n let type = await getTypeofLockFile(cwd)\n if (type) {\n return type\n }\n\n let tmpCwd = cwd || \".\"\n for (let i = 1; i <= 5; i++) {\n tmpCwd = dirname(tmpCwd)\n type = await getTypeofLockFile(tmpCwd)\n if (type) {\n return type\n }\n }\n\n if (await hasGlobalInstallation(\"yarn\")) {\n return \"yarn\"\n }\n if (await hasGlobalInstallation(\"pnpm\")) {\n return \"yarn\"\n }\n\n if (includeGlobalBun && (await hasGlobalInstallation(\"bun\"))) {\n return \"bun\"\n }\n return \"npm\"\n}\n\nexport function getPackageManagerVersion(pm: PM) {\n return exec(pm, [\"--version\"]).then(res => res.trim())\n}\n\nexport function clearCache() {\n return cache.clear()\n}\n"]}
1
+ {"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../src/node-module-collector/packageManager.ts"],"names":[],"mappings":";;;AAwFA,4DAEC;AAED,gCAEC;AA9FD,oFAAoF;AACpF,wFAAwF;AACxF,+BAAuC;AACvC,+CAA2C;AAI3C,MAAM,KAAK,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,MAAM,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAI,MAAM,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,gBAAgB,IAAI,CAAC,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AA1BY,QAAA,MAAM,UA0BlB;AAED,SAAgB,wBAAwB,CAAC,EAAM;IAC7C,OAAO,IAAA,mBAAI,EAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;AACzE,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,KAAK,CAAC,KAAK,EAAE,CAAA;AACtB,CAAC","sourcesContent":["// copy from https://github.com/egoist/detect-package-manager/blob/main/src/index.ts\n// and merge https://github.com/egoist/detect-package-manager/pull/9 to support Monorepo\nimport { resolve, dirname } from \"path\"\nimport { exec, exists } from \"builder-util\"\n\nexport type PM = \"npm\" | \"yarn\" | \"pnpm\" | \"bun\"\n\nconst cache = new Map()\nconst globalInstallationCache = new Map<string, boolean>()\nconst lockfileCache = new Map<string, PM>()\n\n/**\n * Check if a global pm is available\n */\nfunction hasGlobalInstallation(pm: PM): Promise<boolean> {\n const key = `has_global_${pm}`\n if (globalInstallationCache.has(key)) {\n return Promise.resolve(globalInstallationCache.get(key)!)\n }\n\n return exec(pm, [\"--version\"], { shell: true })\n .then(res => {\n return /^\\d+.\\d+.\\d+$/.test(res)\n })\n .then(value => {\n globalInstallationCache.set(key, value)\n return value\n })\n .catch(() => false)\n}\n\nfunction getTypeofLockFile(cwd = process.cwd()): Promise<PM> {\n const key = `lockfile_${cwd}`\n if (lockfileCache.has(key)) {\n return Promise.resolve(lockfileCache.get(key)!)\n }\n\n return Promise.all([\n exists(resolve(cwd, \"yarn.lock\")),\n exists(resolve(cwd, \"package-lock.json\")),\n exists(resolve(cwd, \"pnpm-lock.yaml\")),\n exists(resolve(cwd, \"bun.lockb\")),\n ]).then(([isYarn, _, isPnpm, isBun]) => {\n let value: PM\n\n if (isYarn) {\n value = \"yarn\"\n } else if (isPnpm) {\n value = \"pnpm\"\n } else if (isBun) {\n value = \"bun\"\n } else {\n value = \"npm\"\n }\n\n cache.set(key, value)\n return value\n })\n}\n\nexport const detect = async ({ cwd, includeGlobalBun }: { cwd?: string; includeGlobalBun?: boolean } = {}) => {\n let type = await getTypeofLockFile(cwd)\n if (type) {\n return type\n }\n\n let tmpCwd = cwd || \".\"\n for (let i = 1; i <= 5; i++) {\n tmpCwd = dirname(tmpCwd)\n type = await getTypeofLockFile(tmpCwd)\n if (type) {\n return type\n }\n }\n\n if (await hasGlobalInstallation(\"yarn\")) {\n return \"yarn\"\n }\n if (await hasGlobalInstallation(\"pnpm\")) {\n return \"yarn\"\n }\n\n if (includeGlobalBun && (await hasGlobalInstallation(\"bun\"))) {\n return \"bun\"\n }\n return \"npm\"\n}\n\nexport function getPackageManagerVersion(pm: PM) {\n return exec(pm, [\"--version\"], { shell: true }).then(res => res.trim())\n}\n\nexport function clearCache() {\n return cache.clear()\n}\n"]}
@@ -25,17 +25,32 @@ class PnpmNodeModulesCollector extends nodeModulesCollector_1.NodeModulesCollect
25
25
  extractProductionDependencyTree(tree) {
26
26
  const p = path.normalize(this.resolvePath(tree.path));
27
27
  const packageJson = require(path.join(p, "package.json"));
28
- const prodDependencies = { ...(packageJson.dependencies || {}), ...(packageJson.optionalDependencies || {}) };
29
28
  const deps = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) };
30
29
  const dependencies = Object.entries(deps).reduce((acc, curr) => {
30
+ var _b, _c;
31
31
  const [packageName, dependency] = curr;
32
- if (!prodDependencies[packageName]) {
32
+ let isOptional;
33
+ if ((_b = packageJson.dependencies) === null || _b === void 0 ? void 0 : _b[packageName]) {
34
+ isOptional = false;
35
+ }
36
+ else if ((_c = packageJson.optionalDependencies) === null || _c === void 0 ? void 0 : _c[packageName]) {
37
+ isOptional = true;
38
+ }
39
+ else {
33
40
  return acc;
34
41
  }
35
- return {
36
- ...acc,
37
- [packageName]: this.extractProductionDependencyTree(dependency),
38
- };
42
+ try {
43
+ return {
44
+ ...acc,
45
+ [packageName]: this.extractProductionDependencyTree(dependency),
46
+ };
47
+ }
48
+ catch (error) {
49
+ if (isOptional) {
50
+ return acc;
51
+ }
52
+ throw error;
53
+ }
39
54
  }, {});
40
55
  const { name, version, path: packagePath, workspaces } = tree;
41
56
  const depTree = {
@@ -1 +1 @@
1
- {"version":3,"file":"pnpmNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/pnpmNodeModulesCollector.ts"],"names":[],"mappings":";;;;AAAA,uCAA+B;AAC/B,iEAA6D;AAE7D,6BAA4B;AAC5B,+CAAwC;AAExC,MAAa,wBAAyB,SAAQ,2CAAoD;IAChG,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QAeG,cAAS,GAAiB,EAAwB,CAAC,SAAS,CAAA;QAC/D,mBAAc,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAA;IAfhJ,CAAC;IAiBS,OAAO;QACf,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;IAC5D,CAAC;IAES,mBAAmB,CAAC,OAAuB;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAA;QA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AW;YACjB,UAAU;YACV,YAAY;YACZ,4BAA4B,EAAE,KAAK;SACpC,CAAA;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;IAES,qBAAqB,CAAC,QAAgB;QAC9C,MAAM,cAAc,GAAqB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC7D,4CAA4C;QAC5C,OAAO,cAAc,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC;;AAjEH,4DAkEC;;AA7DiB,kCAAS,GAAG,IAAI,eAAI,CAAS,KAAK,IAAI,EAAE;IACtD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,IAAA,mBAAI,EAAC,MAAM,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;QACnC,CAAC;QAAC,OAAO,MAAW,EAAE,CAAC;YACrB,kBAAG,CAAC,KAAK,CAAC,IAAI,EAAE,6CAA6C,CAAC,CAAA;YAC9D,OAAO,UAAU,CAAA;QACnB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAC,AAVuB,CAUvB","sourcesContent":["import { Lazy } from \"lazy-val\"\nimport { NodeModulesCollector } from \"./nodeModulesCollector\"\nimport { Dependency, DependencyTree, PnpmDependency } from \"./types\"\nimport * as path from \"path\"\nimport { exec, log } from \"builder-util\"\n\nexport class PnpmNodeModulesCollector extends NodeModulesCollector<PnpmDependency, PnpmDependency> {\n constructor(rootDir: string) {\n super(rootDir)\n }\n\n static readonly pmCommand = new Lazy<string>(async () => {\n if (process.platform === \"win32\") {\n try {\n await exec(\"pnpm\", [\"--version\"])\n } catch (_error: any) {\n log.debug(null, \"pnpm not detected, falling back to pnpm.cmd\")\n return \"pnpm.cmd\"\n }\n }\n return \"pnpm\"\n })\n\n protected readonly pmCommand: Lazy<string> = PnpmNodeModulesCollector.pmCommand\n public readonly installOptions = this.pmCommand.value.then(cmd => ({ cmd, args: [\"install\", \"--frozen-lockfile\"], lockfile: \"pnpm-lock.yaml\" }))\n\n protected getArgs(): string[] {\n return [\"list\", \"--prod\", \"--json\", \"--depth\", \"Infinity\"]\n }\n\n protected extractRelevantData(npmTree: PnpmDependency): PnpmDependency {\n const tree = super.extractRelevantData(npmTree)\n return {\n ...tree,\n optionalDependencies: this.extractInternal(npmTree.optionalDependencies),\n }\n }\n\n extractProductionDependencyTree(tree: PnpmDependency): DependencyTree {\n const p = path.normalize(this.resolvePath(tree.path))\n const packageJson: Dependency<string, string> = require(path.join(p, \"package.json\"))\n const prodDependencies = { ...(packageJson.dependencies || {}), ...(packageJson.optionalDependencies || {}) }\n\n const deps = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) }\n const dependencies = Object.entries(deps).reduce<DependencyTree[\"dependencies\"]>((acc, curr) => {\n const [packageName, dependency] = curr\n if (!prodDependencies[packageName]) {\n return acc\n }\n return {\n ...acc,\n [packageName]: this.extractProductionDependencyTree(dependency),\n }\n }, {})\n\n const { name, version, path: packagePath, workspaces } = tree\n const depTree: DependencyTree = {\n name,\n version,\n path: packagePath,\n workspaces,\n dependencies,\n implicitDependenciesInjected: false,\n }\n return depTree\n }\n\n protected parseDependenciesTree(jsonBlob: string): PnpmDependency {\n const dependencyTree: PnpmDependency[] = JSON.parse(jsonBlob)\n // pnpm returns an array of dependency trees\n return dependencyTree[0]\n }\n}\n"]}
1
+ {"version":3,"file":"pnpmNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/pnpmNodeModulesCollector.ts"],"names":[],"mappings":";;;;AAAA,uCAA+B;AAC/B,iEAA6D;AAE7D,6BAA4B;AAC5B,+CAAwC;AAExC,MAAa,wBAAyB,SAAQ,2CAAoD;IAChG,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QAeG,cAAS,GAAiB,EAAwB,CAAC,SAAS,CAAA;QAC/D,mBAAc,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CA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AAA;AACf,CAAC,CAAC,AAVuB,CAUvB","sourcesContent":["import { Lazy } from \"lazy-val\"\nimport { NodeModulesCollector } from \"./nodeModulesCollector\"\nimport { Dependency, DependencyTree, PnpmDependency } from \"./types\"\nimport * as path from \"path\"\nimport { exec, log } from \"builder-util\"\n\nexport class PnpmNodeModulesCollector extends NodeModulesCollector<PnpmDependency, PnpmDependency> {\n constructor(rootDir: string) {\n super(rootDir)\n }\n\n static readonly pmCommand = new Lazy<string>(async () => {\n if (process.platform === \"win32\") {\n try {\n await exec(\"pnpm\", [\"--version\"])\n } catch (_error: any) {\n log.debug(null, \"pnpm not detected, falling back to pnpm.cmd\")\n return \"pnpm.cmd\"\n }\n }\n return \"pnpm\"\n })\n\n protected readonly pmCommand: Lazy<string> = PnpmNodeModulesCollector.pmCommand\n public readonly installOptions = this.pmCommand.value.then(cmd => ({ cmd, args: [\"install\", \"--frozen-lockfile\"], lockfile: \"pnpm-lock.yaml\" }))\n\n protected getArgs(): string[] {\n return [\"list\", \"--prod\", \"--json\", \"--depth\", \"Infinity\"]\n }\n\n protected extractRelevantData(npmTree: PnpmDependency): PnpmDependency {\n const tree = super.extractRelevantData(npmTree)\n return {\n ...tree,\n optionalDependencies: this.extractInternal(npmTree.optionalDependencies),\n }\n }\n\n extractProductionDependencyTree(tree: PnpmDependency): DependencyTree {\n const p = path.normalize(this.resolvePath(tree.path))\n const packageJson: Dependency<string, string> = require(path.join(p, \"package.json\"))\n\n const deps = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) }\n const dependencies = Object.entries(deps).reduce<DependencyTree[\"dependencies\"]>((acc, curr) => {\n const [packageName, dependency] = curr\n\n let isOptional: boolean\n if (packageJson.dependencies?.[packageName]) {\n isOptional = false\n } else if (packageJson.optionalDependencies?.[packageName]) {\n isOptional = true\n } else {\n return acc\n }\n\n try {\n return {\n ...acc,\n [packageName]: this.extractProductionDependencyTree(dependency),\n }\n } catch (error) {\n if (isOptional) {\n return acc\n }\n throw error\n }\n }, {})\n\n const { name, version, path: packagePath, workspaces } = tree\n const depTree: DependencyTree = {\n name,\n version,\n path: packagePath,\n workspaces,\n dependencies,\n implicitDependenciesInjected: false,\n }\n return depTree\n }\n\n protected parseDependenciesTree(jsonBlob: string): PnpmDependency {\n const dependencyTree: PnpmDependency[] = JSON.parse(jsonBlob)\n // pnpm returns an array of dependency trees\n return dependencyTree[0]\n }\n}\n"]}
@@ -149,6 +149,7 @@ export interface PlatformSpecificBuildOptions extends TargetSpecificOptions, Fil
149
149
  publish?: Publish;
150
150
  /**
151
151
  * Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.
152
+ * This does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).
152
153
  * @default true
153
154
  */
154
155
  readonly detectUpdateChannel?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformSpecificBuildOptions.js","sourceRoot":"","sources":["../../src/options/PlatformSpecificBuildOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { CompressionLevel, Publish, TargetConfiguration, TargetSpecificOptions } from \"../core\"\nimport { FileAssociation } from \"./FileAssociation\"\n\nexport interface FileSet {\n /**\n * The source path relative to and defaults to:\n *\n * - the [app directory](configuration.md#directories) for `files`,\n * - the project directory for `extraResources` and `extraFiles`.\n * If you don't use two-package.json structure and don't set custom app directory, app directory equals to project directory.\n */\n from?: string\n /**\n * The destination path relative to and defaults to:\n *\n * - the asar archive root for `files`,\n * - the app's content directory for `extraFiles`,\n * - the app's resource directory for `extraResources`.\n */\n to?: string\n /**\n * The [glob patterns](./file-patterns.md). Defaults to \"**\\/*\"\n */\n filter?: Array<string> | string\n}\n\nexport interface AsarOptions {\n /**\n * Whether to automatically unpack executables files.\n * @default true\n */\n smartUnpack?: boolean\n\n ordering?: string | null\n}\n\nexport interface FilesBuildOptions {\n /**\n * A [glob patterns](./file-patterns.md) relative to the [app directory](configuration.md#directories), which specifies which files to include when copying files to create the package.\n\nDefaults to:\n```json\n[\n \"**\\/*\",\n \"!**\\/node_modules/*\\/{CHANGELOG.md,README.md,README,readme.md,readme}\",\n \"!**\\/node_modules/*\\/{test,__tests__,tests,powered-test,example,examples}\",\n \"!**\\/node_modules/*.d.ts\",\n \"!**\\/node_modules/.bin\",\n \"!**\\/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}\",\n \"!.editorconfig\",\n \"!**\\/._*\",\n \"!**\\/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}\",\n \"!**\\/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}\",\n \"!**\\/{appveyor.yml,.travis.yml,circle.yml}\",\n \"!**\\/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}\"\n]\n```\n\nDevelopment dependencies are never copied in any case. You don't need to ignore it explicitly. Hidden files are not ignored by default, but all files that should be ignored, are ignored by default.\n\nDefault pattern \\`**\\/*\\` **is not added to your custom** if some of your patterns is not ignore (i.e. not starts with `!`). `package.json` and \\`**\\/node_modules/**\\/*` (only production dependencies will be copied) is added to your custom in any case. All default ignores are added in any case — you don't need to repeat it if you configure own patterns.\n\nMay be specified in the platform options (e.g. in the [mac](mac.md)).\n\nYou may also specify custom source and destination directories by using `FileSet` objects instead of simple glob patterns.\n\n```json\n[\n {\n \"from\": \"path/to/source\",\n \"to\": \"path/to/destination\",\n \"filter\": [\"**\\/*\", \"!foo/*.js\"]\n }\n]\n```\n\nYou can use [file macros](./file-patterns.md#file-macros) in the `from` and `to` fields as well. `from` and `to` can be files and you can use this to [rename](https://github.com/electron-userland/electron-builder/issues/1119) a file while packaging.\n */\n files?: Array<FileSet | string> | FileSet | string | null\n\n /**\n * A [glob patterns](./file-patterns.md) relative to the project directory, when specified, copy the file or directory with matching names directly into the app's resources directory (`Contents/Resources` for MacOS, `resources` for Linux and Windows).\n *\n * File patterns (and support for `from` and `to` fields) the same as for [files](#files).\n *\n */\n extraResources?: Array<FileSet | string> | FileSet | string | null\n\n /**\n * The same as [extraResources](#extraresources) but copy into the app's content directory (`Contents` for MacOS, root directory for Linux and Windows).\n */\n extraFiles?: Array<FileSet | string> | FileSet | string | null\n}\n\nexport interface PlatformSpecificBuildOptions extends TargetSpecificOptions, FilesBuildOptions {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * The [artifact file name template](./configuration.md#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).\n */\n readonly artifactName?: string | null\n\n /**\n * The executable name. Defaults to `productName`.\n */\n readonly executableName?: string | null\n\n /**\n * The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time.\n * @default normal\n */\n readonly compression?: CompressionLevel | null\n\n /**\n * Whether to exclude all default ignored files(https://www.electron.build/contents#files) and options. Defaults to `false`.\n *\n * @default false\n */\n disableDefaultIgnoredFiles?: boolean | null\n\n /**\n * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n *\n * Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#asarUnpack) - please file an issue if this doesn't work.\n * @default true\n */\n readonly asar?: AsarOptions | boolean | null\n\n /**\n * A [glob patterns](./file-patterns.md) relative to the [app directory](#directories), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive.\n */\n readonly asarUnpack?: Array<string> | string | null\n\n /* - @private */\n readonly icon?: string | null\n\n /**\n * The file associations.\n */\n readonly fileAssociations?: Array<FileAssociation> | FileAssociation\n /**\n * The URL protocol schemes.\n */\n readonly protocols?: Array<Protocol> | Protocol\n\n /**\n * The electron locales to keep. By default, all Electron locales used as-is.\n */\n readonly electronLanguages?: Array<string> | string\n\n /**\n * Whether to fail if app will be not code signed.\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * The [electron-updater compatibility](./auto-update.md#compatibility) semver range.\n */\n readonly electronUpdaterCompatibility?: string | null\n\n /**\n * Publisher configuration. See [Auto Update](./publish.md) for more information.\n */\n publish?: Publish\n\n /**\n * Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\n * @default true\n */\n readonly detectUpdateChannel?: boolean\n\n /**\n * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).\n * @default false\n */\n readonly generateUpdatesFilesForAllChannels?: boolean\n\n /**\n * The release info. Intended for command line usage:\n *\n * ```\n * -c.releaseInfo.releaseNotes=\"new features\"\n * ```\n */\n readonly releaseInfo?: ReleaseInfo\n\n readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null\n\n /* - @private */\n cscLink?: string | null\n\n /* - @private */\n cscKeyPassword?: string | null\n\n readonly defaultArch?: string\n}\n\nexport interface ReleaseInfo {\n /**\n * The release name.\n */\n releaseName?: string | null\n\n /**\n * The release notes.\n */\n releaseNotes?: string | null\n\n /**\n * The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](./contents.md#extraresources).\n */\n releaseNotesFile?: string | null\n\n /**\n * The release date.\n */\n releaseDate?: string\n\n /**\n * Vendor specific information.\n */\n vendor?: { [key: string]: any } | null\n}\n\n/**\n * URL Protocol Schemes. Protocols to associate the app with. macOS only.\n *\n * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).\n */\nexport interface Protocol {\n /**\n * The name. e.g. `IRC server URL`.\n */\n readonly name: string\n\n /**\n * The schemes. e.g. `[\"irc\", \"ircs\"]`.\n */\n readonly schemes: Array<string>\n\n /**\n * *macOS-only* The app’s role with respect to the type.\n * @default Editor\n */\n readonly role?: \"Editor\" | \"Viewer\" | \"Shell\" | \"None\"\n}\n"]}
1
+ {"version":3,"file":"PlatformSpecificBuildOptions.js","sourceRoot":"","sources":["../../src/options/PlatformSpecificBuildOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { CompressionLevel, Publish, TargetConfiguration, TargetSpecificOptions } from \"../core\"\nimport { FileAssociation } from \"./FileAssociation\"\n\nexport interface FileSet {\n /**\n * The source path relative to and defaults to:\n *\n * - the [app directory](configuration.md#directories) for `files`,\n * - the project directory for `extraResources` and `extraFiles`.\n * If you don't use two-package.json structure and don't set custom app directory, app directory equals to project directory.\n */\n from?: string\n /**\n * The destination path relative to and defaults to:\n *\n * - the asar archive root for `files`,\n * - the app's content directory for `extraFiles`,\n * - the app's resource directory for `extraResources`.\n */\n to?: string\n /**\n * The [glob patterns](./file-patterns.md). Defaults to \"**\\/*\"\n */\n filter?: Array<string> | string\n}\n\nexport interface AsarOptions {\n /**\n * Whether to automatically unpack executables files.\n * @default true\n */\n smartUnpack?: boolean\n\n ordering?: string | null\n}\n\nexport interface FilesBuildOptions {\n /**\n * A [glob patterns](./file-patterns.md) relative to the [app directory](configuration.md#directories), which specifies which files to include when copying files to create the package.\n\nDefaults to:\n```json\n[\n \"**\\/*\",\n \"!**\\/node_modules/*\\/{CHANGELOG.md,README.md,README,readme.md,readme}\",\n \"!**\\/node_modules/*\\/{test,__tests__,tests,powered-test,example,examples}\",\n \"!**\\/node_modules/*.d.ts\",\n \"!**\\/node_modules/.bin\",\n \"!**\\/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}\",\n \"!.editorconfig\",\n \"!**\\/._*\",\n \"!**\\/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}\",\n \"!**\\/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}\",\n \"!**\\/{appveyor.yml,.travis.yml,circle.yml}\",\n \"!**\\/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}\"\n]\n```\n\nDevelopment dependencies are never copied in any case. You don't need to ignore it explicitly. Hidden files are not ignored by default, but all files that should be ignored, are ignored by default.\n\nDefault pattern \\`**\\/*\\` **is not added to your custom** if some of your patterns is not ignore (i.e. not starts with `!`). `package.json` and \\`**\\/node_modules/**\\/*` (only production dependencies will be copied) is added to your custom in any case. All default ignores are added in any case — you don't need to repeat it if you configure own patterns.\n\nMay be specified in the platform options (e.g. in the [mac](mac.md)).\n\nYou may also specify custom source and destination directories by using `FileSet` objects instead of simple glob patterns.\n\n```json\n[\n {\n \"from\": \"path/to/source\",\n \"to\": \"path/to/destination\",\n \"filter\": [\"**\\/*\", \"!foo/*.js\"]\n }\n]\n```\n\nYou can use [file macros](./file-patterns.md#file-macros) in the `from` and `to` fields as well. `from` and `to` can be files and you can use this to [rename](https://github.com/electron-userland/electron-builder/issues/1119) a file while packaging.\n */\n files?: Array<FileSet | string> | FileSet | string | null\n\n /**\n * A [glob patterns](./file-patterns.md) relative to the project directory, when specified, copy the file or directory with matching names directly into the app's resources directory (`Contents/Resources` for MacOS, `resources` for Linux and Windows).\n *\n * File patterns (and support for `from` and `to` fields) the same as for [files](#files).\n *\n */\n extraResources?: Array<FileSet | string> | FileSet | string | null\n\n /**\n * The same as [extraResources](#extraresources) but copy into the app's content directory (`Contents` for MacOS, root directory for Linux and Windows).\n */\n extraFiles?: Array<FileSet | string> | FileSet | string | null\n}\n\nexport interface PlatformSpecificBuildOptions extends TargetSpecificOptions, FilesBuildOptions {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * The [artifact file name template](./configuration.md#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).\n */\n readonly artifactName?: string | null\n\n /**\n * The executable name. Defaults to `productName`.\n */\n readonly executableName?: string | null\n\n /**\n * The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time.\n * @default normal\n */\n readonly compression?: CompressionLevel | null\n\n /**\n * Whether to exclude all default ignored files(https://www.electron.build/contents#files) and options. Defaults to `false`.\n *\n * @default false\n */\n disableDefaultIgnoredFiles?: boolean | null\n\n /**\n * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).\n *\n * Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#asarUnpack) - please file an issue if this doesn't work.\n * @default true\n */\n readonly asar?: AsarOptions | boolean | null\n\n /**\n * A [glob patterns](./file-patterns.md) relative to the [app directory](#directories), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive.\n */\n readonly asarUnpack?: Array<string> | string | null\n\n /* - @private */\n readonly icon?: string | null\n\n /**\n * The file associations.\n */\n readonly fileAssociations?: Array<FileAssociation> | FileAssociation\n /**\n * The URL protocol schemes.\n */\n readonly protocols?: Array<Protocol> | Protocol\n\n /**\n * The electron locales to keep. By default, all Electron locales used as-is.\n */\n readonly electronLanguages?: Array<string> | string\n\n /**\n * Whether to fail if app will be not code signed.\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * The [electron-updater compatibility](./auto-update.md#compatibility) semver range.\n */\n readonly electronUpdaterCompatibility?: string | null\n\n /**\n * Publisher configuration. See [Auto Update](./publish.md) for more information.\n */\n publish?: Publish\n\n /**\n * Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\n * This does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).\n * @default true\n */\n readonly detectUpdateChannel?: boolean\n\n /**\n * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).\n * @default false\n */\n readonly generateUpdatesFilesForAllChannels?: boolean\n\n /**\n * The release info. Intended for command line usage:\n *\n * ```\n * -c.releaseInfo.releaseNotes=\"new features\"\n * ```\n */\n readonly releaseInfo?: ReleaseInfo\n\n readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null\n\n /* - @private */\n cscLink?: string | null\n\n /* - @private */\n cscKeyPassword?: string | null\n\n readonly defaultArch?: string\n}\n\nexport interface ReleaseInfo {\n /**\n * The release name.\n */\n releaseName?: string | null\n\n /**\n * The release notes.\n */\n releaseNotes?: string | null\n\n /**\n * The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](./contents.md#extraresources).\n */\n releaseNotesFile?: string | null\n\n /**\n * The release date.\n */\n releaseDate?: string\n\n /**\n * Vendor specific information.\n */\n vendor?: { [key: string]: any } | null\n}\n\n/**\n * URL Protocol Schemes. Protocols to associate the app with. macOS only.\n *\n * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).\n */\nexport interface Protocol {\n /**\n * The name. e.g. `IRC server URL`.\n */\n readonly name: string\n\n /**\n * The schemes. e.g. `[\"irc\", \"ircs\"]`.\n */\n readonly schemes: Array<string>\n\n /**\n * *macOS-only* The app’s role with respect to the type.\n * @default Editor\n */\n readonly role?: \"Editor\" | \"Viewer\" | \"Shell\" | \"None\"\n}\n"]}
@@ -34,7 +34,7 @@ export interface SquirrelWindowsOptions extends TargetSpecificOptions {
34
34
  */
35
35
  readonly useAppIdAsId?: boolean;
36
36
  /**
37
- * The custom squirrel vender dir. If not specified will use the Squirrel.Windows that is shipped with electron-installer(https://github.com/electron/windows-installer/tree/main/vendor).
37
+ * The custom squirrel vendor dir. If not specified will use the Squirrel.Windows that is shipped with electron-installer(https://github.com/electron/windows-installer/tree/main/vendor).
38
38
  * After https://github.com/electron-userland/electron-builder-binaries/pull/56 merged, will add `electron-builder-binaries` to get the latest version of squirrel.
39
39
  */
40
40
  readonly customSquirrelVendorDir?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SquirrelWindowsOptions.js","sourceRoot":"","sources":["../../src/options/SquirrelWindowsOptions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Squirrel.Windows options.\n */\nimport { TargetSpecificOptions } from \"../core\"\n\nexport interface SquirrelWindowsOptions extends TargetSpecificOptions {\n /**\n * A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Electron icon.\n *\n * Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http.\n *\n * If you don't plan to build windows installer, you can omit it.\n * If your project repository is public on GitHub, it will be `https://github.com/${u}/${p}/blob/master/build/icon.ico?raw=true` by default.\n */\n readonly iconUrl?: string | null\n\n /**\n * The path to a .gif file to display during install. `build/install-spinner.gif` will be used if exists (it is a recommended way to set)\n * (otherwise [default](https://github.com/electron/windows-installer/blob/master/resources/install-spinner.gif)).\n */\n readonly loadingGif?: string | null\n\n /**\n * Whether to create an MSI installer. Defaults to `false` (MSI is not created).\n */\n readonly msi?: boolean\n\n /**\n * A URL to your existing updates. Or `true` to automatically set to your GitHub repository. If given, these will be downloaded to create delta updates.\n */\n readonly remoteReleases?: string | boolean | null\n\n /**\n * Authentication token for remote updates\n */\n readonly remoteToken?: string | null\n\n /**\n * Use `appId` to identify package instead of `name`.\n */\n readonly useAppIdAsId?: boolean\n\n /**\n * The custom squirrel vender dir. If not specified will use the Squirrel.Windows that is shipped with electron-installer(https://github.com/electron/windows-installer/tree/main/vendor).\n * After https://github.com/electron-userland/electron-builder-binaries/pull/56 merged, will add `electron-builder-binaries` to get the latest version of squirrel.\n */\n readonly customSquirrelVendorDir?: string\n\n /**\n * https://github.com/electron-userland/electron-builder/issues/1743\n * @private\n */\n readonly name?: string\n}\n"]}
1
+ {"version":3,"file":"SquirrelWindowsOptions.js","sourceRoot":"","sources":["../../src/options/SquirrelWindowsOptions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Squirrel.Windows options.\n */\nimport { TargetSpecificOptions } from \"../core\"\n\nexport interface SquirrelWindowsOptions extends TargetSpecificOptions {\n /**\n * A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Electron icon.\n *\n * Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http.\n *\n * If you don't plan to build windows installer, you can omit it.\n * If your project repository is public on GitHub, it will be `https://github.com/${u}/${p}/blob/master/build/icon.ico?raw=true` by default.\n */\n readonly iconUrl?: string | null\n\n /**\n * The path to a .gif file to display during install. `build/install-spinner.gif` will be used if exists (it is a recommended way to set)\n * (otherwise [default](https://github.com/electron/windows-installer/blob/master/resources/install-spinner.gif)).\n */\n readonly loadingGif?: string | null\n\n /**\n * Whether to create an MSI installer. Defaults to `false` (MSI is not created).\n */\n readonly msi?: boolean\n\n /**\n * A URL to your existing updates. Or `true` to automatically set to your GitHub repository. If given, these will be downloaded to create delta updates.\n */\n readonly remoteReleases?: string | boolean | null\n\n /**\n * Authentication token for remote updates\n */\n readonly remoteToken?: string | null\n\n /**\n * Use `appId` to identify package instead of `name`.\n */\n readonly useAppIdAsId?: boolean\n\n /**\n * The custom squirrel vendor dir. If not specified will use the Squirrel.Windows that is shipped with electron-installer(https://github.com/electron/windows-installer/tree/main/vendor).\n * After https://github.com/electron-userland/electron-builder-binaries/pull/56 merged, will add `electron-builder-binaries` to get the latest version of squirrel.\n */\n readonly customSquirrelVendorDir?: string\n\n /**\n * https://github.com/electron-userland/electron-builder/issues/1743\n * @private\n */\n readonly name?: string\n}\n"]}
@@ -314,6 +314,7 @@ class PlatformPackager {
314
314
  const { appOutDir, electronPlatformName } = context;
315
315
  const ext = {
316
316
  darwin: ".app",
317
+ mas: ".app",
317
318
  win32: ".exe",
318
319
  linux: "",
319
320
  }[electronPlatformName];
@@ -1 +1 @@
1
- {"version":3,"file":"platformPackager.js","sourceRoot":"","sources":["../src/platformPackager.ts"],"names":[],"mappings":";;;AAw1BA,4CAEC;AAED,0EAeC;AAGD,oCAEC;AAED,sCAEC;AAp3BD,2CAAiG;AACjG,+CAeqB;AAErB,0CAAqC;AACrC,uCAA+B;AAE/B,6BAA4B;AAC5B,uCAAmC;AACnC,4DAA2D;AAC3D,8CAA8C;AAC9C,gDAA6D;AAE7D,+CAA8I;AAC9I,uDAA4E;AAC5E,2CAAwD;AACxD,mCAcgB;AAChB,kDAA2D;AAC3D,wDAA+I;AAC/I,wDAAmE;AAgBnE,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;QAQxH,IAAI,CAAC,4BAA4B,GAAG,gBAAgB,CAAC,qCAAqC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AC,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 { 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\"\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 dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise<void> {\n return this.info.emitArtifactBuildCompleted({\n file,\n safeArtifactName,\n target,\n arch,\n packager: this,\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 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 } else if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n } else {\n return appOutDir\n }\n }\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 protected async getOrConvertIcon(format: IconFormat): Promise<string | null> {\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 args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\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":";;;AAy1BA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AC,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 { 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\"\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 dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise<void> {\n return this.info.emitArtifactBuildCompleted({\n file,\n safeArtifactName,\n target,\n arch,\n packager: this,\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 } else if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n } else {\n return appOutDir\n }\n }\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 protected async getOrConvertIcon(format: IconFormat): Promise<string | null> {\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 args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\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"]}
package/out/util/yarn.js CHANGED
@@ -80,8 +80,9 @@ async function installDependencies(config, appDir, options) {
80
80
  const platform = options.platform || process.platform;
81
81
  const arch = options.arch || process.arch;
82
82
  const additionalArgs = options.additionalArgs;
83
- builder_util_1.log.info({ platform, arch, appDir }, `installing production dependencies`);
84
- const pm = await (0, node_module_collector_1.detect)({ cwd: appDir });
83
+ const projectDir = await (0, search_module_1.getProjectRootPath)(appDir);
84
+ const pm = await (0, node_module_collector_1.detect)({ cwd: projectDir });
85
+ builder_util_1.log.info({ pm, platform, arch, projectDir, appDir }, `installing production dependencies`);
85
86
  const execArgs = ["install"];
86
87
  const isYarnBerry = await checkYarnBerry(pm);
87
88
  if (!isYarnBerry) {
@@ -1 +1 @@
1
- {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;AAcA,4CAqBC;AAWD,8BAiCC;AAgDD,wCAiBC;AA4BD,0BAuCC;AAlND,uEAAwE;AAExE,+CAAkD;AAClD,uCAAqC;AAErC,2BAA4B;AAC5B,6BAA4B;AAE5B,6CAA4D;AAC5D,oEAA+E;AAE/E,+CAA4D;AAErD,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAAuB,EAAE,YAAY,GAAG,KAAK;IACzH,MAAM,gBAAgB,GAAmB;QACvC,eAAe,EAAE,MAAM,CAAC,2BAA2B,KAAK,IAAI;QAC5D,cAAc,EAAE,IAAA,sBAAO,EAAC,MAAM,CAAC,OAAO,CAAC;QACvC,GAAG,OAAO;KACX,CAAA;IACD,IAAI,uBAAuB,GAAG,KAAK,CAAA;IAEnC,KAAK,MAAM,SAAS,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC;QACpD,IAAI,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;YACnD,uBAAuB,GAAG,IAAI,CAAA;YAE9B,MAAK;QACP,CAAC;IACH,CAAC;IAED,IAAI,YAAY,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7C,MAAM,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC7D,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACjD,CAAC;AACH,CAAC;AAOD,SAAS,s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K,IAAI;KAClD,CAAA;IACD,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAA;IAEzD,IAAI,MAAM,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,CAAA;QAC7E,OAAO,IAAA,0CAA6B,EAAC,CAAC,sBAAsB,CAAC,EAAE,aAAa,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAA;IACrG,CAAC;IAED,MAAM,EACJ,aAAa,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAC5C,GAAG,OAAO,CAAA;IACX,MAAM,OAAO,GAAG;QACd,eAAe;QACf,IAAI;QACJ,eAAe;QACf,MAAM,EAAE,kBAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI;KACrC,CAAA;IACD,kBAAG,CAAC,IAAI,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;IAEhD,MAAM,cAAc,GAAmC;QACrD,SAAS,EAAE,MAAM;QACjB,eAAe;QACf,IAAI;QACJ,QAAQ;QACR,eAAe;QACf,eAAe,EAAE,MAAM,IAAA,kCAAkB,EAAC,MAAM,CAAC;QACjD,IAAI,EAAG,MAAM,CAAC,eAA+B,IAAI,YAAY;QAC7D,iBAAiB,EAAE,IAAI;KACxB,CAAA;IACD,OAAO,IAAA,iBAAa,EAAC,cAAc,CAAC,CAAA;AACtC,CAAC","sourcesContent":["import * as electronRebuild from \"@electron/rebuild\"\nimport { getProjectRootPath } from \"@electron/rebuild/lib/search-module\"\nimport { RebuildMode } from \"@electron/rebuild/lib/types\"\nimport { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { PM, detect, getPackageManagerVersion } from \"../node-module-collector\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\nimport { rebuild as remoteRebuild } from \"./rebuild/rebuild\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if (await pathExists(path.join(appDir, fileOrDir))) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(config, appDir, effectiveOptions)\n } else {\n await rebuild(config, appDir, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: common.npm_config_electron_mirror || \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nasync function checkYarnBerry(pm: PM) {\n if (pm !== \"yarn\") {\n return false\n }\n const version = await getPackageManagerVersion(pm)\n if (version == null || version.split(\".\").length < 1) {\n return false\n }\n\n return version.split(\".\")[0] >= \"2\"\n}\n\nasync function installDependencies(config: Configuration, appDir: string, options: RebuildOptions): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({ platform, arch, appDir }, `installing production dependencies`)\n const pm = await detect({ cwd: appDir })\n const execArgs = [\"install\"]\n const isYarnBerry = await checkYarnBerry(pm)\n if (!isYarnBerry) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n }\n\n if (!isRunningYarn(pm)) {\n execArgs.push(\"--prefer-offline\")\n }\n\n const execPath = getPackageToolPath(pm)\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n await spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n\n // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)\n // https://github.com/electron-userland/electron-builder/issues/8024\n return rebuild(config, appDir, options)\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = `node-gyp${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\n\nfunction getPackageToolPath(pm: PM) {\n let cmd = pm\n if (process.env.FORCE_YARN === \"true\") {\n cmd = \"yarn\"\n }\n return `${cmd}${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n}\n\nfunction isRunningYarn(pm: PM) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" || pm === \"yarn\" || (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\n/** @internal */\nexport async function rebuild(config: Configuration, appDir: string, options: RebuildOptions) {\n const configuration = {\n dependencies: await options.productionDeps.value,\n nodeExecPath: process.execPath,\n platform: options.platform || process.platform,\n arch: options.arch || process.arch,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n buildFromSource: options.buildFromSource === true,\n }\n const { arch, buildFromSource, platform } = configuration\n\n if (config.nativeRebuilder === \"legacy\") {\n const env = getGypEnv(options.frameworkInfo, platform, arch, buildFromSource)\n return executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n }\n\n const {\n frameworkInfo: { version: electronVersion },\n } = options\n const logInfo = {\n electronVersion,\n arch,\n buildFromSource,\n appDir: log.filePath(appDir) || \"./\",\n }\n log.info(logInfo, \"executing @electron/rebuild\")\n\n const rebuildOptions: electronRebuild.RebuildOptions = {\n buildPath: appDir,\n electronVersion,\n arch,\n platform,\n buildFromSource,\n projectRootPath: await getProjectRootPath(appDir),\n mode: (config.nativeRebuilder as RebuildMode) || \"sequential\",\n disablePreGypCopy: true,\n }\n return remoteRebuild(rebuildOptions)\n}\n"]}
1
+ {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;AA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AG,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,CAAA;QAC7E,OAAO,IAAA,0CAA6B,EAAC,CAAC,sBAAsB,CAAC,EAAE,aAAa,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAA;IACrG,CAAC;IAED,MAAM,EACJ,aAAa,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAC5C,GAAG,OAAO,CAAA;IACX,MAAM,OAAO,GAAG;QACd,eAAe;QACf,IAAI;QACJ,eAAe;QACf,MAAM,EAAE,kBAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI;KACrC,CAAA;IACD,kBAAG,CAAC,IAAI,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;IAEhD,MAAM,cAAc,GAAmC;QACrD,SAAS,EAAE,MAAM;QACjB,eAAe;QACf,IAAI;QACJ,QAAQ;QACR,eAAe;QACf,eAAe,EAAE,MAAM,IAAA,kCAAkB,EAAC,MAAM,CAAC;QACjD,IAAI,EAAG,MAAM,CAAC,eAA+B,IAAI,YAAY;QAC7D,iBAAiB,EAAE,IAAI;KACxB,CAAA;IACD,OAAO,IAAA,iBAAa,EAAC,cAAc,CAAC,CAAA;AACtC,CAAC","sourcesContent":["import * as electronRebuild from \"@electron/rebuild\"\nimport { getProjectRootPath } from \"@electron/rebuild/lib/search-module\"\nimport { RebuildMode } from \"@electron/rebuild/lib/types\"\nimport { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { PM, detect, getPackageManagerVersion } from \"../node-module-collector\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\nimport { rebuild as remoteRebuild } from \"./rebuild/rebuild\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if (await pathExists(path.join(appDir, fileOrDir))) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(config, appDir, effectiveOptions)\n } else {\n await rebuild(config, appDir, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: common.npm_config_electron_mirror || \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nasync function checkYarnBerry(pm: PM) {\n if (pm !== \"yarn\") {\n return false\n }\n const version = await getPackageManagerVersion(pm)\n if (version == null || version.split(\".\").length < 1) {\n return false\n }\n\n return version.split(\".\")[0] >= \"2\"\n}\n\nasync function installDependencies(config: Configuration, appDir: string, options: RebuildOptions): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n const projectDir = await getProjectRootPath(appDir)\n const pm = await detect({ cwd: projectDir })\n log.info({ pm, platform, arch, projectDir, appDir }, `installing production dependencies`)\n const execArgs = [\"install\"]\n const isYarnBerry = await checkYarnBerry(pm)\n if (!isYarnBerry) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n }\n\n if (!isRunningYarn(pm)) {\n execArgs.push(\"--prefer-offline\")\n }\n\n const execPath = getPackageToolPath(pm)\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n await spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n\n // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)\n // https://github.com/electron-userland/electron-builder/issues/8024\n return rebuild(config, appDir, options)\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = `node-gyp${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\n\nfunction getPackageToolPath(pm: PM) {\n let cmd = pm\n if (process.env.FORCE_YARN === \"true\") {\n cmd = \"yarn\"\n }\n return `${cmd}${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n}\n\nfunction isRunningYarn(pm: PM) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" || pm === \"yarn\" || (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\n/** @internal */\nexport async function rebuild(config: Configuration, appDir: string, options: RebuildOptions) {\n const configuration = {\n dependencies: await options.productionDeps.value,\n nodeExecPath: process.execPath,\n platform: options.platform || process.platform,\n arch: options.arch || process.arch,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n buildFromSource: options.buildFromSource === true,\n }\n const { arch, buildFromSource, platform } = configuration\n\n if (config.nativeRebuilder === \"legacy\") {\n const env = getGypEnv(options.frameworkInfo, platform, arch, buildFromSource)\n return executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n }\n\n const {\n frameworkInfo: { version: electronVersion },\n } = options\n const logInfo = {\n electronVersion,\n arch,\n buildFromSource,\n appDir: log.filePath(appDir) || \"./\",\n }\n log.info(logInfo, \"executing @electron/rebuild\")\n\n const rebuildOptions: electronRebuild.RebuildOptions = {\n buildPath: appDir,\n electronVersion,\n arch,\n platform,\n buildFromSource,\n projectRootPath: await getProjectRootPath(appDir),\n mode: (config.nativeRebuilder as RebuildMode) || \"sequential\",\n disablePreGypCopy: true,\n }\n return remoteRebuild(rebuildOptions)\n}\n"]}
package/out/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "26.0.10";
1
+ export declare const PACKAGE_VERSION = "26.0.12";
package/out/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PACKAGE_VERSION = void 0;
4
- exports.PACKAGE_VERSION = "26.0.10";
4
+ exports.PACKAGE_VERSION = "26.0.12";
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,SAAS,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.0.10\"\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,SAAS,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.0.12\"\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "app-builder-lib",
3
3
  "description": "electron-builder lib",
4
- "version": "26.0.10",
4
+ "version": "26.0.12",
5
5
  "main": "out/index.js",
6
6
  "files": [
7
7
  "out",
@@ -76,9 +76,9 @@
76
76
  "temp-file": "^3.4.0",
77
77
  "tiny-async-pool": "1.3.0",
78
78
  "plist": "3.1.0",
79
- "builder-util": "26.0.7",
80
- "builder-util-runtime": "9.3.1",
81
- "electron-publish": "26.0.7"
79
+ "builder-util": "26.0.11",
80
+ "electron-publish": "26.0.11",
81
+ "builder-util-runtime": "9.3.1"
82
82
  },
83
83
  "///": "babel in devDependencies for proton tests",
84
84
  "devDependencies": {
@@ -111,12 +111,12 @@
111
111
  "@types/tiny-async-pool": "^1",
112
112
  "@types/plist": "3.0.5",
113
113
  "toml": "^3.0.0",
114
- "dmg-builder": "26.0.10",
115
- "electron-builder-squirrel-windows": "26.0.10"
114
+ "dmg-builder": "26.0.12",
115
+ "electron-builder-squirrel-windows": "26.0.12"
116
116
  },
117
117
  "peerDependencies": {
118
- "dmg-builder": "26.0.10",
119
- "electron-builder-squirrel-windows": "26.0.10"
118
+ "dmg-builder": "26.0.12",
119
+ "electron-builder-squirrel-windows": "26.0.12"
120
120
  },
121
121
  "//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
122
122
  "typings": "./out/index.d.ts"
package/scheme.json CHANGED
@@ -1756,7 +1756,7 @@
1756
1756
  },
1757
1757
  "detectUpdateChannel": {
1758
1758
  "default": true,
1759
- "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
1759
+ "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\nThis does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).",
1760
1760
  "type": "boolean"
1761
1761
  },
1762
1762
  "disableDefaultIgnoredFiles": {
@@ -2437,7 +2437,7 @@
2437
2437
  },
2438
2438
  "detectUpdateChannel": {
2439
2439
  "default": true,
2440
- "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
2440
+ "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\nThis does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).",
2441
2441
  "type": "boolean"
2442
2442
  },
2443
2443
  "disableDefaultIgnoredFiles": {
@@ -3069,7 +3069,7 @@
3069
3069
  },
3070
3070
  "detectUpdateChannel": {
3071
3071
  "default": true,
3072
- "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
3072
+ "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\nThis does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).",
3073
3073
  "type": "boolean"
3074
3074
  },
3075
3075
  "disableDefaultIgnoredFiles": {
@@ -6010,7 +6010,7 @@
6010
6010
  ]
6011
6011
  },
6012
6012
  "customSquirrelVendorDir": {
6013
- "description": "The custom squirrel vender dir. If not specified will use the Squirrel.Windows that is shipped with electron-installer(https://github.com/electron/windows-installer/tree/main/vendor).\nAfter https://github.com/electron-userland/electron-builder-binaries/pull/56 merged, will add `electron-builder-binaries` to get the latest version of squirrel.",
6013
+ "description": "The custom squirrel vendor dir. If not specified will use the Squirrel.Windows that is shipped with electron-installer(https://github.com/electron/windows-installer/tree/main/vendor).\nAfter https://github.com/electron-userland/electron-builder-binaries/pull/56 merged, will add `electron-builder-binaries` to get the latest version of squirrel.",
6014
6014
  "type": "string"
6015
6015
  },
6016
6016
  "iconUrl": {
@@ -6274,7 +6274,7 @@
6274
6274
  },
6275
6275
  "detectUpdateChannel": {
6276
6276
  "default": true,
6277
- "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
6277
+ "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\nThis does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).",
6278
6278
  "type": "boolean"
6279
6279
  },
6280
6280
  "disableDefaultIgnoredFiles": {
@@ -6960,7 +6960,7 @@
6960
6960
  },
6961
6961
  "detectUpdateChannel": {
6962
6962
  "default": true,
6963
- "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
6963
+ "description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.\nThis does *not* apply to github publishing, which will [never auto-detect the update channel](https://github.com/electron-userland/electron-builder/issues/8589).",
6964
6964
  "type": "boolean"
6965
6965
  },
6966
6966
  "directories": {
@@ -36,9 +36,9 @@ fi
36
36
  #
37
37
  # Unfortunately, at the moment AppArmor doesn't have a good story for backwards compatibility.
38
38
  # https://askubuntu.com/questions/1517272/writing-a-backwards-compatible-apparmor-profile
39
- APPARMOR_PROFILE_SOURCE='/opt/${sanitizedProductName}/resources/apparmor-profile'
40
- APPARMOR_PROFILE_TARGET='/etc/apparmor.d/${executable}'
41
- if test -d "/etc/apparmor.d"; then
39
+ if apparmor_status --enabled > /dev/null 2>&1; then
40
+ APPARMOR_PROFILE_SOURCE='/opt/${sanitizedProductName}/resources/apparmor-profile'
41
+ APPARMOR_PROFILE_TARGET='/etc/apparmor.d/${executable}'
42
42
  if apparmor_parser --skip-kernel-load --debug "$APPARMOR_PROFILE_SOURCE" > /dev/null 2>&1; then
43
43
  cp -f "$APPARMOR_PROFILE_SOURCE" "$APPARMOR_PROFILE_TARGET"
44
44
 
@@ -54,4 +54,4 @@ if test -d "/etc/apparmor.d"; then
54
54
  else
55
55
  echo "Skipping the installation of the AppArmor profile as this version of AppArmor does not seem to support the bundled profile"
56
56
  fi
57
- fi
57
+ fi