{"id":18409361,"url":"https://github.com/be-fe/conventional-changelog-befe","last_synced_at":"2025-04-12T21:52:20.001Z","repository":{"id":34199002,"uuid":"154770111","full_name":"be-fe/conventional-changelog-befe","owner":"be-fe","description":"conventional-changelog @baidu/preset for baidu BEFE","archived":false,"fork":false,"pushed_at":"2022-02-11T00:33:50.000Z","size":217,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-20T13:04:11.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/be-fe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-26T03:09:18.000Z","updated_at":"2020-07-17T15:38:13.000Z","dependencies_parsed_at":"2022-07-24T18:02:16.429Z","dependency_job_id":null,"html_url":"https://github.com/be-fe/conventional-changelog-befe","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be-fe%2Fconventional-changelog-befe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be-fe%2Fconventional-changelog-befe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be-fe%2Fconventional-changelog-befe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be-fe%2Fconventional-changelog-befe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/be-fe","download_url":"https://codeload.github.com/be-fe/conventional-changelog-befe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637833,"owners_count":21137538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T03:24:51.643Z","updated_at":"2025-04-12T21:52:19.981Z","avatar_url":"https://github.com/be-fe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# conventional-changelog-befe\n\n[![build status](https://img.shields.io/travis/be-fe/conventional-changelog-befe/master.svg?style=flat-square)](https://travis-ci.org/be-fe/conventional-changelog-befe)\n[![NPM version](https://img.shields.io/npm/v/conventional-changelog-befe.svg?style=flat-square)](https://www.npmjs.com/package/conventional-changelog-befe)\n[![NPM Downloads](https://img.shields.io/npm/dm/conventional-changelog-befe.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/conventional-changelog-befe)\n\n\u003e conventional-changelog preset for baidu BEFE.\n\n## 样例项目\n\n[icode commit-demo](http://icode.baidu.com/repos/baidu/personal-code/commit-demo)\n\n## 规范标准\n\n- [Commit message 和 Change log 编写指南](http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html)\n- [约定式提交](https://conventionalcommits.org/)\n\n除了上述规范标准以外，befe 规范还支持：\n\n### type 允许大写字母开头\n\n- `build/Build`: 构建相关\n- `chore/Chore`: 其他繁杂事务的变动\n- `ci/Ci`: ci 相关的变动\n- `docs/Docs`: 文档书写改动\n- `feat/Feat`: 新功能，新特性 **(体现在 changelog)**\n- `fix/Fix`: Bug 修复 **(体现在 changelog)**\n- `perf/Perf`: 性能优化相关 **(体现在 changelog)**\n- `refactor`: 重构（即不是新增功能，也不是修改 bug 的代码变动）\n- `revert/Revert`: 代码回滚 **(体现在 changelog)**\n- `style/Style`: Code Style 修改\n- `test/Test`: 测试相关\n- `temp/Temp`: 临时提交\n\n### scope / subject 允许中文\n\n```text\nfeat(编辑页面): 添加自动保存\n```\n\n### 特殊的\n\n#### 一个提交中包含多个 type (v2.0)\n\n有时候可能一次提交中涉及的操作比较多，这时候需要安装如下的规则提交，才能正常解析生成 changelog，当然更建议的还是分开提交啦。\n\n```text\nfix: foo \u0026 feat: add something \u0026 chore: abc @yucong02\n\nsome description\n```\n\n```text\nfix: foo\nfeat: add something\nchore: abc @yucong02\n\nsome description\n```\n\n#### 代码回滚 Revert\n\n除了支持规范定义的\n\n```text\nrevert: fix: something\n\nThis reverts commit 05699d0ded15dc35a038612a38185aa71274151.\n```\n\n同时支持默认 `git revert` message 模板\n\n```text\nRevert \"fix: something\"\n\nThis reverts commit 05699d0ded15dc35a038612a38185aa71274151.\n```\n\n### 支持 icode / baidu gitlab / icafe\n\n如果是 icode 或 baidu gitlab 仓库（会读取 `package.json` 中的 `repository` 或者 获取 git 远端地址），需要在 `package.json` 中配置 `icafe` 字段，对应为该项目的 icafe Id。\n\n```json\n{\n  \"icafe\": \"dulife-hr\"\n}\n```\n\n或者\n\n```json\n{\n  \"icafe\": {\n    \"spaceId\": \"dulife-hr\"\n  }\n}\n```\n\n然后在 commit message 中匹配的 `#123` 将会在 changelog 对应为 icafe 对应 issue 地址。\n\n如果是想关联其他项目的卡片，则需要在 commit message 中书写完整的 icafe ID, 如\n\n```text\nfeat: 完成 changelog 文档任务\n\ncloses BEFE-ERP-225 befe-erp-564\n```\n\n### changelog 支持中英文\n\n在 `package.json` 中配置\n\n```js\n{\n  \"lang\": \"zh\" // 'zh' | 'en'\n}\n```\n\n默认为系统语言\n\n## 使用\n\n### 安装\n\n```\nnpm i conventional-changelog-cli conventional-changelog-befe -D\n```\n\n### 在项目 (`package.json`) 配置\n\n```json\n{\n  \"scripts\": {\n    \"changelog\": \"conventional-changelog -p befe -i CHANGELOG.md -s -r 0 \u0026\u0026 git add CHANGELOG.md\",\n    \"version\": \"npm run changelog\"\n  }\n}\n```\n\n### 触发\n\n执行 `npm version [version]` 或直接执行 `npm run changelog`\n\n### 配置\n\n- `package.json`\n\n```json\n{\n  \"config\": {\n    \"conventional-changelog-befe\": {\n      \"i18n\": {\n        \"fix.title\": \"🐛 BugFix\"\n      }\n    }\n  }\n}\n```\n\n#### `i18n`\n\n自定义国际化文本，包含[国际化文本](i18n/zh.js)\n\n- Type: `{}`\n- Default: `{}`\n\n## Related\n\n- [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) - 根据 commit message 生成 changelog\n- [commitlint](https://github.com/marionebl/commitlint) - Lint commit messages\n- [commitlint-config-befe](http://gitlab.baidu.com/be-fe/commitlint-config-befe) - commitlint lint 预设\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbe-fe%2Fconventional-changelog-befe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbe-fe%2Fconventional-changelog-befe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbe-fe%2Fconventional-changelog-befe/lists"}