You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: fix CONTRIBUTING.md setup steps and scope db:seed to webapp
- Fix wrong path 'cd packages/database' -> 'cd internal-packages/database' in
the migration walkthrough.
- Renumber duplicate '4.' steps in Adding migrations and the skipped step in
the hello-world Running section.
- Combine three sequential builds into one (turbo parallelizes filters):
pnpm run build --filter webapp --filter trigger.dev --filter @trigger.dev/sdk
- Add a 'pnpm run db:seed' step after migrate. The seed creates a stable
local user, References org, and reference projects (including hello-world
with proj_rrkpdguyagvsoktglnod) so contributors no longer have to manually
edit the externalRef column in Postgres.
- Mention ClickHouse and the ClickHouse migrator alongside Postgres/Redis.
- Remove the V1-era 'Add sample jobs' section — references/job-catalog no
longer exists; the hello-world flow above replaces it.
Scope db:seed in turbo.json to 'webapp#db:seed' depending on 'webapp#build'.
The previous root-level entry queued 'build' for every workspace package
(reference projects, docs, kubernetes-provider, etc.), and a single broken
reference build (e.g. references-realtime-hooks-test failing under Turbopack)
would kill the entire seed pipeline. Scoping cuts the dry-run plan from 27
tasks to 20 — only webapp's actual transitive workspace deps.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+27-61Lines changed: 27 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ branch are tagged into a release periodically.
71
71
72
72
Feel free to update `SESSION_SECRET` and `MAGIC_LINK_SECRET` as well using the same method.
73
73
74
-
8. Start Docker. This starts the required services like Postgres & Redis. If this is your first time using Docker, consider going through this [guide](DOCKER_INSTALLATION.md)
74
+
8. Start Docker. This starts the required services: Postgres, Redis, Electric, and ClickHouse (the ClickHouse migrator runs once on first start). If this is your first time using Docker, consider going through this [guide](DOCKER_INSTALLATION.md).
75
75
76
76
```
77
77
pnpm run docker
@@ -81,11 +81,15 @@ branch are tagged into a release periodically.
81
81
```
82
82
pnpm run db:migrate
83
83
```
84
-
10. Build everything
84
+
10. Build the webapp, CLI, and SDK
85
85
```
86
-
pnpm run build --filter webapp && pnpm run build --filter trigger.dev && pnpm run build --filter @trigger.dev/sdk
86
+
pnpm run build --filter webapp --filter trigger.dev --filter @trigger.dev/sdk
87
87
```
88
-
11. Run the app. See the section below.
88
+
11. Seed the database. This creates a local user, a `References` org, and the reference projects (including `hello-world`) with stable IDs.
89
+
```
90
+
pnpm run db:seed
91
+
```
92
+
12. Run the app. See the section below.
89
93
90
94
## Running
91
95
@@ -105,22 +109,17 @@ We use the `<root>/references/hello-world` subdirectory as a staging ground for
105
109
106
110
### First-time setup
107
111
108
-
First, make sure you are running the webapp according to the instructions above. Then:
109
-
110
-
1. Visit http://localhost:3030 in your browser and create a new project called "hello-world".
112
+
First, make sure you are running the webapp according to the instructions above. The seed step from setup already created a `hello-world` project under the `References` org with the stable ref `proj_rrkpdguyagvsoktglnod` — log in at http://localhost:3030 with any email to access it. Then:
111
113
112
-
2. In Postgres go to the "Projects" table and for the project you create change the `externalRef` to `proj_rrkpdguyagvsoktglnod`.
113
-
114
-
3. Build the CLI
114
+
1. Build the CLI (skip if you already ran the build step in setup)
115
115
116
116
```sh
117
-
# Build the CLI
118
117
pnpm run build --filter trigger.dev
119
118
# Make it accessible to `pnpm exec`
120
119
pnpm i
121
120
```
122
121
123
-
4. Change into the `<root>/references/hello-world` directory and authorize the CLI to the local server:
122
+
2. Change into the `<root>/references/hello-world` directory and authorize the CLI to the local server:
124
123
125
124
```sh
126
125
cd references/hello-world
@@ -168,75 +167,42 @@ If you want additional debug logging, you can use the `--log-level debug` flag:
168
167
pnpm exec trigger dev --log-level debug
169
168
```
170
169
171
-
6. If you make any changes in the CLI/Core/SDK, you'll need to `CTRL+C` to exit the `dev` command and restart it to pickup changes. Any changes to the files inside of the `hello-world/src/trigger` dir will automatically be rebuilt by the `dev` command.
170
+
5. If you make any changes in the CLI/Core/SDK, you'll need to `CTRL+C` to exit the `dev` command and restart it to pickup changes. Any changes to the files inside of the `hello-world/src/trigger` dir will automatically be rebuilt by the `dev` command.
172
171
173
-
7. Navigate to the `hello-world` project in your local dashboard at localhost:3030 and you should see the list of tasks.
172
+
6. Navigate to the `hello-world` project in your local dashboard at localhost:3030 and you should see the list of tasks.
174
173
175
-
8. Go to the "Test" page in the sidebar and select a task. Then enter a payload and click "Run test". You can tell what the payloads should be by looking at the relevant task file inside the `/references/hello-world/src/trigger` folder. Many of them accept an empty payload.
174
+
7. Go to the "Test" page in the sidebar and select a task. Then enter a payload and click "Run test". You can tell what the payloads should be by looking at the relevant task file inside the `/references/hello-world/src/trigger` folder. Many of them accept an empty payload.
176
175
177
-
9. Feel free to add additional files in `hello-world/src/trigger` to test out specific aspects of the system, or add in edge cases.
176
+
8. Feel free to add additional files in `hello-world/src/trigger` to test out specific aspects of the system, or add in edge cases.
This creates a migration file. Check the migration file does only what you want. If you're adding any database indexes they must use `CONCURRENTLY`, otherwise they'll lock the table when executed.
195
194
196
-
4. Run the migration.
197
-
198
-
```
199
-
pnpm run db:migrate:deploy
200
-
pnpm run generate
201
-
```
202
-
203
-
This executes the migrations against your database and applies changes to the database schema(s), and then regenerates the Prisma client.
204
-
205
-
4. Commit generated migrations as well as changes to the schema.prisma file
206
-
5. If you're using VSCode you may need to restart the Typescript server in the webapp to get updated type inference. Open a TypeScript file, then open the Command Palette (View > Command Palette) and run `TypeScript: Restart TS server`.
207
-
208
-
## Add sample jobs
209
-
210
-
The [references/job-catalog](./references/job-catalog/) project defines simple jobs you can get started with.
211
-
212
-
1.`cd` into `references/job-catalog`
213
-
2. Create a `.env` file with the following content,
214
-
replacing `<TRIGGER_DEV_API_KEY>` with an actual key:
195
+
4. Run the migration:
215
196
216
-
```env
217
-
TRIGGER_API_KEY=[TRIGGER_DEV_API_KEY]
218
-
TRIGGER_API_URL=http://localhost:3030
219
-
```
220
-
221
-
`TRIGGER_API_URL` is used to configure the URL for your Trigger.dev instance,
222
-
where the jobs will be registered.
223
-
224
-
3. Run one of the the `job-catalog` files:
225
-
226
-
```sh
227
-
pnpm run events
228
-
```
229
-
230
-
This will open up a local server using `express` on port 8080. Then in a new terminal window you can run the trigger-cli dev command:
231
-
232
-
```sh
233
-
pnpm run dev:trigger
234
-
```
197
+
```
198
+
pnpm run db:migrate:deploy
199
+
pnpm run generate
200
+
```
235
201
236
-
See the [Job Catalog](./references/job-catalog/README.md) file for more.
202
+
This executes the migrations against your database and applies changes to the database schema(s), and then regenerates the Prisma client.
237
203
238
-
4. Navigate to your trigger.dev instance ([http://localhost:3030](http://localhost:3030/)), to see the jobs.
239
-
You can use the test feature to trigger them.
204
+
5. Commit the generated migration files as well as the changes to `schema.prisma`.
205
+
6. If you're using VSCode you may need to restart the TypeScript server in the webapp to get updated type inference. Open a TypeScript file, then open the Command Palette (View > Command Palette) and run `TypeScript: Restart TS server`.
0 commit comments