@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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCpC,wBAAgB,GAAG,qBAElB;AAED,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyGpC,wBAAgB,GAAG,qBAElB;AAED,cAAc,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,17 +1,38 @@
1
1
  import { Command } from "commander";
2
- import { createAddCommand } from "./commands/add.js";
2
+ import { createAddSectionsToPageCommand } from "./commands/add-sections-to-page.js";
3
3
  import { createAddToPageCommand } from "./commands/add-to-page.js";
4
+ import { createAddCommand } from "./commands/add.js";
4
5
  import { createBuildCommand } from "./commands/build.js";
5
6
  import { createCheckCommand } from "./commands/check.js";
6
7
  import { createConfigCommand } from "./commands/config.js";
8
+ import { createCreateBreakpointCommand, createCreateColorCommand, createCreateColorSchemeCommand, createCreateKeyframeCommand, createCreateTextStyleCommand, createRenameColorSchemeSlotCommand, createUpdateBreakpointCommand, createUpdateColorCommand, createUpdateColorSchemeCommand, createUpdateKeyframeCommand, createUpdateTextStyleCommand, } from "./commands/create-design-tokens.js";
9
+ import { createCreateGlobalVariableCommand } from "./commands/create-global-variable.js";
10
+ import { createCreatePageCommand } from "./commands/create-page.js";
11
+ import { createDeletePageCommand } from "./commands/delete-page.js";
12
+ import { createDeleteDesignTokenCommand, createDeleteGlobalVariableCommand, } from "./commands/delete-theme-globals.js";
7
13
  import { createDevCommand } from "./commands/dev.js";
14
+ import { createGetComponentPropsCommand } from "./commands/get-component-props.js";
15
+ import { createEnableBuiltinPagesCommand } from "./commands/enable-builtin-pages.js";
16
+ import { createGetPageByTypeCommand } from "./commands/get-page-by-type.js";
17
+ import { createListBuiltinPagesCommand } from "./commands/list-builtin-pages.js";
18
+ import { createUpdateBuiltinPagePropCommand } from "./commands/update-builtin-page-prop.js";
19
+ import { createGetSectionValuesCommand } from "./commands/get-section-values.js";
8
20
  import { createImportCommand } from "./commands/import.js";
21
+ import { createListEntitiesCommand } from "./commands/list-entities.js";
9
22
  import { createListImportedCommand } from "./commands/list-imported.js";
10
23
  import { createListPageSectionsCommand } from "./commands/list-page-sections.js";
24
+ import { createMovePageSectionCommand } from "./commands/move-page-section.js";
25
+ import { createRemovePageSectionCommand } from "./commands/remove-page-section.js";
11
26
  import { createListPagesCommand } from "./commands/list-pages.js";
27
+ import { createListThemeGlobalsCommand } from "./commands/list-theme-globals.js";
28
+ import { createPublishThemeCommand } from "./commands/publish-theme.js";
12
29
  import { createPublishCommand } from "./commands/publish.js";
30
+ import { createSearchProductsCommand } from "./commands/search-products.js";
31
+ import { createUpdateGlobalVariableCommand } from "./commands/update-global-variable.js";
32
+ import { createUpdatePageSectionsCommand } from "./commands/update-page-sections.js";
13
33
  import { createUpdateSectionPropCommand } from "./commands/update-section-prop.js";
14
34
  import { createUploadImageCommand } from "./commands/upload-image.js";
35
+ import { createUploadImagesCommand } from "./commands/upload-images.js";
15
36
  const program = new Command();
16
37
  program
17
38
  .name("ikas-component")
@@ -28,9 +49,41 @@ program.addCommand(createListPagesCommand());
28
49
  program.addCommand(createListImportedCommand());
29
50
  program.addCommand(createImportCommand());
30
51
  program.addCommand(createAddToPageCommand());
