@cmssy/cli 0.12.1 → 0.13.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 +21 -0
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/skills.d.ts +8 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +75 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/skills/claude/cmssy-block.md +345 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -420,6 +420,27 @@ Team Project
|
|
|
420
420
|
|
|
421
421
|
- API token must be configured (run `cmssy configure` first)
|
|
422
422
|
|
|
423
|
+
### Install AI Assistant Skills
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
cmssy skills install # Claude Code skill, global (~/.claude/skills/)
|
|
427
|
+
cmssy skills install --local # Install into current project (./.claude/skills/)
|
|
428
|
+
cmssy skills install --force # Overwrite existing skill
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Drops the `cmssy-block` skill into your Claude Code config so the assistant knows
|
|
432
|
+
the full cmssy CLI lifecycle (init, link, create, dev, test, build, publish, sync)
|
|
433
|
+
and how to scaffold/edit blocks and templates correctly.
|
|
434
|
+
|
|
435
|
+
After installing, restart Claude Code (or start a new session) and ask it anything
|
|
436
|
+
about cmssy blocks, e.g. _"scaffold a pricing block and publish as patch"_.
|
|
437
|
+
|
|
438
|
+
**Options:**
|
|
439
|
+
|
|
440
|
+
- `--local` - install into `./.claude/skills/` in the current project (default: `~/.claude/skills/`)
|
|
441
|
+
- `--force` - overwrite an existing skill without prompting
|
|
442
|
+
- `-y, --yes` - non-interactive mode (fails instead of prompting on conflict)
|
|
443
|
+
|
|
423
444
|
---
|
|
424
445
|
|
|
425
446
|
## Project Structure
|
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,7 @@ import { syncCommand } from "./commands/sync.js";
|
|
|
15
15
|
import { migrateCommand } from "./commands/migrate.js";
|
|
16
16
|
import { publishCommand } from "./commands/publish.js";
|
|
17
17
|
import { packageCommand } from "./commands/package.js";
|
|
18
|
+
import { skillsInstallCommand } from "./commands/skills.js";
|
|
18
19
|
import { uploadCommand } from "./commands/upload.js";
|
|
19
20
|
import { workspacesCommand } from "./commands/workspaces.js";
|
|
20
21
|
import { readFileSync } from "fs";
|
|
@@ -285,6 +286,28 @@ Use workspace IDs with:
|
|
|
285
286
|
$ cmssy sync --workspace <id>
|
|
286
287
|
`)
|
|
287
288
|
.action(workspacesCommand);
|
|
289
|
+
// cmssy skills
|
|
290
|
+
const skills = program
|
|
291
|
+
.command("skills")
|
|
292
|
+
.description("Install AI coding-assistant skills for cmssy");
|
|
293
|
+
skills
|
|
294
|
+
.command("install")
|
|
295
|
+
.description("Install a skill into your AI assistant's config directory")
|
|
296
|
+
.argument("[target]", "Target assistant: claude", "claude")
|
|
297
|
+
.option("--local", "Install into ./.claude/skills (default: ~/.claude/skills)")
|
|
298
|
+
.option("--force", "Overwrite existing skill without prompting")
|
|
299
|
+
.option("-y, --yes", "Non-interactive mode (fail instead of prompting)")
|
|
300
|
+
.addHelpText("after", `
|
|
301
|
+
Examples:
|
|
302
|
+
$ cmssy skills install Install Claude Code skill globally
|
|
303
|
+
$ cmssy skills install claude Same as above (explicit)
|
|
304
|
+
$ cmssy skills install --local Install into current project's .claude/
|
|
305
|
+
$ cmssy skills install --force Overwrite existing skill
|
|
306
|
+
|
|
307
|
+
The Claude Code skill teaches the assistant the full cmssy CLI lifecycle
|
|
308
|
+
(init, link, create, dev, test, build, publish, sync).
|
|
309
|
+
`)
|
|
310
|
+
.action((target, options) => skillsInstallCommand(target, options));
|
|
288
311
|
// cmssy add-source (hidden - use `cmssy publish --with-source` instead)
|
|
289
312
|
program.addCommand(new Command("add-source")
|
|
290
313
|
.argument("[blocks...]")
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.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CAAC,UAAU,CAChB,IAAI,OAAO,CAAC,SAAS,CAAC;KACnB,WAAW,CACV,gEAAgE,CACjE;KACA,MAAM,CAAC,wBAAwB,EAAE,gBAAgB,CAAC;KAClD,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,sBAAsB,CAAC;KACzE,MAAM,CACL,QAAQ,EACR,4DAA4D,CAC7D;KACA,WAAW,CACV,OAAO,EACP;;;;;CAKL,CACI;KACA,MAAM,CAAC,cAAc,CAAC,EACzB,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAC;AAEF,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface SkillsInstallOptions {
|
|
2
|
+
local?: boolean;
|
|
3
|
+
force?: boolean;
|
|
4
|
+
yes?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function skillsInstallCommand(rawTarget: string | undefined, options: SkillsInstallOptions): Promise<void>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAqDA,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAgEf"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import inquirer from "inquirer";
|
|
4
|
+
import os from "os";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
const SKILLS_ROOT = path.resolve(__dirname, "../skills");
|
|
10
|
+
const SKILLS = {
|
|
11
|
+
claude: {
|
|
12
|
+
target: "claude",
|
|
13
|
+
label: "Claude Code",
|
|
14
|
+
sourcePath: path.join(SKILLS_ROOT, "claude", "cmssy-block.md"),
|
|
15
|
+
destFilename: "SKILL.md",
|
|
16
|
+
resolveInstallDir: ({ local, cwd }) => local
|
|
17
|
+
? path.join(cwd, ".claude", "skills", "cmssy-block")
|
|
18
|
+
: path.join(os.homedir(), ".claude", "skills", "cmssy-block"),
|
|
19
|
+
postInstallHint: (installPath) => [
|
|
20
|
+
chalk.gray("Next step:"),
|
|
21
|
+
chalk.white(" Restart Claude Code (or open a new session) so it picks up the skill."),
|
|
22
|
+
chalk.gray(" Then ask it anything about cmssy blocks, e.g.:"),
|
|
23
|
+
chalk.white(' "scaffold a pricing block and publish as patch"'),
|
|
24
|
+
"",
|
|
25
|
+
chalk.gray(`Installed at: ${installPath}`),
|
|
26
|
+
].join("\n"),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export async function skillsInstallCommand(rawTarget, options) {
|
|
30
|
+
const target = (rawTarget ?? "claude").trim().toLowerCase();
|
|
31
|
+
if (!Object.hasOwn(SKILLS, target)) {
|
|
32
|
+
console.error(chalk.red(`✖ Unknown skill target: ${rawTarget}`) +
|
|
33
|
+
chalk.gray(`\n Supported: ${Object.keys(SKILLS).join(", ")}`));
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
const skill = SKILLS[target];
|
|
37
|
+
if (!(await fs.pathExists(skill.sourcePath))) {
|
|
38
|
+
console.error(chalk.red(`✖ Skill source missing: ${skill.sourcePath}`) +
|
|
39
|
+
chalk.gray("\n This is a packaging bug - please report it at https://github.com/cmssy-io/cmssy-cli/issues"));
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
const installDir = skill.resolveInstallDir({
|
|
43
|
+
local: !!options.local,
|
|
44
|
+
cwd: process.cwd(),
|
|
45
|
+
});
|
|
46
|
+
const installPath = path.join(installDir, skill.destFilename);
|
|
47
|
+
const exists = await fs.pathExists(installPath);
|
|
48
|
+
if (exists && !options.force) {
|
|
49
|
+
if (options.yes) {
|
|
50
|
+
console.error(chalk.red(`✖ ${installPath} already exists`) +
|
|
51
|
+
chalk.gray("\n Pass --force to overwrite."));
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
const { overwrite } = await inquirer.prompt([
|
|
55
|
+
{
|
|
56
|
+
type: "confirm",
|
|
57
|
+
name: "overwrite",
|
|
58
|
+
message: `${installPath} already exists. Overwrite?`,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
]);
|
|
62
|
+
if (!overwrite) {
|
|
63
|
+
console.log(chalk.yellow("⚠ Aborted. Nothing changed."));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
await fs.ensureDir(installDir);
|
|
68
|
+
await fs.copy(skill.sourcePath, installPath, { overwrite: true });
|
|
69
|
+
const scope = options.local ? "local (.claude/)" : "global (~/.claude/)";
|
|
70
|
+
console.log(chalk.green(`✔ Installed ${skill.label} skill`) + chalk.gray(` → ${scope}`));
|
|
71
|
+
console.log();
|
|
72
|
+
console.log(skill.postInstallHint(installPath));
|
|
73
|
+
console.log();
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CA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AAgC,CAAC,CAC/C,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAyB;YAClE;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,GAAG,WAAW,6BAA6B;gBACpD,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;YACzD,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,CAAC;IACzE,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,eAAe,KAAK,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,CAC5E,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cmssy-block
|
|
3
|
+
description: "Run the full cmssy CLI lifecycle - init, link, scaffold/edit blocks and templates, dev/build/test, publish, sync. Trigger when the user asks to: initialize a cmssy project, link to a workspace, create/add a new block or template, add a field to a block's schema, edit config.ts, run cmssy dev/build/test/doctor, publish a block, bump a block version, sync a block from the design library, or work with defineBlock/defineTemplate. Trigger on words: cmssy, blok, block, template, publish, opublikuj, workspace, link, sync, defineBlock, defineTemplate, scaffold, zescafoldwac."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cmssy-block
|
|
7
|
+
|
|
8
|
+
Operates the full cmssy CLI workflow for blocks and templates in a project like `cmssy-marketing`. Covers every command the CLI exposes: `init`, `link`, `create`, `dev`, `test`, `build`, `publish`, `sync`, `doctor`, `workspaces`.
|
|
9
|
+
|
|
10
|
+
## 0. Orientation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
cmssy --version # CLI must be installed globally
|
|
14
|
+
cmssy doctor # all-in-one health check
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`cmssy doctor` is the canonical precheck. It verifies:
|
|
18
|
+
- Node >= 18, npm, Next.js, React versions
|
|
19
|
+
- `cmssy.config.js` exists
|
|
20
|
+
- `.env` with `CMSSY_API_URL`, `CMSSY_API_TOKEN`, `CMSSY_WORKSPACE_ID`
|
|
21
|
+
- API reachable, token valid, workspace accessible
|
|
22
|
+
|
|
23
|
+
Run it before any non-trivial operation. If something fails, fix that first - don't proceed.
|
|
24
|
+
|
|
25
|
+
The project uses **pnpm**. Never run `npm install` - use `pnpm install`, `pnpm typecheck`, `pnpm lint`.
|
|
26
|
+
|
|
27
|
+
## 1. Project lifecycle (in order)
|
|
28
|
+
|
|
29
|
+
### 1.1 `cmssy init` - start a new project or bolt onto an existing one
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cmssy init <name> # creates ./<name> via create-next-app + cmssy scaffolding
|
|
33
|
+
cmssy init -y <name> # skip prompts, use defaults
|
|
34
|
+
cmssy init # add cmssy to the current Next.js project
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Outputs: `cmssy.config.js`, `blocks/`, `templates/`, `styles/main.css`, `components/`, example block.
|
|
38
|
+
|
|
39
|
+
### 1.2 `cmssy link` - connect the project to a workspace
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cmssy link # interactive: pick workspace, paste token
|
|
43
|
+
cmssy link --token cs_xxx --workspace <id|slug> # non-interactive, for CI or scripted setup
|
|
44
|
+
cmssy link --api-url https://api.cmssy.io/graphql
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Writes credentials and `CMSSY_WORKSPACE_ID` to `.env`. Tokens come from https://cmssy.io/settings/tokens. List existing workspaces with `cmssy workspaces`.
|
|
48
|
+
|
|
49
|
+
### 1.3 `cmssy workspaces` - show what this machine can publish to
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cmssy workspaces
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Returns name, slug, ID, and role for every accessible workspace. Use this when the user is ambiguous about the publish target.
|
|
56
|
+
|
|
57
|
+
### 1.4 `cmssy create` - scaffold blocks or templates
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cmssy create block <kebab-name> [-d "desc"] [-c <category>] [-t "tag1,tag2"] [-y]
|
|
61
|
+
cmssy create template <kebab-name> [-d "desc"] [-y]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Categories: `marketing`, `typography`, `media`, `layout`, `forms`, `navigation`, `other`.
|
|
65
|
+
|
|
66
|
+
Always use `-y` in automated flows unless the user wants to be prompted.
|
|
67
|
+
|
|
68
|
+
### 1.5 `cmssy dev` - local preview with HMR
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
cmssy dev # port 3000
|
|
72
|
+
cmssy dev -p 8080 # custom port
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Watches `config.ts` and auto-regenerates `block.d.ts`. Use for visual verification after edits.
|
|
76
|
+
|
|
77
|
+
### 1.6 `cmssy test` - vitest runner
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cmssy test # all blocks/templates
|
|
81
|
+
cmssy test --block hero faq # subset
|
|
82
|
+
cmssy test --watch
|
|
83
|
+
cmssy test --coverage
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Test files live at `blocks/*/src/**/*.{test,spec}.{ts,tsx}` (same for templates). If no tests exist yet, this is a no-op.
|
|
87
|
+
|
|
88
|
+
### 1.7 `cmssy build` - production bundle
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
cmssy build # everything
|
|
92
|
+
cmssy build --block hero pricing # subset
|
|
93
|
+
cmssy build --framework react # override
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Outputs `public/@<vendor>/blocks.<name>/<version>/{index.js,index.css,package.json}`. Run before publish if you want to preview the bundle.
|
|
97
|
+
|
|
98
|
+
### 1.8 `cmssy publish` - upload to workspace
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cmssy publish <name> --patch # single, patch bump
|
|
102
|
+
cmssy publish --all --patch # everything
|
|
103
|
+
cmssy publish <name> -w <workspaceId> --patch # explicit workspace (otherwise .env)
|
|
104
|
+
cmssy publish <name> --patch --dry-run # preview only, upload nothing
|
|
105
|
+
cmssy publish <name> --patch --with-source # include source for AI Block Builder
|
|
106
|
+
cmssy publish <name> --patch --zip # package and upload ZIP instead of GraphQL
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Exactly one bump flag:** `--patch` | `--minor` | `--major` | `--no-bump`.
|
|
110
|
+
|
|
111
|
+
**Bump semantics:**
|
|
112
|
+
- `--patch` - bug fix, copy tweak, style-only change. No schema change.
|
|
113
|
+
- `--minor` - added optional fields, new variants. Non-breaking schema additions.
|
|
114
|
+
- `--major` - renamed/removed fields, changed field types, breaking component contract.
|
|
115
|
+
|
|
116
|
+
**Content preservation:** republishing preserves `defaultContent` and `schemaFields` on the workspace by default. Pass `--overwrite-content` only when the user explicitly wants to reset them from `config.ts` / `preview.json`.
|
|
117
|
+
|
|
118
|
+
**Breaking changes** trigger a confirmation prompt; pass `--force` only with explicit user approval.
|
|
119
|
+
|
|
120
|
+
### 1.9 `cmssy sync` - pull blocks down from a workspace
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cmssy sync @cmssy/blocks.hero # one package from the design library
|
|
124
|
+
cmssy sync --workspace <id> # everything from a workspace
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Use when cloning a project's block set to a new repo, or when a block has drifted from its published version.
|
|
128
|
+
|
|
129
|
+
## 2. Block anatomy (non-negotiable)
|
|
130
|
+
|
|
131
|
+
Every block lives in `blocks/<kebab-name>/`:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
blocks/<name>/
|
|
135
|
+
├── config.ts # defineBlock({ name, description, category, tags, schema })
|
|
136
|
+
├── package.json # { "name": "@<project>/blocks.<name>", "version": "x.y.z" }
|
|
137
|
+
├── preview.json # sample content for cmssy dev
|
|
138
|
+
└── src/
|
|
139
|
+
├── index.tsx # export { default } from "./<Pascal>"; import "./index.css";
|
|
140
|
+
├── <Pascal>.tsx # the React component
|
|
141
|
+
├── index.css # @import "../../../styles/main.css";
|
|
142
|
+
└── block.d.ts # AUTO-GENERATED from config.ts - never hand-edit
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Naming (hard rules):**
|
|
146
|
+
- Directory + package `name` suffix: `kebab-case` (`blog-post-hero`).
|
|
147
|
+
- Component file and default export: `PascalCase` matching the directory (`BlogPostHero.tsx`).
|
|
148
|
+
- Package name: `@<projectName>/blocks.<kebab-name>` where `projectName` comes from `cmssy.config.js`.
|
|
149
|
+
- New blocks start at `"version": "1.0.0"`.
|
|
150
|
+
|
|
151
|
+
## 3. Writing `config.ts`
|
|
152
|
+
|
|
153
|
+
Import from `@cmssy/cli/config`. Available field types:
|
|
154
|
+
|
|
155
|
+
| type | Use for |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `singleLine` | Short text (heading, label, badge). |
|
|
158
|
+
| `multiLine` | Paragraph without formatting. |
|
|
159
|
+
| `richText` | HTML body copy. |
|
|
160
|
+
| `link` | URL. |
|
|
161
|
+
| `media` | Image or video (returns URL string). |
|
|
162
|
+
| `boolean` | Toggle. |
|
|
163
|
+
| `numeric` | Number. |
|
|
164
|
+
| `date` | ISO date string. |
|
|
165
|
+
| `color` | Hex color picker. |
|
|
166
|
+
| `select` | Enum with `options: [{ label, value }]`. |
|
|
167
|
+
| `repeater` | Array of sub-objects with nested `schema`. |
|
|
168
|
+
| `form` | Reference to a form-builder form. |
|
|
169
|
+
| `pageSelector` | Pick a page from the workspace. |
|
|
170
|
+
|
|
171
|
+
**Field options:** `label` (required), `defaultValue`, `placeholder`, `required`, `group` (groups fields in the editor UI).
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
import { defineBlock, field } from "@cmssy/cli/config";
|
|
175
|
+
|
|
176
|
+
export default defineBlock({
|
|
177
|
+
name: "Feature Grid",
|
|
178
|
+
description: "Grid of feature cards with icon, title, description",
|
|
179
|
+
category: "marketing",
|
|
180
|
+
tags: ["marketing", "features", "grid"],
|
|
181
|
+
|
|
182
|
+
schema: {
|
|
183
|
+
heading: field({ type: "singleLine", label: "Heading", required: true }),
|
|
184
|
+
headingHighlight: field({ type: "singleLine", label: "Highlight" }),
|
|
185
|
+
description: field({ type: "multiLine", label: "Description" }),
|
|
186
|
+
features: field({
|
|
187
|
+
type: "repeater",
|
|
188
|
+
label: "Features",
|
|
189
|
+
schema: {
|
|
190
|
+
title: field({ type: "singleLine", label: "Title", required: true }),
|
|
191
|
+
description: field({ type: "multiLine", label: "Description" }),
|
|
192
|
+
icon: field({
|
|
193
|
+
type: "select",
|
|
194
|
+
label: "Icon",
|
|
195
|
+
options: [
|
|
196
|
+
{ label: "Zap", value: "ZapIcon" },
|
|
197
|
+
{ label: "Sparkles", value: "SparklesIcon" },
|
|
198
|
+
],
|
|
199
|
+
}),
|
|
200
|
+
color: field({ type: "color", label: "Accent color" }),
|
|
201
|
+
},
|
|
202
|
+
}),
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
After editing `config.ts`, `block.d.ts` regenerates on the next `cmssy dev` or `cmssy build`. Never hand-edit it.
|
|
208
|
+
|
|
209
|
+
## 4. Writing the component
|
|
210
|
+
|
|
211
|
+
Follow the design system in the repo's `DESIGN.md`:
|
|
212
|
+
|
|
213
|
+
- Import `Container` from `../../../components/container`.
|
|
214
|
+
- Section wrapper: `<section className="py-24">` or `"py-24 bg-slate-50/50 dark:bg-slate-900/50"` for alternating tint.
|
|
215
|
+
- Destructure `content` with defaults: `const { heading = "Default" } = content;`.
|
|
216
|
+
- Gradient-clip highlight phrases: `bg-linear-to-r from-violet-600 to-purple-600 bg-clip-text text-transparent`.
|
|
217
|
+
- Primary CTAs: gradient pill button with `shadow-lg shadow-violet-500/25`. Secondary: outline with `border-input`.
|
|
218
|
+
- Icons: `lucide-react`, default stroke width.
|
|
219
|
+
- Rich text: `dangerouslySetInnerHTML` inside a `prose` wrapper.
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { Container } from "../../../components/container";
|
|
223
|
+
import { BlockContent } from "./block";
|
|
224
|
+
|
|
225
|
+
export default function FeatureGrid({ content }: { content: BlockContent }) {
|
|
226
|
+
const { heading = "", features = [] } = content;
|
|
227
|
+
return (
|
|
228
|
+
<section className="py-24">
|
|
229
|
+
<Container>{/* ... */}</Container>
|
|
230
|
+
</section>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Blocks that read platform data (auth, i18n) accept a second prop:
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
export default function Header({ content, context }: {
|
|
239
|
+
content: BlockContent;
|
|
240
|
+
context?: PlatformContext;
|
|
241
|
+
}) { ... }
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Components that use hooks or browser APIs: `"use client";` at the top.
|
|
245
|
+
|
|
246
|
+
## 5. `preview.json`
|
|
247
|
+
|
|
248
|
+
Sample content for `cmssy dev`. Keys must match `config.ts` field names. Repeater fields take arrays of objects. Make it realistic - preview is what reviewers see.
|
|
249
|
+
|
|
250
|
+
## 6. Templates
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
templates/<name>/
|
|
254
|
+
├── config.ts # defineTemplate({ name, description, category, tags, pages })
|
|
255
|
+
├── package.json
|
|
256
|
+
├── pages.json # layoutPositions (header/footer) + block references
|
|
257
|
+
├── preview.json
|
|
258
|
+
└── src/ # optional root component
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
import { defineTemplate, field } from "@cmssy/cli/config";
|
|
263
|
+
|
|
264
|
+
export default defineTemplate({
|
|
265
|
+
name: "Marketing Site",
|
|
266
|
+
description: "...",
|
|
267
|
+
category: "website",
|
|
268
|
+
tags: [...],
|
|
269
|
+
pages: [
|
|
270
|
+
{
|
|
271
|
+
name: "Home",
|
|
272
|
+
slug: "/",
|
|
273
|
+
blocks: [
|
|
274
|
+
{ type: "hero", content: { heading: "...", ... } },
|
|
275
|
+
{ type: "features", content: { ... } },
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
});
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Publish templates the same way as blocks: `cmssy publish <template-name> --patch`.
|
|
283
|
+
|
|
284
|
+
## 7. Standard workflows
|
|
285
|
+
|
|
286
|
+
### Brand-new project
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
cmssy init my-blocks -y
|
|
290
|
+
cd my-blocks
|
|
291
|
+
cmssy link # interactive - pick workspace
|
|
292
|
+
cmssy doctor # confirm green
|
|
293
|
+
cmssy dev
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Add a new block end-to-end
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
cmssy create block testimonials -c marketing -t "marketing,social-proof" -y
|
|
300
|
+
# edit blocks/testimonials/config.ts, Testimonials.tsx, preview.json
|
|
301
|
+
cmssy dev # visual check
|
|
302
|
+
pnpm typecheck && pnpm lint
|
|
303
|
+
cmssy test --block testimonials # if tests exist
|
|
304
|
+
cmssy publish testimonials --patch --dry-run
|
|
305
|
+
cmssy publish testimonials --patch
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Extend an existing block with an optional field
|
|
309
|
+
|
|
310
|
+
1. Add `field({...})` to `config.ts`. Don't set `required: true` - that's breaking.
|
|
311
|
+
2. Update the component to read and render it with a default.
|
|
312
|
+
3. Update `preview.json`.
|
|
313
|
+
4. `cmssy publish <block> --minor`.
|
|
314
|
+
|
|
315
|
+
### Copy-only fix
|
|
316
|
+
|
|
317
|
+
1. Edit default strings or JSX in the component.
|
|
318
|
+
2. `cmssy publish <block> --patch`.
|
|
319
|
+
|
|
320
|
+
### Pull a block from the design library
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
cmssy sync @cmssy/blocks.hero
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## 8. Safety rules (always)
|
|
327
|
+
|
|
328
|
+
- Run `cmssy doctor` before publishing.
|
|
329
|
+
- Never fabricate a workspace ID. Use `cmssy workspaces` and confirm with the user.
|
|
330
|
+
- Never pass `--force` without explicit user approval (skips breaking-change confirmation).
|
|
331
|
+
- Never pass `--overwrite-content` without explicit user approval (wipes editor content).
|
|
332
|
+
- Use `--dry-run` first when unsure what will change.
|
|
333
|
+
- Confirm with the user before publishing from a branch other than `develop` or `main`.
|
|
334
|
+
- Commit local changes before publishing - publish uploads the working tree.
|
|
335
|
+
- For init and link, never write a token or workspace ID into `.env` without user confirmation.
|
|
336
|
+
|
|
337
|
+
## 9. Troubleshooting
|
|
338
|
+
|
|
339
|
+
| Symptom | Likely cause | Fix |
|
|
340
|
+
| --- | --- | --- |
|
|
341
|
+
| `doctor` says token invalid | Revoked/expired token | `cmssy link` again with a fresh token from https://cmssy.io/settings/tokens |
|
|
342
|
+
| Publish says "workspace not accessible" | Wrong `CMSSY_WORKSPACE_ID` or no role | `cmssy workspaces`, update `.env` |
|
|
343
|
+
| Schema diff prompts blocking publish | Breaking field change | Bump `--major`, or revert to non-breaking, or `--force` with user approval |
|
|
344
|
+
| `block.d.ts` shows wrong fields | Stale generation | Restart `cmssy dev`, or run `cmssy build` to regenerate |
|
|
345
|
+
| Dev server shows a blank block | `preview.json` missing keys | Match keys to `config.ts` field names |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Unified CLI for building and publishing blocks to Cmssy design library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"./test": "./test.js"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "tsc && tsc config.ts --module esnext --target esnext --moduleResolution bundler && tsc config.ts --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler",
|
|
15
|
+
"build": "tsc && tsc config.ts --module esnext --target esnext --moduleResolution bundler && tsc config.ts --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler && node scripts/copy-assets.mjs",
|
|
16
16
|
"dev": "tsc --watch",
|
|
17
17
|
"test": "vitest run",
|
|
18
18
|
"test:watch": "vitest",
|