|
1 | | -import { ExpressLogo } from "~/assets/logos/ExpressLogo"; |
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 { InitCommand, 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 { Badge } from "~/components/primitives/Badge"; |
| 10 | +import { Button, LinkButton } from "~/components/primitives/Buttons"; |
| 11 | +import { Callout } from "~/components/primitives/Callout"; |
| 12 | +import { ClipboardField } from "~/components/primitives/ClipboardField"; |
| 13 | +import { Header1 } from "~/components/primitives/Headers"; |
| 14 | +import { Paragraph } from "~/components/primitives/Paragraph"; |
| 15 | +import { StepNumber } from "~/components/primitives/StepNumber"; |
| 16 | +import { useAppOrigin } from "~/hooks/useAppOrigin"; |
| 17 | +import { useDevEnvironment } from "~/hooks/useEnvironments"; |
| 18 | +import { useOrganization } from "~/hooks/useOrganizations"; |
| 19 | +import { useProject } from "~/hooks/useProject"; |
| 20 | +import { useProjectSetupComplete } from "~/hooks/useProjectSetupComplete"; |
4 | 21 | import { Handle } from "~/utils/handle"; |
5 | | -import { trimTrailingSlash } from "~/utils/pathBuilder"; |
| 22 | +import { projectSetupPath, trimTrailingSlash } from "~/utils/pathBuilder"; |
6 | 23 |
|
7 | 24 | export const handle: Handle = { |
8 | 25 | breadcrumb: (match) => <BreadcrumbLink to={trimTrailingSlash(match.pathname)} title="Express" />, |
9 | 26 | }; |
10 | 27 |
|
11 | 28 | export default function Page() { |
| 29 | + const organization = useOrganization(); |
| 30 | + const project = useProject(); |
| 31 | + useProjectSetupComplete(); |
| 32 | + const devEnvironment = useDevEnvironment(); |
| 33 | + invariant(devEnvironment, "Dev environment must be defined"); |
| 34 | + const appOrigin = useAppOrigin(); |
| 35 | + |
12 | 36 | return ( |
13 | | - <FrameworkComingSoon |
14 | | - frameworkName="Express" |
15 | | - githubIssueUrl="https://github.com/triggerdotdev/trigger.dev/issues/451" |
16 | | - githubIssueNumber={451} |
17 | | - > |
18 | | - <ExpressLogo className="w-56" /> |
19 | | - </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="Manually set up Trigger.dev in your existing Express project" |
| 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/express" |
| 89 | + variant="primary/medium" |
| 90 | + TrailingIcon="external-link" |
| 91 | + > |
| 92 | + Manual installation guide |
| 93 | + </LinkButton> |
| 94 | + </StepContentContainer> |
| 95 | + <StepNumber stepNumber="2" title="Run your Express app" /> |
| 96 | + <StepContentContainer> |
| 97 | + <RunDevCommand /> |
| 98 | + <Callout variant="info"> |
| 99 | + You may be using the `start` script instead, in which case substitute `dev` in the |
| 100 | + above commands. |
| 101 | + </Callout> |
| 102 | + </StepContentContainer> |
| 103 | + <StepNumber stepNumber="3" title="Run the CLI 'dev' command" /> |
| 104 | + <StepContentContainer> |
| 105 | + <TriggerDevStep /> |
| 106 | + </StepContentContainer> |
| 107 | + <StepNumber stepNumber="6" title="Wait for Jobs" displaySpinner /> |
| 108 | + <StepContentContainer> |
| 109 | + <Paragraph>This page will automatically refresh.</Paragraph> |
| 110 | + </StepContentContainer> |
| 111 | + </div> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + </PageGradient> |
20 | 115 | ); |
21 | 116 | } |
0 commit comments