@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.
@@ -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;AA6BpC,wBAAgB,8BAA8B,IAAI,OAAO,CAUxD"}
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
- if (!options.componentId || typeof options.componentId !== "string") {
5
- printErrorAndExit(new Error("--component-id is required"));
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 a component's prop blueprint from the editor (the source of truth): 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.")
20
- .requiredOption("--component-id <id>", "Code component id (section or child) — or a section id")
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;AAO1C,KAAK,UAAU,oBAAoB,CAAC,OAAiC;IACnE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpE,iBAAiB,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,qBAAqB,EACrB,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,EACpC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CACrB,CAAC;QACF,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC/C,GAAG;SACA,WAAW,CACV,6YAA6Y,CAC9Y;SACA,cAAc,CAAC,qBAAqB,EAAE,wDAAwD,CAAC;SAC/F,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,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,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aAClB,MAAM,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,SAAS,CAAC;IACd,IAAI,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAClD,iBAAiB,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;IAChF,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,qBAAqB,EACrB,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,EAC9E,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CACrB,CAAC;QACF,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC/C,GAAG;SACA,WAAW,CACV,0bAA0b,CAC3b;SACA,MAAM,CAAC,qBAAqB,EAAE,iEAAiE,CAAC;SAChG,MAAM,CAAC,uBAAuB,EAAE,0EAA0E,CAAC;SAC3G,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
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;AAiCpC,wBAAgB,6BAA6B,IAAI,OAAO,CAWvD"}
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
- if (!options.elementId || typeof options.elementId !== "string") {
8
- printErrorAndExit(new Error("--element-id is required (use `ikas-component list-page-sections`)"));
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", { pageId: options.pageId, elementId: options.elementId }, port ? { port } : {});
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 ONE placed section (its 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 for a single section.")
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
- .requiredOption("--element-id <id>", "Placed section elementId (from `ikas-component list-page-sections`)")
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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M,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;SAC5E,EACD,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CACrB,CAAC;QACF,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9C,GAAG;SACA,WAAW,CACV,6QAA6Q,CAC9Q;SACA,cAAc,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;SAC9E,MAAM,CAAC,mBAAmB,EAAE,8EAA8E,CAAC;SAC3G,MAAM,CAAC,qBAAqB,EAAE,oCAAoC,CAAC;SACnE,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC/B,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/component-cli",
3
- "version": "1.4.0-beta.27",
3
+ "version": "1.4.0-beta.28",
4
4
  "description": "CLI for developing ikas code components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",