448443a024
Bumps the internal/toolchain Node version to the latest 22.x LTS (`22.23.1`) and standardises it across the repo. Scope is the **platform toolchain + the repo's own runtime images** (all `20 → 22` *upgrades*, off the now-EOL node 20). ### Main changes - Node `20.20.2 → 22.23.1` across all CI workflows, `.nvmrc`, `CONTRIBUTING.md`, and the OSS `docker/Dockerfile` (digest-pinned). - `@types/node → 22.20.0` (root dep + pnpm `overrides`, so the whole workspace resolves to it); lockfile regenerated. - `sdk-compat` matrix: adds Node 24 + 26 (keeps 20, still in `engines`). - **App runtime images → node 22** (were on EOL node 20): `apps/coordinator` → `node:22.23.1-bookworm-slim`; `apps/docker-provider` + `apps/kubernetes-provider` → `node:22-alpine` (reusing the exact digest `apps/supervisor` already runs, so all four worker images are now identical). Stage aliases renamed off `node-20`. ### Possible issues / test notes - `@types/node` 22.x can surface new TS errors — typecheck (now on 22) is the gate. - **Smoke-test the v3 worker path** — `coordinator` (`crictl`/CRI calls) and the docker/kubernetes providers (talking to their daemons) now run on node 22 (alpine/musl for the providers). Upgrade off EOL so low-risk, but it's deployed runtime code with its own `publish-worker.yml` pipeline.
3.1 KiB
3.1 KiB
Guidance for Coding Agents
This repository is a pnpm monorepo managed with Turbo. It contains multiple apps and packages that make up the Trigger.dev platform and SDK.
Repository layout
apps/webapp– Remix application that serves as the main API and dashboard.apps/supervisor– Node application for executing built tasks.packages/*– Published packages such as@trigger.dev/sdk, the CLI (trigger.dev), and shared libraries.internal-packages/*– Internal-only packages used by the webapp and other apps.- Example/reference projects for manual testing live in a separate repo:
triggerdotdev/references. ai/references– Contains additional documentation including an overview (repo.md) and testing guidelines (tests.md).
See ai/references/repo.md for a more complete explanation of the workspaces.
Development setup
- Install dependencies with
pnpm i(pnpm10.33.2and Node.js22.23.1are required). - Copy
.env.exampleto.envand generate a random 16 byte hex string forENCRYPTION_KEY(openssl rand -hex 16). Update other secrets if needed. - Start the local services with Docker:
Add
pnpm run docker:full(pnpm run docker:full) for the optional observability + chaos tooling. Seedocker/docker-compose.extras.yml. - Run database migrations:
pnpm run db:migrate - Build the webapp, CLI and SDK packages:
pnpm run build --filter webapp && pnpm run build --filter trigger.dev && pnpm run build --filter @trigger.dev/sdk - Launch the development server:
The webapp runs on http://localhost:3030.
pnpm run dev --filter webapp
For full setup instructions see CONTRIBUTING.md.
Running tests
- Unit tests use vitest. Run all tests:
pnpm run test - Run tests for a specific workspace (example for
webapp):pnpm run test --filter webapp - Prefer running a single test file from within its directory:
If packages in that workspace need to be built first, run
cd apps/webapp pnpm run test ./src/components/Button.test.tspnpm run build --filter webapp.
Refer to ai/references/tests.md for details on writing tests. Tests should avoid mocks or stubs and use the helpers from @internal/testcontainers when Redis or Postgres are needed.
Coding style
- Formatting is enforced using oxfmt. Run
pnpm run formatbefore committing. - Follow the existing project conventions. Test files live beside the files under test and use descriptive
describeanditblocks. - Do not commit directly to the
mainbranch. All changes should be made in a separate branch and go through a pull request.
Additional docs
- The root
README.mddescribes Trigger.dev and links to documentation. - The
docsworkspace contains our documentation site, which can be run locally with:pnpm run dev --filter docs - The
triggerdotdev/referencesrepo's README explains how to create new reference projects for manual testing.