How cloudflare/next-on-pages works
Main Components
a. Core Components:
• CLI Tool Interface
• Build System
• Development Server
• ESLint Plugin
• Next.js Integration Layer
• Cloudflare Pages Integration Layer
b. Supporting Components:
• Cache Management System
• Router Handler
• Worker File Generator
• Request Context Manager
• Static Assets Handler
┌─ Developer Interface Layer ─────────────────┐
• CLI Tool │
• ESLint Plugin │
• ┬───────────────────────┘
• ↓
┌─ Build Processing Layer ───────────────────┐
• Build Application System │
• Vercel Output Processing │
• Worker File Generation │
• ┬───────────────────────┘
• ↓
┌─ Runtime Layer ────────────────────────────┐
• Request Handler │
• Cache Management │
• Route Matcher │
• ┬───────────────────────┘
• ↓
┌─ Platform Integration Layer ───────────────┐
• Cloudflare Pages Integration │
• Edge Runtime Adapters │
• ┘
Key Relationships to Highlight
• Bidirectional flow between CLI and Build System
• Data flow from Build System to Worker Generator
• Cache interaction patterns
• Routing system's connections
• Integration points with Cloudflare Pages
Implementation Details
• File processing flow
• Build artifact generation
• Cache management strategy
• Request handling pipeline
• Static asset processing