1 | import { CompressionLevel, Publish, TargetConfiguration, TargetSpecificOptions } from "../core";
|
2 | import { FileAssociation } from "./FileAssociation";
|
3 | export interface FileSet {
|
4 | /**
|
5 | * The source path relative to the project directory.
|
6 | */
|
7 | from?: string;
|
8 | /**
|
9 | * The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`.
|
10 | */
|
11 | to?: string;
|
12 | /**
|
13 | * The [glob patterns](/file-patterns).
|
14 | */
|
15 | filter?: Array<string> | string;
|
16 | }
|
17 | export interface AsarOptions {
|
18 | /**
|
19 | * Whether to automatically unpack executables files.
|
20 | * @default true
|
21 | */
|
22 | smartUnpack?: boolean;
|
23 | ordering?: string | null;
|
24 | }
|
25 | export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {
|
26 | /**
|
27 | * 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
|
28 | * [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.
|
29 | * @default com.electron.${name}
|
30 | */
|
31 | readonly appId?: string | null;
|
32 | /**
|
33 | * 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).
|
34 | */
|
35 | readonly artifactName?: string | null;
|
36 | /**
|
37 | * The executable name. Defaults to `productName`.
|
38 | */
|
39 | readonly executableName?: string | null;
|
40 | /**
|
41 | * 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.
|
42 | * @default normal
|
43 | */
|
44 | readonly compression?: CompressionLevel | null;
|
45 | files?: Array<FileSet | string> | FileSet | string | null;
|
46 | extraResources?: Array<FileSet | string> | FileSet | string | null;
|
47 | extraFiles?: Array<FileSet | string> | FileSet | string | null;
|
48 | /**
|
49 | * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).
|
50 | *
|
51 | * 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.
|
52 | * @default true
|
53 | */
|
54 | readonly asar?: AsarOptions | boolean | null;
|
55 | /**
|
56 | * 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.
|
57 | */
|
58 | readonly asarUnpack?: Array<string> | string | null;
|
59 | /** @private */
|
60 | readonly icon?: string | null;
|
61 | /**
|
62 | * The file associations.
|
63 | */
|
64 | readonly fileAssociations?: Array<FileAssociation> | FileAssociation;
|
65 | /**
|
66 | * The URL protocol schemes.
|
67 | */
|
68 | readonly protocols?: Array<Protocol> | Protocol;
|
69 | /**
|
70 | * The electron locales to keep. By default, all Electron locales used as-is.
|
71 | */
|
72 | readonly electronLanguages?: Array<string> | string;
|
73 | /**
|
74 | * Whether to fail if app will be not code signed.
|
75 | */
|
76 | readonly forceCodeSigning?: boolean;
|
77 | /**
|
78 | * The [electron-updater compatibility](/auto-update#compatibility) semver range.
|
79 | */
|
80 | readonly electronUpdaterCompatibility?: string | null;
|
81 | publish?: Publish;
|
82 | /**
|
83 | * 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`.
|
84 | * @default true
|
85 | */
|
86 | readonly detectUpdateChannel?: boolean;
|
87 | /**
|
88 | * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).
|
89 | * @default false
|
90 | */
|
91 | readonly generateUpdatesFilesForAllChannels?: boolean;
|
92 | /**
|
93 | * The release info. Intended for command line usage:
|
94 | *
|
95 | * ```
|
96 | * -c.releaseInfo.releaseNotes="new features"
|
97 | * ```
|
98 | */
|
99 | readonly releaseInfo?: ReleaseInfo;
|
100 | readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null;
|
101 | /** @private */
|
102 | cscLink?: string | null;
|
103 | /** @private */
|
104 | cscKeyPassword?: string | null;
|
105 | readonly defaultArch?: string;
|
106 | }
|
107 | export interface ReleaseInfo {
|
108 | /**
|
109 | * The release name.
|
110 | */
|
111 | releaseName?: string | null;
|
112 | /**
|
113 | * The release notes.
|
114 | */
|
115 | releaseNotes?: string | null;
|
116 | /**
|
117 | * 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).
|
118 | */
|
119 | releaseNotesFile?: string | null;
|
120 | /**
|
121 | * The release date.
|
122 | */
|
123 | releaseDate?: string;
|
124 | /**
|
125 | * Vendor specific information.
|
126 | */
|
127 | vendor?: {
|
128 | [key: string]: any;
|
129 | } | null;
|
130 | }
|
131 | /**
|
132 | * URL Protocol Schemes. Protocols to associate the app with. macOS only.
|
133 | *
|
134 | * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).
|
135 | */
|
136 | export interface Protocol {
|
137 | /**
|
138 | * The name. e.g. `IRC server URL`.
|
139 | */
|
140 | readonly name: string;
|
141 | /**
|
142 | * The schemes. e.g. `["irc", "ircs"]`.
|
143 | */
|
144 | readonly schemes: Array<string>;
|
145 | /**
|
146 | * *macOS-only* The app’s role with respect to the type.
|
147 | * @default Editor
|
148 | */
|
149 | readonly role?: "Editor" | "Viewer" | "Shell" | "None";
|
150 | }
|