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