Skip to content

Commit

Permalink
Merge pull request #2 from umutcanbolat/master
Browse files Browse the repository at this point in the history
chore: add husky, commitizen, lint-staged and standard-version tools
  • Loading branch information
ugurcoskn authored Jan 22, 2020
2 parents 21e068c + 8082341 commit ef61b7c
Show file tree
Hide file tree
Showing 4 changed files with 1,967 additions and 42 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A boilerplate for setting up your react-typescript project in seconds with antd,

Antd implementation always take a lot of time for my typescript projects. This boilerplate has some configuration for that.

### Getting Started
## Getting Started

```bash
git clone https://github.com/ugurcoskn/react-typescript-antd-boilerplate.git my-app
Expand All @@ -15,14 +15,29 @@ yarn dev # start dev server

#### yarn dev

Start the app in dev mode
Start the app in dev mode

#### yarn build

Build the app in production mode
Build the app in production mode

#### yarn lint

Check all `ts,tsx` files whether they match given coding style
Check all `ts,tsx` files whether they match given coding style

### Have FUN !
## Commit Message Standard

Commit messages must comply with [conventional-changelog](https://conventionalcommits.org). Otherwise [husky](https://github.com/typicode/husky) will complain. In order to create a conventional commit, `yarn commit` command can be used.

## Releasing

Running `yarn release` command;

- Creates a new version tag based on the commit history.
- Updates version number in `package.json`.
- Generates `CHANGELOG.md`.
- Commits these changes with a message like `chore(release): publish %s`.

After that, `git push --follow-tags origin master && npm publish` command can be used to push these changes to upstream.

Have fun!
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
28 changes: 27 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"dev": "parcel public/index.html",
"build": "parcel build public/index.html",
"lint": "eslint --ext .ts,.tsx src/"
"lint": "eslint --ext .ts,.tsx src/",
"commit": "git-cz",
"release": "standard-version"
},
"author": "Ugur Coskun<[email protected]>",
"license": "MIT",
Expand All @@ -22,6 +24,8 @@
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"@babel/preset-react": "^7.7.0",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@types/jest": "^24.0.23",
"@types/node": "^12.12.9",
"@types/react": "^16.9.11",
Expand All @@ -32,12 +36,34 @@
"babel-plugin-import": "^1.12.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"commitizen": "^4.0.3",
"cz-conventional-changelog": "^3.0.2",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"husky": "^4.0.10",
"lint-staged": "^10.0.1",
"parcel-bundler": "^1.12.4",
"prettier": "^1.19.1",
"standard-version": "^7.0.1",
"typescript": "^3.7.4"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"git add"
]
}
}
Loading

0 comments on commit ef61b7c

Please sign in to comment.