Repository navigation
Commit 11edde8
authored
feat: show prisma CLI output on the docs in the CLI's own colours, in light and dark mode (#9038)
* feat(ui): colour prisma CLI output by the CLI's tones, checked against real captures
colorizeTerminalOutput styles plain CLI output with the tones prisma-cli's engine and the ORM's renderers use (palette, rendering, migration graph lanes, focus mode and back-arc colours). Every capture from prisma 8.0.0-rc.39 with ORM 8.0.0-rc.28 is reproduced character by character; rules with no capture are tested by hand against the source.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* feat(ui): a terminal fence language that renders CLI output in the CLI's colours
terminal is aliased to plain text for Shiki; transformerTerminalColors wraps each run in a terminal-<tone> span before box drawing runs. Tone classes have light (WCAG AA on white) and dark values through --shiki-light and --shiki-dark.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs: show the migration graph example as a terminal block and remove TerminalOutput
The page's worked example becomes a terminal fence with the capture's plain text. The TerminalOutput component, its capture, tests, llm-markdown step and CSS are removed. Agents' Markdown gets terminal fences as text fences.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* fix(ui): bold the app name in prisma deploy's summary, as Composer's deploy command does
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs: show prisma CLI output in terminal blocks, in the CLI's colours
136 fences of prisma CLI output in 43 pages move from text to terminal. Fences of other tools' output, and those whose colours the CLI's source does not determine, stay text.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* fix(ui): leave a terminal block uncoloured when its lines drift, check dark contrast, spread close colours
The transformer pairs styled lines with Shiki's by position; if a notation transformer removed a line the counts differ and the block stays plain. The contrast test also checks dark values on the lightest dark code panel. ok/ref and info/color-4 light values move apart. make is no longer a command name: it turned prose such as 'make it optional' cyan.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* fix(ui): register terminal as its own plain grammar instead of a langAlias
With langAlias set, fumadocs builds a new Shiki highlighter for every compile instead of sharing one, and the docs dev server failed every page with 'Language bash not found'. An empty grammar passed through langs keeps fumadocs on its shared highlighter, and the transformer still sees the block's language as terminal.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* refactor: rename the terminal fence language to prisma-output
terminal read as 'any terminal output'; the colours only fit what the prisma CLI printed. The fence, the module and function names, and the CSS classes (now cli-tone-<tone>) say so. The colouriser's doc names its three source codebases and the releases its rules match.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* test(ui): fail the parallel-compile test when fumadocs stops sharing its highlighter
With langAlias restored the old test still passed. It now asserts rehypeCodeOptions has no langAlias and that the shared highlighter is reused with prisma-output and each fence's language loaded; each assertion fails on its own under langAlias.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* test(docs): snapshot the colours of every prisma-output block
A page edit or a rule change that alters a block's colours, or leaves a block with none, now fails until the snapshot is accepted.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs(agents): say when a block is prisma-output, bash or text
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs: move commands out of prisma-output blocks
Two script echo lines are dropped (the command is already in the block before); the rollbacks page gets an npm block for its command.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* test(docs): find tilde prisma-output fences and sort pages by code point
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs(agents): command fences, prisma dev and deploy output, sessions, and fixing a block that lost its colour
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs(agents): plain snapshot command, script echo lines, and output blocks by tool
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs(github-actions): give the seed command and its output their own blocks
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* fix(ui): keep a table row's own text when it is shorter than the header
Rows are cut at the header's column starts into cells and the gaps after them, so the runs always join back into the row. A test checks that every capture's runs join back into its text.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* fix(ui): colour prisma-output lines from the text Shiki left in them
The transformer coloured from the raw source, so text an earlier transformer removed would come back. It now colours each line's own text, which also keeps the colours in step with the lines.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* test(docs): skip prisma-output fences shown inside longer fences; accept CRLF after the fence label
The snapshot scanner now skips a fence nested in a longer one, and checks that every block's runs join back into its text.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* test(ui): pin that prisma-output handles notation comments as text does
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
* docs: colour the missed prisma output blocks; state what notation does in prisma-output; end fences on CRLF pages
Converts the dev ready lines, the telemetry first-run notice and the skills
staleness notice to prisma-output, and records them as plain. The notation
test now states the observed behaviour, with a ts control. The snapshot
scanner splits pages on CRLF too.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
---------
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>1 parent 9012eb8 commit 11edde8
104 files changed
Lines changed: 4220 additions & 451 deletions
File tree
- .claude/skills/docs-writer
- apps/docs
- content/docs
- (index)/prisma-orm
- add-to-existing-project
- quickstart/existing-app
- cli
- composer
- guides
- authentication/clerk
- compute
- database
- deployment
- frameworks
- integrations
- runtimes
- switch-to-prisma-orm
- upgrade-prisma-orm
- orm/migrations
- scripts
- src
- app
- components/terminal-output
- lib
- packages/ui/src
- mdx
- prisma-output-captures
- styles
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
42 | 60 | | |
43 | 61 | | |
44 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
0 commit comments