kaola-fed / blog

kaola blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

公共类库版本发布流程实践

ImHype opened this issue · comments

commented

没有规范的 npm 版本发布会面临什么问题?

  • 新特性与bug修复版本号没有规范,在一个版本中既有 bug 修复,又有新特性引入,无形之中会引入新的 bug;
  • 用户不敢随意升级

学习 git tag 和 npm tag

git tag

npm tag

版本分类

版本类型 分支名 npm tag 定位
stable master latest 稳定版本代码管理
next develop next 开发集成测试版本
hotfix hotfix_proxy hotfix_proxy 修复当前 stable 版本 bug
feature feature_dubbo feature_dubbo 新特性开发自测,使用者一般不关心

包管理方案 LERNA

我们的某个公共项目在开发中使用了 lerna,主要利用了以下特性

  • 多 package 集中管理;
  • 版本号管理规范;
  • 对 npm tag 与 git tag 友好,一键式使用;

版本状态转移

https://haitao.nos.netease.com/7e8c4053-b22d-4025-8422-e0a6e1e8372a.jpg