@ikas/component-cli 1.4.0-beta.27 → 1.4.0-beta.28
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/dist/commands/get-component-props.d.ts.map +1 -1
- package/dist/commands/get-component-props.js +12 -5
- package/dist/commands/get-component-props.js.map +1 -1
- package/dist/commands/get-section-values.d.ts.map +1 -1
- package/dist/commands/get-section-values.js +15 -5
- package/dist/commands/get-section-values.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-component-props.d.ts","sourceRoot":"","sources":["../../src/commands/get-component-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"get-component-props.d.ts","sourceRoot":"","sources":["../../src/commands/get-component-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC,wBAAgB,8BAA8B,IAAI,OAAO,CAWxD"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
3
|
async function runGetComponentProps(options) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const componentIds = options.componentIds
|
|
5
|
+
? options.componentIds
|
|
6
|
+
.split(",")
|
|
7
|
+
.map(s => s.trim())
|
|
8
|
+
.filter(Boolean)
|
|
9
|
+
: undefined;
|
|
10
|
+
if (!componentIds?.length && !options.componentId) {
|
|
11
|
+
printErrorAndExit(new Error("--component-id or --component-ids is required"));
|
|
6
12
|
}
|
|
7
13
|
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
8
14
|
try {
|
|
9
|
-
const result = await runEditorAction("get-component-props", { componentId: options.componentId }, port ? { port } : {});
|
|
15
|
+
const result = await runEditorAction("get-component-props", componentIds?.length ? { componentIds } : { componentId: options.componentId }, port ? { port } : {});
|
|
10
16
|
printResultAndExit(result);
|
|
11
17
|
}
|
|
12
18
|
catch (e) {
|
|
@@ -16,8 +22,9 @@ async function runGetComponentProps(options) {
|
|
|
16
22
|
export function createGetComponentPropsCommand() {
|
|
17
23
|
const cmd = new Command("get-component-props");
|
|
18
24
|
cmd
|
|
19
|
-
.description("Get
|
|
20
|
-
.
|
|
25
|
+
.description("Get prop blueprints from the editor (the source of truth) for one or many components: each prop's id, name, type, required, default, ENUM `options` (valid values), and for COMPONENT/COMPONENT_LIST the `allowedComponentIds` (which children it permits). Works for any section OR child code component id — use it to learn a COMPONENT_LIST child's props and valid enum values instead of grepping ikas.config.json. Returns { components: [...] }.")
|
|
26
|
+
.option("--component-id <id>", "A single code component id (section or child) — or a section id")
|
|
27
|
+
.option("--component-ids <ids>", "Comma-separated component ids (batch — resolve many schemas in one call)")
|
|
21
28
|
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
22
29
|
.action(runGetComponentProps);
|
|
23
30
|
return cmd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-component-props.js","sourceRoot":"","sources":["../../src/commands/get-component-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-component-props.js","sourceRoot":"","sources":["../../src/commands/get-component-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAQ1C,KAAK,UAAU,oBAAoB,CAAC,OAAiC;IACnE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY;QACvC,CAAC,CAAC,OAAO,CAAC,YAAY;aACjB,KAAK,CAAC,GAAG,CAAC;aACV,GA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"file":"get-section-values.d.ts","sourceRoot":"","sources":["../../src/commands/get-section-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"get-section-values.d.ts","sourceRoot":"","sources":["../../src/commands/get-section-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2CpC,wBAAgB,6BAA6B,IAAI,OAAO,CAYvD"}
|
|
@@ -4,12 +4,21 @@ async function runGetSectionValues(options) {
|
|
|
4
4
|
if (!options.pageId || typeof options.pageId !== "string") {
|
|
5
5
|
printErrorAndExit(new Error("--page-id is required (use `ikas-component list-pages`)"));
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const elementIds = options.elementIds
|
|
8
|
+
? options.elementIds
|
|
9
|
+
.split(",")
|
|
10
|
+
.map(s => s.trim())
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
: undefined;
|
|
13
|
+
if (!elementIds?.length && !options.elementId) {
|
|
14
|
+
printErrorAndExit(new Error("--element-id or --element-ids is required (use `ikas-component list-page-sections`)"));
|
|
9
15
|
}
|
|
10
16
|
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
11
17
|
try {
|
|
12
|
-
const result = await runEditorAction("get-section-values", {
|
|
18
|
+
const result = await runEditorAction("get-section-values", {
|
|
19
|
+
pageId: options.pageId,
|
|
20
|
+
...(elementIds?.length ? { elementIds } : { elementId: options.elementId }),
|
|
21
|
+
}, port ? { port } : {});
|
|
13
22
|
printResultAndExit(result);
|
|
14
23
|
}
|
|
15
24
|
catch (e) {
|
|
@@ -19,9 +28,10 @@ async function runGetSectionValues(options) {
|
|
|
19
28
|
export function createGetSectionValuesCommand() {
|
|
20
29
|
const cmd = new Command("get-section-values");
|
|
21
30
|
cmd
|
|
22
|
-
.description("Get the current prop values of
|
|
31
|
+
.description("Get the current prop values of placed section(s) (full propValues + blueprint props). Use for read-modify-write of a COMPONENT_LIST or to inspect an existing value's shape. `list-page-sections` is lean and omits values; this fetches them. Returns { sections: [...] }.")
|
|
23
32
|
.requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
|
|
24
|
-
.
|
|
33
|
+
.option("--element-id <id>", "A single placed-section elementId (from `ikas-component list-page-sections`)")
|
|
34
|
+
.option("--element-ids <ids>", "Comma-separated elementIds (batch)")
|
|
25
35
|
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
26
36
|
.action(runGetSectionValues);
|
|
27
37
|
return cmd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-section-values.js","sourceRoot":"","sources":["../../src/commands/get-section-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-section-values.js","sourceRoot":"","sources":["../../src/commands/get-section-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,UAAU,mBAAmB,CAAC,OAAgC;IACjE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1D,iBAAiB,CAAC,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU;QACnC,CAAC,CAAC,OAAO,CAAC,UAAU;aACf,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aAClB,MAAM,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,SAAS,CAAC;IACd,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