Skip to content

Commit b69ef39

Browse files
authored
Merge branch 'main' into main
2 parents de0220b + 2dbc085 commit b69ef39

File tree

1,634 files changed

+114802
-82941
lines changed

Some content is hidden

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

1,634 files changed

+114802
-82941
lines changed

.changeset/blue-eyes-tickle.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
The dev command will now use the platform-provided engine URL

.changeset/breezy-turtles-talk.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@trigger.dev/react-hooks": patch
3+
"@trigger.dev/sdk": patch
4+
"trigger.dev": patch
5+
"@trigger.dev/build": patch
6+
"@trigger.dev/core": patch
7+
"@trigger.dev/rsc": patch
8+
---
9+
10+
Run Engine 2.0 (alpha)

.changeset/config.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
"access": "public",
1313
"baseBranch": "main",
1414
"updateInternalDependencies": "patch",
15-
"ignore": ["webapp", "proxy", "coordinator", "docker-provider", "kubernetes-provider"],
15+
"ignore": [
16+
"webapp",
17+
"coordinator",
18+
"docker-provider",
19+
"kubernetes-provider",
20+
"supervisor"
21+
],
1622
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
1723
"onlyUpdatePeerDependentsWhenOutOfRange": true
1824
}

.changeset/eighty-rings-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Configurable queue consumer count in supervisor session

.changeset/forty-windows-shop.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/four-needles-add.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@trigger.dev/redis-worker": major
3+
"@trigger.dev/react-hooks": major
4+
"@trigger.dev/sdk": major
5+
"trigger.dev": major
6+
"@trigger.dev/python": major
7+
"@trigger.dev/build": major
8+
"@trigger.dev/core": major
9+
"@trigger.dev/rsc": major
10+
---
11+
12+
Trigger.dev v4 release. Please see our upgrade to v4 docs to view the full changelog: https://trigger.dev/docs/upgrade-to-v4

.changeset/green-lions-relate.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+
The envvars.list() and retrieve() functions receive isSecret for each value. Secret values are always redacted.

.changeset/hip-cups-wave.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 issue where realtime streams would cut off after 5 minutes

.changeset/honest-files-decide.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+
Deprecate toolTask and replace with `ai.tool(mySchemaTask)`

.changeset/late-chairs-ring.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 init.ts in custom trigger dirs

.changeset/lemon-fireants-repair.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/lovely-toys-obey.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/moody-squids-count.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+
Init command will now correctly install v4-beta packages

.changeset/nice-colts-boil.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+
Improve warm start times by eagerly creating the child TaskRunProcess when a previous run as completed

.changeset/polite-impalas-care.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+
Fixes runLimiter check on #dequeueRuns

.changeset/polite-lies-fix.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+
Update nypm package to support test-based bun.lock files

.changeset/pre.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"mode": "pre",
3+
"tag": "v4-beta",
4+
"initialVersions": {
5+
"coordinator": "0.0.1",
6+
"docker-provider": "0.0.1",
7+
"kubernetes-provider": "0.0.1",
8+
"supervisor": "0.0.1",
9+
"webapp": "1.0.0",
10+
"@trigger.dev/build": "3.3.17",
11+
"trigger.dev": "3.3.17",
12+
"@trigger.dev/core": "3.3.17",
13+
"@trigger.dev/python": "3.3.17",
14+
"@trigger.dev/react-hooks": "3.3.17",
15+
"@trigger.dev/redis-worker": "3.3.17",
16+
"@trigger.dev/rsc": "3.3.17",
17+
"@trigger.dev/sdk": "3.3.17"
18+
},
19+
"changesets": [
20+
"blue-eyes-tickle",
21+
"breezy-turtles-talk",
22+
"eighty-rings-divide",
23+
"four-needles-add",
24+
"green-lions-relate",
25+
"hip-cups-wave",
26+
"honest-files-decide",
27+
"late-chairs-ring",
28+
"moody-squids-count",
29+
"nice-colts-boil",
30+
"polite-lies-fix",
31+
"red-wasps-cover",
32+
"shiny-kiwis-beam",
33+
"smart-coins-hammer",
34+
"sour-mirrors-accept",
35+
"tiny-buckets-teach",
36+
"tricky-houses-invite",
37+
"two-tigers-dream",
38+
"weak-jobs-hide"
39+
]
40+
}

.changeset/red-wasps-cover.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Suppress external instrumentation for fetch calls from ApiClient

.changeset/shiny-kiwis-beam.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+
Handle flush errors gracefully in dev

.changeset/smart-coins-hammer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
fix: Realtime streams: prevent enqueuing into closed ReadableStream

.changeset/sour-mirrors-accept.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Improve usage flushing

.changeset/tiny-buckets-teach.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 stalled run detection

.changeset/tricky-houses-invite.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Managed run controller performance and reliability improvements

.changeset/two-tigers-dream.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+
maintain proper context in metadata.root and parent getters

.changeset/weak-jobs-hide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
"trigger.dev": patch
4+
"@trigger.dev/core": patch
5+
---
6+
7+
v4: New lifecycle hooks

.changeset/wet-deers-think.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Fix QUEUED status snapshot handler

.configs/tsconfig.base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es2022",
4-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
4+
"lib": ["ES2022", "DOM", "DOM.Iterable", "DOM.AsyncIterable"],
55
"module": "NodeNext",
66
"moduleResolution": "NodeNext",
77
"moduleDetection": "force",
@@ -10,7 +10,7 @@
1010

