@0x-lerna-fork/filter-options 中文文档教程
@0x-lerna-fork/filter-options
需要过滤的 lerna 子命令的选项
安装 lerna 以访问 lerna
CLI。
Options
--scope <glob>
仅包含名称与给定 glob 匹配的包。
$ lerna exec --scope my-component -- ls -la
$ lerna run --scope toolbar-* test
$ lerna run --scope package-1 --scope *-2 lint
注意:对于某些 glob,可能需要引用选项参数以避免过早的 shell 扩展。
--ignore <glob>
排除名称与给定 glob 匹配的包。
$ lerna exec --ignore package-{1,2,5} -- ls -la
$ lerna run --ignore package-1 test
$ lerna run --ignore package-@(1|2) --ignore package-3 lint
可以在此处。
--no-private
排除私人包裹。 默认包含它们。
--since [ref]
仅包含自指定的 ref
以来已更新的包。 如果未传递 ref,则默认为最新标签。
# List the contents of packages that have changed since the latest tag
$ lerna exec --since -- ls -la
# Run the tests for all packages that have changed since `master`
$ lerna run test --since master
# List all packages that have changed since `some-branch`
$ lerna ls --since some-branch
这在 CI 中使用时特别有用,如果您可以获得 PR 将进入的目标分支,因为您可以将其用作 的
选项。 这对于进入主分支和功能分支的 PR 非常有效。ref
-- 因为
--include-filtered-dependents
在运行命令时包括所有可传递的依赖项,而不考虑 --scope
、--ignore
,或 --since
。
--include-filtered-dependencies
无论 --scope
、--ignore
或 --since
,在运行命令时包括所有传递依赖项。
与任何接受 --scope
的命令结合使用(bootstrap
、clean
、ls
、run ,<代码>执行)。 确保任何作用域包的所有依赖项(和开发依赖项)(通过
--scope
或 --ignore
)也被操作。
注意:这将覆盖
--scope
和--ignore
标志。即,如果一个被
--ignore
标志匹配的包被另一个正在引导的包所依赖,它仍然会被引导。
这对于您想要“设置”依赖于正在设置的其他包的单个包的情况很有用。
$ lerna bootstrap --scope my-component --include-filtered-dependencies
# my-component and all of its dependencies will be bootstrapped
$ lerna bootstrap --scope "package-*" --ignore "package-util-*" --include-filtered-dependencies
# all packages matching "package-util-*" will be ignored unless they are
# depended upon by a package whose name matches "package-*"
@0x-lerna-fork/filter-options
Options for lerna sub-commands that need filtering
Install lerna for access to the lerna
CLI.
Options
--scope <glob>
Include only packages with names matching the given glob.
$ lerna exec --scope my-component -- ls -la
$ lerna run --scope toolbar-* test
$ lerna run --scope package-1 --scope *-2 lint
Note: For certain globs, it may be necessary to quote the option argument to avoid premature shell expansion.
--ignore <glob>
Exclude packages with names matching the given glob.
$ lerna exec --ignore package-{1,2,5} -- ls -la
$ lerna run --ignore package-1 test
$ lerna run --ignore package-@(1|2) --ignore package-3 lint
More examples of filtering can be found here.
--no-private
Exclude private packages. They are included by default.
--since [ref]
Only include packages that have been updated since the specified ref
. If no ref is passed, it defaults to the most-recent tag.
# List the contents of packages that have changed since the latest tag
$ lerna exec --since -- ls -la
# Run the tests for all packages that have changed since `master`
$ lerna run test --since master
# List all packages that have changed since `some-branch`
$ lerna ls --since some-branch
This can be particularly useful when used in CI, if you can obtain the target branch a PR will be going into, because you can use that as the ref
to the --since
option. This works well for PRs going into master as well as feature branches.
--include-filtered-dependents
Include all transitive dependents when running a command regardless of --scope
, --ignore
, or --since
.
--include-filtered-dependencies
Include all transitive dependencies when running a command regardless of --scope
, --ignore
, or --since
.
Used in combination with any command that accepts --scope
(bootstrap
, clean
, ls
, run
, exec
). Ensures that all dependencies (and dev dependencies) of any scoped packages (either through --scope
or --ignore
) are operated on as well.
Note: This will override the
--scope
and--ignore
flags.i.e. A package matched by the
--ignore
flag will still be bootstrapped if it is depended on by another package that is being bootstrapped.
This is useful for situations where you want to "set up" a single package that relies on other packages being set up.
$ lerna bootstrap --scope my-component --include-filtered-dependencies
# my-component and all of its dependencies will be bootstrapped
$ lerna bootstrap --scope "package-*" --ignore "package-util-*" --include-filtered-dependencies
# all packages matching "package-util-*" will be ignored unless they are
# depended upon by a package whose name matches "package-*"
你可能也喜欢
- 3m5-banner-engine 中文文档教程
- @100shapes/monday-ui 中文文档教程
- @160over90/vue-tweened-number 中文文档教程
- @168-cli/log 中文文档教程
- @1productaweek/npm-starter 中文文档教程
- @1tm/eslint-config-1tm-react 中文文档教程
- @a15396222371/batman-component-template 中文文档教程
- @abdevs/discord.js-utils 中文文档教程
- @abfluss/util 中文文档教程
- @abhinavzspace/redux-pouchdb-plus 中文文档教程