cmssy-cli 0.7.0 → 0.9.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 +382 -36
- package/dist/cli.js +29 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +147 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +20 -16
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/package.d.ts +7 -0
- package/dist/commands/package.d.ts.map +1 -0
- package/dist/commands/package.js +161 -0
- package/dist/commands/package.js.map +1 -0
- package/dist/commands/publish.d.ts +12 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +395 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/push.d.ts +9 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +199 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/upload.d.ts +7 -0
- package/dist/commands/upload.d.ts.map +1 -0
- package/dist/commands/upload.js +126 -0
- package/dist/commands/upload.js.map +1 -0
- package/dist/dev-ui/app.js +163 -2
- package/dist/dev-ui/index.html +396 -2
- package/dist/utils/cmssy-config.d.ts +0 -3
- package/dist/utils/cmssy-config.d.ts.map +1 -1
- package/dist/utils/cmssy-config.js.map +1 -1
- package/dist/utils/config.d.ts +1 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +1 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/graphql.d.ts +1 -0
- package/dist/utils/graphql.d.ts.map +1 -1
- package/dist/utils/graphql.js +28 -0
- package/dist/utils/graphql.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -21,21 +21,42 @@ cd my-blocks
|
|
|
21
21
|
npm install
|
|
22
22
|
|
|
23
23
|
# 4. Start development server
|
|
24
|
-
|
|
24
|
+
cmssy dev
|
|
25
25
|
|
|
26
26
|
# 5. Create a new block
|
|
27
|
-
|
|
27
|
+
cmssy create block my-block
|
|
28
28
|
|
|
29
29
|
# 6. Build for production
|
|
30
|
-
|
|
30
|
+
cmssy build
|
|
31
31
|
|
|
32
32
|
# 7. Configure Cmssy API (for publishing)
|
|
33
|
-
|
|
33
|
+
cmssy configure
|
|
34
34
|
|
|
35
|
-
# 8.
|
|
36
|
-
|
|
35
|
+
# 8. Publish to marketplace or workspace
|
|
36
|
+
cmssy publish --all --marketplace
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
## Environment Configuration
|
|
40
|
+
|
|
41
|
+
Create a `.env` file in your project root with the following variables:
|
|
42
|
+
|
|
43
|
+
```env
|
|
44
|
+
# Required for publishing
|
|
45
|
+
CMSSY_API_URL=https://api.cmssy.io/graphql
|
|
46
|
+
CMSSY_API_TOKEN=your_api_token_here
|
|
47
|
+
|
|
48
|
+
# Optional - default workspace ID for publishing
|
|
49
|
+
CMSSY_WORKSPACE_ID=ws_abc123
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**How to get API Token:**
|
|
53
|
+
1. Go to your Cmssy workspace settings
|
|
54
|
+
2. Navigate to "API Tokens"
|
|
55
|
+
3. Create a new token with `marketplace:publish` or `workspace:write` scope
|
|
56
|
+
4. Copy the token to your `.env` file
|
|
57
|
+
|
|
58
|
+
Run `cmssy configure` for interactive setup.
|
|
59
|
+
|
|
39
60
|
## Commands
|
|
40
61
|
|
|
41
62
|
### Initialize Project
|
|
@@ -54,6 +75,14 @@ Create a new Cmssy project with example blocks.
|
|
|
54
75
|
cmssy init my-blocks --framework react
|
|
55
76
|
```
|
|
56
77
|
|
|
78
|
+
**What it creates:**
|
|
79
|
+
- Project structure with `blocks/` and `templates/` directories
|
|
80
|
+
- Example hero block
|
|
81
|
+
- `cmssy.config.js` configuration file
|
|
82
|
+
- `.env.example` with API configuration template
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
57
86
|
### Create Block or Template
|
|
58
87
|
|
|
59
88
|
```bash
|
|
@@ -69,6 +98,14 @@ cmssy create block hero
|
|
|
69
98
|
cmssy create template landing-page
|
|
70
99
|
```
|
|
71
100
|
|
|
101
|
+
**What it creates:**
|
|
102
|
+
- `blocks/<name>/` or `templates/<name>/` directory
|
|
103
|
+
- `package.json` with metadata
|
|
104
|
+
- `preview.json` for dev server
|
|
105
|
+
- `src/` directory with component scaffold
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
72
109
|
### Build
|
|
73
110
|
|
|
74
111
|
```bash
|
|
@@ -87,13 +124,15 @@ cmssy build
|
|
|
87
124
|
|
|
88
125
|
**Output:** Built files are generated in `public/@vendor/package-name/version/` directory.
|
|
89
126
|
|
|
127
|
+
---
|
|
128
|
+
|
|
90
129
|
### Development Server
|
|
91
130
|
|
|
92
131
|
```bash
|
|
93
132
|
cmssy dev [options]
|
|
94
133
|
```
|
|
95
134
|
|
|
96
|
-
Start development server with hot reload and preview.
|
|
135
|
+
Start development server with hot reload and preview UI.
|
|
97
136
|
|
|
98
137
|
**Options:**
|
|
99
138
|
- `-p, --port <port>` - Port number. Default: 3000
|
|
@@ -103,6 +142,15 @@ Start development server with hot reload and preview.
|
|
|
103
142
|
cmssy dev --port 4000
|
|
104
143
|
```
|
|
105
144
|
|
|
145
|
+
**Features:**
|
|
146
|
+
- Hot reload on file changes
|
|
147
|
+
- Interactive block preview
|
|
148
|
+
- Publish blocks directly from UI
|
|
149
|
+
- Live progress tracking
|
|
150
|
+
- Version badges and status indicators
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
106
154
|
### Configure API
|
|
107
155
|
|
|
108
156
|
```bash
|
|
@@ -123,37 +171,131 @@ You'll be prompted for:
|
|
|
123
171
|
- **Cmssy API URL**: `https://api.cmssy.io/graphql` (or your local dev URL)
|
|
124
172
|
- **API Token**: Get this from your Cmssy workspace settings → API Tokens
|
|
125
173
|
|
|
126
|
-
|
|
174
|
+
Creates/updates `.env` file with your credentials.
|
|
127
175
|
|
|
128
|
-
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### Publish to Marketplace or Workspace
|
|
129
179
|
|
|
130
180
|
```bash
|
|
131
|
-
cmssy
|
|
181
|
+
cmssy publish [packages...] [options]
|
|
132
182
|
```
|
|
133
183
|
|
|
134
|
-
Publish blocks/templates to
|
|
184
|
+
Publish blocks/templates to public marketplace (with review) or private workspace (instant).
|
|
135
185
|
|
|
136
186
|
**Options:**
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
- `--
|
|
140
|
-
- `--
|
|
187
|
+
- `-m, --marketplace` - Publish to public marketplace (requires review)
|
|
188
|
+
- `-w, --workspace [id]` - Publish to workspace (private, no review)
|
|
189
|
+
- `--all` - Publish all blocks and templates
|
|
190
|
+
- `--patch` - Bump patch version (1.0.0 → 1.0.1)
|
|
191
|
+
- `--minor` - Bump minor version (1.0.0 → 1.1.0)
|
|
192
|
+
- `--major` - Bump major version (1.0.0 → 2.0.0)
|
|
193
|
+
- `--dry-run` - Preview what would be published without uploading
|
|
141
194
|
|
|
142
195
|
**Example:**
|
|
143
196
|
```bash
|
|
144
|
-
#
|
|
145
|
-
cmssy
|
|
197
|
+
# Publish to marketplace (public, requires review)
|
|
198
|
+
cmssy publish hero --marketplace
|
|
199
|
+
cmssy publish --all --marketplace --patch
|
|
146
200
|
|
|
147
|
-
#
|
|
148
|
-
cmssy
|
|
201
|
+
# Publish to workspace (private, instant)
|
|
202
|
+
cmssy publish hero --workspace ws_abc123
|
|
203
|
+
cmssy publish --all --workspace
|
|
204
|
+
cmssy publish pricing --workspace --minor
|
|
149
205
|
|
|
150
|
-
#
|
|
151
|
-
cmssy
|
|
206
|
+
# Specific packages
|
|
207
|
+
cmssy publish hero pricing --marketplace
|
|
152
208
|
|
|
153
209
|
# Dry run
|
|
154
|
-
cmssy
|
|
210
|
+
cmssy publish --all --marketplace --dry-run
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Notes:**
|
|
214
|
+
- Must specify either `--marketplace` OR `--workspace` (not both)
|
|
215
|
+
- Workspace ID can be provided via flag or `CMSSY_WORKSPACE_ID` in `.env`
|
|
216
|
+
- Version bumping updates `package.json` before publishing
|
|
217
|
+
- Marketplace publish requires review, workspace publish is instant
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### Package into ZIP Files
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
cmssy package [packages...] [options]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Package blocks/templates into ZIP files for distribution or upload.
|
|
228
|
+
|
|
229
|
+
**Options:**
|
|
230
|
+
- `--all` - Package all blocks and templates
|
|
231
|
+
- `-o, --output <dir>` - Output directory. Default: packages
|
|
232
|
+
|
|
233
|
+
**Example:**
|
|
234
|
+
```bash
|
|
235
|
+
# Package single block
|
|
236
|
+
cmssy package hero
|
|
237
|
+
|
|
238
|
+
# Package multiple blocks
|
|
239
|
+
cmssy package hero pricing
|
|
240
|
+
|
|
241
|
+
# Package all blocks and templates
|
|
242
|
+
cmssy package --all
|
|
243
|
+
|
|
244
|
+
# Custom output directory
|
|
245
|
+
cmssy package --all --output dist/packages
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**What gets packaged:**
|
|
249
|
+
- Source files (`src/`)
|
|
250
|
+
- Configuration (`package.json`, `block.config.ts`)
|
|
251
|
+
- Preview data (`preview.json`)
|
|
252
|
+
- Built files (from `public/` if exists)
|
|
253
|
+
- README.md (if exists)
|
|
254
|
+
|
|
255
|
+
**Output:** `packages/<name>-<version>.zip` (e.g., `hero-1.0.0.zip`)
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
### Upload Packages to Workspace
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
cmssy upload [files...] [options]
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Upload packaged ZIP files directly to your Cmssy workspace.
|
|
266
|
+
|
|
267
|
+
**Options:**
|
|
268
|
+
- `-w, --workspace <id>` - Workspace ID to upload to
|
|
269
|
+
- `--all` - Upload all packages from packages directory
|
|
270
|
+
|
|
271
|
+
**Example:**
|
|
272
|
+
```bash
|
|
273
|
+
# Upload single package
|
|
274
|
+
cmssy upload hero-1.0.0.zip
|
|
275
|
+
|
|
276
|
+
# Upload multiple packages (with or without .zip extension)
|
|
277
|
+
cmssy upload hero-1.0.0 pricing-2.1.0
|
|
278
|
+
|
|
279
|
+
# Upload all packages
|
|
280
|
+
cmssy upload --all
|
|
281
|
+
|
|
282
|
+
# Specify workspace ID
|
|
283
|
+
cmssy upload --all --workspace ws_abc123
|
|
155
284
|
```
|
|
156
285
|
|
|
286
|
+
**Requirements:**
|
|
287
|
+
- Packages must exist in `packages/` directory (run `cmssy package` first)
|
|
288
|
+
- API token must be configured in `.env`
|
|
289
|
+
- Workspace ID via `--workspace` flag or `CMSSY_WORKSPACE_ID` in `.env`
|
|
290
|
+
|
|
291
|
+
**Typical workflow:**
|
|
292
|
+
```bash
|
|
293
|
+
cmssy package --all
|
|
294
|
+
cmssy upload --all
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
157
299
|
### Sync from Marketplace
|
|
158
300
|
|
|
159
301
|
```bash
|
|
@@ -167,14 +309,43 @@ Pull blocks from Cmssy marketplace to local project.
|
|
|
167
309
|
|
|
168
310
|
**Example:**
|
|
169
311
|
```bash
|
|
170
|
-
cmssy sync @vendor/blocks.hero
|
|
312
|
+
cmssy sync @vendor/blocks.hero
|
|
313
|
+
cmssy sync @vendor/blocks.hero --workspace ws_abc123
|
|
171
314
|
```
|
|
172
315
|
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
### Migrate to block.config.ts
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
cmssy migrate [block-name]
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Migrate from legacy `package.json` cmssy section to new `block.config.ts` format.
|
|
325
|
+
|
|
326
|
+
**Example:**
|
|
327
|
+
```bash
|
|
328
|
+
# Migrate specific block
|
|
329
|
+
cmssy migrate hero
|
|
330
|
+
|
|
331
|
+
# Migrate all blocks
|
|
332
|
+
cmssy migrate
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**What it does:**
|
|
336
|
+
- Converts `package.json` cmssy section to `block.config.ts`
|
|
337
|
+
- Removes cmssy section from `package.json`
|
|
338
|
+
- Generates TypeScript types from schema
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
173
342
|
## Project Structure
|
|
174
343
|
|
|
175
344
|
```
|
|
176
345
|
my-blocks/
|
|
177
346
|
├── cmssy.config.js # Project configuration
|
|
347
|
+
├── .env # API credentials (not committed)
|
|
348
|
+
├── .env.example # Example environment variables
|
|
178
349
|
├── blocks/ # Your blocks
|
|
179
350
|
│ └── hero/
|
|
180
351
|
│ ├── package.json # Block metadata
|
|
@@ -183,13 +354,15 @@ my-blocks/
|
|
|
183
354
|
│ ├── index.tsx # Block component
|
|
184
355
|
│ └── index.css # Block styles
|
|
185
356
|
├── templates/ # Your page templates
|
|
357
|
+
├── packages/ # ZIP packages (created by cmssy package)
|
|
358
|
+
│ ├── hero-1.0.0.zip
|
|
359
|
+
│ └── pricing-2.1.0.zip
|
|
186
360
|
├── public/ # Build output
|
|
187
361
|
│ └── @vendor/package-name/version/
|
|
188
362
|
│ ├── index.js
|
|
189
363
|
│ ├── index.css
|
|
190
364
|
│ └── package.json
|
|
191
|
-
|
|
192
|
-
└── .env # API credentials
|
|
365
|
+
└── package.json
|
|
193
366
|
```
|
|
194
367
|
|
|
195
368
|
## Block Metadata
|
|
@@ -209,27 +382,200 @@ Each block requires a `cmssy` section in its `package.json`:
|
|
|
209
382
|
"pricing": {
|
|
210
383
|
"licenseType": "free"
|
|
211
384
|
},
|
|
212
|
-
"schemaFields": [
|
|
213
|
-
|
|
385
|
+
"schemaFields": [
|
|
386
|
+
{
|
|
387
|
+
"name": "title",
|
|
388
|
+
"type": "singleLine",
|
|
389
|
+
"label": "Section Title",
|
|
390
|
+
"defaultValue": "Welcome"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"defaultContent": {
|
|
394
|
+
"title": "Welcome to Our Platform"
|
|
395
|
+
}
|
|
214
396
|
}
|
|
215
397
|
}
|
|
216
398
|
```
|
|
217
399
|
|
|
400
|
+
## Publishing Workflows
|
|
401
|
+
|
|
402
|
+
### Marketplace Publishing (Public, Requires Review)
|
|
403
|
+
|
|
404
|
+
For vendors who want to share blocks publicly:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
# 1. Build your blocks
|
|
408
|
+
cmssy build
|
|
409
|
+
|
|
410
|
+
# 2. Publish to marketplace
|
|
411
|
+
cmssy publish --all --marketplace --patch
|
|
412
|
+
|
|
413
|
+
# 3. Wait for Cmssy team review
|
|
414
|
+
# 4. Once approved, blocks appear in public marketplace
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**Use cases:**
|
|
418
|
+
- Public blocks for all Cmssy users
|
|
419
|
+
- Commercial blocks/templates
|
|
420
|
+
- Open-source contributions
|
|
421
|
+
|
|
422
|
+
**Requirements:**
|
|
423
|
+
- API token with `marketplace:publish` scope
|
|
424
|
+
- Blocks undergo review process
|
|
425
|
+
- Must meet marketplace quality standards
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
### Workspace Publishing (Private, Instant)
|
|
430
|
+
|
|
431
|
+
For teams with private block libraries:
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
# 1. Build your blocks
|
|
435
|
+
cmssy build
|
|
436
|
+
|
|
437
|
+
# 2. Publish to workspace
|
|
438
|
+
cmssy publish --all --workspace ws_abc123 --patch
|
|
439
|
+
|
|
440
|
+
# 3. Instantly available in your workspace
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Use cases:**
|
|
444
|
+
- Private company block libraries
|
|
445
|
+
- Internal design systems
|
|
446
|
+
- Client-specific components
|
|
447
|
+
|
|
448
|
+
**Requirements:**
|
|
449
|
+
- API token with `workspace:write` scope
|
|
450
|
+
- Workspace ID
|
|
451
|
+
- No review required, instant publish
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
### ZIP Package Workflow (Manual Upload)
|
|
456
|
+
|
|
457
|
+
For manual distribution or custom upload:
|
|
458
|
+
|
|
459
|
+
```bash
|
|
460
|
+
# 1. Package blocks into ZIP files
|
|
461
|
+
cmssy package --all
|
|
462
|
+
|
|
463
|
+
# 2. Option A: Upload via CLI
|
|
464
|
+
cmssy upload --all --workspace ws_abc123
|
|
465
|
+
|
|
466
|
+
# 2. Option B: Upload manually
|
|
467
|
+
# - Go to http://localhost:3000/workspace/cmssy/resources/add-external
|
|
468
|
+
# - Upload the ZIP files from packages/ directory
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
**Use cases:**
|
|
472
|
+
- Manual review before upload
|
|
473
|
+
- Offline distribution
|
|
474
|
+
- Custom deployment pipelines
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## Environment Variables Reference
|
|
479
|
+
|
|
480
|
+
| Variable | Required | Description | Example |
|
|
481
|
+
|----------|----------|-------------|---------|
|
|
482
|
+
| `CMSSY_API_URL` | Yes (for publish/upload) | Cmssy API GraphQL endpoint | `https://api.cmssy.io/graphql` |
|
|
483
|
+
| `CMSSY_API_TOKEN` | Yes (for publish/upload) | API authentication token | `cmssy_abc123...` |
|
|
484
|
+
| `CMSSY_WORKSPACE_ID` | No | Default workspace ID | `ws_abc123` |
|
|
485
|
+
|
|
218
486
|
## Requirements
|
|
219
487
|
|
|
220
488
|
- Node.js 18+
|
|
489
|
+
- npm or yarn
|
|
490
|
+
|
|
491
|
+
## Complete Workflow Examples
|
|
221
492
|
|
|
222
|
-
|
|
493
|
+
### Example 1: New Public Block
|
|
223
494
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
495
|
+
```bash
|
|
496
|
+
# Initialize project
|
|
497
|
+
cmssy init my-blocks
|
|
498
|
+
cd my-blocks
|
|
499
|
+
|
|
500
|
+
# Create block
|
|
501
|
+
cmssy create block pricing-table
|
|
502
|
+
|
|
503
|
+
# Develop with hot reload
|
|
504
|
+
cmssy dev
|
|
505
|
+
|
|
506
|
+
# Build
|
|
507
|
+
cmssy build
|
|
508
|
+
|
|
509
|
+
# Configure API (one-time)
|
|
510
|
+
cmssy configure
|
|
511
|
+
|
|
512
|
+
# Publish to marketplace
|
|
513
|
+
cmssy publish pricing-table --marketplace --minor
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
### Example 2: Private Workspace Library
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
# Initialize project
|
|
522
|
+
cmssy init company-blocks
|
|
523
|
+
cd company-blocks
|
|
524
|
+
|
|
525
|
+
# Create multiple blocks
|
|
526
|
+
cmssy create block header
|
|
527
|
+
cmssy create block footer
|
|
528
|
+
cmssy create block cta
|
|
529
|
+
|
|
530
|
+
# Configure API with workspace
|
|
531
|
+
cmssy configure
|
|
532
|
+
# Add CMSSY_WORKSPACE_ID=ws_abc123 to .env
|
|
533
|
+
|
|
534
|
+
# Develop and test
|
|
535
|
+
cmssy dev
|
|
536
|
+
|
|
537
|
+
# Build and publish all to workspace
|
|
538
|
+
cmssy build
|
|
539
|
+
cmssy publish --all --workspace
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
### Example 3: ZIP Distribution
|
|
545
|
+
|
|
546
|
+
```bash
|
|
547
|
+
# Package blocks
|
|
548
|
+
cmssy package --all
|
|
549
|
+
|
|
550
|
+
# Distribute ZIP files
|
|
551
|
+
# - Upload manually to Cmssy workspace UI
|
|
552
|
+
# - Or use upload command:
|
|
553
|
+
cmssy upload --all --workspace ws_abc123
|
|
554
|
+
|
|
555
|
+
# Or share packages/hero-1.0.0.zip with team
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
## Troubleshooting
|
|
561
|
+
|
|
562
|
+
### "API token not configured"
|
|
563
|
+
Run `cmssy configure` or manually add `CMSSY_API_TOKEN` to `.env`
|
|
564
|
+
|
|
565
|
+
### "Workspace ID required"
|
|
566
|
+
Add `CMSSY_WORKSPACE_ID` to `.env` or use `--workspace ws_abc123` flag
|
|
567
|
+
|
|
568
|
+
### "Specify publish target"
|
|
569
|
+
Must use either `--marketplace` OR `--workspace` when publishing
|
|
570
|
+
|
|
571
|
+
### "Not a Cmssy project"
|
|
572
|
+
Make sure you're in a directory with `cmssy.config.js` file
|
|
232
573
|
|
|
233
574
|
## License
|
|
234
575
|
|
|
235
576
|
MIT
|
|
577
|
+
|
|
578
|
+
## Support
|
|
579
|
+
|
|
580
|
+
- Documentation: [https://cmssy.io/docs](https://cmssy.io/docs)
|
|
581
|
+
- Issues: [https://github.com/maciekbe1/cmssy-cli/issues](https://github.com/maciekbe1/cmssy-cli/issues)
|
package/dist/cli.js
CHANGED
|
@@ -3,16 +3,18 @@ import { Command } from "commander";
|
|
|
3
3
|
import { buildCommand } from "./commands/build.js";
|
|
4
4
|
import { configureCommand } from "./commands/configure.js";
|
|
5
5
|
import { createCommand } from "./commands/create.js";
|
|
6
|
-
import { deployCommand } from "./commands/deploy.js";
|
|
7
6
|
import { devCommand } from "./commands/dev.js";
|
|
8
7
|
import { initCommand } from "./commands/init.js";
|
|
9
8
|
import { syncCommand } from "./commands/sync.js";
|
|
10
9
|
import { migrateCommand } from "./commands/migrate.js";
|
|
10
|
+
import { publishCommand } from "./commands/publish.js";
|
|
11
|
+
import { packageCommand } from "./commands/package.js";
|
|
12
|
+
import { uploadCommand } from "./commands/upload.js";
|
|
11
13
|
const program = new Command();
|
|
12
14
|
program
|
|
13
15
|
.name("cmssy")
|
|
14
16
|
.description("Unified CLI for building and publishing blocks to Cmssy marketplace")
|
|
15
|
-
.version("0.
|
|
17
|
+
.version("0.9.0");
|
|
16
18
|
// cmssy init
|
|
17
19
|
program
|
|
18
20
|
.command("init")
|
|
@@ -52,15 +54,18 @@ program
|
|
|
52
54
|
.description("Configure Cmssy API credentials")
|
|
53
55
|
.option("--api-url <url>", "Cmssy API URL", "https://api.cmssy.io/graphql")
|
|
54
56
|
.action(configureCommand);
|
|
55
|
-
// cmssy
|
|
57
|
+
// cmssy publish
|
|
56
58
|
program
|
|
57
|
-
.command("
|
|
58
|
-
.description("Publish blocks/templates to
|
|
59
|
-
.option("--
|
|
60
|
-
.option("--
|
|
61
|
-
.option("--
|
|
62
|
-
.option("--
|
|
63
|
-
.
|
|
59
|
+
.command("publish [packages...]")
|
|
60
|
+
.description("Publish blocks/templates to marketplace or workspace")
|
|
61
|
+
.option("-m, --marketplace", "Publish to public marketplace (requires review)")
|
|
62
|
+
.option("-w, --workspace [id]", "Publish to workspace (private, no review)")
|
|
63
|
+
.option("--all", "Publish all blocks and templates")
|
|
64
|
+
.option("--patch", "Bump patch version (1.0.0 -> 1.0.1)")
|
|
65
|
+
.option("--minor", "Bump minor version (1.0.0 -> 1.1.0)")
|
|
66
|
+
.option("--major", "Bump major version (1.0.0 -> 2.0.0)")
|
|
67
|
+
.option("--dry-run", "Preview what would be published without uploading")
|
|
68
|
+
.action(publishCommand);
|
|
64
69
|
// cmssy sync
|
|
65
70
|
program
|
|
66
71
|
.command("sync")
|
|
@@ -73,5 +78,19 @@ program
|
|
|
73
78
|
.command("migrate [block-name]")
|
|
74
79
|
.description("Migrate from package.json cmssy section to block.config.ts")
|
|
75
80
|
.action(migrateCommand);
|
|
81
|
+
// cmssy package
|
|
82
|
+
program
|
|
83
|
+
.command("package [packages...]")
|
|
84
|
+
.description("Package blocks/templates into ZIP files")
|
|
85
|
+
.option("--all", "Package all blocks and templates")
|
|
86
|
+
.option("-o, --output <dir>", "Output directory", "packages")
|
|
87
|
+
.action(packageCommand);
|
|
88
|
+
// cmssy upload
|
|
89
|
+
program
|
|
90
|
+
.command("upload [files...]")
|
|
91
|
+
.description("Upload packaged ZIP files to workspace")
|
|
92
|
+
.option("-w, --workspace <id>", "Workspace ID to upload to")
|
|
93
|
+
.option("--all", "Upload all packages from packages directory")
|
|
94
|
+
.action(uploadCommand);
|
|
76
95
|
program.parse();
|
|
77
96
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B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A2B,CAAC;KAC3D,MAAM,CAAC,OAAO,EAAE,6CAA6C,CAAC;KAC9D,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAkBA,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAcD,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAkBA,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAcD,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,iBAmUnD"}
|