Skip to content

Commit f9ec66c

Browse files
v3: new build system (#1265)
* upgrade @opentelemetry packages to the latest versions * remove v2 only packages, will be moved to a dedicated repo * remove more v2 code and run pnpm install * use the npm yalt package in the webapp * convert @trigger.dev/core to tshy * Switch from jest to vitest in @trigger.dev/core * Fixed core test * move core-backend code into core subpath export * convert @trigger.dev/sdk to tshy * Removed hono * move core-apps to core/v3/apps, remove core-apps, start converting cli-v3 * Fix up some of the commands * cli now building and loadable * using package-json-from-dist to get package version now in core and cli * dev command WIP * cleaned up some repetition and structure of the entry point stuff * bringing back the background worker stuff * Indexing of the v3 catalog * getting closer to executing dev runs... * centralize dev logging using event emitter * Move indexing to it’s own entry point, simplify code * dev runs working * Get instrumentation to work with openai * debugging achieved internally * provide worker files as part of the worker creation on the server * support for cjs and esm javascript * Fixed timeout * worker manifest now has the config path * auto-upgrade config to non-deprecated alternatives * Adding package preview release * deployment WIP * improve the syncEnvVars output and adapt resolveEnvVars * WIP bun runtime * WIP bun support * seed tasks with the machine preset if listed in the config * deploy run executions WIP, extracted TaskRunProcess into 1 place * deployed tasks running and executing 🎉 * support for waits and better flushing & process cleanup * Fixed the heartbeating * Better warning messages * Improve and unify the indexing between dev and deploy * Support for external deps that need node-gyp to build * build extensions can now install custom packages and run instructions in the image. Also prisma extension now works and also works with multiple schema files * Add back in the main/types/module to sdk * dev no longer is Ink/React, grace period for disconnections in dev * Fix the changeset config * More changeset fixes * Remove config packages * More changeset fixes * Fixed typescript issues (needed to revert back to zod 3.22.3 * Fix pr_checks workflow * Remove the prepare script * Fixed tests and package versions * Remove cli test script * Remove packages from tailwind watch paths * Add repo to public packages * Just commit the generated files and do the building at dev time * Try and get pkg.pr.new working * Try again * Fix emitDecoratorMetadata importing named export from typescript * config file backwards compat with export const config * Fixed issue where import errors weren’t coming through * p-retry is a prod dep * typescript needs to be a prod dependency for emitDecoratorMetadata * Add better debug logging to help track down import-in-the-middle bug * An external is only considered resolvable if it resolves to the same path as the collected external * Fix runtime checks to allow >=18.20 * Move extensions to a new build package * Fixed building packages in dockerfile * Remove the e2e test from publish workflow for now * Don’t treat pkg.pr.new versions has needing upgrading * making sure config handleError works, and discovered path aliases don’t work in config files * Strip empty string env vars so they accidentally override real values * Couple of things * Update version to use preview instead of beta * Hopefully fix re-attempts with >30s delay * Match socket emit messages to current latest in main * Initial guide * Go back to beta * Go back to the preview, and update guide to use pr preview tags * Go back to beta --------- Co-authored-by: Matt Aitken <[email protected]>
1 parent 2cd8658 commit f9ec66c

File tree

1,055 files changed

+33652
-320705
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,055 files changed

+33652
-320705
lines changed

.changeset/config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"webapp",
1717
"emails",
1818
"proxy",
19-
"yalt",
2019
"@trigger.dev/database",
2120
"coordinator",
2221
"docker-provider",
23-
"kubernetes-provider"
22+
"kubernetes-provider",
23+
"@trigger.dev/otlp-importer"
2424
],
2525
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
2626
"onlyUpdatePeerDependentsWhenOutOfRange": true

.changeset/eleven-tips-learn.md

+7
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+
New Build System

.changeset/pre.json

+2-30
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,12 @@
88
"proxy": "0.0.11",
99
"webapp": "1.0.0",
1010
"yalt": "0.0.1",
11-
"@trigger.dev/airtable": "2.3.18",
12-
"@trigger.dev/github": "2.3.18",
13-
"@trigger.dev/linear": "2.3.18",
14-
"@trigger.dev/openai": "2.3.18",
15-
"@trigger.dev/plain": "2.3.18",
16-
"@trigger.dev/replicate": "2.3.18",
17-
"@trigger.dev/resend": "2.3.18",
18-
"@trigger.dev/sendgrid": "2.3.18",
19-
"@trigger.dev/shopify": "2.3.18",
20-
"@trigger.dev/slack": "2.3.18",
21-
"@trigger.dev/stripe": "2.3.18",
22-
"@trigger.dev/supabase": "2.3.18",
23-
"@trigger.dev/typeform": "2.3.18",
24-
"@trigger.dev/astro": "2.3.18",
25-
"@trigger.dev/cli": "2.3.18",
2611
"trigger.dev": "2.3.18",
2712
"@trigger.dev/core": "2.3.18",
28-
"@trigger.dev/core-apps": "0.0.0",
29-
"@trigger.dev/core-backend": "2.3.18",
3013
"@trigger.dev/database": "0.0.1",
3114
"emails": "1.0.0",
32-
"@trigger.dev/eslint-plugin": "2.3.18",
33-
"@trigger.dev/express": "2.3.18",
34-
"@trigger.dev/hono": "2.3.18",
35-
"@trigger.dev/integration-kit": "2.3.18",
36-
"@trigger.dev/nestjs": "2.3.18",
37-
"@trigger.dev/nextjs": "2.3.18",
3815
"@trigger.dev/otlp-importer": "2.3.11",
39-
"@trigger.dev/react": "2.3.18",
40-
"@trigger.dev/remix": "2.3.18",
41-
"@trigger.dev/sveltekit": "2.3.18",
42-
"@trigger.dev/testing": "2.3.18",
43-
"@trigger.dev/sdk": "2.3.18",
44-
"@trigger.dev/yalt": "2.3.18"
16+
"@trigger.dev/sdk": "2.3.18"
4517
},
4618
"changesets": [
4719
"afraid-sheep-joke",
@@ -197,4 +169,4 @@
197169
"young-jars-wait",
198170
"young-snails-sell"
199171
]
200-
}
172+
}

