Commit 095d282
committed
fix(complete): resolve command aliases and make the parser optional
Completing after an alias returned only the global options, because
`@bomb.sh/tab` registers each command under `command.name()` and has no
alias concept: `webpack b <TAB>` offered 4 candidates where `webpack build
<TAB>` offers 21, and `webpack s <TAB>` 4 against `serve`'s 94. The alias
being completed is now registered against the command it stands for, so
every alias resolves. Only the requested one is registered, which keeps
`webpack <TAB>` listing the eight commands rather than all thirteen names.
`@bomb.sh/tab` also moves to an optional peer dependency, next to the other
packages the CLI loads on demand. It is imported only to serve a completion
request, so installing it is the user's choice: the shell runs
`complete -- <words>` on every keypress and now gets silence when the
package is absent, while `complete <shell>` says what to install.
Also updates the dev-server 6 help snapshots, which were added after this
work branched.1 parent 313f96b commit 095d282
7 files changed
Lines changed: 112 additions & 12 deletions
File tree
- .changeset
- packages/webpack-cli
- src
- test
- complete
- help/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
2545 | 2546 | | |
2546 | 2547 | | |
2547 | 2548 | | |
2548 | | - | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
2549 | 2553 | | |
2550 | 2554 | | |
2551 | | - | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
2552 | 2564 | | |
2553 | 2565 | | |
2554 | | - | |
| 2566 | + | |
2555 | 2567 | | |
2556 | 2568 | | |
2557 | 2569 | | |
| |||
2561 | 2573 | | |
2562 | 2574 | | |
2563 | 2575 | | |
2564 | | - | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
2565 | 2596 | | |
2566 | | - | |
| 2597 | + | |
2567 | 2598 | | |
2568 | 2599 | | |
2569 | | - | |
| 2600 | + | |
2570 | 2601 | | |
2571 | 2602 | | |
2572 | 2603 | | |
| |||
2612 | 2643 | | |
2613 | 2644 | | |
2614 | 2645 | | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
2615 | 2649 | | |
2616 | 2650 | | |
2617 | 2651 | | |
2618 | 2652 | | |
2619 | 2653 | | |
2620 | 2654 | | |
2621 | 2655 | | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
2622 | 2662 | | |
2623 | 2663 | | |
2624 | 2664 | | |
| |||
2871 | 2911 | | |
2872 | 2912 | | |
2873 | 2913 | | |
2874 | | - | |
2875 | | - | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
2876 | 2918 | | |
2877 | 2919 | | |
2878 | 2920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 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 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
73 | 110 | | |
74 | 111 | | |
75 | 112 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
| 257 | + | |
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
| |||
2643 | 2646 | | |
2644 | 2647 | | |
2645 | 2648 | | |
| 2649 | + | |
2646 | 2650 | | |
2647 | 2651 | | |
2648 | 2652 | | |
| |||
2732 | 2736 | | |
2733 | 2737 | | |
2734 | 2738 | | |
| 2739 | + | |
2735 | 2740 | | |
2736 | 2741 | | |
2737 | 2742 | | |
| |||
3089 | 3094 | | |
3090 | 3095 | | |
3091 | 3096 | | |
| 3097 | + | |
3092 | 3098 | | |
3093 | 3099 | | |
3094 | 3100 | | |
| |||
3146 | 3152 | | |
3147 | 3153 | | |
3148 | 3154 | | |
| 3155 | + | |
3149 | 3156 | | |
3150 | 3157 | | |
3151 | 3158 | | |
| |||
0 commit comments