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