-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevOverlay] Sync Terminal component with CodeFrame for Build Error
- Loading branch information
1 parent
f3ae0fa
commit 9dfd631
Showing
7 changed files
with
184 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...ponents/react-dev-overlay/_experimental/internal/components/Terminal/Terminal.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { Terminal } from './Terminal' | ||
import { withShadowPortal } from '../../storybook/with-shadow-portal' | ||
|
||
const meta: Meta<typeof Terminal> = { | ||
component: Terminal, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
decorators: [withShadowPortal], | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof Terminal> | ||
|
||
export const SimpleTerminal: Story = { | ||
args: { | ||
content: | ||
'./app/page.tsx:10:5\n\u001b[31mError:\u001b[39m Something went wrong\n at Home (./app/page.tsx:10:5)', | ||
}, | ||
} | ||
|
||
export const WithImportTrace: Story = { | ||
args: { | ||
content: `./components/Button.tsx:15:3 | ||
ReactServerComponentsError: Failed to load component | ||
Import trace for requested module: | ||
./pages/index.tsx | ||
./components/Layout.tsx | ||
./components/Button.tsx`, | ||
}, | ||
} | ||
|
||
export const WithAnsiColors: Story = { | ||
args: { | ||
content: `./app/error.tsx:5:10 | ||
\u001b[31m\u001b[1mError:\u001b[22m\u001b[39m Failed to compile | ||
\u001b[36m console\u001b[39m.\u001b[33mlog\u001b[39m('Debug message') | ||
\u001b[32m✓\u001b[39m Success message | ||
\u001b[31m✕\u001b[39m Error message`, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
...client/components/react-dev-overlay/_experimental/internal/components/Terminal/styles.tsx
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...es/next/src/client/components/react-dev-overlay/_experimental/internal/icons/FileIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// TODO: Add more Icons (react, next, etc.) | ||
export function FileIcon(props: React.SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg | ||
width="16" | ||
height="17" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M14.5 7v7a2.5 2.5 0 0 1-2.5 2.5H4A2.5 2.5 0 0 1 1.5 14V.5h7.586a1 1 0 0 1 .707.293l4.414 4.414a1 1 0 0 1 .293.707V7zM13 7v7a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2h5v5h5zM9.5 2.621V5.5h2.879L9.5 2.621z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters