Open innocces opened 2 months ago
Tuesday, August 27th, 2024
Name
Tom Knickman
X
Name
Anthony Shew
X
Name
Chris Olszewski
Name
Nicholas Yang
X
Name
Dimitri Mitropoulos
Turborepo 2.1 improves integration with your repository, with features like:
--affected
turbo ls
and turbo run
turbo.json
Update today by running npx @turbo/codemod migrate
or get started with npx create-turbo@latest
.
--affected
Turborepo’s Remote Caching shares a single cache across all of your machines, so you never have to do the same work twice. But, what if you could ignore unchanged packages altogether?
You can now use the --affected
flag with turbo run
to automatically target packages with changes between the latest commit of your current branch, and the default branch of your repository (usually main
or master
). turbo
will use your Package Graph to ensure tasks are run for packages with direct changes or changes to internal dependencies.
Terminal
turbo run lint test --affected
You'll want to use this flag in situations like:
turbo-ignore
to create the same or similar behavior as --affected
. You likely have the opportunity to simplify your scripting using this new flag.To learn more, visit the documentation.
As a repository grows and changes, it can be difficult to quickly find what you’re looking for. We want to quickly surface your tasks, packages, and their relationships to make understanding your repository faster and easier.
turbo run
Use turbo run
(with no task arguments) to get a list of the available tasks in your repository. This command also works with filters and Automatic Package Scoping.
Terminal
# List all tasks in the repository
turbo run
# List tasks in a specific package
turbo run --filter=@repo/ui
# Using Automatic Package Scoping
cd packages/ui && turbo run
Visit the documentation to learn more.
turbo ls
Use turbo ls
to get a list of all the packages in your repository with their locations, or filter to a specific package to see a summary of its internal dependencies and tasks. turbo ls
also supports --filter
, and --affected
, making it easy to gather a list of changed packages.
Terminal
# List all packages in the repository
turbo ls
# List dependencies and tasks for the `web` package
turbo ls web
## List affected packages
turbo ls --affected
turbo ls
supports an experimental --output
flag that can be used to return results in a specific format. For example, --output=json
can be used to more easily create inputs for other tools or custom scripts. If you were previously using turbo build --dry=json
only to retrieve a list of changed packages, give turbo ls --affected --output=json
a try. Visit the docs for more information and leave feedback on output format on the turbo ls
RFC.
Visit the documentation to learn more.
In Turborepo 2.0, we released a new terminal UI to improve clarity for logs and allow for interactive tasks in local development. We heard your feedback, and prioritized polishing this UI, releasing improvements in patches to 2.0 and in this 2.1 release:
Building a great terminal UI experience has unique challenges, and we’re continuing to iterate on this experience. We appreciate your continued feedback as we keep up our work on creating great UI for monorepos.
In this release, we’re adding more keys to turbo.json
to give you more flexibility for your repository’s defaults. The following keys are new in this release:
turbo.json
{
"envMode": "loose",
"daemon": false,
"cacheDir": "./my-custom-directory/"
}
You may have been using the flag equivalents for these configurations on many or all of your turbo
invocations, littering your codebase with commands like:
Terminal
turbo run build --env-mode=loose --no-daemon --cache-dir=./my-custom-directory
These can now be simplified with a centralized configuration in turbo.json
using Turborepo’s existing configuration model:
turbo.json
sets the defaults for your repository.turbo
.To learn more about available options and configurations, visit the documentation.
turbo run
invocations.View the full changelog at vercel/turborepo
.
2024 年 8 月 27 日星期二
姓名
汤姆·尼克曼
X
姓名
安东尼·休
X
![Chris Olszewski](https://turbo.build/_next/image?url=%2Fimages%2Fpeople%2Fchrisolszewski.jpg\&w=64\&q=75\&dpl=dpl\_HSYkLo975h5aVF6crYFmydUwHfpr“Chris Olszewski”)
姓名
克里斯·奥尔谢夫斯基
姓名
尼古拉斯·杨
X
姓名
迪米特里·米特罗普洛斯
Turborepo 2.1 改进了与存储库的集成,具有以下功能:
--affected
进行更改的任务turbo.json
为默认值提供更大的灵活性今天通过运行“npx @turbo/codemod migrate”进行更新或开始使用“npx create-turbo@latest”。
--affected
运行已更改包的任务Turborepo 的远程缓存 在所有计算机上共享一个缓存,因此您不必重复执行相同的工作。但是,如果您可以完全忽略未更改的包怎么办?
现在,您可以将“--affected”标志与“turbo run”一起使用,自动定位当前分支的最新提交与存储库的默认分支(通常是“main”或“master”)之间发生更改的包。 turbo
将使用您的包图来确保为直接更改或内部依赖项更改的包运行任务。
终端
[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport] ::-webkit-scrollbar{显示:无}
turbo run lint test --affected
您需要在以下情况下使用此标志:
turbo-ignore
来创建与“--affect”相同或相似的行为。您可能有机会使用这个新标志来简化脚本编写。要了解更多信息,请访问文档。
随着存储库的增长和变化,快速找到您要查找的内容可能会很困难。我们希望快速显示您的任务、包及其关系,以便更快、更轻松地理解您的存储库。
涡轮运行
使用“turbo run”(不带任务参数)获取存储库中可用任务的列表。此命令还适用于 filters 和 [自动包范围](/repo/docs/crafting-your-repository/running-tasks#自动包范围)。
终端
[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport] ::-webkit-scrollbar{显示:无}
# List all tasks in the repository
turbo run
# List tasks in a specific package
turbo run --filter=@repo/ui
# Using Automatic Package Scoping
cd packages/ui && turbo run
访问文档 了解更多信息。
turbo ls
使用“turbo ls”获取存储库中所有包及其位置的列表,或过滤到特定包以查看其内部依赖项和任务的摘要。 turbo ls
还支持 --filter
和 --affected
,可以轻松收集已更改包的列表。
终端
[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport] ::-webkit-scrollbar{显示:无}
# List all packages in the repository
turbo ls
# List dependencies and tasks for the `web` package
turbo ls web
## List affected packages
turbo ls --affected
turbo ls
支持实验性的 --output
标志,可用于以特定格式返回结果。例如,“--output=json”可用于更轻松地为其他工具或自定义脚本创建输入。如果您之前仅使用“turbo build --dry=json”来检索已更改包的列表,请尝试“turbo ls --affected --output=json”。请访问文档以获取更多信息,并在 turbo ls
RFC 上留下有关输出格式的反馈。
访问文档 了解更多信息。
在 Turborepo 2.0 中,我们发布了新的终端 UI,以提高日志的清晰度并允许在本地开发中执行交互式任务。我们听取了您的反馈,并优先完善此 UI,发布 2.0 补丁和 2.1 版本中的改进:
构建出色的终端 UI 体验具有独特的挑战,我们将继续迭代这种体验。我们感谢您持续提供的反馈,我们将继续努力为 monorepos 创建出色的 UI。
在此版本中,我们向“turbo.json”添加了更多键,以便为存储库的默认设置提供更大的灵活性。此版本中新增了以下键:
涡轮.json
[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport] ::-webkit-scrollbar{显示:无}
{
"envMode": "loose",
"daemon": false,
"cacheDir": "./my-custom-directory/"
}
您可能在许多或所有“turbo”调用中使用了这些配置的等效标志,从而在代码库中散布了以下命令:
终端
[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport] ::-webkit-scrollbar{显示:无}
turbo run build --env-mode=loose --no-daemon --cache-dir=./my-custom-directory
现在可以使用 Turborepo 的现有配置模型通过“turbo.json”中的集中配置来简化这些:
turbo.json
设置存储库的默认值。要了解有关可用选项和配置的更多信息,请访问文档。
在 vercel/turborepo
查看完整的变更日志。
emmm~ 整体上还是没处理 race command 的问题。 继续观望吧。
不过新的 terminal 是真的 him 不错
The original blog info