@conloca/cms-spa
v0.1.16
Published
The React-based UI for Conloca CMS, featuring Puck's visual page builder.
Readme
@conloca/cms-spa
The React-based UI for Conloca CMS, featuring Puck's visual page builder.
Development
Running the Development Server
bun run serveThis starts a development server at http://localhost:3000 with:
- Hot Module Replacement (HMR) via Bun
- Tailwind CSS processing with watch mode
- Mock Puck configuration with sample components
- WebSocket-based live reload
Development Features
The dev server includes a comprehensive mock Puck config with these components:
- Hero: Full-width hero section with background image support
- Card: Content card with image, title, description, and link
- Grid: Responsive grid layout with configurable columns
- Text: Rich text component with alignment and size options
- Button: Customizable button with variants
- Spacer: Vertical spacing component
How It Works
- CSS Processing: Tailwind CSS is processed in watch mode
- HMR: File changes trigger automatic browser reload via WebSocket
- Mock Config: Components are injected as
window.__PUCK_CONFIG__ - Static Serving: Bun serves the SPA with proper MIME types
Building for Production
bun run buildThis creates:
- Bundled SPA in
dist/spa/with hashed assets - TypeScript definitions in
dist/ - Minified CSS with Tailwind optimizations
Integration with Astro
In production (when used as an Astro plugin), the CMS:
- Loads the actual Puck config from the host website
- Uses Astro's content API for data persistence
- Leverages Vite's HMR for component updates
