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

  • lerna.jsonGitHublerna/lernanpm 支持 workspace 后 lerna 已很少使用 · #1243 · Lerna 的主要目的是帮助 monorepo 发布 多个包,而不是帮助本地开发本地多模块 - 这是 yarn workspace 的目的 · Lerna 可以配合 yarn workspace 一起使用笔记:Lerna
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"
}

关联信息

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

References

GitHub4 条
其他外链1 条
最近更新commit fc53617Edit

On this page