Skip to content

v3: new build system #1265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 81 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
3eb1678
upgrade @opentelemetry packages to the latest versions
ericallam Aug 5, 2024
d71925f
remove v2 only packages, will be moved to a dedicated repo
ericallam Aug 5, 2024
835c9cb
remove more v2 code and run pnpm install
ericallam Aug 5, 2024
8b9caee
use the npm yalt package in the webapp
ericallam Aug 5, 2024
cadf66c
convert @trigger.dev/core to tshy
ericallam Aug 5, 2024
d6ca192
Switch from jest to vitest in @trigger.dev/core
ericallam Aug 6, 2024
b2852ab
Fixed core test
ericallam Aug 6, 2024
cc7a438
move core-backend code into core subpath export
ericallam Aug 6, 2024
e6c8b45
convert @trigger.dev/sdk to tshy
ericallam Aug 6, 2024
4febab4
Removed hono
ericallam Aug 6, 2024
7caba3a
move core-apps to core/v3/apps, remove core-apps, start converting cl…
ericallam Aug 6, 2024
1125d61
Fix up some of the commands
ericallam Aug 6, 2024
a2eb896
cli now building and loadable
ericallam Aug 6, 2024
ab3a642
using package-json-from-dist to get package version now in core and cli
ericallam Aug 6, 2024
f089871
dev command WIP
ericallam Aug 7, 2024
5bc482e
cleaned up some repetition and structure of the entry point stuff
ericallam Aug 7, 2024
98046c5
bringing back the background worker stuff
ericallam Aug 7, 2024
de81f04
Indexing of the v3 catalog
ericallam Aug 8, 2024
ff9013b
getting closer to executing dev runs...
ericallam Aug 8, 2024
e37d8d4
centralize dev logging using event emitter
ericallam Aug 8, 2024
6bf6583
Move indexing to it’s own entry point, simplify code
ericallam Aug 9, 2024
7130e30
dev runs working
ericallam Aug 9, 2024
510ed6b
Get instrumentation to work with openai
ericallam Aug 9, 2024
2b85d53
debugging achieved internally
ericallam Aug 9, 2024
6dea6e1
provide worker files as part of the worker creation on the server
ericallam Aug 11, 2024
d109300
support for cjs and esm javascript
ericallam Aug 11, 2024
8caebdc
Fixed timeout
ericallam Aug 12, 2024
de69e72
worker manifest now has the config path
ericallam Aug 12, 2024
ffebbb8
auto-upgrade config to non-deprecated alternatives
ericallam Aug 12, 2024
104301a
Adding package preview release
ericallam Aug 12, 2024
059f188
deployment WIP
ericallam Aug 17, 2024
e137013
improve the syncEnvVars output and adapt resolveEnvVars
ericallam Aug 17, 2024
41a046c
WIP bun runtime
ericallam Aug 18, 2024
a7fa91f
WIP bun support
ericallam Aug 19, 2024
cc8eb34
seed tasks with the machine preset if listed in the config
ericallam Aug 19, 2024
6cabc8d
deploy run executions WIP, extracted TaskRunProcess into 1 place
ericallam Aug 19, 2024
36b6f66
deployed tasks running and executing 🎉
ericallam Aug 20, 2024
5d6488e
support for waits and better flushing & process cleanup
ericallam Aug 20, 2024
4c21597
Fixed the heartbeating
ericallam Aug 20, 2024
61d9fd3
Better warning messages
ericallam Aug 20, 2024
ac22210
Improve and unify the indexing between dev and deploy
ericallam Aug 21, 2024
97fce66
Support for external deps that need node-gyp to build
ericallam Aug 21, 2024
cacd13b
build extensions can now install custom packages and run instructions…
ericallam Aug 21, 2024
b945e24
Add back in the main/types/module to sdk
ericallam Aug 21, 2024
a86cbbf
dev no longer is Ink/React, grace period for disconnections in dev
ericallam Aug 21, 2024
15b6dce
Fix the changeset config
ericallam Aug 22, 2024
a4565bb
More changeset fixes
ericallam Aug 22, 2024
30b2b24
Remove config packages
ericallam Aug 22, 2024
67759e6
More changeset fixes
ericallam Aug 22, 2024
2fd5e23
Fixed typescript issues (needed to revert back to zod 3.22.3
ericallam Aug 22, 2024
81d9a04
Fix pr_checks workflow
ericallam Aug 22, 2024
08daf28
Remove the prepare script
ericallam Aug 22, 2024
7a8b29e
Fixed tests and package versions
ericallam Aug 22, 2024
d4f8bb1
Remove cli test script
ericallam Aug 22, 2024
ecf8542
Remove packages from tailwind watch paths
ericallam Aug 22, 2024
b6680ac
Add repo to public packages
ericallam Aug 22, 2024
0d25ad1
Just commit the generated files and do the building at dev time
ericallam Aug 22, 2024
2d99afd
Try and get pkg.pr.new working
ericallam Aug 22, 2024
8767553
Try again
ericallam Aug 22, 2024
8158ad0
Fix emitDecoratorMetadata importing named export from typescript
ericallam Aug 22, 2024
047ed78
config file backwards compat with export const config
ericallam Aug 22, 2024
c89680d
Fixed issue where import errors weren’t coming through
ericallam Aug 22, 2024
ebdc33b
p-retry is a prod dep
ericallam Aug 22, 2024
c5d0741
typescript needs to be a prod dependency for emitDecoratorMetadata
ericallam Aug 22, 2024
9ac57fd
Add better debug logging to help track down import-in-the-middle bug
ericallam Aug 22, 2024
aaa68ad
An external is only considered resolvable if it resolves to the same …
ericallam Aug 22, 2024
7f69664
Fix runtime checks to allow >=18.20
ericallam Aug 22, 2024
8d2428d
Move extensions to a new build package
ericallam Aug 22, 2024
c7c7ced
Fixed building packages in dockerfile
ericallam Aug 23, 2024
e13c322
Remove the e2e test from publish workflow for now
ericallam Aug 23, 2024
86b09f7
Don’t treat pkg.pr.new versions has needing upgrading
ericallam Aug 23, 2024
cb625d9
making sure config handleError works, and discovered path aliases don…
ericallam Aug 23, 2024
e34141d
Strip empty string env vars so they accidentally override real values
ericallam Aug 23, 2024
a50fc0e
Couple of things
ericallam Aug 23, 2024
2b41f51
Update version to use preview instead of beta
ericallam Aug 23, 2024
53ab5a8
Hopefully fix re-attempts with >30s delay
ericallam Aug 23, 2024
3fded0a
Match socket emit messages to current latest in main
ericallam Aug 23, 2024
b5e6033
Initial guide
ericallam Aug 23, 2024
1fad7bf
Go back to beta
ericallam Aug 23, 2024
600511e
Go back to the preview, and update guide to use pr preview tags
ericallam Aug 23, 2024
b43ff4e
Go back to beta
matt-aitken Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"webapp",
"emails",
"proxy",
"yalt",
"@trigger.dev/database",
"coordinator",
"docker-provider",
"kubernetes-provider"
"kubernetes-provider",
"@trigger.dev/otlp-importer"
],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
Expand Down
7 changes: 7 additions & 0 deletions .changeset/eleven-tips-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@trigger.dev/sdk": patch
"trigger.dev": patch
"@trigger.dev/core": patch
---

