Skip to content

Commit

Permalink
Merge pull request #378 from brafdlog/electron
Browse files Browse the repository at this point in the history
Upgrade: electron version from v9 to v13
  • Loading branch information
brafdlog authored Oct 15, 2022
2 parents 08a62a5 + 0324e0d commit 20e859b
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 30 deletions.
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = {
],
moduleNameMapper: {
'\\.css$': 'identity-obj-proxy',
electron: '<rootDir>/test/unit/mock/electron.ts',
'^@electron/remote$': '<rootDir>/test/unit/mock/electron.ts',
'^electron$': '<rootDir>/test/unit/mock/electron.ts',
'^keytar$': '<rootDir>/test/unit/mock/keytar.ts',
},
transform: {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
}
},
"dependencies": {
"@electron/remote": "^2.0.8",
"@getstation/electron-google-oauth2": "2.1.0",
"@sentry/electron": "^2.5.0",
"@vue/composition-api": "^1.0.0-rc.6",
Expand Down Expand Up @@ -78,14 +79,15 @@
"@vue/cli-plugin-unit-jest": "^4.5.4",
"@vue/cli-plugin-vuex": "^4.3.1",
"@vue/cli-service": "^4.3.1",
"@vue/compiler-dom": "^3.2.40",
"@vue/eslint-config-typescript": "^7.0.0",
"@vue/test-utils": "^1.0.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0",
"babel-plugin-component": "^1.1.1",
"conventional-changelog-eslint": "^3.0.9",
"electron": "^9.0.0",
"electron": "^13.0.0",
"eslint": "^7.1.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-friendly-formatter": "^4.0.1",
Expand All @@ -111,7 +113,7 @@
"sass": "~1.32",
"sass-loader": "^10.0.0",
"semantic-release": "^19.0.5",
"spectron": "^11.0.0",
"spectron": "^15.0.0",
"ts-jest": "^26.3.0",
"typescript": "^3.9.7",
"vue-cli-plugin-electron-builder": "^2.0.0-rc.6",
Expand Down
4 changes: 2 additions & 2 deletions src/app-globals.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { app, remote } from 'electron';
import { mkdirSync } from 'fs';
import path from 'path';
import electron from './electron';

export const App = app || remote.app;
export const App: Electron.App = electron.app;

if (process.env.NODE_ENV !== 'production') {
const localUserData = path.resolve('userData');
Expand Down
4 changes: 4 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import Sentry from './logging/sentry';
import { registerHandlers } from './handlers';
// import './store';

require('@electron/remote/main').initialize();

Sentry.initializeReporter();

const isDevelopment = process.env.NODE_ENV !== 'production';
Expand All @@ -22,6 +24,8 @@ function createWindow() {
useContentSize: true,
width: 1000,
webPreferences: {
enableRemoteModule: true,
contextIsolation: false,
nodeIntegration: (process.env.ELECTRON_NODE_INTEGRATION as unknown) as
| boolean
| undefined,
Expand Down
5 changes: 5 additions & 0 deletions src/electron.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const electron = process.type === 'browser'
? require('electron')
: require('@electron/remote');

export default electron;
2 changes: 1 addition & 1 deletion src/ui/components/app/Updater.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { defineComponent, ref } from '@vue/composition-api';
import { ipcHandlers } from '@/handlers';
import { UpdateInfo } from '@/handlers/updater';
import { App } from '@/app-globals';
import { shell } from 'electron';
import { shell } from '@electron/remote';
import { repository } from '../../../../package.json';
enum STATES {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@
"files": [
"./src/types/shims-vue.d.ts",
"./src/types/shims-tsx.d.ts"
]
],
"vueCompilerOptions": {
"target": 2
}
}
140 changes: 117 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.5.tgz#4cd2f346261061b2518873ffecdf1612cb032829"
integrity sha512-TM8C+xtH/9n1qzX+JNHi7AN2zHMTiPUtspO0ZdHflW8KaskkALhMmuMHb4bCmNdv9VAPzJX3/bXqkVLnAvsPfg==

"@babel/parser@^7.16.4":
version "7.19.3"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.3.tgz#8dd36d17c53ff347f9e55c328710321b49479a9a"
integrity sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==

"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5":
version "7.14.5"
resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz#4b467302e1548ed3b1be43beae2cc9cf45e0bb7e"
Expand Down Expand Up @@ -1016,7 +1021,7 @@
ajv "^6.12.0"
ajv-keywords "^3.4.1"

"@electron/get@^1.0.1", "@electron/get@^1.12.2":
"@electron/get@^1.0.1":
version "1.12.4"
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.12.4.tgz#a5971113fc1bf8fa12a8789dc20152a7359f06ab"
integrity sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg==
Expand All @@ -1032,6 +1037,32 @@
global-agent "^2.0.2"
global-tunnel-ng "^2.7.1"

"@electron/get@^1.12.4":
version "1.14.1"
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.14.1.tgz#16ba75f02dffb74c23965e72d617adc721d27f40"
integrity sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==
dependencies:
debug "^4.1.1"
env-paths "^2.2.0"
fs-extra "^8.1.0"
got "^9.6.0"
progress "^2.0.3"
semver "^6.2.0"
sumchecker "^3.0.1"
optionalDependencies:
global-agent "^3.0.0"
global-tunnel-ng "^2.7.1"

"@electron/remote@^1.1.0":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-1.2.2.tgz#4c390a2e669df47af973c09eec106162a296c323"
integrity sha512-PfnXpQGWh4vpX866NNucJRnNOzDRZcsLcLaT32fUth9k0hccsohfxprqEDYLzRg+ZK2xRrtyUN5wYYoHimMCJg==

"@electron/remote@^2.0.8":
version "2.0.8"
resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-2.0.8.tgz#85ff321f0490222993207106e2f720273bb1a5c3"
integrity sha512-P10v3+iFCIvEPeYzTWWGwwHmqWnjoh8RYnbtZAb3RlQefy4guagzIwcWtfftABIfm6JJTNQf4WPSKWZOpLmHXw==

"@electron/universal@1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.0.4.tgz#231ac246c39d45b80e159bd21c3f9027dcaa10f5"
Expand Down Expand Up @@ -2268,7 +2299,7 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.4.tgz#fec0ce0526abb6062fd206d72a642811b887a111"
integrity sha512-6xwbrW4JJiJLgF+zNypN5wr2ykM9/jHcL7rQ8fZe2vuftggjzZeRSM4OwRc6Xk8qWjwJ99qVHo/JgOGmomWRog==

"@types/node@12", "@types/node@^12.0.12":
"@types/node@12":
version "12.20.15"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.15.tgz#10ee6a6a3f971966fddfa3f6e89ef7a73ec622df"
integrity sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==
Expand All @@ -2278,6 +2309,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.3.tgz#6d327abaa4be34a74e421ed6409a0ae2f47f4c3d"
integrity sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==

"@types/node@^14.6.2":
version "14.18.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.31.tgz#4b873dea3122e71af4f77e65ec5841397ff254d3"
integrity sha512-vQAnaReSQkEDa8uwAyQby8bYGKu84R/deEc6mg5T8fX6gzCn8QW6rziSgsti1fNvsrswKUKPnVTi7uoB+u62Mw==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
Expand Down Expand Up @@ -2839,6 +2875,24 @@
semver "^6.1.0"
strip-ansi "^6.0.0"

"@vue/compiler-core@3.2.40":
version "3.2.40"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.40.tgz#c785501f09536748121e937fb87605bbb1ada8e5"
integrity sha512-2Dc3Stk0J/VyQ4OUr2yEC53kU28614lZS+bnrCbFSAIftBJ40g/2yQzf4mPBiFuqguMB7hyHaujdgZAQ67kZYA==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/shared" "3.2.40"
estree-walker "^2.0.2"
source-map "^0.6.1"

"@vue/compiler-dom@^3.2.40":
version "3.2.40"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.40.tgz#c225418773774db536174d30d3f25ba42a33e7e4"
integrity sha512-OZCNyYVC2LQJy4H7h0o28rtk+4v+HMQygRTpmibGoG9wZyomQiS5otU7qo3Wlq5UfHDw2RFwxb9BJgKjVpjrQw==
dependencies:
"@vue/compiler-core" "3.2.40"
"@vue/shared" "3.2.40"

"@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.1.2":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.2.1.tgz#c3e3cb85ea80cc157eeaffe128a25dfe77e2f326"
Expand Down Expand Up @@ -2873,6 +2927,11 @@
resolved "https://registry.yarnpkg.com/@vue/preload-webpack-plugin/-/preload-webpack-plugin-1.1.2.tgz#ceb924b4ecb3b9c43871c7a429a02f8423e621ab"
integrity sha512-LIZMuJk38pk9U9Ur4YzHjlIyMuxPlACdBIHH9/nGYVTsaGKOSnSuELiE8vS9wa+dJpIYspYUOqk+L1Q4pgHQHQ==

"@vue/shared@3.2.40":
version "3.2.40"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.40.tgz#e57799da2a930b975321981fcee3d1e90ed257ae"
integrity sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ==

"@vue/test-utils@^1.0.3":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.2.0.tgz#3bc8c17ed549157275f0aec6b95da40887f7297f"
Expand Down Expand Up @@ -4576,7 +4635,7 @@ cacheable-request@^6.0.0:
normalize-url "^4.1.0"
responselike "^1.0.2"

cacheable-request@^7.0.1:
cacheable-request@^7.0.1, cacheable-request@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27"
integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==
Expand Down Expand Up @@ -6548,12 +6607,12 @@ electron-builder@^22.2.0:
update-notifier "^5.1.0"
yargs "^16.2.0"

electron-chromedriver@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/electron-chromedriver/-/electron-chromedriver-9.0.0.tgz#c7629fe6b9721140f3a380144f99960c2bc3b5c1"
integrity sha512-+MuukzicyfduXO/4yQv9ygLKaScttJNbWtg77A9fs2YhbkISjObWaCF3eJNZL+edZXRfaF/6D4XuXvklQCmwQg==
electron-chromedriver@^13.0.0:
version "13.0.0"
resolved "https://registry.yarnpkg.com/electron-chromedriver/-/electron-chromedriver-13.0.0.tgz#a553af7743215ac463e1e40e0db14d4a542ef762"
integrity sha512-fID1ms8wT7qNfoKkXHNpH0ZE8/Nclb5YmkF3O0w57OxsR8S9PxgE9CJAgaSGroxBgZ+ge1i2OU0Aq/WE/e/Neg==
dependencies:
"@electron/get" "^1.12.2"
"@electron/get" "^1.12.4"
extract-zip "^2.0.0"

electron-devtools-installer@^3.1.1:
Expand Down Expand Up @@ -6604,13 +6663,13 @@ electron-updater@^4.3.9:
lodash.isequal "^4.5.0"
semver "^7.3.5"

electron@^9.0.0:
version "9.4.4"
resolved "https://registry.yarnpkg.com/electron/-/electron-9.4.4.tgz#2a74a0655a74bd326216672c5ae6ed3a44451446"
integrity sha512-dcPlTrMWQu5xuSm6sYV42KK/BRIqh3erM8v/WtZqaDmG7pkCeJpvw26Dgbqhdt78XmqqGiN96giEe6A3S9vpAQ==
electron@^13.0.0:
version "13.6.9"
resolved "https://registry.yarnpkg.com/electron/-/electron-13.6.9.tgz#7bd83cc1662ceaaa09dcd132a7b507cec888b028"
integrity sha512-Es/sBy85NIuqsO9MW41PUCpwIkeinlTQ7g0ainfnmRAM2rmog3GBxVCaoV5dzEjwTF7TKG1Yr/E7Z3qHmlfWAg==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^12.0.12"
"@types/node" "^14.6.2"
extract-zip "^1.0.3"

elliptic@^6.5.3:
Expand Down Expand Up @@ -7095,6 +7154,11 @@ estraverse@^5.1.0, estraverse@^5.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==

estree-walker@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==

esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
Expand Down Expand Up @@ -8068,6 +8132,18 @@ global-agent@^2.0.2:
semver "^7.3.2"
serialize-error "^7.0.1"

global-agent@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-3.0.0.tgz#ae7cd31bd3583b93c5a16437a1afe27cc33a1ab6"
integrity sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==
dependencies:
boolean "^3.0.1"
es6-error "^4.1.1"
matcher "^3.0.0"
roarr "^2.15.3"
semver "^7.3.2"
serialize-error "^7.0.1"

global-dirs@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686"
Expand Down Expand Up @@ -8239,6 +8315,23 @@ got@^11.0.2, got@^11.8.1:
p-cancelable "^2.0.0"
responselike "^2.0.0"

got@^11.8.0:
version "11.8.5"
resolved "https://registry.yarnpkg.com/got/-/got-11.8.5.tgz#ce77d045136de56e8f024bebb82ea349bc730046"
integrity sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==
dependencies:
"@sindresorhus/is" "^4.0.0"
"@szmarczak/http-timer" "^4.0.5"
"@types/cacheable-request" "^6.0.1"
"@types/responselike" "^1.0.0"
cacheable-lookup "^5.0.3"
cacheable-request "^7.0.2"
decompress-response "^6.0.0"
http2-wrapper "^1.0.0-beta.5.2"
lowercase-keys "^2.0.0"
p-cancelable "^2.0.0"
responselike "^2.0.0"

got@^9.6.0:
version "9.6.0"
resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
Expand Down Expand Up @@ -15125,16 +15218,17 @@ spdy@^4.0.2:
select-hose "^2.0.0"
spdy-transport "^3.0.0"

spectron@^11.0.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/spectron/-/spectron-11.1.0.tgz#ee4f11c9057f6d79094f2d444eba555ccbe63965"
integrity sha512-gL5mQZrh2Afv5vfUX7Llf61NI9zzS139BP0vivNU9kbl92O1AoGk7KwOEg+Cf6Pb2/G/s/81wYWqo/WOhYi6jQ==
spectron@^15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/spectron/-/spectron-15.0.0.tgz#9c0e254b2be3f0725a81b8343092b9d0108439c7"
integrity sha512-eErHqymkEVb6H+LPZQoDYvWEv93o3nhxL7HXXdmC61ncV0jBckh8x3Qt6j+As2c1n0C/hKG9A2H1NnwGwD6agg==
dependencies:
"@electron/remote" "^1.1.0"
dev-null "^0.1.1"
electron-chromedriver "^9.0.0"
request "^2.87.0"
split "^1.0.0"
webdriverio "^6.1.20"
electron-chromedriver "^13.0.0"
got "^11.8.0"
split "^1.0.1"
webdriverio "^6.9.1"

split-string@^3.0.1, split-string@^3.0.2:
version "3.1.0"
Expand All @@ -15157,7 +15251,7 @@ split2@~1.0.0:
dependencies:
through2 "~2.0.0"

split@^1.0.0:
split@^1.0.0, split@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9"
integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==
Expand Down Expand Up @@ -16871,7 +16965,7 @@ webdriverio@*:
serialize-error "^8.0.0"
webdriver "7.7.3"

webdriverio@^6.1.20:
webdriverio@^6.9.1:
version "6.12.1"
resolved "https://registry.yarnpkg.com/webdriverio/-/webdriverio-6.12.1.tgz#5b6f1167373bd7a154419d8a930ef1ffda9d0537"
integrity sha512-Nx7ge0vTWHVIRUbZCT+IuMwB5Q0Q5nLlYdgnmmJviUKLuc3XtaEBkYPTbhHWHgSBXsPZMIc023vZKNkn+6iyeQ==
Expand Down

0 comments on commit 20e859b

Please sign in to comment.