From f402f1bd2cf32a99c5fa0785de9c4273e4fd47bf Mon Sep 17 00:00:00 2001 From: MuyianKing Date: Thu, 16 Jan 2025 10:11:22 +0800 Subject: [PATCH] =?UTF-8?q?build:=20:package:=20=E5=BC=95=E5=85=A5@muyiank?= =?UTF-8?q?ing/config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commitlint.config.cjs | 3 ++ commitlint.config.js | 88 ------------------------------------------- package.json | 83 ++++++++++++++++++++-------------------- pnpm-lock.yaml | 8 ++++ 4 files changed, 53 insertions(+), 129 deletions(-) create mode 100644 commitlint.config.cjs delete mode 100644 commitlint.config.js diff --git a/commitlint.config.cjs b/commitlint.config.cjs new file mode 100644 index 0000000..bf7e6c0 --- /dev/null +++ b/commitlint.config.cjs @@ -0,0 +1,3 @@ +const commitlint = require('@muyianking/config/commitlint.config.cjs') + +module.exports = commitlint diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 10613a1..0000000 --- a/commitlint.config.js +++ /dev/null @@ -1,88 +0,0 @@ -export default { - // 继承的规则 - extends: ['@commitlint/config-conventional'], - rules: { - 'subject-case': [0], // subject大小写不做校验 - // 类型枚举,git提交type必须是以下类型 - 'type-enum': [ - // 当前验证的错误级别 - 2, - // 在什么情况下进行验证,always表示一直进行验证 - 'always', - [ - 'feat', // 新增功能 - 'fix', // 修复缺陷 - 'docs', // 文档变更 - 'style', // 代码格式(不影响功能,例如空格、分号等格式修正) - 'refactor', // 代码重构(不包括 bug 修复、功能新增) - 'perf', // 性能优化 - 'test', // 添加疏漏测试或已有测试改动 - 'build', // 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等) - 'ci', // 修改 CI 配置、脚本 - 'revert', // 回滚 commit - 'chore', // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例) - ], - ], - }, - prompt: { - messages: { - type: '选择你要提交的类型 :', - scope: '选择一个提交范围(可选):', - customScope: '请输入自定义的提交范围 :', - subject: '填写简短精炼的变更描述 :\n', - body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n', - breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n', - footerPrefixesSelect: '选择关联issue前缀(可选):', - customFooterPrefix: '输入自定义issue前缀 :', - footer: '列举关联issue (可选) 例如: #31, #I3244 :\n', - generatingByAI: '正在通过 AI 生成你的提交简短描述...', - generatedSelectByAI: '选择一个 AI 生成的简短描述:', - confirmCommit: '是否提交或修改commit ?', - }, - types: [ - { value: 'feat', name: '特性: ✨ 新增功能', emoji: ':sparkles:' }, - { value: 'fix', name: '修复: 🐛 修复缺陷', emoji: ':bug:' }, - { value: 'docs', name: '文档: 📝 文档变更', emoji: ':memo:' }, - { value: 'style', name: '格式: 💄 代码格式(不影响功能,例如空格、分号等格式修正)', emoji: ':lipstick:' }, - { value: 'refactor', name: '重构: ♻️ 代码重构(不包括 bug 修复、功能新增)', emoji: ':recycle:' }, - { value: 'perf', name: '性能: ⚡️ 性能优化', emoji: ':zap:' }, - { value: 'test', name: '测试: ✅ 添加疏漏测试或已有测试改动', emoji: ':white_check_mark:' }, - { value: 'release', name: '构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 vite 配置等)', emoji: ':package:' }, - { value: 'ci', name: '集成: 🎡 修改 CI 配置、脚本', emoji: ':ferris_wheel:' }, - { value: 'revert', name: '回退: ⏪️ 回滚 commit', emoji: ':rewind:' }, - { value: 'chore', name: '其他: 🔨 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)', emoji: ':hammer:' }, - ], - useEmoji: true, - emojiAlign: 'center', - useAI: false, - aiNumber: 1, - themeColorCode: '', - scopes: [], - allowCustomScopes: true, - allowEmptyScopes: true, - customScopesAlign: 'bottom', - customScopesAlias: 'custom', - emptyScopesAlias: 'empty', - upperCaseSubject: false, - markBreakingChangeMode: false, - allowBreakingChanges: ['feat', 'fix'], - breaklineNumber: 100, - breaklineChar: '|', - skipQuestions: [], - issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }], - customIssuePrefixAlign: 'top', - emptyIssuePrefixAlias: 'skip', - customIssuePrefixAlias: 'custom', - allowCustomIssuePrefix: true, - allowEmptyIssuePrefix: true, - confirmColorize: true, - maxHeaderLength: Infinity, - maxSubjectLength: Infinity, - minSubjectLength: 0, - scopeOverrides: undefined, - defaultBody: '', - defaultIssues: '', - defaultScope: '', - defaultSubject: '', - }, -} diff --git a/package.json b/package.json index 9940a32..f94e6b7 100644 --- a/package.json +++ b/package.json @@ -1,43 +1,44 @@ { - "name": "@muyianking/cli", - "type": "module", - "version": "0.2.2", - "private": false, - "scripts": { - "update-dep": "npm-check-updates && ncu -u && pnpm i", - "commit": "git add . && git cz", - "lint": "git add . && lint-staged", - "husky-lint": "git add . && lint-staged", - "prepare": "husky", - "log": "conventional-changelog -p angular -i CHANGELOG.md -s", - "publish": "node ./script/publish.js" - }, - "dependencies": { - "download-git-repo": "^3.0.2", - "fs-extra": "^11.2.0" - }, - "devDependencies": { - "@antfu/eslint-config": "^3.8.0", - "@commitlint/cli": "^19.5.0", - "@commitlint/config-conventional": "^19.5.0", - "@eslint/eslintrc": "^3.1.0", - "cz-git": "^1.10.1", - "eslint": "^9.13.0", - "eslint-plugin-format": "^0.1.2", - "husky": "^9.1.6", - "lint-staged": "^15.2.10" - }, - "resolutions": { - "bin-wrapper": "npm:bin-wrapper-china" - }, - "config": { - "commitizen": { - "path": "node_modules/cz-git" - } - }, - "lint-staged": { - "*.{js,ts,vue}": [ - "eslint --fix" - ] - } + "name": "@muyianking/cli", + "type": "module", + "version": "0.2.2", + "private": false, + "scripts": { + "update-dep": "npm-check-updates && ncu -u && pnpm i", + "commit": "git add . && git cz", + "lint": "git add . && lint-staged", + "husky-lint": "git add . && lint-staged", + "prepare": "husky", + "log": "conventional-changelog -p angular -i CHANGELOG.md -s", + "publish": "node ./script/publish.js" + }, + "dependencies": { + "download-git-repo": "^3.0.2", + "fs-extra": "^11.2.0" + }, + "devDependencies": { + "@antfu/eslint-config": "^3.8.0", + "@commitlint/cli": "^19.5.0", + "@commitlint/config-conventional": "^19.5.0", + "@eslint/eslintrc": "^3.1.0", + "@muyianking/config": "^0.0.4", + "cz-git": "^1.10.1", + "eslint": "^9.13.0", + "eslint-plugin-format": "^0.1.2", + "husky": "^9.1.6", + "lint-staged": "^15.2.10" + }, + "resolutions": { + "bin-wrapper": "npm:bin-wrapper-china" + }, + "config": { + "commitizen": { + "path": "node_modules/cz-git" + } + }, + "lint-staged": { + "*.{js,ts,vue}": [ + "eslint --fix" + ] + } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 627e62e..220f647 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,9 @@ importers: '@eslint/eslintrc': specifier: ^3.1.0 version: 3.1.0 + '@muyianking/config': + specifier: ^0.0.4 + version: 0.0.4 cz-git: specifier: ^1.10.1 version: 1.10.1 @@ -306,6 +309,9 @@ packages: '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@muyianking/config@0.0.4': + resolution: {integrity: sha512-0bL5nVEgH/Yzg87xdkWYUN9s7Hf+NRzUI9rn2MVAs2weMCgyzH9ZKxjfAuZv5jmwAUF6L6jMIeO2za98IY121A==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -2717,6 +2723,8 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.0': {} + '@muyianking/config@0.0.4': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5