diff --git a/superset-frontend/temporary_superset_ui/superset-ui/.gitignore b/superset-frontend/temporary_superset_ui/superset-ui/.gitignore index 42450c1e62d64..4d47e06fed8db 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/.gitignore +++ b/superset-frontend/temporary_superset_ui/superset-ui/.gitignore @@ -4,7 +4,6 @@ .eslintrc.js .idea .npm -.npmrc .prettierignore .yarnclean diff --git a/superset-frontend/temporary_superset_ui/superset-ui/.npmrc b/superset-frontend/temporary_superset_ui/superset-ui/.npmrc new file mode 100644 index 0000000000000..43c97e719a5a8 --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/superset-frontend/temporary_superset_ui/superset-ui/.travis.yml b/superset-frontend/temporary_superset_ui/superset-ui/.travis.yml index 8cc212a062fb4..022a868e31125 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/.travis.yml +++ b/superset-frontend/temporary_superset_ui/superset-ui/.travis.yml @@ -14,13 +14,8 @@ install: - npm install - npm install -g codecov -env: - - PACKAGE=superset-ui-core - script: - - cd ./packages/$PACKAGE - yarn install - - yarn run lint - yarn run test after_script: diff --git a/superset-frontend/temporary_superset_ui/superset-ui/package.json b/superset-frontend/temporary_superset_ui/superset-ui/package.json index 7f17dae3db1f6..0f09da012baef 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/package.json @@ -4,13 +4,18 @@ "description": "Superset UI", "private": true, "scripts": { - "build": "lerna run build", - "lint": "lerna run lint", - "lint:fix": "lerna run lint:fix", + "build": "yarn run build:cjs && yarn run build:esm", + "build:cjs": "NODE_ENV=production beemo babel ./src --out-dir lib/ --minify --workspaces=*", + "build:esm": "NODE_ENV=production beemo babel ./src --out-dir esm/ --esm --minify --workspaces=*", + "lint": "beemo create-config prettier && beemo eslint \"./packages/*/{src,test}/**/*.{js,jsx}\"", + "jest": "beemo jest --color --coverage", + "prepare-release": "git checkout master && git pull --rebase origin master && lerna bootstrap && yarn run test", "prerelease": "yarn run build", - "prepare-release": "git checkout master && git pull --rebase origin master && lerna bootstrap && yarn run lint && yarn run test", + "pretest": "yarn run lint", + "prettier": "beemo prettier \"./packages/*/{src,test}/**/*.{js,jsx,json,md}\"", "release": "yarn run prepare-release && lerna publish", - "test": "lerna run test" + "test": "yarn run jest", + "test:watch": "beemo create-config jest && jest --watch" }, "repository": "https://github.com/apache-superset/superset-ui.git", "keywords": [ @@ -27,13 +32,41 @@ ], "license": "Apache-2.0", "devDependencies": { + "@data-ui/build-config": "^0.0.25", + "husky": "^1.1.2", "lerna": "^3.2.1", + "lint-staged": "^7.3.0", "yarn": "^1.9.4" }, "engines": { "node": ">=8.10.0" }, - "publishConfig": { - "access": "public" + "beemo": { + "module": "@data-ui/build-config", + "drivers": [ + "babel", + "eslint", + { + "driver": "jest", + "env": { + "NODE_ENV": "test" + } + }, + "prettier" + ] + }, + "workspaces": [ + "./packages/*" + ], + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "./packages/*/{src,test}/**/*.{js,jsx,json,md}": [ + "yarn run prettier --write", + "git add" + ] } } diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/.eslintrc b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/.eslintrc new file mode 100644 index 0000000000000..81304a0ba1b59 --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "prefer-promise-reject-errors": "off" + } +} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/package.json b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/package.json index bdde0e5a744ef..b483fdfeca62d 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/package.json @@ -9,19 +9,6 @@ "esm", "lib" ], - "scripts": { - "build:cjs": "beemo babel ./src --out-dir lib/ --minify", - "build:esm": "beemo babel ./src --out-dir esm/ --esm --minify", - "build": "yarn run build:cjs && yarn run build:esm", - "dev": "beemo babel --watch ./src --out-dir esm/ --esm", - "jest": "beemo jest --color --coverage", - "eslint": "beemo eslint \"./{src,test}/**/*.{js,jsx,json,md}\"", - "lint": "yarn run prettier && yarn run eslint", - "lint:fix": "yarn run prettier --write && yarn run eslint --fix", - "test": "yarn run jest", - "prettier": "beemo prettier \"./{src,test}/**/*.{js,jsx,json,md}\"", - "prepublish": "yarn run build" - }, "repository": { "type": "git", "url": "git+https://github.com/apache-superset/superset-ui.git" @@ -32,14 +19,13 @@ "core", "data" ], - "author": "", + "author": "Superset", "license": "Apache-2.0", "bugs": { "url": "https://github.com/apache-superset/superset-ui/issues" }, "homepage": "https://github.com/apache-superset/superset-ui#readme", "devDependencies": { - "@data-ui/build-config": "^0.0.23", "fetch-mock": "^6.5.2", "node-fetch": "^2.2.0" }, @@ -47,25 +33,6 @@ "@babel/runtime": "^7.1.2", "whatwg-fetch": "^2.0.4" }, - "beemo": { - "module": "@data-ui/build-config", - "drivers": [ - "babel", - "eslint", - { - "driver": "jest", - "env": { - "NODE_ENV": "test" - } - }, - "prettier" - ], - "eslint": { - "rules": { - "prefer-promise-reject-errors": "off" - } - } - }, "publishConfig": { "access": "public" } diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation/package.json b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation/package.json index 8d559c611ce5e..d0be216680b3a 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation/package.json @@ -9,19 +9,6 @@ "esm", "lib" ], - "scripts": { - "build:cjs": "beemo babel ./src --out-dir lib/ --minify", - "build:esm": "beemo babel ./src --out-dir esm/ --esm --minify", - "build": "yarn run build:cjs && yarn run build:esm", - "dev": "beemo babel --watch ./src --out-dir esm/ --esm", - "jest": "beemo jest --color --coverage", - "eslint": "beemo eslint \"./{src,test}/**/*.{js,jsx,md}\"", - "lint": "yarn run prettier && yarn run eslint", - "lint:fix": "yarn run prettier --write && yarn run eslint --fix", - "test": "yarn run jest", - "prettier": "beemo prettier \"./{src,test}/**/*.{js,jsx,json,md}\"", - "prepublish": "yarn run build" - }, "repository": { "type": "git", "url": "git+https://github.com/apache-superset/superset-ui.git"