@0x-lerna-fork/global-options 中文文档教程
@0x-lerna-fork/global-options
适用于 every lerna 子命令的全局选项
Options
--concurrency
当 Lerna 并行化任务时使用多少线程(默认为逻辑 CPU 核心数)
$ lerna publish --concurrency 1
--loglevel <silent|error|warn|success|info|verbose|silly>
要报告的日志级别。 失败时,所有日志都写入当前工作目录中的 lerna-debug.log。
显示比设置更高级别的任何日志。 默认值为“信息”。
--max-buffer <bytes>
为每个底层进程调用设置最大缓冲区长度。 有用的例子 当有人想导入一个有大量提交的回购时 运行 lerna import
。 在这种情况下,内置缓冲区长度可能不会 足够了。
--no-progress
禁用进度条。 在 CI 环境中总是如此。
--no-sort
默认情况下,所有任务都以拓扑排序的顺序在包上执行,以尊重相关包的依赖关系。 循环是在尽力而为的基础上以一种不能保证在 Lerna 调用中保持一致的方式被打破的。
如果有少量的包有很多依赖项,或者如果某些包的执行时间过长,拓扑排序可能会导致并发瓶颈。 --no-sort
选项禁用排序,而是以最大并发度以任意顺序执行任务。
如果您运行多个“监视”命令,此选项也有帮助。 由于 lerna run
将按拓扑排序的顺序执行命令,因此它可能会在继续之前等待命令。 这将在您运行“watch”命令时阻止执行,因为它们通常永远不会结束。 “watch”命令的一个例子是 运行 babel
和 --watch
CLI 标志。
--reject-cycles
如果发现循环(在 bootstrap
、exec
、publish
或 run
中),则立即失败。
$ lerna bootstrap --reject-cycles
@0x-lerna-fork/global-options
Global options applicable to every lerna sub-command
Options
--concurrency
How many threads to use when Lerna parallelizes the tasks (defaults to count of logical CPU cores)
$ lerna publish --concurrency 1
--loglevel <silent|error|warn|success|info|verbose|silly>
What level of logs to report. On failure, all logs are written to lerna-debug.log in the current working directory.
Any logs of a higher level than the setting are shown. The default is "info".
--max-buffer <bytes>
Set a max buffer length for each underlying process call. Useful for example when someone wants to import a repo with a larger amount of commits while running lerna import
. In that case the built-in buffer length might not be sufficient.
--no-progress
Disable progress bars. This is always the case in a CI environment.
--no-sort
By default, all tasks execute on packages in topologically sorted order as to respect the dependency relationships of the packages in question. Cycles are broken on a best-effort basis in a way not guaranteed to be consistent across Lerna invocations.
Topological sorting can cause concurrency bottlenecks if there are a small number of packages with many dependents or if some packages take a disproportionately long time to execute. The --no-sort
option disables sorting, instead executing tasks in an arbitrary order with maximum concurrency.
This option can also help if you run multiple "watch" commands. Since lerna run
will execute commands in topologically sorted order, it can end up waiting for a command before moving on. This will block execution when you run "watch" commands, since they typically never end. An example of a "watch" command is running babel
with the --watch
CLI flag.
--reject-cycles
Fail immediately if a cycle is found (in bootstrap
, exec
, publish
or run
).
$ lerna bootstrap --reject-cycles