Skip to content

Commit

Permalink
build: add commitlint and commitizen (#4)
Browse files Browse the repository at this point in the history
* build: add commitlint and commitizen

* docs: add section about commit message to readme

* chore: 🤖 use streamich/git-cz for creating commit message
  • Loading branch information
kristw authored and zhaoyongjie committed Nov 26, 2021
1 parent 96fbba6 commit 5586e58
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional', '@commitlint/config-lerna-scopes'] };
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -78,13 +85,19 @@
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"./packages/*/{src,test,storybook}/**/*.{js,jsx,ts,tsx,json,md}": [
"yarn run prettier --write",
"git add"
]
},
"config": {
"commitizen": {
"path": "git-cz"
}
}
}

0 comments on commit 5586e58

Please sign in to comment.