terminal.stories.tsx
ANSI color escape sequence encodedContains a hardcoded remote HTTP(S) URL
SHA-25674bc865bf9cef96c7f5bceddd87653228eb2d0253b87e965e73e4261038ae2cb
MaleculeH(Cm)Md(Pt)
Evidence
1import type { Meta, StoryObj } from '@storybook/react'
2import { Terminal } from './terminal'
3import { withShadowPortal } from '../../storybook/with-shadow-portal'
4
5const meta: Meta<typeof Terminal> = {
6 component: Terminal,
7 parameters: {
8 layout: 'fu …
14:33… ows no violation.
15 // TODO: We might have setup more explicit backgrounds depending on theme.
16 enabled: false,
17 },
18 …
28:12… t Default: Story = {
29 args: {
30 content: `./app/page.tsx:1:1
31\x1B[31m\x1B[1mModule not found\x1B[22m\x1B[39m: Can't resolve '\x1B[32mnot-existing-module\x1B[39m'
32\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 1 |\x1B[39m \x1B[36mimport\x1B[39m \x1B[32m'not-existing-module'\x1B[39m\x1B[0m
33\x1B[0m \x1B[90m |\x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m
34\x1B[0m \x1B[90m 2 |\x1B[39m\x1B[0m
35\x1B[0m \x1B[90m 3 |\x1B[39m \x1B[36mexport\x1B[39m \x1B[36mdefault\x1B[39m \x1B[36mfunction\x1B[39m \x1B[33mPage\x1B[39m() {\x1B[0m
36\x1B[0m \x1B[90m 4 |\x1B[39m \x1B[36mreturn\x1B[39m \x1B[33m<\x1B[39m\x1B[33mp\x1B[39m\x1B[33m>\x1B[39mhello world\x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mp\x1B[39m\x1B[33m>\x1B[39m\x1B[0m
37
38https://nextjs.org/docs/messages/module-not-found`,
39 },
40}
41
42export const WithImportTrace: Story = {
43 args: {
44 content: `./app/page.tsx
45Error: \x1B[31m×\x1B[0m Expected ';', '}' or <eof>
46 ╭─[\x1B[36;1;4m/hello-world/app/page.tsx\x1B[0m:2:1]
47 \x1B[2m1\x1B[0m │ export default function Page() {
48 \x1B[2m2\ …
49:43… 1m ───\x1B[0m
50 · \x1B[35;1m╰── \x1B[35;1mThis is the expression part of an expression statement\x1B[0m\x1B[0m
51 \x1B[2m3\x1B[0m │ }
52 ╰────
53
54Caused by:
55 Syntax Error
56
57Import trace for requested module:
58./app/page.tsx`,
59 },
60}