docs: add RFC for enhanced dependsOn syntax#322
Draft
branchseer wants to merge 8 commits intomainfrom
Draft
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Task name is passed as the value of the flag key (e.g. `{ "transitive": "build" }`)
instead of a separate `task` field with a boolean flag.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
|
+1 for "Object syntax" |
Collaborator
|
btw, what happens in this case when there’s a circular reference? |
Contributor
I think |
Member
Author
Yes |
Keep only the object syntax, removing the alternative CLI string array style and the comparison table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a new package selection flag that selects only the direct (one-hop) dependencies of the current package, excluding the package itself. This is the equivalent of Turborepo/Nx's `^` prefix in `dependsOn`. Unlike `--transitive` which walks the full transitive closure, `--direct` stops after one hop. All dependency types (dependencies, devDependencies, peerDependencies) are traversed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the three mutually exclusive booleans (`recursive`, `transitive`, `direct`) with a `TraversalMode` enum resolved via `from_flags()`. Clap's `group = "traversal"` enforces mutual exclusivity at parse time; the enum makes it explicit in the type system. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes clippy errors introduced by the `--direct` flag work: - `to_graph_traversal`: merge identical `Recursive`/`Transitive` arms (`match_same_arms`) and mark `const fn` (`missing_const_for_fn`). Both modes produce the same graph traversal; they differ only in how seeds are chosen, which is decided in `into_package_query`. - `from_flags`: mark `const fn` (`missing_const_for_fn`). - `PackageQueryArgs`: silence `struct_excessive_bools` with `#[expect]` since clap requires separate bool fields for the four CLI flags. - `into_package_query`: extract the `--filter` token collection into a `collect_filter_tokens` helper to bring the function under the `too_many_lines` limit. Fixes the Windows-only `query - direct with filter conflict` snapshot failure: the `ParsePlanRequest` error formats `cwd:?`, which on Windows escapes each `\` as `\\`, so the raw `workspace_root_str` redaction never matched. Unescape the doubled backslashes on Windows before redacting, so the same `<workspace>/` placeholder appears on both platforms. https://claude.ai/code/session_01RyEZx6J2a3SodaA5fzrwk6
The previous attempt unconditionally replaced `\\` with `\` on Windows
to unescape Debug-formatted paths, but this also collapsed the `\\?\`
verbatim prefix in Display-formatted paths used by other errors
(e.g. `ambiguous package name`), breaking those snapshots.
Instead, fix the root cause: format `cwd` with Display (`{cwd}`)
rather than Debug (`{cwd:?}`) in `ParsePlanRequest`. Display uses
`Path::display()` which emits raw backslashes on Windows, so the
existing raw `workspace_root_str` redaction works uniformly. Keep
the surrounding double quotes explicitly in the format string so
the existing `"<workspace>/"` snapshot stays exactly as-is.
Revert the test-side `\\` → `\` unescape now that it is no longer
needed and was breaking previously passing tests.
https://claude.ai/code/session_01RyEZx6J2a3SodaA5fzrwk6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dependsOnentries that reuse the existingvp runCLI mental model instead of inventing new symbols"--transitive build",["--filter", "@myorg/core", "build"]{ "transitive": true, "task": "build" }Test plan
🤖 Generated with Claude Code