Skip to content

lerna - Lerna an Nx

仲灏2023-02-08约 1 分钟

<div style="display: none;" hidden="true" aria-hidden="true" data-nosnippet>Are you an LLM? You can read better optimized documentation at /pages/8c0e85.md for this page in Markdown format</div>

Lerna

功能

  1. 版本 - 自动增加包的版本,生成更新日志信息,创建Github版本等。
  2. 部署 - 自动创建标记并将包发布到包注册中心,如npm

安装

  • npm install lerna
  • npc lerna init

Nx

功能

  1. 只运行受代码更改影响的任务
  2. 首先运行必备任务
  3. 本地缓存任务结果
  4. 可视化项目图
  5. Nx Console-Visual Studio代码插件

安装

  • npx lerna add-caching
  • 继续像往常一样使用Lerna

note

lerna run 的一些命令将与旧版本的lerna表现不同。更多细节请参见使用Lerna(由Nx支持)来运行任务。

Nx Cloud

功能

  1. 跨组织共享缓存的任务结果
  2. 在代理计算机之间高效地分配任务执行

费用

对于闭源存储库,每月前500个计算小时是免费的。大多数存储库都不会超过这个限制。之后每计算小时$1。

安装

  • npx nx connect-to-nx-cloud
  • nx generate @nrwl/workspace:ci-workflow(或手动设置CI)
  • 继续像往常一样使用Lerna

功能