1 | import { AsarIntegrityOptions } from "../asar/integrity";
|
2 | import { CompressionLevel, Publish, TargetConfiguration, TargetSpecificOptions } from "../core";
|
3 | import { FileAssociation } from "./FileAssociation";
|
4 | export interface FileSet {
|
5 | /**
|
6 | * The source path relative to the project directory.
|
7 | */
|
8 | from?: string;
|
9 | /**
|
10 | * The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`.
|
11 | */
|
12 | to?: string;
|
13 | /**
|
14 | * The [glob patterns](/file-patterns).
|
15 | */
|
16 | filter?: Array<string> | string;
|
17 | }
|
18 | export interface AsarOptions extends AsarIntegrityOptions {
|
19 | /**
|
20 | * Whether to automatically unpack executables files.
|
21 | * @default true
|
22 | */
|
23 | smartUnpack?: boolean;
|
24 | ordering?: string | null;
|
25 | }
|
26 | export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {
|
27 | /**
|
28 | * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as
|
29 | * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
|
30 | * @default com.electron.${name}
|
31 | */
|
32 | readonly appId?: string | null;
|
33 | /**
|
34 | * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).
|
35 | */
|
36 | readonly artifactName?: string | null;
|
37 | /**
|
38 | * The executable name. Defaults to `productName`.
|
39 | */
|
40 | readonly executableName?: string | null;
|
41 | /**
|
42 | * The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time.
|
43 | * @default normal
|
44 | */
|
45 | readonly compression?: CompressionLevel | null;
|
46 | files?: Array<FileSet | string> | FileSet | string | null;
|
47 | extraResources?: Array<FileSet | string> | FileSet | string | null;
|
48 | extraFiles?: Array<FileSet | string> | FileSet | string | null;
|
49 | /**
|
50 | * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).
|
51 | *
|
52 | * Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work.
|
53 | * @default true
|
54 | */
|
55 | readonly asar?: AsarOptions | boolean | null;
|
56 | /**
|
57 | * A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive.
|
58 | */
|
59 | readonly asarUnpack?: Array<string> | string | null;
|
60 | /** @private */
|
61 | readonly icon?: string | null;
|
62 | /**
|
63 | * The file associations.
|
64 | */
|
65 | readonly fileAssociations?: Array<FileAssociation> | FileAssociation;
|
66 | /**
|
67 | * The URL protocol schemes.
|
68 | */
|
69 | readonly protocols?: Array<Protocol> | Protocol;
|
70 | /**
|
71 | * Whether to fail if app will be not code signed.
|
72 | */
|
73 | readonly forceCodeSigning?: boolean;
|
74 | /**
|
75 | * The [electron-updater compatibility](/auto-update#compatibility) semver range.
|
76 | */
|
77 | readonly electronUpdaterCompatibility?: string | null;
|
78 | publish?: Publish;
|
79 | /**
|
80 | * Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.
|
81 | * @default true
|
82 | */
|
83 | readonly detectUpdateChannel?: boolean;
|
84 | /**
|
85 | * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).
|
86 | * @default false
|
87 | */
|
88 | readonly generateUpdatesFilesForAllChannels?: boolean;
|
89 | /**
|
90 | * The release info. Intended for command line usage:
|
91 | *
|
92 | * ```
|
93 | * -c.releaseInfo.releaseNotes="new features"
|
94 | * ```
|
95 | */
|
96 | readonly releaseInfo?: ReleaseInfo;
|
97 | readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null;
|
98 | /** @private */
|
99 | cscLink?: string | null;
|
100 | /** @private */
|
101 | cscKeyPassword?: string | null;
|
102 | readonly defaultArch?: string;
|
103 | }
|
104 | export interface ReleaseInfo {
|
105 | /**
|
106 | * The release name.
|
107 | */
|
108 | releaseName?: string | null;
|
109 | /**
|
110 | * The release notes.
|
111 | */
|
112 | releaseNotes?: string | null;
|
113 | /**
|
114 | * The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](#MetadataDirectories-buildResources).
|
115 | */
|
116 | releaseNotesFile?: string | null;
|
117 | /**
|
118 | * The release date.
|
119 | */
|
120 | releaseDate?: string;
|
121 | }
|
122 | /**
|
123 | * URL Protocol Schemes. Protocols to associate the app with. macOS only.
|
124 | *
|
125 | * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).
|
126 | */
|
127 | export interface Protocol {
|
128 | /**
|
129 | * The name. e.g. `IRC server URL`.
|
130 | */
|
131 | readonly name: string;
|
132 | /**
|
133 | * The schemes. e.g. `["irc", "ircs"]`.
|
134 | */
|
135 | readonly schemes: Array<string>;
|
136 | /**
|
137 | * *macOS-only* The app’s role with respect to the type.
|
138 | * @default Editor
|
139 | */
|
140 | readonly role?: "Editor" | "Viewer" | "Shell" | "None";
|
141 | }
|