@onexapis/cli 1.1.16 → 1.1.17
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 +46 -46
- package/bin/onexthm.js +4 -0
- package/dist/cli.js +230 -44
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +230 -44
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +115 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +115 -29
- package/dist/index.mjs.map +1 -1
- package/dist/preview/preview-app.tsx +175 -53
- package/package.json +14 -12
package/README.md
CHANGED
|
@@ -20,28 +20,28 @@ Requires Node.js >= 18.
|
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
# 1. Configure credentials (one-time setup)
|
|
23
|
-
|
|
23
|
+
onexthm config
|
|
24
24
|
|
|
25
25
|
# 2. Create a new theme project
|
|
26
|
-
|
|
26
|
+
onexthm init my-theme
|
|
27
27
|
|
|
28
28
|
# Or clone an existing theme
|
|
29
|
-
|
|
29
|
+
onexthm clone simple
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
# Other useful commands
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Commands
|
|
43
43
|
|
|
44
|
-
### `
|
|
44
|
+
### `onexthm init [project-name]`
|
|
45
45
|
|
|
46
46
|
Create a new OneX theme project from a template.
|
|
47
47
|
|
|
@@ -52,7 +52,7 @@ Create a new OneX theme project from a template.
|
|
|
52
52
|
| `--git` | Initialize a git repository |
|
|
53
53
|
| `-y, --yes` | Skip prompts and use defaults |
|
|
54
54
|
|
|
55
|
-
### `
|
|
55
|
+
### `onexthm create:section <name>` (alias: `cs`)
|
|
56
56
|
|
|
57
57
|
Scaffold a new section inside a theme.
|
|
58
58
|
|
|
@@ -63,11 +63,11 @@ Scaffold a new section inside a theme.
|
|
|
63
63
|
| `--template <template>` | Initial template variant (`default`, `minimal`) |
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
onexthm create:section hero -t my-theme -c heroes
|
|
67
|
+
onexthm cs featured-products -t my-store
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
### `
|
|
70
|
+
### `onexthm create:block <name>` (alias: `cb`)
|
|
71
71
|
|
|
72
72
|
Scaffold a new block.
|
|
73
73
|
|
|
@@ -76,11 +76,11 @@ Scaffold a new block.
|
|
|
76
76
|
| `-t, --theme <theme>` | Target theme (optional) |
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
onexthm create:block product-card
|
|
80
|
+
onexthm cb testimonial-item -t my-theme
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
### `
|
|
83
|
+
### `onexthm create:component <name>` (alias: `cc`)
|
|
84
84
|
|
|
85
85
|
Scaffold a new UI component.
|
|
86
86
|
|
|
@@ -89,11 +89,11 @@ Scaffold a new UI component.
|
|
|
89
89
|
| `-t, --type <type>` | Component type (`ui`, `layout`, `form`) |
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
onexthm create:component icon-badge
|
|
93
|
+
onexthm cc custom-input -t form
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
### `
|
|
96
|
+
### `onexthm list`
|
|
97
97
|
|
|
98
98
|
List available themes, sections, blocks, and components in the project.
|
|
99
99
|
|
|
@@ -104,7 +104,7 @@ List available themes, sections, blocks, and components in the project.
|
|
|
104
104
|
| `-c, --components` | List components only |
|
|
105
105
|
| `-t, --theme <theme>` | Filter by theme |
|
|
106
106
|
|
|
107
|
-
### `
|
|
107
|
+
### `onexthm validate`
|
|
108
108
|
|
|
109
109
|
Validate theme structure and files.
|
|
110
110
|
|
|
@@ -113,7 +113,7 @@ Validate theme structure and files.
|
|
|
113
113
|
| `-t, --theme <theme>` | Theme to validate |
|
|
114
114
|
| `-f, --fix` | Auto-fix issues (not yet implemented) |
|
|
115
115
|
|
|
116
|
-
### `
|
|
116
|
+
### `onexthm build`
|
|
117
117
|
|
|
118
118
|
Build a theme for production. Runs type-check, lint, and compilation.
|
|
119
119
|
|
|
@@ -129,7 +129,7 @@ Build a theme for production. Runs type-check, lint, and compilation.
|
|
|
129
129
|
> { "scripts": { "type-check": "tsc --noEmit", "lint": "eslint src" } }
|
|
130
130
|
> ```
|
|
131
131
|
|
|
132
|
-
### `
|
|
132
|
+
### `onexthm package`
|
|
133
133
|
|
|
134
134
|
Compile and package a theme as a distributable zip file.
|
|
135
135
|
|
|
@@ -141,7 +141,7 @@ Compile and package a theme as a distributable zip file.
|
|
|
141
141
|
| `-m, --minify` | Minify compiled output |
|
|
142
142
|
| `--skip-build` | Skip compilation, use existing compiled theme |
|
|
143
143
|
|
|
144
|
-
### `
|
|
144
|
+
### `onexthm deploy`
|
|
145
145
|
|
|
146
146
|
Upload a theme package to the API server.
|
|
147
147
|
|
|
@@ -153,7 +153,7 @@ Upload a theme package to the API server.
|
|
|
153
153
|
| `-k, --api-key <key>` | API key for authentication |
|
|
154
154
|
| `-e, --environment <env>` | Environment (`production`, `staging`, `development`) |
|
|
155
155
|
|
|
156
|
-
### `
|
|
156
|
+
### `onexthm upload`
|
|
157
157
|
|
|
158
158
|
Upload compiled theme to S3 as `bundle.zip` + `source.zip`.
|
|
159
159
|
|
|
@@ -169,19 +169,19 @@ Upload compiled theme to S3 as `bundle.zip` + `source.zip`.
|
|
|
169
169
|
|
|
170
170
|
```bash
|
|
171
171
|
# Dry run first
|
|
172
|
-
|
|
172
|
+
onexthm upload --theme simple --dry-run
|
|
173
173
|
|
|
174
174
|
# Upload to staging
|
|
175
|
-
|
|
175
|
+
onexthm upload --theme simple
|
|
176
176
|
|
|
177
177
|
# Upload to production
|
|
178
|
-
|
|
178
|
+
onexthm upload --theme simple -e production
|
|
179
179
|
|
|
180
180
|
# Override bucket
|
|
181
|
-
|
|
181
|
+
onexthm upload --theme simple --bucket custom-bucket
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
### `
|
|
184
|
+
### `onexthm download`
|
|
185
185
|
|
|
186
186
|
Download a compiled theme from S3.
|
|
187
187
|
|
|
@@ -193,7 +193,7 @@ Download a compiled theme from S3.
|
|
|
193
193
|
| `-e, --environment <env>` | Environment (`staging` or `production`) |
|
|
194
194
|
| `-o, --output <dir>` | Output directory (default: `./active-theme`) |
|
|
195
195
|
|
|
196
|
-
### `
|
|
196
|
+
### `onexthm clone <theme-name>`
|
|
197
197
|
|
|
198
198
|
Clone theme source code from S3.
|
|
199
199
|
|
|
@@ -207,17 +207,17 @@ Clone theme source code from S3.
|
|
|
207
207
|
| `--no-install` | Skip running `pnpm install` after clone |
|
|
208
208
|
|
|
209
209
|
```bash
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
onexthm clone simple
|
|
211
|
+
onexthm clone simple -n my-store
|
|
212
|
+
onexthm clone simple -v 1.0.0 -o ./my-clone --no-install
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
### `
|
|
215
|
+
### `onexthm config`
|
|
216
216
|
|
|
217
|
-
Interactive setup for CLI credentials. Saves configuration to `~/.
|
|
217
|
+
Interactive setup for CLI credentials. Saves configuration to `~/.onexthm/.env` so S3 commands (`clone`, `upload`, `download`) work from any directory.
|
|
218
218
|
|
|
219
219
|
```bash
|
|
220
|
-
|
|
220
|
+
onexthm config
|
|
221
221
|
```
|
|
222
222
|
|
|
223
223
|
Prompts for:
|
|
@@ -237,19 +237,19 @@ Run this once after installing the CLI. Re-run anytime to update values.
|
|
|
237
237
|
|
|
238
238
|
The `upload`, `download`, and `clone` commands use S3 for storage.
|
|
239
239
|
|
|
240
|
-
### Recommended: use `
|
|
240
|
+
### Recommended: use `onexthm config`
|
|
241
241
|
|
|
242
242
|
```bash
|
|
243
|
-
# One-time setup — saves credentials to ~/.
|
|
244
|
-
|
|
243
|
+
# One-time setup — saves credentials to ~/.onexthm/.env
|
|
244
|
+
onexthm config
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
After running `
|
|
247
|
+
After running `onexthm config`, all S3 commands work from any directory:
|
|
248
248
|
|
|
249
249
|
```bash
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
onexthm clone simple # works anywhere
|
|
251
|
+
onexthm upload --theme simple # picks up config automatically
|
|
252
|
+
onexthm download -t simple # same
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
### Manual configuration
|
|
@@ -257,7 +257,7 @@ onex download -t simple # same
|
|
|
257
257
|
The CLI loads env files in this order (first found wins):
|
|
258
258
|
|
|
259
259
|
1. **Project-level**: `.env.local` and `.env` at the project root
|
|
260
|
-
2. **Global**: `~/.
|
|
260
|
+
2. **Global**: `~/.onexthm/.env` (set by `onexthm config`, or create manually)
|
|
261
261
|
|
|
262
262
|
### Adapter Modes
|
|
263
263
|
|
|
@@ -334,7 +334,7 @@ packages/cli/
|
|
|
334
334
|
│ ├── file-helpers.ts # File operations & project detection
|
|
335
335
|
│ └── validators.ts # Input validation
|
|
336
336
|
├── bin/
|
|
337
|
-
│ └──
|
|
337
|
+
│ └── onexthm.js # Executable entry point
|
|
338
338
|
├── templates/ # Scaffolding templates
|
|
339
339
|
└── package.json
|
|
340
340
|
```
|
package/bin/onexthm.js
ADDED