Skip to content

Commit

Permalink
feat: 发布模块架构图、完善git提交规范
Browse files Browse the repository at this point in the history
  • Loading branch information
AKclown committed May 27, 2022
1 parent e6c0227 commit 8ff4043
Show file tree
Hide file tree
Showing 51 changed files with 15,437 additions and 14,168 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"node": true, // 只需将该项设置为 true 即可
"commonjs": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": ["eslint:recommended", "prettier"],
"rules": {
"no-prototype-builtins": "warn",
"no-useless-catch": "warn"
}
}
5 changes: 5 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn run commitlint --edit $1
8 changes: 8 additions & 0 deletions .husky/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
command_exists () {
command -v "$1" >/dev/null 2>&1
}

# Workaround for Windows 10, Git Bash and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

npm run lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx}": ["eslint --fix --resolve-plugins-relative-to ."],
"*.{css,less,js,jsx,ts,tsx,json,yml,yaml,md}": ["prettier --write"]
}
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
package-lock=true
registry=https://registry.npmjs.org
# registry=https://registry.npmjs.org
registry=https://registry.npm.taobao.org
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Dependency directories
node_modules/
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSameLine": false,
"arrowParens": "avoid",
"endOfLine": "lf"
}
4 changes: 4 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.js
**/*.jsx
**/*.ts
**/*.tsx
3 changes: 3 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"]
}
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# [1.0.0](https://github.com/AKclown/ak-cli/compare/v1.0.2...v1.0.0) (2022-04-02)

### Features

- **package.json:** 新增 commit 提交规范 ([e6c0227](https://github.com/AKclown/ak-cli/commit/e6c0227ec67b1e5f80b0da28707e3f340e3d9c7f))

## [1.0.2](https://github.com/AKclown/ak-cli/compare/v1.0.1...v1.0.2) (2022-01-13)



## 1.0.1 (2022-01-13)



23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# ak-cli
ak-cli工具

### init命令
ak-cli 工具

### init 命令

```
ak-cli init --targetPath /Users/ak/Desktop/project/ak-cli/commands/init --force --debug test-project
```

### 提交规范

1. commitizen
2. cz-conventional-changelog (Commitizen适配器)
6. conventional-changelog-cli (自动生成CHANGELOG 文件)
2. cz-conventional-changelog (Commitizen 适配器)
3. conventional-changelog-cli (自动生成 CHANGELOG 文件)

- 一般通过git cz提交符合规范的commit信息,但是有些开发者不是通过命令行的方式来提交commit的。如果我们需要强制校验vscode/webstorm 等其他工具的方式提交 commit,可以使用commitlint+husky的方式来配合使用
- 一般通过 git cz 提交符合规范的 commit 信息,但是有些开发者不是通过命令行的方式来提交 commit 的。如果我们需要强制校验 vscode/webstorm 等其他工具的方式提交 commit,可以使用 commitlint+husky 的方式来配合使用

3. @commitlint/cli (校验提交说明是否符合规范)
4. @commitlint/config-conventional (安装符合Angular风格的校验规则)
5. husky (git钩子工具)
4. @commitlint/config-conventional (安装符合 Angular 风格的校验规则)
5. husky (git 钩子工具)

[commit 参考文献](https://godbasin.github.io/2019/11/10/change-log/)

### 发布的整体架构图

[commit参考文献](https://godbasin.github.io/2019/11/10/change-log/)
![脚手架发布整体架构设计](./doc/diagram/publish-architecture-design.png)
7 changes: 0 additions & 7 deletions commands/init/__tests__/init.test.js

This file was deleted.

12 changes: 6 additions & 6 deletions commands/init/lib/getProjectTemplate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const request = require('@ak-clown/request');
module.exports = function () {
return request({
url:'/project/template'
})
}
const request = require('@ak-clown/request');
module.exports = function () {
return request({
url: '/project/template',
});
};
Loading

0 comments on commit 8ff4043

Please sign in to comment.