cmssy-cli 0.20.1 → 0.24.1
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/config.d.ts +1 -1
- package/dist/cli.js +136 -23
- package/dist/cli.js.map +1 -1
- package/dist/commands/add-source.d.ts +7 -0
- package/dist/commands/add-source.d.ts.map +1 -0
- package/dist/commands/add-source.js +238 -0
- package/dist/commands/add-source.js.map +1 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +56 -12
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +22 -2
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +652 -410
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +3 -1
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/publish.js +74 -0
- package/dist/commands/publish.js.map +1 -1
- package/dist/dev-ui/app.js +166 -19
- package/dist/dev-ui/index.html +138 -0
- package/dist/dev-ui-react/App.tsx +164 -0
- package/dist/dev-ui-react/__tests__/previewData.test.ts +193 -0
- package/dist/dev-ui-react/components/BlocksList.tsx +232 -0
- package/dist/dev-ui-react/components/Editor.tsx +469 -0
- package/dist/dev-ui-react/components/Preview.tsx +146 -0
- package/dist/dev-ui-react/hooks/useBlocks.ts +80 -0
- package/dist/dev-ui-react/index.html +13 -0
- package/dist/dev-ui-react/main.tsx +8 -0
- package/dist/dev-ui-react/styles.css +856 -0
- package/dist/dev-ui-react/types.ts +45 -0
- package/dist/types/block-config.d.ts +100 -2
- package/dist/types/block-config.d.ts.map +1 -1
- package/dist/types/block-config.js +6 -1
- package/dist/types/block-config.js.map +1 -1
- package/dist/utils/block-config.js +3 -3
- package/dist/utils/block-config.js.map +1 -1
- package/dist/utils/blocks-meta-cache.d.ts +28 -0
- package/dist/utils/blocks-meta-cache.d.ts.map +1 -0
- package/dist/utils/blocks-meta-cache.js +72 -0
- package/dist/utils/blocks-meta-cache.js.map +1 -0
- package/dist/utils/builder.d.ts +3 -0
- package/dist/utils/builder.d.ts.map +1 -1
- package/dist/utils/builder.js +17 -14
- package/dist/utils/builder.js.map +1 -1
- package/dist/utils/field-schema.d.ts +2 -0
- package/dist/utils/field-schema.d.ts.map +1 -1
- package/dist/utils/field-schema.js +21 -4
- package/dist/utils/field-schema.js.map +1 -1
- package/dist/utils/graphql.d.ts +2 -0
- package/dist/utils/graphql.d.ts.map +1 -1
- package/dist/utils/graphql.js +22 -0
- package/dist/utils/graphql.js.map +1 -1
- package/dist/utils/scanner.d.ts +5 -3
- package/dist/utils/scanner.d.ts.map +1 -1
- package/dist/utils/scanner.js +23 -16
- package/dist/utils/scanner.js.map +1 -1
- package/dist/utils/type-generator.d.ts +7 -1
- package/dist/utils/type-generator.d.ts.map +1 -1
- package/dist/utils/type-generator.js +58 -41
- package/dist/utils/type-generator.js.map +1 -1
- package/package.json +8 -3
- package/dist/commands/deploy.d.ts +0 -9
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -226
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/push.d.ts +0 -9
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -199
- package/dist/commands/push.js.map +0 -1
- package/dist/utils/blockforge-config.d.ts +0 -19
- package/dist/utils/blockforge-config.d.ts.map +0 -1
- package/dist/utils/blockforge-config.js +0 -19
- package/dist/utils/blockforge-config.js.map +0 -1
package/config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { defineBlock, defineTemplate } from "./dist/utils/block-config.js";
|
|
2
|
-
export type { BlockConfig,
|
|
2
|
+
export type { BlockConfig, FieldConfig, FieldType, BaseFieldConfig, SelectFieldConfig, RepeaterFieldConfig, BlockRequires, LayoutSlotType, ShowWhenCondition, FieldValidation, ValidationPattern, WorkspaceModule, FeatureFlag, TemplateConfig, TemplatePageBlueprint, TemplateBlockInstance, TemplateLayoutSlot, TemplateTheme, } from "./dist/types/block-config.js";
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { addSourceCommand } from "./commands/add-source.js";
|
|
3
4
|
import { buildCommand } from "./commands/build.js";
|
|
4
5
|
import { configureCommand } from "./commands/configure.js";
|
|
5
6
|
import { createCommand } from "./commands/create.js";
|
|
@@ -21,51 +22,121 @@ const program = new Command();
|
|
|
21
22
|
program
|
|
22
23
|
.name("cmssy")
|
|
23
24
|
.description("Unified CLI for building and publishing blocks to Cmssy marketplace")
|
|
24
|
-
.version(packageJson.version)
|
|
25
|
+
.version(packageJson.version)
|
|
26
|
+
.addHelpText("after", `
|
|
27
|
+
Examples:
|
|
28
|
+
$ cmssy init my-blocks Create a new project
|
|
29
|
+
$ cmssy create block hero Add a new block to your project
|
|
30
|
+
$ cmssy dev Start dev server with hot reload
|
|
31
|
+
$ cmssy build Build all blocks for production
|
|
32
|
+
$ cmssy publish --all -w abc Publish all to workspace
|
|
33
|
+
|
|
34
|
+
Workflow:
|
|
35
|
+
1. init → Create project with example block
|
|
36
|
+
2. create → Add more blocks/templates
|
|
37
|
+
3. dev → Develop with live preview
|
|
38
|
+
4. build → Bundle for production
|
|
39
|
+
5. publish → Deploy to marketplace or workspace
|
|
40
|
+
|
|
41
|
+
Documentation: https://cmssy.io/docs/cli
|
|
42
|
+
`);
|
|
25
43
|
// cmssy init
|
|
26
44
|
program
|
|
27
45
|
.command("init")
|
|
28
46
|
.description("Initialize a new Cmssy project")
|
|
29
|
-
.argument("[name]", "Project name")
|
|
47
|
+
.argument("[name]", "Project name (creates directory)")
|
|
30
48
|
.option("-f, --framework <framework>", "Framework (react, vue, angular, vanilla)", "react")
|
|
49
|
+
.addHelpText("after", `
|
|
50
|
+
Examples:
|
|
51
|
+
$ cmssy init Create project in current directory
|
|
52
|
+
$ cmssy init my-blocks Create project in ./my-blocks
|
|
53
|
+
$ cmssy init -f vue my-blocks Create Vue project
|
|
54
|
+
`)
|
|
31
55
|
.action(initCommand);
|
|
32
56
|
// cmssy create
|
|
33
57
|
const create = program
|
|
34
58
|
.command("create")
|
|
35
|
-
.description("Create a new block or template")
|
|
59
|
+
.description("Create a new block or template")
|
|
60
|
+
.addHelpText("after", `
|
|
61
|
+
Examples:
|
|
62
|
+
$ cmssy create block hero
|
|
63
|
+
$ cmssy create block pricing -c marketing -t "pricing,plans"
|
|
64
|
+
$ cmssy create template landing-page
|
|
65
|
+
`);
|
|
36
66
|
create
|
|
37
67
|
.command("block")
|
|
38
|
-
.description("Create a new block")
|
|
39
|
-
.argument("<name>", "Block name")
|
|
68
|
+
.description("Create a new block with scaffold files")
|
|
69
|
+
.argument("<name>", "Block name (kebab-case recommended)")
|
|
40
70
|
.option("-y, --yes", "Skip prompts and use defaults")
|
|
41
71
|
.option("-d, --description <description>", "Block description")
|
|
42
|
-
.option("-c, --category <category>", "
|
|
72
|
+
.option("-c, --category <category>", "Category: marketing, typography, media, layout, forms, navigation, other")
|
|
43
73
|
.option("-t, --tags <tags>", "Comma-separated tags")
|
|
74
|
+
.addHelpText("after", `
|
|
75
|
+
Creates:
|
|
76
|
+
blocks/<name>/
|
|
77
|
+
├── block.config.ts Type-safe configuration
|
|
78
|
+
├── package.json Name and version
|
|
79
|
+
├── preview.json Preview data for dev server
|
|
80
|
+
└── src/
|
|
81
|
+
├── index.tsx Entry point (mount/unmount)
|
|
82
|
+
├── Block.tsx React component
|
|
83
|
+
├── block.d.ts Auto-generated types
|
|
84
|
+
└── index.css Styles
|
|
85
|
+
`)
|
|
44
86
|
.action(createCommand.block);
|
|
45
87
|
create
|
|
46
88
|
.command("template")
|
|
47
89
|
.description("Create a new page template")
|
|
48
|
-
.argument("<name>", "Template name")
|
|
90
|
+
.argument("<name>", "Template name (kebab-case recommended)")
|
|
49
91
|
.option("-y, --yes", "Skip prompts and use defaults")
|
|
50
92
|
.option("-d, --description <description>", "Template description")
|
|
51
93
|
.action(createCommand.page);
|
|
52
94
|
// cmssy build
|
|
53
95
|
program
|
|
54
96
|
.command("build")
|
|
55
|
-
.description("Build
|
|
56
|
-
.option("--
|
|
97
|
+
.description("Build blocks and templates for production")
|
|
98
|
+
.option("--block <names...>", "Build only specific blocks/templates")
|
|
99
|
+
.option("--framework <framework>", "Override framework from config")
|
|
100
|
+
.addHelpText("after", `
|
|
101
|
+
Examples:
|
|
102
|
+
$ cmssy build Build all blocks and templates
|
|
103
|
+
$ cmssy build --block hero pricing Build only hero and pricing blocks
|
|
104
|
+
|
|
105
|
+
Output:
|
|
106
|
+
public/@vendor/blocks.<name>/<version>/
|
|
107
|
+
├── index.js Bundled JavaScript
|
|
108
|
+
├── index.css Styles
|
|
109
|
+
└── package.json Metadata for marketplace
|
|
110
|
+
`)
|
|
57
111
|
.action(buildCommand);
|
|
58
112
|
// cmssy dev
|
|
59
113
|
program
|
|
60
114
|
.command("dev")
|
|
61
|
-
.description("Start development server with
|
|
115
|
+
.description("Start development server with hot reload")
|
|
62
116
|
.option("-p, --port <port>", "Port number", "3000")
|
|
117
|
+
.addHelpText("after", `
|
|
118
|
+
Examples:
|
|
119
|
+
$ cmssy dev Start on default port 3000
|
|
120
|
+
$ cmssy dev -p 8080 Start on port 8080
|
|
121
|
+
|
|
122
|
+
Features:
|
|
123
|
+
• Live preview of all blocks/templates
|
|
124
|
+
• Hot reload on file changes
|
|
125
|
+
• Auto-regenerates types on block.config.ts changes
|
|
126
|
+
`)
|
|
63
127
|
.action(devCommand);
|
|
64
128
|
// cmssy configure
|
|
65
129
|
program
|
|
66
130
|
.command("configure")
|
|
67
131
|
.description("Configure Cmssy API credentials")
|
|
68
132
|
.option("--api-url <url>", "Cmssy API URL", "https://api.cmssy.io/graphql")
|
|
133
|
+
.addHelpText("after", `
|
|
134
|
+
Stores credentials in .env file:
|
|
135
|
+
CMSSY_API_TOKEN=your-token
|
|
136
|
+
CMSSY_API_URL=https://api.cmssy.io/graphql
|
|
137
|
+
|
|
138
|
+
Get your API token at: https://cmssy.io/settings/tokens
|
|
139
|
+
`)
|
|
69
140
|
.action(configureCommand);
|
|
70
141
|
// cmssy publish
|
|
71
142
|
program
|
|
@@ -87,37 +158,79 @@ program
|
|
|
87
158
|
// cmssy sync
|
|
88
159
|
program
|
|
89
160
|
.command("sync")
|
|
90
|
-
.description("Pull blocks from
|
|
91
|
-
.argument("[package]", "Package slug
|
|
92
|
-
.option("--workspace <id>", "
|
|
161
|
+
.description("Pull blocks from marketplace to local project")
|
|
162
|
+
.argument("[package]", "Package slug (e.g., @vendor/blocks.hero)")
|
|
163
|
+
.option("--workspace <id>", "Sync from specific workspace")
|
|
164
|
+
.addHelpText("after", `
|
|
165
|
+
Examples:
|
|
166
|
+
$ cmssy sync @acme/blocks.hero Sync from marketplace
|
|
167
|
+
$ cmssy sync --workspace abc123 Sync all from workspace
|
|
168
|
+
`)
|
|
93
169
|
.action(syncCommand);
|
|
94
170
|
// cmssy migrate
|
|
95
171
|
program
|
|
96
172
|
.command("migrate [block-name]")
|
|
97
|
-
.description("Migrate
|
|
173
|
+
.description("Migrate legacy package.json config to block.config.ts")
|
|
174
|
+
.addHelpText("after", `
|
|
175
|
+
Examples:
|
|
176
|
+
$ cmssy migrate hero Migrate specific block
|
|
177
|
+
$ cmssy migrate Migrate all blocks/templates
|
|
178
|
+
|
|
179
|
+
Converts:
|
|
180
|
+
package.json { cmssy: {...} } → block.config.ts
|
|
181
|
+
`)
|
|
98
182
|
.action(migrateCommand);
|
|
99
183
|
// cmssy package
|
|
100
184
|
program
|
|
101
185
|
.command("package [packages...]")
|
|
102
|
-
.description("Package blocks/templates into ZIP files
|
|
103
|
-
" Packages are directory names from blocks/ or templates/ folders.\n" +
|
|
104
|
-
" Examples:\n" +
|
|
105
|
-
" cmssy package hero faq -o dist\n" +
|
|
106
|
-
" cmssy package --all")
|
|
186
|
+
.description("Package blocks/templates into ZIP files for manual upload")
|
|
107
187
|
.option("--all", "Package all blocks and templates")
|
|
108
188
|
.option("-o, --output <dir>", "Output directory", "packages")
|
|
189
|
+
.addHelpText("after", `
|
|
190
|
+
Examples:
|
|
191
|
+
$ cmssy package hero faq Package specific blocks
|
|
192
|
+
$ cmssy package --all Package everything
|
|
193
|
+
$ cmssy package -o dist --all Package to custom directory
|
|
194
|
+
|
|
195
|
+
Use with 'upload' for two-step deployment.
|
|
196
|
+
`)
|
|
109
197
|
.action(packageCommand);
|
|
110
198
|
// cmssy upload
|
|
111
199
|
program
|
|
112
200
|
.command("upload [files...]")
|
|
113
|
-
.description("Upload
|
|
114
|
-
.option("-w, --workspace <id>", "
|
|
115
|
-
.option("--all", "Upload all
|
|
201
|
+
.description("Upload ZIP packages to workspace")
|
|
202
|
+
.option("-w, --workspace <id>", "Target workspace ID")
|
|
203
|
+
.option("--all", "Upload all from packages directory")
|
|
204
|
+
.addHelpText("after", `
|
|
205
|
+
Examples:
|
|
206
|
+
$ cmssy upload hero.zip -w abc123 Upload single package
|
|
207
|
+
$ cmssy upload --all -w abc123 Upload all packages
|
|
208
|
+
`)
|
|
116
209
|
.action(uploadCommand);
|
|
117
210
|
// cmssy workspaces
|
|
118
211
|
program
|
|
119
212
|
.command("workspaces")
|
|
120
|
-
.description("List your workspaces and
|
|
213
|
+
.description("List your workspaces and their IDs")
|
|
214
|
+
.addHelpText("after", `
|
|
215
|
+
Use workspace IDs with:
|
|
216
|
+
$ cmssy publish --workspace <id>
|
|
217
|
+
$ cmssy upload --workspace <id>
|
|
218
|
+
$ cmssy sync --workspace <id>
|
|
219
|
+
`)
|
|
121
220
|
.action(workspacesCommand);
|
|
221
|
+
// cmssy add-source
|
|
222
|
+
program
|
|
223
|
+
.command("add-source [blocks...]")
|
|
224
|
+
.description("Upload source code to workspace for AI Block Builder")
|
|
225
|
+
.option("-w, --workspace <id>", "Target workspace ID")
|
|
226
|
+
.option("--all", "Add source for all local blocks")
|
|
227
|
+
.addHelpText("after", `
|
|
228
|
+
Examples:
|
|
229
|
+
$ cmssy add-source hero pricing -w abc123
|
|
230
|
+
$ cmssy add-source --all -w abc123
|
|
231
|
+
|
|
232
|
+
Enables AI Block Builder to edit your blocks in the Cmssy editor.
|
|
233
|
+
`)
|
|
234
|
+
.action(addSourceCommand);
|
|
122
235
|
program.parse();
|
|
123
236
|
//# 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,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;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,MAAM,UAA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Ae;AACf,OAAO;KACJ,OAAO,CAAC,mBAAmB,CAAC;KAC5B,WAAW,CAAC,kCAAkC,CAAC;KAC/C,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;KACrD,MAAM,CAAC,OAAO,EAAE,oCAAoC,CAAC;KACrD,WAAW,CAAC,OAAO,EAAE;;;;CAIvB,CAAC;KACC,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,mBAAmB;AACnB,OAAO;KACJ,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CAAC,oCAAoC,CAAC;KACjD,WAAW,CAAC,OAAO,EAAE;;;;;CAKvB,CAAC;KACC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAE7B,mBAAmB;AACnB,OAAO;KACJ,OAAO,CAAC,wBAAwB,CAAC;KACjC,WAAW,CAAC,sDAAsD,CAAC;KACnE,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;KACrD,MAAM,CAAC,OAAO,EAAE,iCAAiC,CAAC;KAClD,WAAW,CAAC,OAAO,EAAE;;;;;;CAMvB,CAAC;KACC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE5B,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-source.d.ts","sourceRoot":"","sources":["../../src/commands/add-source.ts"],"names":[],"mappings":"AAYA,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AA4GD,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAAE,YAAK,EACzB,OAAO,EAAE,gBAAgB,iBAyL1B"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { GraphQLClient } from "graphql-request";
|
|
4
|
+
import inquirer from "inquirer";
|
|
5
|
+
import ora from "ora";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { hasConfig, loadConfig } from "../utils/config.js";
|
|
8
|
+
import { ADD_BLOCK_SOURCE_CODE_MUTATION, GET_WORKSPACE_BLOCKS_QUERY, } from "../utils/graphql.js";
|
|
9
|
+
/**
|
|
10
|
+
* Read original source code for AI Block Builder (editable in Sandpack).
|
|
11
|
+
* Combines the main component file with type definitions into a single file.
|
|
12
|
+
*/
|
|
13
|
+
async function readOriginalSourceCode(packagePath) {
|
|
14
|
+
const srcDir = path.join(packagePath, "src");
|
|
15
|
+
// Find main component file (not index.tsx, but the actual component)
|
|
16
|
+
const files = fs.readdirSync(srcDir);
|
|
17
|
+
let mainComponentFile;
|
|
18
|
+
let sourceCode;
|
|
19
|
+
// Look for component files (excluding index.tsx and .d.ts files)
|
|
20
|
+
for (const file of files) {
|
|
21
|
+
if ((file.endsWith(".tsx") || file.endsWith(".ts")) &&
|
|
22
|
+
!file.startsWith("index") &&
|
|
23
|
+
!file.endsWith(".d.ts")) {
|
|
24
|
+
mainComponentFile = path.join(srcDir, file);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// If no main component found, try index.tsx
|
|
29
|
+
if (!mainComponentFile) {
|
|
30
|
+
const indexPath = path.join(srcDir, "index.tsx");
|
|
31
|
+
if (fs.existsSync(indexPath)) {
|
|
32
|
+
mainComponentFile = indexPath;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (mainComponentFile && fs.existsSync(mainComponentFile)) {
|
|
36
|
+
// Read the main component
|
|
37
|
+
let content = fs.readFileSync(mainComponentFile, "utf-8");
|
|
38
|
+
// Read block.d.ts if exists and inline the types
|
|
39
|
+
const blockDtsPath = path.join(srcDir, "block.d.ts");
|
|
40
|
+
if (fs.existsSync(blockDtsPath)) {
|
|
41
|
+
const blockDts = fs.readFileSync(blockDtsPath, "utf-8");
|
|
42
|
+
// Extract interface/type definitions from block.d.ts
|
|
43
|
+
const typeMatch = blockDts.match(/(?:export\s+)?(?:interface|type)\s+BlockContent[\s\S]*?(?=(?:export\s+)?(?:interface|type)|$)/);
|
|
44
|
+
if (typeMatch) {
|
|
45
|
+
// Remove the import from block.d.ts and add inline type
|
|
46
|
+
content = content.replace(/import\s*{\s*BlockContent\s*}\s*from\s*["']\.\/block(?:\.d)?["'];?\n?/, "");
|
|
47
|
+
// Add inline interface at the top
|
|
48
|
+
const inlineInterface = `interface BlockContent {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}\n\n`;
|
|
51
|
+
// Insert after imports
|
|
52
|
+
const lastImportMatch = content.match(/^(import[\s\S]*?from\s*['"][^'"]+['"];?\n)/m);
|
|
53
|
+
if (lastImportMatch) {
|
|
54
|
+
const insertPos = content.lastIndexOf(lastImportMatch[0]) + lastImportMatch[0].length;
|
|
55
|
+
content =
|
|
56
|
+
content.slice(0, insertPos) +
|
|
57
|
+
"\n" +
|
|
58
|
+
inlineInterface +
|
|
59
|
+
content.slice(insertPos);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
content = inlineInterface + content;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
sourceCode = content;
|
|
67
|
+
}
|
|
68
|
+
// Read CSS
|
|
69
|
+
const cssPath = path.join(srcDir, "index.css");
|
|
70
|
+
const sourceCss = fs.existsSync(cssPath)
|
|
71
|
+
? fs.readFileSync(cssPath, "utf-8")
|
|
72
|
+
: undefined;
|
|
73
|
+
// Read dependencies from package.json
|
|
74
|
+
const pkgPath = path.join(packagePath, "package.json");
|
|
75
|
+
let dependencies;
|
|
76
|
+
if (fs.existsSync(pkgPath)) {
|
|
77
|
+
const pkg = fs.readJsonSync(pkgPath);
|
|
78
|
+
if (pkg.dependencies && Object.keys(pkg.dependencies).length > 0) {
|
|
79
|
+
dependencies = pkg.dependencies;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { sourceCode, sourceCss, dependencies };
|
|
83
|
+
}
|
|
84
|
+
export async function addSourceCommand(blockNames = [], options) {
|
|
85
|
+
console.log(chalk.blue.bold("\n📦 Cmssy - Add Source Code\n"));
|
|
86
|
+
// Check configuration
|
|
87
|
+
if (!hasConfig()) {
|
|
88
|
+
console.error(chalk.red("✖ Not configured. Run: cmssy configure\n"));
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
const config = loadConfig();
|
|
92
|
+
// Get workspace ID
|
|
93
|
+
let workspaceId = options.workspace;
|
|
94
|
+
if (!workspaceId) {
|
|
95
|
+
if (config.workspaceId) {
|
|
96
|
+
workspaceId = config.workspaceId;
|
|
97
|
+
console.log(chalk.gray(`Using workspace ID from .env: ${workspaceId}\n`));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const answer = await inquirer.prompt([
|
|
101
|
+
{
|
|
102
|
+
type: "input",
|
|
103
|
+
name: "workspaceId",
|
|
104
|
+
message: "Enter Workspace ID:",
|
|
105
|
+
validate: (input) => {
|
|
106
|
+
if (!input) {
|
|
107
|
+
return "Workspace ID is required (or set CMSSY_WORKSPACE_ID in .env)";
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
]);
|
|
113
|
+
workspaceId = answer.workspaceId;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Find cmssy.config.js
|
|
117
|
+
const configPath = path.join(process.cwd(), "cmssy.config.js");
|
|
118
|
+
if (!fs.existsSync(configPath)) {
|
|
119
|
+
console.error(chalk.red("✖ Not a cmssy project (missing cmssy.config.js)\n"));
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
// Create GraphQL client
|
|
123
|
+
const client = new GraphQLClient(config.apiUrl, {
|
|
124
|
+
headers: {
|
|
125
|
+
"Content-Type": "application/json",
|
|
126
|
+
Authorization: `Bearer ${config.apiToken}`,
|
|
127
|
+
"X-Workspace-ID": workspaceId,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
// Fetch workspace blocks
|
|
131
|
+
const spinner = ora("Fetching workspace blocks...").start();
|
|
132
|
+
let workspaceBlocks;
|
|
133
|
+
try {
|
|
134
|
+
const result = await client.request(GET_WORKSPACE_BLOCKS_QUERY);
|
|
135
|
+
workspaceBlocks = result.workspaceBlocks;
|
|
136
|
+
spinner.succeed(`Found ${workspaceBlocks.length} blocks in workspace`);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
spinner.fail("Failed to fetch workspace blocks");
|
|
140
|
+
console.error(chalk.red(error.message));
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
// Find blocks directory
|
|
144
|
+
const blocksDir = path.join(process.cwd(), "blocks");
|
|
145
|
+
if (!fs.existsSync(blocksDir)) {
|
|
146
|
+
console.error(chalk.red("✖ No blocks directory found\n"));
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
// Get list of local blocks
|
|
150
|
+
const localBlocks = fs
|
|
151
|
+
.readdirSync(blocksDir, { withFileTypes: true })
|
|
152
|
+
.filter((d) => d.isDirectory())
|
|
153
|
+
.map((d) => d.name);
|
|
154
|
+
// Filter blocks to process
|
|
155
|
+
let blocksToProcess;
|
|
156
|
+
if (options.all) {
|
|
157
|
+
blocksToProcess = localBlocks;
|
|
158
|
+
}
|
|
159
|
+
else if (blockNames.length > 0) {
|
|
160
|
+
blocksToProcess = blockNames.filter((name) => localBlocks.includes(name));
|
|
161
|
+
const missing = blockNames.filter((name) => !localBlocks.includes(name));
|
|
162
|
+
if (missing.length > 0) {
|
|
163
|
+
console.warn(chalk.yellow(`Warning: Blocks not found locally: ${missing.join(", ")}`));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
// Interactive selection
|
|
168
|
+
const choices = localBlocks.map((name) => {
|
|
169
|
+
const wsBlock = workspaceBlocks.find((b) => b.blockType === name);
|
|
170
|
+
const hasSource = wsBlock?.sourceUrl ? chalk.green(" (has source)") : chalk.gray(" (no source)");
|
|
171
|
+
return {
|
|
172
|
+
name: `${name}${hasSource}`,
|
|
173
|
+
value: name,
|
|
174
|
+
checked: !wsBlock?.sourceUrl,
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
const answer = await inquirer.prompt([
|
|
178
|
+
{
|
|
179
|
+
type: "checkbox",
|
|
180
|
+
name: "blocks",
|
|
181
|
+
message: "Select blocks to add source code:",
|
|
182
|
+
choices,
|
|
183
|
+
},
|
|
184
|
+
]);
|
|
185
|
+
blocksToProcess = answer.blocks;
|
|
186
|
+
}
|
|
187
|
+
if (blocksToProcess.length === 0) {
|
|
188
|
+
console.log(chalk.yellow("\n⚠ No blocks selected\n"));
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
console.log(chalk.cyan(`\nAdding source to ${blocksToProcess.length} block(s):\n`));
|
|
192
|
+
let successCount = 0;
|
|
193
|
+
let errorCount = 0;
|
|
194
|
+
for (const blockName of blocksToProcess) {
|
|
195
|
+
const blockPath = path.join(blocksDir, blockName);
|
|
196
|
+
const wsBlock = workspaceBlocks.find((b) => b.blockType === blockName);
|
|
197
|
+
if (!wsBlock) {
|
|
198
|
+
console.log(chalk.yellow(` ⚠ ${blockName}: Not found in workspace (publish it first)`));
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const blockSpinner = ora(`Adding source to ${blockName}...`).start();
|
|
202
|
+
try {
|
|
203
|
+
// Read source code
|
|
204
|
+
const { sourceCode, sourceCss, dependencies } = await readOriginalSourceCode(blockPath);
|
|
205
|
+
if (!sourceCode) {
|
|
206
|
+
blockSpinner.warn(`${blockName}: No source code found`);
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
// Upload via mutation
|
|
210
|
+
const input = {
|
|
211
|
+
blockId: wsBlock.id,
|
|
212
|
+
sourceCode,
|
|
213
|
+
};
|
|
214
|
+
if (sourceCss) {
|
|
215
|
+
input.sourceCss = sourceCss;
|
|
216
|
+
}
|
|
217
|
+
if (dependencies) {
|
|
218
|
+
input.dependencies = dependencies;
|
|
219
|
+
}
|
|
220
|
+
await client.request(ADD_BLOCK_SOURCE_CODE_MUTATION, { input });
|
|
221
|
+
blockSpinner.succeed(chalk.green(`${blockName}: Source added`));
|
|
222
|
+
successCount++;
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
blockSpinner.fail(chalk.red(`${blockName}: Failed`));
|
|
226
|
+
console.error(chalk.red(` Error: ${error.message}`));
|
|
227
|
+
errorCount++;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
console.log("");
|
|
231
|
+
if (errorCount === 0) {
|
|
232
|
+
console.log(chalk.green.bold(`✓ ${successCount} block(s) updated successfully\n`));
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
console.log(chalk.yellow(`⚠ ${successCount} succeeded, ${errorCount} failed\n`));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=add-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-source.js","sourceRoot":"","sources":["../../src/commands/add-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAc7B;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CAAC,WAAmB;IAKvD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAE7C,qEAAqE;IACrE,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC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ACtD,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,YAAY,kCAAkC,CAAC,CACtE,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,KAAK,YAAY,eAAe,UAAU,WAAW,CAAC,CACpE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AASA,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAqHvD"}
|
package/dist/commands/build.js
CHANGED
|
@@ -4,42 +4,86 @@ import path from "path";
|
|
|
4
4
|
import { loadConfig } from "../utils/cmssy-config.js";
|
|
5
5
|
import { scanResources } from "../utils/scanner.js";
|
|
6
6
|
import { buildResource } from "../utils/builder.js";
|
|
7
|
+
import { updateBlockInCache } from "../utils/blocks-meta-cache.js";
|
|
8
|
+
import { getFieldTypes } from "../utils/field-schema.js";
|
|
7
9
|
export async function buildCommand(options) {
|
|
8
10
|
const spinner = ora("Starting build...").start();
|
|
9
11
|
try {
|
|
10
12
|
const config = await loadConfig();
|
|
11
13
|
const framework = options.framework || config.framework;
|
|
12
14
|
// Scan for blocks and templates (strict mode - throw errors)
|
|
15
|
+
// If --block is provided, only scan those specific blocks
|
|
13
16
|
const resources = await scanResources({
|
|
14
17
|
strict: true,
|
|
15
18
|
loadConfig: true,
|
|
16
19
|
validateSchema: true,
|
|
17
20
|
loadPreview: false,
|
|
18
21
|
requirePackageJson: true,
|
|
22
|
+
names: options.block,
|
|
19
23
|
});
|
|
24
|
+
// If --block was provided but no matches found, show available blocks
|
|
25
|
+
if (options.block && options.block.length > 0 && resources.length === 0) {
|
|
26
|
+
spinner.fail(`No matching blocks found: ${options.block.join(", ")}`);
|
|
27
|
+
// Quick scan to list available blocks (minimal, no validation)
|
|
28
|
+
const allResources = await scanResources({
|
|
29
|
+
strict: false,
|
|
30
|
+
loadConfig: false,
|
|
31
|
+
validateSchema: false,
|
|
32
|
+
loadPreview: false,
|
|
33
|
+
requirePackageJson: false,
|
|
34
|
+
});
|
|
35
|
+
console.log(chalk.yellow("\nAvailable blocks/templates:"));
|
|
36
|
+
allResources.forEach((r) => console.log(` - ${r.name}`));
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
20
39
|
if (resources.length === 0) {
|
|
21
40
|
spinner.warn("No blocks or templates found");
|
|
22
41
|
process.exit(0);
|
|
23
42
|
}
|
|
24
43
|
spinner.text = `Building ${resources.length} resources...`;
|
|
25
44
|
const outDir = path.join(process.cwd(), config.build?.outDir || "public");
|
|
45
|
+
// Fetch field types from backend (used for type generation)
|
|
46
|
+
const fieldTypes = await getFieldTypes();
|
|
47
|
+
// Build in parallel with concurrency limit
|
|
48
|
+
const CONCURRENCY = 8;
|
|
49
|
+
const buildOptions = {
|
|
50
|
+
framework,
|
|
51
|
+
minify: config.build?.minify ?? true,
|
|
52
|
+
sourcemap: config.build?.sourcemap ?? true,
|
|
53
|
+
outputMode: "versioned",
|
|
54
|
+
generatePackageJson: true,
|
|
55
|
+
generateTypes: true,
|
|
56
|
+
strict: true,
|
|
57
|
+
fieldTypes,
|
|
58
|
+
};
|
|
59
|
+
const results = [];
|
|
60
|
+
// Process in batches for controlled parallelism
|
|
61
|
+
for (let i = 0; i < resources.length; i += CONCURRENCY) {
|
|
62
|
+
const batch = resources.slice(i, i + CONCURRENCY);
|
|
63
|
+
const batchResults = await Promise.all(batch.map(async (resource) => {
|
|
64
|
+
try {
|
|
65
|
+
await buildResource(resource, outDir, buildOptions);
|
|
66
|
+
return { resource, success: true };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return { resource, success: false, error };
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
results.push(...batchResults);
|
|
73
|
+
}
|
|
74
|
+
// Log results and update cache
|
|
26
75
|
let successCount = 0;
|
|
27
76
|
let errorCount = 0;
|
|
28
|
-
for (const resource of
|
|
29
|
-
|
|
30
|
-
await buildResource(resource, outDir, {
|
|
31
|
-
framework,
|
|
32
|
-
minify: config.build?.minify ?? true,
|
|
33
|
-
sourcemap: config.build?.sourcemap ?? true,
|
|
34
|
-
outputMode: "versioned",
|
|
35
|
-
generatePackageJson: true,
|
|
36
|
-
generateTypes: true,
|
|
37
|
-
strict: true,
|
|
38
|
-
});
|
|
77
|
+
for (const { resource, success, error } of results) {
|
|
78
|
+
if (success) {
|
|
39
79
|
successCount++;
|
|
40
80
|
console.log(chalk.green(` ✓ ${resource.packageJson.name}@${resource.packageJson.version}`));
|
|
81
|
+
// Update metadata cache with fresh data
|
|
82
|
+
if (resource.blockConfig) {
|
|
83
|
+
updateBlockInCache(resource.name, resource.type, resource.blockConfig, resource.packageJson?.version);
|
|
84
|
+
}
|
|
41
85
|
}
|
|
42
|
-
|
|
86
|
+
else {
|
|
43
87
|
errorCount++;
|
|
44
88
|
console.error(chalk.red(` ✖ ${resource.name}:`), error);
|
|
45
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU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