diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml new file mode 100644 index 00000000..a58020ec --- /dev/null +++ b/.github/actions/setup-project/action.yml @@ -0,0 +1,66 @@ +name: "Setup Project" +description: "Common setup steps for CI workflows - checkout, Node.js, dependencies, and native modules" + +inputs: + node-version: + description: "Node.js version to use" + required: false + default: "22" + check-lockfile: + description: "Run lockfile lint check for SSH URLs" + required: false + default: "false" + rebuild-node-pty-path: + description: "Working directory for node-pty rebuild (empty = root)" + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: "npm" + cache-dependency-path: package-lock.json + + - name: Check for SSH URLs in lockfile + if: inputs.check-lockfile == 'true' + shell: bash + run: npm run lint:lockfile + + - name: Configure Git for HTTPS + shell: bash + # Convert SSH URLs to HTTPS for git dependencies (e.g., @electron/node-gyp) + # This is needed because SSH authentication isn't available in CI + run: git config --global url."https://github.com/".insteadOf "git@github.com:" + + - name: Install dependencies + shell: bash + # Use npm install instead of npm ci to correctly resolve platform-specific + # optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries) + # Skip scripts to avoid electron-builder install-app-deps which uses too much memory + run: npm install --ignore-scripts + + - name: Install Linux native bindings + shell: bash + # Workaround for npm optional dependencies bug (npm/cli#4828) + # Explicitly install Linux bindings needed for build tools + run: | + npm install --no-save --force --ignore-scripts \ + @rollup/rollup-linux-x64-gnu@4.53.3 \ + @tailwindcss/oxide-linux-x64-gnu@4.1.17 + + - name: Rebuild native modules (root) + if: inputs.rebuild-node-pty-path == '' + shell: bash + # Rebuild node-pty and other native modules for Electron + run: npm rebuild node-pty + + - name: Rebuild native modules (workspace) + if: inputs.rebuild-node-pty-path != '' + shell: bash + # Rebuild node-pty and other native modules needed for server + run: npm rebuild node-pty + working-directory: ${{ inputs.rebuild-node-pty-path }} diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 24065347..9f8e49a8 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -18,34 +18,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Setup project + uses: ./.github/actions/setup-project with: - node-version: "22" - cache: "npm" - cache-dependency-path: package-lock.json - - - name: Configure Git for HTTPS - # Convert SSH URLs to HTTPS for git dependencies (e.g., @electron/node-gyp) - # This is needed because SSH authentication isn't available in CI - run: git config --global url."https://github.com/".insteadOf "git@github.com:" - - - name: Install dependencies - # Use npm install instead of npm ci to correctly resolve platform-specific - # optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries) - run: npm install - - - name: Install Linux native bindings - # Workaround for npm optional dependencies bug (npm/cli#4828) - # Explicitly install Linux bindings needed for build tools - run: | - npm install --no-save --force \ - @rollup/rollup-linux-x64-gnu@4.53.3 \ - @tailwindcss/oxide-linux-x64-gnu@4.1.17 + check-lockfile: "true" + rebuild-node-pty-path: "apps/server" - name: Install Playwright browsers run: npx playwright install --with-deps chromium - working-directory: apps/app + working-directory: apps/ui - name: Build server run: npm run build --workspace=apps/server @@ -71,20 +52,20 @@ jobs: exit 1 - name: Run E2E tests - # Playwright automatically starts the Next.js frontend via webServer config - # (see apps/app/playwright.config.ts) - no need to start it manually - run: npm run test --workspace=apps/app + # Playwright automatically starts the Vite frontend via webServer config + # (see apps/ui/playwright.config.ts) - no need to start it manually + run: npm run test --workspace=apps/ui env: CI: true - NEXT_PUBLIC_SERVER_URL: http://localhost:3008 - NEXT_PUBLIC_SKIP_SETUP: "true" + VITE_SERVER_URL: http://localhost:3008 + VITE_SKIP_SETUP: "true" - name: Upload Playwright report uses: actions/upload-artifact@v4 if: always() with: name: playwright-report - path: apps/app/playwright-report/ + path: apps/ui/playwright-report/ retention-days: 7 - name: Upload test results @@ -92,5 +73,5 @@ jobs: if: failure() with: name: test-results - path: apps/app/test-results/ + path: apps/ui/test-results/ retention-days: 7 diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index ea452a15..38e0c978 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -17,33 +17,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Setup project + uses: ./.github/actions/setup-project with: - node-version: "22" - cache: "npm" - cache-dependency-path: package-lock.json + check-lockfile: "true" - - name: Check for SSH URLs in lockfile - run: npm run lint:lockfile - - - name: Configure Git for HTTPS - # Convert SSH URLs to HTTPS for git dependencies (e.g., @electron/node-gyp) - # This is needed because SSH authentication isn't available in CI - run: git config --global url."https://github.com/".insteadOf "git@github.com:" - - - name: Install dependencies - # Use npm install instead of npm ci to correctly resolve platform-specific - # optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries) - run: npm install - - - name: Install Linux native bindings - # Workaround for npm optional dependencies bug (npm/cli#4828) - # Explicitly install Linux bindings needed for build tools - run: | - npm install --no-save --force \ - @rollup/rollup-linux-x64-gnu@4.53.3 \ - @tailwindcss/oxide-linux-x64-gnu@4.1.17 - - - name: Run build:electron - run: npm run build:electron + - name: Run build:electron (dir only - faster CI) + run: npm run build:electron:dir diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index aa6ec548..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: Build and Release Electron App - -on: - push: - tags: - - "v*.*.*" # Triggers on version tags like v1.0.0 - workflow_dispatch: # Allows manual triggering - inputs: - version: - description: "Version to release (e.g., v1.0.0)" - required: true - default: "v0.1.0" - -jobs: - build-and-release: - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - name: macOS - artifact-name: macos-builds - - os: windows-latest - name: Windows - artifact-name: windows-builds - - os: ubuntu-latest - name: Linux - artifact-name: linux-builds - - runs-on: ${{ matrix.os }} - - permissions: - contents: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "22" - cache: "npm" - cache-dependency-path: package-lock.json - - - name: Configure Git for HTTPS - # Convert SSH URLs to HTTPS for git dependencies (e.g., @electron/node-gyp) - # This is needed because SSH authentication isn't available in CI - run: git config --global url."https://github.com/".insteadOf "git@github.com:" - - - name: Install dependencies - # Use npm install instead of npm ci to correctly resolve platform-specific - # optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries) - run: npm install - - - name: Install Linux native bindings - # Workaround for npm optional dependencies bug (npm/cli#4828) - # Only needed on Linux - macOS and Windows get their bindings automatically - if: matrix.os == 'ubuntu-latest' - run: | - npm install --no-save --force \ - @rollup/rollup-linux-x64-gnu@4.53.3 \ - @tailwindcss/oxide-linux-x64-gnu@4.1.17 - - - name: Extract and set version - id: version - shell: bash - run: | - VERSION_TAG="${{ github.event.inputs.version || github.ref_name }}" - # Remove 'v' prefix if present (e.g., v1.0.0 -> 1.0.0) - VERSION="${VERSION_TAG#v}" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Extracted version: $VERSION from tag: $VERSION_TAG" - # Update the app's package.json version - cd apps/app - npm version $VERSION --no-git-tag-version - cd ../.. - echo "Updated apps/app/package.json to version $VERSION" - - - name: Build Electron App (macOS) - if: matrix.os == 'macos-latest' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:electron -- --mac --x64 --arm64 - - - name: Build Electron App (Windows) - if: matrix.os == 'windows-latest' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:electron -- --win --x64 - - - name: Build Electron App (Linux) - if: matrix.os == 'ubuntu-latest' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:electron -- --linux --x64 - - - name: Upload Release Assets - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ github.event.inputs.version || github.ref_name }} - files: | - apps/app/dist/*.exe - apps/app/dist/*.dmg - apps/app/dist/*.AppImage - apps/app/dist/*.zip - apps/app/dist/*.deb - apps/app/dist/*.rpm - draft: false - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload macOS artifacts for R2 - if: matrix.os == 'macos-latest' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.artifact-name }} - path: apps/app/dist/*.dmg - retention-days: 1 - - - name: Upload Windows artifacts for R2 - if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.artifact-name }} - path: apps/app/dist/*.exe - retention-days: 1 - - - name: Upload Linux artifacts for R2 - if: matrix.os == 'ubuntu-latest' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.artifact-name }} - path: apps/app/dist/*.AppImage - retention-days: 1 - - upload-to-r2: - needs: build-and-release - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Install AWS SDK - run: npm install @aws-sdk/client-s3 - - - name: Extract version - id: version - shell: bash - run: | - VERSION_TAG="${{ github.event.inputs.version || github.ref_name }}" - # Remove 'v' prefix if present (e.g., v1.0.0 -> 1.0.0) - VERSION="${VERSION_TAG#v}" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT - echo "Extracted version: $VERSION from tag: $VERSION_TAG" - - - name: Upload to R2 and update releases.json - env: - R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }} - R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} - R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} - R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }} - R2_PUBLIC_URL: ${{ secrets.R2_PUBLIC_URL }} - RELEASE_VERSION: ${{ steps.version.outputs.version }} - RELEASE_TAG: ${{ steps.version.outputs.version_tag }} - GITHUB_REPOSITORY: ${{ github.repository }} - run: node .github/scripts/upload-to-r2.js diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cadeb2f3..1d15b425 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,30 +17,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Setup project + uses: ./.github/actions/setup-project with: - node-version: "22" - cache: "npm" - cache-dependency-path: package-lock.json - - - name: Configure Git for HTTPS - # Convert SSH URLs to HTTPS for git dependencies (e.g., @electron/node-gyp) - # This is needed because SSH authentication isn't available in CI - run: git config --global url."https://github.com/".insteadOf "git@github.com:" - - - name: Install dependencies - # Use npm install instead of npm ci to correctly resolve platform-specific - # optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries) - run: npm install - - - name: Install Linux native bindings - # Workaround for npm optional dependencies bug (npm/cli#4828) - # Explicitly install Linux bindings needed for build tools - run: | - npm install --no-save --force \ - @rollup/rollup-linux-x64-gnu@4.53.3 \ - @tailwindcss/oxide-linux-x64-gnu@4.1.17 + check-lockfile: "true" + rebuild-node-pty-path: "apps/server" - name: Run server tests with coverage run: npm run test:server:coverage diff --git a/README.md b/README.md index 8c863c53..39c31d4b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-
+
No project selected
-- {currentProject.path}/.automaker/app_spec.txt -
-- {isCreating - ? currentPhase === "feature_generation" - ? "The app specification has been created! Now generating features from the implementation roadmap..." - : "We're analyzing your project and generating a comprehensive specification. This may take a few moments..." - : "Create an app specification to help our system understand your project. We'll analyze your codebase and generate a comprehensive spec based on your description."} -
- {errorMessage && ( -Error:
-{errorMessage}
-- {currentProject.path}/.automaker/app_spec.txt -
-