New Build System
32 changes: 2 additions & 30 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,12 @@
"proxy": "0.0.11",
"webapp": "1.0.0",
"yalt": "0.0.1",
"@trigger.dev/airtable": "2.3.18",
"@trigger.dev/github": "2.3.18",
"@trigger.dev/linear": "2.3.18",
"@trigger.dev/openai": "2.3.18",
"@trigger.dev/plain": "2.3.18",
"@trigger.dev/replicate": "2.3.18",
"@trigger.dev/resend": "2.3.18",
"@trigger.dev/sendgrid": "2.3.18",
"@trigger.dev/shopify": "2.3.18",
"@trigger.dev/slack": "2.3.18",
"@trigger.dev/stripe": "2.3.18",
"@trigger.dev/supabase": "2.3.18",
"@trigger.dev/typeform": "2.3.18",
"@trigger.dev/astro": "2.3.18",
"@trigger.dev/cli": "2.3.18",
"trigger.dev": "2.3.18",
"@trigger.dev/core": "2.3.18",
"@trigger.dev/core-apps": "0.0.0",
"@trigger.dev/core-backend": "2.3.18",
"@trigger.dev/database": "0.0.1",
"emails": "1.0.0",
"@trigger.dev/eslint-plugin": "2.3.18",
"@trigger.dev/express": "2.3.18",
"@trigger.dev/hono": "2.3.18",
"@trigger.dev/integration-kit": "2.3.18",
"@trigger.dev/nestjs": "2.3.18",
"@trigger.dev/nextjs": "2.3.18",
"@trigger.dev/otlp-importer": "2.3.11",
"@trigger.dev/react": "2.3.18",
"@trigger.dev/remix": "2.3.18",
"@trigger.dev/sveltekit": "2.3.18",
"@trigger.dev/testing": "2.3.18",
"@trigger.dev/sdk": "2.3.18",
"@trigger.dev/yalt": "2.3.18"
"@trigger.dev/sdk": "2.3.18"
},
"changesets": [
"afraid-sheep-joke",
Expand Down Expand Up @@ -197,4 +169,4 @@
"young-jars-wait",
"young-snails-sell"
]
}
}
1 change: 0 additions & 1 deletion .changeset/silly-suits-switch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
"@trigger.dev/otlp-importer": patch
"trigger.dev": patch
---

