forked from sing1ee/deepseekCoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99aec33
commit 55d9eba
Showing
7 changed files
with
125 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { shadcnComponents } from "@/utils/Shadcn"; | ||
// import { shadcnComponents } from "@/utils/Shadcn"; | ||
import shadcnDocs from "@/utils/shadcn-docs"; | ||
import { | ||
TogetherAIStream, | ||
TogetherAIStreamPayload, | ||
|
@@ -13,14 +14,40 @@ You are an expert frontend React engineer who is also a great UI/UX designer. Fo | |
- Make sure the React app is interactive and functional by creating state when needed and having no required props | ||
- Use TypeScript as the language for the React component | ||
- Use Tailwind classes for styling. DO NOT USE ARBITRARY VALUES (e.g. \`h-[600px]\`). Make sure to use a consistent color palette. | ||
- If the code calls for a button, use the provided \`Button\` component. Here's how to import it: \`import { Button } from '/components/ui/button';\` And here are the extra props available for use: \`\`\`type ExtraButtonProps = {variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined}\`\`\`. Use your best judgement and use an extra prop if it seems appropriate. | ||
- NO OTHER LIBRARIES (e.g. zod, hookform) ARE INSTALLED OR ABLE TO BE IMPORTED. | ||
- Please ONLY return the full React code starting with the imports, nothing else. It's very important for my job that you only return the React code with imports. DO NOT START WITH \`\`\`typescript or \`\`\`javascript or \`\`\`tsx or \`\`\`. | ||
- The [email protected] library is also available to be imported. If you need an icon, use one from lucide-react. Here's an example of importing and using one: import { Camera } from "lucide-react"\` & \`<Camera color="red" size={48} />\` | ||
There are some prestyled components available for use. Please use your best judgement to use any of these components if the app calls for one. | ||
Here are the components that are available, along with how to use them: | ||
${shadcnDocs | ||
.map( | ||
(component) => ` | ||
<component> | ||
<name> | ||
${component.name} | ||
</name> | ||
<usage> | ||
${component.usage} | ||
</component> | ||
`, | ||
) | ||
.join("\n")} | ||
NO OTHER LIBRARIES (e.g. zod, hookform) ARE INSTALLED OR ABLE TO BE IMPORTED. | ||
`; | ||
// - The assistant can ONLY use these 2 prebuilt components from the \`shadcn\` library if needed: | ||
// - \`import { Button } from '@/components/ui/button';\` | ||
// - \`import { Alert, AlertDescription, AlertTitle, AlertDialog, AlertDialogAction } from '@/components/ui/alert';\` | ||
// - ONLY IF the user asks for a dashboard, graph or chart, the recharts library is available to be imported, e.g. \`import { LineChart, XAxis, ... } from "recharts"\` & \`<LineChart ...><XAxis dataKey="name"> ...\`. Please only use this when needed. | ||
|
||
console.log(systemPrompt); | ||
|
||
// - If the code calls for a button, use the provided \`Button\` component. Here's how to import it: \`import { Button } from '/components/ui/button';\` And here are the extra props available for use: \`\`\`type ExtraButtonProps = {variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined}\`\`\`. Use your best judgement and use an extra prop if it seems appropriate. | ||
// // - The assistant can ONLY use these 2 prebuilt components from the \`shadcn\` library if needed: | ||
// // - \`import { Button } from '@/components/ui/button';\` | ||
// // - \`import { Alert, AlertDescription, AlertTitle, AlertDialog, AlertDialogAction } from '@/components/ui/alert';\` | ||
// // - ONLY IF the user asks for a dashboard, graph or chart, the recharts library is available to be imported, e.g. \`import { LineChart, XAxis, ... } from "recharts"\` & \`<LineChart ...><XAxis dataKey="name"> ...\`. Please only use this when needed. | ||
|
||
// - Here are all the prebuilt components ${JSON.stringify(shadcnComponents.button + shadcnComponents.alert)} | ||
|
||
export async function POST(req: Request) { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const name = "Avatar"; | ||
|
||
export const usage = ` | ||
import { Avatar, AvatarFallback, AvatarImage } from "/components/ui/avatar"; | ||
export function Demo() { | ||
return ( | ||
<Avatar> | ||
<AvatarImage src="https://github.com/nutlope.png" /> | ||
<AvatarFallback>CN</AvatarFallback> | ||
</Avatar> | ||
) | ||
} | ||
`; |
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,18 @@ | ||
export const name = "Button"; | ||
|
||
export const usage = ` | ||
import { Button } from "/components/ui/button" | ||
export function Demo() { | ||
return ( | ||
<div> | ||
<Button>A normal button</Button> | ||
<Button variant='secondary'>Button</Button> | ||
<Button variant='destructive'>Button</Button> | ||
<Button variant='outline'>Button</Button> | ||
<Button variant='ghost'>Button</Button> | ||
<Button variant='link'>Button</Button> | ||
</div> | ||
) | ||
} | ||
`; |
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,25 @@ | ||
export const name = "Card"; | ||
|
||
export const usage = ` | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
} from "/components/ui/card" | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>Card Title</CardTitle> | ||
<CardDescription>Card Description</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<p>Card Content</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
`; |
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,25 @@ | ||
export const name = "Checkbox"; | ||
|
||
export const usage = ` | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
} from "/components/ui/card" | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>Card Title</CardTitle> | ||
<CardDescription>Card Description</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<p>Card Content</p> | ||
</CardContent> | ||
<CardFooter> | ||
<p>Card Footer</p> | ||
</CardFooter> | ||
</Card> | ||
`; |
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,7 @@ | ||
import * as Avatar from "./avatar"; | ||
import * as Button from "./button"; | ||
import * as Card from "./card"; | ||
|
||
const shadcnDocs = [Avatar, Button, Card]; | ||
|
||
export default shadcnDocs; |