Skip to content

Commit 51f5f4c

Browse files
authored
Upgrade Electron to v17 (marktext#3138)
1 parent c841fac commit 51f5f4c

File tree

13 files changed

+570
-584
lines changed

13 files changed

+570
-584
lines changed

.eslintrc.js

+8-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
root: true,
33
parserOptions: {
44
parser: '@babel/eslint-parser',
5-
ecmaVersion: 8,
5+
ecmaVersion: 11,
66
ecmaFeatures: {
77
impliedStrict: true
88
},
@@ -25,29 +25,23 @@ module.exports = {
2525
},
2626
plugins: ['html', 'vue'],
2727
rules: {
28+
// Two spaces but disallow semicolons
29+
indent: ['error', 2, { 'SwitchCase': 1, 'ignoreComments': true }],
30+
semi: [2, 'never'],
31+
'no-return-await': 'error',
32+
'no-return-assign': 'error',
33+
'no-new': 'error',
2834
// allow paren-less arrow functions
2935
'arrow-parens': 'off',
30-
// allow async-await
31-
'generator-star-spacing': 'off',
3236
// allow console
3337
'no-console': 'off',
3438
// allow debugger during development
3539
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
36-
'no-return-assign': 'warn',
37-
'no-new': 'warn',
38-
// disallow semicolons
39-
semi: [2, 'never'],
4040
'require-atomic-updates': 'off',
4141
// TODO: fix these errors someday
4242
'prefer-const': 'off',
43-
'no-new': 'off',
4443
'no-mixed-operators': 'off',
45-
'no-prototype-builtins': 'off',
46-
'no-return-await': 'off',
47-
'accessor-pairs': 'off',
48-
// Workaround #2422.
49-
'template-curly-spacing': 'off',
50-
indent: 'off'
44+
'no-prototype-builtins': 'off'
5145
},
5246
settings: {
5347
'import/resolver': {

.github/workflows/build.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install Node.js
3434
uses: actions/setup-node@v2
3535
with:
36-
node-version: 14
36+
node-version: 16
3737
check-latest: true
3838
cache: yarn
3939
cache-dependency-path: yarn.lock
@@ -50,21 +50,21 @@ jobs:
5050
id: cacheNodeModules
5151
with:
5252
path: ${{ github.workspace }}/node_modules
53-
key: ${{ runner.os }}-node_modules-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
53+
key: ${{ runner.os }}-node_modules-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
5454
restore-keys: |
55-
${{ runner.os }}-node_modules-cache-
55+
${{ runner.os }}-node_modules-cache-v1-
5656
5757
- name: Cache Electron
5858
uses: actions/cache@v2
5959
with:
6060
path: ${{ env.HOME }}/.cache/electron
61-
key: ${{ runner.os }}-electron-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
61+
key: ${{ runner.os }}-electron-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
6262

6363
- name: Cache Electron-Builder
6464
uses: actions/cache@v2
6565
with:
6666
path: ${{ env.HOME }}/.cache//electron-builder
67-
key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
67+
key: ${{ runner.os }}-electron-builder-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
6868

6969
- name: Install dependencies
7070
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
@@ -100,7 +100,7 @@ jobs:
100100
- name: Install Node.js
101101
uses: actions/setup-node@v2
102102
with:
103-
node-version: 14
103+
node-version: 16
104104
check-latest: true
105105
cache: yarn
106106
cache-dependency-path: yarn.lock
@@ -118,21 +118,21 @@ jobs:
118118
id: cacheNodeModules
119119
with:
120120
path: ${{ github.workspace }}\node_modules
121-
key: ${{ runner.os }}-node_modules-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
121+
key: ${{ runner.os }}-node_modules-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
122122
restore-keys: |
123-
${{ runner.os }}-node_modules-cache-v1-
123+
${{ runner.os }}-node_modules-cache-v2-
124124
125125
- name: Cache Electron
126126
uses: actions/cache@v2
127127
with:
128128
path: ${{ env.LOCALAPPDATA }}\electron\Cache
129-
key: ${{ runner.os }}-electron-cache-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
129+
key: ${{ runner.os }}-electron-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
130130

131131
- name: Cache Electron-Builder
132132
uses: actions/cache@v2
133133
with:
134134
path: ${{ env.LOCALAPPDATA }}\electron-builder\cache
135-
key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
135+
key: ${{ runner.os }}-electron-builder-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
136136

137137
- name: Install dependencies
138138
# Windows worker fail sometimes because a module cannot be found.

.github/workflows/release.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install Node.js
2929
uses: actions/setup-node@v2
3030
with:
31-
node-version: 14
31+
node-version: 16
3232
check-latest: true
3333
cache: yarn
3434
cache-dependency-path: yarn.lock
@@ -44,21 +44,21 @@ jobs:
4444
uses: actions/cache@v2
4545
with:
4646
path: ${{ github.workspace }}/node_modules
47-
key: ${{ runner.os }}-node_modules-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
47+
key: ${{ runner.os }}-node_modules-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
4848
restore-keys: |
49-
${{ runner.os }}-node_modules-cache-v1-
49+
${{ runner.os }}-node_modules-cache-v2-
5050
5151
- name: Cache Electron
5252
uses: actions/cache@v2
5353
with:
5454
path: ${{ env.HOME }}/.cache/electron
55-
key: ${{ runner.os }}-electron-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
55+
key: ${{ runner.os }}-electron-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
5656

5757
- name: Cache Electron-Builder
5858
uses: actions/cache@v2
5959
with:
6060
path: ${{ env.HOME }}/.cache//electron-builder
61-
key: ${{ runner.os }}-electron-builder-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
61+
key: ${{ runner.os }}-electron-builder-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
6262

6363
- name: Install dependencies
6464
run: yarn install --check-files --frozen-lockfile
@@ -123,7 +123,7 @@ jobs:
123123
- name: Install Node.js
124124
uses: actions/setup-node@v2
125125
with:
126-
node-version: 14
126+
node-version: 16
127127
check-latest: true
128128
cache: yarn
129129
cache-dependency-path: yarn.lock
@@ -140,21 +140,21 @@ jobs:
140140
uses: actions/cache@v2
141141
with:
142142
path: ${{ github.workspace }}\node_modules
143-
key: ${{ runner.os }}-node_modules-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
143+
key: ${{ runner.os }}-node_modules-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
144144
restore-keys: |
145-
${{ runner.os }}-node_modules-cache-v1-
145+
${{ runner.os }}-node_modules-cache-v2-
146146
147147
- name: Cache Electron
148148
uses: actions/cache@v2
149149
with:
150150
path: ${{ env.LOCALAPPDATA }}\electron\Cache
151-
key: ${{ runner.os }}-electron-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
151+
key: ${{ runner.os }}-electron-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
152152

153153
- name: Cache Electron-Builder
154154
uses: actions/cache@v2
155155
with:
156156
path: ${{ env.LOCALAPPDATA }}\electron-builder\cache
157-
key: ${{ runner.os }}-electron-builder-cache-v1-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
157+
key: ${{ runner.os }}-electron-builder-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
158158

159159
- name: Install dependencies
160160
run: yarn install --check-files --frozen-lockfile

package.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
"deobfuscateStackTrace": "node tools/deobfuscateStackTrace.js"
3535
},
3636
"dependencies": {
37-
"@electron/remote": "^2.0.4",
37+
"@electron/remote": "^2.0.8",
3838
"@hfelix/electron-localshortcut": "^4.0.1",
3939
"@hfelix/electron-spellchecker": "^2.0.0",
4040
"@marktext/file-icons": "^1.0.6",
4141
"@octokit/rest": "^18.12.0",
4242
"arg": "^5.0.1",
43-
"axios": "^0.26.0",
43+
"axios": "^0.26.1",
4444
"ced": "^2.0.0",
4545
"chokidar": "^3.5.3",
46-
"codemirror": "^5.65.1",
46+
"codemirror": "^5.65.2",
4747
"command-exists": "^1.2.9",
48-
"dayjs": "^1.10.7",
48+
"dayjs": "^1.11.0",
4949
"dom-autoscroller": "^2.3.4",
5050
"dompurify": "^2.3.6",
5151
"dragula": "^3.7.3",
@@ -64,11 +64,11 @@
6464
"iconv-lite": "^0.6.3",
6565
"iso-639-1": "^2.1.13",
6666
"joplin-turndown-plugin-gfm": "^1.0.12",
67-
"katex": "^0.15.2",
67+
"katex": "^0.15.3",
6868
"keytar": "^7.9.0",
6969
"mermaid": "^8.14.0",
7070
"minizlib": "^2.1.2",
71-
"native-keymap": "^3.2.1",
71+
"native-keymap": "^3.3.0",
7272
"plist": "^3.0.4",
7373
"popper.js": "^1.16.1",
7474
"prismjs": "^1.27.0",
@@ -78,7 +78,7 @@
7878
"turndown": "^7.1.1",
7979
"underscore": "^1.13.2",
8080
"unsplash-js": "^7.0.15",
81-
"vega": "^5.21.0",
81+
"vega": "^5.22.0",
8282
"vega-embed": "^6.20.8",
8383
"vega-lite": "^5.2.0",
8484
"vscode-ripgrep": "^1.12.1",
@@ -89,7 +89,7 @@
8989
"webfontloader": "^1.6.28"
9090
},
9191
"devDependencies": {
92-
"@babel/core": "^7.17.5",
92+
"@babel/core": "^7.17.7",
9393
"@babel/eslint-parser": "^7.17.0",
9494
"@babel/plugin-proposal-class-properties": "^7.16.7",
9595
"@babel/plugin-proposal-export-default-from": "^7.16.7",
@@ -98,10 +98,10 @@
9898
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
9999
"@babel/plugin-transform-runtime": "^7.17.0",
100100
"@babel/preset-env": "^7.16.11",
101-
"@babel/register": "^7.17.0",
102-
"@babel/runtime": "^7.17.2",
103-
"@markedjs/html-differ": "^4.0.0",
104-
"@playwright/test": "^1.19.1",
101+
"@babel/register": "^7.17.7",
102+
"@babel/runtime": "^7.17.7",
103+
"@markedjs/html-differ": "^4.0.1",
104+
"@playwright/test": "^1.20.0",
105105
"babel-loader": "^8.2.3",
106106
"babel-plugin-component": "^1.1.1",
107107
"babel-plugin-istanbul": "^6.1.1",
@@ -111,16 +111,16 @@
111111
"cheerio": "^1.0.0-rc.10",
112112
"copy-webpack-plugin": "^10.2.4",
113113
"cross-env": "^7.0.3",
114-
"css-loader": "^6.6.0",
114+
"css-loader": "^6.7.1",
115115
"del": "^6.0.0",
116116
"devtron": "^1.4.0",
117-
"dotenv": "^10.0.0",
118-
"electron": "^15.4.0",
117+
"dotenv": "^16.0.0",
118+
"electron": "^17.1.2",
119119
"electron-builder": "^22.14.13",
120120
"electron-devtools-installer": "^3.2.0",
121121
"electron-rebuild": "^3.2.7",
122122
"electron-updater": "^4.6.5",
123-
"eslint": "^8.9.0",
123+
"eslint": "^8.11.0",
124124
"eslint-config-standard": "^16.0.3",
125125
"eslint-friendly-formatter": "^4.0.1",
126126
"eslint-import-resolver-alias": "^1.1.2",
@@ -129,14 +129,14 @@
129129
"eslint-plugin-node": "^11.1.0",
130130
"eslint-plugin-promise": "^6.0.0",
131131
"eslint-plugin-standard": "^4.1.0",
132-
"eslint-plugin-vue": "^8.4.1",
132+
"eslint-plugin-vue": "^8.5.0",
133133
"eslint-webpack-plugin": "^3.1.1",
134134
"esm": "^3.2.25",
135135
"file-loader": "^6.2.0",
136136
"git-revision-webpack-plugin": "^5.0.0",
137137
"html-webpack-plugin": "^5.5.0",
138138
"imports-loader": "^0.8.0",
139-
"karma": "^6.3.16",
139+
"karma": "^6.3.17",
140140
"karma-chai": "^0.1.0",
141141
"karma-coverage": "^2.2.0",
142142
"karma-electron": "^7.1.0",
@@ -147,15 +147,15 @@
147147
"license-checker": "^25.0.1",
148148
"listr": "^0.14.3",
149149
"marked": "^1.2.9",
150-
"mini-css-extract-plugin": "^2.5.3",
151-
"mocha": "^8.4.0",
152-
"node-fetch": "^2.6.6",
150+
"mini-css-extract-plugin": "^2.6.0",
151+
"mocha": "^9.2.2",
152+
"node-fetch": "^2.6.7",
153153
"node-loader": "^2.0.0",
154154
"path-browserify": "^1.0.1",
155-
"playwright": "^1.19.1",
156-
"postcss": "^8.4.6",
155+
"playwright": "^1.20.0",
156+
"postcss": "^8.4.12",
157157
"postcss-loader": "^6.2.1",
158-
"postcss-preset-env": "^7.4.1",
158+
"postcss-preset-env": "^7.4.2",
159159
"raw-loader": "^4.0.2",
160160
"require-dir": "^1.2.0",
161161
"stacktrace-parser": "^0.1.10",
@@ -169,7 +169,7 @@
169169
"vue-loader": "^15.9.8",
170170
"vue-style-loader": "^4.1.3",
171171
"vue-template-compiler": "^2.6.14",
172-
"webpack": "^5.69.1",
172+
"webpack": "^5.70.0",
173173
"webpack-bundle-analyzer": "^4.5.0",
174174
"webpack-cli": "^4.9.2",
175175
"webpack-dev-server": "^4.7.4",
@@ -178,7 +178,7 @@
178178
},
179179
"resolutions": {
180180
"cld": "^2.7.1",
181-
"node-abi": "^3.5.0"
181+
"node-abi": "^3.8.0"
182182
},
183183
"repository": {
184184
"type": "git",

src/main/app/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ class App {
579579

580580
ipcMain.handle('mt::keybinding-save-user-keybindings', async (event, userKeybindings) => {
581581
const { keybindings } = this._accessor
582-
return await keybindings.setUserKeybindings(userKeybindings)
582+
return keybindings.setUserKeybindings(userKeybindings)
583583
})
584584
}
585585
}

src/muya/lib/parser/render/renderInlines/htmlRuby.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ export default function htmlRuby (h, cursor, block, token, outerClass) {
1111
const previewSelector = `span.${CLASS_OR_ID.AG_RUBY_RENDER}`
1212

1313
return children
14-
? [
15-
h(`span.${className}.${CLASS_OR_ID.AG_RUBY}`, [
16-
h(`span.${CLASS_OR_ID.AG_INLINE_RULE}.${CLASS_OR_ID.AG_RUBY_TEXT}`, content),
17-
h(previewSelector, {
18-
attrs: {
19-
contenteditable: 'false',
20-
spellcheck: 'false'
21-
}
22-
}, vNode)
23-
])
14+
? [
15+
h(`span.${className}.${CLASS_OR_ID.AG_RUBY}`, [
16+
h(`span.${CLASS_OR_ID.AG_INLINE_RULE}.${CLASS_OR_ID.AG_RUBY_TEXT}`, content),
17+
h(previewSelector, {
18+
attrs: {
19+
contenteditable: 'false',
20+
spellcheck: 'false'
21+
}
22+
}, vNode)
23+
])
2424
// if children is empty string, no need to render ruby charactors...
25-
]
26-
: [
27-
h(`span.${className}.${CLASS_OR_ID.AG_RUBY}`, [
28-
h(`span.${CLASS_OR_ID.AG_INLINE_RULE}.${CLASS_OR_ID.AG_RUBY_TEXT}`, content)
29-
])
30-
]
25+
]
26+
: [
27+
h(`span.${className}.${CLASS_OR_ID.AG_RUBY}`, [
28+
h(`span.${CLASS_OR_ID.AG_INLINE_RULE}.${CLASS_OR_ID.AG_RUBY_TEXT}`, content)
29+
])
30+
]
3131
}

src/renderer/commands/quickOpen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class QuickOpenCommand {
4545
}
4646

4747
await timeout
48-
return await this._doSearch(query)
48+
return this._doSearch(query)
4949
}
5050

5151
run = async () => {

src/renderer/components/editorWithTabs/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default {
6464
SourceCode,
6565
TabNotifications
6666
},
67-
computed: {
67+
computed: {
6868
...mapState({
6969
showSideBar: state => state.layout.showSideBar,
7070
sideBarWidth: state => state.layout.sideBarWidth

0 commit comments

Comments
 (0)