app-builder-lib 24.9.2 → 24.9.3
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.
- package/out/index.d.ts +2 -2
- package/out/index.js.map +1 -1
- package/out/options/macOptions.d.ts +6 -1
- package/out/options/macOptions.js.map +1 -1
- package/out/targets/snap.js +41 -1
- package/out/targets/snap.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/package.json +5 -5
- package/scheme.json +2 -2
package/out/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { Configuration, AfterPackContext, MetadataDirectories } from "./configur
|
|
|
9
9
|
export { ElectronBrandingOptions, ElectronDownloadOptions, ElectronPlatformName } from "./electron/ElectronFramework";
|
|
10
10
|
export { PlatformSpecificBuildOptions, AsarOptions, FileSet, Protocol, ReleaseInfo } from "./options/PlatformSpecificBuildOptions";
|
|
11
11
|
export { FileAssociation } from "./options/FileAssociation";
|
|
12
|
-
export { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow } from "./options/macOptions";
|
|
12
|
+
export { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow, NotarizeLegacyOptions, NotarizeNotaryOptions } from "./options/macOptions";
|
|
13
13
|
export { PkgOptions, PkgBackgroundOptions, BackgroundAlignment, BackgroundScaling } from "./options/pkgOptions";
|
|
14
14
|
export { WindowsConfiguration } from "./options/winOptions";
|
|
15
15
|
export { AppXOptions } from "./options/AppXOptions";
|
|
@@ -18,7 +18,7 @@ export { MsiWrappedOptions } from "./options/MsiWrappedOptions";
|
|
|
18
18
|
export { CommonWindowsInstallerConfiguration } from "./options/CommonWindowsInstallerConfiguration";
|
|
19
19
|
export { NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions } from "./targets/nsis/nsisOptions";
|
|
20
20
|
export { LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, FlatpakOptions } from "./options/linuxOptions";
|
|
21
|
-
export { SnapOptions } from "./options/SnapOptions";
|
|
21
|
+
export { SnapOptions, PlugDescriptor, SlotDescriptor } from "./options/SnapOptions";
|
|
22
22
|
export { Metadata, AuthorMetadata, RepositoryInfo } from "./options/metadata";
|
|
23
23
|
export { AppInfo } from "./appInfo";
|
|
24
24
|
export { SquirrelWindowsOptions } from "./options/SquirrelWindowsOptions";
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAAyD;AAEzD,+CAA6D;AAC7D,+DAA8C;AAC9C,yCAAqC;AAErC,yDAAoD;AACpD,6DAAyD;AAEzD,uCAAkD;AAAzC,oGAAA,QAAQ,OAAA;AAEjB,+BAWe;AATb,gGAAA,QAAQ,OAAA;AACR,8FAAA,MAAM,OAAA;AACN,kGAAA,UAAU,OAAA;AAKV,sGAAA,cAAc,OAAA;AAGhB,6CAAkE;AAAzD,6GAAA,aAAa,OAAA;AAAE,oGAAA,IAAI,OAAA;AAAE,8GAAA,cAAc,OAAA;AAgB5C,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAUhB,6DAAsE;AAA7D,yHAAA,iBAAiB,OAAA;AAE1B,2DAAyD;AAAhD,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AAEzB,6CAAwD;AAA/C,yGAAA,UAAU,OAAA;AAEnB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,QAAQ,EAAE,yBAAyB,EAAE,aAAa,CAAC,CAAC,CAAA;AAE3K,SAAgB,wBAAwB,CAAC,OAAyC;IAChF,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EA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IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC,EAAE;gBACvE,OAAO,WAAW,CAAC,aAAa,CAAA;aACjC;YAED,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;gBACtC,IAAI,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;oBACnD,kBAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,EAAE,iDAAiD,CAAC,CAAA;oBAC5E,SAAQ;iBACT;gBACD,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBAC3C,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE;oBACxD,cAAc,CAAC,cAAc,CAC3B,oBAAoB,EACpB;wBACE,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,IAAI;qBACX,EACD,QAAQ,CAAC,OAAO,CACjB,CAAA;iBACF;aACF;SACF;QACD,OAAO,WAAW,CAAC,aAAa,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,OAAO,IAAA,wBAAc,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE;QAC/C,IAAI,OAAqB,CAAA;QACzB,IAAI,eAAe,EAAE;YACnB,cAAc,CAAC,WAAW,EAAE,CAAA;YAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;SAChC;aAAM;YACL,OAAO,GAAG,cAAc,CAAC,UAAU,EAAE,CAAA;SACtC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC;AAxDD,sBAwDC","sourcesContent":["import { executeFinally } from \"builder-util/out/promise\"\nimport { PublishOptions } from \"electron-publish/out/publisher\"\nimport { log, InvalidConfigurationError } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { Packager } from \"./packager\"\nimport { PackagerOptions } from \"./packagerApi\"\nimport { resolveFunction } from \"./platformPackager\"\nimport { PublishManager } from \"./publish/PublishManager\"\n\nexport { Packager, BuildResult } from \"./packager\"\nexport { PackagerOptions, ArtifactCreated, ArtifactBuildStarted } from \"./packagerApi\"\nexport {\n TargetConfiguration,\n Platform,\n Target,\n DIR_TARGET,\n BeforeBuildContext,\n SourceRepositoryInfo,\n TargetSpecificOptions,\n TargetConfigType,\n DEFAULT_TARGET,\n CompressionLevel,\n} from \"./core\"\nexport { getArchSuffix, Arch, archFromString } from \"builder-util\"\nexport { Configuration, AfterPackContext, MetadataDirectories } from \"./configuration\"\nexport { ElectronBrandingOptions, ElectronDownloadOptions, ElectronPlatformName } from \"./electron/ElectronFramework\"\nexport { PlatformSpecificBuildOptions, AsarOptions, FileSet, Protocol, ReleaseInfo } from \"./options/PlatformSpecificBuildOptions\"\nexport { FileAssociation } from \"./options/FileAssociation\"\nexport { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow } from \"./options/macOptions\"\nexport { PkgOptions, PkgBackgroundOptions, BackgroundAlignment, BackgroundScaling } from \"./options/pkgOptions\"\nexport { WindowsConfiguration } from \"./options/winOptions\"\nexport { AppXOptions } from \"./options/AppXOptions\"\nexport { MsiOptions } from \"./options/MsiOptions\"\nexport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nexport { CommonWindowsInstallerConfiguration } from \"./options/CommonWindowsInstallerConfiguration\"\nexport { NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions } from \"./targets/nsis/nsisOptions\"\nexport { LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, FlatpakOptions } from \"./options/linuxOptions\"\nexport { SnapOptions } from \"./options/SnapOptions\"\nexport { Metadata, AuthorMetadata, RepositoryInfo } from \"./options/metadata\"\nexport { AppInfo } from \"./appInfo\"\nexport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nexport {\n WindowsSignOptions,\n CustomWindowsSignTaskConfiguration,\n WindowsSignTaskConfiguration,\n CustomWindowsSign,\n FileCodeSigningInfo,\n CertificateFromStoreInfo,\n} from \"./codeSign/windowsCodeSign\"\nexport { CancellationToken, ProgressInfo } from \"builder-util-runtime\"\nexport { PublishOptions, UploadTask } from \"electron-publish\"\nexport { PublishManager } from \"./publish/PublishManager\"\nexport { PlatformPackager } from \"./platformPackager\"\nexport { Framework, PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nexport { buildForge, ForgeOptions } from \"./forge-maker\"\n\nconst expectedOptions = new Set([\"publish\", \"targets\", \"mac\", \"win\", \"linux\", \"projectDir\", \"platformPackagerFactory\", \"config\", \"effectiveOptionComputed\", \"prepackaged\"])\n\nexport function checkBuildRequestOptions(options: PackagerOptions & PublishOptions) {\n for (const optionName of Object.keys(options)) {\n if (!expectedOptions.has(optionName) && (options as any)[optionName] !== undefined) {\n throw new InvalidConfigurationError(`Unknown option \"${optionName}\"`)\n }\n }\n}\n\nexport function build(options: PackagerOptions & PublishOptions, packager: Packager = new Packager(options)): Promise<Array<string>> {\n checkBuildRequestOptions(options)\n\n const publishManager = new PublishManager(packager, options)\n const sigIntHandler = () => {\n log.warn(\"cancelled by SIGINT\")\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n }\n process.once(\"SIGINT\", sigIntHandler)\n\n const promise = packager.build().then(async buildResult => {\n const afterAllArtifactBuild = resolveFunction(buildResult.configuration.afterAllArtifactBuild, \"afterAllArtifactBuild\")\n if (afterAllArtifactBuild != null) {\n const newArtifacts = asArray(await Promise.resolve(afterAllArtifactBuild(buildResult)))\n if (newArtifacts.length === 0 || !publishManager.isPublish) {\n return buildResult.artifactPaths\n }\n\n const publishConfigurations = await publishManager.getGlobalPublishConfigurations()\n if (publishConfigurations == null || publishConfigurations.length === 0) {\n return buildResult.artifactPaths\n }\n\n for (const newArtifact of newArtifacts) {\n if (buildResult.artifactPaths.includes(newArtifact)) {\n log.warn({ newArtifact }, \"skipping publish of artifact, already published\")\n continue\n }\n buildResult.artifactPaths.push(newArtifact)\n for (const publishConfiguration of publishConfigurations) {\n publishManager.scheduleUpload(\n publishConfiguration,\n {\n file: newArtifact,\n arch: null,\n },\n packager.appInfo\n )\n }\n }\n }\n return buildResult.artifactPaths\n })\n\n return executeFinally(promise, isErrorOccurred => {\n let promise: Promise<any>\n if (isErrorOccurred) {\n publishManager.cancelTasks()\n promise = Promise.resolve(null)\n } else {\n promise = publishManager.awaitTasks()\n }\n\n return promise.then(() => process.removeListener(\"SIGINT\", sigIntHandler))\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAAyD;AAEzD,+CAA6D;AAC7D,+DAA8C;AAC9C,yCAAqC;AAErC,yDAAoD;AACpD,6DAAyD;AAEzD,uCAAkD;AAAzC,oGAAA,QAAQ,OAAA;AAEjB,+BAWe;AATb,gGAAA,QAAQ,OAAA;AACR,8FAAA,MAAM,OAAA;AACN,kGAAA,UAAU,OAAA;AAKV,sGAAA,cAAc,OAAA;AAGhB,6CAAkE;AAAzD,6GAAA,aAAa,OAAA;AAAE,oGAAA,IAAI,OAAA;AAAE,8GAAA,cAAc,OAAA;AAgB5C,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAUhB,6DAAsE;AAA7D,yHAAA,iBAAiB,OAAA;AAE1B,2DAAyD;AAAhD,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AAEzB,6CAAwD;AAA/C,yGAAA,UAAU,OAAA;AAEnB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,QAAQ,EAAE,yBAAyB,EAAE,aAAa,CAAC,CAAC,CAAA;AAE3K,SAAgB,wBAAwB,CAAC,OAAyC;IAChF,KAAK,MAAM,UAAU,IAAI,MAAM,CAA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F,IAAI,qBAAqB,IAAI,IAAI,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC,EAAE;gBACvE,OAAO,WAAW,CAAC,aAAa,CAAA;aACjC;YAED,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;gBACtC,IAAI,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;oBACnD,kBAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,EAAE,iDAAiD,CAAC,CAAA;oBAC5E,SAAQ;iBACT;gBACD,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBAC3C,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE;oBACxD,cAAc,CAAC,cAAc,CAC3B,oBAAoB,EACpB;wBACE,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,IAAI;qBACX,EACD,QAAQ,CAAC,OAAO,CACjB,CAAA;iBACF;aACF;SACF;QACD,OAAO,WAAW,CAAC,aAAa,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,OAAO,IAAA,wBAAc,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE;QAC/C,IAAI,OAAqB,CAAA;QACzB,IAAI,eAAe,EAAE;YACnB,cAAc,CAAC,WAAW,EAAE,CAAA;YAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;SAChC;aAAM;YACL,OAAO,GAAG,cAAc,CAAC,UAAU,EAAE,CAAA;SACtC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC;AAxDD,sBAwDC","sourcesContent":["import { executeFinally } from \"builder-util/out/promise\"\nimport { PublishOptions } from \"electron-publish/out/publisher\"\nimport { log, InvalidConfigurationError } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { Packager } from \"./packager\"\nimport { PackagerOptions } from \"./packagerApi\"\nimport { resolveFunction } from \"./platformPackager\"\nimport { PublishManager } from \"./publish/PublishManager\"\n\nexport { Packager, BuildResult } from \"./packager\"\nexport { PackagerOptions, ArtifactCreated, ArtifactBuildStarted } from \"./packagerApi\"\nexport {\n TargetConfiguration,\n Platform,\n Target,\n DIR_TARGET,\n BeforeBuildContext,\n SourceRepositoryInfo,\n TargetSpecificOptions,\n TargetConfigType,\n DEFAULT_TARGET,\n CompressionLevel,\n} from \"./core\"\nexport { getArchSuffix, Arch, archFromString } from \"builder-util\"\nexport { Configuration, AfterPackContext, MetadataDirectories } from \"./configuration\"\nexport { ElectronBrandingOptions, ElectronDownloadOptions, ElectronPlatformName } from \"./electron/ElectronFramework\"\nexport { PlatformSpecificBuildOptions, AsarOptions, FileSet, Protocol, ReleaseInfo } from \"./options/PlatformSpecificBuildOptions\"\nexport { FileAssociation } from \"./options/FileAssociation\"\nexport { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow, NotarizeLegacyOptions, NotarizeNotaryOptions } from \"./options/macOptions\"\nexport { PkgOptions, PkgBackgroundOptions, BackgroundAlignment, BackgroundScaling } from \"./options/pkgOptions\"\nexport { WindowsConfiguration } from \"./options/winOptions\"\nexport { AppXOptions } from \"./options/AppXOptions\"\nexport { MsiOptions } from \"./options/MsiOptions\"\nexport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nexport { CommonWindowsInstallerConfiguration } from \"./options/CommonWindowsInstallerConfiguration\"\nexport { NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions } from \"./targets/nsis/nsisOptions\"\nexport { LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, FlatpakOptions } from \"./options/linuxOptions\"\nexport { SnapOptions, PlugDescriptor, SlotDescriptor } from \"./options/SnapOptions\"\nexport { Metadata, AuthorMetadata, RepositoryInfo } from \"./options/metadata\"\nexport { AppInfo } from \"./appInfo\"\nexport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nexport {\n WindowsSignOptions,\n CustomWindowsSignTaskConfiguration,\n WindowsSignTaskConfiguration,\n CustomWindowsSign,\n FileCodeSigningInfo,\n CertificateFromStoreInfo,\n} from \"./codeSign/windowsCodeSign\"\nexport { CancellationToken, ProgressInfo } from \"builder-util-runtime\"\nexport { PublishOptions, UploadTask } from \"electron-publish\"\nexport { PublishManager } from \"./publish/PublishManager\"\nexport { PlatformPackager } from \"./platformPackager\"\nexport { Framework, PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nexport { buildForge, ForgeOptions } from \"./forge-maker\"\n\nconst expectedOptions = new Set([\"publish\", \"targets\", \"mac\", \"win\", \"linux\", \"projectDir\", \"platformPackagerFactory\", \"config\", \"effectiveOptionComputed\", \"prepackaged\"])\n\nexport function checkBuildRequestOptions(options: PackagerOptions & PublishOptions) {\n for (const optionName of Object.keys(options)) {\n if (!expectedOptions.has(optionName) && (options as any)[optionName] !== undefined) {\n throw new InvalidConfigurationError(`Unknown option \"${optionName}\"`)\n }\n }\n}\n\nexport function build(options: PackagerOptions & PublishOptions, packager: Packager = new Packager(options)): Promise<Array<string>> {\n checkBuildRequestOptions(options)\n\n const publishManager = new PublishManager(packager, options)\n const sigIntHandler = () => {\n log.warn(\"cancelled by SIGINT\")\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n }\n process.once(\"SIGINT\", sigIntHandler)\n\n const promise = packager.build().then(async buildResult => {\n const afterAllArtifactBuild = resolveFunction(buildResult.configuration.afterAllArtifactBuild, \"afterAllArtifactBuild\")\n if (afterAllArtifactBuild != null) {\n const newArtifacts = asArray(await Promise.resolve(afterAllArtifactBuild(buildResult)))\n if (newArtifacts.length === 0 || !publishManager.isPublish) {\n return buildResult.artifactPaths\n }\n\n const publishConfigurations = await publishManager.getGlobalPublishConfigurations()\n if (publishConfigurations == null || publishConfigurations.length === 0) {\n return buildResult.artifactPaths\n }\n\n for (const newArtifact of newArtifacts) {\n if (buildResult.artifactPaths.includes(newArtifact)) {\n log.warn({ newArtifact }, \"skipping publish of artifact, already published\")\n continue\n }\n buildResult.artifactPaths.push(newArtifact)\n for (const publishConfiguration of publishConfigurations) {\n publishManager.scheduleUpload(\n publishConfiguration,\n {\n file: newArtifact,\n arch: null,\n },\n packager.appInfo\n )\n }\n }\n }\n return buildResult.artifactPaths\n })\n\n return executeFinally(promise, isErrorOccurred => {\n let promise: Promise<any>\n if (isErrorOccurred) {\n publishManager.cancelTasks()\n promise = Promise.resolve(null)\n } else {\n promise = publishManager.awaitTasks()\n }\n\n return promise.then(() => process.removeListener(\"SIGINT\", sigIntHandler))\n })\n}\n"]}
|
|
@@ -175,7 +175,12 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
|
|
|
175
175
|
* Options to use for @electron/notarize (ref: https://github.com/electron/notarize).
|
|
176
176
|
* Supports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable
|
|
177
177
|
*
|
|
178
|
-
* Note: In order to activate the notarization step You MUST specify one of the following via environment variables
|
|
178
|
+
* Note: In order to activate the notarization step You MUST specify one of the following via environment variables:
|
|
179
|
+
* 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.
|
|
180
|
+
* 2. `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD`
|
|
181
|
+
* 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`
|
|
182
|
+
*
|
|
183
|
+
* For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)
|
|
179
184
|
*/
|
|
180
185
|
readonly notarize?: NotarizeLegacyOptions | NotarizeNotaryOptions | boolean | null;
|
|
181
186
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](/configuration/mas).\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](/configuration/mas).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let @electron/osx-sign validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let @electron/osx-sign verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from @electron/osx-sign.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\n * Supports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\\n1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`\\n2. `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD`\\n3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\\n\\nFor security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: NotarizeLegacyOptions | NotarizeNotaryOptions | boolean | null\n}\n\nexport interface NotarizeLegacyOptions {\n /**\n * The app bundle identifier your Electron app is using. E.g. com.github.electron. Useful if notarization ID differs from app ID (unlikely).\n * Only used by `legacy` notarization tool\n */\n readonly appBundleId?: string | null\n\n /**\n * Your Team Short Name. Only used by `legacy` notarization tool\n */\n readonly ascProvider?: string | null\n}\n\nexport interface NotarizeNotaryOptions {\n /**\n * The team ID you want to notarize under for when using `notarytool`\n */\n readonly teamId: string\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](/configuration/mas).\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](/configuration/mas).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let @electron/osx-sign validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let @electron/osx-sign verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from @electron/osx-sign.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\n * Supports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: NotarizeLegacyOptions | NotarizeNotaryOptions | boolean | null\n}\n\nexport interface NotarizeLegacyOptions {\n /**\n * The app bundle identifier your Electron app is using. E.g. com.github.electron. Useful if notarization ID differs from app ID (unlikely).\n * Only used by `legacy` notarization tool\n */\n readonly appBundleId?: string | null\n\n /**\n * Your Team Short Name. Only used by `legacy` notarization tool\n */\n readonly ascProvider?: string | null\n}\n\nexport interface NotarizeNotaryOptions {\n /**\n * The team ID you want to notarize under for when using `notarytool`\n */\n readonly teamId: string\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
package/out/targets/snap.js
CHANGED
|
@@ -212,13 +212,14 @@ class SnapTarget extends core_1.Target {
|
|
|
212
212
|
args.push("--template-url", `electron4:${snapArch}`);
|
|
213
213
|
}
|
|
214
214
|
await (0, builder_util_1.executeAppBuilder)(args);
|
|
215
|
+
const publishConfig = findSnapPublishConfig(this.packager.config);
|
|
215
216
|
await packager.info.callArtifactBuildCompleted({
|
|
216
217
|
file: artifactPath,
|
|
217
218
|
safeArtifactName: packager.computeSafeArtifactName(artifactName, "snap", arch, false),
|
|
218
219
|
target: this,
|
|
219
220
|
arch,
|
|
220
221
|
packager,
|
|
221
|
-
publishConfig:
|
|
222
|
+
publishConfig: publishConfig == null ? { provider: "snapStore" } : publishConfig,
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
225
|
isElectronVersionGreaterOrEqualThan(version) {
|
|
@@ -226,6 +227,45 @@ class SnapTarget extends core_1.Target {
|
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
exports.default = SnapTarget;
|
|
230
|
+
function findSnapPublishConfig(config) {
|
|
231
|
+
var _a;
|
|
232
|
+
if (!config) {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
if ((_a = config.linux) === null || _a === void 0 ? void 0 : _a.publish) {
|
|
236
|
+
const configCandidate = findSnapPublishConfigInPublishNode(config.linux.publish);
|
|
237
|
+
if (configCandidate) {
|
|
238
|
+
return configCandidate;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (config.publish) {
|
|
242
|
+
const configCandidate = findSnapPublishConfigInPublishNode(config.publish);
|
|
243
|
+
if (configCandidate) {
|
|
244
|
+
return configCandidate;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
function findSnapPublishConfigInPublishNode(configPublishNode) {
|
|
250
|
+
if (!configPublishNode) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
if (Array.isArray(configPublishNode)) {
|
|
254
|
+
for (const configObj of configPublishNode) {
|
|
255
|
+
if (isSnapStoreOptions(configObj)) {
|
|
256
|
+
return configObj;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (typeof configPublishNode === `object` && isSnapStoreOptions(configPublishNode)) {
|
|
261
|
+
return configPublishNode;
|
|
262
|
+
}
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
function isSnapStoreOptions(configPublishNode) {
|
|
266
|
+
const snapStoreOptionsCandidate = configPublishNode;
|
|
267
|
+
return (snapStoreOptionsCandidate === null || snapStoreOptionsCandidate === void 0 ? void 0 : snapStoreOptionsCandidate.provider) === `snapStore`;
|
|
268
|
+
}
|
|
229
269
|
function archNameToTriplet(arch) {
|
|
230
270
|
switch (arch) {
|
|
231
271
|
case builder_util_1.Arch.x64:
|
package/out/targets/snap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snap.js","sourceRoot":"","sources":["../../src/targets/snap.ts"],"names":[],"mappings":";;AAAA,+CAAyK;AACzK,+DAA8C;AAC9C,uCAA+C;AAC/C,qCAA8B;AAC9B,6BAA4B;AAC5B,iCAAgC;AAChC,kCAAgC;AAGhC,qDAAqD;AAErD,6CAAiD;AAEjD,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;AAE3K,MAAqB,UAAW,SAAQ,aAAM;IAK5C,YAAY,IAAY,EAAmB,QAAuB,EAAmB,MAAyB,EAAW,MAAc;QACrI,KAAK,CAAC,IAAI,CAAC,CAAA;QAD8B,aAAQ,GAAR,QAAQ,CAAe;QAAmB,WAAM,GAAN,MAAM,CAAmB;QAAW,WAAM,GAAN,MAAM,CAAQ;QAJ9H,YAAO,GAAgB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Yaml, toLinuxArchString } from \"builder-util\"\nimport { asArray } from \"builder-util-runtime\"\nimport { outputFile, readFile } from \"fs-extra\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { PlugDescriptor, SnapOptions } from \"../options/SnapOptions\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDirPath } from \"./targetUtil\"\n\nconst defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\nexport default class SnapTarget extends Target {\n readonly options: SnapOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n\n public isUseTemplateApp = false\n\n constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(name)\n }\n\n private replaceDefault(inList: Array<string> | null | undefined, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n private async createDescriptor(arch: Arch): Promise<any> {\n if (!this.isElectronVersionGreaterOrEqualThan(\"4.0.0\")) {\n if (!this.isElectronVersionGreaterOrEqualThan(\"2.0.0-beta.1\")) {\n throw new InvalidConfigurationError(\"Electron 2 and higher is required to build Snap\")\n }\n\n log.warn(\"Electron 4 and higher is highly recommended for Snap\")\n }\n\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = normalizePlugConfiguration(this.options.plugs)\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), defaultPlugs)\n\n const slots = normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const defaultStagePackages = getDefaultStagePackages()\n const stagePackages = this.replaceDefault(options.stagePackages, defaultStagePackages)\n\n this.isUseTemplateApp =\n this.options.useTemplateApp !== false &&\n (arch === Arch.x64 || arch === Arch.armv7l) &&\n buildPackages.length === 0 &&\n isArrayEqualRegardlessOfSort(stagePackages, defaultStagePackages)\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n // from core22 onwards adapter is legacy\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${snap.name}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = archNameToTriplet(arch)\n appDescriptor.environment = {\n DISABLE_WAYLAND: options.allowNativeWayland ? \"\" : \"1\",\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const options = this.options\n // tslint:disable-next-line:no-invalid-template-strings\n const artifactName = packager.expandArtifactNamePattern(this.options, \"snap\", arch, \"${name}_${version}_${arch}.${ext}\", false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"snap\",\n file: artifactPath,\n arch,\n })\n\n const snap = await this.createDescriptor(arch)\n\n const stageDir = await createStageDirPath(this, packager, arch)\n const snapArch = toLinuxArchString(arch, \"snap\")\n const args = [\"snap\", \"--app\", appOutDir, \"--stage\", stageDir, \"--arch\", snapArch, \"--output\", artifactPath, \"--executable\", this.packager.executableName]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n // snapcraft.yaml inside a snap directory\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${snap.name}.desktop`)\n await this.helper.writeDesktopEntry(this.options, packager.executableName + \" %U\", desktopFile, {\n // tslint:disable:no-invalid-template-strings\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = options.executableArgs ?? []\n if (this.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n // remove fields that are valid in snapcraft.yaml, but not snap.yaml\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await packager.getResource(options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n args.push(\"--template-url\", `electron4:${snapArch}`)\n }\n\n await executeAppBuilder(args)\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"snap\", arch, false),\n target: this,\n arch,\n packager,\n publishConfig: options.publish == null ? { provider: \"snapStore\" } : null,\n })\n }\n\n private isElectronVersionGreaterOrEqualThan(version: string) {\n return semver.gte(this.packager.config.electronVersion || \"7.0.0\", version)\n }\n}\n\nfunction archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n // noinspection SpellCheckingInspection\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n\nfunction isArrayEqualRegardlessOfSort(a: Array<string>, b: Array<string>) {\n a = a.slice()\n b = b.slice()\n a.sort()\n b.sort()\n return a.length === b.length && a.every((value, index) => value === b[index])\n}\n\nfunction normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | null | undefined): { [key: string]: { [name: string]: any } | null } | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n result[item] = null\n } else {\n Object.assign(result, item)\n }\n }\n return result\n}\n\nfunction isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n}\n\nfunction getDefaultStagePackages() {\n // libxss1 - was \"error while loading shared libraries: libXss.so.1\" on Xubuntu 16.04\n // noinspection SpellCheckingInspection\n return [\"libnspr4\", \"libnss3\", \"libxss1\", \"libappindicator3-1\", \"libsecret-1-0\"]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"snap.js","sourceRoot":"","sources":["../../src/targets/snap.ts"],"names":[],"mappings":";;AAAA,+CAAyK;AACzK,+DAAgE;AAChE,uCAA+C;AAC/C,qCAA8B;AAC9B,6BAA4B;AAC5B,iCAAgC;AAChC,kCAAyC;AAGzC,qDAAqD;AAErD,6CAAiD;AAGjD,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ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Z;SACF;KACF;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,uBAAuB;IAC9B,qFAAqF;IACrF,uCAAuC;IACvC,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,CAAC,CAAA;AAClF,CAAC","sourcesContent":["import { Arch, deepAssign, executeAppBuilder, InvalidConfigurationError, log, replaceDefault as _replaceDefault, serializeToYaml, toLinuxArchString } from \"builder-util\"\nimport { SnapStoreOptions, asArray } from \"builder-util-runtime\"\nimport { outputFile, readFile } from \"fs-extra\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Publish, Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { PlugDescriptor, SnapOptions } from \"../options/SnapOptions\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDirPath } from \"./targetUtil\"\nimport { Configuration } from \"../configuration\"\n\nconst defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\nexport default class SnapTarget extends Target {\n readonly options: SnapOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n\n public isUseTemplateApp = false\n\n constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(name)\n }\n\n private replaceDefault(inList: Array<string> | null | undefined, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n private async createDescriptor(arch: Arch): Promise<any> {\n if (!this.isElectronVersionGreaterOrEqualThan(\"4.0.0\")) {\n if (!this.isElectronVersionGreaterOrEqualThan(\"2.0.0-beta.1\")) {\n throw new InvalidConfigurationError(\"Electron 2 and higher is required to build Snap\")\n }\n\n log.warn(\"Electron 4 and higher is highly recommended for Snap\")\n }\n\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = normalizePlugConfiguration(this.options.plugs)\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), defaultPlugs)\n\n const slots = normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const defaultStagePackages = getDefaultStagePackages()\n const stagePackages = this.replaceDefault(options.stagePackages, defaultStagePackages)\n\n this.isUseTemplateApp =\n this.options.useTemplateApp !== false &&\n (arch === Arch.x64 || arch === Arch.armv7l) &&\n buildPackages.length === 0 &&\n isArrayEqualRegardlessOfSort(stagePackages, defaultStagePackages)\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n // from core22 onwards adapter is legacy\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${snap.name}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = archNameToTriplet(arch)\n appDescriptor.environment = {\n DISABLE_WAYLAND: options.allowNativeWayland ? \"\" : \"1\",\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const options = this.options\n // tslint:disable-next-line:no-invalid-template-strings\n const artifactName = packager.expandArtifactNamePattern(this.options, \"snap\", arch, \"${name}_${version}_${arch}.${ext}\", false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"snap\",\n file: artifactPath,\n arch,\n })\n\n const snap = await this.createDescriptor(arch)\n\n const stageDir = await createStageDirPath(this, packager, arch)\n const snapArch = toLinuxArchString(arch, \"snap\")\n const args = [\"snap\", \"--app\", appOutDir, \"--stage\", stageDir, \"--arch\", snapArch, \"--output\", artifactPath, \"--executable\", this.packager.executableName]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n // snapcraft.yaml inside a snap directory\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${snap.name}.desktop`)\n await this.helper.writeDesktopEntry(this.options, packager.executableName + \" %U\", desktopFile, {\n // tslint:disable:no-invalid-template-strings\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = options.executableArgs ?? []\n if (this.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n // remove fields that are valid in snapcraft.yaml, but not snap.yaml\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await packager.getResource(options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n args.push(\"--template-url\", `electron4:${snapArch}`)\n }\n\n await executeAppBuilder(args)\n\n const publishConfig = findSnapPublishConfig(this.packager.config)\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"snap\", arch, false),\n target: this,\n arch,\n packager,\n publishConfig: publishConfig == null ? { provider: \"snapStore\" } : publishConfig,\n })\n }\n\n private isElectronVersionGreaterOrEqualThan(version: string) {\n return semver.gte(this.packager.config.electronVersion || \"7.0.0\", version)\n }\n}\n\nfunction findSnapPublishConfig(config?: Configuration): SnapStoreOptions | null {\n if (!config) {\n return null\n }\n\n if (config.linux?.publish) {\n const configCandidate = findSnapPublishConfigInPublishNode(config.linux.publish)\n\n if (configCandidate) {\n return configCandidate\n }\n }\n\n if (config.publish) {\n const configCandidate = findSnapPublishConfigInPublishNode(config.publish)\n\n if (configCandidate) {\n return configCandidate\n }\n }\n\n return null\n}\n\nfunction findSnapPublishConfigInPublishNode(configPublishNode: Publish): SnapStoreOptions | null {\n if (!configPublishNode) {\n return null\n }\n\n if (Array.isArray(configPublishNode)) {\n for (const configObj of configPublishNode) {\n if (isSnapStoreOptions(configObj)) {\n return configObj\n }\n }\n }\n\n if (typeof configPublishNode === `object` && isSnapStoreOptions(configPublishNode)) {\n return configPublishNode\n }\n\n return null\n}\n\nfunction isSnapStoreOptions(configPublishNode: Publish): configPublishNode is SnapStoreOptions {\n const snapStoreOptionsCandidate = configPublishNode as SnapStoreOptions\n return snapStoreOptionsCandidate?.provider === `snapStore`\n}\n\nfunction archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n // noinspection SpellCheckingInspection\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n\nfunction isArrayEqualRegardlessOfSort(a: Array<string>, b: Array<string>) {\n a = a.slice()\n b = b.slice()\n a.sort()\n b.sort()\n return a.length === b.length && a.every((value, index) => value === b[index])\n}\n\nfunction normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | null | undefined): { [key: string]: { [name: string]: any } | null } | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n result[item] = null\n } else {\n Object.assign(result, item)\n }\n }\n return result\n}\n\nfunction isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n}\n\nfunction getDefaultStagePackages() {\n // libxss1 - was \"error while loading shared libraries: libXss.so.1\" on Xubuntu 16.04\n // noinspection SpellCheckingInspection\n return [\"libnspr4\", \"libnss3\", \"libxss1\", \"libappindicator3-1\", \"libsecret-1-0\"]\n}\n"]}
|
package/out/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "24.9.
|
|
1
|
+
export declare const PACKAGE_VERSION = "24.9.3";
|
package/out/version.js
CHANGED
package/out/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"24.9.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"24.9.3\"\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": "24.9.
|
|
4
|
+
"version": "24.9.3",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"tar": "^6.1.12",
|
|
73
73
|
"temp-file": "^3.4.0",
|
|
74
74
|
"builder-util": "24.8.1",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
75
|
+
"builder-util-runtime": "9.2.3",
|
|
76
|
+
"electron-publish": "24.8.1"
|
|
77
77
|
},
|
|
78
78
|
"///": "babel in devDependencies for proton tests",
|
|
79
79
|
"devDependencies": {
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"@types/js-yaml": "4.0.3",
|
|
104
104
|
"@types/semver": "7.3.8",
|
|
105
105
|
"@types/tar": "^6.1.3",
|
|
106
|
-
"dmg-builder": "24.9.
|
|
107
|
-
"electron-builder-squirrel-windows": "24.9.
|
|
106
|
+
"dmg-builder": "24.9.3",
|
|
107
|
+
"electron-builder-squirrel-windows": "24.9.3"
|
|
108
108
|
},
|
|
109
109
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
110
110
|
"typings": "./out/index.d.ts"
|
package/scheme.json
CHANGED
|
@@ -2680,7 +2680,7 @@
|
|
|
2680
2680
|
]
|
|
2681
2681
|
}
|
|
2682
2682
|
],
|
|
2683
|
-
"description": "Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\nSupports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable\n\nNote: In order to activate the notarization step You MUST specify one of the following via environment variables
|
|
2683
|
+
"description": "Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\nSupports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable\n\nNote: In order to activate the notarization step You MUST specify one of the following via environment variables:\n1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n2. `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD`\n3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n\nFor security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)"
|
|
2684
2684
|
},
|
|
2685
2685
|
"preAutoEntitlements": {
|
|
2686
2686
|
"default": true,
|
|
@@ -3313,7 +3313,7 @@
|
|
|
3313
3313
|
]
|
|
3314
3314
|
}
|
|
3315
3315
|
],
|
|
3316
|
-
"description": "Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\nSupports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable\n\nNote: In order to activate the notarization step You MUST specify one of the following via environment variables
|
|
3316
|
+
"description": "Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\nSupports both `legacy` and `notarytool` notarization tools. Use `false` to explicitly disable\n\nNote: In order to activate the notarization step You MUST specify one of the following via environment variables:\n1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n2. `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD`\n3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n\nFor security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)"
|
|
3317
3317
|
},
|
|
3318
3318
|
"preAutoEntitlements": {
|
|
3319
3319
|
"default": true,
|