@conloca/cms-spa 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/spa/main.css +4314 -0
- package/package.json +118 -0
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @conloca/cms-spa
|
|
2
|
+
|
|
3
|
+
The React-based UI for Conloca CMS, featuring Puck's visual page builder.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
### Running the Development Server
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun run serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This starts a development server at http://localhost:3000 with:
|
|
14
|
+
|
|
15
|
+
- Hot Module Replacement (HMR) via Bun
|
|
16
|
+
- Tailwind CSS processing with watch mode
|
|
17
|
+
- Mock Puck configuration with sample components
|
|
18
|
+
- WebSocket-based live reload
|
|
19
|
+
|
|
20
|
+
### Development Features
|
|
21
|
+
|
|
22
|
+
The dev server includes a comprehensive mock Puck config with these components:
|
|
23
|
+
|
|
24
|
+
- **Hero**: Full-width hero section with background image support
|
|
25
|
+
- **Card**: Content card with image, title, description, and link
|
|
26
|
+
- **Grid**: Responsive grid layout with configurable columns
|
|
27
|
+
- **Text**: Rich text component with alignment and size options
|
|
28
|
+
- **Button**: Customizable button with variants
|
|
29
|
+
- **Spacer**: Vertical spacing component
|
|
30
|
+
|
|
31
|
+
### How It Works
|
|
32
|
+
|
|
33
|
+
1. **CSS Processing**: Tailwind CSS is processed in watch mode
|
|
34
|
+
2. **HMR**: File changes trigger automatic browser reload via WebSocket
|
|
35
|
+
3. **Mock Config**: Components are injected as `window.__PUCK_CONFIG__`
|
|
36
|
+
4. **Static Serving**: Bun serves the SPA with proper MIME types
|
|
37
|
+
|
|
38
|
+
### Building for Production
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
bun run build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates:
|
|
45
|
+
|
|
46
|
+
- Bundled SPA in `dist/spa/` with hashed assets
|
|
47
|
+
- TypeScript definitions in `dist/`
|
|
48
|
+
- Minified CSS with Tailwind optimizations
|
|
49
|
+
|
|
50
|
+
### Integration with Astro
|
|
51
|
+
|
|
52
|
+
In production (when used as an Astro plugin), the CMS:
|
|
53
|
+
|
|
54
|
+
1. Loads the actual Puck config from the host website
|
|
55
|
+
2. Uses Astro's content API for data persistence
|
|
56
|
+
3. Leverages Vite's HMR for component updates
|