diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md index d88dd16247da0..03716fb8773bf 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md @@ -90,6 +90,10 @@ yarn build Each package defines its own build config, linting, and testing. You can have lerna run commands across all packages using the syntax `yarn run test` (or `yarn run test:watch` for watch mode) from the root `@superset-ui` directory. +### Committing + +This repository follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.3/) guideline for commit messages and has a `commitlint` hook which will require you to have the valid commit message before committing. You can use `npm run commit` to help you create a commit message. + ### Publishing **Prerequisite:** You'll need an [npmjs.com](https://npmjs.com) account that is part of the `@superset-ui` organization. diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/commitlint.config.js b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/commitlint.config.js new file mode 100644 index 0000000000000..1f9ae7dfcb137 --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional', '@commitlint/config-lerna-scopes'] }; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/package.json b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/package.json index aab85b3901a78..034f655cac985 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/package.json @@ -8,6 +8,7 @@ "build:cjs": "NODE_ENV=production beemo babel --extensions=\".js,.jsx,.ts,.tsx\" ./src --out-dir lib/ --minify --workspaces=\"@superset-ui/!(plugins-demo)\"", "build:esm": "NODE_ENV=production beemo babel --extensions=\".js,.jsx,.ts,.tsx\" ./src --out-dir esm/ --esm --minify --workspaces=\"@superset-ui/!(plugins-demo)\"", "build:assets": "node ./buildAssets.js", + "commit": "git-cz", "type": "NODE_ENV=production beemo typescript --workspaces=\"@superset-ui/(plugin-*)\" --noEmit", "type:dts": "NODE_ENV=production beemo typescript --workspaces=\"@superset-ui/(plugin-*)\" --emitDeclarationOnly", "lint": "beemo create-config prettier && beemo eslint \"./packages/*/{src,test,storybook}/**/*.{js,jsx,ts,tsx}\"", @@ -37,17 +38,23 @@ ], "license": "Apache-2.0", "devDependencies": { + "@commitlint/cli": "^7.5.2", + "@commitlint/config-conventional": "^7.5.0", + "@commitlint/config-lerna-scopes": "^7.5.1", + "@commitlint/prompt-cli": "^7.5.0", "@superset-ui/build-config": "^0.0.3", "@superset-ui/chart": "^0.9.6", "@superset-ui/color": "^0.9.5", - "@superset-ui/core": "^0.9.5", "@superset-ui/connection": "^0.9.5", + "@superset-ui/core": "^0.9.5", "@superset-ui/dimension": "^0.9.3", "@superset-ui/number-format": "^0.9.5", "@superset-ui/time-format": "^0.9.5", "@superset-ui/translation": "^0.9.5", + "commitizen": "^3.0.7", "fast-glob": "^2.2.6", "fs-extra": "^7.0.1", + "git-cz": "^1.8.0", "husky": "^1.1.2", "lerna": "^3.2.1", "lint-staged": "^8.0.4", @@ -78,7 +85,8 @@ ], "husky": { "hooks": { - "pre-commit": "lint-staged" + "pre-commit": "lint-staged", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, "lint-staged": { @@ -86,5 +94,10 @@ "yarn run prettier --write", "git add" ] + }, + "config": { + "commitizen": { + "path": "git-cz" + } } }