From 177a24e321d733d5432ba7867043b5e2024d7927 Mon Sep 17 00:00:00 2001 From: Ashutosh-Bhadauriya Date: Wed, 26 Jul 2023 18:25:02 +0530 Subject: [PATCH 1/2] Add testing CLI changes guide to contributing.md --- CONTRIBUTING.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a63f1c1cf8..c1636166038 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,6 +95,53 @@ 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. + ## Making a pull request **If you get errors, be sure to fix them before committing.** From a09081f94ad7cbe96aac4a7bcd1f7efdcd6ffb1d Mon Sep 17 00:00:00 2001 From: Ashutosh-Bhadauriya Date: Wed, 26 Jul 2023 20:26:53 +0530 Subject: [PATCH 2/2] Update backticks --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1636166038..f425c5fc9ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,7 +115,7 @@ To test CLI changes, follow the steps below: 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: +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: ``` { @@ -131,7 +131,7 @@ To test CLI changes, follow the steps below: 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. +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 ```