filter package.json passthrough tasks from shell completions#9
filter package.json passthrough tasks from shell completions#9
Conversation
In a Turborepo monorepo, the canonical wiring is a root package.json with `"build": "turbo run build"` mirroring a same-named entry in turbo.json. Tab completion was emitting both the package.json and turbo.json qualified forms (`package.json:build`, `turbo.json:build`) plus the bare name — three candidates for what is functionally one task. When a task name appears in both sources, drop the package.json entry from completion candidates entirely. This is consistent with the existing run-priority order (TurboJson > PackageJson), so `runner build` was already dispatching through turbo. `runner list` keeps showing both sources for transparency, and a typed `package.json:build` still works. If a third source (e.g. Makefile) also defines the name, both turbo and the third source keep their qualified forms — only the package.json wrapper is suppressed.
📝 WalkthroughWalkthroughThe pull request refines task completion generation in ChangesTurbo Passthrough Completion Handling
Poem
🚥 Pre-merge checks | ✅ 6 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
✨ Simplify code
Comment |
Summary
This change improves shell completion behavior by filtering out
package.jsontasks that are passthrough wrappers toturbo.jsontasks. This follows the canonical Turborepo pattern wherepackage.jsonscripts like"build": "turbo run build"delegate to turbo, and such passthroughs should not clutter completion suggestions.Key Changes
package.jsontask shares its name with aturbo.jsontask, treating it as a passthrough wrapperpackage.jsonpassthrough tasks are now excluded from completion candidates entirely, while still being surfaced byrunner listfor transparencypackage_json_passthrough_to_turbo_collapses_to_bare_name: Verifies that a passthrough task results in only the bare name appearing oncepassthrough_swallow_keeps_unrelated_runner_qualified_forms: Ensures that when other task sources (e.g., Makefile) also define the same task name, they retain their qualified forms for disambiguationImplementation Details
HashMap<&str, HashSet<TaskSource>>to track all sources for each task nameis_turbo_passthroughclosure checks if a task is frompackage.jsonAND has a correspondingturbo.jsonsourcerunner listandrunner buildcommands, which continue to surface all sources per their existing priority orderinghttps://claude.ai/code/session_01S5a1HBiSU1YBeRbebcbLWf