NestJS framework suport (from @H4ad) (#574)
* feat: added nestjs package adapter
* Latest lockfile
* Updated Astro setup docs: env import
* Astro docs improvements
* Docs: improved the limitations
* Bumped package versions to 2.1.3
* Updated the Astro docs with SSR notes
* test/368/use vitest instead of jest (#470)
* chore: add vitest dependencies
* refactor: replace jest by vitest
* test: disable broken test
* Update pnpm-lock.yaml
* Update pnpm-lock.yaml
---------
Co-authored-by: Matt Aitken <matt@mattaitken.com>
* Created Temp for pull req, bugreport & feature req
* A few teaks to the templates
* Added instructions for how to do Changeset snapshots
* Redirect people to discord to ask a question
* Documentation Update: Added <github_username> instead of triggerdotdev to avoid confusion while cloning the repository (#477)
* Added a link to the homepage from the side menu (#479)
* Added 2 new named icons
* New side menu link to the homepage
* Updated lock file
* Removed un-used import
* Renamed the examples dir to references (true examples are in another repo and this was confusing)
* Add a references README
* Fixes broken pnpm lock file
* Improve the Astro manual setup guide
* Fixed cal.com link
* Upgrade to the latest remix (pre v2)
* React status hooks (#493)
* Added stripInternal to SDK tsconfig
* Statuses can now be set from a run, and are stored in the database
* Added the key to the returned status
* Made the test job have an extra step and only pass in some of the options
* client.getRunStatuses() and the corresponding endpoint
* client.getRun() now includes status info
* Fixed circular dependency schema
* Translate null to undefined
* Added the react package to the nextjs-reference tsconfig
* Removed unused OpenAI integration from nextjs-reference project
* New hooks for getting the statuses
* Disabled most of the nextjs-reference jobs
* Updated the hooks UI
* Updated the endpoints to deal with null statuses values
* The hook is working, with an example
* Changeset: “You can create statuses in your Jobs that can then be read using React hooks”
* Changeset config is back to the old changelog style
* WIP on new React hooks guide
* Guide docs for the new hooks
* Added the status hooks to the React hooks guide
* Removed the links to the status hooks reference for now
* Re-ordered the hooks
* Fix for an error in the docs
* Set a default of a blank array for the GetRunSchema
* Fixed dependency
* Revert "Upgrade to the latest remix (pre v2)"
This reverts commit 4edc7112ab.
* Update introduction.mdx (#498)
Changed https://github.com/triggerdotdev/examples/tree/main/resend (which was a 404) to https://github.com/triggerdotdev/examples/tree/main/resend-email-form
* Use the bell icon for the new status Tasks
* Going exponential with `Linear` (#478)
* Unleash GPT magic
* Clean up after GPT
* All the hooks
* Provisional integration catalog entry
* Sample webhook jobs
* Attachments with alpha warnings
* Remove some verbose logs
* Fix IP restrictions
* Remove tunnel
* Revert "Remove tunnel"
This reverts commit c5b69ce6524e3b40c26b66cdc56e087b8576b8c6.
* Resolve event name clashes
* Remove circular dependency
* Use correct payload uuid
* Schema fixes
* Fix webhook event name
* Start to Linearify catalog entry
* Remove todo
* More catalog updates
* Make OAuth work
* Rename webhook helper
* Schema juggling
* More discrimination
* Add Issue SLA event
* Simplify triggers
* Handle rate limits
* Fix Project schema
* Payload examples
* Improve event props
* Remove redundant source metadata
* One type to rule them all
* Recursive WithoutFunctions type
* Linear output serializer
* Some tasks
* Update catalog entry
* Dynamic usage sample
* Bump version
* Remove tunnel
* More tasks
* Add optional skipRetrying on runTask errors
* Fail fast on user errors
* Entity getter tasks
* Another couple of tasks
* Token to apiKey
* Sort tasks
* Add filtered issue SLA triggers
* Add docs
* Type fixes
* Job catalog examples
* Serialization helper docs
* Add changeset
* Refactor webhooks
* Enhance properties
* Pagination helper and docs
* Clean up imports
* Change misc catalog job
---------
Co-authored-by: Matt Aitken <matt@mattaitken.com>
* Use absolute image paths (#490)
* Update sendevent.mdx
* fix: Fail client-side on invalid Stripe event names (#492)
* Parse event names
* Add changeset
* feat: BYO Auth (#491)
* feat: BYO Auth
Define client-side auth resolvers to be able to supply custom authentication credentials for integrations before a run is performed
- Added new defineAuthResolver
- Update all integrations to support the new auth resolvers
- Strip internal symbols from .d.ts in integrations and trigger-sdk
- Added BYO Auth docs
- Update Dynamic Schedule to support associated account IDs
- Create external accounts just-in-time
- Added Account ID field to test job when there are external auth integrations
- Show Account ID on run dashboard
- Added new Run error state called “Unresolved auth”
* Added changeset
* Remove @internal from TriggerIntegration public methods
* Add void to the result union
* DynamicTriggers now work with the new BYO auth system, and added a bunch of docs and docs changes
* Add additional key material for registering dynamic trigger task
* Add new define* instance methods to the overview
* CLI now supports multiple frameworks (with tests) (#480)
* Early work defining CLI framework support
* WIP moving CLI init logic to the Framework class
* Installing files should now work for Nextjs
* Some fixes
* WIP creating unit tests for Next.js project detection
* Delete old jest config
* Latest lockfile
* Detect use of src directory test
* Tests for detection pages/app directory
* Correct detection of Next.js project
* Renamed test file
* Create install files from template files with replacements. With tests
* Added multiple uses of the same replacement
* Created a test for the install step (it fails right now with JS)
* Removed unused import
* Another test that should pass but currently fails…
* Path alias fixed and now has tests
* New pathAlias function used
* Nextjs page install tests
* Fixed app directory install (with tests)
* Removed e2e CLI test, switched to unit testing strategy instead
* Latest lockfile
* The install files are now actual files that are copied and transformed
* Got the template files working correctly after building
* Next steps are now framework specific
* createFileFromTemplate now works with a path again. Uses mock if specified.
* Renamed apiRoute.js to pagesApiRoute.js
* Simplified pages file generation
* Next.js app API route template
* Next.js App routing support, with common files logic shared
* Dev command now uses framework default values if they exist and aren’t overridden
* Unused import
* pathAlias now works for all frameworks
* Added a test to detect Next from the next.config.js
* WIP on Remix framework support
* Tests for Remix install
* Replaced references to Next.js
* Use a green ✔️ instead of ✅ in the CLI
* Support for multiple hostnames
* Tunneling can now use the hostname and port
* Work on multiple ports
* Improved the error messages. Added some extra pots to Next.js
* Update the Remix templates to have .server in the imports
* Remix updated to use server-runtime instead of node. Node v18+
* Frameworks can specify the watch paths and ignore paths
* Define the watch variables above, so we can easily log them for debugging
* Don’t wait for outdated package checking when running the dev command
* Improved the Remix manual setup guide
* Rewriting docs for quickstart
* Updated the Next.js quickstart
* Remix quick start
* Added a changeset
* Improved the Next.js manual setup
* Tweaked the Linear scopes
* Latest lockfile
* Fix for getPathAlias typecheck failure
* Linear getAll type error (weirdly not in VSCode…) and removed the pagination example that uses the SDK as won’t work with timeouts
* Add BYO auth for oauth options
* Add back in Job.toJSON to fix the testing package
* Removed dynamicTrigger @internal from toJSON
* The CLI now checks for a dev server API key in init and dev commands
* Remix onboarding now uses the CLI init command
* Decouple zod (#500)
Zod Schemas is no longer required for validating/inferring event triggers. We’ve taken inspiration from how domain-functions did it: https://github.com/seasonedcc/domain-functions/pull/114
* chore: Update version for release (#481)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Latest lockfile
* feat: Basic usage dashboard to show run volume (#501)
* New usage dashboard with static data
* Implement org usage dash
* Grab chart data for the last 12 months
* If no org is found just return undefined so a 404 will be shown
* Remove mock data
* Fill in missing months with 0s
---------
Co-authored-by: James Ritchie <james@jamesritchie.co.uk>
* Fixed duplicate end month
* hotfix
* hotfix 2
* Astro CLI support (#506)
* Astro framework CLI support
* Changeset: Added Astro automatic installation
* Fixed the package name – was remix, now astro
* Fixed the export of the example
* Added IPv6 localhost to Astro hostnames
* Updated Astro onboarding to show the CLI init command, instead of manual instructions
* Astro quickstart
* Fix for type in Remix quickstart
* Next.js framework detection allows different config file extensions and “next” devDependency
* Made the dev command port more general so it works with various frameworks
* chore: Update version for release (#508)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Fix for incorrectly named Next.js package in manual setup
* Latest lockfile
* Increased the intervalTrigger max from 1 day to 30 days
* Implement the task output redacting to prevent redacted values from showing in the logs
* Express frameworks docs + CLI (#512)
* Manual setup docs
* Added the onboarding
* The emails package now works with Node > 18
* Added CLi support for Express, including custom init command finished messages
* Need to actually log out the installation complete message…
* Fix for an old Remix reference
* Renamed the page export
* Use resolvedOptions.triggerUrl
* Typo in manual instructions
* chore: Update version for release (#513)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Latest lockfile
* Add the STAGING environment by default
* Fixed sparodically failed run creations
- Use a better way of getting the latest job run number to increment
- Make the CreateRunService transaction more reliable
- Invoke dispatchers in parallel
- No longer swallow prisma errors in $transaction
* Swapped out the Homepage link in the side menu for a link to the Changelog
* Youtube embedded video fits its aspect ratio instead of going full width
* Improved CLI init Next.js middleware detection
* CLI init: adds public key as “TRIGGER_PUBLIC_API_KEY” except for Next which overrides this
* Updated the docs for the React hooks
* chore: Update version for release (#521)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Display framework logos on the onboarding setup pages (#519)
* autofocus the search field on the Job page
* Add some documentation around canceling scheduled events
* Updated outdated lockfile
* Updated docs README.md
* Improves the performance of run resuming (#522)
* Improves the perform of run resuming
When runs resume, we try and make sure that tasks that have already been completed are cached and reused. Worst case scenario the client needs to hit the API server once for a non-cached task that is indeed completed on the server, but this can get pretty expensive when there are a larger number of tasks.
This commit does 2 different things to help:
- noop tasks are no longer “cached” using the cachedTasks strategy, instead their idempotency keys are shoved into a bloom filter and the client tests for their inclusion in the bloom filter before running them (since they don’t have any concept of output, this works)
- Additional cached tasks are lazy loaded when a task is run. This allows us to progressively fetch additional tasks to be cached on the client, which will cut down on cache misses by a decent amount
* Create warm-carrots-float.md
* Make io.yield backwards compat with older platform versions
* Better support old clients connecting to server versions that support lazy loading cached tasks
* Fixed type errors when settings headers with unknown value
* Better yield not support error message
* Rename _version to _serverVersion to be more clear
* Add typed filters to `Linear` getAll helper (#517)
* Fix getAll params type
* Changeset
* Search param types
* Update changeset
* `Replicate` integration and remote callbacks (#507)
* Support tasks with remote callbacks
* Add common integration tsconfig
* Add Replicate integration
* Basic job catalog example
* Integration catalog entry
* Check for callbackUrl during executeTask
* Fix getAll
* Improve JSDoc
* Bump version
* Remove named queue
* Simplify runTask types
* Trust the types
* Fail tasks on timeout
* Callback timeout as param
* Mess with types
* performRunExecutionV1
* Update runTask docs
* Shorten callback task methods
* Fix run method return type
* Image processing jobs
* Replicate docs
* Text output example
* Changeset
* Version bump
* Roll back ugly types
* Remove missing types
* Quicker return when waiting on remote callback
* Remote callback example
* Bump version
* Remove schema parsing
* Only schedule positive callback timeout
* Decrease callback secret length
* Explicit default timeouts
* Import deployments tasks
* JSDoc
* Deployments docs
* Fix runTask examples, mention wrappers
---------
Co-authored-by: Eric Allam <eric@trigger.dev>
* Update pnpm lock file
* Allow blank issues
* chore: Update version for release (#538)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Fix pnpm lock file
* feat: New Test page (#558)
* Improvements to the shortcut keys
* Updated code mirror theme to the new dark mode style
* Removed the old test page help panel copy
* WIP new structure for the test page
* Added some of the side panel options for examples and account ID
* Conditionally hide the side panel components if they’re blank
* Example with selected state working
* Allow selecting the example again to overwrite any edits
* Previous run payloads working
* Select a recent payload if there’s no example
* Created Icon and DetailCell components
* The integrations now use the DetailCell
* Use DetailCell on the integrations page
* Added support for description to DetailCell. With proper variants now
* DateTimeAccurate and formatDateTimeAccurate weren’t displaying correctly.
fractionalSecondDigits isn’t in the types, but is supported for 92.5% of users
* DetailCell now allows label and description to be React components
* Using the DetailCell on the Test page
* Styled the CodeMirror scrollbars to match elsewhere
* Adding copy and clear to the JSONEditor, not working properly yet though
* Removed the copy/clear buttons from the Test route
* Delete the light color theme
* The editor now supports copying/clearing etc
* Made it clear when text is copied
* Changed the learn link to a tertiary button
* Fixed CMD shortcut keys
* Run test button now works with ⌘ Enter
* CodeMirror now allows ⌘Enter to escape the field
* Added JSON linter to the test editor
* Fix for buttons not being aligned correctly
* Copy/clear buttons now aligned
* Made the integration DetailCell text smaller
* The test recent payloads now have colored text to help identify the status
* DetailCell descriptions are dimmer
* Added link to docs for BYOA
* Fix for buttons going full width when they shouldn’t
---------
Co-authored-by: James Ritchie <james@jamesritchie.co.uk>
* chore: update doc title for groups (#539)
* chore: update doc title for groups
* update docs for sdk and integrations
* Add instructions for triggering job runs to the job catalog readme
* Updated the Test docs
* Removed a console.log when a user’s file is changed that CLI dev is listening for
* feat: allow cancelling jobs from trigger-client sdk (#562)
* feat: allow cancelling jobs from trigger-client sdk
* use presenter instead of service for non-mutating logic
* chore: upgrade zod to 3.22.3 (#570)
* chore: upgrade zod to 3.22.3
* add changeset
* Created a changeset with the correct starting package version
* Added headers to NestJS response
* Added some types to the NestJS project
* Added fastify types
* Removed log from CodeMirror
* Added InstallPackages component
* Improved the NestJS onboarding instructions
* Updated the onboarding instructions
* Made all the quickstart framework cards snippets, so the page isn’t a nightmare to edit
* NestJS docs updates
* Added dotenv to the earlier code sample
* Latest lockfile
* Moved the nestjs-example to the reference folder
---------
Co-authored-by: Vinícius Lourenço <contact@viniciusl.com.br>
Co-authored-by: Wesley <100464352+ologbonowiwi@users.noreply.github.com>
Co-authored-by: Vishesh Rawal <92795514+visheshrwl@users.noreply.github.com>
Co-authored-by: Eric Allam <eallam@icloud.com>
Co-authored-by: Aniket Bindhani <aniketbindhani44@gmail.com>
Co-authored-by: James Ritchie <james@trigger.dev>
Co-authored-by: D-K-P <dkp.github@pm.me>
Co-authored-by: Gregory <93215236+gjohnsx@users.noreply.github.com>
Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com>
Co-authored-by: Eric Allam <eric@trigger.dev>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: James Ritchie <james@jamesritchie.co.uk>
Co-authored-by: Hemachandar <132386067+hmacr@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@trigger.dev/nestjs": patch
|
||||
---
|
||||
|
||||
First release of NestJS adaptor
|
||||
@@ -0,0 +1,44 @@
|
||||
import {
|
||||
ClientTabs,
|
||||
ClientTabsList,
|
||||
ClientTabsTrigger,
|
||||
ClientTabsContent,
|
||||
} from "../primitives/ClientTabs";
|
||||
import { ClipboardField } from "../primitives/ClipboardField";
|
||||
|
||||
type InstallPackagesProps = {
|
||||
packages: string[];
|
||||
};
|
||||
|
||||
export function InstallPackages({ packages }: InstallPackagesProps) {
|
||||
return (
|
||||
<ClientTabs defaultValue="npm">
|
||||
<ClientTabsList>
|
||||
<ClientTabsTrigger value={"npm"}>npm</ClientTabsTrigger>
|
||||
<ClientTabsTrigger value={"pnpm"}>pnpm</ClientTabsTrigger>
|
||||
<ClientTabsTrigger value={"yarn"}>yarn</ClientTabsTrigger>
|
||||
</ClientTabsList>
|
||||
<ClientTabsContent value={"npm"}>
|
||||
<ClipboardField
|
||||
variant="primary/medium"
|
||||
className="mb-4"
|
||||
value={`npm install ${packages.join(" ")}`}
|
||||
/>
|
||||
</ClientTabsContent>
|
||||
<ClientTabsContent value={"pnpm"}>
|
||||
<ClipboardField
|
||||
variant="primary/medium"
|
||||
className="mb-4"
|
||||
value={`pnpm install ${packages.join(" ")}`}
|
||||
/>
|
||||
</ClientTabsContent>
|
||||
<ClientTabsContent value={"yarn"}>
|
||||
<ClipboardField
|
||||
variant="primary/medium"
|
||||
className="mb-4"
|
||||
value={`yarn add ${packages.join(" ")}`}
|
||||
/>
|
||||
</ClientTabsContent>
|
||||
</ClientTabs>
|
||||
);
|
||||
}
|
||||
@@ -28,7 +28,6 @@ export function getEditorSetup(showLineNumbers = true, showHighlights = true): A
|
||||
{
|
||||
key: "Mod-Enter",
|
||||
run: () => {
|
||||
console.log("Mod-Enter");
|
||||
return true;
|
||||
},
|
||||
preventDefault: false,
|
||||
|
||||
@@ -72,7 +72,7 @@ export function FrameworkSelector() {
|
||||
<FrameworkLink to={projectSetupFastifyPath(organization, project)}>
|
||||
<FastifyLogo className="w-36" />
|
||||
</FrameworkLink>
|
||||
<FrameworkLink to={projectSetupNestjsPath(organization, project)}>
|
||||
<FrameworkLink to={projectSetupNestjsPath(organization, project)} supported>
|
||||
<NestjsLogo className="w-36" />
|
||||
</FrameworkLink>
|
||||
</div>
|
||||
|
||||
+211
-12
@@ -1,21 +1,220 @@
|
||||
import { NestjsLogo } from "~/assets/logos/NestjsLogo";
|
||||
import { FrameworkComingSoon } from "~/components/frameworks/FrameworkComingSoon";
|
||||
import { ChatBubbleLeftRightIcon, Squares2X2Icon } from "@heroicons/react/20/solid";
|
||||
import invariant from "tiny-invariant";
|
||||
import { Feedback } from "~/components/Feedback";
|
||||
import { PageGradient } from "~/components/PageGradient";
|
||||
import { StepContentContainer } from "~/components/StepContentContainer";
|
||||
import { InlineCode } from "~/components/code/InlineCode";
|
||||
import { InstallPackages } from "~/components/code/InstallPackages";
|
||||
import { BreadcrumbLink } from "~/components/navigation/NavBar";
|
||||
import { Button, LinkButton } from "~/components/primitives/Buttons";
|
||||
import { Header1 } from "~/components/primitives/Headers";
|
||||
import { Paragraph } from "~/components/primitives/Paragraph";
|
||||
import { StepNumber } from "~/components/primitives/StepNumber";
|
||||
import { useAppOrigin } from "~/hooks/useAppOrigin";
|
||||
import { useDevEnvironment } from "~/hooks/useEnvironments";
|
||||
import { useOrganization } from "~/hooks/useOrganizations";
|
||||
import { useProject } from "~/hooks/useProject";
|
||||
import { useProjectSetupComplete } from "~/hooks/useProjectSetupComplete";
|
||||
import { Handle } from "~/utils/handle";
|
||||
import { trimTrailingSlash } from "~/utils/pathBuilder";
|
||||
import { projectSetupPath, trimTrailingSlash } from "~/utils/pathBuilder";
|
||||
import { CodeBlock } from "../../components/code/CodeBlock";
|
||||
import { TriggerDevStep } from "~/components/SetupCommands";
|
||||
|
||||
export const handle: Handle = {
|
||||
breadcrumb: (match) => <BreadcrumbLink to={trimTrailingSlash(match.pathname)} title="Nest.js" />,
|
||||
breadcrumb: (match) => <BreadcrumbLink to={trimTrailingSlash(match.pathname)} title="NestJS" />,
|
||||
};
|
||||
|
||||
export default function Page() {
|
||||
const AppModuleCode = `
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { TriggerDevModule } from '@trigger.dev/nestjs';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
TriggerDevModule.registerAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService) => ({
|
||||
id: 'my-nest-app',
|
||||
apiKey: config.getOrThrow('TRIGGER_API_KEY'),
|
||||
apiUrl: config.getOrThrow('TRIGGER_API_URL'),
|
||||
verbose: false,
|
||||
ioLogLocalEnabled: true,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
`;
|
||||
|
||||
const JobControllerCode = `
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { InjectTriggerDevClient } from '@trigger.dev/nestjs';
|
||||
import { eventTrigger, TriggerClient } from '@trigger.dev/sdk';
|
||||
|
||||
@Controller()
|
||||
export class JobController {
|
||||
constructor(
|
||||
@InjectTriggerDevClient() private readonly client: TriggerClient,
|
||||
) {
|
||||
this.client.defineJob({
|
||||
id: 'test-job',
|
||||
name: 'Test Job One',
|
||||
version: '0.0.1',
|
||||
trigger: eventTrigger({
|
||||
name: 'test.event',
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info('Hello world!', { payload });
|
||||
|
||||
return {
|
||||
message: 'Hello world!',
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return \`Running Trigger.dev with client-id \${this.client.id}\`;
|
||||
}
|
||||
}`;
|
||||
|
||||
const AppModuleWithControllerCode = `
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { TriggerDevModule } from '@trigger.dev/nestjs';
|
||||
import { JobController } from './job.controller';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
TriggerDevModule.registerAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService) => ({
|
||||
id: 'my-nest-app',
|
||||
apiKey: config.getOrThrow('TRIGGER_API_KEY'),
|
||||
apiUrl: config.getOrThrow('TRIGGER_API_URL'),
|
||||
verbose: false,
|
||||
ioLogLocalEnabled: true,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
controllers: [
|
||||
//...existingControllers,
|
||||
JobController
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
`;
|
||||
|
||||
const packageJsonCode = `"trigger.dev": {
|
||||
"endpointId": "my-nest-app"
|
||||
}`;
|
||||
|
||||
export default function SetupNestJS() {
|
||||
const organization = useOrganization();
|
||||
const project = useProject();
|
||||
useProjectSetupComplete();
|
||||
const devEnvironment = useDevEnvironment();
|
||||
const appOrigin = useAppOrigin();
|
||||
|
||||
invariant(devEnvironment, "devEnvironment is required");
|
||||
|
||||
return (
|
||||
<FrameworkComingSoon
|
||||
frameworkName="Nest.js"
|
||||
githubIssueUrl="https://github.com/triggerdotdev/trigger.dev/issues/449"
|
||||
githubIssueNumber={449}
|
||||
>
|
||||
<NestjsLogo className="w-56" />
|
||||
</FrameworkComingSoon>
|
||||
<PageGradient>
|
||||
<div className="mx-auto max-w-3xl">
|
||||
<div className="flex items-center justify-between">
|
||||
<Header1 spacing className="text-bright">
|
||||
Get setup in 2 minutes
|
||||
</Header1>
|
||||
<div className="flex items-center gap-2">
|
||||
<LinkButton
|
||||
to={projectSetupPath(organization, project)}
|
||||
variant="tertiary/small"
|
||||
LeadingIcon={Squares2X2Icon}
|
||||
>
|
||||
Choose a different framework
|
||||
</LinkButton>
|
||||
<Feedback
|
||||
button={
|
||||
<Button variant="tertiary/small" LeadingIcon={ChatBubbleLeftRightIcon}>
|
||||
I'm stuck!
|
||||
</Button>
|
||||
}
|
||||
defaultValue="help"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<>
|
||||
<StepNumber stepNumber="1" title="Add the dependencies" />
|
||||
<StepContentContainer>
|
||||
<InstallPackages
|
||||
packages={["@trigger.dev/sdk", "@trigger.dev/nestjs", "@nestjs/config"]}
|
||||
/>
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="2" title="Add the environment variables" />
|
||||
<StepContentContainer className="flex flex-col gap-2">
|
||||
<Paragraph>
|
||||
Inside your <InlineCode>.env</InlineCode> file, create the following env variables:
|
||||
</Paragraph>
|
||||
<CodeBlock
|
||||
fileName=".env"
|
||||
showChrome
|
||||
code={`TRIGGER_API_KEY=${devEnvironment.apiKey}\nTRIGGER_API_URL=${appOrigin}`}
|
||||
/>
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="3" title="Add the TriggerDevModule" />
|
||||
<StepContentContainer className="flex flex-col gap-2">
|
||||
<Paragraph>
|
||||
Now, go to your <InlineCode>app.module.ts</InlineCode> and add the{" "}
|
||||
<InlineCode>TriggerDevModule</InlineCode>:
|
||||
</Paragraph>
|
||||
<CodeBlock fileName="app.module.ts" showChrome code={AppModuleCode} />
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="4" title="Add the first job" />
|
||||
<StepContentContainer className="flex flex-col gap-2">
|
||||
<Paragraph>
|
||||
Create a <InlineCode>controller</InlineCode> called{" "}
|
||||
<InlineCode>job.controller.ts</InlineCode> and add the following code:
|
||||
</Paragraph>
|
||||
<CodeBlock fileName="src/job.controller.ts" showChrome code={JobControllerCode} />
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="5" title="Update your app.module.ts" />
|
||||
<StepContentContainer className="flex flex-col gap-2">
|
||||
<Paragraph>
|
||||
Now, add the new <InlineCode>controller</InlineCode> to your{" "}
|
||||
<InlineCode>app.module.ts</InlineCode>:
|
||||
</Paragraph>
|
||||
<CodeBlock fileName="app.module.ts" showChrome code={AppModuleWithControllerCode} />
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="6" title="Update your package.json" />
|
||||
<StepContentContainer className="flex flex-col gap-2">
|
||||
<Paragraph>
|
||||
Now, add this to the top-level of your <InlineCode>package.json</InlineCode>:
|
||||
</Paragraph>
|
||||
<CodeBlock fileName="package.json" showChrome code={packageJsonCode} />
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="7" title="Run your app" />
|
||||
<StepContentContainer className="flex flex-col gap-2">
|
||||
<Paragraph>
|
||||
Finally, run your project with <InlineCode>npm run start</InlineCode>:
|
||||
</Paragraph>
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="8" title="Run the CLI 'dev' command" />
|
||||
<StepContentContainer>
|
||||
<TriggerDevStep />
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="9" title="Wait for Jobs" displaySpinner />
|
||||
<StepContentContainer>
|
||||
<Paragraph>This page will automatically refresh.</Paragraph>
|
||||
</StepContentContainer>
|
||||
</>
|
||||
</div>
|
||||
</PageGradient>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg
|
||||
width="150"
|
||||
height="49"
|
||||
viewBox="-38 0 226 49"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g clipPath="url(#clip0_5336_22429)">
|
||||
<mask id="mask0_5336_22429" maskUnits="userSpaceOnUse" x="0" y="0" width="184" height="49">
|
||||
<path d="M184 0H0V48.4533H184V0Z" fill="white" />
|
||||
</mask>
|
||||
<g mask="url(#mask0_5336_22429)">
|
||||
<path
|
||||
d="M12.4424 40.9986C10.2625 39.0108 9.62608 34.8341 10.5343 31.8083C12.1092 33.716 14.2912 34.3203 16.5514 34.6615C20.0406 35.1879 23.4674 34.991 26.7087 33.4002C27.0795 33.218 27.4221 32.9759 27.8273 32.7306C28.1315 33.6107 28.2106 34.4993 28.1044 35.4037C27.8461 37.6063 26.7472 39.3077 24.9995 40.5974C24.3006 41.1133 23.5611 41.5744 22.8393 42.0609C20.6218 43.5559 20.0219 45.3089 20.8551 47.8589C20.8749 47.921 20.8926 47.9831 20.9374 48.1347C19.8053 47.6293 18.9783 46.8934 18.3481 45.9258C17.6825 44.9046 17.3659 43.7749 17.3492 42.5525C17.3409 41.9577 17.3409 41.3576 17.2607 40.7711C17.0649 39.3413 16.3921 38.7013 15.1245 38.6644C13.8236 38.6265 12.7945 39.4287 12.5216 40.6921C12.5008 40.789 12.4706 40.8849 12.4404 40.9975L12.4424 40.9986Z"
|
||||
fill="url(#paint0_linear_5336_22429)"
|
||||
/>
|
||||
<path
|
||||
d="M0 31.3041C0 31.3041 6.45527 28.1673 12.9286 28.1673L17.8093 13.1001C17.992 12.3714 18.5256 11.8762 19.1278 11.8762C19.7302 11.8762 20.2637 12.3714 20.4464 13.1001L25.3271 28.1673C32.9938 28.1673 38.2557 31.3041 38.2557 31.3041C38.2557 31.3041 27.2909 1.50808 27.2694 1.44829C26.9547 0.567361 26.4234 0 25.7072 0H12.5496C11.8333 0 11.3235 0.567361 10.9874 1.44829C10.9637 1.50695 0 31.3041 0 31.3041Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M68.0598 26.9653C68.0598 29.6056 64.7674 31.1825 60.2089 31.1825C57.2422 31.1825 56.1929 30.4491 56.1929 28.9089C56.1929 27.2954 57.4954 26.5253 60.4622 26.5253C63.1396 26.5253 65.4188 26.5619 68.0598 26.892V26.9653ZM68.096 23.7016C66.4682 23.3349 64.0081 23.1149 61.0773 23.1149C52.5388 23.1149 48.5228 25.1318 48.5228 29.8257C48.5228 34.7029 51.2725 36.5731 57.6402 36.5731C63.031 36.5731 66.6853 35.2163 68.0236 31.8792H68.2407C68.2045 32.6859 68.1683 33.4927 68.1683 34.1161C68.1683 35.8396 68.4578 35.9864 69.8691 35.9864H76.5262C76.1644 34.9596 75.9472 32.0626 75.9472 29.5689C75.9472 26.892 76.0558 24.8751 76.0558 22.1615C76.0558 16.6241 72.7272 13.1037 62.3073 13.1037C57.821 13.1037 52.8282 13.8738 49.0293 15.0106C49.3911 16.5141 49.8977 19.5578 50.1509 21.538C53.4433 19.9979 58.1105 19.3378 61.7283 19.3378C66.7215 19.3378 68.096 20.4745 68.096 22.7848V23.7016Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M86.3622 28.5055C85.4576 28.6155 84.2278 28.6155 82.9613 28.6155C81.6224 28.6155 80.3927 28.5788 79.5604 28.4688C79.5604 28.7622 79.5242 29.0922 79.5242 29.3856C79.5242 33.9695 82.5271 36.6464 93.0917 36.6464C103.041 36.6464 106.261 34.0062 106.261 29.3489C106.261 24.9484 104.127 22.7848 94.6833 22.3081C87.3393 21.9781 86.6879 21.1713 86.6879 20.2545C86.6879 19.1911 87.6288 18.641 92.5489 18.641C97.6506 18.641 99.0251 19.3378 99.0251 20.8046V21.1346C99.7489 21.098 101.052 21.0613 102.39 21.0613C103.656 21.0613 105.031 21.098 105.827 21.1713C105.827 20.8413 105.863 20.5479 105.863 20.2912C105.863 14.9006 101.377 13.1404 92.6937 13.1404C82.9251 13.1404 79.6327 15.524 79.6327 20.1812C79.6327 24.3617 82.2738 26.9653 91.6443 27.3687C98.5547 27.5887 99.3146 28.3588 99.3146 29.4223C99.3146 30.559 98.1928 31.0725 93.345 31.0725C87.7735 31.0725 86.3622 30.3024 86.3622 28.7255V28.5055Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M118.203 9.17995C115.562 11.6369 110.822 14.0939 108.181 14.7539C108.217 16.1107 108.217 18.6044 108.217 19.9612L110.641 19.9979C110.605 22.6015 110.569 25.7552 110.569 27.8454C110.569 32.7226 113.137 36.3897 121.133 36.3897C124.498 36.3897 126.741 36.023 129.527 35.4363C129.237 33.6394 128.912 30.8891 128.804 28.7988C127.139 29.3489 125.041 29.6423 122.725 29.6423C119.505 29.6423 118.203 28.7622 118.203 26.2319C118.203 24.0316 118.203 21.9781 118.239 20.0712C122.364 20.1078 126.488 20.1812 128.912 20.2545C128.876 18.3477 128.948 15.5973 129.057 13.7638C125.547 13.8371 121.604 13.8738 118.348 13.8738C118.384 12.2603 118.42 10.7201 118.456 9.17995H118.203Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M139.812 18.861C139.848 16.9541 139.884 15.3406 139.92 13.7638H132.648C132.757 16.9175 132.757 20.1445 132.757 24.8751C132.757 29.6056 132.72 32.8693 132.648 35.9864H140.969C140.824 33.7861 140.788 30.0823 140.788 26.9286C140.788 21.9414 142.815 20.5112 147.409 20.5112C149.544 20.5112 151.063 20.768 152.402 21.2446C152.438 19.3745 152.8 15.744 153.017 14.1305C151.642 13.7271 150.123 13.4705 148.278 13.4705C144.334 13.4338 141.44 15.0473 140.101 18.8977L139.812 18.861Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M176.038 24.7284C176.038 28.7255 173.143 30.5957 168.584 30.5957C164.062 30.5957 161.167 28.8355 161.167 24.7284C161.167 20.6213 164.098 19.0811 168.584 19.0811C173.107 19.0811 176.038 20.7313 176.038 24.7284ZM183.599 24.5451C183.599 16.5875 177.376 13.0304 168.584 13.0304C159.757 13.0304 153.75 16.5875 153.75 24.5451C153.75 32.4659 159.359 36.7198 168.548 36.7198C177.81 36.7198 183.599 32.4659 183.599 24.5451Z"
|
||||
fill="white"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="paint0_linear_5336_22429"
|
||||
x1="10.1338"
|
||||
y1="48.1347"
|
||||
x2="31.1641"
|
||||
y2="38.1736"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#D83333" />
|
||||
<stop offset="1" stopColor="#F041FF" />
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_5336_22429">
|
||||
<rect width="184" height="48.4533" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
href="/documentation/quickstarts/astro"
|
||||
/>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,52 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg
|
||||
width="160"
|
||||
height="55"
|
||||
viewBox="-30 6 220 55"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g clipPath="url(#clip0_5342_22458)">
|
||||
<path
|
||||
d="M181.319 7.73806L184 0.829078L183.889 0.386903L157.47 7.35116C160.288 3.26104 159.321 0 159.321 0C159.321 0 150.892 5.38901 144.508 5.25083C138.124 5.11265 136.079 3.39922 126.296 6.52208C116.513 9.64494 113.749 19.207 110.903 21.2797C108.084 23.3247 99.213 30.1508 99.213 30.1508L107.227 27.5807C107.227 27.5807 104.961 29.7363 100.291 36.0096V36.0372C101.037 37.0874 104.326 41.4263 107.587 40.4866C107.946 40.3761 108.36 40.1826 108.83 39.9615C110.295 40.7906 112.257 41.5921 114.385 41.8132C114.385 41.8132 112.948 40.155 111.732 38.2205L112.727 37.5849L112.561 37.6954L115.629 38.8008L115.297 35.9267H115.325L118.309 37.0321L117.95 34.4067L119.083 33.854L122.206 22.0258L135.14 13.1823L134.117 15.7801C131.492 22.2193 126.573 23.7393 126.573 23.7393L124.527 24.5407C122.98 26.337 122.344 26.7792 121.819 32.8591C123.063 32.5275 124.223 32.4722 125.301 32.7486C130.828 34.2409 132.735 40.9012 131.243 42.7528C130.884 43.195 129.999 43.9964 128.866 44.9084H126.628L126.6 46.7324L126.379 46.9258H124.085L124.058 48.6945L123.45 49.1367C121.322 49.1919 118.586 47.3127 118.586 47.3127C118.613 49.0261 120.023 51.6515 120.023 51.6515L120.272 51.5134L120.05 51.6792C120.05 51.6792 125.799 55.4929 129.419 54.0835C132.625 52.8123 140.943 46.2625 148.129 43.1673L169.85 37.419L172.725 30.0126L156.171 34.3791V27.6912L175.599 22.5786L178.473 15.1445L156.171 21.0309V14.3707L181.319 7.73806ZM141.883 21.86L147.051 20.5059L147.106 20.7546L145.503 24.9276L140.169 26.337L141.883 21.86ZM143.652 30.7864L138.318 32.1959L140.059 27.7188L145.199 26.3647L145.282 26.6134L143.652 30.7864ZM150.616 29.2941L145.282 30.7035L147.023 26.2265L152.163 24.8723L152.246 25.1211L150.616 29.2941Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M4.00721 16.7197L4.17302 15.863C4.64284 13.3758 5.58246 11.2478 7.32352 9.64495C8.59477 8.4566 10.474 7.73807 12.602 7.73807C13.9561 7.73807 14.9787 7.93152 15.6143 8.15261L14.426 12.2427C13.9285 12.0769 13.4587 11.994 12.7678 11.994C10.8609 11.994 9.75548 13.9838 9.39621 15.8078L9.2304 16.7197H13.2652L12.5467 20.4506H8.59477L5.3061 37.5296H0L3.26104 20.4506"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M21.4178 37.5296L21.5837 34.0475H21.4455C19.7873 36.8111 17.7975 37.8612 16.1394 37.8612C13.0994 37.8612 11.6071 35.2634 11.6071 31.6155C11.6071 25.3145 14.7576 16.3605 23.7116 16.3605C25.7843 16.3605 27.8846 16.7197 29.1559 17.2172L26.8621 28.7966C26.3647 31.2286 25.9778 35.2634 26.0054 37.5296H21.4178ZM23.3247 20.4506C22.9102 20.3677 22.5233 20.34 22.2193 20.34C18.7372 20.34 16.8579 27.2767 16.8026 30.3443C16.8026 32.1682 17.079 33.4947 18.3779 33.4947C19.8426 33.4947 21.1968 31.0904 21.9706 27.3043L23.3247 20.4506Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M29.7915 32.9697C30.6482 33.4395 31.6708 33.854 33.1631 33.8264C34.7107 33.7711 35.5398 32.8038 35.5398 31.4773C35.5398 30.3166 34.9871 29.5152 33.55 28.3821C31.7537 26.9174 30.897 25.0934 30.897 23.2971C30.897 19.4833 33.8816 16.3605 38.6074 16.3605C40.459 16.3605 41.7579 16.6921 42.5317 17.1343L41.371 21.0033C40.7906 20.6717 39.7957 20.3677 38.9114 20.3677C37.198 20.3677 36.1478 21.252 36.1478 22.6615C36.1478 23.7393 36.7558 24.3749 37.723 25.1763C40.0721 26.9727 40.8459 29.0177 40.8459 30.6206C40.8459 35.2358 37.6401 37.7783 32.8591 37.7783C30.9522 37.7783 29.2388 37.2256 28.5203 36.7282L29.7915 32.9697Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M53.3097 11.082L52.2319 16.7197H60.4121L59.7212 20.4506H51.5134L49.6894 30.1232C49.5512 30.8417 49.5236 31.4773 49.5236 31.8642C49.5236 33.1355 50.1592 33.6053 51.1265 33.6053C51.5134 33.6053 52.0661 33.6053 52.5635 33.5224L51.9279 37.5296C50.9606 37.7783 49.7723 37.8612 48.7498 37.8612C45.544 37.8612 43.9688 36.0925 43.9688 33.2736C43.9688 32.334 44.1346 31.1733 44.3557 30.1508L46.1796 20.4506H43.7753L44.4938 16.6921H46.9258L47.7549 12.4085L53.3097 11.082Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M54.581 37.5296L58.5882 16.7197H63.8943L59.9147 37.5296H54.581ZM59.5554 11.386C59.5554 9.83838 60.6609 8.09732 62.5401 8.09732C64.2812 8.09732 65.1103 9.42384 65.055 10.8609C64.9997 12.9889 63.5626 14.2049 61.9874 14.2049C60.274 14.2049 59.5278 12.9612 59.5554 11.386Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M67.2106 16.7197L67.3764 15.863C67.8462 13.3758 68.7858 11.2478 70.5269 9.64495C71.7981 8.4566 73.6774 7.73807 75.8054 7.73807C77.1595 7.73807 78.182 7.93152 78.8177 8.15261L77.6293 12.2427C77.1319 12.0769 76.6621 11.994 75.9712 11.994C74.0643 11.994 72.9589 13.9838 72.6272 15.8078L72.4338 16.7197H78.6242L77.9057 20.4506H71.7981L68.5371 37.5296H63.2034L66.492 20.4506"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M81.9405 16.7197L82.0787 26.7239C82.1063 28.6861 82.1616 30.1232 82.1063 31.6431H82.1892C82.6314 29.9574 83.046 28.5479 83.7645 26.337L86.915 16.6921H92.2764L85.4779 33.1078C83.4329 37.8612 81.0838 41.8684 78.5413 44.2175C77.2977 45.3506 75.8606 46.2625 74.9763 46.6218L72.8483 42.283C73.7603 41.8132 74.7552 41.2604 75.6119 40.5972C76.8002 39.6023 77.9333 38.4139 78.4584 37.2532C78.5413 36.9769 78.6242 36.7558 78.5689 36.3413L76.3581 16.6921H81.9405V16.7197Z"
|
||||
fill="white"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_5342_22458">
|
||||
<rect width="184" height="54.4151" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
href="/documentation/quickstarts/fastify"
|
||||
/>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg width="160" height="38" viewBox="-26 -7 220 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clipPath="url(#clip0_5291_19580)">
|
||||
<path d="M122.318 0.0154419H154.367V5.93096H141.653V37.0517H135.296V5.93096H122.318V0.0154419Z" fill="white"/>
|
||||
<path d="M69.608 0.0154419V5.93096H43.9181V15.4472H64.5779V21.3627H43.9181V31.1362H69.608V37.0517H37.5612L37.5586 0.0154419H69.608Z" fill="white"/>
|
||||
<path d="M85.6114 0.0308914H77.2921L107.09 37.0672H115.433L100.533 18.5618L115.41 0.0591477L107.09 0.0720044L96.3674 13.3889L85.6114 0.0308914Z" fill="white"/>
|
||||
<path d="M94.1482 26.4861L89.9821 21.3061L77.2683 37.0954H85.6114L94.1482 26.4861Z" fill="white"/>
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M37.784 37.0517L7.94614 0H0V37.0363H6.35692V7.91648L29.7981 37.0517H37.784Z" fill="white"/>
|
||||
<path d="M155.796 36.8255C155.331 36.8255 154.935 36.6642 154.603 36.3417C154.271 36.0191 154.107 35.6286 154.112 35.166C154.107 34.7161 154.271 34.3298 154.603 34.0073C154.935 33.6847 155.331 33.5234 155.796 33.5234C156.244 33.5234 156.636 33.6847 156.967 34.0073C157.304 34.3298 157.471 34.7161 157.476 35.166C157.471 35.4716 157.394 35.7517 157.239 36.0021C157.079 36.2568 156.877 36.4563 156.623 36.6006C156.373 36.7491 156.097 36.8255 155.796 36.8255Z" fill="white"/>
|
||||
<path d="M166.646 21.2232H169.463V32.0761C169.459 33.0735 169.243 33.9266 168.821 34.6439C168.395 35.3612 167.805 35.9087 167.047 36.2949C166.293 36.6769 165.41 36.8722 164.406 36.8722C163.489 36.8722 162.666 36.7066 161.934 36.3841C161.202 36.0615 160.62 35.5777 160.194 34.941C159.763 34.3043 159.552 33.5107 159.552 32.5599H162.373C162.378 32.9759 162.472 33.3366 162.653 33.638C162.834 33.9393 163.084 34.1685 163.403 34.3298C163.725 34.4911 164.096 34.5717 164.514 34.5717C164.966 34.5717 165.354 34.4783 165.668 34.2873C165.982 34.1006 166.224 33.8205 166.392 33.447C166.555 33.0777 166.642 32.6193 166.646 32.0761V21.2232Z" fill="white"/>
|
||||
<path d="M181.054 25.4676C180.985 24.8097 180.683 24.2961 180.158 23.9311C179.628 23.5619 178.943 23.3793 178.103 23.3793C177.513 23.3793 177.005 23.4685 176.583 23.6425C176.161 23.8208 175.833 24.0584 175.609 24.3598C175.386 24.6611 175.274 25.0049 175.265 25.3912C175.265 25.7138 175.342 25.9939 175.493 26.2273C175.644 26.465 175.846 26.6645 176.109 26.8258C176.367 26.9913 176.656 27.1271 176.971 27.2375C177.289 27.3478 177.608 27.4412 177.927 27.5176L179.395 27.8784C179.986 28.0142 180.559 28.1967 181.105 28.4301C181.652 28.6594 182.148 28.9522 182.583 29.3045C183.018 29.6568 183.363 30.0812 183.617 30.5778C183.871 31.0744 184 31.6558 184 32.3265C184 33.2305 183.767 34.0242 183.298 34.7118C182.828 35.3951 182.152 35.9299 181.265 36.3162C180.382 36.6982 179.314 36.8934 178.056 36.8934C176.841 36.8934 175.782 36.7067 174.89 36.3332C173.994 35.9639 173.296 35.4206 172.792 34.7075C172.288 33.9945 172.017 33.1244 171.978 32.1015H174.77C174.808 32.6363 174.981 33.082 175.274 33.4427C175.571 33.7993 175.958 34.0624 176.432 34.2407C176.91 34.4147 177.444 34.5038 178.034 34.5038C178.65 34.5038 179.193 34.4104 179.662 34.2279C180.128 34.0454 180.494 33.7908 180.757 33.4597C181.024 33.1329 181.157 32.7467 181.162 32.3053C181.157 31.902 181.036 31.5667 180.804 31.3035C180.567 31.0404 180.24 30.8197 179.822 30.6415C179.4 30.4632 178.909 30.3019 178.349 30.1618L176.566 29.7119C175.278 29.3851 174.257 28.8886 173.512 28.2222C172.762 27.5558 172.392 26.673 172.392 25.5652C172.392 24.6569 172.641 23.859 173.146 23.1756C173.645 22.4923 174.33 21.9618 175.196 21.584C176.066 21.202 177.048 21.0152 178.142 21.0152C179.253 21.0152 180.227 21.202 181.067 21.584C181.906 21.9618 182.566 22.4881 183.044 23.1586C183.522 23.8293 183.772 24.5975 183.785 25.4676H181.054Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_5291_19580">
|
||||
<rect width="184" height="37.3604" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>}
|
||||
href="/documentation/quickstarts/nextjs"
|
||||
|
||||
/>
|
||||
@@ -0,0 +1,28 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg
|
||||
width="150"
|
||||
height="46"
|
||||
viewBox="-30 0 220 58"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g clipPath="url(#clip0_5336_22448)">
|
||||
<path
|
||||
d="M38.7097 46H64.3598C65.1746 46 65.9748 45.7875 66.6805 45.3838C67.3846 44.9814 67.9704 44.4006 68.379 43.7C68.7859 43.0017 69.0002 42.208 69 41.3998C68.9994 40.5916 68.7844 39.7981 68.3769 39.1002L51.1511 9.52867C50.7425 8.82816 50.1568 8.24752 49.4528 7.84507C48.7462 7.44109 47.9464 7.22869 47.1325 7.2289C46.3181 7.2289 45.5179 7.44165 44.8125 7.8453C44.1084 8.24768 43.5227 8.82834 43.1142 9.5289L38.7097 17.095L30.0978 2.29954C29.6891 1.59892 29.1031 1.01826 28.3988 0.61594C27.6921 0.212089 26.8922 -0.000228035 26.0783 1.8379e-07C25.2637 1.8379e-07 24.4633 0.21252 23.7576 0.61617C23.0534 1.01847 22.4674 1.59904 22.0586 2.29954L0.623071 39.1C0.215509 39.7979 0.000499188 40.5915 7.38785e-07 41.3998C-0.000459261 42.2073 0.213901 43.0006 0.621001 43.7C1.0296 44.4006 1.61541 44.9813 2.31955 45.3838C3.02626 45.7878 3.82623 46.0002 4.64025 46H20.7412C27.1207 46 31.8253 43.2228 35.0624 37.8044L42.9217 24.3144L47.1314 17.095L59.7653 38.7805H42.9217L38.7097 46ZM20.4787 38.7732L9.24232 38.7706L26.0857 9.85826L34.4901 24.3144L28.8629 33.9768C26.7131 37.4923 24.271 38.7732 20.4787 38.7732Z"
|
||||
fill="#00DC82"
|
||||
/>
|
||||
<path
|
||||
d="M86.71 46C86.954 46 87.188 45.9031 87.3605 45.7305C87.5331 45.558 87.63 45.324 87.63 45.08V23.69C87.63 23.69 88.8361 25.5958 91.08 29.44L99.9826 44.841C100.394 45.5584 101.152 46 101.972 46H108.1V11.5H101.89C101.646 11.5 101.412 11.5969 101.239 11.7695C101.067 11.942 100.97 12.176 100.97 12.42V34.04L97.06 27.14L88.6448 12.6546C88.2326 11.9398 87.4761 11.5 86.6578 11.5H80.5V46H86.71ZM155.527 33.0871L163.427 21.16H157.509C157.128 21.1607 156.754 21.2561 156.419 21.4377C156.084 21.6193 155.8 21.8813 155.592 22.2001L151.974 27.715L148.356 22.2001C148.148 21.8813 147.864 21.6193 147.529 21.4377C147.195 21.2561 146.82 21.1607 146.439 21.16H140.568L148.468 33.0379L139.961 46H145.703C146.08 45.9993 146.452 45.9054 146.785 45.7265C147.117 45.5477 147.401 45.2894 147.609 44.9747L152.021 38.3608L156.386 44.9664C156.595 45.2834 156.878 45.5438 157.212 45.7242C157.546 45.9046 157.919 45.9993 158.298 46H163.988L155.527 33.0871ZM166.658 21.16H171.192V13.8163H177.689V21.16H184V26.8771H177.689V36.685C177.689 39.1 178.905 40.2337 181.008 40.2337H184V46H180.12C174.698 46 171.192 42.7471 171.192 36.9808V26.8771H166.658V21.16ZM135.7 21.16H132.25C131.448 21.16 130.82 21.1934 130.295 21.7403C129.77 22.2569 129.72 22.5752 129.72 23.3655V35.4372C129.72 37.2906 129.634 38.4185 128.8 39.33C127.966 40.2111 126.818 40.48 125.12 40.48C123.453 40.48 122.274 40.2111 121.44 39.33C120.606 38.4185 120.52 37.2906 120.52 35.4372V23.3655C120.52 22.5754 120.47 22.2569 119.945 21.7403C119.42 21.1934 118.792 21.16 117.99 21.16H114.54V35.5171C114.54 38.738 115.435 41.2903 117.225 43.1742C119.047 45.0582 121.694 46 125.12 46C128.546 46 131.147 45.0582 132.968 43.1742C134.789 41.2903 135.7 38.738 135.7 35.5171V21.16Z"
|
||||
fill="white"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_5336_22448">
|
||||
<rect width="184" height="46" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
href="/documentation/quickstarts/nuxt"
|
||||
/>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,206 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg
|
||||
width="180"
|
||||
height="38"
|
||||
viewBox="22 0 184 58"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g filter="url(#filter0_d_5334_22407)">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M47.4777 45.058C47.8835 50.3106 47.8835 52.7727 47.8835 55.4603H35.8237C35.8237 54.8748 35.8341 54.3393 35.8445 53.7962C35.8771 52.1081 35.9111 50.3479 35.6397 46.7928C35.2811 41.5885 33.0571 40.4319 28.9676 40.4319H25.3444H10V30.9627H29.5415C34.7071 30.9627 37.2898 29.379 37.2898 25.1865C37.2898 21.5001 34.7071 19.2659 29.5415 19.2659H10V10H31.6937C43.3882 10 49.1997 15.5659 49.1997 24.457C49.1997 31.1071 45.1102 35.4441 39.5857 36.167C44.2492 37.1068 46.9754 39.7813 47.4777 45.058Z"
|
||||
fill="#E5F3FF"
|
||||
/>
|
||||
</g>
|
||||
<path
|
||||
d="M10 55.4604V48.4012H22.7516C24.8815 48.4012 25.3439 49.9932 25.3439 50.9423V55.4604H10Z"
|
||||
fill="#E5F3FF"
|
||||
/>
|
||||
<g filter="url(#filter1_d_5334_22407)">
|
||||
<path
|
||||
d="M192.998 23.7133H181.045L175.606 31.3573L170.309 23.7133H157.498L169.021 39.5059L156.496 55.8753H168.448L174.819 47.1497L181.188 55.8753H194L181.403 39.0011L192.998 23.7133Z"
|
||||
fill="#FFF1F1"
|
||||
/>
|
||||
</g>
|
||||
<g filter="url(#filter2_d_5334_22407)">
|
||||
<path
|
||||
d="M117.711 29.0434C116.351 25.2935 113.416 22.6975 107.762 22.6975C102.966 22.6975 99.5309 24.861 97.8132 28.3943V23.5629H86.2185V55.7246H97.8132V39.9322C97.8132 35.1008 99.1731 31.9279 102.966 31.9279C106.474 31.9279 107.333 34.2354 107.333 38.6343V55.7246H118.927V39.9322C118.927 35.1008 120.215 31.9279 124.08 31.9279C127.588 31.9279 128.375 34.2354 128.375 38.6343V55.7246H139.97V35.5335C139.97 28.827 137.393 22.6975 128.59 22.6975C123.222 22.6975 119.428 25.4377 117.711 29.0434Z"
|
||||
fill="#FFFAEA"
|
||||
/>
|
||||
</g>
|
||||
<g filter="url(#filter3_d_5334_22407)">
|
||||
<path
|
||||
d="M74.1446 43.2432C73.071 45.7671 71.067 46.8487 67.9178 46.8487C64.4107 46.8487 61.5477 44.9738 61.2614 41.0076H83.6637V37.7628C83.6637 29.0372 78.0096 21.6817 67.345 21.6817C57.3964 21.6817 49.9529 28.9651 49.9529 39.1328C49.9529 49.3725 57.2534 55.5742 67.4883 55.5742C75.934 55.5742 81.803 51.464 83.4491 44.1084L74.1446 43.2432ZM61.4047 35.3829C61.8339 32.3542 63.4803 30.0466 67.202 30.0466C70.6375 30.0466 72.4983 32.4984 72.6415 35.3829H61.4047Z"
|
||||
fill="#F1FFF0"
|
||||
/>
|
||||
</g>
|
||||
<g filter="url(#filter4_d_5334_22407)">
|
||||
<path
|
||||
d="M143.762 23.7765V55.9383H155.357V23.7765H143.762ZM143.691 20.7478H155.429V10.5078H143.691V20.7478Z"
|
||||
fill="white"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter
|
||||
id="filter0_d_5334_22407"
|
||||
x="0"
|
||||
y="0"
|
||||
width="59.1997"
|
||||
height="65.4604"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="5" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.203922 0 0 0 0 0.45098 0 0 0 0 0.74902 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_22407" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5334_22407"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
<filter
|
||||
id="filter1_d_5334_22407"
|
||||
x="146.496"
|
||||
y="13.7133"
|
||||
width="57.5044"
|
||||
height="52.162"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="5" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.882353 0 0 0 0 0.180392 0 0 0 0 0.227451 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_22407" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5334_22407"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
<filter
|
||||
id="filter2_d_5334_22407"
|
||||
x="78.2185"
|
||||
y="14.6975"
|
||||
width="69.7512"
|
||||
height="49.0271"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="4" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.937255 0 0 0 0 0.72549 0 0 0 0 0.117647 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_22407" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5334_22407"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3_d_5334_22407"
|
||||
x="41.9529"
|
||||
y="13.6817"
|
||||
width="49.7108"
|
||||
height="49.8926"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="4" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.384314 0 0 0 0 0.788235 0 0 0 0 0.372549 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_22407" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5334_22407"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
<filter
|
||||
id="filter4_d_5334_22407"
|
||||
x="133.691"
|
||||
y="0.507791"
|
||||
width="31.738"
|
||||
height="65.4305"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="5" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.596078 0 0 0 0 0.192157 0 0 0 0 0.556863 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_22407" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5334_22407"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
href="/documentation/quickstarts/remix"
|
||||
/>
|
||||
@@ -0,0 +1,132 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg
|
||||
width="307"
|
||||
height="36"
|
||||
viewBox="0 -5 307 38"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g clipPath="url(#clip0_5373_35)">
|
||||
<g clipPath="url(#clip1_5373_35)">
|
||||
<path
|
||||
d="M274.818 6.00787H291.539V9.01627H284.906V24.843H281.589V9.01627H274.818V6.00787Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M247.317 6.00787V9.01627H233.914V13.8559H244.693V16.8642H233.914V21.8346H247.317V24.843H230.597L230.596 6.00787H247.317Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M255.667 6.01569H251.326L266.873 24.8508H271.226L263.452 15.4397L271.214 6.03006L266.873 6.03659L261.279 12.809L255.667 6.01569Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M260.121 19.4698L257.947 16.8354L251.314 24.8653H255.667L260.121 19.4698Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M230.713 24.843L215.146 6H211V24.8351H214.317V10.026L226.547 24.843H230.713Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M292.285 24.7279C292.042 24.7279 291.835 24.6459 291.662 24.4819C291.489 24.3178 291.404 24.1192 291.406 23.8839C291.404 23.6551 291.489 23.4587 291.662 23.2947C291.835 23.1306 292.042 23.0486 292.285 23.0486C292.519 23.0486 292.723 23.1306 292.896 23.2947C293.071 23.4587 293.159 23.6551 293.161 23.8839C293.159 24.0393 293.118 24.1818 293.038 24.3091C292.955 24.4387 292.849 24.5401 292.716 24.6135C292.586 24.6891 292.442 24.7279 292.285 24.7279Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M297.946 16.7932H299.416V22.3125C299.413 22.8198 299.301 23.2537 299.081 23.6185C298.858 23.9832 298.55 24.2617 298.155 24.4581C297.762 24.6523 297.301 24.7517 296.777 24.7517C296.298 24.7517 295.869 24.6675 295.487 24.5034C295.105 24.3394 294.802 24.0933 294.579 23.7695C294.355 23.4458 294.244 23.0421 294.244 22.5586H295.717C295.719 22.7702 295.768 22.9536 295.863 23.1069C295.957 23.2601 296.087 23.3767 296.254 23.4587C296.422 23.5407 296.615 23.5817 296.833 23.5817C297.069 23.5817 297.272 23.5342 297.436 23.4371C297.6 23.3421 297.726 23.1997 297.813 23.0097C297.899 22.822 297.944 22.5888 297.946 22.3125V16.7932Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M305.463 18.9518C305.427 18.6172 305.27 18.356 304.995 18.1704C304.719 17.9826 304.362 17.8898 303.923 17.8898C303.616 17.8898 303.351 17.9351 303.13 18.0236C302.91 18.1143 302.739 18.2351 302.622 18.3884C302.506 18.5417 302.447 18.7165 302.442 18.9129C302.442 19.077 302.483 19.2194 302.562 19.3382C302.64 19.459 302.746 19.5605 302.883 19.6425C303.018 19.7267 303.168 19.7958 303.333 19.8519C303.499 19.908 303.665 19.9555 303.831 19.9944L304.598 20.1778C304.906 20.2469 305.205 20.3397 305.49 20.4584C305.775 20.575 306.034 20.7239 306.261 20.9031C306.488 21.0822 306.667 21.2981 306.8 21.5506C306.933 21.8032 307 22.0989 307 22.4399C307 22.8997 306.879 23.3033 306.634 23.653C306.389 24.0005 306.036 24.2725 305.573 24.4689C305.112 24.6632 304.555 24.7625 303.899 24.7625C303.265 24.7625 302.712 24.6675 302.247 24.4776C301.78 24.2898 301.415 24.0135 301.153 23.6509C300.89 23.2882 300.748 22.8457 300.728 22.3255H302.184C302.204 22.5975 302.294 22.8242 302.447 23.0076C302.602 23.1889 302.804 23.3228 303.052 23.4134C303.301 23.5019 303.58 23.5473 303.888 23.5473C304.209 23.5473 304.492 23.4998 304.737 23.4069C304.98 23.3141 305.171 23.1846 305.308 23.0163C305.447 22.8501 305.517 22.6536 305.519 22.4292C305.517 22.2241 305.454 22.0536 305.332 21.9197C305.209 21.7859 305.038 21.6737 304.82 21.583C304.6 21.4924 304.344 21.4103 304.052 21.3391L303.121 21.1103C302.449 20.9441 301.917 20.6916 301.528 20.3527C301.137 20.0138 300.943 19.5648 300.943 19.0014C300.943 18.5395 301.074 18.1337 301.337 17.7862C301.597 17.4387 301.955 17.1689 302.407 16.9768C302.861 16.7825 303.373 16.6875 303.944 16.6875C304.523 16.6875 305.031 16.7825 305.47 16.9768C305.908 17.1689 306.252 17.4365 306.501 17.7776C306.75 18.1186 306.881 18.5093 306.888 18.9518H305.463Z"
|
||||
fill="white"
|
||||
/>
|
||||
</g>
|
||||
<path
|
||||
d="M47.9467 21.1428C48.1364 22.9167 49.75 25.9577 54.4327 25.9577C58.5139 25.9577 60.4758 23.3602 60.4758 20.8261C60.4758 18.5454 58.9253 16.6765 55.8565 16.0429L53.6415 15.5678C52.7874 15.4094 52.218 14.9342 52.218 14.174C52.218 13.287 53.1038 12.6219 54.2113 12.6219C55.9829 12.6219 56.6473 13.7939 56.774 14.7125L60.2858 13.9206C60.0961 12.2417 58.6089 9.42255 54.1796 9.42255C50.8258 9.42255 48.3581 11.7349 48.3581 14.5224C48.3581 16.7081 49.7183 18.5137 52.7241 19.1789L54.7807 19.6541C55.9829 19.9074 56.4576 20.4777 56.4576 21.1745C56.4576 21.9981 55.7932 22.7267 54.401 22.7267C52.566 22.7267 51.6483 21.5863 51.5536 20.3509L47.9467 21.1428Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M73.9233 25.4825H77.9416C77.8782 24.944 77.7832 23.867 77.7832 22.6633V9.89764H73.575V18.9571C73.575 20.7627 72.4995 22.0298 70.6329 22.0298C68.6713 22.0298 67.7852 20.636 67.7852 18.8938V9.89764H63.5772V19.7491C63.5772 23.1385 65.7285 25.8943 69.4937 25.8943C71.1386 25.8943 72.9429 25.2608 73.797 23.8037C73.797 24.4372 73.86 25.1657 73.9233 25.4825Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M86.4819 31.5011V23.9621C87.241 25.0074 88.8232 25.8627 90.9749 25.8627C95.3725 25.8627 98.3146 22.3782 98.3146 17.6584C98.3146 13.0337 95.6889 9.54926 91.1329 9.54926C88.7919 9.54926 87.0516 10.5945 86.3555 11.7983V9.89768H82.2743V31.5011H86.4819ZM94.17 17.6901C94.17 20.4777 92.4617 22.0932 90.3101 22.0932C88.1591 22.0932 86.4189 20.446 86.4189 17.6901C86.4189 14.9343 88.1591 13.3188 90.3101 13.3188C92.4617 13.3188 94.17 14.9343 94.17 17.6901Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M100.698 21.2379C100.698 23.677 102.722 25.926 106.045 25.926C108.354 25.926 109.841 24.849 110.632 23.6136C110.632 24.2155 110.695 25.0707 110.79 25.4825H114.65C114.555 24.944 114.461 23.8354 114.461 23.0118V15.346C114.461 12.21 112.625 9.42255 107.69 9.42255C103.513 9.42255 101.267 12.115 101.014 14.5541L104.747 15.346C104.874 13.9839 105.886 12.8119 107.721 12.8119C109.493 12.8119 110.347 13.7305 110.347 14.8392C110.347 15.3777 110.063 15.8212 109.177 15.9479L105.349 16.5181C102.754 16.8982 100.698 18.4503 100.698 21.2379ZM106.93 22.79C105.57 22.79 104.905 21.9031 104.905 20.9845C104.905 19.7808 105.759 19.1789 106.836 19.0205L110.347 18.482V19.1789C110.347 21.9348 108.702 22.79 106.93 22.79Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M122.784 25.4826V23.582C123.606 24.9124 125.251 25.8627 127.403 25.8627C131.833 25.8627 134.743 22.3466 134.743 17.6268C134.743 13.002 132.117 9.4859 127.561 9.4859C125.251 9.4859 123.543 10.4995 122.847 11.6082V2.54871H118.702V25.4826H122.784ZM130.535 17.6584C130.535 20.5093 128.827 22.0932 126.675 22.0932C124.555 22.0932 122.784 20.4777 122.784 17.6584C122.784 14.8075 124.555 13.2554 126.675 13.2554C128.827 13.2554 130.535 14.8075 130.535 17.6584Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M137.126 21.2379C137.126 23.677 139.151 25.926 142.473 25.926C144.782 25.926 146.27 24.849 147.06 23.6136C147.06 24.2155 147.124 25.0707 147.218 25.4825H151.078C150.984 24.944 150.889 23.8354 150.889 23.0118V15.346C150.889 12.21 149.054 9.42255 144.118 9.42255C139.942 9.42255 137.695 12.115 137.442 14.5541L141.175 15.346C141.302 13.9839 142.315 12.8119 144.149 12.8119C145.921 12.8119 146.776 13.7305 146.776 14.8392C146.776 15.3777 146.491 15.8212 145.605 15.9479L141.777 16.5181C139.183 16.8982 137.126 18.4503 137.126 21.2379ZM143.359 22.79C141.998 22.79 141.334 21.9031 141.334 20.9845C141.334 19.7808 142.188 19.1789 143.264 19.0205L146.776 18.482V19.1789C146.776 21.9348 145.13 22.79 143.359 22.79Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M153.802 21.1428C153.991 22.9167 155.605 25.9577 160.287 25.9577C164.369 25.9577 166.33 23.3602 166.33 20.8261C166.33 18.5454 164.78 16.6765 161.711 16.0429L159.496 15.5678C158.642 15.4094 158.073 14.9342 158.073 14.174C158.073 13.287 158.958 12.6219 160.066 12.6219C161.838 12.6219 162.502 13.7939 162.629 14.7125L166.141 13.9206C165.951 12.2417 164.464 9.42255 160.034 9.42255C156.68 9.42255 154.213 11.7349 154.213 14.5224C154.213 16.7081 155.573 18.5137 158.579 19.1789L160.635 19.6541C161.838 19.9074 162.312 20.4777 162.312 21.1745C162.312 21.9981 161.648 22.7267 160.256 22.7267C158.421 22.7267 157.503 21.5863 157.408 20.3509L153.802 21.1428Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M172.721 15.9162C172.816 14.4908 174.018 12.8436 176.201 12.8436C178.606 12.8436 179.619 14.3641 179.682 15.9162H172.721ZM180.093 19.9708C179.587 21.3646 178.511 22.3466 176.549 22.3466C174.461 22.3466 172.721 20.8578 172.627 18.7988H183.763C183.763 18.7354 183.826 18.1019 183.826 17.5C183.826 12.4951 180.947 9.42255 176.138 9.42255C172.152 9.42255 168.481 12.6535 168.481 17.6268C168.481 22.885 172.246 25.9577 176.518 25.9577C180.346 25.9577 182.814 23.7086 183.605 21.0161L180.093 19.9708Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M20.1759 34.9264C19.2703 36.0669 17.4341 35.442 17.4123 33.9859L17.0932 12.6877H31.4141C34.008 12.6877 35.4547 15.6837 33.8417 17.7151L20.1759 34.9264Z"
|
||||
fill="url(#paint0_linear_5373_35)"
|
||||
/>
|
||||
<path
|
||||
d="M20.1759 34.9264C19.2703 36.0669 17.4341 35.442 17.4123 33.9859L17.0932 12.6877H31.4141C34.008 12.6877 35.4547 15.6837 33.8417 17.7151L20.1759 34.9264Z"
|
||||
fill="url(#paint1_linear_5373_35)"
|
||||
fillOpacity="0.2"
|
||||
/>
|
||||
<path
|
||||
d="M14.3517 0.6559C15.2573 -0.484647 17.0935 0.140291 17.1153 1.59648L17.2551 22.8946H3.11348C0.519504 22.8946 -0.927202 19.8986 0.685807 17.8672L14.3517 0.6559Z"
|
||||
fill="#3ECF8E"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M198 13H197V16H194V17H197V20H198V17H201V16H198V13Z"
|
||||
fill="#D9D9D9"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="paint0_linear_5373_35"
|
||||
x1="17.0932"
|
||||
y1="17.41"
|
||||
x2="29.8211"
|
||||
y2="22.7481"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#249361" />
|
||||
<stop offset="1" stopColor="#3ECF8E" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint1_linear_5373_35"
|
||||
x1="11.4504"
|
||||
y1="9.68392"
|
||||
x2="17.255"
|
||||
y2="20.6107"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop />
|
||||
<stop offset="1" stopOpacity="0" />
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_5373_35">
|
||||
<rect width="307" height="36" fill="white" />
|
||||
</clipPath>
|
||||
<clipPath id="clip1_5373_35">
|
||||
<rect width="96" height="19" fill="white" transform="translate(211 6)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
href="/documentation/quickstarts/supabase"
|
||||
/>
|
||||
@@ -0,0 +1,36 @@
|
||||
<Card
|
||||
icon={
|
||||
<svg
|
||||
width="234"
|
||||
height="40"
|
||||
viewBox="10 -6 240 44"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g clipPath="url(#clip0_5341_22451)">
|
||||
<path
|
||||
d="M153.928 25.3304L149.002 16.1776L145.901 19.929V25.3304H143.3V7.82486H145.901V16.3027L152.653 7.82486H155.654L150.753 13.977L156.98 25.3304H153.928ZM162.606 25.3304V7.82486H165.206V25.3304H162.606ZM178.761 10.3257V25.3304H176.16V10.3257H171.208V7.82486H183.712V10.3257H178.761Z"
|
||||
fill="#8D8D93"
|
||||
/>
|
||||
<path
|
||||
d="M43.8554 25.6303C42.4293 25.6662 41.0258 25.2695 39.8294 24.4926C38.7117 23.7554 37.8816 22.6561 37.4785 21.3792L39.9292 20.4789C40.2691 21.2628 40.8241 21.9343 41.53 22.4157C42.2466 22.8959 43.0933 23.1447 43.9558 23.1285C44.7848 23.1719 45.603 22.9242 46.2688 22.4283C46.5585 22.1851 46.7873 21.8776 46.9371 21.5302C47.0869 21.1829 47.1535 20.8054 47.1316 20.4278C47.1349 20.076 47.0534 19.7285 46.8939 19.4148C46.7552 19.1342 46.5738 18.8768 46.3563 18.6518C46.0811 18.4012 45.7691 18.1946 45.431 18.0391C45.0139 17.8311 44.6679 17.6727 44.393 17.5639C44.1181 17.4552 43.7138 17.3093 43.1801 17.1264C42.5134 16.893 42.0133 16.7097 41.68 16.5764C41.2284 16.3842 40.7898 16.1628 40.367 15.9135C39.912 15.6721 39.4983 15.3598 39.1415 14.9882C38.8329 14.6257 38.5839 14.2162 38.4041 13.7754C38.0584 12.9348 37.9858 12.0069 38.1964 11.1229C38.4071 10.2388 38.8904 9.44335 39.5779 8.84903C40.5782 7.96552 41.9368 7.52366 43.6538 7.52347C45.0876 7.52347 46.2672 7.84021 47.1926 8.47369C48.0908 9.07097 48.7503 9.96521 49.0555 10.9998L46.655 11.7998C46.4138 11.258 46.0065 10.807 45.492 10.5121C44.8698 10.1667 44.1651 9.99797 43.4539 10.024C42.7565 9.98411 42.0657 10.1777 41.4907 10.5743C41.2559 10.7563 41.0685 10.9924 40.9445 11.2623C40.8204 11.5323 40.7634 11.8282 40.7782 12.1249C40.7802 12.3524 40.8303 12.5769 40.9251 12.7837C41.0198 12.9906 41.1572 13.1751 41.3281 13.3252C41.6604 13.6524 42.0504 13.9153 42.4785 14.1005C42.8791 14.2672 43.4878 14.4922 44.3044 14.7755C44.8041 14.9592 45.1749 15.0967 45.4169 15.1881C45.6589 15.2794 46.0132 15.4336 46.4798 15.6506C46.8539 15.816 47.2136 16.0123 47.555 16.2375C47.8608 16.4574 48.1532 16.6954 48.4304 16.9503C48.732 17.2117 48.9896 17.5199 49.1934 17.863C49.3877 18.2188 49.5387 18.5965 49.6433 18.9881C49.771 19.4482 49.8342 19.9239 49.8311 20.4014C49.8311 22.0354 49.2726 23.3149 48.1555 24.2399C47.0384 25.1649 45.605 25.6283 43.8554 25.6303ZM59.8851 25.3304L53.8832 7.82485H56.6843L60.6604 20.0287C60.8801 20.6851 61.0638 21.3531 61.2107 22.0295C61.357 21.3529 61.5407 20.685 61.7609 20.0287L65.6868 7.82485H68.4627L62.4858 25.3304H59.8851ZM73.764 25.3304V7.82485H84.6174V10.2758H76.365V15.0772H81.6916V17.5281H76.365V22.8794H85.1688V25.3304H73.764ZM91.7943 25.3304V7.82485H94.3955V22.8295H102.948V25.3304H91.7943ZM112.75 10.3257V25.3304H110.149V10.3257H105.198V7.82485H117.702V10.3257H112.75ZM123.078 25.3304V7.82485H133.931V10.2758H125.679V15.0772H131.006V17.5281H125.679V22.8794H134.483V25.3304H123.078Z"
|
||||
fill="#4A4A55"
|
||||
/>
|
||||
<path
|
||||
d="M25.615 4.49554C22.563 0.127376 16.5351 -1.16825 12.1769 1.60935L4.52282 6.48785C3.48875 7.13833 2.6018 7.99743 1.91867 9.01023C1.23553 10.023 0.771258 11.1672 0.555527 12.3697C0.190411 14.395 0.51127 16.4843 1.46731 18.3067C0.812002 19.3005 0.365144 20.417 0.153779 21.5885C-0.0643107 22.8151 -0.0352588 24.073 0.239231 25.2882C0.51372 26.5035 1.02812 27.6517 1.75226 28.6656C4.80425 33.0343 10.8325 34.3294 15.1901 31.5518L22.8445 26.6733C23.8786 26.0228 24.7655 25.1637 25.4487 24.1509C26.1318 23.1381 26.5961 21.9939 26.8118 20.7914C27.1767 18.766 26.856 16.6768 25.9003 14.8541C26.5553 13.8603 27.0019 12.744 27.2132 11.5726C27.4315 10.346 27.4025 9.08811 27.128 7.87282C26.8535 6.65752 26.3393 5.5093 25.615 4.49554Z"
|
||||
fill="#FF3E00"
|
||||
/>
|
||||
<path
|
||||
d="M11.4291 29.0767C10.2246 29.3898 8.95296 29.3257 7.78598 28.8932C6.619 28.4606 5.61287 27.6803 4.90345 26.6577C4.46805 26.0481 4.15874 25.3578 3.99365 24.6271C3.82857 23.8964 3.81103 23.1401 3.94207 22.4025C3.98642 22.1604 4.04751 21.9216 4.1249 21.6879L4.26898 21.2478L4.66134 21.5356C5.56664 22.2013 6.57896 22.7074 7.65464 23.0323L7.93901 23.1186L7.91289 23.4026C7.87805 23.8066 7.98742 24.2097 8.22161 24.5407C8.43522 24.849 8.73834 25.0842 9.08998 25.2146C9.44162 25.345 9.82483 25.3644 10.1878 25.2699C10.3539 25.2258 10.5122 25.1565 10.6573 25.0645L18.312 20.1845C18.4992 20.0666 18.6599 19.9109 18.7837 19.7275C18.9075 19.544 18.9917 19.3368 19.0309 19.119C19.0702 18.8966 19.0648 18.6687 19.015 18.4485C18.9652 18.2282 18.8721 18.0201 18.741 17.8363C18.5274 17.528 18.2243 17.2928 17.8727 17.1622C17.521 17.0317 17.1379 17.0122 16.7748 17.1064C16.6087 17.1505 16.4504 17.2198 16.3053 17.3119L13.3842 19.1739C12.9035 19.4793 12.379 19.7095 11.8288 19.8565C10.6243 20.1696 9.35266 20.1055 8.18568 19.6729C7.01869 19.2403 6.01256 18.4601 5.30314 17.4375C4.86762 16.8279 4.55821 16.1376 4.39307 15.4069C4.22793 14.6762 4.21039 13.9198 4.34147 13.1823C4.47158 12.4591 4.75119 11.7711 5.16242 11.1622C5.57365 10.5533 6.10744 10.0369 6.72965 9.64607L14.3834 4.76787C14.8639 4.46198 15.3885 4.23149 15.9388 4.0844C17.1433 3.77125 18.4149 3.8353 19.5819 4.26789C20.7489 4.70048 21.755 5.48077 22.4644 6.5034C22.8999 7.11296 23.2093 7.80332 23.3744 8.53401C23.5395 9.2647 23.5571 10.021 23.4261 10.7586C23.3812 11.0011 23.3197 11.2402 23.2421 11.4743L23.098 11.9145L22.706 11.6272C21.8007 10.9615 20.7884 10.4553 19.7127 10.1306L19.428 10.0443L19.4544 9.76023C19.4889 9.35635 19.3795 8.95328 19.1457 8.62219C18.9322 8.31419 18.6293 8.07913 18.278 7.94872C17.9266 7.81831 17.5437 7.79884 17.181 7.89294C17.0149 7.93707 16.8566 8.00635 16.7114 8.09836L9.05592 12.9766C8.86868 13.0944 8.70806 13.25 8.58432 13.4335C8.46058 13.6169 8.37643 13.8241 8.33723 14.0418C8.29778 14.2642 8.30305 14.4922 8.35274 14.7125C8.40242 14.9328 8.49551 15.1409 8.62659 15.3248C8.84026 15.6331 9.14336 15.8683 9.49496 15.9988C9.84656 16.1293 10.2297 16.1488 10.5928 16.0547C10.7588 16.0104 10.9171 15.9411 11.0623 15.8493L13.9828 13.9881C14.4633 13.6822 14.9878 13.4518 15.5382 13.3049C16.7424 12.9919 18.0136 13.0559 19.1803 13.4882C20.347 13.9205 21.3529 14.7004 22.0624 15.7225C22.4979 16.332 22.8073 17.0224 22.9725 17.7531C23.1376 18.4838 23.1552 19.2401 23.0241 19.9777C22.8943 20.7008 22.615 21.3889 22.2042 21.998C21.7934 22.607 21.26 23.1237 20.6382 23.515L12.9845 28.3932C12.504 28.6992 11.9795 28.9297 11.4291 29.0767Z"
|
||||
fill="white"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_5341_22451">
|
||||
<rect width="184" height="33.1611" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
href="/documentation/quickstarts/sveltekit"
|
||||
/>
|
||||
@@ -0,0 +1,264 @@
|
||||
<Accordion defaultOpen title="Don't have a NestJS project yet to add Trigger.dev to? No problem, you can complete the Manual Setup using a blank NestJS project:">
|
||||
Create a blank project by installing the NestJS CLI in your terminal:
|
||||
|
||||
```bash
|
||||
npm i -g @nestjs/cli
|
||||
```
|
||||
|
||||
Then, create an empty project with:
|
||||
|
||||
```bash
|
||||
nest new project-name
|
||||
```
|
||||
|
||||
</Accordion>
|
||||
|
||||
## Installing Required Packages
|
||||
|
||||
To begin, install the necessary packages in your NestJS project directory. You can choose one of the following package managers:
|
||||
|
||||
<CodeGroup>
|
||||
```bash npm
|
||||
npm i @trigger.dev/sdk @trigger.dev/nestjs @nestjs/config
|
||||
```
|
||||
|
||||
```bash pnpm
|
||||
pnpm install @trigger.dev/sdk @trigger.dev/nestjs @nestjs/config
|
||||
```
|
||||
|
||||
```bash yarn
|
||||
yarn add @trigger.dev/sdk @trigger.dev/nestjs @nestjs/config
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
<br />
|
||||
|
||||
<Note>Ensure that you execute this command within a NestJS project.</Note>
|
||||
|
||||
## Obtaining the Development API Key
|
||||
|
||||
To locate your development API key, login to the [Trigger.dev
|
||||
dashboard](https://cloud.trigger.dev) and select the Project you want to
|
||||
connect to. Then click on the Environments & API Keys tab in the left menu.
|
||||
You can copy your development API Key from the field at the top of this page.
|
||||
(Your development key will start with `tr_dev_`).
|
||||
|
||||
## Adding Environment Variables
|
||||
|
||||
Create a `.env` file at the root of your project and include your Trigger API key and URL like this:
|
||||
|
||||
```bash
|
||||
TRIGGER_API_KEY=ENTER_YOUR_DEVELOPMENT_API_KEY_HERE
|
||||
TRIGGER_API_URL=https://api.trigger.dev # this line is only necessary if you are self-hosting Trigger
|
||||
```
|
||||
|
||||
Replace `ENTER_YOUR_DEVELOPMENT_API_KEY_HERE` with the actual API key obtained from the previous step.
|
||||
|
||||
<Note>
|
||||
This configuration only will be loaded if you use [NestJS
|
||||
Config](https://docs.nestjs.com/techniques/configuration) or
|
||||
[dotenv](https://github.com/motdotla/dotenv).
|
||||
</Note>
|
||||
|
||||
## Adding TriggerDev Module
|
||||
|
||||
Open your `app.module.ts`, and add the following inside your `imports`:
|
||||
|
||||
```typescript
|
||||
import { TriggerDevModule } from "@trigger.dev/nestjs";
|
||||
import { Module } from "@nestjs/common";
|
||||
|
||||
//you need to load the environment variables from .env, this is one way to do it
|
||||
import "dotenv/config";
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TriggerDevModule.register({
|
||||
id: "my-app",
|
||||
apiKey: process.env.TRIGGER_API_KEY,
|
||||
apiUrl: process.env.TRIGGER_API_URL,
|
||||
}),
|
||||
// if you use NestJS Config, you can do like this:
|
||||
// TriggerDevModule.registerAsync({
|
||||
// useFactory: (configService: ConfigService) => ({
|
||||
// id: 'my-app',
|
||||
// apiKey: configService.get<string>("TRIGGER_API_KEY"),
|
||||
// apiUrl: configService.get<string>("TRIGGER_API_URL"),
|
||||
// }),
|
||||
// inject: [ConfigService],
|
||||
// }),
|
||||
],
|
||||
})
|
||||
export class AppModule {
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
Replace **"my-app"** with an appropriate identifier for your project. The **apiKey** and **apiUrl** are obtained from the environment variables you set earlier.
|
||||
|
||||
By following these steps, you'll configure the Trigger Client to work with your project.
|
||||
|
||||
## Creating the Example Job
|
||||
|
||||
When you add `TriggerDevModule` to your project, you will can have access to the `TriggerClient` instance by using the `@InjectTriggerDevClient()` decorator in the constructor.
|
||||
|
||||
Now, let's create an example job to test the integration.
|
||||
|
||||
1. Create a controller named `job.controller.ts` alongside your `app.module.ts`
|
||||
2. Inside that controller, add the following code:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```typescript job.controller.ts
|
||||
import { Controller, Get } from "@nestjs/common";
|
||||
import { InjectTriggerDevClient } from "@trigger.dev/nestjs";
|
||||
import { eventTrigger, TriggerClient } from "@trigger.dev/sdk";
|
||||
|
||||
@Controller()
|
||||
export class JobController {
|
||||
constructor(@InjectTriggerDevClient() private readonly client: TriggerClient) {
|
||||
this.client.defineJob({
|
||||
id: "test-job",
|
||||
name: "Test Job One",
|
||||
version: "0.0.1",
|
||||
trigger: eventTrigger({
|
||||
name: "test.event",
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info("Hello world!", { payload });
|
||||
|
||||
return {
|
||||
message: "Hello world!",
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return `Running Trigger.dev with client-id ${this.client.id}`;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now, add this controller to your `app.module.ts`:
|
||||
|
||||
```typescript app.module.ts
|
||||
import { TriggerDevModule } from "@trigger.dev/nestjs";
|
||||
import { Module } from "@nestjs/common";
|
||||
import { JobController } from "./job.controller";
|
||||
|
||||
//you need to load the environment variables from .env, this is one way to do it
|
||||
import "dotenv/config";
|
||||
|
||||
@Module({
|
||||
controllers: [JobController],
|
||||
imports: [
|
||||
TriggerDevModule.register({
|
||||
id: "my-app",
|
||||
apiKey: process.env.TRIGGER_API_KEY,
|
||||
apiUrl: process.env.TRIGGER_API_URL,
|
||||
}),
|
||||
// if you use NestJS Config, you can do like this:
|
||||
// TriggerDevModule.registerAsync({
|
||||
// useFactory: (configService: ConfigService) => ({
|
||||
// id: 'my-app',
|
||||
// apiKey: configService.get<string>("TRIGGER_API_KEY"),
|
||||
// apiUrl: configService.get<string>("TRIGGER_API_URL"),
|
||||
// }),
|
||||
// inject: [ConfigService],
|
||||
// }),
|
||||
],
|
||||
})
|
||||
export class AppModule {
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
<br />
|
||||
<Note>
|
||||
You can import the Trigger.dev client inside any `service` or `controller`, we recommend you to
|
||||
create specialized `service` for each job you have for a better maintainability.
|
||||
</Note>
|
||||
|
||||
## Adding Configuration to `package.json`
|
||||
|
||||
Inside the `package.json` file, add the following configuration under the root object:
|
||||
|
||||
```json
|
||||
"trigger.dev": {
|
||||
"endpointId": "my-app"
|
||||
}
|
||||
```
|
||||
|
||||
Your `package.json` file might look something like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-app",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
// ... other dependencies
|
||||
},
|
||||
"trigger.dev": {
|
||||
"endpointId": "my-app"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace **"my-app"** with the appropriate identifier you used during the step for creating the Trigger Client.
|
||||
|
||||
## Running
|
||||
|
||||
### Run your NestJS app
|
||||
|
||||
Run your NestJS app locally, like you normally would. For example:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npm run start
|
||||
```
|
||||
|
||||
```bash pnpm
|
||||
pnpm run start
|
||||
```
|
||||
|
||||
```bash yarn
|
||||
yarn run start
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
### Run the CLI 'dev' command
|
||||
|
||||
In a **_separate terminal window or tab_** run:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npx @trigger.dev/cli@latest dev
|
||||
```
|
||||
|
||||
```bash pnpm
|
||||
pnpm dlx @trigger.dev/cli@latest dev
|
||||
```
|
||||
|
||||
```bash yarn
|
||||
yarn dlx @trigger.dev/cli@latest dev
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
<br />
|
||||
<Note>
|
||||
You can optionally pass the port if you're not running on 3000 by adding
|
||||
`--port 3001` to the end
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
You can optionally pass the hostname if you're not running on localhost by adding
|
||||
`--hostname <host>`. Example, in case your Remix is running on 0.0.0.0: `--hostname 0.0.0.0`.
|
||||
</Note>
|
||||
@@ -28,6 +28,7 @@ Each platform has one or more adaptors, see the guides below:
|
||||
| ------------------------------------------------- | -------------------- |
|
||||
| [Next.js](/documentation/guides/platforms/nextjs) | `createPagesRoute()` |
|
||||
| [Next.js](/documentation/guides/platforms/nextjs) | `createAppRoute()` |
|
||||
| [NestJS](/documentation/guides/manual/nestjs) | `TriggerDevModule` |
|
||||
| [Astro](/documentation/guides/platforms/astro) | `createAstroRoute()` |
|
||||
| [Remix](/documentation/guides/platforms/remix) | `createRemixRoute()` |
|
||||
| Express | Coming soon |
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: "NestJS"
|
||||
sidebarTitle: "NestJS"
|
||||
description: "How to manually setup Trigger.dev in your NestJS project"
|
||||
---
|
||||
|
||||
<Snippet file="manual-setup-nestjs.mdx" />
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: "NestJS Quick Start"
|
||||
sidebarTitle: "NestJS"
|
||||
description: "Start creating Jobs in 5 minutes in your NestJS project."
|
||||
---
|
||||
|
||||
<Snippet file="manual-setup-nestjs.mdx" />
|
||||
@@ -142,6 +142,7 @@
|
||||
"group": "Manual setup",
|
||||
"pages": [
|
||||
"documentation/guides/manual/nextjs",
|
||||
"documentation/guides/manual/nestjs",
|
||||
"documentation/guides/manual/express",
|
||||
"documentation/guides/manual/remix",
|
||||
"documentation/guides/manual/redwood",
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Trigger.dev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
# NestJS and Trigger.dev
|
||||
|
||||
Trigger.dev has full support for the NestJS framework.
|
||||
|
||||
For information about the using Trigger.dev in your NestJS app, check out these useful docs links:
|
||||
|
||||
- [Quick start guide for getting setup with Trigger.dev in a NestJS project](https://trigger.dev/docs/documentation/quickstarts/nestjs)
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "@trigger.dev/nestjs",
|
||||
"version": "2.1.8",
|
||||
"description": "Official NestJS adapter for Trigger.dev",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.1.0",
|
||||
"@trigger.dev/tsconfig": "workspace:*",
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/express": "^4.17.13",
|
||||
"fastify": "^4.23.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"tsup": "^6.5.0",
|
||||
"tsx": "^3.12.1"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"build": "npm run clean && npm run build:tsup",
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": ">=10.0.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^10.2.4",
|
||||
"@remix-run/web-fetch": "^4.3.5",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.8.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
import {
|
||||
Body,
|
||||
ConfigurableModuleBuilder,
|
||||
Controller,
|
||||
DynamicModule,
|
||||
Head,
|
||||
Headers,
|
||||
HttpCode,
|
||||
Inject,
|
||||
InjectionToken,
|
||||
InternalServerErrorException,
|
||||
Module,
|
||||
NotFoundException,
|
||||
Post,
|
||||
Res,
|
||||
} from "@nestjs/common";
|
||||
import { Headers as StandardHeaders, Request as StandardRequest } from "@remix-run/web-fetch";
|
||||
import { TriggerClient, TriggerClientOptions } from "@trigger.dev/sdk";
|
||||
import type { Response } from "express";
|
||||
import type { FastifyReply } from "fastify";
|
||||
|
||||
const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } =
|
||||
new ConfigurableModuleBuilder<TriggerClientOptions>().build();
|
||||
|
||||
/**
|
||||
* The injection token to use for the TriggerDev client.
|
||||
*/
|
||||
export const TriggerClientRef = Symbol("TriggerClientRef");
|
||||
|
||||
/**
|
||||
* Injects the TriggerDev client.
|
||||
* It will returns an instance of {@link TriggerClient}
|
||||
*/
|
||||
export const InjectTriggerDevClient = (customProviderToken: InjectionToken = TriggerClientRef) =>
|
||||
Inject(customProviderToken);
|
||||
|
||||
/**
|
||||
* The TriggerDev module for NestJS.
|
||||
*
|
||||
* Use {@link TriggerDevModule.register} to register the module, or {@link TriggerDevModule.registerAsync} to register it asynchronously.
|
||||
*
|
||||
* @example```ts
|
||||
* import { Module } from '@nestjs/common';
|
||||
* import { TriggerDevModule } from '@trigger.dev/nestjs';
|
||||
*
|
||||
* @Module({
|
||||
* imports: [
|
||||
* TriggerDevModule.register({
|
||||
* id: 'my-client',
|
||||
* apiKey: process.env['TRIGGER_API_KEY']!,
|
||||
* }),
|
||||
* // you can also can configure it asynchnously
|
||||
* TriggerDevModule.registerAsync({
|
||||
* inject: [YouConfigService],
|
||||
* useFactory: (configService: YouConfigService) => {
|
||||
* return {
|
||||
* id: 'my-client',
|
||||
* apiKey: configService.get('TRIGGER_API_KEY'),
|
||||
* };
|
||||
* },
|
||||
* }),
|
||||
* ],
|
||||
* })
|
||||
* export class AppModule {}
|
||||
* ```
|
||||
*/
|
||||
@Module({})
|
||||
export class TriggerDevModule extends ConfigurableModuleClass {
|
||||
/**
|
||||
* Register the instance for the TriggerDev client.
|
||||
*
|
||||
* Hint: If you want to have multiple instances of the client, you can use the `customProviderToken` to create multiple instances.
|
||||
*
|
||||
* @param options The options to use for the client
|
||||
* @param path The path to use for the controller (default: `/api/trigger`)
|
||||
* @param customProviderToken The token to use for the provider (default: {@link TriggerClientRef})
|
||||
*/
|
||||
static register(
|
||||
options: typeof OPTIONS_TYPE,
|
||||
path: string = "/api/trigger",
|
||||
customProviderToken: InjectionToken = TriggerClientRef
|
||||
): DynamicModule {
|
||||
const { providers, ...rest } = ConfigurableModuleClass.register(options);
|
||||
const controller = createControllerByPath(customProviderToken, path);
|
||||
|
||||
return {
|
||||
...rest,
|
||||
controllers: [controller],
|
||||
providers: [
|
||||
...(providers || []),
|
||||
{
|
||||
provide: customProviderToken,
|
||||
inject: [MODULE_OPTIONS_TOKEN],
|
||||
useFactory: (options: TriggerClientOptions) => {
|
||||
return new TriggerClient(options);
|
||||
},
|
||||
},
|
||||
],
|
||||
exports: [customProviderToken],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the instance for the TriggerDev client asynchronously.
|
||||
*
|
||||
* Hint: If you want to have multiple instances of the client, you can use the `customProviderToken` to create multiple instances.
|
||||
*
|
||||
* @param options The options to use for the client
|
||||
* @param path The path to use for the controller (default: `/api/trigger`)
|
||||
* @param customProviderToken The token to use for the provider (default: {@link TriggerClientRef})
|
||||
*/
|
||||
static registerAsync(
|
||||
options: typeof ASYNC_OPTIONS_TYPE,
|
||||
path: string = "/api/trigger",
|
||||
customProviderToken: InjectionToken = TriggerClientRef
|
||||
): DynamicModule {
|
||||
const { providers, ...rest } = ConfigurableModuleClass.registerAsync(options);
|
||||
const controller = createControllerByPath(customProviderToken, path);
|
||||
|
||||
return {
|
||||
...rest,
|
||||
controllers: [controller],
|
||||
providers: [
|
||||
...(providers || []),
|
||||
{
|
||||
provide: customProviderToken,
|
||||
inject: [MODULE_OPTIONS_TOKEN],
|
||||
useFactory: (options: TriggerClientOptions) => {
|
||||
return new TriggerClient(options);
|
||||
},
|
||||
},
|
||||
],
|
||||
exports: [customProviderToken],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to create a custom controller for NestJS with specific path to handle TriggerDev requests.
|
||||
*
|
||||
* @param customProvider The provider to use to inject the TriggerDev client
|
||||
* @param path The path to use for the controller
|
||||
*/
|
||||
function createControllerByPath(customProvider: InjectionToken, path: string) {
|
||||
@Controller(path)
|
||||
class TriggerDevController {
|
||||
constructor(
|
||||
@InjectTriggerDevClient(customProvider)
|
||||
private readonly client: TriggerClient
|
||||
) {}
|
||||
|
||||
@Head()
|
||||
@HttpCode(200)
|
||||
public empty() {}
|
||||
|
||||
@Post()
|
||||
public handleRequestPost(
|
||||
@Res({ passthrough: true }) res: any,
|
||||
@Headers() headers: unknown,
|
||||
@Body() body?: unknown
|
||||
): Promise<unknown> {
|
||||
return this.handleRequest(res, "POST", headers, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forward the request to the TriggerDev client
|
||||
*/
|
||||
public async handleRequest(
|
||||
res: any,
|
||||
method: string,
|
||||
requestHeaders: unknown,
|
||||
requestBody?: unknown
|
||||
): Promise<unknown> {
|
||||
// try {
|
||||
const headers = new StandardHeaders();
|
||||
|
||||
Object.entries(requestHeaders || {}).forEach(([key, value]) => {
|
||||
headers.set(key, value as string);
|
||||
});
|
||||
|
||||
// Create a new Request object (hardcode the url because it doesn't really matter what it is)
|
||||
const standardRequest = new StandardRequest("https://nestjs.com/api/trigger", {
|
||||
headers,
|
||||
method,
|
||||
// @ts-ignore
|
||||
body: requestBody ? JSON.stringify(requestBody) : undefined,
|
||||
});
|
||||
|
||||
const response = await this.client.handleRequest(standardRequest);
|
||||
|
||||
if (!response) {
|
||||
throw new NotFoundException({ error: "Not found" });
|
||||
}
|
||||
|
||||
if (typeof res.status === "function") {
|
||||
// express
|
||||
(res as Response).status(response.status);
|
||||
(res as Response).set(response.headers);
|
||||
} else if (typeof res.code === "function") {
|
||||
// fastify
|
||||
(res as FastifyReply).code(response.status);
|
||||
if (response.headers) {
|
||||
(res as FastifyReply).headers(response.headers);
|
||||
}
|
||||
} else {
|
||||
throw new InternalServerErrorException(
|
||||
"Unable to indetify the framework to set the status code, are you using Express or Fastify?"
|
||||
);
|
||||
}
|
||||
|
||||
return response.body;
|
||||
}
|
||||
}
|
||||
|
||||
return TriggerDevController;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "@trigger.dev/tsconfig/node18.json",
|
||||
"include": ["./src/**/*.ts", "tsup.config.ts"],
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"declaration": false,
|
||||
"declarationMap": false
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { defineConfig } from "tsup";
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
name: "main",
|
||||
entry: ["./src/index.ts"],
|
||||
outDir: "./dist",
|
||||
platform: "node",
|
||||
format: ["cjs"],
|
||||
legacyOutput: true,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
bundle: true,
|
||||
splitting: false,
|
||||
dts: true,
|
||||
external: ["http", "https", "util", "events", "tty", "os", "timers"],
|
||||
esbuildPlugins: [],
|
||||
},
|
||||
]);
|
||||
Generated
+1551
-90
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
|
||||
TRIGGER_API_KEY=tr_dev_test-api-key
|
||||
TRIGGER_API_URL=http://localhost:3030
|
||||
@@ -0,0 +1,25 @@
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:prettier/recommended',
|
||||
],
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
jest: true,
|
||||
},
|
||||
ignorePatterns: ['.eslintrc.js'],
|
||||
rules: {
|
||||
'@typescript-eslint/interface-name-prefix': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
# compiled output
|
||||
/dist
|
||||
/node_modules
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
pnpm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
|
||||
# Tests
|
||||
/coverage
|
||||
/.nyc_output
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
.env
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<p align="center">
|
||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
|
||||
</p>
|
||||
|
||||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
||||
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
||||
|
||||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
||||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
||||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
|
||||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
||||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
||||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
|
||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
||||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
||||
</p>
|
||||
<!--[](https://opencollective.com/nest#backer)
|
||||
[](https://opencollective.com/nest#sponsor)-->
|
||||
|
||||
## Description
|
||||
|
||||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ pnpm install
|
||||
```
|
||||
|
||||
## Running the app
|
||||
|
||||
```bash
|
||||
# development
|
||||
$ pnpm run start
|
||||
|
||||
# watch mode
|
||||
$ pnpm run start:dev
|
||||
|
||||
# production mode
|
||||
$ pnpm run start:prod
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
```bash
|
||||
# unit tests
|
||||
$ pnpm run test
|
||||
|
||||
# e2e tests
|
||||
$ pnpm run test:e2e
|
||||
|
||||
# test coverage
|
||||
$ pnpm run test:cov
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
## Stay in touch
|
||||
|
||||
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
||||
- Website - [https://nestjs.com](https://nestjs.com/)
|
||||
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
||||
|
||||
## License
|
||||
|
||||
Nest is [MIT licensed](LICENSE).
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/nest-cli",
|
||||
"collection": "@nestjs/schematics",
|
||||
"sourceRoot": "src",
|
||||
"compilerOptions": {
|
||||
"deleteOutDir": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"name": "nestjs-example",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
"license": "UNLICENSED",
|
||||
"scripts": {
|
||||
"build": "nest build",
|
||||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
||||
"start": "nest start",
|
||||
"start:dev": "nest start --watch",
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:prod": "node dist/main",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^10.0.0",
|
||||
"@nestjs/core": "^10.0.0",
|
||||
"@nestjs/config": "^3.0.1",
|
||||
"@nestjs/platform-express": "^10.0.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"@trigger.dev/sdk": "workspace:*",
|
||||
"@trigger.dev/nestjs": "workspace:*",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "^10.0.0",
|
||||
"@nestjs/schematics": "^10.0.0",
|
||||
"@nestjs/testing": "^10.0.0",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@types/node": "^20.3.1",
|
||||
"@types/supertest": "^2.0.12",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"eslint": "^8.42.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^3.0.0",
|
||||
"source-map-support": "^0.5.21",
|
||||
"supertest": "^6.3.3",
|
||||
"ts-jest": "^29.1.0",
|
||||
"ts-loader": "^9.4.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsconfig-paths": "^4.2.0",
|
||||
"typescript": "^5.1.3"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"json",
|
||||
"ts"
|
||||
],
|
||||
"rootDir": "src",
|
||||
"testRegex": ".*\\.spec\\.ts$",
|
||||
"transform": {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
},
|
||||
"collectCoverageFrom": [
|
||||
"**/*.(t|j)s"
|
||||
],
|
||||
"coverageDirectory": "../coverage",
|
||||
"testEnvironment": "node"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { InjectTriggerDevClient } from '@trigger.dev/nestjs';
|
||||
import { eventTrigger, TriggerClient } from '@trigger.dev/sdk';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(
|
||||
@InjectTriggerDevClient() private readonly client: TriggerClient,
|
||||
) {
|
||||
this.client.defineJob({
|
||||
id: 'test-job',
|
||||
name: 'Test Job One',
|
||||
version: '0.0.1',
|
||||
trigger: eventTrigger({
|
||||
name: 'test.event',
|
||||
}),
|
||||
run: async (payload, io) => {
|
||||
await io.logger.info('Hello world!', { payload });
|
||||
|
||||
return {
|
||||
message: 'Hello world!',
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return `Running Trigger.dev with client-id ${this.client.id}`;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { TriggerDevModule } from '@trigger.dev/nestjs';
|
||||
import { AppController } from './app.controller';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
TriggerDevModule.registerAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService) => ({
|
||||
id: 'my-nest-app',
|
||||
apiKey: config.getOrThrow('TRIGGER_API_KEY'),
|
||||
apiUrl: config.getOrThrow('TRIGGER_API_URL'),
|
||||
verbose: false,
|
||||
ioLogLocalEnabled: true,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
controllers: [AppController],
|
||||
})
|
||||
export class AppModule {}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
await app.listen(3000);
|
||||
}
|
||||
bootstrap();
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import * as request from 'supertest';
|
||||
import { AppModule } from './../src/app.module';
|
||||
|
||||
describe('AppController (e2e)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
const moduleFixture: TestingModule = await Test.createTestingModule({
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = moduleFixture.createNestApplication();
|
||||
await app.init();
|
||||
});
|
||||
|
||||
it('/ (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/')
|
||||
.expect(200)
|
||||
.expect('Hello World!');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"moduleFileExtensions": ["js", "json", "ts"],
|
||||
"rootDir": ".",
|
||||
"testEnvironment": "node",
|
||||
"testRegex": ".e2e-spec.ts$",
|
||||
"transform": {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"removeComments": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "ES2021",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./",
|
||||
"incremental": true,
|
||||
"skipLibCheck": true,
|
||||
"strictNullChecks": false,
|
||||
"noImplicitAny": false,
|
||||
"strictBindCallApply": false,
|
||||
"forceConsistentCasingInFileNames": false,
|
||||
"noFallthroughCasesInSwitch": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user