Skip to content

Set up React + TypeScript development environment for GitHub Pages - #1

Merged
Roystbeef merged 6 commits into
mainfrom
terragon/setup-codebase-for-gh-pages
Aug 7, 2025
Merged

Set up React + TypeScript development environment for GitHub Pages#1
Roystbeef merged 6 commits into
mainfrom
terragon/setup-codebase-for-gh-pages

Conversation

@Roystbeef

@Roystbeef Roystbeef commented Aug 7, 2025

Copy link
Copy Markdown
Owner

Summary

This PR transforms the Figma-exported .tsx files into a complete React + TypeScript development environment ready for GitHub Pages deployment.

🚀 Key Changes Made

  • Complete Development Setup: Added package.json with React 18, TypeScript, Vite, and all necessary UI dependencies
  • Build System: Configured Vite with TypeScript support and GitHub Pages deployment path
  • Styling: Set up Tailwind CSS with proper configuration and Radix UI components
  • Code Quality: Added ESLint configuration for React + TypeScript with proper linting rules
  • Import Fixes: Replaced motion/react with framer-motion and fixed all versioned package imports
  • Project Structure: Created proper entry points (index.html, main.tsx) and configuration files
  • Automation: Included terragon-setup.sh script for easy project setup

📁 Files Added/Modified

  • package.json - Complete dependency and script configuration
  • vite.config.ts - Build system configuration with GitHub Pages support
  • tsconfig.json + related - TypeScript configuration
  • tailwind.config.js - Tailwind CSS setup
  • eslint.config.js - Code quality configuration
  • index.html + main.tsx - Application entry points
  • terragon-setup.sh - Setup automation script
  • styles/globals.css - Added Tailwind directives
  • .gitignore - Proper exclusions for Node.js projects

🛠️ Manual Steps Required

GitHub Actions Workflow: Due to permission restrictions, you'll need to manually create .github/workflows/deploy.yml:

name: Deploy to GitHub Pages

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout
      uses: actions/checkout@v4
      
    - name: Setup Node.js
      uses: actions/setup-node@v4
      with:
        node-version: '18'
        cache: 'npm'
        
    - name: Install dependencies
      run: npm ci
      
    - name: Build
      run: npm run build
      
    - name: Setup Pages
      uses: actions/configure-pages@v4
      
    - name: Upload artifact
      uses: actions/upload-pages-artifact@v3
      with:
        path: './dist'

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    if: github.ref == 'refs/heads/main'
    
    steps:
    - name: Deploy to GitHub Pages
      id: deployment
      uses: actions/deploy-pages@v4

🎯 Test Plan

  • Package installation works (npm install)
  • Development server starts (npm run dev)
  • Production build succeeds (npm run build)
  • Linting passes (npm run lint)
  • All TypeScript errors resolved
  • Setup script works (./terragon-setup.sh)
  • Manual testing of GitHub Actions workflow
  • GitHub Pages deployment verification

🌐 Next Steps

  1. Merge this PR to main
  2. Add the GitHub Actions workflow file manually
  3. Enable GitHub Pages in repository settings
  4. Set Pages source to "GitHub Actions"

🤖 Generated with Claude Code

Roystbeef and others added 2 commits August 7, 2025 01:17
Updated import statements from 'motion/react' to 'framer-motion' in:
- App.tsx
- components/Footer.tsx
- components/FunFacts.tsx
- components/Hero.tsx
- components/PawPrints.tsx
- components/PersonalityCards.tsx
- components/PhotoGallery.tsx

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove version numbers from all package imports in components/ui
- Remove unused Clock import from FunFacts component
- Create vite-env.d.ts for CSS module type declarations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Roystbeef Roystbeef changed the title Replace motion/react imports with framer-motion Fix imports and add TypeScript support Aug 7, 2025
- Add complete package.json with React, TypeScript, Vite, and UI dependencies
- Configure Vite build system with TypeScript support and GitHub Pages base path
- Set up Tailwind CSS with proper configuration and directives
- Add ESLint configuration for React + TypeScript
- Create development server entry point and HTML template
- Include terragon-setup.sh script for easy project setup
- Configure proper .gitignore for Node.js projects

Note: GitHub Actions workflow needs to be added manually due to permissions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Roystbeef Roystbeef changed the title Fix imports and add TypeScript support Set up React + TypeScript development environment for GitHub Pages Aug 7, 2025
Roystbeef and others added 2 commits August 7, 2025 01:27
- Create a new workflow file .github/workflows/deploy.yml
- Trigger deployment on push and pull request to main branch
- Setup Node.js environment and install dependencies
- Build project and upload build artifacts
- Deploy built site to GitHub Pages environment

This enables automated deployment of the site to GitHub Pages on changes to main branch.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
The workflow file needs to be added manually by the repository owner.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Roystbeef
Roystbeef marked this pull request as ready for review August 7, 2025 01:32
@Roystbeef
Roystbeef merged commit c7425b9 into main Aug 7, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant