Commit 80c87b1
feat(project): display platform suggestions in multi-column tables (#365)
## Summary
Replaces the plain indented text lists in `project create` error
messages with bordered 3-column tables using `renderTextTable`. Both the
"Did you mean?" suggestions and "Common platforms" sections now render
compactly instead of taking 30+ lines of vertical space.
Also extracts platform validation into `src/lib/platforms.ts` with fuzzy
matching (`suggestPlatform`) and validates client-side before making the
API call for faster feedback on typos.
## Changes
- New `src/lib/platforms.ts` module with `COMMON_PLATFORMS`,
`isValidPlatform`, and `suggestPlatform` (Levenshtein distance +
platform family matching)
- `buildPlatformError` now renders both sections as 3-col
`renderTextTable` tables with `headerSeparator: false`
- Client-side validation rejects invalid platforms before the API
roundtrip
- Tests updated to match new output format and validate the platforms
module
## Test Plan
- `bun test test/commands/project/` — 109 tests pass
- `bun test test/lib/platforms.test.ts` — all pass
- `npx biome check src/commands/project/create.ts` — clean
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 453b52b commit 80c87b1
File tree
4 files changed
+474
-50
lines changed- src
- commands/project
- lib
- test
- commands/project
- lib
4 files changed
+474
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| |||
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
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 | | - | |
| 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 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | | - | |
152 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
153 | 163 | | |
154 | | - | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
| |||
332 | 342 | | |
333 | 343 | | |
334 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
335 | 349 | | |
336 | 350 | | |
337 | 351 | | |
| |||
0 commit comments