52
+ program.addCommand(createListThemeGlobalsCommand());
53
+ program.addCommand(createCreateGlobalVariableCommand());
54
+ program.addCommand(createCreateColorCommand());
55
+ program.addCommand(createUpdateColorCommand());
56
+ program.addCommand(createCreateTextStyleCommand());
57
+ program.addCommand(createUpdateTextStyleCommand());
58
+ program.addCommand(createCreateBreakpointCommand());
59
+ program.addCommand(createUpdateBreakpointCommand());
60
+ program.addCommand(createCreateKeyframeCommand());
61
+ program.addCommand(createUpdateKeyframeCommand());
62
+ program.addCommand(createCreateColorSchemeCommand());
63
+ program.addCommand(createUpdateColorSchemeCommand());
64
+ program.addCommand(createRenameColorSchemeSlotCommand());
65
+ program.addCommand(createUpdateGlobalVariableCommand());
66
+ program.addCommand(createDeleteGlobalVariableCommand());
67
+ program.addCommand(createDeleteDesignTokenCommand());
68
+ program.addCommand(createAddSectionsToPageCommand());
31
69
  program.addCommand(createListPageSectionsCommand());
70
+ program.addCommand(createMovePageSectionCommand());
71
+ program.addCommand(createRemovePageSectionCommand());
72
+ program.addCommand(createGetSectionValuesCommand());
73
+ program.addCommand(createGetComponentPropsCommand());
74
+ program.addCommand(createGetPageByTypeCommand());
75
+ program.addCommand(createListBuiltinPagesCommand());
76
+ program.addCommand(createUpdateBuiltinPagePropCommand());
77
+ program.addCommand(createEnableBuiltinPagesCommand());
78
+ program.addCommand(createCreatePageCommand());
79
+ program.addCommand(createDeletePageCommand());
80
+ program.addCommand(createPublishThemeCommand());
32
81
  program.addCommand(createUpdateSectionPropCommand());
82
+ program.addCommand(createUpdatePageSectionsCommand());
33
83
  program.addCommand(createUploadImageCommand());
