Commit 84fd6e3
authored
feat: Rework turbo ls to use query internals and add turbo query ls shorthand (#12424)
## Summary
- **Refactors `turbo ls`** to execute GraphQL queries through the
`QueryServer` instead of directly querying the package graph. This keeps
`ls` in sync with `turbo query` semantics and eliminates duplicate
querying logic.
- **Adds `turbo query ls`** as a new shorthand subcommand with the same
flags as `turbo ls` (`--filter`, `--affected`, `--output`, positional
packages).
- **Documents `turbo query ls`** in the query reference page.
## How it works
`ls::run()` now accepts a `&dyn QueryServer` and uses it to execute two
types of GraphQL queries:
- `{ packages { items { name path } length } }` for listing packages
- `{ package(name: "...") { ... tasks, allDependencies, allDependents
... } }` for package details
Filter/affected flags still flow through `RunBuilder` via `Opts` — the
filtered package set is captured before the `Run` is wrapped as `Arc<dyn
QueryRun>`, then used to filter the GraphQL results.
`turbo query ls` is handled early in `query::run()` (before the
general-purpose query Run is constructed) since it needs its own Run
with filter opts.
Closes #11144
Closes #108691 parent 3ebf536 commit 84fd6e3
5 files changed
Lines changed: 365 additions & 233 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
44 | 104 | | |
45 | 105 | | |
46 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
889 | 911 | | |
890 | 912 | | |
891 | 913 | | |
| |||
1636 | 1658 | | |
1637 | 1659 | | |
1638 | 1660 | | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
1639 | 1664 | | |
1640 | 1665 | | |
1641 | 1666 | | |
1642 | 1667 | | |
1643 | 1668 | | |
1644 | 1669 | | |
1645 | 1670 | | |
1646 | | - | |
| 1671 | + | |
1647 | 1672 | | |
1648 | 1673 | | |
1649 | 1674 | | |
| |||
0 commit comments