Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,52 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.
``
4. Paste the magic link shown in your terminal into your browser to login.

## Testing CLI changes
To test CLI changes, follow the steps below:

1. Build the CLI and watch for changes

```
cd packages/cli
pnpm run dev
```

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.

3. Create a new temporary Next.js app in examples directory

```
pnpm create next-app@latest
```

Follow the prompts to create a TypeScript project using the App Directory.

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:

```
{
"devDependencies": { "@trigger.dev/cli": "workspace:*" }
}
```

5. Open a new terminal window, navigate into the example, and initialize the CLI:

```
cd examples/your-newly-created-nextjs-project
pnpm i
pnpm exec trigger-cli init
```

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.

7. Run the CLI
```
pnpm exec trigger-cli dev
```

8. After running the CLI, start your newly created Next.js project. You should now be able to see the changes.

9. Please remember to delete the temporary project you created after you've tested the changes, and before you raise a PR.
## Add sample jobs

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