这是indexloc提供的服务,不要输入任何密码
Skip to content

feat(turbo json): make with public #10191

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

Merged
merged 8 commits into from
Mar 18, 2025

Conversation

chris-olszewski
Copy link
Member

@chris-olszewski chris-olszewski commented Mar 17, 2025

Description

Make public the feature added in #9504 that allows for pulling in extra tasks into the graph without a dependsOn relationship.

Renamed to with as it is better than sibling since that indicates a shared parent, which isn't required.

Testing Instructions

Added quick unit test for parsing and error validation.

Basic test:

[0 olszewski@macbookpro] /tmp/with-test $ git diff
diff --git a/turbo.json b/turbo.json
index d6a7fe0..35fa9cd 100644
--- a/turbo.json
+++ b/turbo.json
@@ -15,7 +15,8 @@
     },
     "dev": {
       "cache": false,
-      "persistent": true
+      "persistent": true,
+      "with": ["build"]
     }
   }
 }
# Verify web#build is in the graph
[0 olszewski@macbookpro] /tmp/with-test $ turbo_dev --skip-infer web#dev --graph
turbo 2.4.5-canary.4


digraph {
        compound = "true"
        newrank = "true"
        subgraph "root" {
                "[root] @repo/eslint-config#build" -> "[root] ___ROOT___"
                "[root] @repo/typescript-config#build" -> "[root] ___ROOT___"
                "[root] @repo/ui#build" -> "[root] @repo/eslint-config#build"
                "[root] @repo/ui#build" -> "[root] @repo/typescript-config#build"
                "[root] web#build" -> "[root] @repo/eslint-config#build"
                "[root] web#build" -> "[root] @repo/typescript-config#build"
                "[root] web#build" -> "[root] @repo/ui#build"
                "[root] web#dev" -> "[root] ___ROOT___"
        }
}

Error message for trying to use ^

[0 olszewski@macbookpro] /tmp/with-test $ turbo_dev --skip-infer web#dev
turbo 2.4.5-canary.4

  × Invalid turbo.json configuration
  ╰─▶   × `with` cannot use topological dependencies.
          ╭─[turbo.json:19:16]
       18 │       "persistent": true,
       19 │       "with": ["^build"]
          ·                ────┬───
          ·                    ╰── Remove `^` from start of task name.
       20 │     }
          ╰────

Copy link

vercel bot commented Mar 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:48pm

@turbo-orchestrator turbo-orchestrator bot added the area: docs Improvements or additions to documentation label Mar 17, 2025
Copy link
Contributor

@anthonyshew anthonyshew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor docs/error message from me. Exciting!

chris-olszewski and others added 2 commits March 18, 2025 14:27
Co-authored-by: Anthony Shew <anthony.shew@vercel.com>
Co-authored-by: Anthony Shew <anthony.shew@vercel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants