Skip to content

Commit de30285

Browse files
authored
v3 docs (#929)
* Started building out the docs navigation * Drafted out a lot of the docs pages. With just titles and descriptions with a coming soon message for now. * A ton more scaffolded pages with titles, descriptions, coming soon/incomplete docs messages * Created the remaining page stubs * Introduction page improvements * Lots of docs changes, mostly the task overview page * Moved some bits around * Task overview fleshed out * Triggering docs page * Regular task page * CLi dev docs * Docs for debugging locally * Environment variables docs * Added env var images * Deployment guides * Updated the title of “Integrations” to “Deployment integrations” to make it less confusing * Lots more docs pages * Changed the language to JavaScript * Fixed typos about queues and added a simple code sample * Moved the local debugger docs into the CLI dev page * Added the CLI deploy options * Delete the local debugger page * Updated the logging page with structured logging * Added the new CLI deploy options * Change to h4 for one of the options * Errors page * WIP on retrying * Retrying guide * Wait docs pages * Queuing docs simplified, partial written * Queuing and concurrency docs * Run tests docs * New combined error and retrying page * Errors and retrying page updated * More docs * Added a possible configurations coming soon table * Created a limits page * Added warnings about how you need to get early access * Minor fixes for the docs
1 parent cf9d466 commit de30285

File tree

102 files changed

+2312
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2312
-4
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: OpenTelemetry Auto-Instrumentation Request
2+
description: Suggest an SDK that you'd like to be auto-instrumented in the Run log view
3+
title: "auto-instrumentation: "
4+
labels: ["🌟 enhancement"]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: What API or SDK would you to have automatic spans for?
9+
description: A clear description of which API or SDK you'd like, and links to it.
10+
validations:
11+
required: true
12+
- type: textarea
13+
attributes:
14+
label: Is there an existing OpenTelemetry auto-instrumentation package?
15+
description: You can search for existing ones – https://opentelemetry.io/ecosystem/registry/?component=instrumentation&language=js
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: Additional information
21+
description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here.

docs/_snippets/coming-soon-slim.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Warning>This feature will become available during the Developer Preview.</Warning>

docs/_snippets/coming-soon.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Warning>This feature will become available during the Developer Preview.</Warning>
2+
3+
To get the latest updates on the Developer Preview, [join our Discord community](https://trigger.dev/discord) or follow us on [Twitter](https://twitter.com/triggerdotdev).

docs/_snippets/incomplete-docs.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Note>This documentation is coming soon.</Note>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
```ts /trigger/openai.ts
2+
import { task } from "@trigger.dev/sdk/v3";
3+
import OpenAI from "openai";
4+
5+
const openai = new OpenAI({
6+
apiKey: process.env.OPENAI_API_KEY,
7+
});
8+
9+
export const openaiTask = task({
10+
id: "openai-task",
11+
//specifying retry options overrides the defaults defined in your trigger.config file
12+
retry: {
13+
maxAttempts: 10,
14+
factor: 1.8,
15+
minTimeoutInMs: 500,
16+
maxTimeoutInMs: 30_000,
17+
randomize: false,
18+
},
19+
run: async (payload: { prompt: string }) => {
20+
//if this fails, it will throw an error and retry
21+
const chatCompletion = await openai.chat.completions.create({
22+
messages: [{ role: "user", content: payload.prompt }],
23+
model: "gpt-3.5-turbo",
24+
});
25+
26+
if (chatCompletion.choices[0]?.message.content === undefined) {
27+
//sometimes OpenAI returns an empty response, let's retry by throwing an error
28+
throw new Error("OpenAI call failed");
29+
}
30+
31+
return chatCompletion.choices[0].message.content;
32+
},
33+
});
34+
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Note>
2+
In the Trigger.dev Cloud we automatically pause execution of tasks when they are waiting for
3+
longer than a few seconds. You are not charged when execution is paused.
4+
</Note>

docs/documentation/introduction.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ Trigger.dev is an open source framework for creating long-running Jobs directly
88

99
You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [Self-host Trigger.dev](/documentation/guides/self-hosting) on your own infrastructure.
1010

11-
<Note>
12-
Trigger.dev v2 currently only supports serverless. We will be adding [support for long-running
13-
servers](https://github.com/triggerdotdev/trigger.dev/issues/244) soon.
14-
</Note>
11+
<Note>Trigger.dev v2 currently only supports serverless.</Note>
1512

1613
<CardGroup>
1714
<Card title="Quick start guides" icon="person-running-fast" href="quickstarts/introduction">
66.4 KB
Loading
Loading
Loading
175 KB
Loading
140 KB
Loading

docs/images/v3/run-in-progress.png

84.8 KB
Loading

docs/images/v3/run-log.png

119 KB
Loading
46 KB
Loading

docs/images/v3/test-select-task.png

137 KB
Loading

docs/images/v3/test-set-payload.png

171 KB
Loading

docs/mint.json

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
{
5050
"name": "Examples",
5151
"url": "https://trigger.dev/apis"
52+
},
53+
{
54+
"name": "v3 Developer Preview",
55+
"url": "v3"
5256
}
5357
],
5458
"redirects": [
@@ -427,6 +431,157 @@
427431
{
428432
"group": "Overview",
429433
"pages": ["examples/introduction"]
434+
},
435+
{
436+
"group": "",
437+
"pages": ["v3/introduction"]
438+
},
439+
{
440+
"group": "Getting Started",
441+
"pages": [
442+
"v3/quick-start",
443+
"v3/upgrading-from-v2",
444+
"v3/changelog",
445+
"v3/feature-matrix",
446+
"v3/limits"
447+
]
448+
},
449+
{
450+
"group": "Fundamentals",
451+
"pages": [
452+
"v3/trigger-folder",
453+
"v3/tasks-overview",
454+
"v3/triggering",
455+
{
456+
"group": "Task types",
457+
"pages": ["v3/tasks-regular", "v3/tasks-scheduled", "v3/tasks-zod", "v3/tasks-webhooks"]
458+
}
459+
]
460+
},
461+
{
462+
"group": "Development",
463+
"pages": ["v3/cli-dev", "v3/run-tests"]
464+
},
465+
{
466+
"group": "Deployment",
467+
"pages": [
468+
"v3/deploy-environment-variables",
469+
"v3/cli-deploy",
470+
"v3/github-actions",
471+
{
472+
"group": "Deployment integrations",
473+
"pages": ["v3/vercel-integration"]
474+
}
475+
]
476+
},
477+
{
478+
"group": "Writing tasks",
479+
"pages": [
480+
"v3/writing-tasks-introduction",
481+
"v3/logging",
482+
"v3/errors-retrying",
483+
{
484+
"group": "Wait",
485+
"pages": [
486+
"v3/wait",
487+
"v3/wait-for",
488+
"v3/wait-until",
489+
"v3/wait-for-event",
490+
"v3/wait-for-request"
491+
]
492+
},
493+
"v3/queue-concurrency",
494+
"v3/versioning",
495+
"v3/machines",
496+
"v3/idempotency",
497+
"v3/reattempting-replaying",
498+
"v3/trigger-filters",
499+
"v3/notifications",
500+
"v3/rollbacks",
501+
"v3/using-apis",
502+
"v3/middleware",
503+
"v3/automated-tests"
504+
]
505+
},
506+
{
507+
"group": "Dashboard",
508+
"pages": [
509+
"v3/dashboard-overview",
510+
"v3/dashboard-runs",
511+
"v3/dashboard-tests",
512+
"v3/dashboard-environment-variables"
513+
]
514+
},
515+
{
516+
"group": "API reference",
517+
"pages": [
518+
{
519+
"group": "Functions",
520+
"pages": [
521+
"v3/reference-task",
522+
"v3/reference-cron-task",
523+
"v3/reference-cron-dynamic",
524+
"v3/reference-interval-task",
525+
"v3/reference-interval-dynamic",
526+
"v3/reference-zod-task",
527+
"v3/reference-zod-catalog",
528+
"v3/reference-task-trigger",
529+
"v3/reference-task-trigger-and-wait",
530+
"v3/reference-task-batch-trigger",
531+
"v3/reference-task-batch-trigger-and-wait",
532+
"v3/reference-wait-for",
533+
"v3/reference-wait-until",
534+
"v3/reference-wait-for-event",
535+
"v3/reference-wait-for-request",
536+
"v3/reference-retry-on-throw",
537+
"v3/reference-retry-fetch",
538+
"v3/reference-retry-intercept-fetch",
539+
"v3/reference-notification-catalog",
540+
"v3/reference-notify",
541+
"v3/reference-queue"
542+
]
543+
},
544+
{
545+
"group": "Objects",
546+
"pages": ["v3/reference-context"]
547+
},
548+
{
549+
"group": "CLI",
550+
"pages": [
551+
"v3/reference-cli-init",
552+
"v3/reference-cli-dev",
553+
"v3/reference-cli-deploy",
554+
"v3/reference-cli-login",
555+
"v3/reference-cli-logout",
556+
"v3/reference-cli-update",
557+
"v3/reference-cli-build",
558+
"v3/reference-cli-who-am-i"
559+
]
560+
},
561+
"v3/reference-trigger-config"
562+
]
563+
},
564+
{
565+
"group": "Architecture",
566+
"pages": [
567+
"v3/architecture-how-it-works",
568+
"v3/architecture-multi-tenant-queue",
569+
"v3/architecture-reliability"
570+
]
571+
},
572+
{
573+
"group": "Open source",
574+
"pages": ["v3/github-repo", "v3/open-source-self-hosting", "v3/open-source-contributing"]
575+
},
576+
{
577+
"group": "Help",
578+
"pages": [
579+
"v3/help-faqs",
580+
"v3/community",
581+
"v3/help-email",
582+
"v3/help-slack",
583+
"v3/help-uptime-status"
584+
]
430585
}
431586
],
432587
"footerSocials": {

docs/v3/architecture-how-it-works.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Architecture: How it works"
3+
sidebarTitle: "How it works"
4+
description: "An overview of how Trigger.dev v3 works under the hood."
5+
---
6+
7+
<Snippet file="incomplete-docs.mdx" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Architecture: Multi-tenant queue"
3+
sidebarTitle: "Multi-tenant queue"
4+
description: "We built a reliable and fair multi-tenant queue that controls triggering all tasks."
5+
---
6+
7+
<Snippet file="incomplete-docs.mdx" />

docs/v3/architecture-reliability.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Architecture: Reliability"
3+
sidebarTitle: "Reliability"
4+
description: "How reliability is achieved with Trigger.dev."
5+
---
6+
7+
<Snippet file="incomplete-docs.mdx" />

docs/v3/automated-tests.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Automated tests"
3+
description: "Write automated tests of your tasks."
4+
---
5+
6+
<Snippet file="coming-soon.mdx" />

docs/v3/changelog.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Changelog"
3+
url: "https://trigger.dev/changelog"
4+
---
5+
6+
Our [changelog](https://trigger.dev/changelog) is the best way to stay up to date with the latest changes to Trigger.

docs/v3/cli-deploy.mdx

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: "CLI deploy command"
3+
description: "The `trigger.dev deploy` command can be used to manually deploy."
4+
---
5+
6+
You run the command like this:
7+
8+
<CodeGroup>
9+
10+
```bash npm
11+
npx trigger.dev@v3 deploy
12+
```
13+
14+
```bash pnpm
15+
pnpm dlx trigger.dev@v3 deploy
16+
```
17+
18+
```bash yarn
19+
yarn dlx trigger.dev@v3 deploy
20+
```
21+
22+
</CodeGroup>
23+
24+
It performs a few steps to deploy:
25+
26+
1. Typechecks the code.
27+
2. Compiles and bundles the code.
28+
3. Checks that [environment variables](/v3/deploy-environment-variables) are set.
29+
4. Deploys the code to the cloud.
30+
5. Registers the tasks as a new version in the environment (prod by default).
31+
32+
## Options
33+
34+
### Environment `--env` or `-e`
35+
36+
Defaults to `prod` but you can specify `staging`.
37+
38+
### Skip typecheck `--skip-typecheck` or `-T`
39+
40+
Skips the pre-build typecheck step.
41+
42+
### Build platform `--build-platform`
43+
44+
The platform to build the deployment image for. Defaults to `linux/amd64`.
45+
46+
### Log level `--log-level` or `-l`
47+
48+
The log level to use (debug, info, log, warn, error, none). Defaults to `log`.
49+
50+
### Set config filename `--config` or `-c`
51+
52+
The name of the config file, found where the command is run from. Defaults to `trigger.config.ts`.
53+
54+
### Set the projectRef `--project-ref` or `-p`
55+
56+
The project ref. Required if there is no config file.
57+
58+
### Self-hosted options
59+
60+
These options are usually only relevant to self-hosters or for local development.
61+
62+
#### Skip deploying the image `--skip-deploy` or `-D`
63+
64+
Load the built image into your local docker.
65+
66+
#### Self-hosted (builds locally) `--self-hosted`
67+
68+
Builds and loads the image using your local docker. Use the `--registry` option to specify the registry to push the image to when using `--self-hosted`, or just use `--push-image` to push to the default registry.
69+
70+
#### Registry `--registry`
71+
72+
<Snippet file="coming-soon-slim.mdx" />
73+
74+
The registry to push the image to when using --self-hosted.
75+
76+
#### Push image `--push-image`
77+
78+
<Snippet file="coming-soon-slim.mdx" />
79+
80+
When using the --self-hosted flag, push the image to the default registry. (defaults to false when not using --registry)
81+
82+
#### Tag the image `--tag`
83+
84+
<Snippet file="coming-soon-slim.mdx" />
85+
86+
Specify the tag to use when pushing the image to the registry.
87+
88+
{/* todo add options, remove the reference docs */}

0 commit comments

Comments
 (0)