84
+ program.addCommand(createUploadImagesCommand());
85
+ program.addCommand(createSearchProductsCommand());
86
+ program.addCommand(createListEntitiesCommand());
34
87
  export function run() {
35
88
  return program.parseAsync(process.argv);
36
89
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,g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AAC,CAAC;AACrD,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAC,CAAC;AACpD,OAAO,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,CAAC;AACrD,OAAO,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC,CAAC;AACjD,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAC,CAAC;AACpD,OAAO,CAAC,UAAU,CAAC,kCAAkC,EAAE,CAAC,CAAC;AACzD,OAAO,CAAC,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAC;AACtD,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,CAAC;AAC9C,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,CAAC;AAC9C,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAChD,OAAO,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,CAAC;AACrD,OAAO,CAAC,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAC;AACtD,OAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,CAAC;AAC/C,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAChD,OAAO,CAAC,UAAU,CAAC,2BAA2B,EAAE,CAAC,CAAC;AAClD,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAEhD,MAAM,UAAU,GAAG;IACjB,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,cAAc,YAAY,CAAC"}
package/dist/types.d.ts CHANGED
@@ -43,6 +43,24 @@ export interface ComponentPropGroup {
43
43
  name: string;
44
44
  description?: string;
45
45
  children?: ComponentPropGroup[];
46
+ /**
47
+ * Conditional visibility ("Koşullu Prop"). Names a BOOLEAN or ENUM prop on this component; the
48
+ * group and everything under it are drawn in the editor's settings panel only while that prop
49
+ * satisfies the condition, and a required prop hidden this way stops blocking a publish.
50
+ *
51
+ * A NAME, not an id — config props carry no id, the CLI mints those from position, and a name
52
+ * survives a reorder where an index would not.
53
+ *
54
+ * Nothing under a hidden group is dropped from the theme or from what renders; the controls come
55
+ * back with what they held.
56
+ */
57
+ requiredProp?: string;
58
+ /** For a BOOLEAN gate — which state of `requiredProp` shows this group. Defaults to `true`. */
59
+ requiredPropValue?: boolean;
60
+ /** For an ENUM gate — the option's id. */
61
+ requiredEnumOptionId?: string;
62
+ /** For an ENUM gate — the option value `requiredProp` must hold. */
63
+ requiredEnumOptionValue?: string;
46
64
  }
47
65
  /**
48
66
  * Prop definition for a component
@@ -60,6 +78,13 @@ export interface ComponentProp {
60
78
  typeId?: string;
61
79
  /** For ENUM props — the enum type ID from TypeStore (e.g. "@ikas/bp-storefront-models-FlexDirectionStyleType") */
62
80
  enumTypeId?: string;
81
+ /** For NUMBER_RANGE props — slider config (min/max/interval/unit) */
82
+ numberRangeData?: {
83
+ min?: number;
84
+ max?: number;
85
+ interval?: number;
86
+ unit?: string;
87
+ };
63
88
  /** For COMPONENT/COMPONENT_LIST props — map of variable keys to { id, typeId } */
64
89
  privateVarMap?: Record<string, {
65
90
  id: string;
@@ -67,6 +92,16 @@ export interface ComponentProp {
67
92
  }>;
68
93
  /** For COMPONENT/COMPONENT_LIST props — restrict which components can be selected */
69
94
  filteredComponentIds?: string[];
95
+ /**
96
+ * Conditional visibility — see {@link ComponentPropGroup.requiredProp} for the full contract.
97
+ */
98
+ requiredProp?: string;
99
+ /** For a BOOLEAN gate — which state of `requiredProp` shows this prop. Defaults to `true`. */
100
+ requiredPropValue?: boolean;
101
+ /** For an ENUM gate — the option's id. */
102
+ requiredEnumOptionId?: string;
103
+ /** For an ENUM gate — the option value `requiredProp` must hold. */
104
+ requiredEnumOptionValue?: string;
70
105
  }
71
106
  /**
72
107
  * Result of component compilation
@@ -114,4 +149,20 @@ export interface SharedModuleData {
114
149
  canvasClientJs: string;
115
150
  compiledCss: string;
116
151
  }
152
+ /**
153
+ * Theme global-variable metadata carried over the dev-server `sync-types` protocol
154
+ * (name / displayName / type only — no value). Drives the generated `ThemeSettingName`
155
+ * union in the author's `src/global-types.ts`.
156
+ */
157
+ export type ThemeSettingMeta = {
158
+ name: string;
159
+ displayName: string;
160
+ type: string;
161
+ /**
162
+ * ENUM only — id of the project enum the setting selects from. Types the setting's entry in
163
+ * the generated value map as that enum's union type, and forces the union to be emitted even
164
+ * when no component prop uses the enum.
165
+ */
166
+ enumTypeId?: string;
167
+ };
117
168
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,WAAW,GACX,QAAQ,GACR,cAAc,GACd,SAAS,GACT,OAAO,GACP,YAAY,GACZ,OAAO,GACP,KAAK,GACL,UAAU,GACV,MAAM,GACN,MAAM,GACN,cAAc,GACd,OAAO,GACP,MAAM,GACN,SAAS,GACT,cAAc,GACd,mBAAmB,GACnB,wBAAwB,GACxB,UAAU,GACV,eAAe,GACf,OAAO,GACP,YAAY,GACZ,MAAM,GACN,WAAW,GACX,eAAe,GACf,oBAAoB,GACpB,MAAM,GACN,WAAW,GACX,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,yFAAyF;IACzF,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAA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,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Directory / file names that never belong in a theme source archive.
3
+ * `node_modules` is the reason this module exists (a theme folder is a few MB
4
+ * without it and hundreds of MB with it); the rest are either machine-local
5
+ * noise or secrets that must not be copied to cloud storage.
6
+ */
7
+ export declare const DEFAULT_ARCHIVE_EXCLUDES: string[];
8
+ export interface ArchiveProjectOptions {
9
+ /** Absolute path of the folder to archive (the theme project root). */
10
+ rootDir: string;
11
+ /** Extra exclude patterns (directory / file names, matched at every depth). */
12
+ exclude?: string[];
13
+ /** Where to write the zip; defaults to a unique file in the OS temp dir. */
14
+ outputPath?: string;
15
+ /**
16
+ * Id table applied to the archived source text (see `rewriteIdsInText`).
17
+ * Only the zip gets the rewritten text; files on disk are never modified.
18
+ */
19
+ rewriteIds?: Record<string, string>;
20
+ }
21
+ export interface ArchiveProjectResult {
22
+ zipPath: string;
23
+ size: number;
24
+ fileCount: number;
25
+ }
26
+ export interface UploadArchiveOptions {
27
+ zipPath: string;
28
+ uploadUrl: string;
29
+ /** HTTP method the upload URL was signed for; presigned PUT is the norm. */
30
+ method?: string;
31
+ /** Extra headers the signature requires (e.g. a Content-Type it was signed with). */
32
+ headers?: Record<string, string>;
33
+ }
34
+ export interface UploadArchiveResult {
35
+ status: number;
36
+ etag?: string;
37
+ }
38
+ export declare function isRewritableFile(rel: string): boolean;
39
+ /**
40
+ * Replace every occurrence of a table key with its value, longest key first so
41
+ * a full id (`<projectId>-hero-slider`) wins over its project-id root, which
42
+ * still covers everything derived from it (chunk ids, `cc_<projectId>_…`
43
+ * scopes). Plain substring semantics, same as the editor's publish rewrite.
44
+ */
45
+ export declare function rewriteIdsInText(text: string, ids: Record<string, string>): string;
46
+ export declare function isExcluded(name: string, patterns: string[]): boolean;
47
+ /**
48
+ * Recursively list files under `rootDir`, skipping excluded names at every
49
+ * depth (a nested `node_modules` inside a workspace package is dropped too).
50
+ * Returns paths relative to `rootDir` with forward slashes, sorted for a
51
+ * deterministic archive.
52
+ */
53
+ export declare function collectProjectFiles(rootDir: string, patterns: string[]): string[];
54
+ /**
55
+ * Zip the project folder WITHOUT its node_modules (and the other excludes).
56
+ * The working tree is never modified — the archive is simply built without
57
+ * those entries, which yields the same zip as deleting them first would.
58
+ */
59
+ export declare function archiveProject(options: ArchiveProjectOptions): Promise<ArchiveProjectResult>;
60
+ /**
61
+ * PUT the zip to a presigned URL (Cloudflare R2 / S3 style). The CLI holds no
62
+ * cloud credentials: the editor asks the ikas backend for a short-lived signed
63
+ * URL and hands it over, so the bytes go straight from the partner's machine
64
+ * to the bucket without passing through the browser or the websocket tunnel.
65
+ */
66
+ export declare function uploadArchive(options: UploadArchiveOptions): Promise<UploadArchiveResult>;
67
+ /** Delete the zip; also drops the temp dir when it is one `archiveProject` created. */
68
+ export declare function removeArchive(zipPath: string): void;
69
+ //# sourceMappingURL=archive-project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-project.d.ts","sourceRoot":"","sources":["../../src/utils/archive-project.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,UAUpC,CAAC;AAIF,MAAM,WAAW,qBAAqB;IACpC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA0BD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIrD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,MAAM,CAUR;AAUD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,EAAE,CAkBV;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CA2D/B;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAqB9B;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAanD"}
@@ -0,0 +1,202 @@
1
+ import archiver from "archiver";
2
+ import * as fs from "fs";
3
+ import * as os from "os";
4
+ import * as path from "path";
5
+ /**
6
+ * Directory / file names that never belong in a theme source archive.
7
+ * `node_modules` is the reason this module exists (a theme folder is a few MB
8
+ * without it and hundreds of MB with it); the rest are either machine-local
9
+ * noise or secrets that must not be copied to cloud storage.
10
+ */
11
+ export const DEFAULT_ARCHIVE_EXCLUDES = [
12
+ "node_modules",
13
+ ".git",
14
+ ".DS_Store",
15
+ ".env",
16
+ ".env.*",
17
+ ".ikas-tmp",
18
+ // `ikas theme link` state (editor URL, store name, storefront/theme ids) —
19
+ // the partner's own store; a customer links the copy to theirs.
20
+ ".ikas",
21
+ ];
22
+ const TEMP_DIR_PREFIX = "ikas-theme-archive-";
23
+ /**
24
+ * Source files whose text may carry ids: the config, code, styles and docs.
25
+ * Lockfiles are left alone — their integrity hashes are opaque base64 that a
26
+ * short id could in theory occur in, and they never reference ids anyway.
27
+ */
28
+ const REWRITABLE_EXTENSIONS = new Set([
29
+ ".json",
30
+ ".ts",
31
+ ".tsx",
32
+ ".js",
33
+ ".jsx",
34
+ ".mjs",
35
+ ".cjs",
36
+ ".css",
37
+ ".scss",
38
+ ".md",
39
+ ".html",
40
+ ]);
41
+ const NEVER_REWRITE = new Set([
42
+ "package-lock.json",
43
+ "pnpm-lock.yaml",
44
+ "yarn.lock",
45
+ ]);
46
+ export function isRewritableFile(rel) {
47
+ const base = path.posix.basename(rel);
48
+ if (NEVER_REWRITE.has(base))
49
+ return false;
50
+ return REWRITABLE_EXTENSIONS.has(path.posix.extname(base).toLowerCase());
51
+ }
52
+ /**
53
+ * Replace every occurrence of a table key with its value, longest key first so
54
+ * a full id (`<projectId>-hero-slider`) wins over its project-id root, which
55
+ * still covers everything derived from it (chunk ids, `cc_<projectId>_…`
56
+ * scopes). Plain substring semantics, same as the editor's publish rewrite.
57
+ */
58
+ export function rewriteIdsInText(text, ids) {
59
+ const keys = Object.keys(ids)
60
+ .filter((k) => k && ids[k] && ids[k] !== k)
61
+ .sort((a, b) => b.length - a.length);
62
+ if (keys.length === 0)
63
+ return text;
64
+ const pattern = new RegExp(keys.map((k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), "g");
65
+ return text.replace(pattern, (match) => ids[match]);
66
+ }
67
+ /** Glob-lite matcher: supports a trailing/leading `*` only, which is all the exclude list needs. */
68
+ function matchesPattern(name, pattern) {
69
+ if (pattern === name)
70
+ return true;
71
+ if (pattern.endsWith("*"))
72
+ return name.startsWith(pattern.slice(0, -1));
73
+ if (pattern.startsWith("*"))
74
+ return name.endsWith(pattern.slice(1));
75
+ return false;
76
+ }
77
+ export function isExcluded(name, patterns) {
78
+ return patterns.some((p) => matchesPattern(name, p));
79
+ }
80
+ /**
81
+ * Recursively list files under `rootDir`, skipping excluded names at every
82
+ * depth (a nested `node_modules` inside a workspace package is dropped too).
83
+ * Returns paths relative to `rootDir` with forward slashes, sorted for a
84
+ * deterministic archive.
85
+ */
86
+ export function collectProjectFiles(rootDir, patterns) {
87
+ const files = [];
88
+ const walk = (dir) => {
89
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
90
+ for (const entry of entries) {
91
+ if (isExcluded(entry.name, patterns))
92
+ continue;
93
+ const full = path.join(dir, entry.name);
94
+ if (entry.isDirectory()) {
95
+ walk(full);
96
+ }
97
+ else if (entry.isFile()) {
98
+ files.push(path.relative(rootDir, full).split(path.sep).join("/"));
99
+ }
100
+ // symlinks and other special entries are skipped on purpose: a symlinked
101
+ // node_modules or a socket file must not end up in the archive.
102
+ }
103
+ };
104
+ walk(rootDir);
105
+ return files.sort();
106
+ }
107
+ /**
108
+ * Zip the project folder WITHOUT its node_modules (and the other excludes).
109
+ * The working tree is never modified — the archive is simply built without
110
+ * those entries, which yields the same zip as deleting them first would.
111
+ */
112
+ export async function archiveProject(options) {
113
+ const rootDir = path.resolve(options.rootDir);
114
+ if (!fs.existsSync(rootDir) || !fs.statSync(rootDir).isDirectory()) {
115
+ throw new Error(`Project folder not found: ${rootDir}`);
116
+ }
117
+ const patterns = [...DEFAULT_ARCHIVE_EXCLUDES, ...(options.exclude ?? [])];
118
+ const files = collectProjectFiles(rootDir, patterns);
119
+ const rewriteIds = options.rewriteIds ?? {};
120
+ const shouldRewrite = Object.keys(rewriteIds).length > 0;
121
+ if (files.length === 0) {
122
+ throw new Error(`Nothing to archive in ${rootDir} (every file is excluded)`);
123
+ }
124
+ const zipPath = options.outputPath ??
125
+ path.join(fs.mkdtempSync(path.join(os.tmpdir(), TEMP_DIR_PREFIX)), "theme-source.zip");
126
+ await new Promise((resolve, reject) => {
127
+ const output = fs.createWriteStream(zipPath);
128
+ const archive = archiver("zip", { zlib: { level: 9 } });
129
+ output.on("close", () => resolve());
130
+ output.on("error", reject);
131
+ archive.on("error", reject);
132
+ archive.on("warning", (err) => {
133
+ // ENOENT = a file vanished between listing and zipping (editor save, build
134
+ // output churn); skip it rather than fail the whole archive.
135
+ if (err.code === "ENOENT")
136
+ return;
137
+ reject(err);
138
+ });
139
+ archive.pipe(output);
140
+ for (const rel of files) {
141
+ const full = path.join(rootDir, rel);
142
+ if (shouldRewrite && isRewritableFile(rel)) {
143
+ let text;
144
+ try {
145
+ text = fs.readFileSync(full, "utf-8");
146
+ }
147
+ catch (err) {
148
+ // Same tolerance as archiver's ENOENT warning above: a file that
149
+ // vanished since listing is skipped, anything else fails the archive.
150
+ if (err.code === "ENOENT")
151
+ continue;
152
+ throw err;
153
+ }
154
+ archive.append(rewriteIdsInText(text, rewriteIds), { name: rel });
155
+ }
156
+ else {
157
+ archive.file(full, { name: rel });
158
+ }
159
+ }
160
+ void archive.finalize();
161
+ });
162
+ return { zipPath, size: fs.statSync(zipPath).size, fileCount: files.length };
163
+ }
164
+ /**
165
+ * PUT the zip to a presigned URL (Cloudflare R2 / S3 style). The CLI holds no
166
+ * cloud credentials: the editor asks the ikas backend for a short-lived signed
167
+ * URL and hands it over, so the bytes go straight from the partner's machine
168
+ * to the bucket without passing through the browser or the websocket tunnel.
169
+ */
170
+ export async function uploadArchive(options) {
171
+ const body = fs.readFileSync(options.zipPath);
172
+ const method = (options.method ?? "PUT").toUpperCase();
173
+ const headers = {
174
+ "Content-Type": "application/zip",
175
+ "Content-Length": String(body.byteLength),
176
+ ...(options.headers ?? {}),
177
+ };
178
+ const response = await fetch(options.uploadUrl, { method, headers, body });
179
+ if (!response.ok) {
180
+ const text = await response.text().catch(() => "");
181
+ throw new Error(`Archive upload failed: ${response.status} ${response.statusText}${text ? ` — ${text.slice(0, 300)}` : ""}`);
182
+ }
183
+ return {
184
+ status: response.status,
185
+ etag: response.headers.get("etag") ?? undefined,
186
+ };
187
+ }
188
+ /** Delete the zip; also drops the temp dir when it is one `archiveProject` created. */
189
+ export function removeArchive(zipPath) {
190
+ try {
191
+ fs.rmSync(zipPath, { force: true });
192
+ const dir = path.dirname(zipPath);
193
+ if (path.basename(dir).startsWith(TEMP_DIR_PREFIX) &&
194
+ fs.readdirSync(dir).length === 0) {
195
+ fs.rmdirSync(dir);
196
+ }
197
+ }
198
+ catch {
199
+ // best-effort temp cleanup
200
+ }
201
+ }
202
+ //# sourceMappingURL=archive-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-project.js","sourceRoot":"","sources":["../../src/utils/archive-project.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,cAAc;IACd,MAAM;IACN,WAAW;IACX,MAAM;IACN,QAAQ;IACR,WAAW;IACX,2EAA2E;IAC3E,gEAAgE;IAChE,OAAO;CACR,CAAC;AAEF,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAoC9C;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,OAAO;IACP,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,OAAO;CACR,CAAC,CAAC;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,mBAAmB;IACnB,gBAAgB;IAChB,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,OAAO,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3E,CAA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MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,IACE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC;YAC9C,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAChC,CAAC;YACD,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,2BAA2B;IAC7B,CAAC;AACH,CAAC"}
@@ -4,7 +4,10 @@ import type { CompilationResult, MultiCompilationResult } from "../types.js";
4
4
  */
5
5
  export declare function compileComponent(entryPath: string, stylesPath: string, componentId: string): Promise<CompilationResult>;
6
6
  /**
7
- * Scope CSS selectors with a component-specific class prefix
7
+ * Scope CSS selectors with a component-specific class prefix, then namespace any
8
+ * document-global CSS identifiers (`@keyframes`, `@font-face` font-family,
9
+ * `@counter-style`) DEFINED in this component so two components — or the host theme —
10
+ * declaring the same name can't collide in the page's global namespace.
8
11
  */
9
12
  export declare function scopeCSS(css: string, componentId: string): string;
10
13
  /**
@@ -12,6 +15,18 @@ export declare function scopeCSS(css: string, componentId: string): string;
12
15
  * Each selector becomes: .cc_id1 .sel, .cc_id2 .sel { ... }
13
16
  */
14
17
  export declare function scopeCSSMulti(css: string, componentIds: string[]): string;
18
+ export interface CompileAllOptions {
19
+ /**
20
+ * Bundle the `@ikas/bp-storefront*` packages into the artifact instead of leaving them for the
21
+ * host to resolve. See `vendorStorefrontPlugin` for why, and for what it costs.
22
+ *
23
+ * Off by default: a theme's own code components SHOULD bind to the storefront the theme ships,
24
+ * so a merchant gets one `customerStore` and one router. Turn it on only for artifacts that are
25
+ * published independently of any theme — today that means the built-in account pages, which are
26
+ * delivered from the CDN and cannot assume anything about the theme they land in.
27
+ */
28
+ vendorStorefront?: boolean;
29
+ }
15
30
  /**
16
31
  * Compile all components together with esbuild code splitting.
17
32
  * Shared code is automatically extracted into chunk files.
@@ -21,5 +36,5 @@ export declare function compileAllComponents(components: {
21
36
  id: string;
22
37
  entryPath: string;
23
38
  stylesPath: string;
24
- }[], globalStylesPath?: string): Promise<MultiCompilationResult>;
39
+ }[], globalStylesPath?: string, options?: CompileAllOptions): Promise<MultiCompilationResult>;
25
40
  //# sourceMappingURL=compile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/utils/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAuB,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAmClG;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAoD5B;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAGzE;AAyFD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,EACnE,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAwTjC"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/utils/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAuB,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAmElG;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EA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