.changeset/silly-suits-switch.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
"@trigger.dev/otlp-importer": patch
32
"trigger.dev": patch
43
---
54

.changeset/sweet-lizards-press.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
"trigger.dev": major
33
"@trigger.dev/core": major
4-
"@trigger.dev/otlp-importer": major
54
"@trigger.dev/sdk": major
65
---
76

.changeset/warm-nails-jump.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/build": patch
3+
---
4+
5+
Added new @trigger.dev/build package that currently has all the build extensions

.configs/tsconfig.base.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
5+
"module": "NodeNext",
6+
"moduleResolution": "NodeNext",
7+
"moduleDetection": "force",
8+
"verbatimModuleSyntax": false,
9+
"jsx": "react",
10+
11+
"strict": true,
12+
"alwaysStrict": true,
13+
"strictPropertyInitialization": false,
14+
"skipLibCheck": true,
15+
"forceConsistentCasingInFileNames": true,
16+
"noUnusedLocals": false,
17+
"noUnusedParameters": false,
18+
"noImplicitAny": true,
19+
"noImplicitReturns": true,
20+
"noImplicitThis": true,
21+
22+
"noFallthroughCasesInSwitch": true,
23+
"resolveJsonModule": true,
24+
25+
"removeComments": false,
26+
"esModuleInterop": true,
27+
"emitDecoratorMetadata": false,
28+
"experimentalDecorators": false,
29+
"downlevelIteration": true,
30+
"isolatedModules": true,
31+
"noUncheckedIndexedAccess": true,
32+
33+
"pretty": true,
34+
"customConditions": ["@triggerdotdev/source"]
35+
}
36+
}

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ packages/\*\*/dist
3737
.vercel
3838
.cache
3939
.output
40+
.trigger
4041
apps/\*\*/public/build
4142

4243
cypress/screenshots

.github/workflows/e2e.yml

-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ jobs:
7676
node-version: 20.11.1
7777
cache: "pnpm"
7878

79-
- name: Install Protoc
80-
uses: arduino/setup-protoc@v3
81-
with:
82-
repo-token: ${{ secrets.GITHUB_TOKEN }}
83-
8479
- name: 📥 Download deps
8580
run: pnpm install --frozen-lockfile
8681

.github/workflows/pr_checks.yml

+33-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ name: 🤖 PR Checks
22

33
on:
44
pull_request:
5-
branches:
6-
- main
7-
paths-ignore:
8-
- "**.md"
9-
- "**.mdx"
10-
- ".github/CODEOWNERS"
11-
- ".github/ISSUE_TEMPLATE/**"
5+
types: [opened, synchronize, reopened]
126

