@ikas/component-cli 1.4.0-beta.21 → 1.4.0-beta.210

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.
Files changed (176) hide show
  1. package/dist/build-tools.d.ts +37 -0
  2. package/dist/build-tools.d.ts.map +1 -0
  3. package/dist/build-tools.js +36 -0
  4. package/dist/build-tools.js.map +1 -0
  5. package/dist/commands/add-sections-to-page.d.ts +3 -0
  6. package/dist/commands/add-sections-to-page.d.ts.map +1 -0
  7. package/dist/commands/add-sections-to-page.js +39 -0
  8. package/dist/commands/add-sections-to-page.js.map +1 -0
  9. package/dist/commands/add.d.ts.map +1 -1
  10. package/dist/commands/add.js +11 -2
  11. package/dist/commands/add.js.map +1 -1
  12. package/dist/commands/build.d.ts.map +1 -1
  13. package/dist/commands/build.js +5 -165
  14. package/dist/commands/build.js.map +1 -1
  15. package/dist/commands/config.d.ts +35 -0
  16. package/dist/commands/config.d.ts.map +1 -1
  17. package/dist/commands/config.js +1082 -147
  18. package/dist/commands/config.js.map +1 -1
  19. package/dist/commands/create-design-tokens.d.ts +24 -0
  20. package/dist/commands/create-design-tokens.d.ts.map +1 -0
  21. package/dist/commands/create-design-tokens.js +334 -0
  22. package/dist/commands/create-design-tokens.js.map +1 -0
  23. package/dist/commands/create-global-variable.d.ts +3 -0
  24. package/dist/commands/create-global-variable.d.ts.map +1 -0
  25. package/dist/commands/create-global-variable.js +73 -0
  26. package/dist/commands/create-global-variable.js.map +1 -0
  27. package/dist/commands/create-page.d.ts +3 -0
  28. package/dist/commands/create-page.d.ts.map +1 -0
  29. package/dist/commands/create-page.js +31 -0
  30. package/dist/commands/create-page.js.map +1 -0
  31. package/dist/commands/delete-page.d.ts +3 -0
  32. package/dist/commands/delete-page.d.ts.map +1 -0
  33. package/dist/commands/delete-page.js +28 -0
  34. package/dist/commands/delete-page.js.map +1 -0
  35. package/dist/commands/delete-theme-globals.d.ts +4 -0
  36. package/dist/commands/delete-theme-globals.d.ts.map +1 -0
  37. package/dist/commands/delete-theme-globals.js +48 -0
  38. package/dist/commands/delete-theme-globals.js.map +1 -0
  39. package/dist/commands/dev.d.ts.map +1 -1
  40. package/dist/commands/dev.js +218 -31
  41. package/dist/commands/dev.js.map +1 -1
  42. package/dist/commands/enable-builtin-pages.d.ts +3 -0
  43. package/dist/commands/enable-builtin-pages.d.ts.map +1 -0
  44. package/dist/commands/enable-builtin-pages.js +27 -0
  45. package/dist/commands/enable-builtin-pages.js.map +1 -0
  46. package/dist/commands/get-component-props.d.ts +3 -0
  47. package/dist/commands/get-component-props.d.ts.map +1 -0
  48. package/dist/commands/get-component-props.js +32 -0
  49. package/dist/commands/get-component-props.js.map +1 -0
  50. package/dist/commands/get-page-by-type.d.ts +3 -0
  51. package/dist/commands/get-page-by-type.d.ts.map +1 -0
  52. package/dist/commands/get-page-by-type.js +25 -0
  53. package/dist/commands/get-page-by-type.js.map +1 -0
  54. package/dist/commands/get-section-values.d.ts +3 -0
  55. package/dist/commands/get-section-values.d.ts.map +1 -0
  56. package/dist/commands/get-section-values.js +39 -0
  57. package/dist/commands/get-section-values.js.map +1 -0
  58. package/dist/commands/list-builtin-pages.d.ts +3 -0
  59. package/dist/commands/list-builtin-pages.d.ts.map +1 -0
  60. package/dist/commands/list-builtin-pages.js +28 -0
  61. package/dist/commands/list-builtin-pages.js.map +1 -0
  62. package/dist/commands/list-entities.d.ts +3 -0
  63. package/dist/commands/list-entities.d.ts.map +1 -0
  64. package/dist/commands/list-entities.js +32 -0
  65. package/dist/commands/list-entities.js.map +1 -0
  66. package/dist/commands/list-page-sections.d.ts.map +1 -1
  67. package/dist/commands/list-page-sections.js +8 -2
  68. package/dist/commands/list-page-sections.js.map +1 -1
  69. package/dist/commands/list-theme-globals.d.ts +3 -0
  70. package/dist/commands/list-theme-globals.d.ts.map +1 -0
  71. package/dist/commands/list-theme-globals.js +22 -0
  72. package/dist/commands/list-theme-globals.js.map +1 -0
  73. package/dist/commands/move-page-section.d.ts +3 -0
  74. package/dist/commands/move-page-section.d.ts.map +1 -0
  75. package/dist/commands/move-page-section.js +62 -0
  76. package/dist/commands/move-page-section.js.map +1 -0
  77. package/dist/commands/publish-theme.d.ts +3 -0
  78. package/dist/commands/publish-theme.d.ts.map +1 -0
  79. package/dist/commands/publish-theme.js +29 -0
  80. package/dist/commands/publish-theme.js.map +1 -0
  81. package/dist/commands/publish.d.ts.map +1 -1
  82. package/dist/commands/publish.js +54 -3
  83. package/dist/commands/publish.js.map +1 -1
  84. package/dist/commands/remove-page-section.d.ts +3 -0
  85. package/dist/commands/remove-page-section.d.ts.map +1 -0
  86. package/dist/commands/remove-page-section.js +40 -0
  87. package/dist/commands/remove-page-section.js.map +1 -0
  88. package/dist/commands/search-products.d.ts +3 -0
  89. package/dist/commands/search-products.d.ts.map +1 -0
  90. package/dist/commands/search-products.js +40 -0
  91. package/dist/commands/search-products.js.map +1 -0
  92. package/dist/commands/update-builtin-page-prop.d.ts +3 -0
  93. package/dist/commands/update-builtin-page-prop.d.ts.map +1 -0
  94. package/dist/commands/update-builtin-page-prop.js +49 -0
  95. package/dist/commands/update-builtin-page-prop.js.map +1 -0
  96. package/dist/commands/update-global-variable.d.ts +3 -0
  97. package/dist/commands/update-global-variable.d.ts.map +1 -0
  98. package/dist/commands/update-global-variable.js +70 -0
  99. package/dist/commands/update-global-variable.js.map +1 -0
  100. package/dist/commands/update-page-sections.d.ts +3 -0
  101. package/dist/commands/update-page-sections.d.ts.map +1 -0
  102. package/dist/commands/update-page-sections.js +39 -0
  103. package/dist/commands/update-page-sections.js.map +1 -0
  104. package/dist/commands/update-section-prop.d.ts.map +1 -1
  105. package/dist/commands/update-section-prop.js +25 -8
  106. package/dist/commands/update-section-prop.js.map +1 -1
  107. package/dist/commands/upload-image.d.ts.map +1 -1
  108. package/dist/commands/upload-image.js +5 -46
  109. package/dist/commands/upload-image.js.map +1 -1
  110. package/dist/commands/upload-images.d.ts +3 -0
  111. package/dist/commands/upload-images.d.ts.map +1 -0
  112. package/dist/commands/upload-images.js +48 -0
  113. package/dist/commands/upload-images.js.map +1 -0
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +54 -1
  116. package/dist/index.js.map +1 -1
  117. package/dist/types.d.ts +51 -0
  118. package/dist/types.d.ts.map +1 -1
  119. package/dist/utils/archive-project.d.ts +69 -0
  120. package/dist/utils/archive-project.d.ts.map +1 -0
  121. package/dist/utils/archive-project.js +202 -0
  122. package/dist/utils/archive-project.js.map +1 -0
  123. package/dist/utils/compile.d.ts +17 -2
  124. package/dist/utils/compile.d.ts.map +1 -1
  125. package/dist/utils/compile.js +750 -117
  126. package/dist/utils/compile.js.map +1 -1
  127. package/dist/utils/component-helpers.d.ts +167 -2
  128. package/dist/utils/component-helpers.d.ts.map +1 -1
  129. package/dist/utils/component-helpers.js +452 -29
  130. package/dist/utils/component-helpers.js.map +1 -1
  131. package/dist/utils/css-import-resolver.d.ts +4 -1
  132. package/dist/utils/css-import-resolver.d.ts.map +1 -1
  133. package/dist/utils/css-import-resolver.js +9 -1
  134. package/dist/utils/css-import-resolver.js.map +1 -1
  135. package/dist/utils/editor-action-client.d.ts +4 -3
  136. package/dist/utils/editor-action-client.d.ts.map +1 -1
  137. package/dist/utils/editor-action-client.js +55 -19
  138. package/dist/utils/editor-action-client.js.map +1 -1
  139. package/dist/utils/esm-transform.d.ts +30 -0
  140. package/dist/utils/esm-transform.d.ts.map +1 -1
  141. package/dist/utils/esm-transform.js +169 -2
  142. package/dist/utils/esm-transform.js.map +1 -1
  143. package/dist/utils/find-component-for-file.d.ts +12 -0
  144. package/dist/utils/find-component-for-file.d.ts.map +1 -0
  145. package/dist/utils/find-component-for-file.js +24 -0
  146. package/dist/utils/find-component-for-file.js.map +1 -0
  147. package/dist/utils/forbid-deep-imports.d.ts +3 -0
  148. package/dist/utils/forbid-deep-imports.d.ts.map +1 -0
  149. package/dist/utils/forbid-deep-imports.js +54 -0
  150. package/dist/utils/forbid-deep-imports.js.map +1 -0
  151. package/dist/utils/forbid-external-packages.d.ts +26 -0
  152. package/dist/utils/forbid-external-packages.d.ts.map +1 -0
  153. package/dist/utils/forbid-external-packages.js +99 -0
  154. package/dist/utils/forbid-external-packages.js.map +1 -0
  155. package/dist/utils/load-image.d.ts +16 -0
  156. package/dist/utils/load-image.d.ts.map +1 -0
  157. package/dist/utils/load-image.js +50 -0
  158. package/dist/utils/load-image.js.map +1 -0
  159. package/dist/utils/vendor-storefront.d.ts +13 -0
  160. package/dist/utils/vendor-storefront.d.ts.map +1 -0
  161. package/dist/utils/vendor-storefront.js +91 -0
  162. package/dist/utils/vendor-storefront.js.map +1 -0
  163. package/dist/utils/websocket-server.d.ts +119 -5
  164. package/dist/utils/websocket-server.d.ts.map +1 -1
  165. package/dist/utils/websocket-server.js +255 -44
  166. package/dist/utils/websocket-server.js.map +1 -1
  167. package/package.json +19 -2
  168. package/templates/add/section.css +11 -0
  169. package/dist/commands/create.d.ts +0 -4
  170. package/dist/commands/create.d.ts.map +0 -1
  171. package/dist/commands/create.js +0 -228
  172. package/dist/commands/create.js.map +0 -1
  173. package/dist/commands/proxy.d.ts +0 -39
  174. package/dist/commands/proxy.d.ts.map +0 -1
  175. package/dist/commands/proxy.js +0 -210
  176. package/dist/commands/proxy.js.map +0 -1
