diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 205d790fdf29cd6b4f0f082109726bf681230ffc..0e40ac9eefdb20116070ee16dbff342b87ad0ba0 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -70,7 +70,7 @@ jobs: uses: ./.github/actions/prepare-backend with: m2-cache-key: 'cljs' - - run: yarn build-quick:cljs + - run: yarn build:cljs name: Compile CLJS - run: yarn type-check name: Check types diff --git a/bin/build/src/build.clj b/bin/build/src/build.clj index f8bb3a595c0855c26463bdd73a1f860ca22f4e50..7ac75e327f615fb42d876e5f155e7c2f414f4e29 100644 --- a/bin/build/src/build.clj +++ b/bin/build/src/build.clj @@ -37,7 +37,7 @@ "HOME" (env/env :user-home) "WEBPACK_BUNDLE" "production" "MB_EDITION" mb-edition}} - "yarn" "build")) + "yarn" "build-release")) (u/step "Build static viz" (u/sh {:dir u/project-root-directory :env {"PATH" (env/env :path) diff --git a/package.json b/package.json index a177c0c199d6cff68ccdcb8665fb5380f46dec6e..f528fd3a20de68ca1313cc4befbbf559fdaba3fb 100644 --- a/package.json +++ b/package.json @@ -281,26 +281,27 @@ "concurrently": "yarn && concurrently --kill-others -p name", "dev": "yarn concurrently -n 'backend,frontend,cljs,static-viz' -c 'blue,green,yellow,magenta,red' 'clojure -M:run' 'yarn build-hot:js' 'yarn build-hot:cljs' 'yarn build-static-viz:watch'", "dev-ee": "yarn concurrently -n 'backend,frontend,cljs,static-viz' -c 'blue,green,yellow,magenta,red' 'clojure -M:run:ee' 'MB_EDITION=ee yarn build-hot:js' 'MB_EDITION=ee yarn build-hot:cljs' 'yarn build-static-viz:watch'", - "type-check": "rm -rf frontend/src/{cljs,cljs_release} && yarn build-quick:cljs && tsc --noEmit", + "type-check": "rm -rf frontend/src/{cljs,cljs_release} && yarn build:cljs && tsc --noEmit", "remove-webpack-cache": "rm -rf ./node_modules/.cache", "lint": "yarn lint-eslint && yarn lint-prettier && yarn lint-docs-links && yarn lint-yaml && yarn type-check", - "lint-eslint": "yarn build-quick:cljs && eslint --ext .js,.jsx,.ts,.tsx --rulesdir frontend/lint/eslint-rules --max-warnings 0 enterprise/frontend/src frontend/src frontend/test e2e/test", + "lint-eslint": "yarn build:cljs && eslint --ext .js,.jsx,.ts,.tsx --rulesdir frontend/lint/eslint-rules --max-warnings 0 enterprise/frontend/src frontend/src frontend/test e2e/test", "lint-prettier": "yarn && prettier -l '{enterprise/,}frontend/**/*.{js,jsx,ts,tsx,css}' || (echo '\nThese files are not formatted correctly. Did you forget to \"yarn prettier\"?' && false)", "lint-docs-links": "yarn && ./bin/verify-doc-links", "lint-yaml": "yamllint **/*.{yaml,yml} --ignore=node_modules/**/*.{yaml,yml}", "test": "yarn test-unit && yarn test-timezones && yarn test-cypress", - "test-debug": "yarn build-quick:cljs && node --inspect-brk node_modules/.bin/jest --runInBand --detectOpenHandles --config jest.unit.conf.json", - "test-unit": "yarn build-quick:cljs && jest --maxWorkers=2 --config jest.unit.conf.json", + "test-debug": "yarn build:cljs && node --inspect-brk node_modules/.bin/jest --runInBand --detectOpenHandles --config jest.unit.conf.json", + "test-unit": "yarn build:cljs && jest --maxWorkers=2 --config jest.unit.conf.json", "test-unit-keep-cljs": "jest --maxWorkers=2 --config jest.unit.conf.json", "test-unit-watch": "yarn test-unit --watch", "test-unit-watch:cljs": "yarn concurrently -n 'cljs,tests' 'yarn build-watch:cljs' 'yarn test-unit-keep-cljs --watch'", - "test-timezones-unit": "yarn build-quick:cljs && jest --silent --maxWorkers=2 --config jest.tz.unit.conf.json", + "test-timezones-unit": "yarn build:cljs && jest --silent --maxWorkers=2 --config jest.tz.unit.conf.json", "test-timezones": "yarn && ./frontend/test/__runner__/run_timezone_tests", "build:js": "yarn && webpack --bail", "build-watch:js": "yarn && webpack --watch", "build-hot:js": "yarn && NODE_OPTIONS=--max-old-space-size=8096 WEBPACK_BUNDLE=hot webpack serve --host 0.0.0.0", - "build:cljs": "yarn && rm -rf frontend/src/cljs_release/* && shadow-cljs release app", - "build-quick:cljs": "yarn && rm -rf frontend/src/cljs/* && shadow-cljs compile app", + "build-release:js": "yarn && WEBPACK_BUNDLE=production webpack --bail", + "build-release:cljs": "yarn && rm -rf frontend/src/cljs_release/* && shadow-cljs release app", + "build:cljs": "yarn && rm -rf frontend/src/cljs/* && shadow-cljs compile app", "build-watch:cljs": "yarn && shadow-cljs watch app", "build-hot:cljs": "yarn && shadow-cljs watch app", "cljs-server-start": "yarn && shadow-cljs start", @@ -311,9 +312,10 @@ "build": "yarn build:cljs && yarn build:js", "build-watch": "yarn concurrently -n 'cljs,js' 'yarn build-watch:cljs' 'yarn build-watch:js'", "build-hot": "yarn concurrently -n 'cljs,js' 'yarn build-hot:cljs' 'yarn build-hot:js'", + "build-release": "yarn build-release:cljs && yarn build-release:js", "build-stats": "yarn && webpack --json > stats.json", "build-shared": "yarn && webpack --config webpack.shared.config.js", - "build-static-viz": "yarn && yarn build:cljs && webpack --config webpack.static-viz.config.js", + "build-static-viz": "yarn && yarn build-release:cljs && webpack --config webpack.static-viz.config.js", "build-static-viz:watch": "webpack --config webpack.static-viz.config.js --watch", "precommit": "lint-staged", "preinstall": "echo $npm_execpath | grep -q yarn || echo '\\033[0;33mSorry, npm is not supported. Please use Yarn (https://yarnpkg.com/).\\033[0m'", @@ -337,8 +339,8 @@ "test-visual": "yarn build && ./bin/build-for-test && yarn test-visual-run", "prepare": "husky install", "storybook": "yarn build:cljs && start-storybook -p 6006", - "build-storybook": "yarn build-quick:cljs && build-storybook", - "chromatic": "yarn build-quick:cljs && chromatic", + "build-storybook": "yarn build:cljs && build-storybook", + "chromatic": "yarn build:cljs && chromatic", "docs-lint-links": "find docs -type f -name '*.md' -print0 | xargs -0 markdown-link-check --quiet --config .mlc_config.json" }, "lint-staged": {