feat: 增加提交规范

This commit is contained in:
ningmengchongshui 2024-06-18 22:52:19 +08:00
parent 209699f64d
commit dc75fa4890
16 changed files with 83 additions and 2 deletions

40
.commitlint.config.cjs Normal file
View File

@ -0,0 +1,40 @@
/**
* feat新增功能feature表示添加了新的功能或功能的扩展
* fix修复问题bug fix表示修复了已存在的问题或错误
* docs文档更新表示更新了文档如添加新的文档改进现有文档等
* chore杂项任务chore表示对构建过程或辅助工具的修改不涉及功能或代码的更改
* style代码风格调整表示对代码风格格式的调整如空格缩进命名等
* refactor重构代码表示对代码进行重构旨在改进代码结构性能或可读性但不涉及功能更改
* test测试相关表示新增或修改了测试代码如添加新的测试用例修复现有测试等
* revert撤销提交表示撤销先前的提交用于还原之前的更改
*/
// git commit -m "feat: Add new feature"
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// 提交类型type必须使用小写字母
'type-case': [2, 'always', 'lower-case'],
// 提交类型type必须符合指定的正则表达式
'type-enum': [
2,
'always',
['feat', 'fix', 'docs', 'chore', 'style', 'refactor', 'test', 'revert']
],
// 提交范围scope必须使用小写字母
'scope-case': [2, 'always', 'lower-case'],
// 提交主题subject的长度限制为 50 个字符
'subject-max-length': [2, 'always', 50],
// 提交主题subject的首字母必须大写
'subject-case': [2, 'always', 'sentence-case'],
// 提交主题subject不允许以句号结尾
'subject-full-stop': [2, 'never', '.']
// 提交主题subject必须使用具体、清晰的语句描述更改内容
// 'subject-words': [
// 2,
// 'always',
// {
// words: ['add', 'update', 'remove', 'refactor', 'fix', 'merge', 'docs']
// }
// ]
}
}

5
.gitignore vendored
View File

@ -152,4 +152,7 @@ docs/
public/
/html/
/plugins/
/plugins/
yarn.lock

View File

@ -1 +1,2 @@
npm run lint
npm run format

View File

@ -1,5 +1,8 @@
import * as core from 'yunzai/core'
import * as utils from 'yunzai/utils'
/**
* @deprecated
*/
export default {
...core,
...utils

View File

@ -1,2 +1,5 @@
import { ConfigController } from "yunzai/config";
/**
* @deprecated
*/
export default ConfigController

View File

@ -1,2 +1,5 @@
import handler from "../../src/core/plugins/handler.js";
/**
* @deprecated
*/
export default handler

View File

@ -1,2 +1,5 @@
import { Messages, Events } from "yunzai/core"
/**
* @deprecated
*/
export { Messages, Events }

View File

@ -1,2 +1,5 @@
import pluginsLoader from "../../src/core/plugins.loader";
/**
* @deprecated
*/
export default pluginsLoader

View File

@ -1,2 +1,5 @@
import { Plugin } from "yunzai/core"
/**
* @deprecated
*/
export default Plugin

View File

@ -1,2 +1,5 @@
import { Runtime } from 'yunzai/core'
export default Runtime
/**
* @deprecated 已废弃
*/
export default Runtime

View File

@ -1,2 +1,5 @@
import { puppeteer } from 'yunzai/utils'
/**
* @deprecated
*/
export default puppeteer

View File

@ -1,2 +1,5 @@
import { renderer } from 'yunzai/utils'
/**
* @deprecated
*/
export default renderer

View File

@ -1,2 +1,5 @@
import { Renderer } from 'yunzai/utils'
/**
* @deprecated
*/
export default Renderer

View File

@ -18,6 +18,7 @@
"pm2": "pm2",
"image": "node image.js",
"css": "tailwindcss -i ./src/input.css -o ./public/output.css",
"lint": "commitlint --config .commitlint.config.cjs -e -V",
"format": "prettier --write .",
"prepare": "husky"
},
@ -52,6 +53,8 @@
"yaml": "^2.4.1"
},
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-terser": "^0.4.4",

View File

@ -7,6 +7,7 @@ import Puppeteer from './lib/puppeteer.js'
* @returns renderer.id IDrenderer中选择的id
* @returns renderer.type image
* @returns renderer.render
* @deprecated
*/
export default function (config?: PuppeteerLaunchOptions & {
chromiumPath?: string;

View File

@ -1,2 +1,5 @@
import { Renderers } from 'yunzai/utils'
/**
* @deprecated
*/
export default Renderers