@@ -0,0 +1,27 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runEnableBuiltinPages(options) {
4
+ // Group validation is the editor handler's job; only the string→boolean parse lives here.
5
+ if (options.enabled !== "true" && options.enabled !== "false") {
6
+ printErrorAndExit(new Error("--enabled must be true or false."));
7
+ }
8
+ const port = options.port ? parseInt(options.port, 10) : undefined;
9
+ try {
10
+ const result = await runEditorAction("enable-builtin-pages", { group: options.group, enabled: options.enabled === "true" }, port ? { port } : {});
11
+ printResultAndExit(result);
12
+ }
13
+ catch (e) {
14
+ printErrorAndExit(e);
15
+ }
16
+ }
17
+ export function createEnableBuiltinPagesCommand() {
18
+ const cmd = new Command("enable-builtin-pages");
19
+ cmd
20
+ .description('Turn one group of ikas-rendered built-in pages on or off: "membership" (login/register/password) or "account" (my-account pages). Enabling creates any missing page of the group; disabling removes only the untouched pages the toggle itself created.')
21
+ .requiredOption("--group <group>", 'Page group: "membership" or "account"')
22
+ .requiredOption("--enabled <bool>", "true to enable, false to disable")
23
+ .option("--port <port>", "Dev server WebSocket port", "5201")
24
+ .action(runEnableBuiltinPages);
25
+ return cmd;
26
+ }
27
+ //# sourceMappingURL=enable-builtin-pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enable-builtin-pages.js","sourceRoot":"","sources":["../../src/commands/enable-builtin-pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAQ1C,KAAK,UAAU,qBAAqB,CAClC,OAAkC;IAElC,0FAA0F;IAC1F,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAC9D,iBAAiB,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;IACnE,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,sBAAsB,EACtB,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,EAAE,EAC7D,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,+BAA+B;IAC7C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChD,GAAG;SACA,WAAW,CACV,yPAAyP,CAC1P;SACA,cAAc,CAAC,iBAAiB,EAAE,uCAAuC,CAAC;SAC1E,cAAc,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;SACtE,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createGetComponentPropsCommand(): Command;
3
+ //# sourceMappingURL=get-component-props.d.ts.map
@@ -0,0 +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;AAoCpC,wBAAgB,8BAA8B,IAAI,OAAO,CAWxD"}
@@ -0,0 +1,32 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runGetComponentProps(options) {
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"));
12
+ }
13
+ const port = options.port ? parseInt(options.port, 10) : undefined;
14
+ try {
15
+ const result = await runEditorAction("get-component-props", componentIds?.length ? { componentIds } : { componentId: options.componentId }, port ? { port } : {});
16
+ printResultAndExit(result);
17
+ }
18
+ catch (e) {
19
+ printErrorAndExit(e);
20
+ }
21
+ }
22
+ export function createGetComponentPropsCommand() {
23
+ const cmd = new Command("get-component-props");
24
+ cmd
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)")
28
+ .option("--port <port>", "Dev server WebSocket port", "5201")
29
+ .action(runGetComponentProps);
30
+ return cmd;
31
+ }
32
+ //# sourceMappingURL=get-component-props.js.map
@@ -0,0 +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;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"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createGetPageByTypeCommand(): Command;
3
+ //# sourceMappingURL=get-page-by-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-page-by-type.d.ts","sourceRoot":"","sources":["../../src/commands/get-page-by-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6BpC,wBAAgB,0BAA0B,IAAI,OAAO,CAUpD"}
@@ -0,0 +1,25 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runGetPageByType(options) {
4
+ if (!options.pageType || typeof options.pageType !== "string") {
5
+ printErrorAndExit(new Error("--page-type is required (e.g. CATEGORY, PRODUCT, BRAND, BLOG, BLOG_CATEGORY, INDEX)"));
6
+ }
7
+ const port = options.port ? parseInt(options.port, 10) : undefined;
8
+ try {
9
+ const result = await runEditorAction("get-page-by-type", { pageType: options.pageType }, port ? { port } : {});
10
+ printResultAndExit(result);
11
+ }
12
+ catch (e) {
13
+ printErrorAndExit(e);
14
+ }
15
+ }
16
+ export function createGetPageByTypeCommand() {
17
+ const cmd = new Command("get-page-by-type");
18
+ cmd
19
+ .description("Resolve a theme page id from its pageType (CATEGORY, PRODUCT, BRAND, BLOG, BLOG_CATEGORY, INDEX, …). Use the returned pageId together with an entity id (from list-entities) to build a PAGE link to that entity. Returns pageId: null with a note if no page of that type exists yet.")
20
+ .requiredOption("--page-type <type>", "Page type to resolve (e.g. CATEGORY)")
21
+ .option("--port <port>", "Dev server WebSocket port", "5201")
22
+ .action(runGetPageByType);
23
+ return cmd;
24
+ }
25
+ //# sourceMappingURL=get-page-by-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-page-by-type.js","sourceRoot":"","sources":["../../src/commands/get-page-by-type.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,gBAAgB,CAAC,OAA6B;IAC3D,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9D,iBAAiB,CAAC,IAAI,KAAK,CAAC,qFAAqF,CAAC,CAAC,CAAC;IACtH,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,kBAAkB,EAClB,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,EAC9B,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,0BAA0B;IACxC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5C,GAAG;SACA,WAAW,CACV,wRAAwR,CACzR;SACA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC;SAC5E,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAC5B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createGetSectionValuesCommand(): Command;
3
+ //# sourceMappingURL=get-section-values.d.ts.map
@@ -0,0 +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;AA2CpC,wBAAgB,6BAA6B,IAAI,OAAO,CAYvD"}
@@ -0,0 +1,39 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runGetSectionValues(options) {
4
+ if (!options.pageId || typeof options.pageId !== "string") {
5
+ printErrorAndExit(new Error("--page-id is required (use `ikas-component list-pages`)"));
6
+ }
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`)"));
15
+ }
16
+ const port = options.port ? parseInt(options.port, 10) : undefined;
17
+ try {
18
+ const result = await runEditorAction("get-section-values", {
19
+ pageId: options.pageId,
20
+ ...(elementIds?.length ? { elementIds } : { elementId: options.elementId }),
21
+ }, port ? { port } : {});
22
+ printResultAndExit(result);
23
+ }
24
+ catch (e) {
25
+ printErrorAndExit(e);
26
+ }
27
+ }
28
+ export function createGetSectionValuesCommand() {
29
+ const cmd = new Command("get-section-values");
30
+ cmd
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: [...] }. A COMMON (global) section — the theme's header/footer — keeps ONE theme-wide set of values stored on the INDEX (Home) page's placement; its values are read from there whatever --page-id you pass, and it comes back with a `common` block naming that canonical page/element.")
32
+ .requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
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)")
35
+ .option("--port <port>", "Dev server WebSocket port", "5201")
36
+ .action(runGetSectionValues);
37
+ return cmd;
38
+ }
39
+ //# sourceMappingURL=get-section-values.js.map
@@ -0,0 +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;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,CA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,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"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createListBuiltinPagesCommand(): Command;
3
+ //# sourceMappingURL=list-builtin-pages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-builtin-pages.d.ts","sourceRoot":"","sources":["../../src/commands/list-builtin-pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmCpC,wBAAgB,6BAA6B,IAAI,OAAO,CAkBvD"}
@@ -0,0 +1,28 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runListBuiltinPages(options) {
4
+ const port = options.port ? parseInt(options.port, 10) : undefined;
5
+ try {
6
+ const result = await runEditorAction("list-builtin-pages", {
7
+ ...(options.pageType ? { pageType: options.pageType } : {}),
8
+ ...(options.scopeId ? { scopeId: options.scopeId } : {}),
9
+ ...(options.sfRoutingId ? { sfRoutingId: options.sfRoutingId } : {}),
10
+ }, port ? { port } : {});
11
+ printResultAndExit(result);
12
+ }
13
+ catch (e) {
14
+ printErrorAndExit(e);
15
+ }
16
+ }
17
+ export function createListBuiltinPagesCommand() {
18
+ const cmd = new Command("list-builtin-pages");
19
+ cmd
20
+ .description("List the ikas-rendered built-in account/membership pages: per-group enabled state, page types, and shared scopes. Pass --page-type (e.g. LOGIN) or --scope-id for one page's/scope's full prop schema and current values. These pages have no sections — configure them with update-builtin-page-prop, not update-section-prop.")
21
+ .option("--page-type <type>", "One built-in page's full prop schema and values (e.g. LOGIN, ACCOUNT)")
22
+ .option("--scope-id <id>", "One shared scope's full prop schema and values")
23
+ .option("--sf-routing-id <id>", "Read the values one storefront routing sees (default: the base routing)")
24
+ .option("--port <port>", "Dev server WebSocket port", "5201")
25
+ .action(runListBuiltinPages);
26
+ return cmd;
27
+ }
28
+ //# sourceMappingURL=list-builtin-pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-builtin-pages.js","sourceRoot":"","sources":["../../src/commands/list-builtin-pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,UAAU,mBAAmB,CAChC,OAAgC;IAEhC,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,oBAAoB,EACpB;YACE,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3D,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrE,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,iUAAiU,CAClU;SACA,MAAM,CACL,oBAAoB,EACpB,uEAAuE,CACxE;SACA,MAAM,CAAC,iBAAiB,EAAE,gDAAgD,CAAC;SAC3E,MAAM,CACL,sBAAsB,EACtB,yEAAyE,CAC1E;SACA,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC/B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createListEntitiesCommand(): Command;
3
+ //# sourceMappingURL=list-entities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-entities.d.ts","sourceRoot":"","sources":["../../src/commands/list-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC,wBAAgB,yBAAyB,IAAI,OAAO,CAWnD"}
@@ -0,0 +1,32 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ const VALID_KINDS = ["category", "brand", "blog", "blog-category"];
4
+ async function runListEntities(options) {
5
+ if (!options.kind || !VALID_KINDS.includes(options.kind)) {
6
+ printErrorAndExit(new Error(`--kind must be one of: ${VALID_KINDS.join(", ")}`));
7
+ }
8
+ const port = options.port ? parseInt(options.port, 10) : undefined;
9
+ try {
10
+ const result = await runEditorAction("list-entities", {
11
+ kind: options.kind,
12
+ ...(options.query ? { query: options.query } : {}),
13
+ },
14
+ // The host fetches from the store API, so allow more than the default 10s.
15
+ { ...(port ? { port } : {}), timeoutMs: 20_000 });
16
+ printResultAndExit(result);
17
+ }
18
+ catch (e) {
19
+ printErrorAndExit(e);
20
+ }
21
+ }
22
+ export function createListEntitiesCommand() {
23
+ const cmd = new Command("list-entities");
24
+ cmd
25
+ .description("List store entities (category, brand, blog, blog-category) and their ids, for filling the corresponding entity prop value via `ikas-component update-section-prop`. Requires the editor embedded in the ikas admin panel (the host runs the lookup). Note: category and brand return all entries (no query); blog and blog-category accept --query.")
26
+ .requiredOption("--kind <kind>", `Entity kind: ${VALID_KINDS.join(" | ")}`)
27
+ .option("--query <text>", "Free-text search (blog / blog-category only)")
28
+ .option("--port <port>", "Dev server WebSocket port", "5201")
29
+ .action(runListEntities);
30
+ return cmd;
31
+ }
32
+ //# sourceMappingURL=list-entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-entities.js","sourceRoot":"","sources":["../../src/commands/list-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;AAQnE,KAAK,UAAU,eAAe,CAAC,OAA4B;IACzD,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACzD,iBAAiB,CAAC,IAAI,KAAK,CAAC,0BAA0B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACnF,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,eAAe,EACf;YACE,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD;QACD,2EAA2E;QAC3E,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CACjD,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,yBAAyB;IACvC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,GAAG;SACA,WAAW,CACV,qVAAqV,CACtV;SACA,cAAc,CAAC,eAAe,EAAE,gBAAgB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;SAC1E,MAAM,CAAC,gBAAgB,EAAE,8CAA8C,CAAC;SACxE,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"list-page-sections.d.ts","sourceRoot":"","sources":["../../src/commands/list-page-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6BpC,wBAAgB,6BAA6B,IAAI,OAAO,CAUvD"}
1
+ {"version":3,"file":"list-page-sections.d.ts","sourceRoot":"","sources":["../../src/commands/list-page-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmCpC,wBAAgB,6BAA6B,IAAI,OAAO,CAYvD"}
@@ -6,7 +6,11 @@ async function runListPageSections(options) {
6
6
  }
7
7
  const port = options.port ? parseInt(options.port, 10) : undefined;
8
8
  try {
9
- const result = await runEditorAction("list-page-sections", { pageId: options.pageId }, port ? { port } : {});
9
+ const result = await runEditorAction("list-page-sections", {
10
+ pageId: options.pageId,
11
+ ...(options.sfRoutingId ? { sfRoutingId: options.sfRoutingId } : {}),
12
+ ...(options.specificationId ? { specificationId: options.specificationId } : {}),
13
+ }, port ? { port } : {});
10
14
  printResultAndExit(result);
11
15
  }
12
16
  catch (e) {
@@ -16,8 +20,10 @@ async function runListPageSections(options) {
16
20
  export function createListPageSectionsCommand() {
17
21
  const cmd = new Command("list-page-sections");
18
22
  cmd
19
- .description("List the sections placed on a page, each with its per-placement elementId, sectionId, current prop values, and blueprint props. Use the elementId with `ikas-component update-section-prop`.")
23
+ .description("List the sections placed on a page, each with its per-placement elementId, sectionId, current prop values, and blueprint props. Use the elementId with `ikas-component update-section-prop`. COMMON (global) sections — the theme's header/footer — carry a `common` block: their prop values are not page-specific but shared theme-wide and stored on the INDEX (Home) page's placement. A page customized per storefront-routing/specification holds a SEPARATE set of placements and its own section order in each state: by default this lists the BASE layer and reports the available states in `pageStates`; pass --sf-routing-id (and --specification-id) to list one of them instead.")
20
24
  .requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
25
+ .option("--sf-routing-id <id>", "List a routing-customized state of the page instead of the base layer")
26
+ .option("--specification-id <id>", "Specification of the customized state (used with --sf-routing-id)")
21
27
  .option("--port <port>", "Dev server WebSocket port", "5201")
22
28
  .action(runListPageSections);
23
29
  return cmd;
@@ -1 +1 @@
1
- {"version":3,"file":"list-page-sections.js","sourceRoot":"","sources":["../../src/commands/list-page-sections.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,mBAAmB,CAAC,OAAgC;IACjE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI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AAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createListThemeGlobalsCommand(): Command;
3
+ //# sourceMappingURL=list-theme-globals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-theme-globals.d.ts","sourceRoot":"","sources":["../../src/commands/list-theme-globals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,wBAAgB,6BAA6B,IAAI,OAAO,CAUvD"}
@@ -0,0 +1,22 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction } from "../utils/editor-action-client.js";
3
+ async function runListThemeGlobals(options) {
4
+ const port = options.port ? parseInt(options.port, 10) : undefined;
5
+ try {
6
+ const result = await runEditorAction("list-theme-globals", {}, port ? { port } : {});
7
+ printResultAndExit(result);
8
+ }
9
+ catch (e) {
10
+ printErrorAndExit(e);
11
+ }
12
+ }
13
+ export function createListThemeGlobalsCommand() {
14
+ const cmd = new Command("list-theme-globals");
15
+ cmd
16
+ .description("List the theme's global settings — global variables and design tokens (colors, typography, " +
17
+ "breakpoints, keyframes, color schemes). Requires a running dev server with the editor connected.")
18
+ .option("--port <port>", "Dev server WebSocket port", "5201")
19
+ .action(runListThemeGlobals);
20
+ return cmd;
21
+ }
22
+ //# sourceMappingURL=list-theme-globals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-theme-globals.js","sourceRoot":"","sources":["../../src/commands/list-theme-globals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAM1G,KAAK,UAAU,mBAAmB,CAAC,OAAgC;IACjE,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,CAAC,oBAAoB,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,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,6FAA6F;QAC3F,kGAAkG,CACrG;SACA,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC/B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createMovePageSectionCommand(): Command;
3
+ //# sourceMappingURL=move-page-section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-page-section.d.ts","sourceRoot":"","sources":["../../src/commands/move-page-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DpC,wBAAgB,4BAA4B,IAAI,OAAO,CAsBtD"}
@@ -0,0 +1,62 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runMovePageSection(options) {
4
+ if (!options.pageId || typeof options.pageId !== "string") {
5
+ printErrorAndExit(new Error("--page-id is required (use `ikas-component list-pages` to discover ids)"));
6
+ }
7
+ if (!options.elementId || typeof options.elementId !== "string") {
8
+ printErrorAndExit(new Error("--element-id is required (use `ikas-component list-page-sections` to discover ids)"));
9
+ }
10
+ if (options.toIndex === undefined && !options.direction) {
11
+ printErrorAndExit(new Error("Provide --to-index <n> or --direction <up|down>"));
12
+ }
13
+ if (options.toIndex !== undefined && options.direction) {
14
+ printErrorAndExit(new Error("Provide only one of --to-index or --direction, not both"));
15
+ }
16
+ if (options.direction && options.direction !== "up" && options.direction !== "down") {
17
+ printErrorAndExit(new Error(`--direction must be "up" or "down". Received: ${options.direction}`));
18
+ }
19
+ let toIndex;
20
+ if (options.toIndex !== undefined) {
21
+ toIndex = Number(options.toIndex);
22
+ if (!Number.isInteger(toIndex) || toIndex < 0) {
23
+ printErrorAndExit(new Error(`--to-index must be a non-negative integer. Received: ${options.toIndex}`));
24
+ }
25
+ }
26
+ const port = options.port ? parseInt(options.port, 10) : undefined;
27
+ try {
28
+ const result = await runEditorAction("move-page-section", {
29
+ pageId: options.pageId,
30
+ elementId: options.elementId,
31
+ ...(options.direction ? { direction: options.direction } : { toIndex }),
32
+ ...(options.sfRoutingId ? { sfRoutingId: options.sfRoutingId } : {}),
33
+ ...(options.specificationId ? { specificationId: options.specificationId } : {}),
34
+ }, port ? { port } : {});
35
+ printResultAndExit(result);
36
+ }
37
+ catch (e) {
38
+ printErrorAndExit(e);
39
+ }
40
+ }
41
+ export function createMovePageSectionCommand() {
42
+ const cmd = new Command("move-page-section");
43
+ cmd
44
+ .description([
45
+ "Reorder a section already placed on a page. Target the placement by its elementId (from `ikas-component list-page-sections`).",
46
+ "Use --direction up|down to move it one position, or --to-index <n> to move it to an absolute position.",
47
+ "Indices are 0-based and count only placed sections — the same order `list-page-sections` returns.",
48
+ "The result echoes the resulting order (`sections`) plus `resultIndex`, so you can assert on where the section actually landed rather than assuming. A reorder that does not take effect is returned as an ERROR, never as a success that changed nothing.",
49
+ "COMMON (global) sections — the theme's header/footer — cannot be reordered; their position is fixed by the theme and the call is rejected.",
50
+ "SCOPE: by default reorders the page's BASE layer. A page customized per storefront-routing/specification holds a SEPARATE section order in each of those states. Pass --sf-routing-id (and --specification-id) to reorder one of those states instead; without them the states are untouched. When the page has any state, the result carries `scope`, `pageStates` and `pageStatesNote` — check them before treating the reorder as complete. List a state's own placements with `ikas-component list-page-sections --sf-routing-id ...`. The state must already exist (creating one duplicates the page and is a deliberate editor action, so it is never done automatically).",
51
+ ].join("\n"))
52
+ .requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
53
+ .requiredOption("--element-id <id>", "Placed section elementId (from `ikas-component list-page-sections`)")
54
+ .option("--to-index <n>", "Absolute 0-based target position among the page's sections")
55
+ .option("--direction <up|down>", "Move one position up or down (alternative to --to-index)")
56
+ .option("--sf-routing-id <id>", "Reorder a routing-customized state of the page instead of the base layer")
57
+ .option("--specification-id <id>", "Specification of the customized state (used with --sf-routing-id)")
58
+ .option("--port <port>", "Dev server WebSocket port", "5201")
59
+ .action(runMovePageSection);
60
+ return cmd;
61
+ }
62
+ //# sourceMappingURL=move-page-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-page-section.js","sourceRoot":"","sources":["../../src/commands/move-page-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAY1C,KAAK,UAAU,kBAAkB,CAAC,OAA+B;IAC/D,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1D,iBAAiB,CAAC,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChE,iBAAiB,CACf,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAChG,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;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AO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjF,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,4BAA4B;IAC1C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC7C,GAAG;SACA,WAAW,CACV;QACE,+HAA+H;QAC/H,wGAAwG;QACxG,mGAAmG;QACnG,2PAA2P;QAC3P,4IAA4I;QAC5I,kpBAAkpB;KACnpB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb;SACA,cAAc,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;SAC9E,cAAc,CAAC,mBAAmB,EAAE,qEAAqE,CAAC;SAC1G,MAAM,CAAC,gBAAgB,EAAE,4DAA4D,CAAC;SACtF,MAAM,CAAC,uBAAuB,EAAE,0DAA0D,CAAC;SAC3F,MAAM,CAAC,sBAAsB,EAAE,0EAA0E,CAAC;SAC1G,MAAM,CAAC,yBAAyB,EAAE,mEAAmE,CAAC;SACtG,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC9B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createPublishThemeCommand(): Command;
3
+ //# sourceMappingURL=publish-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-theme.d.ts","sourceRoot":"","sources":["../../src/commands/publish-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,wBAAgB,yBAAyB,IAAI,OAAO,CAWnD"}
@@ -0,0 +1,29 @@
1
+ import { Command } from "commander";
2
+ import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
3
+ async function runPublishTheme(options) {
4
+ const port = options.port ? parseInt(options.port, 10) : undefined;
5
+ try {
6
+ const result = await runEditorAction("publish-theme", {
7
+ confirm: !!options.confirm,
8
+ confirmProduction: !!options.confirmProduction,
9
+ },
10
+ // Publishing optimizes images + uploads the whole project to the host, so
11
+ // give it more headroom than the default action timeout.
12
+ { ...(port ? { port } : {}), timeoutMs: 120_000 });
13
+ printResultAndExit(result);
14
+ }
15
+ catch (e) {
16
+ printErrorAndExit(e);
17
+ }
18
+ }
19
+ export function createPublishThemeCommand() {
20
+ const cmd = new Command("publish-theme");
21
+ cmd
22
+ .description("Publish the current theme LIVE (same as the editor's Publish button — saves the whole project to the storefront). This is a real, customer-facing publish: it does nothing unless you pass --confirm, and the MAIN/production theme additionally requires --confirm-production. Without the flags it returns a dry-run describing what would happen and the previewUrl. On success returns { published: true, previewUrl, isMainTheme }.")
23
+ .option("--confirm", "Actually publish (required). Without it, returns a dry-run.")
24
+ .option("--confirm-production", "Required IN ADDITION to --confirm when publishing the MAIN/production theme (live customer-facing site).")
25
+ .option("--port <port>", "Dev server WebSocket port", "5201")
26
+ .action(runPublishTheme);
27
+ return cmd;
28
+ }
29
+ //# sourceMappingURL=publish-theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-theme.js","sourceRoot":"","sources":["../../src/commands/publish-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,e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+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2bpC,wBAAgB,oBAAoB,IAAI,OAAO,CAM9C"}
@@ -4,8 +4,8 @@ import ora from "ora";
4
4
  import * as fs from "fs";
5
5
  import * as path from "path";
6
6
  import { compileAllComponents } from "../utils/compile.js";
7
- import { transformEsmToWindowGlobals, transformChunkForCanvas, buildChunkMapping, } from "../utils/esm-transform.js";
8
- import { generateProjectId, buildPropGroupHierarchy, validatePropGroups, } from "../utils/component-helpers.js";
7
+ import { transformEsmToWindowGlobals, transformChunkForCanvas, buildChunkMapping, findComputedDynamicImportsInBundles, } from "../utils/esm-transform.js";
8
+ import { generateProjectId, isValidProjectId, findInvalidComponentIds, COMPONENT_ID_HINT, buildPropGroupHierarchy, propIdsByName, resolveCondition, validatePropGroups, } from "../utils/component-helpers.js";
9
9
  const LIBRARY_TYPE_PREFIX = "@ikas/";
10
10
  /**
11
11
  * Match custom types for a component's props from the project's custom types.
@@ -72,6 +72,27 @@ async function publishComponents(options) {
72
72
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
73
73
  console.log(chalk.yellow(` Auto-generated projectId: ${config.projectId}`));
74
74
  }
75
+ else if (!isValidProjectId(config.projectId)) {
76
+ // A malformed projectId (hand-edited config) breaks the editor's republish
77
+ // stability: published/local id prefixes stop matching and every publish
78
+ // INSERTs duplicate design elements. Fail fast instead of corrupting data.
79
+ console.error(chalk.red(`Error: invalid projectId "${config.projectId}" in ikas.config.json`));
80
+ console.error(chalk.gray("projectId must be at least 6 alphanumeric characters (no '-' or '_'). " +
81
+ "Restore the original generated value — do not hand-edit it."));
82
+ process.exit(1);
83
+ }
84
+ // Component ids carry the same prefix/suffix contract as projectId (they are what
85
+ // actually gets published) — a hand-edited id corrupts republish matching even
86
+ // when projectId itself is valid, so reject before anything is sent.
87
+ const invalidComponents = findInvalidComponentIds(config.components, config.projectId);
88
+ if (invalidComponents.length > 0) {
89
+ console.error(chalk.red("Error: invalid component id(s) in ikas.config.json:"));
90
+ invalidComponents.forEach((c) => {
91
+ console.error(chalk.red(` - "${c.id}"${c.name ? ` (${c.name})` : ""} — ${c.reason}`));
92
+ });
93
+ console.error(chalk.gray(COMPONENT_ID_HINT));
94
+ process.exit(1);
95
+ }
75
96
  // Filter components if specific one requested
76
97
  let componentsToPublish = config.components;
77
98
  if (options.component) {
@@ -99,6 +120,26 @@ async function publishComponents(options) {
99
120
  // Build chunk mapping for ESM transform (namespace with projectId)
100
121
  const chunkIds = Array.from(result.chunks.keys());
101
122
  const chunkMapping = buildChunkMapping(chunkIds, config.projectId);
123
+ // A dynamic import whose specifier is computed cannot be rewritten by either consumer of this
124
+ // output: the canvas transform leaves it a native `import()` that 404s against the editor's own
125
+ // URL, and the theme build's `rewriteChunkImports` is a literal string replace that never sees
126
+ // it. Both fail only when something reaches that lazy path, long after the publish.
127
+ //
128
+ // WARNS, does not block — deliberately, and only for now. The equivalent guard for built-ins
129
+ // (packages/builtin-components/scripts/build-bundle.ts) throws, but it judges one bundle this
130
+ // repo builds and can fix in the same commit. This one judges every partner's source, and the
131
+ // risk here is asymmetric: failing to warn costs a lazy path that was already broken, while a
132
+ // false positive costs a partner their publish with no way around it. The detector has been
133
+ // clean over every bundle available to check it against — but "every bundle we have" is not
134
+ // "every bundle there is". Promote this to an error once a release has gone out and real
135
+ // publishes have exercised it.
136
+ const computedImports = findComputedDynamicImportsInBundles(result.chunks, result.entries, new Map(componentsToPublish.map((c) => [c.id, c.name])));
137
+ if (computedImports.length > 0) {
138
+ console.warn(chalk.yellow(` Warning: ${computedImports.length} dynamic import(s) with a computed specifier. Nothing can resolve these — they 404 on the first lazy path that reaches them. Use a literal, e.g. import("./thing.js") not import(name):`));
139
+ for (const offender of computedImports) {
140
+ console.warn(chalk.gray(` ${offender}`));
141
+ }
142
+ }
102
143
  // Process shared modules
103
144
  const sharedModules = [];
104
145
  for (const [chunkId, chunk] of result.chunks) {
@@ -141,6 +182,12 @@ async function publishComponents(options) {
141
182
  const canvasClientJs = transformEsmToWindowGlobals(entry.clientJs, {
142
183
  chunkMapping,
143
184
  });
185
+ // Config names a prop's visibility gate; the editor addresses props by id, so resolve the one
186
+ // against the other off the same index formula the ids come from.
187
+ const propIdByName = propIdsByName(component.props.map((prop, index) => ({
188
+ id: `${component.id}_prop_${index}`,
189
+ name: prop.name,
190
+ })));
144
191
  const propsWithIds = component.props.map((prop, index) => ({
145
192
  id: `${component.id}_prop_${index}`,
146
193
  name: prop.name,
@@ -152,7 +199,11 @@ async function publishComponents(options) {
152
199
  groupId: prop.groupId,
153
200
  typeId: prop.typeId,
154
201
  enumTypeId: prop.enumTypeId,
202
+ ...(prop.numberRangeData
203
+ ? { numberRangeData: prop.numberRangeData }
204
+ : {}),
155
205
  ...(prop.privateVarMap ? { privateVarMap: prop.privateVarMap } : {}),
206
+ ...resolveCondition(prop, propIdByName),
156
207
  }));
157
208
  // Build prop group hierarchy if groups are defined
158
209
  const propGroups = component.propGroups && component.propGroups.length > 0
@@ -167,7 +218,7 @@ async function publishComponents(options) {
167
218
  const componentCustomTypes = config.customTypes
168
219
  ? matchCustomTypesForProps(propsWithIds, config.customTypes)
169
220
  : undefined;
170
- const usedSharedModuleIds = (result.entryChunkIds.get(component.id) || []).map((id) => config.projectId ? `${config.projectId}-${id}` : id);
221
+ const usedSharedModuleIds = (result.entryChunkIds.get(component.id) || []).map((id) => (config.projectId ? `${config.projectId}-${id}` : id));
171
222
  outputComponents.push({
172
223
  id: component.id,
173
224
  name: component.name,