-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(turbo_json): add $TURBO_EXTENDS$
#10763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(turbo_json): add $TURBO_EXTENDS$
#10763
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6b3ebbc to
5baf407
Compare
| "env": [ | ||
| "NODE_ENV", | ||
| "$FOOBAR" | ||
| "FOOBAR" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We changed validation order (both are still checked) and this turbo.json was invalid in 2 ways. Previously we were depending on the ordering of validations to see the expected error message around this task being interruptible, but not persistent.
| /// When enabled, allows using `$TURBO_EXTENDS$` in array fields. | ||
| /// This will change the default behavior of overriding the field to instead | ||
| /// append. | ||
| pub turbo_extends: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: Let's be slightly more descriptive on this flag name since we're about to have $TURBO_EXTENDS$ and, separately, make the extends key more powerful. I could see a user being confused about which this refers to.
8fc77cd to
2123e6f
Compare
) ### Description TL;DR Allow for `"extends": ["//", "@acem/my-pkg"]` to allow for shared task configuration outside of the root. This PR adds non-root extensions of `turbo.json` files. We still require all `turbo.json` files to extend from root first, but now you can extend from an additional package `turbo.json` files. The task definitions are collapsed left to right with the right fields taking precedence. (This can be more powerful when using `$TURBO_EXTENDS$` added in #10763) We do have to check for cycles in `turbo.json` extends statements to ensure we can resolve the `extends` chain. Prefactor steps taken: - Splitting of the `RawTurboJson` schema into a root schema and a package schema. This removes the need for our ad-hoc checks of all fields in a package `turbo.json` that are invalid. (We were missing quite a few, for example you could put `globalEnv` in a package `turbo.json` and it would be silently ignored) - Changed ordering of task definition chain construction to first load all necessary `turbo.json` before fetching task definitions - Created a `Validator` struct which is used to share context which affect validation outcomes. This is necessary to feature flag this behavior I highly suggest reviewing each commit by itself as there is a lot of prefactor work that muddies the feature addition. ### Testing Instructions
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [turbo](https://turborepo.com) ([source](https://github.com/vercel/turborepo)) | [`2.5.6` -> `2.6.1`](https://renovatebot.com/diffs/npm/turbo/2.5.6/2.6.1) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vercel/turborepo (turbo)</summary> ### [`v2.6.1`](https://github.com/vercel/turborepo/releases/tag/v2.6.1): Turborepo v2.6.1 [Compare Source](vercel/turborepo@v2.6.0...v2.6.1) <!-- Release notes generated using configuration in .github/release.yml at v2.6.1 --> #### What's Changed ##### Docs - docs: 2.6 release blog post by [@​anthonyshew](https://github.com/anthonyshew) in [#​11003](vercel/turborepo#11003) - docs: update typo'd link by [@​lishaduck](https://github.com/lishaduck) in [#​11032](vercel/turborepo#11032) - chore(with-docker/Dockerfile): Some improvements by [@​yairopro](https://github.com/yairopro) in [#​11010](vercel/turborepo#11010) - docs: Fix grammatical mistake on structuring-a-repository.mdx by [@​Andrew-Pynch](https://github.com/Andrew-Pynch) in [#​11091](vercel/turborepo#11091) - feat: Cross-platform microfrontends port command by [@​anthonyshew](https://github.com/anthonyshew) in [#​11098](vercel/turborepo#11098) ##### [@​turbo/codemod](https://github.com/turbo/codemod) - ci: Fix flake in JS tests by [@​anthonyshew](https://github.com/anthonyshew) in [#​11067](vercel/turborepo#11067) ##### [@​turbo/repository](https://github.com/turbo/repository) - chore: Update to Rust 1.91.0 by [@​ognevny](https://github.com/ognevny) in [#​10885](vercel/turborepo#10885) ##### Examples - examples(deps-dev): bump [@​types/node](https://github.com/types/node) from 18.17.4 to 24.10.0 in /examples/non-monorepo by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11037](vercel/turborepo#11037) - examples(deps-dev): bump the kitchen-sink group in /examples/kitchen-sink with 9 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11043](vercel/turborepo#11043) - examples: Remove redundant border declaration by [@​Yeom-JinHo](https://github.com/Yeom-JinHo) in [#​11042](vercel/turborepo#11042) - examples(deps-dev): bump turbo from 2.5.6 to 2.6.0 in /examples/with-shell-commands in the with-shell-commands group by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11039](vercel/turborepo#11039) - examples(deps-dev): bump the with-svelte group in /examples/with-svelte with 7 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11041](vercel/turborepo#11041) - examples(deps): bump the basic group in /examples/basic with 9 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11040](vercel/turborepo#11040) - examples(deps-dev): bump the with-tailwind group in /examples/with-tailwind with 6 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11038](vercel/turborepo#11038) - examples(deps): bump next from 16.0.0 to 16.0.1 in /examples/non-monorepo by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11051](vercel/turborepo#11051) - examples(deps): bump next from 16.0.0 to 16.0.1 in /examples/basic by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11082](vercel/turborepo#11082) - examples(deps): bump next from 16.0.0 to 16.0.1 in /examples/with-tailwind by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11083](vercel/turborepo#11083) - examples(dev-deps): bump eslint-config-next from 16.0.0 to 16.0.1 in /examples/non-monorepo by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11086](vercel/turborepo#11086) - examples(fix): Gradient in `with-tailwind` by [@​mahi656](https://github.com/mahi656) in [#​11073](vercel/turborepo#11073) - examples(dev-deps): bump svelte from 5.43.3 to 5.43.5 in /examples/with-svelte by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11087](vercel/turborepo#11087) - examples(deps): bump next from 16.0.0 to 16.0.1 in /examples/kitchen-sink by [@​dependabot](https://github.com/dependabot)\[bot] in [#​11088](vercel/turborepo#11088) ##### Changelog - fix: Improve parity with real Bun lockfile format for `prune` by [@​anthonyshew](https://github.com/anthonyshew) in [#​11048](vercel/turborepo#11048) - fix: add some Linux variables to default passthrough env vars by [@​anthonyshew](https://github.com/anthonyshew) in [#​10959](vercel/turborepo#10959) - fix: Labels for k + j backwards in binds list by [@​ethan-fraser](https://github.com/ethan-fraser) in [#​11036](vercel/turborepo#11036) - fix(prune): Add bunfig.toml to list of copied files by [@​Gabrola](https://github.com/Gabrola) in [#​11055](vercel/turborepo#11055) - fix(prune): Handle `patchedDependencies` for bun by [@​Gabrola](https://github.com/Gabrola) in [#​11027](vercel/turborepo#11027) - fix(boundaries): Enable import attributes parsing by [@​anthonyshew](https://github.com/anthonyshew) in [#​11053](vercel/turborepo#11053) - fix: Improve determinism for graceful shutdown by [@​anthonyshew](https://github.com/anthonyshew) in [#​11063](vercel/turborepo#11063) - ci: Lower opt-level and remove debug symbols for dev profile by [@​anthonyshew](https://github.com/anthonyshew) in [#​11068](vercel/turborepo#11068) - ci: Avoid flaking for test server mock by [@​anthonyshew](https://github.com/anthonyshew) in [#​11066](vercel/turborepo#11066) - ci: Don't install dependencies in tests that don't need it by [@​anthonyshew](https://github.com/anthonyshew) in [#​11071](vercel/turborepo#11071) - fix: Revert "fix(logs): create log files for non-cached tasks" by [@​anthonyshew](https://github.com/anthonyshew) in [#​11072](vercel/turborepo#11072) - ci: Fix leaky tests by [@​anthonyshew](https://github.com/anthonyshew) in [#​11081](vercel/turborepo#11081) - fix: Bun lockfile pruner adjustment by [@​anthonyshew](https://github.com/anthonyshew) in [#​11092](vercel/turborepo#11092) - fix: Improve version resolution in Bun lockfiles by [@​anthonyshew](https://github.com/anthonyshew) in [#​11095](vercel/turborepo#11095) - feat: Move icon to left side in TUI by [@​anthonyshew](https://github.com/anthonyshew) in [#​11097](vercel/turborepo#11097) #### New Contributors - [@​lishaduck](https://github.com/lishaduck) made their first contribution in [#​11032](vercel/turborepo#11032) - [@​Yeom-JinHo](https://github.com/Yeom-JinHo) made their first contribution in [#​11042](vercel/turborepo#11042) - [@​ethan-fraser](https://github.com/ethan-fraser) made their first contribution in [#​11036](vercel/turborepo#11036) - [@​yairopro](https://github.com/yairopro) made their first contribution in [#​11010](vercel/turborepo#11010) - [@​Gabrola](https://github.com/Gabrola) made their first contribution in [#​11055](vercel/turborepo#11055) - [@​mahi656](https://github.com/mahi656) made their first contribution in [#​11073](vercel/turborepo#11073) - [@​Andrew-Pynch](https://github.com/Andrew-Pynch) made their first contribution in [#​11091](vercel/turborepo#11091) **Full Changelog**: <vercel/turborepo@v2.6.0...v2.6.1> ### [`v2.6.0`](https://github.com/vercel/turborepo/releases/tag/v2.6.0): Turborepo v2.6.0 [Compare Source](vercel/turborepo@v2.5.8...v2.6.0) <!-- Release notes generated using configuration in .github/release.yml at v2.6.0 --> #### What's Changed ##### Docs - docs: clarification on Transit Nodes docs by [@​maschwenk](https://github.com/maschwenk) in [#​9181](vercel/turborepo#9181) - docs: add GitHub Actions reusable workflow documentation for remote caching by [@​anthonyshew](https://github.com/anthonyshew) in [#​10923](vercel/turborepo#10923) - docs: generate blog release OG images by [@​anthonyshew](https://github.com/anthonyshew) in [#​10936](vercel/turborepo#10936) - docs: fix correct package name from eslint-config-turbo to eslint-plugin-turbo by [@​tetzng](https://github.com/tetzng) in [#​10954](vercel/turborepo#10954) - docs: align tailwindcss 4 guide to the with-tailwind example by [@​esauri](https://github.com/esauri) in [#​10963](vercel/turborepo#10963) - docs: fix typos and formatting issues in Playwright guide by [@​yamcodes](https://github.com/yamcodes) in [#​10980](vercel/turborepo#10980) - docs: adjust compute hours saved component initial value by [@​anthonyshew](https://github.com/anthonyshew) in [#​10958](vercel/turborepo#10958) - docs: clarify passthrough args comparison by [@​emilbjorklund](https://github.com/emilbjorklund) in [#​10990](vercel/turborepo#10990) - docs: fix profile images on home page by [@​anthonyshew](https://github.com/anthonyshew) in [#​10993](vercel/turborepo#10993) - feat: microfrontends by [@​anthonyshew](https://github.com/anthonyshew) in [#​10982](vercel/turborepo#10982) - docs: Clarify passtrhough args cache miss by [@​eug-vs](https://github.com/eug-vs) in [#​11026](vercel/turborepo#11026) - fix: path validation in `microfrontends.json` by [@​anthonyshew](https://github.com/anthonyshew) in [#​11006](vercel/turborepo#11006) - feat(microfrontends): schema.json for microfrontends.json by [@​anthonyshew](https://github.com/anthonyshew) in [#​11008](vercel/turborepo#11008) ##### create-turbo - feat: update `create-turbo` Bun prompt text by [@​anthonyshew](https://github.com/anthonyshew) in [#​10918](vercel/turborepo#10918) ##### eslint - fix(eslint-config-turbo): use module.exports for ESLint v8 compatibility by [@​anthonyshew](https://github.com/anthonyshew) in [#​10902](vercel/turborepo#10902) - perf: \~8.6x faster ESLint rule by [@​anthonyshew](https://github.com/anthonyshew) in [#​10943](vercel/turborepo#10943) ##### Examples - Update package.json by [@​Satheeshsk369](https://github.com/Satheeshsk369) in [#​10892](vercel/turborepo#10892) - docs: fix JSDoc type for ESLint config in basic example by [@​victor-code19](https://github.com/victor-code19) in [#​10727](vercel/turborepo#10727) - refactor(examples): enhance `with-nestjs` ([#​8131](vercel/turborepo#8131)) by [@​Neosoulink](https://github.com/Neosoulink) in [#​10964](vercel/turborepo#10964) - examples: Upgrade core-team-maintained examples to Next.js 16 by [@​anthonyshew](https://github.com/anthonyshew) in [#​11014](vercel/turborepo#11014) ##### Changelog - chore: remove missing turbow\.js references by [@​pauloZion1](https://github.com/pauloZion1) in [#​10893](vercel/turborepo#10893) - fix(turborepo-lockfiles): handle missing optional dependencies in Bun lockfiles by [@​anthonyshew](https://github.com/anthonyshew) in [#​10909](vercel/turborepo#10909) - fix: update `ui` suggested value in error message for turbo.json by [@​hugomassing](https://github.com/hugomassing) in [#​10896](vercel/turborepo#10896) - chore: remove unused `origin` field from auth structs by [@​anthonyshew](https://github.com/anthonyshew) in [#​10910](vercel/turborepo#10910) - feat: new OAuth flow for Turborepo CLI with Vercel by [@​anthonyshew](https://github.com/anthonyshew) in [#​10911](vercel/turborepo#10911) - fix(lockfiles): include bundled dependencies in Bun lockfile subgraphs by [@​anthonyshew](https://github.com/anthonyshew) in [#​10915](vercel/turborepo#10915) - test: increase coverage for lockfiles by [@​anthonyshew](https://github.com/anthonyshew) in [#​10633](vercel/turborepo#10633) - fix: update remote cache OAuth refresh flow by [@​anthonyshew](https://github.com/anthonyshew) in [#​10916](vercel/turborepo#10916) - feat(tui): task list search with `/` by [@​anthonyshew](https://github.com/anthonyshew) in [#​10908](vercel/turborepo#10908) - fix: --graph=foo.dot should not require graphviz installed by [@​blast-hardcheese](https://github.com/blast-hardcheese) in [#​10942](vercel/turborepo#10942) - chore: update devcontainer configuration by [@​anthonyshew](https://github.com/anthonyshew) in [#​10955](vercel/turborepo#10955) - fix: `injectWorkspacePackages` for `turbo prune` with pnpm by [@​anthonyshew](https://github.com/anthonyshew) in [#​10945](vercel/turborepo#10945) - fix: adjust binary call for microfrontends proxy on Windows by [@​mknichel](https://github.com/mknichel) in [#​10962](vercel/turborepo#10962) - Add worktrees.json configuration to .cursor directory by [@​Copilot](https://github.com/Copilot) in [#​10986](vercel/turborepo#10986) - fix: windows symlinking bug by [@​anthonyshew](https://github.com/anthonyshew) in [#​10992](vercel/turborepo#10992) - fix: added Linux env vars to global passthroughs by [@​aviramha](https://github.com/aviramha) in [#​10984](vercel/turborepo#10984) - fix: recursive transitive closure analysis in npm lockfile parser by [@​anthonyshew](https://github.com/anthonyshew) in [#​10988](vercel/turborepo#10988) - ci(fix): dynamically set ports in proxy integration tests by [@​anthonyshew](https://github.com/anthonyshew) in [#​11009](vercel/turborepo#11009) - feat: Add support for custom microfrontends.json naming by [@​kitfoster](https://github.com/kitfoster) in [#​11022](vercel/turborepo#11022) #### New Contributors - [@​Satheeshsk369](https://github.com/Satheeshsk369) made their first contribution in [#​10892](vercel/turborepo#10892) - [@​robobun](https://github.com/robobun) made their first contribution in [#​10729](vercel/turborepo#10729) - [@​hugomassing](https://github.com/hugomassing) made their first contribution in [#​10896](vercel/turborepo#10896) - [@​victor-code19](https://github.com/victor-code19) made their first contribution in [#​10727](vercel/turborepo#10727) - [@​blast-hardcheese](https://github.com/blast-hardcheese) made their first contribution in [#​10942](vercel/turborepo#10942) - [@​tetzng](https://github.com/tetzng) made their first contribution in [#​10954](vercel/turborepo#10954) - [@​esauri](https://github.com/esauri) made their first contribution in [#​10963](vercel/turborepo#10963) - [@​Copilot](https://github.com/Copilot) made their first contribution in [#​10986](vercel/turborepo#10986) - [@​emilbjorklund](https://github.com/emilbjorklund) made their first contribution in [#​10990](vercel/turborepo#10990) - [@​aviramha](https://github.com/aviramha) made their first contribution in [#​10984](vercel/turborepo#10984) - [@​eug-vs](https://github.com/eug-vs) made their first contribution in [#​11026](vercel/turborepo#11026) - [@​kitfoster](https://github.com/kitfoster) made their first contribution in [#​11022](vercel/turborepo#11022) **Full Changelog**: <vercel/turborepo@v2.5.8...v2.6.0> ### [`v2.5.8`](https://github.com/vercel/turborepo/releases/tag/v2.5.8): Turborepo v2.5.8 [Compare Source](vercel/turborepo@v2.5.7...v2.5.8) <!-- Release notes generated using configuration in .github/release.yml at v2.5.8 --> #### What's Changed ##### create-turbo - fix: revert [#​10847](vercel/turborepo#10847) by [@​anthonyshew](https://github.com/anthonyshew) in [#​10882](vercel/turborepo#10882) ##### Changelog - chore: add Cursor slash command by [@​anthonyshew](https://github.com/anthonyshew) in [#​10881](vercel/turborepo#10881) **Full Changelog**: <vercel/turborepo@v2.5.7...v2.5.8> ### [`v2.5.7`](https://github.com/vercel/turborepo/releases/tag/v2.5.7): Turborepo v2.5.7 [Compare Source](vercel/turborepo@v2.5.6...v2.5.7) <!-- Release notes generated using configuration in .github/release.yml at v2.5.7 --> #### What's Changed ##### Docs - docs: add `TURBO_CONCURRENCY` to options overview page by [@​anthonyshew](https://github.com/anthonyshew) in [#​10772](vercel/turborepo#10772) - fix(docs): fix broken anchor links to --graph option by [@​anthonyshew](https://github.com/anthonyshew) in [#​10773](vercel/turborepo#10773) - docs: clarify TURBO\_TEAM secret usage by [@​vikhyathdevadiga](https://github.com/vikhyathdevadiga) in [#​10795](vercel/turborepo#10795) - docs: add Buildkite example to CI Vendors documentation by [@​AndrewDiMola](https://github.com/AndrewDiMola) in [#​10721](vercel/turborepo#10721) - docs: rework llms.txt and add .md responses by [@​anthonyshew](https://github.com/anthonyshew) in [#​10811](vercel/turborepo#10811) - docs: add `name` field mention to migration page by [@​anthonyshew](https://github.com/anthonyshew) in [#​10823](vercel/turborepo#10823) - docs: update configuration reference to use correct turbo.json title by [@​xcfio](https://github.com/xcfio) in [#​10843](vercel/turborepo#10843) - docs: correct description of how `^` works by [@​anthonyshew](https://github.com/anthonyshew) in [#​10865](vercel/turborepo#10865) ##### create-turbo - feat(create-turbo): `--no-git` flag by [@​anthonyshew](https://github.com/anthonyshew) in [#​10720](vercel/turborepo#10720) - chore(create-turbo): fix lint by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10807](vercel/turborepo#10807) - fix(security): update dependencies to resolve warning for `node-plop` by [@​anthonyshew](https://github.com/anthonyshew) in [#​10847](vercel/turborepo#10847) ##### eslint - docs: adjust typo on instructions for eslint-config-turbo legacy config by [@​evsasse](https://github.com/evsasse) in [#​10717](vercel/turborepo#10717) ##### [@​turbo/repository](https://github.com/turbo/repository) - chore: reformat code with 2024 edition by [@​ognevny](https://github.com/ognevny) in [#​10775](vercel/turborepo#10775) ##### Examples - chore(deps-dev): bump the with-svelte group in /examples/with-svelte with 6 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10752](vercel/turborepo#10752) - chore(deps-dev): bump turbo from 2.5.5 to 2.5.6 in /examples/with-shell-commands by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10781](vercel/turborepo#10781) - chore(deps-dev): bump [@​sveltejs/kit](https://github.com/sveltejs/kit) from 2.27.3 to 2.31.1 in /examples/with-svelte in the with-svelte group by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10780](vercel/turborepo#10780) - chore(deps-dev): bump [@​next/eslint-plugin-next](https://github.com/next/eslint-plugin-next) from 15.4.2 to 15.4.6 in /examples/with-tailwind by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10779](vercel/turborepo#10779) - chore(deps-dev): bump [@​next/eslint-plugin-next](https://github.com/next/eslint-plugin-next) from 15.4.2 to 15.4.6 in /examples/basic by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10776](vercel/turborepo#10776) - chore(deps): bump next from 15.4.2 to 15.4.6 in /examples/non-monorepo by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10778](vercel/turborepo#10778) - chore(deps-dev): bump the with-svelte group in /examples/with-svelte with 3 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10787](vercel/turborepo#10787) - chore(deps): bump the basic group in /examples/basic with 3 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10788](vercel/turborepo#10788) - fix: add types node to fix minimatch issue by [@​oliveirabalsa](https://github.com/oliveirabalsa) in [#​10730](vercel/turborepo#10730) - chore(deps-dev): bump the basic group in /examples/basic with 2 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10797](vercel/turborepo#10797) - chore(deps-dev): bump the with-svelte group in /examples/with-svelte with 2 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10800](vercel/turborepo#10800) ##### Changelog - feat(turbo\_json): add `$TURBO_EXTENDS$` by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10763](vercel/turborepo#10763) - chore(deps): bump the kitchen-sink group in /examples/kitchen-sink with 10 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​10758](vercel/turborepo#10758) - chore: fix lints by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10786](vercel/turborepo#10786) - docs: add top level crate documentation by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10801](vercel/turborepo#10801) - docs: add more doc comments for working with the lockfile trait by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10802](vercel/turborepo#10802) - fix(logs): create log files for non-cached tasks by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10806](vercel/turborepo#10806) - ci: add packaging checks for some JS packages by [@​anthonyshew](https://github.com/anthonyshew) in [#​10810](vercel/turborepo#10810) - docs: fix typos by [@​pauloZion1](https://github.com/pauloZion1) in [#​10821](vercel/turborepo#10821) - feat(turbo\_json): allow for extending form non-root `turbo.json` by [@​chris-olszewski](https://github.com/chris-olszewski) in [#​10812](vercel/turborepo#10812) - feat(tui): add shortcut for clearing task logs by [@​mcky](https://github.com/mcky) in [#​10828](vercel/turborepo#10828) - chore: mention other package managers in bug report template by [@​anthonyshew](https://github.com/anthonyshew) in [#​10849](vercel/turborepo#10849) - feat: add Expo to common frameworks by [@​Alvi24](https://github.com/Alvi24) in [#​10861](vercel/turborepo#10861) - chore: remove label from workflows by [@​anthonyshew](https://github.com/anthonyshew) in [#​10864](vercel/turborepo#10864) - fix: add WINDIR to default passthroughs by [@​anthonyshew](https://github.com/anthonyshew) in [#​10868](vercel/turborepo#10868) - fix: output valid turbo.json for prune with Boundaries definition by [@​anthonyshew](https://github.com/anthonyshew) in [#​10866](vercel/turborepo#10866) - fix: sanitize logging prefix for GitLab groups by [@​anthonyshew](https://github.com/anthonyshew) in [#​10850](vercel/turborepo#10850) #### New Contributors - [@​oliveirabalsa](https://github.com/oliveirabalsa) made their first contribution in [#​10730](vercel/turborepo#10730) - [@​vikhyathdevadiga](https://github.com/vikhyathdevadiga) made their first contribution in [#​10795](vercel/turborepo#10795) - [@​AndrewDiMola](https://github.com/AndrewDiMola) made their first contribution in [#​10721](vercel/turborepo#10721) - [@​pauloZion1](https://github.com/pauloZion1) made their first contribution in [#​10821](vercel/turborepo#10821) - [@​mcky](https://github.com/mcky) made their first contribution in [#​10828](vercel/turborepo#10828) - [@​xcfio](https://github.com/xcfio) made their first contribution in [#​10843](vercel/turborepo#10843) - [@​evsasse](https://github.com/evsasse) made their first contribution in [#​10717](vercel/turborepo#10717) - [@​Alvi24](https://github.com/Alvi24) made their first contribution in [#​10861](vercel/turborepo#10861) **Full Changelog**: <vercel/turborepo@v2.5.6...v2.5.7> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDguNCIsInVwZGF0ZWRJblZlciI6IjQyLjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.in.csmpro.ru/csmpro/csm-mapban/pulls/30 Co-authored-by: Renovate Bot <renovate@csmpro.ru> Co-committed-by: Renovate Bot <renovate@csmpro.ru>
Description
This PR adds a new DSL keyword for array task definitions that alters the behavior when using
extendsin a packageturbo.json. Usually a field from a package task definition will completely override the root field e.g.Root:
{ "env": ["FOO"] }Package:
{ "env": ["BAR"] }Result:
{"env": ["BAR"] }If the package uses the new
$TURBO_EXTENDS$the root field value will be extended from instead of overridden. e.g.Root:
{ "env": ["FOO"] }Package:
{ "env": ["$TURBO_EXTENDS$", "BAR"] }Result:
{"env": ["FOO", "BAR"] }This functionality allows for greater flexibility when specializing package task definitions without needing to copy/paste the shared values and remembering to update them if the root changed.
It is currently gated by
turboExtendsfeature flag in the rootturbo.json.Reviewing this each commit individually in this PR is highly suggested. The actual feature add is all done in the final commit, the rest are prefactors.
The primary prefactors are:
turbo.jsonsNerd note:
Technically, we could extend
$TURBO_EXTENDS$to additional fields that are monoids. Extension behavior is really:The only interesting addition we could make would be around boolean fields which has 2 different monoids: any and all. Which one to choose would depend on the default value of the flag. e.g.
cachedefaults to false so we would want an any (or) behavior. I am not suggesting we do this, it is more confusing than it is worthwhile.Testing Instructions
Added a fair amount of unit tests for the whole task definition resolution steps.