Skip to content

Commit

Permalink
Merge pull request #268 from XPoet/dev
Browse files Browse the repository at this point in the history
Release new version
  • Loading branch information
XPoet committed Dec 7, 2023
2 parents a409270 + 8568fb7 commit de154a4
Show file tree
Hide file tree
Showing 34 changed files with 759 additions and 618 deletions.
23 changes: 23 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat',
'fix',
'docs',
'style',
'refactor',
'perf',
'test',
'build',
'revert',
'ci',
'ui',
'chore'
]
]
}
}
114 changes: 58 additions & 56 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -1,82 +1,84 @@
module.exports = {
// type 类型(定义之后,可通过上下键选择)
// Commit 类型列表
types: [
{ value: 'feat', name: 'feat: 新增功能' },
{ value: 'fix', name: 'fix: 修复 bug' },
{ value: 'docs', name: 'docs: 文档变更' },
{ value: 'style', name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)' },
{ value: 'refactor', name: 'refactor: 代码重构(不包括 bug 修复、功能新增)' },
{ value: 'perf', name: 'perf: 性能优化' },
{ value: 'test', name: 'test: 添加、修改测试用例' },
{ value: 'build', name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)' },
{ value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
{ value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)' },
{ value: 'revert', name: 'revert: 回滚 commit' }
],
['feat', '新增功能', '✨'],
['fix', '修复 Bug', '🐛'],
['docs', '文档变更', '📝'],
['style', '不影响代码功能的更改(例如:空格、格式化、补齐分号等)', '🎨'],
['refactor', '代码重构(不包括新增功能、修复 Bug)', '🔨'],
['perf', '提高性能的代码更改', '📈'],
['test', '添加、修改测试用例', '✅'],
['build', '构建流程、外部依赖变更(如升级依赖、修改 Vite 配置等)', '🛠️'],
['ci', '修改 CI 配置、脚本', '🔧'],
['chore', '对构建过程或辅助工具和库的更改(不影响源文件、测试用例)', '📦'],
['revert', '回滚 Commit', '⏪'],
['WIP', '正在进行的工作', '🚧'],
['ui', '修改界面 UI', '💄'],
['release', '发布版本或标签', '🚀']
].map(([value, desc, icon]) => {
return {
value,
name: `${(value + ': ').padEnd(10)}${icon} ${desc}`
};
}),

// scope 类型(定义之后,可通过上下键选择)
// Scopes 类型列表
scopes: [
['components', '组件相关'],
['hooks', 'hook 相关'],
['utils', 'utils 相关'],
['element-ui', '对 element-ui 的调整'],
['utils', 'util 相关'],
['element-plus', '对 element-plus 的调整'],
['styles', '样式相关'],
['deps', '项目依赖'],
['auth', '对 auth 修改'],
['other', '其他修改'],
// 如果选择 custom,后面会让你再输入一个自定义的 scope。也可以不设置此项,把后面的 allowCustomScopes 设置为 true
['custom', '以上都不是?我要自定义']
].map(([value, description]) => {
['other', '其他修改']
].map(([value, desc]) => {
return {
value,
name: `${value.padEnd(30)} (${description})`
}
name: `${value.padEnd(20)}${desc}`
};
}),

// 是否允许自定义填写 scope,在 scope 选择的时候,会有 empty 和 custom 可以选择。
// allowCustomScopes: true,

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


// 针对每一个 type 去定义对应的 scopes,例如 fix
/*
// 设置在只有选择了 fix 类型才会出现的 scopes
scopeOverrides: {
fix: [
{ name: 'merge' },
{ name: 'style' },
{ name: 'e2eTest' },
{ name: 'unitTest' }
{name: 'merge'},
{name: 'style'},
{name: 'e2eTest'},
{name: 'unitTest'}
]
},
*/
*/

allowCustomScopes: true, // 允许自定义 Scope
allowEmptyScopes: true, // 允许空 Scope
customScopesName: `${'custom'.padEnd(20)}(自定义 Scope)`, // 选择自定义 Scope 时的描述
emptyScopesName: `${'empty'.padEnd(20)}(不填 Scope)`, // 选择空 Scope 时的描述

// 交互提示信息
messages: {
type: '确保本次提交遵循 Angular 规范!\n选择你要提交的类型:',
scope: '\n选择一个 scope(可选):',
// 选择 scope: custom 时会出下面的提示
customScope: '请输入自定义的 scope:',
subject: '填写简短精炼的变更描述:\n',
body:
'填写更加详细的变更描述(可选)。使用 "|" 换行:\n',
breaking: '列举非兼容性重大的变更(可选):\n',
footer: '列举出所有变更的 ISSUES CLOSED(可选)。 例如: #31, #34:\n',
confirmCommit: '确认提交?'
type: '请选择 Commit 类型:(上下键选择,按 Enter 键确定)',
scope: '\n请选择或输入修改范围 Scope:(上下键选择,按 Enter 键确定)',
customScope: '请输入自定义的 Scope:', // 需设置 allowCustomScopes: true
subject: '填写简短精炼的变更描述:(必填)\n',
body: '填写更加详细的变更描述:(使用 \'|\' 换行。非必填,可按 Enter 键跳过)\n',
breaking: '列举非兼容性重大的变更:(非必填,可按 Enter 键跳过)\n',
footer: '列举出所有变更的 ISSUES CLOSED:(例如:#31、#34。非必填,可按 Enter 键跳过)\n',
confirmCommit: '确认使用以上信息提交?(y/n/e)'
},

// 设置只有 type 选择了 feat 或 fix,才询问 breaking message
allowBreakingChanges: ['feat', 'fix'],

// 跳过要询问的步骤
// skipQuestions: ['body', 'footer'],
allowTicketNumber: false,
isTicketNumberRequired: false,
ticketNumberPrefix: 'TICKET-',
ticketNumberRegExp: '\\d{1,5}',

allowBreakingChanges: ['feat', 'fix'], // 设置 type 选择 feat 或 fix,询问 breaking message
// skipQuestions: ['body', 'footer'], // 跳过问题
skipEmptyScopes: false,

// subject 限制长度
subjectLimit: 100,
breaklineChar: '|' // 支持 body 和 footer
subjectLimit: 100 // subject 长度限制
// breaklineChar: '|', // 设置换行符
// footerPrefix : 'ISSUES CLOSED:'
// askForBreakingChangeFirst : true,
// askForBreakingChangeFirst : true, // default is false
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@

- 在线使用,无需下载,无需安装。
- 操作简单,文档完善,持续维护。
- 代码开源,数据安全,免费使用
- 代码开源,数据安全,完全免费

## 如何使用 | How to use

只需 [创建一个 GitHub Token](https://github.com/settings/tokens/new),在 [PicX 官网](https://picx.xpoet.cn) 使用 Token 完成图床配置即可。

**PicX 在线使用入口 >> https://picx.xpoet.cn**
**在线使用 https://picx.xpoet.cn**

## 文档 | Documents

官方文档 https://picx-docs.xpoet.cn
**官方文档 https://picx-docs.xpoet.cn**

通过阅读 **[快速开始](https://picx-docs.xpoet.cn/usage-guide/get-start.html)** 教程,可帮助你迅速上手 PicX。

Expand Down
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "picx",
"version": "2.3.6",
"version": "2.4.0",
"private": false,
"author": "XPoet <i@xpoet.cn>",
"license": "AGPL-3.0",
Expand All @@ -21,6 +21,14 @@
"*.{vue,styl}": "stylelint --fix",
"*.{vue,js,ts}": "eslint --fix"
},
"config": {
"commitizen": {
"path": "cz-custom"
},
"cz-custom": {
"config": ".cz-config.js"
}
},
"dependencies": {
"@yireen/squoosh-browser": "^1.0.7",
"axios": "^1.3.5",
Expand All @@ -31,17 +39,17 @@
"vuex": "^4.1.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@commitlint/cli": "17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@iconify-json/ep": "^1.1.10",
"@types/node": "^15.0.1",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@vitejs/plugin-vue": "^2.3.4",
"@vue/compiler-sfc": "^3.2.47",
"commitizen": "^4.2.3",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.3.0",
"cz-custom": "^0.0.2",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -62,10 +70,5 @@
"unplugin-vue-components": "^0.24.1",
"vite": "~2.7.13",
"vite-plugin-pwa": "^0.12.8"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}

0 comments on commit de154a4

Please sign in to comment.