Skip to content

Commit 603ed04

Browse files
fxhaJocs
authored andcommitted
Add experimental spellchecker (marktext#1424)
* Experimental spellchecker for testing purpose * Fix 'apache' license validation * Use local electron-spellchecker for development * Add settings and bug fixes * Fix Hunspell switchLanguage bug and improvements * Fix attach to editor when enabling spell check again * Add Hunspell license * Copy default Huspell dictionary on first start * Fix full language name * Some code improvements * Allow to add words to user dict and bug fixes * Allow to change Muya's spellcheck container attribute * feat: Don't underline misspelled words * Allow to set Hunspell on macOS * Fix spellchecker changed value * Refactor switchLanguage, init and enableSpellchecker * Refactor and some fixes * Code improvements * electron-spellchecker cleanup and optimization * Disable automatic language detection for Hunspell * Fix init on macOS and update JSDoc * Fix macOS issues and some improvements * Load single settings value only * Fix rebase * Remove debug code * Move electron-spellchecker to scoped npm repo * Fix dictionary of ignored words on macOS * Move replaceWordInline to core API * Remove comment block * Fix upstream lint error
1 parent 1b9ee78 commit 603ed04

46 files changed

Lines changed: 5516 additions & 946 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.electron-vue/thirdPartyChecker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const getLicenses = (rootDir, callback) => {
1010
direct: true,
1111
excludePackages: 'xmldom@0.1.27', // xmldom@0.1.27 is under MIT License, but license-checker show it's under LGPL License.
1212
json: true,
13-
onlyAllow: 'Unlicense;WTFPL;ISC;MIT;BSD;ISC;Apache-2.0;MIT*;Apache*;BSD*;CC0-1.0;CC-BY-4.0;CC-BY-3.0',
13+
onlyAllow: 'Unlicense;WTFPL;ISC;MIT;BSD;ISC;Apache-2.0;MIT*;Apache;Apache*;BSD*;CC0-1.0;CC-BY-4.0;CC-BY-3.0',
1414
customPath: {
1515
licenses: '',
1616
licenseText: 'none'

electron-builder.yml

100644100755
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,31 @@ files:
1818
- "!node_modules/terser/dist/bundle.min.js.map"
1919
- "!node_modules/vega-lite/build/vega-lite*.js.map"
2020
# Don't bundle build files
21+
- "!node_modules/@felixrieseberg/spellchecker/bin"
22+
- "!node_modules/ced/bin"
23+
- "!node_modules/ced/vendor"
24+
- "!node_modules/cld/bin"
25+
- "!node_modules/cld/deps"
2126
- "!node_modules/fontmanager-redux/bin"
2227
- "!node_modules/keyboard-layout/bin"
2328
- "!node_modules/keytar/bin"
2429
- "!node_modules/vscode-windows-registry/bin"
30+
# Don't bundle Windows build files
31+
- "!node_modules/**/{*.vcxproj,*.vcxproj.filters}"
32+
- "!node_modules/**/build/Release/{*.lib,*.exp,*.ilk,*.pdb}"
33+
- "!node_modules/**/build/Release/obj"
34+
- "!node_modules/ced/build/vendor"
35+
# Don't bundle LGPL source files
36+
- "!node_modules/@felixrieseberg/spellchecker/vendor"
2537
extraFiles:
2638
- "LICENSE"
2739
- from: "resources/THIRD-PARTY-LICENSES.txt"
2840
to: "THIRD-PARTY-LICENSES.txt"
41+
extraResources:
42+
- from: "resources/hunspell_dictionaries/"
43+
to: "hunspell_dictionaries/"
44+
filter:
45+
- "!**/LICENSE-hunspell.txt"
2946

3047
fileAssociations:
3148
- ext:

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build:bin": "node .electron-vue/build.js && electron-builder --dir",
1515
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
1616
"build:dev": "node .electron-vue/build.js",
17-
"dev": "node .electron-vue/dev-runner.js",
17+
"dev": "cross-env node .electron-vue/dev-runner.js",
1818
"e2e": "yarn run pack && cross-env MARKTEXT_EXIT_ON_ERROR=1 mocha --timeout 10000 test/e2e",
1919
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test",
2020
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test",
@@ -28,12 +28,13 @@
2828
"preinstall": "node .electron-vue/preinstall.js",
2929
"build:muya": "cd src/muya && webpack --progress --colors --config webpack.config.js",
3030
"release:muya": "yarn run build:muya && cd src/muya && yarn publish",
31-
"rebuild": "electron-rebuild -f -o fontmanager-redux,keytar,keyboard-layout,vscode-windows-registry",
31+
"rebuild": "electron-rebuild -f",
3232
"gen-third-party": "node tools/generateThirdPartyLicense.js",
3333
"validate-licenses": "node tools/validateLicenses.js"
3434
},
3535
"dependencies": {
3636
"@hfelix/electron-localshortcut": "^3.1.1",
37+
"@hfelix/electron-spellchecker": "^1.0.0-rc.1",
3738
"@octokit/rest": "^16.33.1",
3839
"arg": "^4.1.1",
3940
"axios": "^0.19.0",
@@ -60,6 +61,7 @@
6061
"github-markdown-css": "^3.0.1",
6162
"html-tags": "^3.0.0",
6263
"iconv-lite": "^0.5.0",
64+
"iso-639-1": "^2.1.0",
6365
"joplin-turndown-plugin-gfm": "^1.0.11",
6466
"katex": "^0.11.1",
6567
"keyboard-layout": "^2.0.16",

0 commit comments

Comments
 (0)