Skip to content

Commit

Permalink
feat: add commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
ChelesteWang committed Jun 14, 2021
1 parent 5f31e89 commit 8eb9d18
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
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'],
};
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,26 @@
"start:no-ui": "cross-env UMI_UI=none umi dev",
"start:pre": "cross-env REACT_APP_ENV=pre umi dev",
"start:test": "cross-env REACT_APP_ENV=test MOCK=none umi dev",

"archives:sync": "echo TODO",
"archives": "yarn archives:compile && yarn archives:add && yarn archives:upload",
"archives:compile": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/compile-archives.ts",
"archives:add": "git stash; git pull --rebase; git stash pop; git add ./archives; git commit --no-verify -m \"DATA: archives `date \"+%Y-%m-%d-%H:%M:%S\"`\" && git push",
"archives:upload": "ossutilmac64 cp -r -u ./archives oss://lanting-public/archives",
"archives:migrate-backend2": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/migrate-backend2.ts",

"deploy": "yarn build && yarn deploy:ec2 && yarn deploy:oss",
"build": "UMI_ENV=prod umi build",
"analyze": "cross-env ANALYZE=1 umi build",
"deploy:oss": "for f in ./dist/; do ossutilmac64 cp -r -u $f oss://lanting-public/; done",
"deploy:ec2": "rsync -arvz --progress ./config/lanting-nginx.conf [email protected]:/data/server-apps/lanting; rsync -arvz --progress ./dist/index.html [email protected]:/data/server-apps/lanting/dist"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged",
"pre-add": "lint-staged",
"pre-push": "lint-staged"
}
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts}": [
Expand Down Expand Up @@ -64,6 +70,8 @@
},
"devDependencies": {
"@ant-design/pro-cli": "^1.0.18",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@types/classnames": "^2.2.7",
"@types/express": "^4.17.0",
"@types/history": "^4.7.2",
Expand All @@ -83,13 +91,15 @@
"@umijs/yorkie": "^2.0.3",
"carlo": "^0.9.46",
"chalk": "^4.0.0",
"commitlint": "^12.1.4",
"cross-env": "^7.0.0",
"cross-port-killer": "^1.1.1",
"detect-installer": "^1.0.1",
"enzyme": "^3.11.0",
"eslint": "^7.1.0",
"express": "^4.17.1",
"gh-pages": "^3.0.0",
"husky": "^6.0.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^10.0.0",
"mockjs": "^1.0.1-beta3",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
".stylelintrc.js",
".prettierrc.js",
"jest.config.js"
],
, "commitlint.config.js" ],
"exclude": ["node_modules", "build", "dist", "src/.umi/*", "webpack", "jest"]
}

0 comments on commit 8eb9d18

Please sign in to comment.