Expand Down
1 change: 0 additions & 1 deletion .changeset/sweet-lizards-press.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
"trigger.dev": major
"@trigger.dev/core": major
"@trigger.dev/otlp-importer": major
"@trigger.dev/sdk": major
---

Expand Down
5 changes: 5 additions & 0 deletions .changeset/warm-nails-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/build": patch
---

Added new @trigger.dev/build package that currently has all the build extensions
36 changes: 36 additions & 0 deletions .configs/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"compilerOptions": {
"target": "es2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"moduleDetection": "force",
"verbatimModuleSyntax": false,
"jsx": "react",

"strict": true,
"alwaysStrict": true,
"strictPropertyInitialization": false,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,

"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,

"removeComments": false,
"esModuleInterop": true,
"emitDecoratorMetadata": false,
"experimentalDecorators": false,
"downlevelIteration": true,
"isolatedModules": true,
"noUncheckedIndexedAccess": true,

"pretty": true,
"customConditions": ["@triggerdotdev/source"]
}
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ packages/\*\*/dist
.vercel
.cache
.output
.trigger
apps/\*\*/public/build

cypress/screenshots
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ jobs:
node-version: 20.11.1
cache: "pnpm"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

Expand Down
40 changes: 33 additions & 7 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: 🤖 PR Checks

on:
pull_request:
branches:
- main
paths-ignore:
- "**.md"
- "**.mdx"
- ".github/CODEOWNERS"
- ".github/ISSUE_TEMPLATE/**"
types: [opened, synchronize, reopened]

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

preview-release:
name: Preview Release
needs: [typecheck, units]
if: |
github.repository == 'triggerdotdev/trigger.dev'
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: ⎔ Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.5

- name: ⎔ Setup node
uses: buildjet/setup-node@v3
with:
node-version: 20.11.1
cache: "pnpm"

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

- name: 🏗️ Build
run: pnpm run build --filter "@trigger.dev/*" --filter "trigger.dev"