137
concurrency:
148
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -27,6 +21,38 @@ jobs:
2721
uses: ./.github/workflows/unit-tests.yml
2822
secrets: inherit
2923

24+
preview-release:
25+
name: Preview Release
26+
needs: [typecheck, units]
27+
if: |
28+
github.repository == 'triggerdotdev/trigger.dev'
29+
runs-on: buildjet-8vcpu-ubuntu-2204
30+
steps:
31+
- name: ⬇️ Checkout repo
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0
35+
36+
- name: ⎔ Setup pnpm
37+
uses: pnpm/action-setup@v4
38+
with:
39+
version: 8.15.5
40+
41+
- name: ⎔ Setup node
42+
uses: buildjet/setup-node@v3
43+
with:
44+
node-version: 20.11.1
45+
cache: "pnpm"
46+
47+
- name: 📥 Download deps
48+
run: pnpm install --frozen-lockfile
49+
50+
- name: 🏗️ Build
51+
run: pnpm run build --filter "@trigger.dev/*" --filter "trigger.dev"
52+
53+
- name: ⚡ publish preview release
54+
run: npx pkg-pr-new publish --no-template $(ls -d ./packages/*)
55+
3056
# e2e:
3157
# uses: ./.github/workflows/e2e.yml
3258
# with:

.github/workflows/publish.yml

-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ jobs:
4949
uses: ./.github/workflows/unit-tests.yml
5050
secrets: inherit
5151

52-
e2e:
53-
uses: ./.github/workflows/e2e.yml
54-
with:
55-
package: cli-v3
56-
secrets: inherit
57-
5852
publish:
5953
needs: [typecheck, units]
6054
uses: ./.github/workflows/publish-docker.yml

.github/workflows/release.yml

-5
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ jobs:
3838
node-version: 20.11.1
3939
cache: "pnpm"
4040

41-
- name: Install Protoc
42-
uses: arduino/setup-protoc@v3
43-
with:
44-
repo-token: ${{ secrets.GITHUB_TOKEN }}
45-
4641
- name: 📥 Download deps
4742
run: pnpm install --frozen-lockfile
4843

.github/workflows/typecheck.yml

-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ jobs:
2222
node-version: 20.11.1
2323
cache: "pnpm"
2424

25-
- name: Install Protoc
26-
uses: arduino/setup-protoc@v3
27-
with:
28-
repo-token: ${{ secrets.GITHUB_TOKEN }}
29-
3025
- name: 📥 Download deps
3126
run: pnpm install --frozen-lockfile
3227

.github/workflows/unit-tests.yml

-15
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,6 @@ jobs:
2222
node-version: 20.11.1
2323
cache: "pnpm"
2424

25-
- name: Install Protoc
26-
uses: arduino/setup-protoc@v3
27-
with:
28-
repo-token: ${{ secrets.GITHUB_TOKEN }}
29-
30-
- name: ⎔ Setup Deno
31-
uses: denoland/setup-deno@v1
32-
with:
33-
deno-version: v1.x
34-
35-
- name: ⎔ Setup bun
36-
uses: oven-sh/setup-bun@v1
37-
with:
38-
bun-version: "1.0.15"
39-
4025
- name: 📥 Download deps
4126
run: pnpm install --frozen-lockfile
4227

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ coverage
1212
# next.js
1313
.next/
1414
out/
15-
build
1615
dist
1716
packages/**/dist
1817

@@ -54,4 +53,5 @@ apps/**/public/build
5453
/playwright/.cache/
5554

5655
.cosine
57-
.trigger/
56+
.trigger/
57+
.tshy*

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ tailwind.css
77
**/.react-email/
88
**/storybook-static/
99
**/.changeset/
10-
**/build/
1110
**/dist/

.vscode/launch.json

+18-2
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,31 @@
3333
"type": "node-terminal",
3434
"request": "launch",
3535
"name": "Debug V3 Dev CLI",
36-
"command": "pnpm exec triggerdev dev --log-level debug",
36+
"command": "pnpm exec triggerdev dev",
3737
"cwd": "${workspaceFolder}/references/v3-catalog",
3838
"sourceMaps": true
3939
},
4040
{
4141
"type": "node-terminal",
4242
"request": "launch",
4343
"name": "Debug V3 Deploy CLI",
44-
"command": "pnpm exec triggerdev deploy",
44+
"command": "pnpm exec triggerdev deploy --self-hosted --load-image",
45+
"cwd": "${workspaceFolder}/references/v3-catalog",
46+
"sourceMaps": true
47+
},
48+
{
49+
"type": "node-terminal",
50+
"request": "launch",
51+
"name": "Debug V3 list-profiles CLI",
52+
"command": "pnpm exec triggerdev list-profiles --log-level debug",
53+
"cwd": "${workspaceFolder}/references/v3-catalog",
54+
"sourceMaps": true
55+
},
56+
{
57+
"type": "node-terminal",
58+
"request": "launch",
59+
"name": "Debug V3 update CLI",
60+
"command": "pnpm exec triggerdev update",
4561
"cwd": "${workspaceFolder}/references/v3-catalog",
4662
"sourceMaps": true
4763
},

