Shared CLJ/CLJS lib (#14980)
* Shared CLJ/CLJS lib (PoC/WIP) * PoC 2.0 * Fixes* More test fixes * Bump shadow-cljs version * Fix more stuff * Need to ^:export the exports * CI fixes * Add eslintignore * Ignore cljs files for FE code coverage * Try prefixing CLJS -> JS import with goog: * Revert indentation change * No goog: * Add .prettierignore * Use advanced build for now for JS tests unit we can figure out how to make it work
Showing
- .circleci/config.yml 2 additions, 2 deletions.circleci/config.yml
- .eslintignore 1 addition, 0 deletions.eslintignore
- .github/workflows/frontend.yml 1 addition, 0 deletions.github/workflows/frontend.yml
- .gitignore 2 additions, 1 deletion.gitignore
- .prettierignore 1 addition, 0 deletions.prettierignore
- bin/build-mb/src/build.clj 9 additions, 0 deletionsbin/build-mb/src/build.clj
- frontend/src/metabase/lib/types.js 2 additions, 42 deletionsfrontend/src/metabase/lib/types.js
- jest.unit.conf.json 2 additions, 1 deletionjest.unit.conf.json
- package.json 17 additions, 8 deletionspackage.json
- project.clj 4 additions, 4 deletionsproject.clj
- shadow-cljs.edn 12 additions, 0 deletionsshadow-cljs.edn
- shared/src/metabase/shared/util.cljc 14 additions, 0 deletionsshared/src/metabase/shared/util.cljc
- shared/src/metabase/types.cljc 17 additions, 2 deletionsshared/src/metabase/types.cljc
- src/metabase/public_settings.clj 0 additions, 13 deletionssrc/metabase/public_settings.clj
- src/metabase/util.clj 8 additions, 12 deletionssrc/metabase/util.clj
- webpack.config.js 5 additions, 3 deletionswebpack.config.js
- yarn.lock 43 additions, 2 deletionsyarn.lock
.eslintignore
0 → 100644
.prettierignore
0 → 100644
... | ... | @@ -141,6 +141,7 @@ |
"promise-loader": "^1.0.0", | ||
"raf": "^3.4.0", | ||
"react-test-renderer": "~16.14.0", | ||
"shadow-cljs": "2.11.20", | ||
"style-loader": "^0.19.0", | ||
"uglifyjs-webpack-plugin": "^1.0.0", | ||
"unused-files-webpack-plugin": "^3.0.0", | ||
... | ... | @@ -153,22 +154,30 @@ |
"yaml-lint": "^1.2.4" | ||
}, | ||
"scripts": { | ||
"dev": "concurrently --kill-others -p name -n 'backend,frontend,docs' -c 'blue,green,yellow' 'lein run' 'yarn build-hot' 'yarn docs'", | ||
"dev-ee": "concurrently --kill-others -p name -n 'backend,frontend,docs' -c 'blue,green,yellow' 'lein with-profiles +ee run' 'MB_EDITION=ee yarn build-hot' 'yarn docs'", | ||
"concurrently": "yarn && concurrently --kill-others -p name", | ||
"dev": "yarn concurrently -n 'backend,frontend,cljs,docs' -c 'blue,green,yellow,magenta' 'lein run' 'yarn build-hot:js' 'yarn build-hot:cljs' 'yarn docs'", | ||
"dev-ee": "yarn concurrently -n 'backend,frontend,cljs,docs' -c 'blue,green,yellow,magenta' 'lein with-profiles +ee run' 'MB_EDITION=ee yarn build-hot:js' 'MB_EDITION=ee yarn build-hot:cljs' 'yarn docs'", | ||
"lint": "yarn lint-eslint && yarn lint-prettier && yarn lint-docs-links && yarn lint-yaml", | ||
"lint-eslint": "yarn && eslint --ext .js --ext .jsx --rulesdir frontend/lint/eslint-rules --max-warnings 0 enterprise/frontend/src frontend/src enterprise/frontend/test frontend/test", | ||
"lint-eslint": "yarn build-quick:cljs && eslint --ext .js --ext .jsx --rulesdir frontend/lint/eslint-rules --max-warnings 0 enterprise/frontend/src frontend/src enterprise/frontend/test frontend/test", | ||
"lint-prettier": "yarn && prettier -l '{enterprise/,}frontend/**/*.{js,jsx,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-unit": "yarn && jest --maxWorkers=2 --config jest.unit.conf.json", | ||
"test-unit": "yarn build-quick:cljs && jest --maxWorkers=2 --config jest.unit.conf.json", | ||
"test-unit-watch": "yarn test-unit --watch", | ||
"test-unit-update-snapshot": "yarn test-unit --updateSnapshot", | ||
"test-timezones-unit": "yarn && jest --maxWorkers=2 --config jest.tz.unit.conf.json", | ||
"test-timezones-unit": "yarn build-quick:cljs && jest --maxWorkers=2 --config jest.tz.unit.conf.json", | ||
"test-timezones": "yarn && ./frontend/test/__runner__/run_timezone_tests", | ||
"build": "yarn && webpack --bail", | ||
"build-watch": "yarn && webpack --watch", | ||
"build-hot": "yarn && NODE_ENV=hot webpack-dev-server --progress", | ||
"build:js": "yarn && webpack --bail", | ||
"build-watch:js": "yarn && webpack --watch", | ||
"build-hot:js": "yarn && NODE_ENV=hot webpack-dev-server --progress", | ||
"build:cljs": "yarn && shadow-cljs release app", | ||
"build-quick:cljs": "yarn build:cljs", | ||
"build-watch:cljs": "yarn && shadow-cljs watch app", | ||
"build-hot:cljs": "yarn && shadow-cljs watch app", | ||
"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-stats": "yarn && webpack --json > stats.json", | ||
"build-shared": "yarn && webpack --config webpack.shared.config.js", | ||
"start": "yarn build && lein ring server", | ||
... | ... |
shadow-cljs.edn
0 → 100644
shared/src/metabase/shared/util.cljc
0 → 100644
Please register or sign in to comment