Skip to content

Commit 3cf01ff

Browse files
Add testing CLI changes guide to contributing.md (#220)
* Add testing CLI changes guide to contributing.md * Update backticks
1 parent 10798c0 commit 3cf01ff

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,52 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.
9595
``
9696
4. Paste the magic link shown in your terminal into your browser to login.
9797

98+
## Testing CLI changes
99+
To test CLI changes, follow the steps below:
100+
101+
1. Build the CLI and watch for changes
102+
103+
```
104+
cd packages/cli
105+
pnpm run dev
106+
```
107+
108+
2. Open a new Terminal window and run the webapp locally and then create a new project in the dashboard. Copy out the dev API key.
109+
110+
3. Create a new temporary Next.js app in examples directory
111+
112+
```
113+
pnpm create next-app@latest
114+
```
115+
116+
Follow the prompts to create a TypeScript project using the App Directory.
117+
118+
4. Then once that's finished, add the `@trigger.dev/cli` to the `devDependencies` of the newly created Next.js app's `package.json` file, like so:
119+
120+
```
121+
{
122+
"devDependencies": { "@trigger.dev/cli": "workspace:*" }
123+
}
124+
```
125+
126+
5. Open a new terminal window, navigate into the example, and initialize the CLI:
127+
128+
```
129+
cd examples/your-newly-created-nextjs-project
130+
pnpm i
131+
pnpm exec trigger-cli init
132+
```
133+
134+
6. When prompted, select `self-hosted` and enter `localhost:3030` for your local version of the webapp. When asked for an API key, use the key you copied earlier.
135+
136+
7. Run the CLI
137+
```
138+
pnpm exec trigger-cli dev
139+
```
140+
141+
8. After running the CLI, start your newly created Next.js project. You should now be able to see the changes.
142+
143+
9. Please remember to delete the temporary project you created after you've tested the changes, and before you raise a PR.
98144
## Add sample jobs
99145

100146
The [examples/jobs-starter](./examples/jobs-starter/) project defines simple jobs you can get started with.

0 commit comments

Comments
 (0)