.vscode/settings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"deno.enablePaths": ["references/deno-reference", "runtime_tests/tests/deno"],
3-
"debug.toolBarLocation": "commandCenter"
3+
"debug.toolBarLocation": "commandCenter",
4+
"typescript.tsdk": "node_modules/typescript/lib",
5+
"search.exclude": {
6+
"**/node_modules/**": true,
7+
"packages/cli-v3/e2e": true
8+
}
49
}

apps/coordinator/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"license": "MIT",
1818
"dependencies": {
1919
"@trigger.dev/core": "workspace:*",
20-
"@trigger.dev/core-apps": "workspace:*",
2120
"execa": "^8.0.1",
2221
"nanoid": "^5.0.6",
2322
"prom-client": "^15.1.0",

apps/coordinator/src/checkpointer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ExponentialBackoff } from "@trigger.dev/core-apps/backoff";
2-
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core-apps/checkpoints";
3-
import { SimpleLogger } from "@trigger.dev/core-apps/logger";
1+
import { ExponentialBackoff } from "@trigger.dev/core/v3/apps";
2+
import { testDockerCheckpoint, isExecaChildProcess } from "@trigger.dev/core/v3/apps";
3+
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
44
import { $ } from "execa";
55
import { nanoid } from "nanoid";
66
import fs from "node:fs/promises";

apps/coordinator/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
} from "@trigger.dev/core/v3";
1111
import { ZodNamespace } from "@trigger.dev/core/v3/zodNamespace";
1212
import { ZodSocketConnection } from "@trigger.dev/core/v3/zodSocket";
13-
import { HttpReply, getTextBody } from "@trigger.dev/core-apps/http";
14-
import { SimpleLogger } from "@trigger.dev/core-apps/logger";
13+
import { HttpReply, getTextBody } from "@trigger.dev/core/v3/apps";
14+
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
1515
import { ChaosMonkey } from "./chaosMonkey";
1616
import { Checkpointer } from "./checkpointer";
1717

apps/coordinator/tsconfig.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
"skipLibCheck": true,
1212
"paths": {
1313
"@trigger.dev/core/v3": ["../../packages/core/src/v3"],
14-
"@trigger.dev/core/v3/*": ["../../packages/core/src/v3/*"],
15-
"@trigger.dev/core-apps": ["../../packages/core-apps/src"],
16-
"@trigger.dev/core-apps/*": ["../../packages/core-apps/src/*"]
14+
"@trigger.dev/core/v3/*": ["../../packages/core/src/v3/*"]
1715
}
1816
}
1917
}

apps/docker-provider/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"license": "MIT",
1818
"dependencies": {
1919
"@trigger.dev/core": "workspace:*",
20-
"@trigger.dev/core-apps": "workspace:*",
2120
"execa": "^8.0.1"
2221
},
2322
"devDependencies": {

apps/docker-provider/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
TaskOperationsCreateOptions,
66
TaskOperationsIndexOptions,
77
TaskOperationsRestoreOptions,
8-
} from "@trigger.dev/core-apps/provider";
9-
import { SimpleLogger } from "@trigger.dev/core-apps/logger";
10-
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core-apps/checkpoints";
8+
} from "@trigger.dev/core/v3/apps";
9+
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
10+
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core/v3/apps";
1111
import { setTimeout } from "node:timers/promises";
1212
import { PostStartCauses, PreStopCauses } from "@trigger.dev/core/v3";
1313

0 commit comments

Comments
 (0)