workflow_launcher/node_modules/app-builder-lib/out/packager.js.map
2024-03-12 12:57:14 +01:00

1 line
38 KiB
Plaintext

{"version":3,"file":"packager.js","sourceRoot":"","sources":["../src/packager.ts"],"names":[],"mappings":";;;AAAA,+CAAoL;AACpL,+DAAwD;AACxD,sDAA+E;AAC/E,mCAAqC;AACrC,uCAAoD;AACpD,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,gDAA2D;AAC3D,uCAAmC;AACnC,sCAA0C;AAE1C,iCAA+D;AAC/D,oEAA6E;AAE7E,gEAA4D;AAG5D,yDAAsE;AACtE,uDAAmD;AACnD,2DAAgG;AAChG,0CAAqF;AACrF,wDAAkD;AAClD,oEAAwF;AACxF,4DAAuE;AACvE,0DAAyD;AACzD,sCAA8D;AAC9D,uCAA2C;AAC3C,2BAA4C;AAE5C,SAAS,UAAU,CAAC,OAAqB,EAAE,KAAa,EAAE,OAAsC;IAC9F,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;AAC5B,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,aAA4B,EAAE,QAAkB;IACjF,IAAI,SAAS,GAAG,aAAa,CAAC,SAAS,CAAA;IACvC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAA;IACrC,CAAC;IAED,IAAI,WAAW,GAAG,aAAa,CAAC,WAAW,CAAA;IAC3C,IAAI,SAAS,KAAK,UAAU,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QAClD,OAAO,MAAM,IAAA,kDAA8B,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACtE,CAAC;IAED,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QACrD,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA;IACrC,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,eA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C;QACtB,CAAC,CAAC,OAAO,GAAG,qBAAqB,CAAA;IACnC,CAAC;IACD,OAAO,IAAA,8BAAe,EAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AACjC,CAAC","sourcesContent":["import { addValue, Arch, archFromString, AsyncTaskManager, DebugLogger, deepAssign, InvalidConfigurationError, log, safeStringifyJson, serializeToYaml, TmpDir } from \"builder-util\"\nimport { CancellationToken } from \"builder-util-runtime\"\nimport { executeFinally, orNullIfFileNotExist } from \"builder-util/out/promise\"\nimport { EventEmitter } from \"events\"\nimport { mkdirs, chmod, outputFile } from \"fs-extra\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { getArtifactArchName } from \"builder-util/out/arch\"\nimport { AppInfo } from \"./appInfo\"\nimport { readAsarJson } from \"./asar/asar\"\nimport { AfterPackContext, Configuration } from \"./configuration\"\nimport { Platform, SourceRepositoryInfo, Target } from \"./core\"\nimport { createElectronFrameworkSupport } from \"./electron/ElectronFramework\"\nimport { Framework } from \"./Framework\"\nimport { LibUiFramework } from \"./frameworks/LibUiFramework\"\nimport { Metadata } from \"./options/metadata\"\nimport { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from \"./packagerApi\"\nimport { PlatformPackager, resolveFunction } from \"./platformPackager\"\nimport { ProtonFramework } from \"./ProtonFramework\"\nimport { computeArchToTargetNamesMap, createTargets, NoOpTarget } from \"./targets/targetFactory\"\nimport { computeDefaultAppDirectory, getConfig, validateConfig } from \"./util/config\"\nimport { expandMacro } from \"./util/macroExpander\"\nimport { createLazyProductionDeps, NodeModuleDirInfo } from \"./util/packageDependencies\"\nimport { checkMetadata, readPackageJson } from \"./util/packageMetadata\"\nimport { getRepositoryInfo } from \"./util/repositoryInfo\"\nimport { installOrRebuild, nodeGypRebuild } from \"./util/yarn\"\nimport { PACKAGE_VERSION } from \"./version\"\nimport { release as getOsRelease } from \"os\"\n\nfunction addHandler(emitter: EventEmitter, event: string, handler: (...args: Array<any>) => void) {\n emitter.on(event, handler)\n}\n\nasync function createFrameworkInfo(configuration: Configuration, packager: Packager): Promise<Framework> {\n let framework = configuration.framework\n if (framework != null) {\n framework = framework.toLowerCase()\n }\n\n let nodeVersion = configuration.nodeVersion\n if (framework === \"electron\" || framework == null) {\n return await createElectronFrameworkSupport(configuration, packager)\n }\n\n if (nodeVersion == null || nodeVersion === \"current\") {\n nodeVersion = process.versions.node\n }\n\n const distMacOsName = `${packager.appInfo.productFilename}.app`\n const isUseLaunchUi = configuration.launchUiVersion !== false\n if (framework === \"proton\" || framework === \"proton-native\") {\n return new ProtonFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n } else if (framework === \"libui\") {\n return new LibUiFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n } else {\n throw new InvalidConfigurationError(`Unknown framework: ${framework}`)\n }\n}\n\nexport class Packager {\n readonly projectDir: string\n\n private _appDir: string\n get appDir(): string {\n return this._appDir\n }\n\n private _metadata: Metadata | null = null\n get metadata(): Metadata {\n return this._metadata!\n }\n\n private _nodeModulesHandledExternally = false\n\n get areNodeModulesHandledExternally(): boolean {\n return this._nodeModulesHandledExternally\n }\n\n private _isPrepackedAppAsar = false\n\n get isPrepackedAppAsar(): boolean {\n return this._isPrepackedAppAsar\n }\n\n private _devMetadata: Metadata | null = null\n get devMetadata(): Metadata | null {\n return this._devMetadata\n }\n\n private _configuration: Configuration | null = null\n\n get config(): Configuration {\n return this._configuration!\n }\n\n isTwoPackageJsonProjectLayoutUsed = false\n\n readonly eventEmitter = new EventEmitter()\n\n _appInfo: AppInfo | null = null\n get appInfo(): AppInfo {\n return this._appInfo!\n }\n\n readonly tempDirManager = new TmpDir(\"packager\")\n\n private _repositoryInfo = new Lazy<SourceRepositoryInfo | null>(() => getRepositoryInfo(this.projectDir, this.metadata, this.devMetadata))\n\n private readonly afterPackHandlers: Array<(context: AfterPackContext) => Promise<any> | null> = []\n\n readonly options: PackagerOptions\n\n readonly debugLogger = new DebugLogger(log.isDebugEnabled)\n\n get repositoryInfo(): Promise<SourceRepositoryInfo | null> {\n return this._repositoryInfo.value\n }\n\n private nodeDependencyInfo = new Map<string, Lazy<Array<any>>>()\n\n getNodeDependencyInfo(platform: Platform | null): Lazy<Array<NodeModuleDirInfo>> {\n let key = \"\"\n let excludedDependencies: Array<string> | null = null\n if (platform != null && this.framework.getExcludedDependencies != null) {\n excludedDependencies = this.framework.getExcludedDependencies(platform)\n if (excludedDependencies != null) {\n key += `-${platform.name}`\n }\n }\n\n let result = this.nodeDependencyInfo.get(key)\n if (result == null) {\n result = createLazyProductionDeps(this.appDir, excludedDependencies)\n this.nodeDependencyInfo.set(key, result)\n }\n return result\n }\n\n stageDirPathCustomizer: (target: Target, packager: PlatformPackager<any>, arch: Arch) => string = (target, packager, arch) => {\n return path.join(target.outDir, `__${target.name}-${getArtifactArchName(arch, target.name)}`)\n }\n\n private _buildResourcesDir: string | null = null\n\n get buildResourcesDir(): string {\n let result = this._buildResourcesDir\n if (result == null) {\n result = path.resolve(this.projectDir, this.relativeBuildResourcesDirname)\n this._buildResourcesDir = result\n }\n return result\n }\n\n get relativeBuildResourcesDirname(): string {\n return this.config.directories!.buildResources!\n }\n\n private _framework: Framework | null = null\n get framework(): Framework {\n return this._framework!\n }\n\n private readonly toDispose: Array<() => Promise<void>> = []\n\n disposeOnBuildFinish(disposer: () => Promise<void>) {\n this.toDispose.push(disposer)\n }\n\n //noinspection JSUnusedGlobalSymbols\n constructor(\n options: PackagerOptions,\n readonly cancellationToken = new CancellationToken()\n ) {\n if (\"devMetadata\" in options) {\n throw new InvalidConfigurationError(\"devMetadata in the options is deprecated, please use config instead\")\n }\n if (\"extraMetadata\" in options) {\n throw new InvalidConfigurationError(\"extraMetadata in the options is deprecated, please use config.extraMetadata instead\")\n }\n\n const targets = options.targets || new Map<Platform, Map<Arch, Array<string>>>()\n if (options.targets == null) {\n options.targets = targets\n }\n\n function processTargets(platform: Platform, types: Array<string>) {\n function commonArch(currentIfNotSpecified: boolean): Array<Arch> {\n const result = Array<Arch>()\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n let archToType = targets.get(platform)\n if (archToType == null) {\n archToType = new Map<Arch, Array<string>>()\n targets.set(platform, archToType)\n }\n\n if (types.length === 0) {\n for (const arch of commonArch(false)) {\n archToType.set(arch, [])\n }\n return\n }\n\n for (const type of types) {\n const suffixPos = type.lastIndexOf(\":\")\n if (suffixPos > 0) {\n addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))\n } else {\n for (const arch of commonArch(true)) {\n addValue(archToType, arch, type)\n }\n }\n }\n }\n\n if (options.mac != null) {\n processTargets(Platform.MAC, options.mac)\n }\n if (options.linux != null) {\n processTargets(Platform.LINUX, options.linux)\n }\n if (options.win != null) {\n processTargets(Platform.WINDOWS, options.win)\n }\n\n this.projectDir = options.projectDir == null ? process.cwd() : path.resolve(options.projectDir)\n this._appDir = this.projectDir\n this.options = {\n ...options,\n prepackaged: options.prepackaged == null ? null : path.resolve(this.projectDir, options.prepackaged),\n }\n\n try {\n log.info({ version: PACKAGE_VERSION, os: getOsRelease() }, \"electron-builder\")\n } catch (e: any) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n }\n\n addAfterPackHandler(handler: (context: AfterPackContext) => Promise<any> | null) {\n this.afterPackHandlers.push(handler)\n }\n\n artifactCreated(handler: (event: ArtifactCreated) => void): Packager {\n addHandler(this.eventEmitter, \"artifactCreated\", handler)\n return this\n }\n\n async callArtifactBuildStarted(event: ArtifactBuildStarted, logFields?: any): Promise<void> {\n log.info(\n logFields || {\n target: event.targetPresentableName,\n arch: event.arch == null ? null : Arch[event.arch],\n file: log.filePath(event.file),\n },\n \"building\"\n )\n const handler = await resolveFunction(this.appInfo.type, this.config.artifactBuildStarted, \"artifactBuildStarted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n }\n\n /**\n * Only for sub artifacts (update info), for main artifacts use `callArtifactBuildCompleted`.\n */\n dispatchArtifactCreated(event: ArtifactCreated): void {\n this.eventEmitter.emit(\"artifactCreated\", event)\n }\n\n async callArtifactBuildCompleted(event: ArtifactCreated): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.artifactBuildCompleted, \"artifactBuildCompleted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n\n this.dispatchArtifactCreated(event)\n }\n\n async callAppxManifestCreated(path: string): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.appxManifestCreated, \"appxManifestCreated\")\n if (handler != null) {\n await Promise.resolve(handler(path))\n }\n }\n\n async callMsiProjectCreated(path: string): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.msiProjectCreated, \"msiProjectCreated\")\n if (handler != null) {\n await Promise.resolve(handler(path))\n }\n }\n\n async build(): Promise<BuildResult> {\n let configPath: string | null = null\n let configFromOptions = this.options.config\n if (typeof configFromOptions === \"string\") {\n // it is a path to config file\n configPath = configFromOptions\n configFromOptions = null\n } else if (configFromOptions != null && typeof configFromOptions.extends === \"string\" && configFromOptions.extends.includes(\".\")) {\n configPath = configFromOptions.extends\n delete configFromOptions.extends\n }\n\n const projectDir = this.projectDir\n\n const devPackageFile = path.join(projectDir, \"package.json\")\n this._devMetadata = await orNullIfFileNotExist(readPackageJson(devPackageFile))\n\n const devMetadata = this.devMetadata\n const configuration = await getConfig(projectDir, configPath, configFromOptions, new Lazy(() => Promise.resolve(devMetadata)))\n if (log.isDebugEnabled) {\n log.debug({ config: getSafeEffectiveConfig(configuration) }, \"effective config\")\n }\n\n this._appDir = await computeDefaultAppDirectory(projectDir, configuration.directories!.app)\n this.isTwoPackageJsonProjectLayoutUsed = this._appDir !== projectDir\n\n const appPackageFile = this.isTwoPackageJsonProjectLayoutUsed ? path.join(this.appDir, \"package.json\") : devPackageFile\n\n // tslint:disable:prefer-conditional-expression\n if (this.devMetadata != null && !this.isTwoPackageJsonProjectLayoutUsed) {\n this._metadata = this.devMetadata\n } else {\n this._metadata = await this.readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile)\n }\n deepAssign(this.metadata, configuration.extraMetadata)\n\n if (this.isTwoPackageJsonProjectLayoutUsed) {\n log.debug({ devPackageFile, appPackageFile }, \"two package.json structure is used\")\n }\n checkMetadata(this.metadata, this.devMetadata, appPackageFile, devPackageFile)\n\n return await this._build(configuration, this._metadata, this._devMetadata)\n }\n\n // external caller of this method always uses isTwoPackageJsonProjectLayoutUsed=false and appDir=projectDir, no way (and need) to use another values\n async _build(configuration: Configuration, metadata: Metadata, devMetadata: Metadata | null, repositoryInfo?: SourceRepositoryInfo): Promise<BuildResult> {\n await validateConfig(configuration, this.debugLogger)\n this._configuration = configuration\n this._metadata = metadata\n this._devMetadata = devMetadata\n\n if (repositoryInfo != null) {\n this._repositoryInfo.value = Promise.resolve(repositoryInfo)\n }\n\n this._appInfo = new AppInfo(this, null)\n this._framework = await createFrameworkInfo(this.config, this)\n\n const commonOutDirWithoutPossibleOsMacro = path.resolve(\n this.projectDir,\n expandMacro(configuration.directories!.output!, null, this._appInfo, {\n os: \"\",\n })\n )\n\n if (!isCI && (process.stdout as any).isTTY) {\n const effectiveConfigFile = path.join(commonOutDirWithoutPossibleOsMacro, \"builder-effective-config.yaml\")\n log.info({ file: log.filePath(effectiveConfigFile) }, \"writing effective config\")\n await outputFile(effectiveConfigFile, getSafeEffectiveConfig(configuration))\n }\n\n // because artifact event maybe dispatched several times for different publish providers\n const artifactPaths = new Set<string>()\n this.artifactCreated(event => {\n if (event.file != null) {\n artifactPaths.add(event.file)\n }\n })\n\n this.disposeOnBuildFinish(() => this.tempDirManager.cleanup())\n const platformToTargets = await executeFinally(this.doBuild(), async () => {\n if (this.debugLogger.isEnabled) {\n await this.debugLogger.save(path.join(commonOutDirWithoutPossibleOsMacro, \"builder-debug.yml\"))\n }\n\n const toDispose = this.toDispose.slice()\n this.toDispose.length = 0\n for (const disposer of toDispose) {\n await disposer().catch((e: any) => {\n log.warn({ error: e }, \"cannot dispose\")\n })\n }\n })\n\n return {\n outDir: commonOutDirWithoutPossibleOsMacro,\n artifactPaths: Array.from(artifactPaths),\n platformToTargets,\n configuration,\n }\n }\n\n private async readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile: string): Promise<Metadata> {\n let data = await orNullIfFileNotExist(readPackageJson(appPackageFile))\n if (data != null) {\n return data\n }\n\n data = await orNullIfFileNotExist(readAsarJson(path.join(this.projectDir, \"app.asar\"), \"package.json\"))\n if (data != null) {\n this._isPrepackedAppAsar = true\n return data\n }\n\n throw new Error(`Cannot find package.json in the ${path.dirname(appPackageFile)}`)\n }\n\n private async doBuild(): Promise<Map<Platform, Map<string, Target>>> {\n const taskManager = new AsyncTaskManager(this.cancellationToken)\n const syncTargetsIfAny = [] as Target[]\n\n const platformToTarget = new Map<Platform, Map<string, Target>>()\n const createdOutDirs = new Set<string>()\n\n for (const [platform, archToType] of this.options.targets!) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n if (platform === Platform.MAC && process.platform === Platform.WINDOWS.nodeName) {\n throw new InvalidConfigurationError(\"Build for macOS is supported only on macOS, please see https://electron.build/multi-platform-build\")\n }\n\n const packager = await this.createHelper(platform)\n const nameToTarget: Map<string, Target> = new Map()\n platformToTarget.set(platform, nameToTarget)\n\n for (const [arch, targetNames] of computeArchToTargetNamesMap(archToType, packager, platform)) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n // support os and arch macro in output value\n const outDir = path.resolve(this.projectDir, packager.expandMacro(this._configuration!.directories!.output!, Arch[arch]))\n const targetList = createTargets(nameToTarget, targetNames.length === 0 ? packager.defaultTarget : targetNames, outDir, packager)\n await createOutDirIfNeed(targetList, createdOutDirs)\n await packager.pack(outDir, arch, targetList, taskManager)\n }\n\n if (this.cancellationToken.cancelled) {\n break\n }\n\n for (const target of nameToTarget.values()) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.finishBuild())\n } else {\n syncTargetsIfAny.push(target)\n }\n }\n }\n\n await taskManager.awaitTasks()\n\n for (const target of syncTargetsIfAny) {\n await target.finishBuild()\n }\n return platformToTarget\n }\n\n private async createHelper(platform: Platform): Promise<PlatformPackager<any>> {\n if (this.options.platformPackagerFactory != null) {\n return this.options.platformPackagerFactory(this, platform)\n }\n\n switch (platform) {\n case Platform.MAC: {\n const helperClass = (await import(\"./macPackager\")).default\n return new helperClass(this)\n }\n\n case Platform.WINDOWS: {\n const helperClass = (await import(\"./winPackager\")).WinPackager\n return new helperClass(this)\n }\n\n case Platform.LINUX:\n return new (await import(\"./linuxPackager\")).LinuxPackager(this)\n\n default:\n throw new Error(`Unknown platform: ${platform}`)\n }\n }\n\n public async installAppDependencies(platform: Platform, arch: Arch): Promise<any> {\n if (this.options.prepackaged != null || !this.framework.isNpmRebuildRequired) {\n return\n }\n\n const frameworkInfo = { version: this.framework.version, useCustomDist: true }\n const config = this.config\n if (config.nodeGypRebuild === true) {\n await nodeGypRebuild(platform.nodeName, Arch[arch], frameworkInfo)\n }\n\n if (config.npmRebuild === false) {\n log.info({ reason: \"npmRebuild is set to false\" }, \"skipped dependencies rebuild\")\n return\n }\n\n const beforeBuild = await resolveFunction(this.appInfo.type, config.beforeBuild, \"beforeBuild\")\n if (beforeBuild != null) {\n const performDependenciesInstallOrRebuild = await beforeBuild({\n appDir: this.appDir,\n electronVersion: this.config.electronVersion!,\n platform,\n arch: Arch[arch],\n })\n\n // If beforeBuild resolves to false, it means that handling node_modules is done outside of electron-builder.\n this._nodeModulesHandledExternally = !performDependenciesInstallOrRebuild\n if (!performDependenciesInstallOrRebuild) {\n return\n }\n }\n\n if (config.buildDependenciesFromSource === true && platform.nodeName !== process.platform) {\n log.info({ reason: \"platform is different and buildDependenciesFromSource is set to true\" }, \"skipped dependencies rebuild\")\n } else {\n await installOrRebuild(config, this.appDir, {\n frameworkInfo,\n platform: platform.nodeName,\n arch: Arch[arch],\n productionDeps: this.getNodeDependencyInfo(null),\n })\n }\n }\n\n async afterPack(context: AfterPackContext): Promise<any> {\n const afterPack = await resolveFunction(this.appInfo.type, this.config.afterPack, \"afterPack\")\n const handlers = this.afterPackHandlers.slice()\n if (afterPack != null) {\n // user handler should be last\n handlers.push(afterPack)\n }\n\n for (const handler of handlers) {\n await Promise.resolve(handler(context))\n }\n }\n}\n\nfunction createOutDirIfNeed(targetList: Array<Target>, createdOutDirs: Set<string>): Promise<any> {\n const ourDirs = new Set<string>()\n for (const target of targetList) {\n // noinspection SuspiciousInstanceOfGuard\n if (target instanceof NoOpTarget) {\n continue\n }\n\n const outDir = target.outDir\n if (!createdOutDirs.has(outDir)) {\n ourDirs.add(outDir)\n }\n }\n\n if (ourDirs.size === 0) {\n return Promise.resolve()\n }\n\n return Promise.all(\n Array.from(ourDirs)\n .sort()\n .map(dir => {\n return mkdirs(dir)\n .then(() => chmod(dir, 0o755) /* set explicitly */)\n .then(() => createdOutDirs.add(dir))\n })\n )\n}\n\nexport interface BuildResult {\n readonly outDir: string\n readonly artifactPaths: Array<string>\n readonly platformToTargets: Map<Platform, Map<string, Target>>\n readonly configuration: Configuration\n}\n\nfunction getSafeEffectiveConfig(configuration: Configuration): string {\n const o = JSON.parse(safeStringifyJson(configuration))\n if (o.cscLink != null) {\n o.cscLink = \"<hidden by builder>\"\n }\n return serializeToYaml(o, true)\n}\n"]}