跳至正文
Wener Notes

Lerna

约 1 分钟阅读

npm 支持 workspace 后 lerna 已很少使用

bash
# npx lerna init
yarn dlx lerna init

# 项目间依赖
lerna add @wener/core --scope=@wener/admin

yarn lerna publish 1.0.0 -y --skip-git

# 只修改版本 - 不 push
yarn lerna version prerelease --no-push

# 当前 git 版本
git describe --abbrev=0 --tags
# 发布 git 版本 - 用于发布失败的时候
yarn lerna from-git

lerna.json

json
{
  "packages": ["packages/*"],
  "command": {
    "create": {
      "homepage": "https://github.com/lerna/lerna",
      "license": "MIT"
    },
    "version": {
      "allowBranch": "master",
      "conventionalCommits": true,
      "exact": true,
      "gitRemote": "upstream",
      "message": "chore(release): %s"
    }
  },
  "ignoreChanges": ["**/__fixtures__/**", "**/__tests__/**", "**/*.md"],
  "version": "3.20.2"
}

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub4 条
其他外链1 条
最近更新commit fc53617编辑