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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+15-70Lines changed: 15 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,17 +84,17 @@ branch are tagged into a release periodically.
84
84
85
85
2. Once the app is running click the magic link button and enter your email. You will automatically be logged in, since you are running locally. Create an Org and your first project in the dashboard.
86
86
87
-
## Manual testing using v3-catalog
87
+
## Manual testing using hello-world
88
88
89
-
We use the `<root>/references/v3-catalog` subdirectory as a staging ground for testing changes to the SDK (`@trigger.dev/sdk` at `<root>/packages/trigger-sdk`), the Core package (`@trigger.dev/core` at `<root>packages/core`), the CLI (`trigger.dev` at `<root>/packages/cli-v3`) and the platform (The remix app at `<root>/apps/webapp`). The instructions below will get you started on using the `v3-catalog` for local development of Trigger.dev (v3).
89
+
We use the `<root>/references/hello-world` subdirectory as a staging ground for testing changes to the SDK (`@trigger.dev/sdk` at `<root>/packages/trigger-sdk`), the Core package (`@trigger.dev/core` at `<root>packages/core`), the CLI (`trigger.dev` at `<root>/packages/cli-v3`) and the platform (The remix app at `<root>/apps/webapp`). The instructions below will get you started on using the `hello-world` for local development of Trigger.dev.
90
90
91
91
### First-time setup
92
92
93
93
First, make sure you are running the webapp according to the instructions above. Then:
94
94
95
-
1. Visit http://localhost:3030 in your browser and create a new V3 project called "v3-catalog".
95
+
1. Visit http://localhost:3030 in your browser and create a new V3 project called "hello-world".
96
96
97
-
2. In Postgres go to the "Projects" table and for the project you create change the `externalRef` to `yubjwjsfkxnylobaqvqz`.
97
+
2. In Postgres go to the "Projects" table and for the project you create change the `externalRef` to `proj_rrkpdguyagvsoktglnod`.
98
98
99
99
3. Build the CLI
100
100
@@ -105,10 +105,10 @@ pnpm run build --filter trigger.dev
105
105
pnpm i
106
106
```
107
107
108
-
4. Change into the `<root>/references/v3-catalog` directory and authorize the CLI to the local server:
108
+
4. Change into the `<root>/references/hello-world` directory and authorize the CLI to the local server:
109
109
110
110
```sh
111
-
cd references/v3-catalog
111
+
cd references/hello-world
112
112
cp .env.example .env
113
113
pnpm exec trigger login -a http://localhost:3030
114
114
```
@@ -118,7 +118,7 @@ This will open a new browser window and authorize the CLI against your local use
118
118
You can optionally pass a `--profile` flag to the `login` command, which will allow you to use the CLI with separate accounts/servers. We suggest using a profile called `local` for your local development:
119
119
120
120
```sh
121
-
cd references/v3-catalog
121
+
cd references/hello-world
122
122
pnpm exec trigger login -a http://localhost:3030 --profile local
123
123
# later when you run the dev or deploy command:
124
124
pnpm exec trigger dev --profile local
@@ -137,84 +137,29 @@ The following steps should be followed any time you start working on a new featu
137
137
pnpm run dev --filter trigger.dev --filter "@trigger.dev/*"
138
138
```
139
139
140
-
3. Open another terminal window, and change into the `<root>/references/v3-catalog` directory.
140
+
3. Open another terminal window, and change into the `<root>/references/hello-world` directory.
141
141
142
-
4.You'll need to run the following commands to setup prisma and migrate the database:
142
+
4.Run the `dev` command, which will register all the local tasks with the platform and allow you to start testing task execution:
143
143
144
144
```sh
145
-
pnpm exec prisma migrate deploy
146
-
pnpm run generate:prisma
147
-
```
148
-
149
-
5. Run the `dev` command, which will register all the local tasks with the platform and allow you to start testing task execution:
150
-
151
-
```sh
152
-
# in <root>/references/v3-catalog
145
+
# in <root>/references/hello-world
153
146
pnpm exec trigger dev
154
147
```
155
148
156
149
If you want additional debug logging, you can use the `--log-level debug` flag:
157
150
158
151
```sh
159
-
# in <root>/references/v3-catalog
152
+
# in <root>/references/hello-world
160
153
pnpm exec trigger dev --log-level debug
161
154
```
162
155
163
-
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 `v3-catalog/src/trigger` dir will automatically be rebuilt by the `dev` command.
164
-
165
-
7. Navigate to the `v3-catalog` project in your local dashboard at localhost:3030 and you should see the list of tasks.
166
-
167
-
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/v3-catalog/src/trigger` folder. Many of them accept an empty payload.
168
-
169
-
9. Feel free to add additional files in `v3-catalog/src/trigger` to test out specific aspects of the system, or add in edge cases.
170
-
171
-
## Running end-to-end webapp tests (deprecated)
156
+
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.
172
157
173
-
To run the end-to-end tests, follow the steps below:
174
-
175
-
1. Set up environment variables (copy example envs into the correct place)
pnpm run build --filter @references/nextjs-test^...
187
-
pnpm --filter @trigger.dev/database generate
158
+
7. Navigate to the `hello-world` project in your local dashboard at localhost:3030 and you should see the list of tasks.
188
159
189
-
# Move trigger-cli bin to correct place
190
-
pnpm install --frozen-lockfile
160
+
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.
191
161
192
-
# Install playwrite browsers (ONE TIME ONLY)
193
-
npx playwright install
194
-
```
195
-
196
-
3. Set up the database
197
-
198
-
```sh
199
-
pnpm run docker
200
-
pnpm run db:migrate
201
-
pnpm run db:seed
202
-
```
203
-
204
-
4. Run the end-to-end tests
205
-
206
-
```sh
207
-
pnpm run test:e2e
208
-
```
209
-
210
-
### Cleanup
211
-
212
-
The end-to-end tests use a `setup` and `teardown` script to seed the database with test data. If the test runner doesn't exit cleanly, then the database can be left in a state where the tests can't run because the `setup` script will try to create data that already exists. If this happens, you can manually delete the `users` and `organizations` from the database using prisma studio:
213
-
214
-
```sh
215
-
# With the database running (i.e. pnpm run docker)
216
-
pnpm run db:studio
217
-
```
162
+
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.
0 commit comments