{"_id":"@be-link/be-link-husky","_rev":"5-631995917431710f63b7a6523b9e11be","name":"@be-link/be-link-husky","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.1":{"name":"@be-link/be-link-husky","version":"1.0.1","keywords":["git","hooks","pre-commit"],"author":{"name":"zhuiyi"},"license":"MIT","_id":"@be-link/be-link-husky@1.0.1","maintainers":[{"name":"8848top-dev","email":"dev@8848top.com"},{"name":"hanguodong","email":"875521275@qq.com"},{"name":"wangml0310","email":"2576306481@qq.com"}],"homepage":"https://github.com/snowmountain-top/be-link","bugs":{"url":"https://github.com/snowmountain-top/be-link/issues"},"bin":{"be-link-husky":"bin/index.js"},"dist":{"shasum":"57c626e05b8e5beb9f2d11ab937a36d3a1e20819","tarball":"https://registry.npmjs.org/@be-link/be-link-husky/-/be-link-husky-1.0.1.tgz","fileCount":10,"integrity":"sha512-0ZYxj74Tb6uGje0C9rPcXiF4lfTnLzNtVFgr/8J3I9CpTP740Sxhb8UQBoMCMEXt2Q5U1yh7xc3vDwm+J8TYVw==","signatures":[{"sig":"MEQCIGpvqmBYMOn9zY3YpFbfhmDZ9zB+A3br6Vb7uqNSRHeDAiBZmpU+xQrW78Ww579R8Zgij8vh8MT6shXXAWfkvTyQpg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21929},"type":"module","_from":"file:be-link-be-link-husky-1.0.1.tgz","engines":{"node":"16.x || 18.x || 20.x"},"scripts":{"test":"pnpm build && node bin/index.js","build":"tsc"},"_npmUser":{"name":"8848top-dev","email":"dev@8848top.com"},"_resolved":"/tmp/7a883677005ee76ba4cdf6bec429d027/be-link-be-link-husky-1.0.1.tgz","_integrity":"sha512-0ZYxj74Tb6uGje0C9rPcXiF4lfTnLzNtVFgr/8J3I9CpTP740Sxhb8UQBoMCMEXt2Q5U1yh7xc3vDwm+J8TYVw==","repository":{"url":"git+https://github.com/snowmountain-top/be-link.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern native Git hooks made easy","directories":{},"packageInfo":{"repoPath":"packages/be-link-husky"},"_nodeVersion":"18.20.8","dependencies":{"chalk":"^4.1.2","colors":"^1.4.0","lodash":"^4.17.21","npmlog":"^6.0.2","semver":"^7.5.3","shelljs":"^0.8.5","fs-extra":"^11.1.1","commander":"^11.0.0"},"publishConfig":{"access":"public","directory":"."},"_hasShrinkwrap":false,"devDependencies":{"@types/lodash":"^4.14.195","@types/npmlog":"^4.1.4","@types/semver":"^7.5.0","@types/shelljs":"^0.8.12","@types/fs-extra":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/be-link-husky_1.0.1_1761813729919_0.4052028047266054","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@be-link/be-link-husky","version":"1.0.2","keywords":["git","hooks","pre-commit"],"author":{"name":"zhuiyi"},"license":"MIT","_id":"@be-link/be-link-husky@1.0.2","maintainers":[{"name":"8848top-dev","email":"dev@8848top.com"},{"name":"hanguodong","email":"875521275@qq.com"},{"name":"wangml0310","email":"2576306481@qq.com"}],"homepage":"https://github.com/snowmountain-top/be-link","bugs":{"url":"https://github.com/snowmountain-top/be-link/issues"},"bin":{"be-link-husky":"bin/index.js"},"dist":{"shasum":"748f0ca6755c8887ea644fd643fd39e08f5fff83","tarball":"https://registry.npmjs.org/@be-link/be-link-husky/-/be-link-husky-1.0.2.tgz","fileCount":10,"integrity":"sha512-WSlJdodjGXEfVIFm8qVD3JMAtw6rWSc6IpmT62dhZ3Dxo7iAysCylWly2+h9r0vu8Oy0L5ppFTGuFWPYHYRnRA==","signatures":[{"sig":"MEQCIFHyuAiZ3lc1vv9XI0Rr8XkHdTL03Nf6uOog1UxXuK3pAiBZUd8YLEKyako3bAm4u6nPVw8ZeqaVGy3KiADevGaFCA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24051},"type":"module","_from":"file:be-link-be-link-husky-1.0.2.tgz","engines":{"node":"16.x || 18.x || 20.x"},"scripts":{"test":"pnpm build && node bin/index.js","build":"tsc"},"_npmUser":{"name":"8848top-dev","email":"dev@8848top.com"},"_resolved":"/tmp/ba4b7e65dc8bbfc06e49d3763e24a67b/be-link-be-link-husky-1.0.2.tgz","_integrity":"sha512-WSlJdodjGXEfVIFm8qVD3JMAtw6rWSc6IpmT62dhZ3Dxo7iAysCylWly2+h9r0vu8Oy0L5ppFTGuFWPYHYRnRA==","repository":{"url":"git+https://github.com/snowmountain-top/be-link.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern native Git hooks made easy","directories":{},"packageInfo":{"repoPath":"packages/be-link-husky"},"_nodeVersion":"18.20.8","dependencies":{"chalk":"^4.1.2","colors":"^1.4.0","lodash":"^4.17.21","npmlog":"^6.0.2","semver":"^7.5.3","shelljs":"^0.8.5","fs-extra":"^11.1.1","commander":"^11.0.0"},"publishConfig":{"access":"public","directory":"."},"_hasShrinkwrap":false,"devDependencies":{"@types/lodash":"^4.14.195","@types/npmlog":"^4.1.4","@types/semver":"^7.5.0","@types/shelljs":"^0.8.12","@types/fs-extra":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/be-link-husky_1.0.2_1762843816182_0.8929270516931935","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@be-link/be-link-husky","version":"1.0.3","keywords":["git","hooks","pre-commit"],"author":{"name":"zhuiyi"},"license":"MIT","_id":"@be-link/be-link-husky@1.0.3","maintainers":[{"name":"8848top-dev","email":"dev@8848top.com"},{"name":"hanguodong","email":"875521275@qq.com"},{"name":"wangml0310","email":"2576306481@qq.com"}],"homepage":"https://github.com/snowmountain-top/be-link","bugs":{"url":"https://github.com/snowmountain-top/be-link/issues"},"bin":{"be-link-husky":"bin/index.js"},"dist":{"shasum":"35374caffbd866a1c1e65cd128295bcc4995cfc1","tarball":"https://registry.npmjs.org/@be-link/be-link-husky/-/be-link-husky-1.0.3.tgz","fileCount":10,"integrity":"sha512-b9QTWyft4+Rf0qgcqh0kNCEundx/QZNSMs+t7iLU2KYBJGlNFZIehDXE1YU8PBIBAz/yGzmcyTc1Lmap6Vno2A==","signatures":[{"sig":"MEYCIQCx02hv9OjDf1ZtziZhJuQmRUkNpOIizbHCbjvfzjsYegIhALMETnKhk8etd9AWh7OtBws+tCuASp1n/9k3oJT08gv6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24107},"type":"module","_from":"file:be-link-be-link-husky-1.0.3.tgz","engines":{"node":"16.x || 18.x || 20.x"},"scripts":{"test":"pnpm build && node bin/index.js","build":"tsc"},"_npmUser":{"name":"8848top-dev","email":"dev@8848top.com"},"_resolved":"/tmp/9b1e499ab4c01a877daec58878ccdd8b/be-link-be-link-husky-1.0.3.tgz","_integrity":"sha512-b9QTWyft4+Rf0qgcqh0kNCEundx/QZNSMs+t7iLU2KYBJGlNFZIehDXE1YU8PBIBAz/yGzmcyTc1Lmap6Vno2A==","repository":{"url":"git+https://github.com/snowmountain-top/be-link.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern native Git hooks made easy","directories":{},"packageInfo":{"repoPath":"packages/be-link-husky"},"_nodeVersion":"18.20.8","dependencies":{"chalk":"^4.1.2","colors":"^1.4.0","lodash":"^4.17.21","npmlog":"^6.0.2","semver":"^7.5.3","shelljs":"^0.8.5","fs-extra":"^11.1.1","commander":"^11.0.0"},"publishConfig":{"access":"public","directory":"."},"_hasShrinkwrap":false,"devDependencies":{"@types/lodash":"^4.14.195","@types/npmlog":"^4.1.4","@types/semver":"^7.5.0","@types/shelljs":"^0.8.12","@types/fs-extra":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/be-link-husky_1.0.3_1763719935888_0.9684753485198503","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@be-link/be-link-husky","version":"1.0.5","keywords":["git","hooks","pre-commit"],"author":{"name":"zhuiyi"},"license":"MIT","_id":"@be-link/be-link-husky@1.0.5","maintainers":[{"name":"8848top-dev","email":"dev@8848top.com"},{"name":"hanguodong","email":"875521275@qq.com"},{"name":"wangml0310","email":"2576306481@qq.com"}],"homepage":"https://github.com/snowmountain-top/be-link","bugs":{"url":"https://github.com/snowmountain-top/be-link/issues"},"bin":{"be-link-husky":"bin/index.js"},"dist":{"shasum":"d3c7ff99cfe3e63209bd0ecec423e040d8e2dfc9","tarball":"https://registry.npmjs.org/@be-link/be-link-husky/-/be-link-husky-1.0.5.tgz","fileCount":10,"integrity":"sha512-l+wZ9TXpmOgAE7YchwysQAm+qNOcoxRDOT3E7+hE4QEKHuNla9vIFhFxxcJms5FTpIpsKgrFgImrvjtKTbjvtA==","signatures":[{"sig":"MEUCID4kPGBSC0/aIChFgq3M5MPdjJbrL6I5p9VqLPEoY2XfAiEAv1v3vgPEs0abUU31H7CSvAPVLRukpFm0cgJs8/8tLVg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26892},"type":"module","_from":"file:be-link-be-link-husky-1.0.5.tgz","engines":{"node":"16.x || 18.x || 20.x"},"scripts":{"test":"pnpm build && node bin/index.js","build":"tsc"},"_npmUser":{"name":"8848top-dev","email":"dev@8848top.com"},"_resolved":"/tmp/61fba9882093bc03dd7a663f8c78b2f2/be-link-be-link-husky-1.0.5.tgz","_integrity":"sha512-l+wZ9TXpmOgAE7YchwysQAm+qNOcoxRDOT3E7+hE4QEKHuNla9vIFhFxxcJms5FTpIpsKgrFgImrvjtKTbjvtA==","repository":{"url":"git+https://github.com/snowmountain-top/be-link.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern native Git hooks made easy","directories":{},"packageInfo":{"repoPath":"packages/be-link-husky"},"_nodeVersion":"18.20.8","dependencies":{"chalk":"^4.1.2","colors":"^1.4.0","lodash":"^4.17.21","npmlog":"^6.0.2","semver":"^7.5.3","shelljs":"^0.8.5","fs-extra":"^11.1.1","commander":"^11.0.0"},"publishConfig":{"access":"public","directory":"."},"_hasShrinkwrap":false,"devDependencies":{"@types/lodash":"^4.14.195","@types/npmlog":"^4.1.4","@types/semver":"^7.5.0","@types/shelljs":"^0.8.12","@types/fs-extra":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/be-link-husky_1.0.5_1765786927713_0.4711528795157427","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@be-link/be-link-husky","version":"1.0.6","description":"Modern native Git hooks made easy","keywords":["git","hooks","pre-commit"],"homepage":"https://github.com/snowmountain-top/be-link","author":{"name":"zhuiyi"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/snowmountain-top/be-link.git"},"bugs":{"url":"https://github.com/snowmountain-top/be-link/issues"},"type":"module","bin":{"be-link-husky":"bin/index.js"},"engines":{"node":">=18.0.0"},"dependencies":{"chalk":"^4.1.2","commander":"^11.0.0","fs-extra":"^11.1.1","lodash":"^4.17.21","npmlog":"^6.0.2","semver":"^7.5.3","shelljs":"^0.8.5"},"devDependencies":{"@types/fs-extra":"^11.0.1","@types/lodash":"^4.14.195","@types/npmlog":"^4.1.4","@types/semver":"^7.5.0","@types/shelljs":"^0.8.12"},"publishConfig":{"access":"public","directory":"."},"packageInfo":{"repoPath":"packages/be-link-husky"},"scripts":{"test":"pnpm build && node bin/index.js","build":"tsc"},"_id":"@be-link/be-link-husky@1.0.6","_integrity":"sha512-3rM444zGUcG/Hh7SEO71+OxBNbp173N5tLl0iwuDi7TmvDAjzknMF6csVVA+BCqJnKVu4xxMFc2vpV15sprxvA==","_resolved":"/tmp/3f8e599e2bf3a25c43bb247ac7f08d1b/be-link-be-link-husky-1.0.6.tgz","_from":"file:be-link-be-link-husky-1.0.6.tgz","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-3rM444zGUcG/Hh7SEO71+OxBNbp173N5tLl0iwuDi7TmvDAjzknMF6csVVA+BCqJnKVu4xxMFc2vpV15sprxvA==","shasum":"36a3a23477071ee086771412a75b1a165be8f483","tarball":"https://registry.npmjs.org/@be-link/be-link-husky/-/be-link-husky-1.0.6.tgz","fileCount":10,"unpackedSize":28611,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCbnJ8nkkqzyG8BBBWs5PiYGcW1ryKzlr0bsHOiIOzB7gIgdY4+QxfchjTCrysNpC3twixGu5VjhZ/wO3U5N9/a9MI="}]},"_npmUser":{"name":"8848top-dev","email":"dev@8848top.com"},"directories":{},"maintainers":[{"name":"8848top-dev","email":"dev@8848top.com"},{"name":"hanguodong","email":"875521275@qq.com"},{"name":"wangml0310","email":"2576306481@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/be-link-husky_1.0.6_1765810595846_0.9403100088154419"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-30T08:42:09.856Z","modified":"2025-12-15T14:56:36.228Z","1.0.1":"2025-10-30T08:42:10.128Z","1.0.2":"2025-11-11T06:50:16.418Z","1.0.3":"2025-11-21T10:12:16.097Z","1.0.5":"2025-12-15T08:22:07.837Z","1.0.6":"2025-12-15T14:56:36.009Z"},"bugs":{"url":"https://github.com/snowmountain-top/be-link/issues"},"author":{"name":"zhuiyi"},"license":"MIT","homepage":"https://github.com/snowmountain-top/be-link","keywords":["git","hooks","pre-commit"],"repository":{"type":"git","url":"git+https://github.com/snowmountain-top/be-link.git"},"description":"Modern native Git hooks made easy","maintainers":[{"name":"8848top-dev","email":"dev@8848top.com"},{"name":"hanguodong","email":"875521275@qq.com"},{"name":"wangml0310","email":"2576306481@qq.com"}],"readme":"# 📦 @be-link/be-link-husky\n\n> Git hooks 自动化配置工具，统一管理团队开发规范\n\n## ✨ 特性\n\n- 🚀 **一键配置** - 自动安装 husky、commitlint、lint-staged\n- 🔒 **版本锁定** - 根据 Node 版本自动选择兼容的依赖版本\n- 🌲 **分支规范** - 强制执行 `花名/类型-分支名` 命名规范\n- ✅ **提交规范** - 基于 conventional commits 校验提交信息\n- 🎨 **代码检查** - 提交前自动运行 lint-staged\n\n## 📦 快速开始\n\n### 1. 安装\n\n```bash\npnpm install @be-link/be-link-husky -D\n```\n\n### 2. 配置 package.json\n\n```json\n{\n  \"scripts\": {\n    \"prepare\": \"be-link-husky\"\n  }\n}\n```\n\n支持的参数：\n\n- `-p, --package-manager` - 指定包管理器 (默认: `pnpm`)\n- `-r, --registry` - 指定 npm registry (默认: `https://registry.npmjs.org/`)\n- `-i, --install` - husky 安装目录 (默认: `.husky`)\n- `-s, --skip-install` - 跳过依赖安装\n\n示例：\n\n```json\n{\n  \"scripts\": {\n    \"prepare\": \"be-link-husky -p=npm -r=https://registry.npmjs.org/\"\n  }\n}\n```\n\n### 3. 首次运行\n\n```bash\npnpm install\n```\n\n工具会自动：\n\n1. ✅ 检测 Node.js 版本\n2. ✅ 安装匹配的依赖\n3. ✅ 配置 git hooks\n4. ✅ 创建 commitlint 配置文件\n\n## 📝 使用规范\n\n### 分支命名规范\n\n**格式：** `花名/类型-分支名`\n\n- **花名**：只允许字母（大小写）、下划线、连字符，不允许数字\n- **类型**：chore, docs, feat, fix, perf, refactor, revert, style, test, hotfix\n- **分支名**：允许字母、数字、下划线、点、连字符\n\n#### 示例\n\n```bash\n# ✅ 正确\ngit checkout -b ZhangSan/feat-add-login\ngit checkout -b LiSi/fix-user-avatar-bug\ngit checkout -b Wang_Wu/refactor-payment-module\n\n# ❌ 错误\ngit checkout -b zhang123/feat-add-login    # 花名包含数字\ngit checkout -b feat/add-login             # 缺少花名\ngit checkout -b ZhangSan-feat-add-login    # 格式错误\n```\n\n### Commit 消息规范\n\n**格式：** `<type>(<scope>): <subject>`\n\n#### 支持的类型\n\n| Type       | 说明      | 示例                             |\n| ---------- | --------- | -------------------------------- |\n| `feat`     | 新功能    | `feat(user): 添加用户登录功能`   |\n| `fix`      | 修复 Bug  | `fix(auth): 修复 token 过期问题` |\n| `docs`     | 文档变更  | `docs(readme): 更新安装说明`     |\n| `style`    | 代码格式  | `style(app): 统一代码缩进`       |\n| `refactor` | 重构      | `refactor(api): 优化接口结构`    |\n| `perf`     | 性能优化  | `perf(list): 优化列表渲染性能`   |\n| `test`     | 测试相关  | `test(user): 添加用户模块测试`   |\n| `chore`    | 构建/工具 | `chore(deps): 升级依赖版本`      |\n\n#### 示例\n\n```bash\n# ✅ 正确\ngit commit -m \"feat(user): 添加用户登录功能\"\ngit commit -m \"fix(cart): 修复购物车计算错误\"\ngit commit -m \"docs: 更新 README\"\n\n# ❌ 错误\ngit commit -m \"add login\"              # 缺少 type\ngit commit -m \"Add: 添加登录功能\"       # type 必须小写\ngit commit -m \"feat:添加登录功能\"       # 冒号后需要空格\n```\n\n## 🔧 版本管理策略\n\n### 设计思想\n\n本工具采用**集中式版本管理**策略，所有依赖版本由 `be-link-husky` 统一管理，确保：\n\n- ✅ 团队成员环境一致\n- ✅ 依赖版本兼容\n- ✅ 规则快速更新\n\n### 管理的依赖\n\n| 依赖包                            | 作用           | Node 16 | Node 18/20        |\n| --------------------------------- | -------------- | ------- | ----------------- |\n| `husky`                           | Git hooks 管理 | ^8.0.3  | ^8.0.3 / ^9.1.7   |\n| `@commitlint/cli`                 | Commit 校验    | ^17.8.1 | ^20.1.0           |\n| `@commitlint/config-conventional` | 标准配置       | ^17.8.1 | ^20.0.0           |\n| `@be-link/commitlint-config`      | 团队配置       | latest  | latest            |\n| `lint-staged`                     | 代码检查       | ^13.3.0 | ^15.5.2 / ^16.2.6 |\n\n> **为什么 `@be-link/commitlint-config` 使用 latest？**  \n> 团队内部配置包使用 `latest` 确保所有项目始终使用最新的规则，保持团队标准统一。\n\n## 🏗️ 架构设计\n\n```\n用户项目\n  ↓ 安装\n@be-link/be-link-husky (版本管理器)\n  ↓ 自动安装\n┌─────────────────────────────────────┐\n│ • husky                             │\n│ • @commitlint/cli                   │\n│ • @commitlint/config-conventional   │\n│ • @be-link/commitlint-config        │ ← 纯配置包，只提供规则\n│ • lint-staged                       │\n└─────────────────────────────────────┘\n```\n\n**职责划分：**\n\n- **@be-link/be-link-husky**：版本管理 + 自动化配置\n- **@be-link/commitlint-config**：只提供 commit 规则配置\n\n详细设计请查看 [架构文档](./ARCHITECTURE.md)\n\n## 📚 更多信息\n\n- 查看命令帮助：`npx @be-link/be-link-husky -h`\n- 详细架构设计：[ARCHITECTURE.md](./ARCHITECTURE.md)\n- Commit 规则配置：[@be-link/commitlint-config](../commitlint-config/README.md)\n\n## 🤝 贡献\n\n欢迎提交 Issue 和 Pull Request！\n\n## 📄 License\n\nMIT\n","readmeFilename":"README.md"}