@onexapis/cli 1.1.17 → 1.1.19

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.
Files changed (61) hide show
  1. package/README.md +82 -16
  2. package/dist/cli.js +621 -294
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cli.mjs +618 -291
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/index.js +73 -278
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +73 -278
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/templates/default/.env.example +1 -1
  12. package/templates/default/.mcp.json +8 -0
  13. package/templates/default/CLAUDE.md +941 -0
  14. package/templates/default/bundle-entry.ts +18 -0
  15. package/templates/default/index.ts +26 -0
  16. package/templates/default/package.json +34 -0
  17. package/templates/default/pages/about.ts +66 -0
  18. package/templates/default/pages/home.ts +93 -0
  19. package/templates/default/pages/showcase.ts +146 -0
  20. package/templates/default/sections/about/about-default.tsx +237 -0
  21. package/templates/default/sections/about/about.schema.ts +259 -0
  22. package/templates/default/sections/about/index.ts +15 -0
  23. package/templates/default/sections/cta/cta-default.tsx +180 -0
  24. package/templates/default/sections/cta/cta.schema.ts +210 -0
  25. package/templates/default/sections/cta/index.ts +11 -0
  26. package/templates/default/sections/features/features-default.tsx +154 -0
  27. package/templates/default/sections/features/features.schema.ts +330 -0
  28. package/templates/default/sections/features/index.ts +11 -0
  29. package/templates/default/sections/gallery/gallery-default.tsx +134 -0
  30. package/templates/default/sections/gallery/gallery.schema.ts +397 -0
  31. package/templates/default/sections/gallery/index.ts +11 -0
  32. package/templates/default/sections/hero/hero-default.tsx +212 -0
  33. package/templates/default/sections/hero/hero.schema.ts +273 -0
  34. package/templates/default/sections/hero/index.ts +15 -0
  35. package/templates/default/sections/stats/index.ts +11 -0
  36. package/templates/default/sections/stats/stats-default.tsx +103 -0
  37. package/templates/default/sections/stats/stats.schema.ts +266 -0
  38. package/templates/default/sections/testimonials/index.ts +11 -0
  39. package/templates/default/sections/testimonials/testimonials-default.tsx +130 -0
  40. package/templates/default/sections/testimonials/testimonials.schema.ts +371 -0
  41. package/templates/default/sections-registry.ts +32 -0
  42. package/templates/default/theme.config.ts +107 -0
  43. package/templates/default/theme.layout.ts +21 -0
  44. package/templates/default/tsconfig.json +16 -7
  45. package/templates/default/README.md.ejs +0 -129
  46. package/templates/default/esbuild.config.js +0 -81
  47. package/templates/default/package.json.ejs +0 -31
  48. package/templates/default/src/config.ts.ejs +0 -98
  49. package/templates/default/src/index.ts.ejs +0 -11
  50. package/templates/default/src/layout.ts +0 -23
  51. package/templates/default/src/manifest.ts.ejs +0 -47
  52. package/templates/default/src/pages/home.ts.ejs +0 -37
  53. package/templates/default/src/sections/footer/footer-default.tsx +0 -28
  54. package/templates/default/src/sections/footer/footer.schema.ts +0 -45
  55. package/templates/default/src/sections/footer/index.ts +0 -2
  56. package/templates/default/src/sections/header/header-default.tsx +0 -61
  57. package/templates/default/src/sections/header/header.schema.ts +0 -46
  58. package/templates/default/src/sections/header/index.ts +0 -2
  59. package/templates/default/src/sections/hero/hero-default.tsx +0 -52
  60. package/templates/default/src/sections/hero/hero.schema.ts +0 -52
  61. package/templates/default/src/sections/hero/index.ts +0 -2
package/README.md CHANGED
@@ -19,24 +19,33 @@ Requires Node.js >= 18.
19
19
  ## Quick Start
20
20
 
21
21
  ```bash
22
- # 1. Configure credentials (one-time setup)
23
- onexthm config
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
- # Or clone an existing theme
29
- onexthm clone simple
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
- ```bash
33
- # Other useful commands
34
- onexthm list # List themes, sections, blocks
35
- onexthm create:section hero --theme simple # Scaffold a section
36
- onexthm validate --theme simple # Validate theme structure
37
- onexthm build --theme simple # Build a theme
38
- onexthm upload --theme simple # Upload to S3
39
- onexthm clone simple # Clone a theme from S3
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
@@ -212,15 +221,72 @@ onexthm clone simple -n my-store
212
221
  onexthm clone simple -v 1.0.0 -o ./my-clone --no-install
213
222
  ```
214
223
 
215
- ### `onexthm config`
224
+ ### `onexthm login`
216
225
 
217
- Interactive setup for CLI credentials. Saves configuration to `~/.onexthm/.env` so S3 commands (`clone`, `upload`, `download`) work from any directory.
226
+ Authenticate with the OneX platform. Stores encrypted JWT token in `~/.onexthm/auth.json`.
218
227
 
219
228
  ```bash
220
- onexthm config
229
+ onexthm login
230
+ # Email: dev@example.com
231
+ # Password: ********
232
+ # ✓ Logged in! Token stored securely.
233
+ ```
234
+
235
+ Required before `onexthm publish`. Token auto-refreshes on expiry.
236
+
237
+ ### `onexthm logout`
238
+
239
+ Clear stored authentication tokens.
240
+
241
+ ```bash
242
+ onexthm logout
221
243
  ```
222
244
 
223
- Prompts for:
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
  | ------------------------ | --------------------- | -------- |