@conloca/cli 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 +124 -0
- package/dist/conloca.js +17895 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# @conloca/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for Conloca content management.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @conloca/cli
|
|
9
|
+
# or
|
|
10
|
+
bun add -g @conloca/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Initialize Content Structure
|
|
16
|
+
|
|
17
|
+
Initialize a new Conloca content structure for a site:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
conloca init <directory> <site>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This command will:
|
|
24
|
+
|
|
25
|
+
- Create the content directory structure
|
|
26
|
+
- Create directories for the specified site
|
|
27
|
+
- Create or update the sites.json configuration file
|
|
28
|
+
- Set up the blocks/shared directory for shared components
|
|
29
|
+
|
|
30
|
+
Example:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
conloca init . default
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Astro Integration
|
|
37
|
+
|
|
38
|
+
Set up Astro integration with Puck components and configuration:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
conloca astro setup [path]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This command will generate:
|
|
45
|
+
|
|
46
|
+
- `src/puck.config.tsx` - Puck component configuration
|
|
47
|
+
- `src/components/Layout.tsx` - Layout HOC with grid/flex support
|
|
48
|
+
- `src/components/Section.tsx` - Section wrapper component
|
|
49
|
+
- `src/components/puck/Heading.tsx` - Heading component
|
|
50
|
+
- `src/components/puck/Text.tsx` - Text component
|
|
51
|
+
- `src/components/puck/Flex.tsx` - Flex layout component
|
|
52
|
+
- `src/components/puck/Grid.tsx` - Grid layout component
|
|
53
|
+
- `src/schemas/data.ts` - Example Zod schemas for data collections
|
|
54
|
+
|
|
55
|
+
> **Note:** Routes are now handled automatically by the Astro plugin. Configure routing in your `astro.config.mjs` with `conlocaCMS({ routing: true })`.
|
|
56
|
+
|
|
57
|
+
Examples:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Set up in current directory
|
|
61
|
+
conloca astro setup
|
|
62
|
+
|
|
63
|
+
# Set up in a specific project
|
|
64
|
+
conloca astro setup ./my-astro-project
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Verify Content
|
|
68
|
+
|
|
69
|
+
Verify content files in a directory, automatically repairing any files missing required fields:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
conloca verify <directory>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This command will:
|
|
76
|
+
|
|
77
|
+
- Check all content files in the specified directory
|
|
78
|
+
- Automatically repair files missing required fields (id, created, modified)
|
|
79
|
+
- Report any errors found
|
|
80
|
+
- Display a summary of verified content items
|
|
81
|
+
|
|
82
|
+
## Quick Start
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# 1. Create a new Astro project (if you don't have one)
|
|
86
|
+
npm create astro@latest my-site
|
|
87
|
+
cd my-site
|
|
88
|
+
|
|
89
|
+
# 2. Install Conloca packages
|
|
90
|
+
npm install @conloca/astro-cms @conloca/content-api @conloca/mdx @measured/puck
|
|
91
|
+
|
|
92
|
+
# 3. Initialize content structure
|
|
93
|
+
conloca init . default
|
|
94
|
+
|
|
95
|
+
# 4. Set up Astro integration (components + Puck config)
|
|
96
|
+
conloca astro setup
|
|
97
|
+
|
|
98
|
+
# 5. Configure routing in astro.config.mjs:
|
|
99
|
+
# import { conlocaCMS } from '@conloca/astro-cms';
|
|
100
|
+
# export default defineConfig({
|
|
101
|
+
# integrations: [conlocaCMS({ routing: true })]
|
|
102
|
+
# });
|
|
103
|
+
|
|
104
|
+
# 6. Start your dev server
|
|
105
|
+
npm run dev
|
|
106
|
+
|
|
107
|
+
# 7. Visit /__cms to edit pages
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Development
|
|
111
|
+
|
|
112
|
+
### Building
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bun run build
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Testing
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
bun test
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The CLI is bundled into a single executable file using Bun's build system.
|