1111
"strict": true,
1212
"alwaysStrict": true,
13-
"strictPropertyInitialization": false,
13+
"strictPropertyInitialization": true,
1414
"skipLibCheck": true,
1515
"forceConsistentCasingInFileNames": true,
1616
"noUnusedLocals": false,

.cursor/mcp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"mcpServers": {
3+
"trigger.dev": {
4+
"url": "http://localhost:3333/sse"
5+
}
6+
}
7+
}

.cursor/rules/executing-commands.mdc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
description: how to run commands in the monorepo
3+
globs:
4+
alwaysApply: true
5+
---
6+
Almost all commands in the monorepo should be executed when `pnpm run ...` from the root of the monorepo. For example, running tests for the `@internal/run-engine` internal package:
7+
8+
```
9+
pnpm run dev --filter webapp
10+
```
11+
12+
But often, when running tests, it's better to `cd` into the directory and then run tests:
13+
14+
```
15+
cd apps/webapp
16+
pnpm run test --run
17+
```
18+
19+
This way you can run for a single file easily:
20+
21+
```
22+
cd internal-packages/run-engine
23+
pnpm run test ./src/engine/tests/ttl.test.ts --run
24+
```

.cursor/rules/repo.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: understanding the structure of the monorepo
3+
globs:
4+
alwaysApply: true
5+
---
6+
We've documented the structure of our monorepo here: [repo.md](mdc:ai/references/repo.md)

.cursor/rules/webapp.mdc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
description: Making updates to the main trigger.dev remix webapp
3+
globs: apps/webapp/**/*.tsx,apps/webapp/**/*.ts
4+
alwaysApply: false
5+
---
6+
7+
The main trigger.dev webapp, which powers it's API and dashboard and makes up the docker image that is produced as an OSS image, is a Remix 2.1.0 app that uses an express server, written in TypeScript. The following subsystems are either included in the webapp or are used by the webapp in another part of the monorepo:
8+
9+
- `@trigger.dev/database` exports a Prisma 5.4.1 client that is used extensively in the webapp to access a PostgreSQL instance. The schema file is [schema.prisma](mdc:internal-packages/database/prisma/schema.prisma)
10+
- `@trigger.dev/core` is a published package and is used to share code between the `@trigger.dev/sdk` and the webapp. It includes functionality but also a load of Zod schemas for data validation. When importing from `@trigger.dev/core` in the webapp, we never import the root `@trigger.dev/core` path, instead we favor one of the subpath exports that you can find in [package.json](mdc:packages/core/package.json)
11+
- `@internal/run-engine` has all the code needed to trigger a run and take it through it's lifecycle to completion.
12+
- `@trigger.dev/redis-worker` is a custom redis based background job/worker system that's used in the webapp and also used inside the run engine.
13+
14+
## Environment variables and testing
15+
16+
In the webapp, all environment variables are accessed through the `env` export of [env.server.ts](mdc:apps/webapp/app/env.server.ts), instead of directly accessing `process.env`.
17+
18+
Ideally, the `env.server.ts` file would never be imported into a test file, either directly or indirectly. Tests should only imported classes and functions from a file matching `app/**/*.ts` of the webapp, and that file should not use environment variables, everything should be passed through as options instead. This "service/configuration" separation is important, and can be seen in a few places in the code for examples:
19+
20+
- [realtimeClient.server.ts](mdc:apps/webapp/app/services/realtimeClient.server.ts) is the testable service, and [realtimeClientGlobal.server.ts](mdc:apps/webapp/app/services/realtimeClientGlobal.server.ts) is the configuration
21+
22+
Also for writing tests in the webapp, checkout our [tests.md](mdc:ai/references/tests.md) guide
23+
24+
## Legacy run engine vs Run Engine 2.0
25+
26+
We originally the Trigger.dev "Run Engine" not as a single system, but just spread out all over the codebase, with no real separate or encapsulation. And we didn't even call it a "Run Engine". With Run Engine 2.0, we've completely rewritten big parts of the way the system works, and moved it over to an internal package called `@internal/run-engine`. So we've retroactively named the previous run engine "Legacy run engine". We're focused almost exclusively now on moving to Run Engine 2.0 and will be deprecating and removing the legacy run engine code eventually.
27+
28+
## Where to look for code
29+
30+
- The trigger API endpoint is [api.v1.tasks.$taskId.trigger.ts](mdc:apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts)
31+
- The batch trigger API endpoint is [api.v1.tasks.batch.ts](mdc:apps/webapp/app/routes/api.v1.tasks.batch.ts)
32+
- Setup code for the prisma client is in [db.server.ts](mdc:apps/webapp/app/db.server.ts)
33+
- The run engine is configured in [runEngine.server.ts](mdc:apps/webapp/app/v3/runEngine.server.ts)
34+
- All the "services" that are found in app/v3/services/**/*.server.ts
35+
- The code for the TaskEvent data, which is the otel data sent from tasks to our servers, is in both the [eventRepository.server.ts](mdc:apps/webapp/app/v3/eventRepository.server.ts) and also the [otlpExporter.server.ts](mdc:apps/webapp/app/v3/otlpExporter.server.ts). The otel endpoints which are hit from production and development otel exporters is [otel.v1.logs.ts](mdc:apps/webapp/app/routes/otel.v1.logs.ts) and [otel.v1.traces.ts](mdc:apps/webapp/app/routes/otel.v1.traces.ts)
36+
- We use "presenters" to move more complex loader code into a class, and you can find those are app/v3/presenters/**/*.server.ts
37+

0 commit comments

Comments
 (0)