Skip to content

lerna 相关 #27

@yinxin630

Description

@yinxin630

推荐配置

{
  "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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions