Skip to content

Commit 9d2203f

Browse files
nhnt11claude
andcommitted
Convert to React and add comprehensive test suite
- Convert vanilla HTML/JS to React component with hooks - Add Astro React integration and Node adapter - Add Vitest with React Testing Library for testing - Add 55 tests covering API endpoint and UI component - Add GitHub Actions CI workflow for tests and build - Update .gitignore for AI assistant directories Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 960d85a commit 9d2203f

11 files changed

Lines changed: 3504 additions & 301 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests
27+
run: npm run test:run
28+
29+
- name: Build
30+
run: npm run build

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ dist/
2424
*.swp
2525
*.swo
2626

27+
# AI assistants
28+
.agent/
29+
.claude/
30+
.cursor/
31+
.gemini/
32+
2733
# Debug
2834
npm-debug.log*
2935
yarn-debug.log*

astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { defineConfig } from 'astro/config';
2+
import react from '@astrojs/react';
3+
import node from '@astrojs/node';
24

35
export default defineConfig({
4-
output: 'server'
6+
output: 'server',
7+
adapter: node({ mode: 'standalone' }),
8+
integrations: [react()],
59
});

0 commit comments

Comments
 (0)