Skip to content

Commit

Permalink
feat: add commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhengjian committed Jul 25, 2022
1 parent bf39725 commit c77828b
Show file tree
Hide file tree
Showing 9 changed files with 659 additions and 24 deletions.
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"

pnpm exec commitlint -e $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec lint-staged
8 changes: 8 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [
'@commitlint/config-conventional',
],
rules: {
'subject-max-length': [1, 'always', 150],
},
}
29 changes: 19 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
{
"name": "monorepo-starter-template",
"version": "0.0.10",
"packageManager": "[email protected]",
"description": "this is monorepo starter template",
"scripts": {
"prepare": "husky install",
"release": "esno ./scripts/release.ts --tag"
},
"packageManager": "[email protected]",
"repository": {
"type": "git",
"url": "git+https://github.com/mistjs/monorepo-starter.git"
},
"keywords": [
"monorepo",
"monorepo-template"
],
"license": "MIT",
"author": {
"name": "aibayanyu",
"email": "[email protected]"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/mistjs/monorepo-starter.git"
},
"scripts": {
"prepare": "husky install",
"release": "esno ./scripts/release.ts --tag"
},
"bugs": {
"url": "https://github.com/mistjs/monorepo-starter/issues"
},
"homepage": "https://github.com/mistjs/monorepo-starter#readme",
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@mistjs/eslint-config": "^0.0.2",
"@mistjs/tsconfig": "^1.0.0",
"@types/minimist": "^1.2.2",
Expand All @@ -38,8 +40,15 @@
"execa": "^6.1.0",
"find-packages": "^9.0.6",
"husky": "^7.0.4",
"lint-staged": "^13.0.3",
"minimist": "^1.2.6",
"prompts": "^2.4.2",
"typescript": "^4.7.4"
},
"lint-staged": {
"*.{ts,tsx,js,vue}": "eslint . --fix"
},
"engines": {
"node": ">=14.0.0"
}
}
12 changes: 6 additions & 6 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"name": "@yanyu28/app",
"version": "1.1.9",
"description": "",
"keywords": [],
"license": "ISC",
"author": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"tsup": "^6.1.3",
"vitest": "^0.18.0"
Expand Down
12 changes: 6 additions & 6 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"name": "@yanyu28/tools",
"version": "1.0.7",
"description": "",
"keywords": [],
"license": "MIT",
"author": "",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub",
"test": "vitest run"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"unbuild": "^0.7.4",
"vitest": "^0.18.0"
Expand Down
Loading

0 comments on commit c77828b

Please sign in to comment.