Lerna
约 1 分钟阅读
npm 支持 workspace 后 lerna 已很少使用
- #1243GitHub Issuelerna/lerna#1243
- Lerna 的主要目的是帮助 monorepo 发布 多个包,而不是帮助本地开发本地多模块 - 这是 yarn workspace 的目的
- Lerna 可以配合 yarn workspace 一起使用
- 问题
- yarn2 workspace protocol support - #2564GitHub Issuelerna/lerna#2564
- 失败无法恢复 - #455GitHub Issuelerna/lerna#455
- 建议
--no-push - 考虑版本修改和发布分开
lerna version && lerna publish from-git
- 建议
- 参考
- Why Lerna and Yarn Workspaces is a Perfect Match for Building Mono-Repos链接doppelmutzi.github.io/monorepo-lerna-yarn-workspacesnpm 支持 workspace 后 lerna 已很少使用 · #1243 · Lerna 的主要目的是帮助 monorepo 发布 多个包,而不是帮助本地开发本地多模块 - 这是 yarn workspace 的目的 · Lerna 可以配合 yarn workspace 一起使用笔记:Lerna
# 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-gitlerna.json
- lerna.jsonGitHublerna/lernanpm 支持 workspace 后 lerna 已很少使用 · #1243 · Lerna 的主要目的是帮助 monorepo 发布 多个包,而不是帮助本地开发本地多模块 - 这是 yarn workspace 的目的 · Lerna 可以配合 yarn workspace 一起使用笔记:Lerna
{
"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 条
- lerna/lernagithub.com/lerna/lerna
- lerna/lerna#1243github.com/lerna/lerna/issues/1243
- lerna/lerna#2564github.com/lerna/lerna/issues/2564
- lerna/lerna#455github.com/lerna/lerna/issues/455
其他外链1 条
- doppelmutzi.github.io/monorepo-lerna-yarn-workspacesdoppelmutzi.github.io/monorepo-lerna-yarn-workspaces