@onexapis/cli 1.1.16 → 1.1.18
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 +117 -51
- package/bin/onexthm.js +4 -0
- package/dist/cli.js +750 -328
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +747 -325
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +162 -299
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +162 -299
- package/dist/index.mjs.map +1 -1
- package/dist/preview/preview-app.tsx +175 -53
- package/package.json +14 -12
- package/templates/default/.env.example +1 -1
- package/templates/default/.mcp.json +8 -0
- package/templates/default/CLAUDE.md +941 -0
- package/templates/default/bundle-entry.ts +18 -0
- package/templates/default/index.ts +26 -0
- package/templates/default/package.json +37 -0
- package/templates/default/pages/about.ts +66 -0
- package/templates/default/pages/home.ts +93 -0
- package/templates/default/pages/showcase.ts +146 -0
- package/templates/default/sections/about/about-default.tsx +237 -0
- package/templates/default/sections/about/about.schema.ts +259 -0
- package/templates/default/sections/about/index.ts +15 -0
- package/templates/default/sections/cta/cta-default.tsx +180 -0
- package/templates/default/sections/cta/cta.schema.ts +210 -0
- package/templates/default/sections/cta/index.ts +11 -0
- package/templates/default/sections/features/features-default.tsx +154 -0
- package/templates/default/sections/features/features.schema.ts +330 -0
- package/templates/default/sections/features/index.ts +11 -0
- package/templates/default/sections/gallery/gallery-default.tsx +134 -0
- package/templates/default/sections/gallery/gallery.schema.ts +397 -0
- package/templates/default/sections/gallery/index.ts +11 -0
- package/templates/default/sections/hero/hero-default.tsx +212 -0
- package/templates/default/sections/hero/hero.schema.ts +273 -0
- package/templates/default/sections/hero/index.ts +15 -0
- package/templates/default/sections/stats/index.ts +11 -0
- package/templates/default/sections/stats/stats-default.tsx +103 -0
- package/templates/default/sections/stats/stats.schema.ts +266 -0
- package/templates/default/sections/testimonials/index.ts +11 -0
- package/templates/default/sections/testimonials/testimonials-default.tsx +130 -0
- package/templates/default/sections/testimonials/testimonials.schema.ts +371 -0
- package/templates/default/sections-registry.ts +32 -0
- package/templates/default/theme.config.ts +107 -0
- package/templates/default/theme.layout.ts +21 -0
- package/templates/default/tsconfig.json +16 -7
- package/templates/default/README.md.ejs +0 -129
- package/templates/default/esbuild.config.js +0 -81
- package/templates/default/package.json.ejs +0 -31
- package/templates/default/src/config.ts.ejs +0 -98
- package/templates/default/src/index.ts.ejs +0 -11
- package/templates/default/src/layout.ts +0 -23
- package/templates/default/src/manifest.ts.ejs +0 -47
- package/templates/default/src/pages/home.ts.ejs +0 -37
- package/templates/default/src/sections/footer/footer-default.tsx +0 -28
- package/templates/default/src/sections/footer/footer.schema.ts +0 -45
- package/templates/default/src/sections/footer/index.ts +0 -2
- package/templates/default/src/sections/header/header-default.tsx +0 -61
- package/templates/default/src/sections/header/header.schema.ts +0 -46
- package/templates/default/src/sections/header/index.ts +0 -2
- package/templates/default/src/sections/hero/hero-default.tsx +0 -52
- package/templates/default/src/sections/hero/hero.schema.ts +0 -52
- package/templates/default/src/sections/hero/index.ts +0 -2
package/README.md
CHANGED
|
@@ -19,29 +19,38 @@ Requires Node.js >= 18.
|
|
|
19
19
|
## Quick Start
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
# 1.
|
|
23
|
-
|
|
22
|
+
# 1. Login to OneX platform
|
|
23
|
+
onexthm login
|
|
24
24
|
|
|
25
25
|
# 2. Create a new theme project
|
|
26
|
-
|
|
26
|
+
onexthm init my-theme
|
|
27
|
+
cd my-theme
|
|
27
28
|
|
|
28
|
-
#
|
|
29
|
-
|
|
29
|
+
# 3. Develop with live preview
|
|
30
|
+
onexthm dev
|
|
31
|
+
|
|
32
|
+
# 4. Publish to marketplace (authenticated, secure)
|
|
33
|
+
onexthm publish
|
|
30
34
|
```
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
## Theme Developer Flow
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
onexthm login # Authenticate with OneX platform
|
|
40
|
+
onexthm init my-store # Scaffold theme from template (7 sections, 3 pages)
|
|
41
|
+
cd my-store
|
|
42
|
+
onexthm dev # Live preview at localhost:3456
|
|
43
|
+
onexthm create:section pricing # Add new section
|
|
44
|
+
onexthm validate # Check structure
|
|
45
|
+
onexthm build # Compile for production
|
|
46
|
+
onexthm publish # Register → build → upload → scan → publish
|
|
47
|
+
onexthm whoami # Check logged-in status
|
|
48
|
+
onexthm logout # End session
|
|
40
49
|
```
|
|
41
50
|
|
|
42
51
|
## Commands
|
|
43
52
|
|
|
44
|
-
### `
|
|
53
|
+
### `onexthm init [project-name]`
|
|
45
54
|
|
|
46
55
|
Create a new OneX theme project from a template.
|
|
47
56
|
|
|
@@ -52,7 +61,7 @@ Create a new OneX theme project from a template.
|
|
|
52
61
|
| `--git` | Initialize a git repository |
|
|
53
62
|
| `-y, --yes` | Skip prompts and use defaults |
|
|
54
63
|
|
|
55
|
-
### `
|
|
64
|
+
### `onexthm create:section <name>` (alias: `cs`)
|
|
56
65
|
|
|
57
66
|
Scaffold a new section inside a theme.
|
|
58
67
|
|
|
@@ -63,11 +72,11 @@ Scaffold a new section inside a theme.
|
|
|
63
72
|
| `--template <template>` | Initial template variant (`default`, `minimal`) |
|
|
64
73
|
|
|
65
74
|
```bash
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
onexthm create:section hero -t my-theme -c heroes
|
|
76
|
+
onexthm cs featured-products -t my-store
|
|
68
77
|
```
|
|
69
78
|
|
|
70
|
-
### `
|
|
79
|
+
### `onexthm create:block <name>` (alias: `cb`)
|
|
71
80
|
|
|
72
81
|
Scaffold a new block.
|
|
73
82
|
|
|
@@ -76,11 +85,11 @@ Scaffold a new block.
|
|
|
76
85
|
| `-t, --theme <theme>` | Target theme (optional) |
|
|
77
86
|
|
|
78
87
|
```bash
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
onexthm create:block product-card
|
|
89
|
+
onexthm cb testimonial-item -t my-theme
|
|
81
90
|
```
|
|
82
91
|
|
|
83
|
-
### `
|
|
92
|
+
### `onexthm create:component <name>` (alias: `cc`)
|
|
84
93
|
|
|
85
94
|
Scaffold a new UI component.
|
|
86
95
|
|
|
@@ -89,11 +98,11 @@ Scaffold a new UI component.
|
|
|
89
98
|
| `-t, --type <type>` | Component type (`ui`, `layout`, `form`) |
|
|
90
99
|
|
|
91
100
|
```bash
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
onexthm create:component icon-badge
|
|
102
|
+
onexthm cc custom-input -t form
|
|
94
103
|
```
|
|
95
104
|
|
|
96
|
-
### `
|
|
105
|
+
### `onexthm list`
|
|
97
106
|
|
|
98
107
|
List available themes, sections, blocks, and components in the project.
|
|
99
108
|
|
|
@@ -104,7 +113,7 @@ List available themes, sections, blocks, and components in the project.
|
|
|
104
113
|
| `-c, --components` | List components only |
|
|
105
114
|
| `-t, --theme <theme>` | Filter by theme |
|
|
106
115
|
|
|
107
|
-
### `
|
|
116
|
+
### `onexthm validate`
|
|
108
117
|
|
|
109
118
|
Validate theme structure and files.
|
|
110
119
|
|
|
@@ -113,7 +122,7 @@ Validate theme structure and files.
|
|
|
113
122
|
| `-t, --theme <theme>` | Theme to validate |
|
|
114
123
|
| `-f, --fix` | Auto-fix issues (not yet implemented) |
|
|
115
124
|
|
|
116
|
-
### `
|
|
125
|
+
### `onexthm build`
|
|
117
126
|
|
|
118
127
|
Build a theme for production. Runs type-check, lint, and compilation.
|
|
119
128
|
|
|
@@ -129,7 +138,7 @@ Build a theme for production. Runs type-check, lint, and compilation.
|
|
|
129
138
|
> { "scripts": { "type-check": "tsc --noEmit", "lint": "eslint src" } }
|
|
130
139
|
> ```
|
|
131
140
|
|
|
132
|
-
### `
|
|
141
|
+
### `onexthm package`
|
|
133
142
|
|
|
134
143
|
Compile and package a theme as a distributable zip file.
|
|
135
144
|
|
|
@@ -141,7 +150,7 @@ Compile and package a theme as a distributable zip file.
|
|
|
141
150
|
| `-m, --minify` | Minify compiled output |
|
|
142
151
|
| `--skip-build` | Skip compilation, use existing compiled theme |
|
|
143
152
|
|
|
144
|
-
### `
|
|
153
|
+
### `onexthm deploy`
|
|
145
154
|
|
|
146
155
|
Upload a theme package to the API server.
|
|
147
156
|
|
|
@@ -153,7 +162,7 @@ Upload a theme package to the API server.
|
|
|
153
162
|
| `-k, --api-key <key>` | API key for authentication |
|
|
154
163
|
| `-e, --environment <env>` | Environment (`production`, `staging`, `development`) |
|
|
155
164
|
|
|
156
|
-
### `
|
|
165
|
+
### `onexthm upload`
|
|
157
166
|
|
|
158
167
|
Upload compiled theme to S3 as `bundle.zip` + `source.zip`.
|
|
159
168
|
|
|
@@ -169,19 +178,19 @@ Upload compiled theme to S3 as `bundle.zip` + `source.zip`.
|
|
|
169
178
|
|
|
170
179
|
```bash
|
|
171
180
|
# Dry run first
|
|
172
|
-
|
|
181
|
+
onexthm upload --theme simple --dry-run
|
|
173
182
|
|
|
174
183
|
# Upload to staging
|
|
175
|
-
|
|
184
|
+
onexthm upload --theme simple
|
|
176
185
|
|
|
177
186
|
# Upload to production
|
|
178
|
-
|
|
187
|
+
onexthm upload --theme simple -e production
|
|
179
188
|
|
|
180
189
|
# Override bucket
|
|
181
|
-
|
|
190
|
+
onexthm upload --theme simple --bucket custom-bucket
|
|
182
191
|
```
|
|
183
192
|
|
|
184
|
-
### `
|
|
193
|
+
### `onexthm download`
|
|
185
194
|
|
|
186
195
|
Download a compiled theme from S3.
|
|
187
196
|
|
|
@@ -193,7 +202,7 @@ Download a compiled theme from S3.
|
|
|
193
202
|
| `-e, --environment <env>` | Environment (`staging` or `production`) |
|
|
194
203
|
| `-o, --output <dir>` | Output directory (default: `./active-theme`) |
|
|
195
204
|
|
|
196
|
-
### `
|
|
205
|
+
### `onexthm clone <theme-name>`
|
|
197
206
|
|
|
198
207
|
Clone theme source code from S3.
|
|
199
208
|
|
|
@@ -207,20 +216,77 @@ Clone theme source code from S3.
|
|
|
207
216
|
| `--no-install` | Skip running `pnpm install` after clone |
|
|
208
217
|
|
|
209
218
|
```bash
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
219
|
+
onexthm clone simple
|
|
220
|
+
onexthm clone simple -n my-store
|
|
221
|
+
onexthm clone simple -v 1.0.0 -o ./my-clone --no-install
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `onexthm login`
|
|
225
|
+
|
|
226
|
+
Authenticate with the OneX platform. Stores encrypted JWT token in `~/.onexthm/auth.json`.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
onexthm login
|
|
230
|
+
# Email: dev@example.com
|
|
231
|
+
# Password: ********
|
|
232
|
+
# ✓ Logged in! Token stored securely.
|
|
213
233
|
```
|
|
214
234
|
|
|
215
|
-
|
|
235
|
+
Required before `onexthm publish`. Token auto-refreshes on expiry.
|
|
216
236
|
|
|
217
|
-
|
|
237
|
+
### `onexthm logout`
|
|
238
|
+
|
|
239
|
+
Clear stored authentication tokens.
|
|
218
240
|
|
|
219
241
|
```bash
|
|
220
|
-
|
|
242
|
+
onexthm logout
|
|
221
243
|
```
|
|
222
244
|
|
|
223
|
-
|
|
245
|
+
### `onexthm whoami`
|
|
246
|
+
|
|
247
|
+
Show current logged-in developer info.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
onexthm whoami
|
|
251
|
+
# Email: dev@example.com
|
|
252
|
+
# Company: 9e61d187-...
|
|
253
|
+
# Status: ✓ Active
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### `onexthm publish`
|
|
257
|
+
|
|
258
|
+
Build, scan, and publish theme to the marketplace. Requires login.
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
onexthm publish
|
|
262
|
+
# ✓ Logged in as dev@example.com
|
|
263
|
+
# Publishing my-store v1.0.0...
|
|
264
|
+
# 1. Registering theme... ✓
|
|
265
|
+
# 2. Building... ✓ (54 KB)
|
|
266
|
+
# 3. Getting upload URL... ✓
|
|
267
|
+
# 4. Uploading bundle... ✓
|
|
268
|
+
# 5. Uploading source... ✓
|
|
269
|
+
# 6. Scanning & publishing... ✓ Published!
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
| Option | Description |
|
|
273
|
+
| -------------------- | -------------------- |
|
|
274
|
+
| `-t, --theme <path>` | Theme directory path |
|
|
275
|
+
|
|
276
|
+
Security features:
|
|
277
|
+
|
|
278
|
+
- **Ownership check** — only theme owner can publish updates
|
|
279
|
+
- **Presigned URLs** — no AWS credentials needed
|
|
280
|
+
- **Security scan** — blocks eval(), XSS, crypto mining, data exfiltration
|
|
281
|
+
- **Audit logging** — every publish is logged with developer identity
|
|
282
|
+
|
|
283
|
+
### `onexthm config` (Legacy)
|
|
284
|
+
|
|
285
|
+
Interactive setup for S3 credentials. **Not needed for `onexthm publish`** — use `onexthm login` instead.
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
onexthm config
|
|
289
|
+
```
|
|
224
290
|
|
|
225
291
|
| Key | Description | Required |
|
|
226
292
|
| ------------------------ | --------------------- | -------- |
|
|
@@ -237,19 +303,19 @@ Run this once after installing the CLI. Re-run anytime to update values.
|
|
|
237
303
|
|
|
238
304
|
The `upload`, `download`, and `clone` commands use S3 for storage.
|
|
239
305
|
|
|
240
|
-
### Recommended: use `
|
|
306
|
+
### Recommended: use `onexthm config`
|
|
241
307
|
|
|
242
308
|
```bash
|
|
243
|
-
# One-time setup — saves credentials to ~/.
|
|
244
|
-
|
|
309
|
+
# One-time setup — saves credentials to ~/.onexthm/.env
|
|
310
|
+
onexthm config
|
|
245
311
|
```
|
|
246
312
|
|
|
247
|
-
After running `
|
|
313
|
+
After running `onexthm config`, all S3 commands work from any directory:
|
|
248
314
|
|
|
249
315
|
```bash
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
316
|
+
onexthm clone simple # works anywhere
|
|
317
|
+
onexthm upload --theme simple # picks up config automatically
|
|
318
|
+
onexthm download -t simple # same
|
|
253
319
|
```
|
|
254
320
|
|
|
255
321
|
### Manual configuration
|
|
@@ -257,7 +323,7 @@ onex download -t simple # same
|
|
|
257
323
|
The CLI loads env files in this order (first found wins):
|
|
258
324
|
|
|
259
325
|
1. **Project-level**: `.env.local` and `.env` at the project root
|
|
260
|
-
2. **Global**: `~/.
|
|
326
|
+
2. **Global**: `~/.onexthm/.env` (set by `onexthm config`, or create manually)
|
|
261
327
|
|
|
262
328
|
### Adapter Modes
|
|
263
329
|
|
|
@@ -334,7 +400,7 @@ packages/cli/
|
|
|
334
400
|
│ ├── file-helpers.ts # File operations & project detection
|
|
335
401
|
│ └── validators.ts # Input validation
|
|
336
402
|
├── bin/
|
|
337
|
-
│ └──
|
|
403
|
+
│ └── onexthm.js # Executable entry point
|
|
338
404
|
├── templates/ # Scaffolding templates
|
|
339
405
|
└── package.json
|
|
340
406
|
```
|
package/bin/onexthm.js
ADDED