diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 848a8bf..7853971 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,18 +1,24 @@ -name: Deploy Documentation +name: Deploy Docs to GitHub Pages on: + # Runs on pushes targeting the default branch push: - branches: [main] + branches: ["main"] paths: - 'apps/docs/**' - '.github/workflows/deploy-docs.yml' + + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false @@ -27,13 +33,13 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: 9 + version: 9.0.0 - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 18 - cache: 'pnpm' + node-version: "18" + cache: "pnpm" - name: Setup Pages uses: actions/configure-pages@v4 @@ -41,15 +47,13 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Build docs - run: | - cd apps/docs - pnpm build + - name: Build with Turbo + run: pnpm turbo build --filter=docs - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: apps/docs/dist + path: ./apps/docs/dist deploy: environment: @@ -61,4 +65,3 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 - diff --git a/apps/docs/src/content/docs/development/contributing.md b/apps/docs/src/content/docs/development/contributing.md index 8cad4b8..56a8701 100644 --- a/apps/docs/src/content/docs/development/contributing.md +++ b/apps/docs/src/content/docs/development/contributing.md @@ -28,7 +28,7 @@ New to DesterLib? Here's the fastest way to start contributing: 6. **Push** to your fork and create a **Pull Request** :::tip[First Time Contributing?] -Check out our [CONTRIBUTING.md](https://github.com/DesterLib/desterlib/blob/dev/CONTRIBUTING.md) for detailed step-by-step instructions! +Check out our [CONTRIBUTING.md](https://github.com/DesterLib/desterlib/blob/main/CONTRIBUTING.md) for detailed step-by-step instructions! ::: ## 🚀 For Community Contributors @@ -52,16 +52,16 @@ Before starting new work, always sync: ```bash git fetch upstream -git checkout dev -git merge upstream/dev -git push origin dev +git checkout main +git merge upstream/main +git push origin main ``` ### 3. Create Feature Branch ```bash -# Create branch from dev -git checkout dev +# Create branch from main +git checkout main git checkout -b feat/your-feature-name ``` @@ -97,7 +97,7 @@ git push origin feat/your-feature-name 2. Click "Pull requests" → "New pull request" 3. Click "compare across forks" 4. Select: - - **base:** `DesterLib/desterlib` / `dev` + - **base:** `DesterLib/desterlib` / `main` - **head:** `YOUR-USERNAME/desterlib` / `feat/your-feature-name` 5. Fill out the PR template 6. Submit! @@ -113,9 +113,9 @@ If you have write access to the repository: git clone https://github.com/DesterLib/desterlib.git cd desterlib -# Create feature branch from dev -git checkout dev -git pull origin dev +# Create feature branch from main +git checkout main +git pull origin main git checkout -b feat/your-feature-name # Make changes, commit, add changeset @@ -125,9 +125,14 @@ pnpm changeset # Push to origin git push -u origin feat/your-feature-name -# Create PR to dev +# Create PR using script (targets main by default) +pnpm pr:create ``` +:::note[Alpha Development] +During alpha development, we use a simplified workflow: **Feature Branches → Main**. Once we reach stable releases, we'll introduce a `dev` branch for staging. +::: + See the [Versioning Guide](/development/versioning/) for complete workflow. ## 🔍 Finding Issues to Work On @@ -208,7 +213,7 @@ Before submitting your PR, verify: - [ ] Documentation updated (if needed) - [ ] PR template filled out completely - [ ] Tests pass (when available) -- [ ] No merge conflicts with `dev` +- [ ] No merge conflicts with `main` ## 📝 Commit Message Format @@ -307,8 +312,9 @@ git push origin feat/your-feature-name ### 4. Merge Once approved: -- Maintainer merges to `dev` +- Maintainer merges to `main` - Your contribution is part of DesterLib! +- Docs automatically deploy to GitHub Pages - Celebrate! 🎉 ## 🌟 After Your PR is Merged @@ -316,9 +322,9 @@ Once approved: ### Update Your Fork ```bash -git checkout dev -git pull upstream dev -git push origin dev +git checkout main +git pull upstream main +git push origin main ``` ### Clean Up @@ -344,7 +350,7 @@ Need assistance? - 💭 [GitHub Discussions](https://github.com/DesterLib/desterlib/discussions) - Ask questions - 🐛 [GitHub Issues](https://github.com/DesterLib/desterlib/issues) - Report bugs -- 📖 [Full Contributing Guide](https://github.com/DesterLib/desterlib/blob/dev/CONTRIBUTING.md) - Detailed instructions +- 📖 [Full Contributing Guide](https://github.com/DesterLib/desterlib/blob/main/CONTRIBUTING.md) - Detailed instructions ## 🎉 Recognition diff --git a/apps/docs/src/content/docs/development/quick-reference.md b/apps/docs/src/content/docs/development/quick-reference.md index 74ed138..98aa86f 100644 --- a/apps/docs/src/content/docs/development/quick-reference.md +++ b/apps/docs/src/content/docs/development/quick-reference.md @@ -66,8 +66,8 @@ pnpm release ## Changeset Flow ``` -Make Changes → Create Changeset → Commit & Push → Create PR to dev - → Review & Merge → Version Bump → Merge to main → Auto Release +Make Changes → Create Changeset → Commit & Push → Create PR to main + → Review & Merge → Auto Deploy (docs) → Version Bump → Release ``` ## Example Changeset File @@ -103,9 +103,9 @@ BREAKING CHANGE: Replace /auth/login with OAuth2 ## PR Workflow -1. **Create feature branch from `dev`** +1. **Create feature branch from `main`** ```bash - git checkout dev && git pull + git checkout main && git pull git checkout -b feat/my-feature ``` @@ -127,9 +127,10 @@ BREAKING CHANGE: Replace /auth/login with OAuth2 git push -u origin feat/my-feature ``` -5. **After merge to dev → version bump** +5. **After merge to main** ```bash - pnpm version + # Docs auto-deploy via GitHub Actions + # Version bump via automated PR when ready git commit -am "chore: version packages" ``` diff --git a/apps/docs/src/content/docs/development/versioning.md b/apps/docs/src/content/docs/development/versioning.md index 2bbf0fc..8d23ec7 100644 --- a/apps/docs/src/content/docs/development/versioning.md +++ b/apps/docs/src/content/docs/development/versioning.md @@ -49,19 +49,23 @@ Each significant change should have an associated changeset file that describes ## Branching Strategy -- **main** - Production-ready code, tagged releases -- **dev** - Development branch, all features merge here first -- **feat/** - Feature branches created from `dev` -- **fix/** - Bug fix branches created from `dev` -- **chore/** - Maintenance branches created from `dev` +:::note[Alpha Development Workflow] +During alpha development, we use a simplified workflow. Once we reach stable releases (v1.0.0), we'll introduce a `dev` branch for staging. +::: + +- **main** - Production code, auto-deploys docs, tagged releases +- **feat/** - Feature branches created from `main` +- **fix/** - Bug fix branches created from `main` +- **chore/** - Maintenance branches created from `main` +- **docs/** - Documentation branches created from `main` ## Making Changes ### 1. Create a feature branch ```bash -git checkout dev -git pull origin dev +git checkout main +git pull origin main git checkout -b feat/your-feature-name ``` @@ -213,8 +217,10 @@ git push 1. Merge to main: ```bash - git checkout main - git merge dev + # Not needed in alpha - PRs merge directly to main + # In the future with dev branch: + # git checkout main + # git merge dev ``` 2. Build and publish: @@ -244,8 +250,8 @@ GitHub Actions automatically handles releases: ```bash # 1. Create feature branch -git checkout dev -git pull origin dev +git checkout main +git pull origin main git checkout -b feat/add-user-search # 2. Make changes @@ -276,8 +282,8 @@ git push -u origin feat/add-user-search ```bash # 1. Create fix branch -git checkout dev -git pull origin dev +git checkout main +git pull origin main git checkout -b fix/authentication-error # 2. Fix the bug @@ -308,7 +314,7 @@ git push -u origin fix/authentication-error ```bash # 1. Create feature branch -git checkout dev +git checkout main git checkout -b feat/api-v2-breaking # 2. Make breaking changes diff --git a/scripts/create-pr.sh b/scripts/create-pr.sh index 2b767a3..a8104fc 100755 --- a/scripts/create-pr.sh +++ b/scripts/create-pr.sh @@ -5,8 +5,8 @@ set -e -# Default target branch is dev -TARGET_BRANCH="${1:-dev}" +# Default target branch is main +TARGET_BRANCH="${1:-main}" # Get current branch CURRENT_BRANCH=$(git branch --show-current) @@ -19,8 +19,8 @@ if ! command -v gh &> /dev/null; then fi # Check if we're on a branch -if [ "$CURRENT_BRANCH" == "main" ] || [ "$CURRENT_BRANCH" == "dev" ]; then - echo "❌ Cannot create PR from main or dev branch" +if [ "$CURRENT_BRANCH" == "main" ]; then + echo "❌ Cannot create PR from main branch" echo "Please switch to a feature branch" exit 1 fi