Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lerna 相关 #27

Open
yinxin630 opened this issue Oct 12, 2019 · 0 comments
Open

lerna 相关 #27

yinxin630 opened this issue Oct 12, 2019 · 0 comments
Labels

Comments

@yinxin630
Copy link
Owner

推荐配置

{
  "packages": [
    "packages/*"
  ],
  "version": "0.0.0",                       # 使用统一版本模式, 会自动检测改动, 仅发布有修改的包
  "command": {
    "publish": {
      "conventionalCommits": true,          # 自动生成 changelog
      "ignoreChanges": [
        "*.md"                              # 忽略 md 文件改动
      ]
    },
    "version": {
      "message": "chore(publish): %s"       # 自定义发版的 commit message
    }
  }
}

常用操作

将当前目录初始化为 lerna 结构仓库

lerna init

安装所有包依赖

lerna bootstrap

添加 npm 依赖包

为所有包添加依赖 lerna add xxx
为指定包添加依赖 lerna add xxx --scope=module1 或者 lerna add xxx --scope=module-*

发布

lerna publish [bump]

常用 bump 取值: x.y.z / patch / minor / major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant