Skip to content

Commit e85ef88

Browse files
committed
feat(mac): Support macOS Mojave Dark Mode
Close #3496
1 parent 68e5573 commit e85ef88

File tree

27 files changed

+79
-99
lines changed

27 files changed

+79
-99
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- deps-{{ checksum "yarn.lock" }}
1212
- restore_cache:
1313
keys:
14-
- v-3.0.8-electron
14+
- v-3.0.10-electron
1515
- run:
1616
command: yarn --frozen-lockfile
1717
- run:
@@ -23,7 +23,7 @@ jobs:
2323
- run:
2424
command: node ./test/out/helpers/downloadElectron.js
2525
- save_cache:
26-
key: v-3.0.8-electron
26+
key: v-3.0.10-electron
2727
paths:
2828
- ~/.cache/electron
2929

@@ -41,7 +41,7 @@ jobs:
4141
- deps-{{ checksum "yarn.lock" }}
4242
- restore_cache:
4343
keys:
44-
- v-3.0.8-electron
44+
- v-3.0.10-electron
4545
# because in the build job we use circleci docker image and circleci restores cache to original user home
4646
- run:
4747
command: |

.idea/dictionaries/develar.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"schema": "typescript-json-schema packages/app-builder-lib/tsconfig.json Configuration --out packages/app-builder-lib/scheme.json --noExtraProps --useTypeOfKeyword --strictNullChecks --titles --required",
2121
"jsdoc": "ts2jsdoc packages/builder-util-runtime packages/builder-util packages/app-builder-lib packages/electron-builder packages/electron-publish",
2222
"jsdoc2md": "node scripts/jsdoc2md.js",
23+
"/////": " git clone --single-branch -b docs git@github.com:electron-userland/electron-builder.git docs",
2324
"docs": "tsc -p ./scripts/renderer/tsconfig.json && yarn jsdoc && yarn jsdoc2md",
2425
"deploy-docs": "mkdocs build --clean && netlifyctl deploy --publish-directory site",
2526
"////": "pip3 install mkdocs-material mkdocs pymdown-extensions markdown-include Pygments --upgrade"
@@ -31,7 +32,7 @@
3132
"dependencies": {
3233
"7zip-bin": "~4.1.0",
3334
"@types/is-ci": "^1.1.0",
34-
"app-builder-bin": "2.5.1",
35+
"app-builder-bin": "2.5.4",
3536
"archiver": "^3.0.0",
3637
"async-exit-hook": "^2.0.1",
3738
"bluebird-lst": "^1.0.6",
@@ -65,7 +66,7 @@
6566
"temp-file": "^3.3.2",
6667
"tunnel-agent": "^0.6.0",
6768
"update-notifier": "^2.5.0",
68-
"yargs": "^12.0.2"
69+
"yargs": "^12.0.5"
6970
},
7071
"devDependencies": {
7172
"@babel/core": "^7.1.6",

packages/app-builder-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"homepage": "https://github.com/electron-userland/electron-builder",
4343
"dependencies": {
4444
"7zip-bin": "~4.1.0",
45-
"app-builder-bin": "2.5.1",
45+
"app-builder-bin": "2.5.4",
4646
"async-exit-hook": "^2.0.1",
4747
"bluebird-lst": "^1.0.6",
4848
"chromium-pickle-js": "^0.2.0",

packages/app-builder-lib/src/macPackager.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
295295
use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => appPlist.LSApplicationCategoryType = it)
296296
appPlist.NSHumanReadableCopyright = appInfo.copyright
297297

298+
if (this.platformSpecificBuildOptions.darkModeSupport) {
299+
appPlist.NSRequiresAquaSystemAppearance = false
300+
}
301+
298302
const extendInfo = this.platformSpecificBuildOptions.extendInfo
299303
if (extendInfo != null) {
300304
Object.assign(appPlist, extendInfo)

packages/app-builder-lib/src/options/macOptions.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
5858
*/
5959
readonly bundleShortVersion?: string | null
6060

61+
/**
62+
* 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.
63+
* @default false
64+
*/
65+
readonly darkModeSupport?: boolean
66+
6167
/**
6268
* The bundle identifier to use in the application helper's plist.
6369
* @default ${appBundleIdentifier}.helper

packages/builder-util/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"out"
1212
],
1313
"dependencies": {
14-
"app-builder-bin": "2.5.1",
14+
"app-builder-bin": "2.5.4",
1515
"temp-file": "^3.3.2",
1616
"fs-extra-p": "^7.0.0",
1717
"is-ci": "^1.2.1",

packages/electron-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"read-config-file": "3.2.0",
5656
"sanitize-filename": "^1.6.1",
5757
"update-notifier": "^2.5.0",
58-
"yargs": "^12.0.2",
58+
"yargs": "^12.0.5",
5959
"lazy-val": "^1.0.3",
6060
"app-builder-lib": "0.0.0-semantic-release",
6161
"dmg-builder": "0.0.0-semantic-release"

test/fixtures/test-app-build-sub/electron-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
electronVersion: 3.0.8
1+
electronVersion: 3.0.10
22
appId: org.electron-builder.testApp
33
compression: store
44
npmRebuild: false

test/fixtures/test-app-one/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"author": "Foo Bar <foo@example.com>",
99
"license": "MIT",
1010
"build": {
11-
"electronVersion": "3.0.8",
11+
"electronVersion": "3.0.10",
1212
"appId": "org.electron-builder.testApp",
1313
"compression": "store",
1414
"npmRebuild": false,

test/fixtures/test-app-yarn-several-workspace/packages/test-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Foo Bar <foo@example.com>",
88
"license": "MIT",
99
"build": {
10-
"electronVersion": "3.0.8",
10+
"electronVersion": "3.0.10",
1111
"appId": "org.electron-builder.testApp",
1212
"compression": "store",
1313
"npmRebuild": false,

test/fixtures/test-app-yarn-workspace-version-conflict/packages/test-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Foo Bar <foo@example.com>",
88
"license": "MIT",
99
"build": {
10-
"electronVersion": "3.0.8",
10+
"electronVersion": "3.0.10",
1111
"appId": "org.electron-builder.testApp",
1212
"compression": "store",
1313
"npmRebuild": false,

test/fixtures/test-app-yarn-workspace/packages/test-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Foo Bar <foo@example.com>",
88
"license": "MIT",
99
"build": {
10-
"electronVersion": "3.0.8",
10+
"electronVersion": "3.0.10",
1111
"appId": "org.electron-builder.testApp",
1212
"compression": "store",
1313
"npmRebuild": false,

test/fixtures/test-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"build": {
4-
"electronVersion": "3.0.8",
4+
"electronVersion": "3.0.10",
55
"appId": "org.electron-builder.testApp",
66
"compression": "store",
77
"npmRebuild": false,

test/out/__snapshots__/PublishManagerTest.js.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ Object {
169169
"CFBundlePackageType": "APPL",
170170
"CFBundleShortVersionString": "1.1.0",
171171
"LSApplicationCategoryType": "your.app.category.type",
172-
"LSMinimumSystemVersion": "10.9.0",
173172
"NSAppTransportSecurity": Object {
174173
"NSAllowsLocalNetworking": true,
175174
"NSExceptionDomains": Object {
@@ -275,7 +274,6 @@ Object {
275274
"CFBundlePackageType": "APPL",
276275
"CFBundleShortVersionString": "1.1.0",
277276
"LSApplicationCategoryType": "your.app.category.type",
278-
"LSMinimumSystemVersion": "10.9.0",
279277
"NSAppTransportSecurity": Object {
280278
"NSAllowsLocalNetworking": true,
281279
"NSExceptionDomains": Object {
@@ -353,7 +351,6 @@ Object {
353351
"CFBundlePackageType": "APPL",
354352
"CFBundleShortVersionString": "1.1.0",
355353
"LSApplicationCategoryType": "your.app.category.type",
356-
"LSMinimumSystemVersion": "10.9.0",
357354
"NSAppTransportSecurity": Object {
358355
"NSAllowsLocalNetworking": true,
359356
"NSExceptionDomains": Object {

test/out/mac/__snapshots__/dmgTest.js.snap

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Object {
3333
"CFBundlePackageType": "APPL",
3434
"CFBundleShortVersionString": "2017.1-alpha5",
3535
"LSApplicationCategoryType": "your.app.category.type",
36-
"LSMinimumSystemVersion": "10.9.0",
3736
"NSAppTransportSecurity": Object {
3837
"NSAllowsLocalNetworking": true,
3938
"NSExceptionDomains": Object {
@@ -56,6 +55,7 @@ Object {
5655
"NSHighResolutionCapable": true,
5756
"NSMainNibFile": "MainMenu",
5857
"NSPrincipalClass": "AtomApplication",
58+
"NSRequiresAquaSystemAppearance": false,
5959
"NSSupportsAutomaticGraphicsSwitching": true,
6060
}
6161
`;
@@ -88,7 +88,6 @@ Object {
8888
"CFBundlePackageType": "APPL",
8989
"CFBundleShortVersionString": "1.1.0",
9090
"LSApplicationCategoryType": "your.app.category.type",
91-
"LSMinimumSystemVersion": "10.9.0",
9291
"NSAppTransportSecurity": Object {
9392
"NSAllowsLocalNetworking": true,
9493
"NSExceptionDomains": Object {
@@ -143,7 +142,6 @@ Object {
143142
"CFBundlePackageType": "APPL",
144143
"CFBundleShortVersionString": "1.1.0",
145144
"LSApplicationCategoryType": "your.app.category.type",
146-
"LSMinimumSystemVersion": "10.9.0",
147145
"NSAppTransportSecurity": Object {
148146
"NSAllowsLocalNetworking": true,
149147
"NSExceptionDomains": Object {
@@ -2267,7 +2265,6 @@ Object {
22672265
"CFBundlePackageType": "APPL",
22682266
"CFBundleShortVersionString": "1.1.0",
22692267
"LSApplicationCategoryType": "your.app.category.type",
2270-
"LSMinimumSystemVersion": "10.9.0",
22712268
"NSAppTransportSecurity": Object {
22722269
"NSAllowsLocalNetworking": true,
22732270
"NSExceptionDomains": Object {
@@ -2329,7 +2326,6 @@ Object {
23292326
"CFBundlePackageType": "APPL",
23302327
"CFBundleShortVersionString": "1.1.0",
23312328
"LSApplicationCategoryType": "your.app.category.type",
2332-
"LSMinimumSystemVersion": "10.9.0",
23332329
"NSAppTransportSecurity": Object {
23342330
"NSAllowsLocalNetworking": true,
23352331
"NSExceptionDomains": Object {
@@ -2391,7 +2387,6 @@ Object {
23912387
"CFBundlePackageType": "APPL",
23922388
"CFBundleShortVersionString": "1.1.0",
23932389
"LSApplicationCategoryType": "your.app.category.type",
2394-
"LSMinimumSystemVersion": "10.9.0",
23952390
"NSAppTransportSecurity": Object {
23962391
"NSAllowsLocalNetworking": true,
23972392
"NSExceptionDomains": Object {
@@ -2453,7 +2448,6 @@ Object {
24532448
"CFBundlePackageType": "APPL",
24542449
"CFBundleShortVersionString": "1.1.0",
24552450
"LSApplicationCategoryType": "your.app.category.type",
2456-
"LSMinimumSystemVersion": "10.9.0",
24572451
"NSAppTransportSecurity": Object {
24582452
"NSAllowsLocalNetworking": true,
24592453
"NSExceptionDomains": Object {
@@ -2515,7 +2509,6 @@ Object {
25152509
"CFBundlePackageType": "APPL",
25162510
"CFBundleShortVersionString": "1.1.0",
25172511
"LSApplicationCategoryType": "your.app.category.type",
2518-
"LSMinimumSystemVersion": "10.9.0",
25192512
"NSAppTransportSecurity": Object {
25202513
"NSAllowsLocalNetworking": true,
25212514
"NSExceptionDomains": Object {
@@ -2599,7 +2592,6 @@ Object {
25992592
"CFBundlePackageType": "APPL",
26002593
"CFBundleShortVersionString": "1.1.0",
26012594
"LSApplicationCategoryType": "your.app.category.type",
2602-
"LSMinimumSystemVersion": "10.9.0",
26032595
"NSAppTransportSecurity": Object {
26042596
"NSAllowsLocalNetworking": true,
26052597
"NSExceptionDomains": Object {
@@ -2659,7 +2651,6 @@ Object {
26592651
"CFBundlePackageType": "APPL",
26602652
"CFBundleShortVersionString": "1.1.0",
26612653
"LSApplicationCategoryType": "your.app.category.type",
2662-
"LSMinimumSystemVersion": "10.9.0",
26632654
"NSAppTransportSecurity": Object {
26642655
"NSAllowsLocalNetworking": true,
26652656
"NSExceptionDomains": Object {
@@ -2734,7 +2725,6 @@ Object {
27342725
"CFBundlePackageType": "APPL",
27352726
"CFBundleShortVersionString": "1.1.0",
27362727
"LSApplicationCategoryType": "your.app.category.type",
2737-
"LSMinimumSystemVersion": "10.9.0",
27382728
"NSAppTransportSecurity": Object {
27392729
"NSAllowsLocalNetworking": true,
27402730
"NSExceptionDomains": Object {
@@ -2789,7 +2779,6 @@ Object {
27892779
"CFBundlePackageType": "APPL",
27902780
"CFBundleShortVersionString": "1.1.0",
27912781
"LSApplicationCategoryType": "your.app.category.type",
2792-
"LSMinimumSystemVersion": "10.9.0",
27932782
"NSAppTransportSecurity": Object {
27942783
"NSAllowsLocalNetworking": true,
27952784
"NSExceptionDomains": Object {
@@ -2851,7 +2840,6 @@ Object {
28512840
"CFBundlePackageType": "APPL",
28522841
"CFBundleShortVersionString": "1.1.0",
28532842
"LSApplicationCategoryType": "your.app.category.type",
2854-
"LSMinimumSystemVersion": "10.9.0",
28552843
"NSAppTransportSecurity": Object {
28562844
"NSAllowsLocalNetworking": true,
28572845
"NSExceptionDomains": Object {

test/out/mac/__snapshots__/macArchiveTest.js.snap

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Object {
2323
"CFBundlePackageType": "APPL",
2424
"CFBundleShortVersionString": "1.1.0",
2525
"LSApplicationCategoryType": "your.app.category.type",
26-
"LSMinimumSystemVersion": "10.9.0",
2726
"NSAppTransportSecurity": Object {
2827
"NSAllowsLocalNetworking": true,
2928
"NSExceptionDomains": Object {
@@ -78,7 +77,6 @@ Object {
7877
"CFBundlePackageType": "APPL",
7978
"CFBundleShortVersionString": "1.1.0",
8079
"LSApplicationCategoryType": "your.app.category.type",
81-
"LSMinimumSystemVersion": "10.9.0",
8280
"NSAppTransportSecurity": Object {
8381
"NSAllowsLocalNetworking": true,
8482
"NSExceptionDomains": Object {
@@ -135,7 +133,6 @@ Object {
135133
"CFBundlePackageType": "APPL",
136134
"CFBundleShortVersionString": "1.1.0",
137135
"LSApplicationCategoryType": "your.app.category.type",
138-
"LSMinimumSystemVersion": "10.10.0",
139136
"NSAppTransportSecurity": Object {
140137
"NSAllowsLocalNetworking": true,
141138
"NSExceptionDomains": Object {
@@ -185,7 +182,6 @@ Object {
185182
"CFBundlePackageType": "APPL",
186183
"CFBundleShortVersionString": "1.1.0",
187184
"LSApplicationCategoryType": "your.app.category.type",
188-
"LSMinimumSystemVersion": "10.9.0",
189185
"NSAppTransportSecurity": Object {
190186
"NSAllowsLocalNetworking": true,
191187
"NSExceptionDomains": Object {
@@ -235,7 +231,6 @@ Object {
235231
"CFBundlePackageType": "APPL",
236232
"CFBundleShortVersionString": "1.1.0",
237233
"LSApplicationCategoryType": "your.app.category.type",
238-
"LSMinimumSystemVersion": "10.9.0",
239234
"NSAppTransportSecurity": Object {
240235
"NSAllowsLocalNetworking": true,
241236
"NSExceptionDomains": Object {
@@ -285,7 +280,6 @@ Object {
285280
"CFBundlePackageType": "APPL",
286281
"CFBundleShortVersionString": "1.1.0",
287282
"LSApplicationCategoryType": "your.app.category.type",
288-
"LSMinimumSystemVersion": "10.9.0",
289283
"NSAppTransportSecurity": Object {
290284
"NSAllowsLocalNetworking": true,
291285
"NSExceptionDomains": Object {
@@ -847,7 +841,6 @@ Object {
847841
"CFBundlePackageType": "APPL",
848842
"CFBundleShortVersionString": "1.1.0",
849843
"LSApplicationCategoryType": "your.app.category.type",
850-
"LSMinimumSystemVersion": "10.9.0",
851844
"NSAppTransportSecurity": Object {
852845
"NSAllowsLocalNetworking": true,
853846
"NSExceptionDomains": Object {

test/out/mac/__snapshots__/macPackagerTest.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ Object {
188188
"CFBundlePackageType": "APPL",
189189
"CFBundleShortVersionString": "1.1.0",
190190
"LSApplicationCategoryType": "your.app.category.type",
191-
"LSMinimumSystemVersion": "10.9.0",
192191
"NSAppTransportSecurity": Object {
193192
"NSAllowsLocalNetworking": true,
194193
"NSExceptionDomains": Object {

test/out/mac/__snapshots__/masTest.js.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Object {
1818
"CFBundleShortVersionString": "1.1.0",
1919
"ElectronTeamID": "744739DJ4Y",
2020
"LSApplicationCategoryType": "your.app.category.type",
21-
"LSMinimumSystemVersion": "10.9.0",
2221
"NSHighResolutionCapable": true,
2322
"NSMainNibFile": "MainMenu",
2423
"NSPrincipalClass": "AtomApplication",
@@ -50,7 +49,6 @@ Object {
5049
"CFBundleShortVersionString": "1.1.0",
5150
"ElectronTeamID": "X8C9Z9L4HW",
5251
"LSApplicationCategoryType": "your.app.category.type",
53-
"LSMinimumSystemVersion": "10.9.0",
5452
"NSHighResolutionCapable": true,
5553
"NSMainNibFile": "MainMenu",
5654
"NSPrincipalClass": "AtomApplication",
@@ -87,7 +85,6 @@ Object {
8785
"CFBundleShortVersionString": "1.1.0",
8886
"ElectronTeamID": "X8C9Z9L4HW",
8987
"LSApplicationCategoryType": "your.app.category.type",
90-
"LSMinimumSystemVersion": "10.9.0",
9188
"NSHighResolutionCapable": true,
9289
"NSMainNibFile": "MainMenu",
9390
"NSPrincipalClass": "AtomApplication",

0 commit comments

Comments
 (0)