{"_id":"@142vip/commit-linter","_rev":"2-6d6464709999e7cf4b6d388d925c4c6d","name":"@142vip/commit-linter","dist-tags":{"latest":"0.0.1-alpha.2"},"versions":{"0.0.1-alpha.1":{"name":"@142vip/commit-linter","version":"0.0.1-alpha.1","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/commit-linter","commit","git commit","commit lint"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/commit-linter@0.0.1-alpha.1","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/commit-linter/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"bbe9b4470ba8e67a366c8574443fcd01715ecd2c","tarball":"https://registry.npmjs.org/@142vip/commit-linter/-/commit-linter-0.0.1-alpha.1.tgz","fileCount":8,"integrity":"sha512-snzDEUQBr+7xpS5qgbF8MIQeRyrRA8h4FbRAZdvMtPj2Bp1CouG2oDIV2Mo1uopqiCzpTwrSIegPIpkmKq+sOA==","signatures":[{"sig":"MEQCIDQhFRkeXSxCJT0sBxM4vrLOL5w4wytsot0xLYvHUq22AiAtQFb8wwwQhG7/b/ahnU2Mn3nmKUaNZqJfv3MnnNfblQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21307},"main":"./dist/index.mjs","_from":"file:142vip-commit-linter-0.0.1-alpha.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/ca11fb0dceb040e70ce9411c00c72160/142vip-commit-linter-0.0.1-alpha.1.tgz","_integrity":"sha512-snzDEUQBr+7xpS5qgbF8MIQeRyrRA8h4FbRAZdvMtPj2Bp1CouG2oDIV2Mo1uopqiCzpTwrSIegPIpkmKq+sOA==","authorInfo":{"url":"https://github.com/142vip","name":"微信公众号：储凡","email":"fairy_vip@2925.com","homePage":"https://142vip.cn"},"repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/commit-linter"},"_npmVersion":"10.5.0","description":"Git Commit 信息校验工具","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"@142vip/utils":"0.0.1-alpha.33"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/commit-linter_0.0.1-alpha.1_1744716993042_0.39274135171202285","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.2":{"name":"@142vip/commit-linter","version":"0.0.1-alpha.2","private":false,"description":"Git Commit 信息校验工具","author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/commit-linter/","repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/commit-linter"},"keywords":["公众号搜：储凡","142vip","@142vip","@142vip/commit-linter","commit","git commit","commit lint"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","authorInfo":{"name":"微信公众号：储凡","email":"fairy_vip@2925.com","url":"https://github.com/142vip","homePage":"https://142vip.cn"},"dependencies":{"@142vip/utils":"0.0.1-alpha.36"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"_id":"@142vip/commit-linter@0.0.1-alpha.2","_integrity":"sha512-Wyd/2d6SBdSnGA66rvAMPbtOw8mZimPQbsqSX3fjBJECY4EWxrkkQnF7370aEhKGZjDEUuYc4JdO41+x8gM04g==","_resolved":"/tmp/0ad6f643bbb037dfbbc16dd03c74b194/142vip-commit-linter-0.0.1-alpha.2.tgz","_from":"file:142vip-commit-linter-0.0.1-alpha.2.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-Wyd/2d6SBdSnGA66rvAMPbtOw8mZimPQbsqSX3fjBJECY4EWxrkkQnF7370aEhKGZjDEUuYc4JdO41+x8gM04g==","shasum":"d16aca898aff03afafc3d04ebcf3d98993989e1a","tarball":"https://registry.npmjs.org/@142vip/commit-linter/-/commit-linter-0.0.1-alpha.2.tgz","fileCount":8,"unpackedSize":22200,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHaAtgROv4aZJRJXG7KkwOvpaB0CpRTmNLPH446xu08zAiBg/LNILFNaWgb6/2ZjtuoEa/z+bJTSO2M0cSb1sOL4Qw=="}]},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"directories":{},"maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commit-linter_0.0.1-alpha.2_1747050275019_0.2557975526062888"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-15T11:36:32.981Z","modified":"2025-05-12T11:44:35.417Z","0.0.1-alpha.1":"2025-04-15T11:36:33.218Z","0.0.1-alpha.2":"2025-05-12T11:44:35.208Z"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/commit-linter/","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/commit-linter","commit","git commit","commit lint"],"repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/commit-linter"},"description":"Git Commit 信息校验工具","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"readme":"# @142vip/commit-linter\n\n[![NPM version](https://img.shields.io/npm/v/@142vip/commit-linter?labelColor=0b3d52&color=1da469&label=version)](https://www.npmjs.com/package/@142vip/commit-linter)\n\nGit Commit信息校验工具，统一团队提交规范\n\n## 安装\n\n```shell\n# 安装\npnpm i @142vip/commit-linter -D\n```\n\n## 使用\n\n```ts\nconst { type, scope, subject, commit } = commitLiner({\n  // scopes 为可选参数\n  scopes: ['release'],\n})\n\n// 配置\n/**\n * Git Commit信息校验参数\n */\nexport interface GitCommitLinterOptions {\n  /**\n   * Git Commit支持的Type列表，默认支持：\n   */\n  types?: string[]\n  /**\n   * Git Commit支持的Scope列表\n   */\n  scopes?: string[]\n}\n```\n\n## 最佳实践\n\n创建`verify-commit.ts`文件，添加如下代码：\n\n```ts\nimport { commitLiner } from '@142vip/commit-linter'\nimport { VipColor, VipConsole, vipLogger } from '@142vip/utils'\n\n/**\n * 验证Git Commit信息\n */\nasync function verifyCommitMain(): Promise<void> {\n  const { type, scope, subject, commit } = commitLiner()\n\n  // 提交符合规范，打印相关信息\n  VipConsole.log(`type: ${type}, scope: ${scope}, subject: ${subject}`)\n  vipLogger.logByBlank(`${VipColor.greenBright('Git Commit: ')} ${VipColor.green(commit)}`)\n}\n\nvoid verifyCommitMain()\n```\n\n修改`package.json`文件，配置`check:commit`命令，添加如下代码：\n\n```json5\n{\n  \"scripts\": {\n    \"check:commit\": \"npx node --loader ts-node/esm --no-warnings scripts/core/verify-commit.ts\"\n  }\n}\n```\n\n## 证书\n\n[MIT](https://opensource.org/license/MIT)\n\nCopyright (c) 2019-present, 142vip 储凡\n","readmeFilename":"README.md"}