aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--electron-builder.env1
-rw-r--r--gulpfile.babel.js40
-rw-r--r--package.json4
-rw-r--r--packages/forms/package.json2
-rw-r--r--packages/theme/package.json2
-rw-r--r--packages/ui/package.json2
-rw-r--r--scripts/postinstall.js8
-rw-r--r--scripts/prepare.js6
8 files changed, 44 insertions, 21 deletions
diff --git a/electron-builder.env b/electron-builder.env
new file mode 100644
index 000000000..b034f3fb7
--- /dev/null
+++ b/electron-builder.env
@@ -0,0 +1 @@
BUNDLING=true
diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index f87958a77..21b2e3d3b 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -149,6 +149,12 @@ export function mvLernaPackages() {
149 return gulp.src(['packages/**']).pipe(gulp.dest(`${paths.dest}/packages`)); 149 return gulp.src(['packages/**']).pipe(gulp.dest(`${paths.dest}/packages`));
150} 150}
151 151
152export function mvPostinstallScript() {
153 return gulp
154 .src(['./scripts/postinstall.js'])
155 .pipe(gulp.dest(`${paths.dest}/scripts`));
156}
157
152export function exportBuildInfo() { 158export function exportBuildInfo() {
153 const buildInfoData = { 159 const buildInfoData = {
154 timestamp: buildInfo.timestamp, 160 timestamp: buildInfo.timestamp,
@@ -208,12 +214,7 @@ export function styles() {
208 214
209export function processJavascripts() { 215export function processJavascripts() {
210 return gulp 216 return gulp
211 .src( 217 .src([paths.javascripts.src], { since: gulp.lastRun(processJavascripts) })
212 [
213 paths.javascripts.src,
214 ],
215 { since: gulp.lastRun(processJavascripts) },
216 )
217 .pipe( 218 .pipe(
218 babel({ 219 babel({
219 comments: false, 220 comments: false,
@@ -226,15 +227,9 @@ export function processJavascripts() {
226 227
227export function processTypescripts() { 228export function processTypescripts() {
228 return gulp 229 return gulp
229 .src( 230 .src([paths.typescripts.src], { since: gulp.lastRun(processTypescripts) })
230 [
231 paths.typescripts.src,
232 ],
233 { since: gulp.lastRun(processTypescripts) },
234 )
235 .pipe(tsProject()) 231 .pipe(tsProject())
236 .js 232 .js.pipe(
237 .pipe(
238 babel({ 233 babel({
239 comments: false, 234 comments: false,
240 }), 235 }),
@@ -275,8 +270,21 @@ export function recipeInfo() {
275 270
276const build = gulp.series( 271const build = gulp.series(
277 clean, 272 clean,
278 gulp.parallel(mvSrc, mvPackageJson, mvLernaPackages, exportBuildInfo), 273 gulp.parallel(
279 gulp.parallel(html, processJavascripts, processTypescripts, styles, recipes, recipeInfo), 274 mvSrc,
275 mvPackageJson,
276 mvLernaPackages,
277 mvPostinstallScript,
278 exportBuildInfo,
279 ),
280 gulp.parallel(
281 html,
282 processJavascripts,
283 processTypescripts,
284 styles,
285 recipes,
286 recipeInfo,
287 ),
280); 288);
281export { build }; 289export { build };
282 290
diff --git a/package.json b/package.json
index 8d6b61fd4..b1cde30db 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
17 }, 17 },
18 "engine-strict": true, 18 "engine-strict": true,
19 "scripts": { 19 "scripts": {
20 "prepare": "husky install", 20 "prepare": "node scripts/prepare.js",
21 "start": "electron ./build", 21 "start": "electron ./build",
22 "start:local": "cross-env USE_LOCAL_API=1 npm start", 22 "start:local": "cross-env USE_LOCAL_API=1 npm start",
23 "start:live": "cross-env USE_LIVE_API=1 npm start", 23 "start:live": "cross-env USE_LIVE_API=1 npm start",
@@ -35,7 +35,7 @@
35 "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"", 35 "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"",
36 "packages": "npx lerna publish --no-git-tag-version", 36 "packages": "npx lerna publish --no-git-tag-version",
37 "uidev": "cd uidev && webpack-dev-server", 37 "uidev": "cd uidev && webpack-dev-server",
38 "postinstall": "npx lerna run prepare", 38 "postinstall": "node scripts/postinstall.js",
39 "apply-branding": "node ./src/i18n/apply-branding.js", 39 "apply-branding": "node ./src/i18n/apply-branding.js",
40 "update-submodules": "git submodule update --remote --force", 40 "update-submodules": "git submodule update --remote --force",
41 "prepare-code": "npm run lint && npm run reformat-files && npm run manage-translations && npm run apply-branding", 41 "prepare-code": "npm run lint && npm run reformat-files && npm run manage-translations && npm run apply-branding",
diff --git a/packages/forms/package.json b/packages/forms/package.json
index 29ccc3f25..5676ed6c3 100644
--- a/packages/forms/package.json
+++ b/packages/forms/package.json
@@ -5,7 +5,7 @@
5 "main": "lib/index.js", 5 "main": "lib/index.js",
6 "scripts": { 6 "scripts": {
7 "dev": "tsc -w", 7 "dev": "tsc -w",
8 "prepare": "tsc" 8 "build": "tsc"
9 }, 9 },
10 "publishConfig": { 10 "publishConfig": {
11 "access": "public" 11 "access": "public"
diff --git a/packages/theme/package.json b/packages/theme/package.json
index 7e3c4722d..516bab93c 100644
--- a/packages/theme/package.json
+++ b/packages/theme/package.json
@@ -15,7 +15,7 @@
15 }, 15 },
16 "scripts": { 16 "scripts": {
17 "dev": "tsc -w", 17 "dev": "tsc -w",
18 "prepare": "tsc", 18 "build": "tsc",
19 "preprepare": "npm run test", 19 "preprepare": "npm run test",
20 "test": "npx mocha" 20 "test": "npx mocha"
21 }, 21 },
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 2b24803f5..23af393f5 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -5,7 +5,7 @@
5 "main": "lib/index.js", 5 "main": "lib/index.js",
6 "scripts": { 6 "scripts": {
7 "dev": "tsc -w", 7 "dev": "tsc -w",
8 "prepare": "tsc" 8 "build": "tsc"
9 }, 9 },
10 "publishConfig": { 10 "publishConfig": {
11 "access": "public" 11 "access": "public"
diff --git a/scripts/postinstall.js b/scripts/postinstall.js
new file mode 100644
index 000000000..84e7492ef
--- /dev/null
+++ b/scripts/postinstall.js
@@ -0,0 +1,8 @@
1const { exec } = require('child_process');
2
3// eslint-disable-next-line no-console
4const log = (err, stdout, stderr) => console.log(err || stdout || stderr);
5
6if (!process.env.BUNDLING) {
7 exec('npx lerna run build', log);
8}
diff --git a/scripts/prepare.js b/scripts/prepare.js
new file mode 100644
index 000000000..0b4daa82b
--- /dev/null
+++ b/scripts/prepare.js
@@ -0,0 +1,6 @@
1const isDev = process.env.NODE_ENV === 'development';
2
3if (isDev) {
4 // eslint-disable-next-line global-require
5 require('husky').install();
6}