Skip to content

Commit 865ca8c

Browse files
committed
feat: add support for electron 12
1 parent cf14366 commit 865ca8c

File tree

5 files changed

+70
-31
lines changed

5 files changed

+70
-31
lines changed

Diff for: __tests__/createProject.helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const createProject = async (projectName, useTS, customPlugins = {}) => {
2424
preset.plugins['vue-cli-plugin-electron-builder'] = {
2525
// electron-builder requires that an exact version of electron is provided,
2626
// unless electron is already installed
27-
electronBuilder: { electronVersion: '11.0.0' }
27+
electronBuilder: { electronVersion: '12.0.0' }
2828
}
2929
preset.plugins = { ...preset.plugins, ...customPlugins }
3030
const projectPath = (p) =>

Diff for: docs/guide/guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Available only in Electron, the global variable `__static` is added to the main
4545
:::
4646

4747
:::tip Videos
48-
By default, videos will fail to load from the public folder. There are two solutions to this problem. If you are using Electron 11, simply add `stream: true` to the privileges config on line 10 of your main process file (`background.(js|ts)` by default): `{ scheme: 'app', privileges: { secure: true, standard: true, stream: true } }`. If you do not want to use Electron 11, you will have to configure and use the `local-resource` protocol, see [these docs](./security.html#loading-local-images-resources) for instructions, and [this GitHub issue](https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/872) for more details.
48+
By default, videos will fail to load from the public folder. There are two solutions to this problem. If you are using Electron 11+, simply add `stream: true` to the privileges config on line 10 of your main process file (`background.(js|ts)` by default): `{ scheme: 'app', privileges: { secure: true, standard: true, stream: true } }`. If you do not want to use Electron 11+, you will have to configure and use the `local-resource` protocol, see [these docs](./security.html#loading-local-images-resources) for instructions, and [this GitHub issue](https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/872) for more details.
4949
:::
5050

5151
### Examples:

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@vuepress/plugin-google-analytics": "^1.8.0",
6464
"chai": "^4.2.0",
6565
"chai-as-promised": "^7.1.1",
66-
"electron": "^11.2.1",
66+
"electron": "^12.0.0",
6767
"electron-devtools-installer": "^3.1.0",
6868
"eslint": "^7.2.0",
6969
"eslint-config-standard": "^16.0.2",
@@ -74,7 +74,7 @@
7474
"jest": "^24.8.0",
7575
"lnk": "^1.1.0",
7676
"rimraf": "^3.0.0",
77-
"spectron": "^13.0.0",
77+
"spectron": "^14.0.0",
7878
"terminal-tasks": "^0.0.5",
7979
"typescript": "^3.9.5",
8080
"vue": "^2.5.20",

Diff for: prompts.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@ module.exports = [
55
name: 'electronBuilder.electronVersion',
66
type: 'list',
77
message: 'Choose Electron Version',
8-
default: '^11.0.0',
8+
default: '^12.0.0',
99
choices: [
10-
{
11-
name: '^9.0.0',
12-
value: '^9.0.0',
13-
short: '^9.0.0'
14-
},
1510
{
1611
name: '^10.0.0',
1712
value: '^10.0.0',
@@ -21,6 +16,11 @@ module.exports = [
2116
name: '^11.0.0',
2217
value: '^11.0.0',
2318
short: '^11.0.0'
19+
},
20+
{
21+
name: '^12.0.0',
22+
value: '^12.0.0',
23+
short: '^12.0.0'
2424
}
2525
],
2626
when: () => {

Diff for: yarn.lock

+60-21
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@
10281028
ajv "^6.12.0"
10291029
ajv-keywords "^3.4.1"
10301030

1031-
"@electron/get@^1.0.1", "@electron/get@^1.12.2":
1031+
"@electron/get@^1.0.1":
10321032
version "1.12.2"
10331033
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.12.2.tgz#6442066afb99be08cefb9a281e4b4692b33764f3"
10341034
integrity sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg==
@@ -1044,6 +1044,27 @@
10441044
global-agent "^2.0.2"
10451045
global-tunnel-ng "^2.7.1"
10461046

1047+
"@electron/get@^1.12.4":
1048+
version "1.12.4"
1049+
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.12.4.tgz#a5971113fc1bf8fa12a8789dc20152a7359f06ab"
1050+
integrity sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg==
1051+
dependencies:
1052+
debug "^4.1.1"
1053+
env-paths "^2.2.0"
1054+
fs-extra "^8.1.0"
1055+
got "^9.6.0"
1056+
progress "^2.0.3"
1057+
semver "^6.2.0"
1058+
sumchecker "^3.0.1"
1059+
optionalDependencies:
1060+
global-agent "^2.0.2"
1061+
global-tunnel-ng "^2.7.1"
1062+
1063+
"@electron/remote@^1.0.4":
1064+
version "1.1.0"
1065+
resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-1.1.0.tgz#167d119c7c03c7778b556fdc4f1f38a44b23f1c2"
1066+
integrity sha512-yr8gZTkIgJYKbFqExI4QZqMSjn1kL/us9Dl46+TH1EZdhgRtsJ6HDfdsIxu0QEc6Hv+DMAXs69rgquH+8FDk4w==
1067+
10471068
"@electron/[email protected]":
10481069
version "1.0.4"
10491070
resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.0.4.tgz#231ac246c39d45b80e159bd21c3f9027dcaa10f5"
@@ -1727,10 +1748,10 @@
17271748
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.55.tgz#a147f282edec679b894d4694edb5abeb595fecbd"
17281749
integrity sha512-koZJ89uLZufDvToeWO5BrC4CR4OUfHnUz2qoPs/daQH6qq3IN62QFxCTZ+bKaCE0xaoCAJYE4AXre8AbghCrhg==
17291750

1730-
"@types/node@^12.0.12":
1731-
version "12.19.14"
1732-
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.14.tgz#59e5029a3c2aea34f68b717955381692fd47cafb"
1733-
integrity sha512-2U9uLN46+7dv9PiS8VQJcHhuoOjiDPZOLAt0WuA1EanEknIMae+2QbMhayF7cgGqjvRVIfNpt+6jLPczJZFiRw==
1751+
"@types/node@^14.6.2":
1752+
version "14.14.44"
1753+
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.44.tgz#df7503e6002847b834371c004b372529f3f85215"
1754+
integrity sha512-+gaugz6Oce6ZInfI/tK4Pq5wIIkJMEJUu92RB3Eu93mtj4wjjjz9EB5mLp5s1pSsLXdC/CPut/xF20ZzAQJbTA==
17341755

17351756
"@types/normalize-package-data@^2.4.0":
17361757
version "2.4.0"
@@ -6074,12 +6095,12 @@ electron-builder@^22.2.0:
60746095
update-notifier "^5.1.0"
60756096
yargs "^16.2.0"
60766097

6077-
electron-chromedriver@^11.0.0:
6078-
version "11.0.0"
6079-
resolved "https://registry.yarnpkg.com/electron-chromedriver/-/electron-chromedriver-11.0.0.tgz#49b034ed0ad12c12e3522862c7bb46875a0d85e1"
6080-
integrity sha512-ayMJPBbB4puU0SqYbcD9XvF3/7GWIhqKE1n5lG2/GQPRnrZkNoPIilsrS0rQcD50Xhl69KowatDqLhUznZWtbA==
6098+
electron-chromedriver@^12.0.0:
6099+
version "12.0.0"
6100+
resolved "https://registry.yarnpkg.com/electron-chromedriver/-/electron-chromedriver-12.0.0.tgz#55bdc451b938b384642d613a05eadacb1fe476ee"
6101+
integrity sha512-zOs98o9+20Er8Q44z06h90VldwrJaoRCieW3Q8WkdDjA3cMRU5mlmm1kGDhPLMeYNuhq6e39aGMVH/IBFD97HQ==
60816102
dependencies:
6082-
"@electron/get" "^1.12.2"
6103+
"@electron/get" "^1.12.4"
60836104
extract-zip "^2.0.0"
60846105

60856106
electron-devtools-installer@^3.1.0:
@@ -6111,13 +6132,13 @@ electron-to-chromium@^1.3.649:
61116132
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.693.tgz#5089c506a925c31f93fcb173a003a22e341115dd"
61126133
integrity sha512-vUdsE8yyeu30RecppQtI+XTz2++LWLVEIYmzeCaCRLSdtKZ2eXqdJcrs85KwLiPOPVc6PELgWyXBsfqIvzGZag==
61136134

6114-
electron@^11.2.1:
6115-
version "11.3.0"
6116-
resolved "https://registry.yarnpkg.com/electron/-/electron-11.3.0.tgz#87e8528fd23ae53b0eeb3a738f1fe0a3ad27c2db"
6117-
integrity sha512-MhdS0gok3wZBTscLBbYrOhLaQybCSAfkupazbK1dMP5c+84eVMxJE/QGohiWQkzs0tVFIJsAHyN19YKPbelNrQ==
6135+
electron@^12.0.0:
6136+
version "12.0.7"
6137+
resolved "https://registry.yarnpkg.com/electron/-/electron-12.0.7.tgz#e0fca2c8be34cb7da48c4d15cfb1d2ad666d2718"
6138+
integrity sha512-722TZNKDuLpEmj96AzTYFKHaJEH98xgOBH0aldStaPXI1xDFfb9SJQQuirvwFlkwG5OqQdz6Ne3OwwJ7Dbs5nQ==
61186139
dependencies:
61196140
"@electron/get" "^1.0.1"
6120-
"@types/node" "^12.0.12"
6141+
"@types/node" "^14.6.2"
61216142
extract-zip "^1.0.3"
61226143

61236144
elliptic@^6.5.3:
@@ -7758,6 +7779,23 @@ got@^11.0.2:
77587779
p-cancelable "^2.0.0"
77597780
responselike "^2.0.0"
77607781

7782+
got@^11.8.0:
7783+
version "11.8.2"
7784+
resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599"
7785+
integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ==
7786+
dependencies:
7787+
"@sindresorhus/is" "^4.0.0"
7788+
"@szmarczak/http-timer" "^4.0.5"
7789+
"@types/cacheable-request" "^6.0.1"
7790+
"@types/responselike" "^1.0.0"
7791+
cacheable-lookup "^5.0.3"
7792+
cacheable-request "^7.0.1"
7793+
decompress-response "^6.0.0"
7794+
http2-wrapper "^1.0.0-beta.5.2"
7795+
lowercase-keys "^2.0.0"
7796+
p-cancelable "^2.0.0"
7797+
responselike "^2.0.0"
7798+
77617799
got@^8.3.1:
77627800
version "8.3.2"
77637801
resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937"
@@ -13707,14 +13745,15 @@ spdy@^4.0.2:
1370713745
select-hose "^2.0.0"
1370813746
spdy-transport "^3.0.0"
1370913747

13710-
spectron@^13.0.0:
13711-
version "13.0.0"
13712-
resolved "https://registry.yarnpkg.com/spectron/-/spectron-13.0.0.tgz#16bdfcf9a2b26cb5ee6c3e29b4f08101e339aa4d"
13713-
integrity sha512-7RPa6Fp8gqL4V0DubobnqIRFHIijkpjg6MFHcJlxoerWyvLJd+cQvOh756XpB1Z/U3DyA9jPcS+HE2PvYRP5+A==
13748+
spectron@^14.0.0:
13749+
version "14.0.0"
13750+
resolved "https://registry.yarnpkg.com/spectron/-/spectron-14.0.0.tgz#c8160e38c30dcda39734f3e8e809162dc0805d14"
13751+
integrity sha512-88GM7D1eLiTxjByjtY7lxU7CJcQ92kX1x0WfnADaIXqqYRLbI1KlIWxXz1Xm5UxuMJh5N847K0NONG49mvZtuw==
1371413752
dependencies:
13753+
"@electron/remote" "^1.0.4"
1371513754
dev-null "^0.1.1"
13716-
electron-chromedriver "^11.0.0"
13717-
request "^2.88.2"
13755+
electron-chromedriver "^12.0.0"
13756+
got "^11.8.0"
1371813757
split "^1.0.1"
1371913758
webdriverio "^6.9.1"
1372013759

0 commit comments

Comments
 (0)