Commit Graph

3 Commits

Author SHA1 Message Date
Thomas Hallock bda5bc6c0e fix: prevent database imports from being bundled into client code
**Problem:**
- player-ownership.ts imported drizzle-orm and @/db at top level
- When RoomMemoryPairsProvider imported client-safe utilities, Webpack bundled ALL imports including database code
- This caused hydration error: "The 'original' argument must be of type Function"
- Node.js util.promisify was being called in browser context

**Solution:**
1. Created player-ownership.client.ts with ONLY client-safe utilities
   - No database imports
   - Safe to import from 'use client' components
   - Contains: buildPlayerOwnershipFromRoomData(), buildPlayerMetadata(), helper functions

2. Updated player-ownership.ts to re-export client utilities and add server-only functions
   - Re-exports everything from .client.ts
   - Adds buildPlayerOwnershipMap() (async, database-backed)
   - Safe to import from server components/API routes

3. Updated RoomMemoryPairsProvider to import from .client.ts

**Result:**
- No more hydration errors on /arcade/room
- Client bundle doesn't include database code
- Server code can still use both client and server utilities

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 11:40:46 -05:00
Thomas Hallock 4991fe684f ci: integrate crop mark gallery generation into automated workflow
Enhanced GitHub Actions workflow to automatically generate comprehensive
crop mark examples and unified gallery alongside existing template examples.

Updates include:
- Generate crop mark gallery with node generate-gallery.js
- Build unified gallery with before/after crop comparisons
- Commit and track gallery/*.svg and gallery-unified.html files
- Enhanced summary reporting with post-processing features
- Detailed documentation of viewBox optimization and bead annotations

The workflow now demonstrates the complete SVG post-processing pipeline
with working crop mark detection and optimization examples that update
automatically when templates change.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 15:58:21 -05:00
Thomas Hallock e196fa371c ci: add automated template example regeneration workflow
- Auto-regenerate SVG examples when templates change
- Runs on template file changes, manual trigger, and weekly schedule
- Installs Typst CLI and renders fresh examples from .typ files
- Commits and pushes changes back to main branch automatically
- Includes validation step to ensure generated files are valid
- Proper permissions and git configuration for automated commits

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 09:50:17 -05:00