Things to note:
- The trigger.dev code lives in the packages/trigger directory, a private package
- The
apps/web
Next.js app has a workspace dependency on@repo/trigger
- The
apps/web
Next.js app triggers the example hello world task inapp/actions
which is a server action - The page.tsx is marked as a client component
- The TRIGGER_SECRET_KEY must be set in the
.env.local
inapps/web
- You'll need to set a project reference in the
packages/trigger/trigger.config.ts
file, which you can find in your Trigger.dev dashboard - I've installed the
trigger.dev
package as a dev dep ofpackages/trigger
and created adev
script so you should be able to runpnpm run dev --filter @repo/trigger
from the monorepo root or justpnpm run dev
from thepackages/trigger
dir - The
@repo/trigger
folder uses another package,@repo/dsl
, and that has been added to thedependenciesToBundle
option, since it's a workspace package
This is an official starter Turborepo.
Run the following command:
npx create-turbo@latest
This Turborepo includes the following packages/apps:
docs
: a Next.js appweb
: another Next.js app@repo/ui
: a stub React component library shared by bothweb
anddocs
applications@repo/eslint-config
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)@repo/typescript-config
:tsconfig.json
s used throughout the monorepo
Each package/app is 100% TypeScript.
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
To build all apps and packages, run the following command:
cd my-turborepo
pnpm build
To develop all apps and packages, run the following command:
cd my-turborepo
pnpm dev