專案環境基本設定
[Note] Setting Started Project Environment
Section titled “[Note] Setting Started Project Environment”開發上環境基本設定
pre commit
Section titled “pre commit”對 git commit 規範的工具,規範產生正規的 commit message 。
- conventional-changelog/commitlint
Terminal window echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.jsnpx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}' - conventional-changelog/conventional-changelog
"devDependencies": {"conventional-changelog-angular": "^5.0.13","conventional-changelog-cli": "^2.2.2",
- typicode/husky
Terminal window npx husky-init && npm install - commitizen/cz-cli
- install dev package
Terminal window npm install commitizen --save-devnpm install @commitlint/cz-commitlint --save-dev package.json"config": {"commitizen": {"path": "@commitlint/cz-commitlint"}}- add hook
Terminal window npx husky add .husky/prepare-commit-msg 'exec < /dev/tty && node_modules/.bin/cz --hook || true'
- install dev package
npm version & gen changelog
Section titled “npm version & gen changelog”依據 commit message 異動 package 版號以及產生異動文件。
dotenv-flow
Section titled “dotenv-flow”- dotenv-flow
可以使用不同的
.env*,像是.env.development,.env.production,.env.local