Skip to content

Commit 0cdc165

Browse files
committed
fix(Spellchecker): Dictionaries are now part of app instead of dynamic download
1 parent ed1554f commit 0cdc165

9 files changed

+370
-644
lines changed

build-helpers/installDictionaries.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const { execSync } = require('child_process');
2+
const { SPELLCHECKER_LOCALES } = require('../build/i18n/languages');
3+
4+
const path = './build/dictionaries';
5+
6+
let packages = '';
7+
Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; });
8+
9+
function exec(cmd) {
10+
execSync(cmd,
11+
(error, stdout, stderr) => {
12+
console.log(`stdout: ${stdout}`);
13+
console.log(`stderr: ${stderr}`);
14+
if (error !== null) {
15+
console.log(`exec error: ${error}`);
16+
}
17+
});
18+
}
19+
20+
exec(`
21+
rm -rf ${path}
22+
npm install --prefix ${path} ${packages}
23+
mv ${path}/node_modules/* ${path}
24+
rm -rf ${path}/node_modules ${path}/package-lock.json`);

electron-builder.yml

+2
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ nsis:
4242
protocols:
4343
name: Franz
4444
schemes: [franz]
45+
46+
asarUnpack: "./dictionaries"

gulpfile.babel.js

-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export function sign(done) {
137137
}
138138

139139
const build = gulp.series(
140-
clean,
141140
gulp.parallel(mvSrc, mvPackageJson),
142141
gulp.parallel(html, scripts, styles),
143142
);

0 commit comments

Comments
 (0)