@deneb-ui/cli 2.0.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 +197 -0
- package/bin/index.js +784 -0
- package/package.json +34 -0
- package/src/tools/fivora-template-validator.cjs +37 -0
- package/src/tools/local-template-lab.cjs +136 -0
- package/src/tools/template-preview-focus-bridge.cjs +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# @fivora/cli
|
|
2
|
+
|
|
3
|
+
Official developer CLI for creating, initializing, testing, validating, and packaging **Fivora** templates.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@fivora/cli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
You can run commands directly using `npx`:
|
|
13
|
+
```bash
|
|
14
|
+
npx @fivora/cli <command>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or install globally:
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @fivora/cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or install as a project devDependency:
|
|
23
|
+
```bash
|
|
24
|
+
npm install -D @fivora/cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The CLI command is available as `fivora`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
### 1. `fivora init` (Configure an Existing Project)
|
|
34
|
+
Converts any **existing Next.js project** into a compliant Fivora template:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Inside your existing Next.js project directory:
|
|
38
|
+
npx @fivora/cli init
|
|
39
|
+
# or if installed globally / locally:
|
|
40
|
+
fivora init
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**What it does automatically:**
|
|
44
|
+
- Scans `src/app`, `app`, and `pages` to discover your existing routes (e.g. `/products`, `/about`, `/contact`).
|
|
45
|
+
- Generates `fivora-template.json` (Version 2 strict visual editing contract) with detected pages.
|
|
46
|
+
- Generates `src/data/site-data.json` for merchant branding, navigation labels, and editable copy.
|
|
47
|
+
- Injects npm scripts (`lab`, `validate`, `zip`, `package:template`) into `package.json`.
|
|
48
|
+
- Installs `@fivora/editable-components` and `@fivora/cli`.
|
|
49
|
+
- Checks `next.config` to verify `output: 'export'` for static export builds.
|
|
50
|
+
|
|
51
|
+
**Options:**
|
|
52
|
+
- `--skip-install` – Skip automatic `npm install` of dependencies.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### 2. `fivora create <project-name>` (Start from Scratch)
|
|
57
|
+
Scaffolds a brand-new, production-ready Fivora store with Next.js App Router, Tailwind/CSS, and editable components pre-configured:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
fivora create my-store
|
|
61
|
+
cd my-store
|
|
62
|
+
npm run dev
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### 3. `fivora lab [path]` (Visual Editing Lab)
|
|
68
|
+
Starts the local **Fivora Visual Editing Lab**. It boots your Next.js store inside an interactive editor simulation so you can test merchant visual click-to-edit interactions and field highlights before uploading.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
fivora lab .
|
|
72
|
+
# Or via npm script:
|
|
73
|
+
npm run lab
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Options:**
|
|
77
|
+
- `--api-port <port>` – Controller API port (default: `4174`)
|
|
78
|
+
- `--preview-port <port>` – Template dev server port (default: `4173`)
|
|
79
|
+
- `--skip-install` – Do not install missing dependencies automatically
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### 4. `fivora validate [path]` (Contract Preflight Validation)
|
|
84
|
+
Runs strict preflight compliance checks against the Fivora template contract:
|
|
85
|
+
|
|
86
|
+
- **Manifest Validation:** Ensures `fivora-template.json` satisfies contract version 2.
|
|
87
|
+
- **Probe Fixture Test:** Verifies that all `data-preview-field-path` annotations render without breaking.
|
|
88
|
+
- **Empty-State Safety:** Verifies the template does not crash when merchant content is empty or omitted.
|
|
89
|
+
- **Unselected Page Link Filtering:** Verifies links to optional unselected pages are cleanly filtered.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
fivora validate .
|
|
93
|
+
# Or via npm script:
|
|
94
|
+
npm run validate
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Options:**
|
|
98
|
+
- `--skip-install` – Skip dependency installation during check
|
|
99
|
+
- `--skip-build` – Skip building output directory
|
|
100
|
+
- `--json` – Output results as structured JSON
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### 5. `fivora zip [path]` (Clean 1-Click Packaging)
|
|
105
|
+
Packages your template into an upload-ready `.zip` file for the Fivora Developer Portal.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
fivora zip .
|
|
109
|
+
# Or via npm script:
|
|
110
|
+
npm run zip
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Automatic Exclusions:**
|
|
114
|
+
Strips out heavy and private files automatically:
|
|
115
|
+
- `node_modules/`
|
|
116
|
+
- `.next/` and `.turbo/`
|
|
117
|
+
- `.git/`
|
|
118
|
+
- `.env*` files
|
|
119
|
+
- Temporary logs and build caches
|
|
120
|
+
|
|
121
|
+
Output is saved as `fivora-template.zip` in your project root.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 6. `fivora update [path]` (Update Fivora Dependencies)
|
|
126
|
+
Updates `@fivora/editable-components` and `@fivora/cli` to their latest versions:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
fivora update
|
|
130
|
+
# Or via npm script:
|
|
131
|
+
npm run update:fivora
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**What it does:**
|
|
135
|
+
- In standard/published projects: Runs `npm install @fivora/editable-components@latest @fivora/cli@latest`.
|
|
136
|
+
- In local development workspaces: Automatically detects `file:` package paths (or with `--local` flag) and re-links directly against local package folders.
|
|
137
|
+
|
|
138
|
+
**Options:**
|
|
139
|
+
- `--local` / `-l` (optional `--local=<path>`) – Re-link against a local workspace for developing packages locally (defaults to `/mnt/GAMES/GitHub/fivora_package`).
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Template Manifest (`fivora-template.json`)
|
|
144
|
+
|
|
145
|
+
The template manifest declares template metadata, pages, and editable schema:
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"framework": "nextjs-static-export",
|
|
150
|
+
"version": 2,
|
|
151
|
+
"visualEditing": {
|
|
152
|
+
"contractVersion": 1,
|
|
153
|
+
"mode": "strict",
|
|
154
|
+
"controlOnlyPaths": []
|
|
155
|
+
},
|
|
156
|
+
"siteDataFile": "src/data/site-data.json",
|
|
157
|
+
"outputDirectory": "out",
|
|
158
|
+
"installCommand": "npm install",
|
|
159
|
+
"buildCommand": "npm run build",
|
|
160
|
+
"basePathEnvVar": "NEXT_PUBLIC_SITE_BASE_PATH",
|
|
161
|
+
"pages": [
|
|
162
|
+
{ "id": "home", "label": "Home", "route": "/", "required": true },
|
|
163
|
+
{ "id": "products", "label": "Products", "route": "/products" },
|
|
164
|
+
{ "id": "contact", "label": "Contact", "route": "/contact", "required": true }
|
|
165
|
+
],
|
|
166
|
+
"editorSchema": {
|
|
167
|
+
"version": 1,
|
|
168
|
+
"sections": []
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Troubleshooting
|
|
176
|
+
|
|
177
|
+
### `Error: Template manifest is missing or invalid`
|
|
178
|
+
Your project is missing `fivora-template.json`. Run:
|
|
179
|
+
```bash
|
|
180
|
+
npx @fivora/cli init
|
|
181
|
+
```
|
|
182
|
+
This will automatically generate the manifest and site data for your project.
|
|
183
|
+
|
|
184
|
+
### `Error: Template manifest framework must be "nextjs-static-export"`
|
|
185
|
+
Make sure your `next.config.ts` or `next.config.js` specifies static export:
|
|
186
|
+
```typescript
|
|
187
|
+
const nextConfig = {
|
|
188
|
+
output: 'export',
|
|
189
|
+
};
|
|
190
|
+
export default nextConfig;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
MIT © [Fivora](https://fivora.com)
|