Skip to content

Commit

Permalink
✨ feat(basic): [email protected] 开启开发
Browse files Browse the repository at this point in the history
[email protected] 开启开发

对应 issues: #26
  • Loading branch information
linkFly6 committed Aug 23, 2019
1 parent fdae70e commit 05da92f
Show file tree
Hide file tree
Showing 5 changed files with 1,599 additions and 603 deletions.
41 changes: 41 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* commitlint: https://commitlint.js.org/#/reference-configuration
* @commitlint/config-conventional: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional
*/
module.exports = {
// extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
':sparkles: feat',
':bug: fix',
':pencil: docs',
':lipstick: style',
':recycle: refactor',
':zap: perf',
':white_check_mark: test',
':wrench: chore',
':rewind: revert',
':construction: WIP',
':twisted_rightwards_arrows: merge'
]
],
'body-leading-blank': [2, 'always'],
// 'footer-leading-blank': [2, 'always'],
'header-max-length': [2, 'always', 72],
'scope-case': [2, 'always', 'lower-case'],
'subject-case': [2, 'always', ['sentence-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', ['.']],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never']
},
parserPreset: {
parserOpts: {
headerPattern: /^(:\w*:\s\w*)(?:\((.*?)\))?((?:.*(?=\())|.*)/,
headerCorrespondence: ['type', 'scope', 'subject']
}
}
}
76 changes: 76 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
// git commit gitmoji 语义参考:https://gitmoji.carloscuesta.me/
types: [
{ value: ':sparkles: feat', name: '✨ feat: 新功能/特性' },
{ value: ':bug: fix', name: '🐛 fix: bug 修复' },
{ value: ':pencil: docs', name: '📝 docs: 文档或注释更新' },
{
value: ':lipstick: style',
name:
'💄 style: 格式\n (white-space, formatting, missing semi-colons, etc)',
},
{
value: ':recycle: refactor',
name: '♻️ refactor: 重构,即不是新增功能,也不是修改 bug 的代码变动',
},
{
value: ':zap: perf',
name: '⚡️ perf: 提升性能',
},
{ value: ':white_check_mark: test', name: '✅ test: 测试' },
{
value: ':wrench: chore',
name:
'🔧 chore: 其他修改\n 例如构建工具、依赖升级、merge代码',
},
{ value: ':rewind: revert', name: '⏪ revert: revert 提交' },
{ value: ':construction: WIP', name: '🚧 WIP: 进行中(临时提交)' },
{ value: ':twisted_rightwards_arrows: merge', name: '🔀 merge: 合并分支' },
],

scopes: [{ name: '$article' }, { name: '$blog' }, { name: '$home' }, { name: '$song' }, { name: '$image' }, { name: '$category' }, { name: 'basic' }, { name: 'compile' }, { name: 'merge' }],

// issues 相关
allowTicketNumber: false,
isTicketNumberRequired: false,
ticketNumberPrefix: 'TICKET-',
ticketNumberRegExp: '\\d{1,5}',

// it needs to match the value for field type. Eg.: 'fix'
/*
scopeOverrides: {
fix: [
{name: 'merge'},
{name: 'style'},
{name: 'e2eTest'},
{name: 'unitTest'}
]
},
*/
// override the messages, defaults are as follows
messages: {
type: "选择 commit 类型:",
scope: '\n更改的范围 (可选):',
// used if allowCustomScopes is true
customScope: '请填写本次修改的范围:',
subject: '简述(总结)本次的更改:\n',
body: '详细描述,【如果有业务特殊逻辑请在代码注释中标明】 (用 "|" 换行):\n',
breaking: '特殊的业务逻辑说明 (可选):\n',
footer: '本次提交修正的相关 issues. E.g.: #31, #34:\n',
confirmCommit: '请确定是否提交?',
},

allowCustomScopes: true,
/**
* 说明时候显示 breaking
*/
allowBreakingChanges: [':sparkles: feat', ':bug: fix', ':recycle: refactor', ':construction: WIP'],
// 需要跳过的问题
skipQuestions: ['footer'],
// limit subject length
subjectLimit: 100,
breakingPrefix: '特殊的业务逻辑说明: ',
// breaklineChar: '|', // It is supported for fields body and footer.
footerPrefix : 'ISSUES CLOSED:'
// askForBreakingChangeFirst : true, // default is false
};
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules/
dist/
logs/
said.tar.gz
/said/
/said/
yarn-error.log
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "said",
"version": "2.1.12",
"version": "2.2.0",
"description": "said 采用 node 技术架构重写",
"repository": {
"type": "git",
Expand All @@ -26,6 +26,17 @@
"serve-debug": "nodemon --inspect dist/server.js",
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"Stylus,TypeScript,Node\" -c \"bgMagenta.white.bold,bgBlue.white.bold,bgGreen.white.bold\" \"npm run watch-stylus\" \"npm run watch-ts\" \"npm run serve-debug\""
},
"config": {
"commitizen": {
"path": "./node_modules/cz-customizable"
}
},
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && npx git-cz --hook",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"dependencies": {
"async": "^2.1.2",
"bcrypt-nodejs": "^0.0.3",
Expand Down Expand Up @@ -68,6 +79,8 @@
"@babel/plugin-transform-runtime": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/runtime": "^7.0.0-beta.40",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@types/async": "^2.0.40",
"@types/bcrypt-nodejs": "0.0.30",
"@types/body-parser": "^1.16.2",
Expand Down Expand Up @@ -98,10 +111,13 @@
"@types/typed.js": "^2.0.0",
"babel-loader": "^8.0.0-beta.0",
"colors": "^1.1.2",
"commitizen": "3.1.1",
"concurrently": "^3.4.0",
"cz-customizable": "^6.2.0",
"fancy-log": "^1.3.2",
"gsap": "^2.0.1",
"gulp": "^4.0.0",
"husky": "^3.0.4",
"nodemon": "^1.11.0",
"plugin-error": "^1.0.1",
"scrollmagic": "^2.0.5",
Expand Down
Loading

0 comments on commit 05da92f

Please sign in to comment.