From 43c27df68afd6c635b4d7b9ecf07b191d4110caf Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Fri, 12 Sep 2025 23:57:48 +0530 Subject: [PATCH] chore: update contribution guide --- .github/CONTRIBUTING.md | 45 +++++++++++++++++++++----- apps/web/.env.example | 1 + apps/web/content/docs/contributing.mdx | 29 ++++++++++++++--- 3 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 apps/web/.env.example diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 941f18f..29a7aae 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -47,15 +47,47 @@ This repository is organized as a monorepo containing: 3. **Start development server** ```bash - bun dev:cli + bun dev ``` - This runs the CLI in watch mode, automatically rebuilding on changes. + This runs tsdown build in watch mode, automatically rebuilding on changes. + +4. **Test the CLI** + Now go to anywhere else in your system (maybe like a test folder) and run: + ```bash + create-better-t-stack + ``` + This will run the locally installed CLI. ### Web Development -1. **Start the documentation website** +1. **Install dependencies** ```bash - bun dev:web + # from repo root + bun i + ``` + +2. **Setup backend** + ```bash + cd packages/backend + bun dev:setup # you can choose local development too in prompts + ``` + +3. **Configure environment** + Copy the Convex URL from `packages/backend/.env.local` to `apps/web/.env`: + ``` + NEXT_PUBLIC_CONVEX_URL=http://127.0.0.1:3210/ + ``` + +4. **Set GitHub tokens** + Now run `bun dev` in the root. It will complain about GitHub token, so run this in `packages/backend`: + ```bash + npx convex env set GITHUB_ACCESS_TOKEN=xxxxx + npx convex env set GITHUB_WEBHOOK_SECRET=xxxxx + ``` + +5. **Start the documentation website** + ```bash + bun dev ``` This starts the Next.js development server for the documentation site. @@ -109,12 +141,9 @@ This repository is organized as a monorepo containing: ```bash # For CLI changes cd apps/cli -bun dev:cli +bun dev bun run test -# For web changes -bun dev:web - # Format files bun run format ``` diff --git a/apps/web/.env.example b/apps/web/.env.example new file mode 100644 index 0000000..27b799e --- /dev/null +++ b/apps/web/.env.example @@ -0,0 +1 @@ +NEXT_PUBLIC_CONVEX_URL= diff --git a/apps/web/content/docs/contributing.mdx b/apps/web/content/docs/contributing.mdx index 8d74955..00c3221 100644 --- a/apps/web/content/docs/contributing.mdx +++ b/apps/web/content/docs/contributing.mdx @@ -34,15 +34,34 @@ bun install cd apps/cli # optional global link for testing anywhere bun link -# run in watch mode -bun dev:cli +# run in watch mode (runs tsdown build in watch mode) +bun dev ``` +Now go to anywhere else in your system (maybe like a test folder) and run: +```bash +create-better-t-stack +``` +This will run the locally installed CLI. + ## Develop the Docs ```bash # from repo root -bun dev:web +bun i +cd packages/backend +bun dev:setup # you can choose local development too in prompts +``` + +Copy the Convex URL from `packages/backend/.env.local` to `apps/web/.env`: +``` +NEXT_PUBLIC_CONVEX_URL=http://127.0.0.1:3210/ +``` + +Now run `bun dev` in the root. It will complain about GitHub token, so run this in `packages/backend`: +```bash +npx convex env set GITHUB_ACCESS_TOKEN=xxxxx +npx convex env set GITHUB_WEBHOOK_SECRET=xxxxx ``` ## Contribution Flow @@ -56,11 +75,11 @@ bun dev:web ```bash # CLI -cd apps/cli && bun dev:cli +cd apps/cli && bun dev cd apps/cli && bun run test # Web -bun dev:web +bun dev # Format bun run format