Skip to content

Commit 482cda2

Browse files
committed
Merge remote-tracking branch 'origin/main' into docs/v4-docs-updates
# Conflicts: # docs/docs.json # docs/frontend/overview.mdx # docs/frontend/react-hooks/overview.mdx # docs/guides/example-projects/human-in-the-loop-workflow.mdx # docs/management/authentication.mdx # docs/realtime/backend/streams.mdx # docs/realtime/overview.mdx # docs/realtime/react-hooks/triggering.mdx # docs/realtime/react-hooks/use-wait-token.mdx # docs/realtime/subscribe-to-batch.mdx # docs/realtime/subscribe-to-run.mdx # docs/realtime/subscribe-to-runs-with-tag.mdx # docs/triggering.mdx # docs/upgrade-to-v4.mdx
2 parents d673235 + 26d4d08 commit 482cda2

File tree

477 files changed

+25987
-12104
lines changed

Some content is hidden

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

477 files changed

+25987
-12104
lines changed

.changeset/afraid-waves-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Make the default of legacyDevProcessCwdBehaviour true instead of false (prevents breaking prismaExtension)

.changeset/beige-horses-juggle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Added experimental_devProcessCwdInBuildDir config option to opt-in to new process.cwd behavior when executing tasks in the dev CLI. Currently process.cwd maps to the "root" of your trigger.dev project (the directory that contains your trigger.config.ts file). Setting experimental_devProcessCwdInBuildDir to true changes process.cwd to instead be the temporary build directory inside of the .trigger directory.

.changeset/big-garlics-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
fix: importing from runEngine/index.js breaks non-node runtimes

.changeset/clean-beans-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
fix: prevent circular reference errors on task indexing when using schemaTask

.changeset/cyan-news-design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Allow any runs to finish after SIGTERM but disable warm starts

.changeset/early-points-jam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Gracefully shutdown task run processes using SIGTERM followed by SIGKILL after a 1s timeout. This also prevents cancelled or completed runs from leaving orphaned Ttask run processes behind

.changeset/empty-dolls-judge.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Switch to profile after successful login

.changeset/famous-clocks-thank.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
feat: Support AI SDK 5.0. `ai.tool` now accepts either a schemaTask or a task with a provided jsonSchema

.changeset/five-nails-whisper.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
External Trace Correlation & OpenTelemetry Package Updates.
6+
7+
| Package | Previous Version | New Version | Change Type |
8+
|---------|------------------|-------------|-------------|
9+
| `@opentelemetry/api` | 1.9.0 | 1.9.0 | No change (stable API) |
10+
| `@opentelemetry/api-logs` | 0.52.1 | 0.203.0 | Major update |
11+
| `@opentelemetry/core` | - | 2.0.1 | New dependency |
12+
| `@opentelemetry/exporter-logs-otlp-http` | 0.52.1 | 0.203.0 | Major update |
13+
| `@opentelemetry/exporter-trace-otlp-http` | 0.52.1 | 0.203.0 | Major update |
14+
| `@opentelemetry/instrumentation` | 0.52.1 | 0.203.0 | Major update |
15+
| `@opentelemetry/instrumentation-fetch` | 0.52.1 | 0.203.0 | Major update |
16+
| `@opentelemetry/resources` | 1.25.1 | 2.0.1 | Major update |
17+
| `@opentelemetry/sdk-logs` | 0.52.1 | 0.203.0 | Major update |
18+
| `@opentelemetry/sdk-node` | 0.52.1 | - | Removed (functionality consolidated) |
19+
| `@opentelemetry/sdk-trace-base` | 1.25.1 | 2.0.1 | Major update |
20+
| `@opentelemetry/sdk-trace-node` | 1.25.1 | 2.0.1 | Major update |
21+
| `@opentelemetry/semantic-conventions` | 1.25.1 | 1.36.0 | Minor update |
22+
23+
### External trace correlation and propagation
24+
25+
We will now correlate your external traces with trigger.dev traces and logs when using our external exporters:
26+
27+
```ts
28+
import { defineConfig } from "@trigger.dev/sdk";
29+
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
30+
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
31+
32+
export default defineConfig({
33+
project: process.env.TRIGGER_PROJECT_REF,
34+
dirs: ["./src/trigger"],
35+
telemetry: {
36+
logExporters: [
37+
new OTLPLogExporter({
38+
url: "https://api.axiom.co/v1/logs",
39+
headers: {
40+
Authorization: `Bearer ${process.env.AXIOM_TOKEN}`,
41+
"X-Axiom-Dataset": "test",
42+
},
43+
}),
44+
],
45+
exporters: [
46+
new OTLPTraceExporter({
47+
url: "https://api.axiom.co/v1/traces",
48+
headers: {
49+
Authorization: `Bearer ${process.env.AXIOM_TOKEN}`,
50+
"X-Axiom-Dataset": "test",
51+
},
52+
}),
53+
],
54+
},
55+
maxDuration: 3600,
56+
});
57+
```
58+
59+
You can also now propagate your external trace context when calling back into your own backend infra from inside a trigger.dev task:
60+
61+
```ts
62+
import { otel, task } from "@trigger.dev/sdk";
63+
import { context, propagation } from "@opentelemetry/api";
64+
65+
async function callNextjsApp() {
66+
return await otel.withExternalTrace(async () => {
67+
const headersObject = {};
68+
69+
// Now context.active() refers to your external trace context
70+
propagation.inject(context.active(), headersObject);
71+
72+
const result = await fetch("http://localhost:3000/api/demo-call-from-trigger", {
73+
headers: new Headers(headersObject),
74+
method: "POST",
75+
body: JSON.stringify({
76+
message: "Hello from Trigger.dev",
77+
}),
78+
});
79+
80+
return result.json();
81+
});
82+
}
83+
84+
export const myTask = task({
85+
id: "my-task",
86+
run: async (payload: any) => {
87+
await callNextjsApp()
88+
}
89+
})
90+
```
91+
92+

.changeset/fluffy-mirrors-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Add jsonSchema support when indexing tasks

0 commit comments

Comments
 (0)