- name: ⚡ publish preview release
run: npx pkg-pr-new publish --no-template $(ls -d ./packages/*)

# e2e:
# uses: ./.github/workflows/e2e.yml
# with:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ jobs:
uses: ./.github/workflows/unit-tests.yml
secrets: inherit

e2e:
uses: ./.github/workflows/e2e.yml
with:
package: cli-v3
secrets: inherit

publish:
needs: [typecheck, units]
uses: ./.github/workflows/publish-docker.yml
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ jobs:
node-version: 20.11.1
cache: "pnpm"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ jobs:
node-version: 20.11.1
cache: "pnpm"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ jobs:
node-version: 20.11.1
cache: "pnpm"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: ⎔ Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: ⎔ Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: "1.0.15"

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ coverage
# next.js
.next/
out/
build
dist
packages/**/dist

Expand Down Expand Up @@ -54,4 +53,5 @@ apps/**/public/build
/playwright/.cache/

.cosine
.trigger/
.trigger/
.tshy*
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ tailwind.css
**/.react-email/
**/storybook-static/
**/.changeset/
**/build/
**/dist/
20 changes: 18 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,31 @@
"type": "node-terminal",
"request": "launch",
"name": "Debug V3 Dev CLI",
"command": "pnpm exec triggerdev dev --log-level debug",
"command": "pnpm exec triggerdev dev",
"cwd": "${workspaceFolder}/references/v3-catalog",
"sourceMaps": true
},
{
"type": "node-terminal",
"request": "launch",
"name": "Debug V3 Deploy CLI",
"command": "pnpm exec triggerdev deploy",
"command": "pnpm exec triggerdev deploy --self-hosted --load-image",
"cwd": "${workspaceFolder}/references/v3-catalog",
"sourceMaps": true
},
{
"type": "node-terminal",
"request": "launch",
"name": "Debug V3 list-profiles CLI",
"command": "pnpm exec triggerdev list-profiles --log-level debug",
"cwd": "${workspaceFolder}/references/v3-catalog",
"sourceMaps": true
},
{
"type": "node-terminal",
"request": "launch",
"name": "Debug V3 update CLI",
"command": "pnpm exec triggerdev update",
"cwd": "${workspaceFolder}/references/v3-catalog",
"sourceMaps": true
},
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"deno.enablePaths": ["references/deno-reference", "runtime_tests/tests/deno"],
"debug.toolBarLocation": "commandCenter"
"debug.toolBarLocation": "commandCenter",
"typescript.tsdk": "node_modules/typescript/lib",
"search.exclude": {
"**/node_modules/**": true,
"packages/cli-v3/e2e": true
}
}
1 change: 0 additions & 1 deletion apps/coordinator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"license": "MIT",
"dependencies": {
"@trigger.dev/core": "workspace:*",
"@trigger.dev/core-apps": "workspace:*",
"execa": "^8.0.1",
"nanoid": "^5.0.6",
"prom-client": "^15.1.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/coordinator/src/checkpointer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ExponentialBackoff } from "@trigger.dev/core-apps/backoff";
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core-apps/checkpoints";
import { SimpleLogger } from "@trigger.dev/core-apps/logger";
import { ExponentialBackoff } from "@trigger.dev/core/v3/apps";
import { testDockerCheckpoint, isExecaChildProcess } from "@trigger.dev/core/v3/apps";
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
import { $ } from "execa";
import { nanoid } from "nanoid";
import fs from "node:fs/promises";
Expand Down
4 changes: 2 additions & 2 deletions apps/coordinator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
} from "@trigger.dev/core/v3";
import { ZodNamespace } from "@trigger.dev/core/v3/zodNamespace";
import { ZodSocketConnection } from "@trigger.dev/core/v3/zodSocket";
import { HttpReply, getTextBody } from "@trigger.dev/core-apps/http";
import { SimpleLogger } from "@trigger.dev/core-apps/logger";
import { HttpReply, getTextBody } from "@trigger.dev/core/v3/apps";
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
import { ChaosMonkey } from "./chaosMonkey";
import { Checkpointer } from "./checkpointer";

Expand Down
4 changes: 1 addition & 3 deletions apps/coordinator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"skipLibCheck": true,
"paths": {
"@trigger.dev/core/v3": ["../../packages/core/src/v3"],
"@trigger.dev/core/v3/*": ["../../packages/core/src/v3/*"],
"@trigger.dev/core-apps": ["../../packages/core-apps/src"],
"@trigger.dev/core-apps/*": ["../../packages/core-apps/src/*"]
"@trigger.dev/core/v3/*": ["../../packages/core/src/v3/*"]
}
}
}
1 change: 0 additions & 1 deletion apps/docker-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"license": "MIT",
"dependencies": {
"@trigger.dev/core": "workspace:*",
"@trigger.dev/core-apps": "workspace:*",
"execa": "^8.0.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions apps/docker-provider/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
TaskOperationsCreateOptions,
TaskOperationsIndexOptions,
TaskOperationsRestoreOptions,
} from "@trigger.dev/core-apps/provider";
import { SimpleLogger } from "@trigger.dev/core-apps/logger";
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core-apps/checkpoints";
} from "@trigger.dev/core/v3/apps";
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core/v3/apps";
import { setTimeout } from "node:timers/promises";
import { PostStartCauses, PreStopCauses } from "@trigger.dev/core/v3";

Expand Down
Loading
Loading