|
1 | | -import { SvelteKitLogo } from "~/assets/logos/SveltekitLogo"; |
2 | | -import { FrameworkComingSoon } from "~/components/frameworks/FrameworkComingSoon"; |
| 1 | +import { ChatBubbleLeftRightIcon, Squares2X2Icon } from "@heroicons/react/20/solid"; |
| 2 | +import invariant from "tiny-invariant"; |
| 3 | +import { Feedback } from "~/components/Feedback"; |
| 4 | +import { PageGradient } from "~/components/PageGradient"; |
| 5 | +import { RunDevCommand, TriggerDevStep } from "~/components/SetupCommands"; |
| 6 | +import { StepContentContainer } from "~/components/StepContentContainer"; |
| 7 | +import { InlineCode } from "~/components/code/InlineCode"; |
3 | 8 | import { BreadcrumbLink } from "~/components/navigation/NavBar"; |
| 9 | +import { Button, LinkButton } from "~/components/primitives/Buttons"; |
| 10 | +import { ClipboardField } from "~/components/primitives/ClipboardField"; |
| 11 | +import { Header1 } from "~/components/primitives/Headers"; |
| 12 | +import { NamedIcon } from "~/components/primitives/NamedIcon"; |
| 13 | +import { Paragraph } from "~/components/primitives/Paragraph"; |
| 14 | +import { StepNumber } from "~/components/primitives/StepNumber"; |
| 15 | +import { useAppOrigin } from "~/hooks/useAppOrigin"; |
| 16 | +import { useProjectSetupComplete } from "~/hooks/useProjectSetupComplete"; |
| 17 | +import { useDevEnvironment } from "~/hooks/useEnvironments"; |
| 18 | +import { useOrganization } from "~/hooks/useOrganizations"; |
| 19 | +import { useProject } from "~/hooks/useProject"; |
4 | 20 | import { Handle } from "~/utils/handle"; |
5 | | -import { trimTrailingSlash } from "~/utils/pathBuilder"; |
6 | | - |
| 21 | +import { projectSetupPath, trimTrailingSlash } from "~/utils/pathBuilder"; |
| 22 | +import { Callout } from "~/components/primitives/Callout"; |
| 23 | +import { Badge } from "~/components/primitives/Badge"; |
7 | 24 | export const handle: Handle = { |
8 | 25 | breadcrumb: (match) => ( |
9 | 26 | <BreadcrumbLink to={trimTrailingSlash(match.pathname)} title="SvelteKit" /> |
10 | 27 | ), |
11 | 28 | }; |
12 | 29 |
|
13 | | -export default function Page() { |
| 30 | +export default function SetUpSveltekit() { |
| 31 | + const organization = useOrganization(); |
| 32 | + const project = useProject(); |
| 33 | + useProjectSetupComplete(); |
| 34 | + const devEnvironment = useDevEnvironment(); |
| 35 | + invariant(devEnvironment, "Dev environment must be defined"); |
14 | 36 | return ( |
15 | | - <FrameworkComingSoon |
16 | | - frameworkName="SvelteKit" |
17 | | - githubIssueUrl="https://github.com/triggerdotdev/trigger.dev/issues/453" |
18 | | - githubIssueNumber={453} |
19 | | - > |
20 | | - <SvelteKitLogo className="w-56" /> |
21 | | - </FrameworkComingSoon> |
| 37 | + <PageGradient> |
| 38 | + <div className="mx-auto max-w-3xl"> |
| 39 | + <div className="flex items-center justify-between"> |
| 40 | + <Header1 spacing className="text-bright"> |
| 41 | + Get setup in 5 minutes |
| 42 | + </Header1> |
| 43 | + <div className="flex items-center gap-2"> |
| 44 | + <LinkButton |
| 45 | + to={projectSetupPath(organization, project)} |
| 46 | + variant="tertiary/small" |
| 47 | + LeadingIcon={Squares2X2Icon} |
| 48 | + > |
| 49 | + Choose a different framework |
| 50 | + </LinkButton> |
| 51 | + <Feedback |
| 52 | + button={ |
| 53 | + <Button variant="tertiary/small" LeadingIcon={ChatBubbleLeftRightIcon}> |
| 54 | + I'm stuck! |
| 55 | + </Button> |
| 56 | + } |
| 57 | + defaultValue="help" |
| 58 | + /> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + <div> |
| 62 | + <Callout |
| 63 | + variant={"info"} |
| 64 | + to="https://github.com/triggerdotdev/trigger.dev/discussions/430" |
| 65 | + className="mb-8" |
| 66 | + > |
| 67 | + Trigger.dev has full support for serverless. We will be adding support for long-running |
| 68 | + servers soon. |
| 69 | + </Callout> |
| 70 | + <div> |
| 71 | + <StepNumber |
| 72 | + stepNumber="1" |
| 73 | + title="Follow the steps from the Sveltekit manual installation guide" |
| 74 | + /> |
| 75 | + <StepContentContainer className="flex flex-col gap-2"> |
| 76 | + <Paragraph className="mt-2">Copy your server API Key to your clipboard:</Paragraph> |
| 77 | + <div className="mb-2 flex w-full items-center justify-between"> |
| 78 | + <ClipboardField |
| 79 | + secure |
| 80 | + className="w-fit" |
| 81 | + value={devEnvironment.apiKey} |
| 82 | + variant={"secondary/medium"} |
| 83 | + icon={<Badge variant="outline">Server</Badge>} |
| 84 | + /> |
| 85 | + </div> |
| 86 | + <Paragraph>Now follow this guide:</Paragraph> |
| 87 | + <LinkButton |
| 88 | + to="https://trigger.dev/docs/documentation/guides/manual/sveltekit" |
| 89 | + variant="primary/medium" |
| 90 | + TrailingIcon="external-link" |
| 91 | + > |
| 92 | + Manual installation guide |
| 93 | + </LinkButton> |
| 94 | + <div className="flex items-start justify-start gap-2"></div> |
| 95 | + </StepContentContainer> |
| 96 | + <StepNumber stepNumber="2" title="Run your sveltekit app" /> |
| 97 | + <StepContentContainer> |
| 98 | + <RunDevCommand extra=" -- --open --host" /> |
| 99 | + </StepContentContainer> |
| 100 | + <StepNumber stepNumber="3" title="Run the CLI 'dev' command" /> |
| 101 | + <StepContentContainer> |
| 102 | + <TriggerDevStep extra=" --port 5173" /> |
| 103 | + </StepContentContainer> |
| 104 | + <StepNumber stepNumber="6" title="Wait for Jobs" displaySpinner /> |
| 105 | + <StepContentContainer> |
| 106 | + <Paragraph>This page will automatically refresh.</Paragraph> |
| 107 | + </StepContentContainer> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + </PageGradient> |
22 | 112 | ); |
23 | 113 | } |
0 commit comments