diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-12 11:10:37 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-12 11:10:37 +0100 |
commit | 73308038ab9fd2e04973b45a0ed250a42bb543ad (patch) | |
tree | 0318fdc2f2a323efdda99e8f394875930b7a2b0d | |
parent | Improve loader themeing (diff) | |
download | ferdium-app-73308038ab9fd2e04973b45a0ed250a42bb543ad.tar.gz ferdium-app-73308038ab9fd2e04973b45a0ed250a42bb543ad.tar.zst ferdium-app-73308038ab9fd2e04973b45a0ed250a42bb543ad.zip |
Simplify dictionary step
-rwxr-xr-x | build-helpers/installDictionaries.js | 24 | ||||
-rw-r--r-- | gulpfile.babel.js | 18 | ||||
-rw-r--r-- | package-lock.json | 2 | ||||
-rw-r--r-- | package.json | 6 |
4 files changed, 21 insertions, 29 deletions
diff --git a/build-helpers/installDictionaries.js b/build-helpers/installDictionaries.js deleted file mode 100755 index 8d209356e..000000000 --- a/build-helpers/installDictionaries.js +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
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`); | ||
diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 2ab3f47b1..e732f991a 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js | |||
@@ -25,6 +25,7 @@ const paths = { | |||
25 | src: 'src', | 25 | src: 'src', |
26 | dest: 'build', | 26 | dest: 'build', |
27 | tmp: '.tmp', | 27 | tmp: '.tmp', |
28 | dictionaries: 'build/dictionaries', | ||
28 | package: `out/${config.version}`, | 29 | package: `out/${config.version}`, |
29 | html: { | 30 | html: { |
30 | src: 'src/**/*.html', | 31 | src: 'src/**/*.html', |
@@ -132,13 +133,30 @@ export function webserver() { | |||
132 | })); | 133 | })); |
133 | } | 134 | } |
134 | 135 | ||
136 | export function dictionaries(done) { | ||
137 | const { SPELLCHECKER_LOCALES } = require('./build/i18n/languages'); | ||
138 | |||
139 | let packages = ''; | ||
140 | Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; }); | ||
141 | |||
142 | _shell(` | ||
143 | rm -rf ${paths.dictionaries} | ||
144 | npm install --prefix ${paths.dictionaries} ${packages} | ||
145 | mv ${paths.dictionaries}/node_modules/* ${paths.dictionaries} | ||
146 | rm -rf ${paths.dictionaries}/node_modules ${paths.dictionaries}/package-lock.json`, | ||
147 | done, | ||
148 | ); | ||
149 | } | ||
150 | |||
135 | export function sign(done) { | 151 | export function sign(done) { |
136 | _shell(`codesign --verbose=4 --deep --strict --force --sign "${process.env.SIGNING_IDENTITY}" "${__dirname}/node_modules/electron/dist/Electron.app"`, done); | 152 | _shell(`codesign --verbose=4 --deep --strict --force --sign "${process.env.SIGNING_IDENTITY}" "${__dirname}/node_modules/electron/dist/Electron.app"`, done); |
137 | } | 153 | } |
138 | 154 | ||
139 | const build = gulp.series( | 155 | const build = gulp.series( |
156 | clean, | ||
140 | gulp.parallel(mvSrc, mvPackageJson), | 157 | gulp.parallel(mvSrc, mvPackageJson), |
141 | gulp.parallel(html, scripts, styles), | 158 | gulp.parallel(html, scripts, styles), |
159 | dictionaries, | ||
142 | ); | 160 | ); |
143 | export { build }; | 161 | export { build }; |
144 | 162 | ||
diff --git a/package-lock.json b/package-lock.json index abd4f9266..16fe71944 100644 --- a/package-lock.json +++ b/package-lock.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "name": "franz", | 2 | "name": "franz", |
3 | "version": "5.0.0-beta.20", | 3 | "version": "5.0.0-beta.21", |
4 | "lockfileVersion": 1, | 4 | "lockfileVersion": 1, |
5 | "requires": true, | 5 | "requires": true, |
6 | "dependencies": { | 6 | "dependencies": { |
diff --git a/package.json b/package.json index 447aebd8b..551727ca9 100644 --- a/package.json +++ b/package.json | |||
@@ -17,14 +17,12 @@ | |||
17 | "dev": "cross-env NODE_ENV=development gulp dev", | 17 | "dev": "cross-env NODE_ENV=development gulp dev", |
18 | "lint": "eslint src", | 18 | "lint": "eslint src", |
19 | "sign": "gulp sign", | 19 | "sign": "gulp sign", |
20 | "compile": "gulp clean && gulp build", | 20 | "prebuild": "gulp build", |
21 | "prebuild": "npm run compile && npm run dictionaries", | ||
22 | "build": "node_modules/.bin/electron-builder --publish onTag", | 21 | "build": "node_modules/.bin/electron-builder --publish onTag", |
23 | "rebuild": "node_modules/.bin/electron-rebuild", | 22 | "rebuild": "node_modules/.bin/electron-rebuild", |
24 | "commit": "git-cz", | 23 | "commit": "git-cz", |
25 | "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", | 24 | "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", |
26 | "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"", | 25 | "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"" |
27 | "dictionaries": "node ./build-helpers/installDictionaries.js" | ||
28 | }, | 26 | }, |
29 | "keywords": [], | 27 | "keywords": [], |
30 | "author": "Stefan Malzner <stefan@adlk.io>", | 28 | "author": "Stefan Malzner <stefan@adlk.io>", |