@ikas/component-cli 0.102.0 → 0.103.0

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 (387) hide show
  1. package/dist/commands/config.d.ts.map +1 -1
  2. package/dist/commands/config.js +5 -385
  3. package/dist/commands/config.js.map +1 -1
  4. package/dist/commands/create.d.ts.map +1 -1
  5. package/dist/commands/create.js +43 -118
  6. package/dist/commands/create.js.map +1 -1
  7. package/dist/commands/dev.d.ts.map +1 -1
  8. package/dist/commands/dev.js +5 -135
  9. package/dist/commands/dev.js.map +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +0 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/utils/component-helpers.d.ts +0 -5
  14. package/dist/utils/component-helpers.d.ts.map +1 -1
  15. package/dist/utils/component-helpers.js +1 -14
  16. package/dist/utils/component-helpers.js.map +1 -1
  17. package/dist/utils/template.d.ts +0 -12
  18. package/dist/utils/template.d.ts.map +1 -1
  19. package/dist/utils/template.js +0 -44
  20. package/dist/utils/template.js.map +1 -1
  21. package/dist/utils/websocket-server.d.ts +0 -26
  22. package/dist/utils/websocket-server.d.ts.map +1 -1
  23. package/dist/utils/websocket-server.js +0 -42
  24. package/dist/utils/websocket-server.js.map +1 -1
  25. package/package.json +2 -3
  26. package/templates/create/claude-md +1 -2
  27. package/templates/create/cursorrules +1 -1
  28. package/templates/create/package.json +0 -1
  29. package/templates/create/src/components/ExampleComponent/types.ts +1 -1
  30. package/templates/create/src/components/ExampleSection/types.ts +1 -1
  31. package/templates/create-full/README.md +0 -78
  32. package/templates/create-full/claude-md +0 -721
  33. package/templates/create-full/cursorrules +0 -103
  34. package/templates/create-full/gitignore +0 -4
  35. package/templates/create-full/ikas.config.json +0 -5007
  36. package/templates/create-full/mcp.json +0 -10
  37. package/templates/create-full/package.json +0 -22
  38. package/templates/create-full/src/components/AccountAddresses/components/AddressCard/index.tsx +0 -55
  39. package/templates/create-full/src/components/AccountAddresses/components/AddressCard/styles.css +0 -46
  40. package/templates/create-full/src/components/AccountAddresses/components/AddressModal/index.tsx +0 -301
  41. package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +0 -22
  42. package/templates/create-full/src/components/AccountAddresses/index.tsx +0 -127
  43. package/templates/create-full/src/components/AccountAddresses/styles.css +0 -41
  44. package/templates/create-full/src/components/AccountAddresses/types.ts +0 -15
  45. package/templates/create-full/src/components/AccountFavorites/index.tsx +0 -82
  46. package/templates/create-full/src/components/AccountFavorites/styles.css +0 -52
  47. package/templates/create-full/src/components/AccountFavorites/types.ts +0 -7
  48. package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/index.tsx +0 -171
  49. package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/styles.css +0 -144
  50. package/templates/create-full/src/components/AccountInfo/index.tsx +0 -91
  51. package/templates/create-full/src/components/AccountInfo/styles.css +0 -35
  52. package/templates/create-full/src/components/AccountInfo/types.ts +0 -9
  53. package/templates/create-full/src/components/AccountInfoContent/index.tsx +0 -134
  54. package/templates/create-full/src/components/AccountInfoContent/styles.css +0 -57
  55. package/templates/create-full/src/components/AccountInfoContent/types.ts +0 -8
  56. package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/index.tsx +0 -78
  57. package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/styles.css +0 -46
  58. package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/index.tsx +0 -20
  59. package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/styles.css +0 -16
  60. package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/index.tsx +0 -112
  61. package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/styles.css +0 -86
  62. package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/index.tsx +0 -195
  63. package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/styles.css +0 -93
  64. package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/index.tsx +0 -156
  65. package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/styles.css +0 -100
  66. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/index.tsx +0 -56
  67. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/styles.css +0 -57
  68. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/index.tsx +0 -159
  69. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/styles.css +0 -29
  70. package/templates/create-full/src/components/AccountOrderDetail/index.tsx +0 -244
  71. package/templates/create-full/src/components/AccountOrderDetail/styles.css +0 -125
  72. package/templates/create-full/src/components/AccountOrderDetail/types.ts +0 -32
  73. package/templates/create-full/src/components/AccountOrders/components/OrderCard/index.tsx +0 -122
  74. package/templates/create-full/src/components/AccountOrders/components/OrderCard/styles.css +0 -114
  75. package/templates/create-full/src/components/AccountOrders/index.tsx +0 -105
  76. package/templates/create-full/src/components/AccountOrders/styles.css +0 -36
  77. package/templates/create-full/src/components/AccountOrders/types.ts +0 -11
  78. package/templates/create-full/src/components/Announcement/index.tsx +0 -11
  79. package/templates/create-full/src/components/Announcement/styles.css +0 -4
  80. package/templates/create-full/src/components/Announcement/types.ts +0 -4
  81. package/templates/create-full/src/components/Announcements/index.tsx +0 -91
  82. package/templates/create-full/src/components/Announcements/styles.css +0 -45
  83. package/templates/create-full/src/components/Announcements/types.ts +0 -8
  84. package/templates/create-full/src/components/BlogHome/components/BlogCard/index.tsx +0 -89
  85. package/templates/create-full/src/components/BlogHome/components/BlogCard/styles.css +0 -121
  86. package/templates/create-full/src/components/BlogHome/index.tsx +0 -124
  87. package/templates/create-full/src/components/BlogHome/styles.css +0 -118
  88. package/templates/create-full/src/components/BlogHome/types.ts +0 -15
  89. package/templates/create-full/src/components/BlogPost/index.tsx +0 -128
  90. package/templates/create-full/src/components/BlogPost/styles.css +0 -120
  91. package/templates/create-full/src/components/BlogPost/types.ts +0 -12
  92. package/templates/create-full/src/components/CardProductName/index.tsx +0 -25
  93. package/templates/create-full/src/components/CardProductName/styles.css +0 -22
  94. package/templates/create-full/src/components/CardProductName/types.ts +0 -7
  95. package/templates/create-full/src/components/CardProductPrice/index.tsx +0 -30
  96. package/templates/create-full/src/components/CardProductPrice/styles.css +0 -13
  97. package/templates/create-full/src/components/CardProductPrice/types.ts +0 -6
  98. package/templates/create-full/src/components/CardProductVariants/index.tsx +0 -10
  99. package/templates/create-full/src/components/CardProductVariants/styles.css +0 -1
  100. package/templates/create-full/src/components/CardProductVariants/types.ts +0 -6
  101. package/templates/create-full/src/components/CartPage/components/CouponCode/index.tsx +0 -108
  102. package/templates/create-full/src/components/CartPage/components/CouponCode/styles.css +0 -68
  103. package/templates/create-full/src/components/CartPage/components/EmptyState/index.tsx +0 -31
  104. package/templates/create-full/src/components/CartPage/components/EmptyState/styles.css +0 -18
  105. package/templates/create-full/src/components/CartPage/components/OrderSummary/index.tsx +0 -106
  106. package/templates/create-full/src/components/CartPage/components/OrderSummary/styles.css +0 -70
  107. package/templates/create-full/src/components/CartPage/index.tsx +0 -107
  108. package/templates/create-full/src/components/CartPage/styles.css +0 -54
  109. package/templates/create-full/src/components/CartPage/types.ts +0 -16
  110. package/templates/create-full/src/components/CategoryImageItem/components/Card/index.tsx +0 -64
  111. package/templates/create-full/src/components/CategoryImageItem/components/Card/styles.css +0 -56
  112. package/templates/create-full/src/components/CategoryImageItem/index.tsx +0 -64
  113. package/templates/create-full/src/components/CategoryImageItem/styles.css +0 -10
  114. package/templates/create-full/src/components/CategoryImageItem/types.ts +0 -16
  115. package/templates/create-full/src/components/CategoryImages/index.tsx +0 -62
  116. package/templates/create-full/src/components/CategoryImages/styles.css +0 -38
  117. package/templates/create-full/src/components/CategoryImages/types.ts +0 -11
  118. package/templates/create-full/src/components/CategoryList/components/CategoryListControls/index.tsx +0 -129
  119. package/templates/create-full/src/components/CategoryList/components/CategoryListControls/styles.css +0 -99
  120. package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/index.tsx +0 -42
  121. package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/styles.css +0 -27
  122. package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/index.tsx +0 -43
  123. package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/styles.css +0 -20
  124. package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/index.tsx +0 -114
  125. package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/styles.css +0 -1
  126. package/templates/create-full/src/components/CategoryList/components/FilterListValues/index.tsx +0 -54
  127. package/templates/create-full/src/components/CategoryList/components/FilterListValues/styles.css +0 -22
  128. package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/index.tsx +0 -50
  129. package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/styles.css +0 -25
  130. package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/index.tsx +0 -189
  131. package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/styles.css +0 -89
  132. package/templates/create-full/src/components/CategoryList/components/FilterSidebar/index.tsx +0 -92
  133. package/templates/create-full/src/components/CategoryList/components/FilterSidebar/styles.css +0 -27
  134. package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/index.tsx +0 -63
  135. package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/styles.css +0 -48
  136. package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/index.tsx +0 -146
  137. package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/styles.css +0 -133
  138. package/templates/create-full/src/components/CategoryList/index.tsx +0 -333
  139. package/templates/create-full/src/components/CategoryList/styles.css +0 -110
  140. package/templates/create-full/src/components/CategoryList/types.ts +0 -30
  141. package/templates/create-full/src/components/CollapsibleContent/index.tsx +0 -23
  142. package/templates/create-full/src/components/CollapsibleContent/styles.css +0 -11
  143. package/templates/create-full/src/components/CollapsibleContent/types.ts +0 -6
  144. package/templates/create-full/src/components/CookieBar/index.tsx +0 -78
  145. package/templates/create-full/src/components/CookieBar/styles.css +0 -111
  146. package/templates/create-full/src/components/CookieBar/types.ts +0 -10
  147. package/templates/create-full/src/components/CustomerEmailVerification/index.tsx +0 -168
  148. package/templates/create-full/src/components/CustomerEmailVerification/styles.css +0 -118
  149. package/templates/create-full/src/components/CustomerEmailVerification/types.ts +0 -17
  150. package/templates/create-full/src/components/FeatureItem/index.tsx +0 -27
  151. package/templates/create-full/src/components/FeatureItem/styles.css +0 -19
  152. package/templates/create-full/src/components/FeatureItem/types.ts +0 -7
  153. package/templates/create-full/src/components/Features/index.tsx +0 -25
  154. package/templates/create-full/src/components/Features/styles.css +0 -39
  155. package/templates/create-full/src/components/Features/types.ts +0 -5
  156. package/templates/create-full/src/components/Footer/index.tsx +0 -154
  157. package/templates/create-full/src/components/Footer/styles.css +0 -175
  158. package/templates/create-full/src/components/Footer/types.ts +0 -15
  159. package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/index.tsx +0 -129
  160. package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/styles.css +0 -0
  161. package/templates/create-full/src/components/ForgotPassword/index.tsx +0 -30
  162. package/templates/create-full/src/components/ForgotPassword/styles.css +0 -85
  163. package/templates/create-full/src/components/ForgotPassword/types.ts +0 -13
  164. package/templates/create-full/src/components/Header/index.tsx +0 -53
  165. package/templates/create-full/src/components/Header/styles.css +0 -6
  166. package/templates/create-full/src/components/Header/types.ts +0 -6
  167. package/templates/create-full/src/components/HeroSlider/index.tsx +0 -110
  168. package/templates/create-full/src/components/HeroSlider/styles.css +0 -129
  169. package/templates/create-full/src/components/HeroSlider/types.ts +0 -9
  170. package/templates/create-full/src/components/HeroSliderItem/index.tsx +0 -231
  171. package/templates/create-full/src/components/HeroSliderItem/styles.css +0 -152
  172. package/templates/create-full/src/components/HeroSliderItem/types.ts +0 -34
  173. package/templates/create-full/src/components/Login/components/LoginForm/index.tsx +0 -181
  174. package/templates/create-full/src/components/Login/components/LoginForm/styles.css +0 -0
  175. package/templates/create-full/src/components/Login/index.tsx +0 -37
  176. package/templates/create-full/src/components/Login/styles.css +0 -129
  177. package/templates/create-full/src/components/Login/types.ts +0 -18
  178. package/templates/create-full/src/components/Navbar/components/CartSidebar/index.tsx +0 -203
  179. package/templates/create-full/src/components/Navbar/components/CartSidebar/styles.css +0 -175
  180. package/templates/create-full/src/components/Navbar/components/MobileMenu/index.tsx +0 -198
  181. package/templates/create-full/src/components/Navbar/components/MobileMenu/styles.css +0 -122
  182. package/templates/create-full/src/components/Navbar/components/NavItem/index.tsx +0 -65
  183. package/templates/create-full/src/components/Navbar/components/SearchModal/index.tsx +0 -267
  184. package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +0 -182
  185. package/templates/create-full/src/components/Navbar/index.tsx +0 -250
  186. package/templates/create-full/src/components/Navbar/styles.css +0 -243
  187. package/templates/create-full/src/components/Navbar/types.ts +0 -37
  188. package/templates/create-full/src/components/NotFound/index.tsx +0 -39
  189. package/templates/create-full/src/components/NotFound/styles.css +0 -46
  190. package/templates/create-full/src/components/NotFound/types.ts +0 -8
  191. package/templates/create-full/src/components/ProductDetail/components/ProductGallery/index.tsx +0 -316
  192. package/templates/create-full/src/components/ProductDetail/components/ProductGallery/styles.css +0 -213
  193. package/templates/create-full/src/components/ProductDetail/index.tsx +0 -92
  194. package/templates/create-full/src/components/ProductDetail/styles.css +0 -58
  195. package/templates/create-full/src/components/ProductDetail/types.ts +0 -12
  196. package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx +0 -34
  197. package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/styles.css +0 -4
  198. package/templates/create-full/src/components/ProductDetailAddToCart/index.tsx +0 -146
  199. package/templates/create-full/src/components/ProductDetailAddToCart/styles.css +0 -27
  200. package/templates/create-full/src/components/ProductDetailAddToCart/types.ts +0 -18
  201. package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureRow/index.tsx +0 -164
  202. package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/index.tsx +0 -134
  203. package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/styles.css +0 -188
  204. package/templates/create-full/src/components/ProductDetailBundleFurniture/index.tsx +0 -61
  205. package/templates/create-full/src/components/ProductDetailBundleFurniture/styles.css +0 -12
  206. package/templates/create-full/src/components/ProductDetailBundleFurniture/types.ts +0 -21
  207. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/index.tsx +0 -169
  208. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/styles.css +0 -141
  209. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/index.tsx +0 -35
  210. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/styles.css +0 -85
  211. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/index.tsx +0 -51
  212. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/styles.css +0 -30
  213. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/index.tsx +0 -54
  214. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/styles.css +0 -22
  215. package/templates/create-full/src/components/ProductDetailBundleProduct/index.tsx +0 -101
  216. package/templates/create-full/src/components/ProductDetailBundleProduct/styles.css +0 -20
  217. package/templates/create-full/src/components/ProductDetailBundleProduct/types.ts +0 -18
  218. package/templates/create-full/src/components/ProductDetailDescription/index.tsx +0 -56
  219. package/templates/create-full/src/components/ProductDetailDescription/styles.css +0 -21
  220. package/templates/create-full/src/components/ProductDetailDescription/types.ts +0 -13
  221. package/templates/create-full/src/components/ProductDetailFeatureItem/index.tsx +0 -28
  222. package/templates/create-full/src/components/ProductDetailFeatureItem/styles.css +0 -22
  223. package/templates/create-full/src/components/ProductDetailFeatureItem/types.ts +0 -7
  224. package/templates/create-full/src/components/ProductDetailFeatures/index.tsx +0 -40
  225. package/templates/create-full/src/components/ProductDetailFeatures/styles.css +0 -17
  226. package/templates/create-full/src/components/ProductDetailFeatures/types.ts +0 -10
  227. package/templates/create-full/src/components/ProductDetailNameFavorite/index.tsx +0 -66
  228. package/templates/create-full/src/components/ProductDetailNameFavorite/styles.css +0 -45
  229. package/templates/create-full/src/components/ProductDetailNameFavorite/types.ts +0 -11
  230. package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/index.tsx +0 -209
  231. package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/styles.css +0 -146
  232. package/templates/create-full/src/components/ProductDetailOffer/components/OfferSummary/index.tsx +0 -175
  233. package/templates/create-full/src/components/ProductDetailOffer/index.tsx +0 -199
  234. package/templates/create-full/src/components/ProductDetailOffer/styles.css +0 -211
  235. package/templates/create-full/src/components/ProductDetailOffer/types.ts +0 -24
  236. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/index.tsx +0 -52
  237. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/styles.css +0 -19
  238. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/index.tsx +0 -60
  239. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/styles.css +0 -38
  240. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/index.tsx +0 -102
  241. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/styles.css +0 -34
  242. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/index.tsx +0 -121
  243. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/styles.css +0 -87
  244. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/index.tsx +0 -57
  245. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/index.tsx +0 -54
  246. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/styles.css +0 -0
  247. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/index.tsx +0 -124
  248. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/styles.css +0 -1
  249. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/index.tsx +0 -217
  250. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/styles.css +0 -87
  251. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionRenderer/index.tsx +0 -133
  252. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/index.tsx +0 -60
  253. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/styles.css +0 -1
  254. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/index.tsx +0 -74
  255. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/styles.css +0 -10
  256. package/templates/create-full/src/components/ProductDetailOptionSet/index.tsx +0 -99
  257. package/templates/create-full/src/components/ProductDetailOptionSet/styles.css +0 -30
  258. package/templates/create-full/src/components/ProductDetailOptionSet/types.ts +0 -21
  259. package/templates/create-full/src/components/ProductDetailPrices/index.tsx +0 -62
  260. package/templates/create-full/src/components/ProductDetailPrices/styles.css +0 -32
  261. package/templates/create-full/src/components/ProductDetailPrices/types.ts +0 -10
  262. package/templates/create-full/src/components/ProductDetailProductGroup/index.tsx +0 -74
  263. package/templates/create-full/src/components/ProductDetailProductGroup/styles.css +0 -33
  264. package/templates/create-full/src/components/ProductDetailProductGroup/types.ts +0 -10
  265. package/templates/create-full/src/components/ProductDetailReviews/index.tsx +0 -205
  266. package/templates/create-full/src/components/ProductDetailReviews/styles.css +0 -43
  267. package/templates/create-full/src/components/ProductDetailReviews/types.ts +0 -19
  268. package/templates/create-full/src/components/ProductDetailSku/index.tsx +0 -38
  269. package/templates/create-full/src/components/ProductDetailSku/styles.css +0 -16
  270. package/templates/create-full/src/components/ProductDetailSku/types.ts +0 -11
  271. package/templates/create-full/src/components/ProductDetailVariant/index.tsx +0 -38
  272. package/templates/create-full/src/components/ProductDetailVariant/styles.css +0 -14
  273. package/templates/create-full/src/components/ProductDetailVariant/types.ts +0 -12
  274. package/templates/create-full/src/components/ProductSlider/index.tsx +0 -151
  275. package/templates/create-full/src/components/ProductSlider/styles.css +0 -105
  276. package/templates/create-full/src/components/ProductSlider/types.ts +0 -17
  277. package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/index.tsx +0 -133
  278. package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/styles.css +0 -0
  279. package/templates/create-full/src/components/RecoverPassword/index.tsx +0 -30
  280. package/templates/create-full/src/components/RecoverPassword/styles.css +0 -93
  281. package/templates/create-full/src/components/RecoverPassword/types.ts +0 -13
  282. package/templates/create-full/src/components/Register/components/RegisterForm/index.tsx +0 -326
  283. package/templates/create-full/src/components/Register/components/RegisterForm/styles.css +0 -0
  284. package/templates/create-full/src/components/Register/index.tsx +0 -30
  285. package/templates/create-full/src/components/Register/styles.css +0 -152
  286. package/templates/create-full/src/components/Register/types.ts +0 -27
  287. package/templates/create-full/src/components/RichText/index.tsx +0 -25
  288. package/templates/create-full/src/components/RichText/styles.css +0 -51
  289. package/templates/create-full/src/components/RichText/types.ts +0 -5
  290. package/templates/create-full/src/components/SocialMediaIcon/index.tsx +0 -26
  291. package/templates/create-full/src/components/SocialMediaIcon/styles.css +0 -17
  292. package/templates/create-full/src/components/SocialMediaIcon/types.ts +0 -7
  293. package/templates/create-full/src/components/index.ts +0 -50
  294. package/templates/create-full/src/global-types.ts +0 -13
  295. package/templates/create-full/src/global.css +0 -582
  296. package/templates/create-full/src/hooks/useBundleProducts.ts +0 -75
  297. package/templates/create-full/src/hooks/useColumnPreference.ts +0 -26
  298. package/templates/create-full/src/hooks/useInfiniteScroll.ts +0 -49
  299. package/templates/create-full/src/hooks/usePageTracking.ts +0 -56
  300. package/templates/create-full/src/hooks/usePayWithIkas.ts +0 -114
  301. package/templates/create-full/src/hooks/useRedirectIfLoggedIn.ts +0 -35
  302. package/templates/create-full/src/hooks/useScrollLock.ts +0 -20
  303. package/templates/create-full/src/hooks/useToast.ts +0 -27
  304. package/templates/create-full/src/ikas-component-utils.d.ts +0 -3
  305. package/templates/create-full/src/sub-components/Badge/index.tsx +0 -208
  306. package/templates/create-full/src/sub-components/Badge/styles.css +0 -129
  307. package/templates/create-full/src/sub-components/Breadcrumb/index.tsx +0 -57
  308. package/templates/create-full/src/sub-components/Breadcrumb/styles.css +0 -49
  309. package/templates/create-full/src/sub-components/BundleMedia/index.tsx +0 -72
  310. package/templates/create-full/src/sub-components/BundleQuantityBox/index.tsx +0 -73
  311. package/templates/create-full/src/sub-components/BundleQuantityBox/styles.css +0 -43
  312. package/templates/create-full/src/sub-components/Button/index.tsx +0 -52
  313. package/templates/create-full/src/sub-components/Button/styles.css +0 -114
  314. package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/index.tsx +0 -59
  315. package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/styles.css +0 -24
  316. package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/index.tsx +0 -55
  317. package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/styles.css +0 -30
  318. package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/index.tsx +0 -31
  319. package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/styles.css +0 -6
  320. package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/index.tsx +0 -79
  321. package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/styles.css +0 -28
  322. package/templates/create-full/src/sub-components/CartItem/index.tsx +0 -216
  323. package/templates/create-full/src/sub-components/CartItem/styles.css +0 -170
  324. package/templates/create-full/src/sub-components/Checkbox/index.tsx +0 -42
  325. package/templates/create-full/src/sub-components/Checkbox/styles.css +0 -65
  326. package/templates/create-full/src/sub-components/CollapsibleGroup/index.tsx +0 -52
  327. package/templates/create-full/src/sub-components/CollapsibleGroup/styles.css +0 -51
  328. package/templates/create-full/src/sub-components/ColorInput/index.tsx +0 -33
  329. package/templates/create-full/src/sub-components/ColorInput/styles.css +0 -53
  330. package/templates/create-full/src/sub-components/ConfirmModal/index.tsx +0 -60
  331. package/templates/create-full/src/sub-components/ConfirmModal/styles.css +0 -20
  332. package/templates/create-full/src/sub-components/FormItem/index.tsx +0 -66
  333. package/templates/create-full/src/sub-components/FormItem/styles.css +0 -38
  334. package/templates/create-full/src/sub-components/ImagePreviewModal/index.tsx +0 -55
  335. package/templates/create-full/src/sub-components/ImagePreviewModal/styles.css +0 -50
  336. package/templates/create-full/src/sub-components/Input/index.tsx +0 -69
  337. package/templates/create-full/src/sub-components/Input/styles.css +0 -162
  338. package/templates/create-full/src/sub-components/Modal/index.tsx +0 -118
  339. package/templates/create-full/src/sub-components/Modal/styles.css +0 -70
  340. package/templates/create-full/src/sub-components/PageLoader/index.tsx +0 -14
  341. package/templates/create-full/src/sub-components/PageLoader/styles.css +0 -12
  342. package/templates/create-full/src/sub-components/Pagination/index.tsx +0 -107
  343. package/templates/create-full/src/sub-components/Pagination/styles.css +0 -88
  344. package/templates/create-full/src/sub-components/ProductCard/index.tsx +0 -276
  345. package/templates/create-full/src/sub-components/ProductCard/styles.css +0 -99
  346. package/templates/create-full/src/sub-components/QuantitySelector/index.tsx +0 -41
  347. package/templates/create-full/src/sub-components/QuantitySelector/styles.css +0 -51
  348. package/templates/create-full/src/sub-components/ReviewCard/index.tsx +0 -103
  349. package/templates/create-full/src/sub-components/ReviewCard/styles.css +0 -95
  350. package/templates/create-full/src/sub-components/ReviewForm/index.tsx +0 -115
  351. package/templates/create-full/src/sub-components/ReviewForm/styles.css +0 -11
  352. package/templates/create-full/src/sub-components/ReviewSummary/index.tsx +0 -65
  353. package/templates/create-full/src/sub-components/ReviewSummary/styles.css +0 -86
  354. package/templates/create-full/src/sub-components/Select/index.tsx +0 -86
  355. package/templates/create-full/src/sub-components/Select/styles.css +0 -110
  356. package/templates/create-full/src/sub-components/SkeletonField/index.tsx +0 -12
  357. package/templates/create-full/src/sub-components/SkeletonField/styles.css +0 -29
  358. package/templates/create-full/src/sub-components/SliderArrow/index.tsx +0 -26
  359. package/templates/create-full/src/sub-components/SliderArrow/styles.css +0 -24
  360. package/templates/create-full/src/sub-components/SocialLoginButton/index.tsx +0 -24
  361. package/templates/create-full/src/sub-components/SocialLoginButton/styles.css +0 -19
  362. package/templates/create-full/src/sub-components/SpinnerIcon/index.tsx +0 -10
  363. package/templates/create-full/src/sub-components/SpinnerIcon/styles.css +0 -8
  364. package/templates/create-full/src/sub-components/StarRating/index.tsx +0 -76
  365. package/templates/create-full/src/sub-components/StarRating/styles.css +0 -40
  366. package/templates/create-full/src/sub-components/Tag/index.tsx +0 -21
  367. package/templates/create-full/src/sub-components/Tag/styles.css +0 -30
  368. package/templates/create-full/src/sub-components/Textarea/index.tsx +0 -45
  369. package/templates/create-full/src/sub-components/Textarea/styles.css +0 -82
  370. package/templates/create-full/src/sub-components/Toast/index.tsx +0 -257
  371. package/templates/create-full/src/sub-components/Toast/styles.css +0 -3
  372. package/templates/create-full/src/sub-components/Toggle/index.tsx +0 -46
  373. package/templates/create-full/src/sub-components/Toggle/styles.css +0 -86
  374. package/templates/create-full/src/sub-components/VariantBadge/index.tsx +0 -153
  375. package/templates/create-full/src/sub-components/VariantBadge/styles.css +0 -47
  376. package/templates/create-full/src/sub-components/icons/index.tsx +0 -981
  377. package/templates/create-full/src/utils/bundle.ts +0 -70
  378. package/templates/create-full/src/utils/cx.ts +0 -4
  379. package/templates/create-full/src/utils/fullName.ts +0 -6
  380. package/templates/create-full/src/utils/media.ts +0 -36
  381. package/templates/create-full/src/utils/optionPrice.ts +0 -19
  382. package/templates/create-full/src/utils/optionSet.ts +0 -17
  383. package/templates/create-full/src/utils/orderStatus.ts +0 -28
  384. package/templates/create-full/src/utils/pagination.ts +0 -29
  385. package/templates/create-full/src/utils/toast.ts +0 -5
  386. package/templates/create-full/tsconfig.json +0 -30
  387. package/templates/create-full/vite.config.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAg3CpC,wBAAgB,mBAAmB,IAAI,OAAO,CA0K7C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAk8BpC,wBAAgB,mBAAmB,IAAI,OAAO,CAwH7C"}
@@ -1,7 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import * as fs from "fs";
3
3
  import * as path from "path";
4
- import { PROP_TYPES, toPascalCase, toKebabCase, generateTypesFile, generateGlobalTypesFile, generateComponentFile, generateStylesFile, generateProjectId, generateComponentId, generateUniqueId, updateBarrelExport, findPropGroup, collectPropGroupIds, } from "../utils/component-helpers.js";
4
+ import { PROP_TYPES, toPascalCase, toKebabCase, generateTypesFile, generateGlobalTypesFile, generateComponentFile, generateStylesFile, generateProjectId, generateComponentId, updateBarrelExport, findPropGroup, collectPropGroupIds, } from "../utils/component-helpers.js";
5
5
  function loadConfig() {
6
6
  const configPath = path.resolve(process.cwd(), "ikas.config.json");
7
7
  if (!fs.existsSync(configPath)) {
@@ -53,7 +53,7 @@ function camelCaseToDisplayName(name) {
53
53
  * Parse and validate the --props JSON flag for add-component.
54
54
  * Returns validated ComponentProp[] or exits with error.
55
55
  */
56
- function parsePropsFlag(propsJson, config) {
56
+ function parsePropsFlag(propsJson) {
57
57
  let rawProps;
58
58
  try {
59
59
  rawProps = JSON.parse(propsJson);
@@ -135,22 +135,10 @@ function parsePropsFlag(propsJson, config) {
135
135
  if (!r.enumTypeId || typeof r.enumTypeId !== "string") {
136
136
  console.log(JSON.stringify({
137
137
  success: false,
138
- error: `Prop "${r.name}" has type ENUM but is missing required "enumTypeId" field. Create one with: config add-enum`,
138
+ error: `Prop "${r.name}" has type ENUM but is missing required "enumTypeId" field.`,
139
139
  }));
140
140
  process.exit(1);
141
141
  }
142
- // Validate enum type exists (skip library types)
143
- if (config && typeof r.enumTypeId === "string" && !r.enumTypeId.startsWith("@ikas/")) {
144
- const customTypes = config.customTypes || [];
145
- const enumExists = customTypes.some((t) => t.id === r.enumTypeId && t.type === "enum");
146
- if (!enumExists) {
147
- console.log(JSON.stringify({
148
- success: false,
149
- error: `Enum type "${r.enumTypeId}" not found for prop "${r.name}". Create it first with: config add-enum --name "MyEnum" --options '{"Label":"value"}'`,
150
- }));
151
- process.exit(1);
152
- }
153
- }
154
142
  }
155
143
  const prop = {
156
144
  name: r.name,
@@ -163,21 +151,12 @@ function parsePropsFlag(propsJson, config) {
163
151
  ...(r.defaultValue !== undefined
164
152
  ? { defaultValue: r.defaultValue }
165
153
  : {}),
166
- ...(typeof r.groupId === "string" && r.groupId
167
- ? { groupId: r.groupId }
168
- : {}),
169
154
  ...(propType === "TYPE" && typeof r.typeId === "string"
170
155
  ? { typeId: r.typeId }
171
156
  : {}),
172
157
  ...(propType === "ENUM" && typeof r.enumTypeId === "string"
173
158
  ? { enumTypeId: r.enumTypeId }
174
159
  : {}),
175
- ...((propType === "COMPONENT" || propType === "COMPONENT_LIST") && r.filteredComponentIds && Array.isArray(r.filteredComponentIds)
176
- ? { filteredComponentIds: r.filteredComponentIds }
177
- : {}),
178
- ...((propType === "COMPONENT" || propType === "COMPONENT_LIST") && r.privateVarMap && typeof r.privateVarMap === "object"
179
- ? { privateVarMap: r.privateVarMap }
180
- : {}),
181
160
  };
182
161
  props.push(prop);
183
162
  }
@@ -215,22 +194,8 @@ function addComponent(name, options) {
215
194
  fs.mkdirSync(componentDir, { recursive: true });
216
195
  // Parse --props if provided, otherwise empty
217
196
  const props = options.props
218
- ? parsePropsFlag(options.props, config)
197
+ ? parsePropsFlag(options.props)
219
198
  : [];
220
- // Auto-create prop groups from groupId references in props
221
- const referencedGroupIds = new Set();
222
- for (const prop of props) {
223
- if (prop.groupId) {
224
- referencedGroupIds.add(prop.groupId);
225
- }
226
- }
227
- let propGroups;
228
- if (referencedGroupIds.size > 0) {
229
- propGroups = Array.from(referencedGroupIds).map((groupId) => ({
230
- id: groupId,
231
- name: camelCaseToDisplayName(groupId),
232
- }));
233
- }
234
199
  fs.writeFileSync(path.join(componentDir, "types.ts"), generateTypesFile(pascalName, props, componentType, null, config.customTypes));
235
200
  fs.writeFileSync(path.join(componentDir, "index.tsx"), generateComponentFile(pascalName, props, componentType));
236
201
  fs.writeFileSync(path.join(componentDir, "styles.css"), generateStylesFile(pascalName, componentType));
@@ -244,7 +209,6 @@ function addComponent(name, options) {
244
209
  ...(options.isHeader ? { isHeader: true } : {}),
245
210
  ...(options.isFooter ? { isFooter: true } : {}),
246
211
  props,
247
- ...(propGroups ? { propGroups } : {}),
248
212
  };
249
213
  config.components.push(newComponent);
250
214
  saveConfig(configPath, config);
@@ -314,22 +278,10 @@ function addProp(componentName, options) {
314
278
  if (propType === "ENUM" && !options.enumTypeId) {
315
279
  console.log(JSON.stringify({
316
280
  success: false,
317
- error: `ENUM props require --enumTypeId. Run "config add-enum" to create one, or "config list-types" to see available types.`,
281
+ error: `ENUM props require --enumTypeId. Run "config list-types" to see available enum types.`,
318
282
  }));
319
283
  process.exit(1);
320
284
  }
321
- // Validate that enumTypeId references an existing enum type
322
- if (propType === "ENUM" && options.enumTypeId && !options.enumTypeId.startsWith("@ikas/")) {
323
- const customTypes = config.customTypes || [];
324
- const enumExists = customTypes.some((t) => t.id === options.enumTypeId && t.type === "enum");
325
- if (!enumExists) {
326
- console.log(JSON.stringify({
327
- success: false,
328
- error: `Enum type "${options.enumTypeId}" not found. Create it first with: config add-enum --name "MyEnum" --options '{"Label":"value"}'`,
329
- }));
330
- process.exit(1);
331
- }
332
- }
333
285
  // Validate group reference
334
286
  if (options.group) {
335
287
  if (!component.propGroups || component.propGroups.length === 0) {
@@ -348,36 +300,6 @@ function addProp(componentName, options) {
348
300
  process.exit(1);
349
301
  }
350
302
  }
351
- // Parse filteredComponentIds JSON for COMPONENT/COMPONENT_LIST
352
- let parsedFilteredIds;
353
- if (options.filteredComponentIds && (propType === "COMPONENT" || propType === "COMPONENT_LIST")) {
354
- try {
355
- parsedFilteredIds = JSON.parse(options.filteredComponentIds);
356
- if (!Array.isArray(parsedFilteredIds)) {
357
- console.log(JSON.stringify({ success: false, error: "--filteredComponentIds must be a JSON array of strings." }));
358
- process.exit(1);
359
- }
360
- }
361
- catch {
362
- console.log(JSON.stringify({ success: false, error: `Invalid --filteredComponentIds JSON: ${options.filteredComponentIds}` }));
363
- process.exit(1);
364
- }
365
- }
366
- // Parse privateVarMap JSON for COMPONENT/COMPONENT_LIST
367
- let parsedPrivateVarMap;
368
- if (options.privateVarMap && (propType === "COMPONENT" || propType === "COMPONENT_LIST")) {
369
- try {
370
- parsedPrivateVarMap = JSON.parse(options.privateVarMap);
371
- if (typeof parsedPrivateVarMap !== "object" || Array.isArray(parsedPrivateVarMap)) {
372
- console.log(JSON.stringify({ success: false, error: "--privateVarMap must be a JSON object mapping keys to {id, typeId}." }));
373
- process.exit(1);
374
- }
375
- }
376
- catch {
377
- console.log(JSON.stringify({ success: false, error: `Invalid --privateVarMap JSON: ${options.privateVarMap}` }));
378
- process.exit(1);
379
- }
380
- }
381
303
  const newProp = {
382
304
  name: options.name,
383
305
  displayName: options.displayName,
@@ -390,8 +312,6 @@ function addProp(componentName, options) {
390
312
  ...(options.group ? { groupId: options.group } : {}),
391
313
  ...(options.typeId ? { typeId: options.typeId } : {}),
392
314
  ...(options.enumTypeId ? { enumTypeId: options.enumTypeId } : {}),
393
- ...(parsedFilteredIds ? { filteredComponentIds: parsedFilteredIds } : {}),
394
- ...(parsedPrivateVarMap ? { privateVarMap: parsedPrivateVarMap } : {}),
395
315
  };
396
316
  component.props.push(newProp);
397
317
  saveConfig(configPath, config);
@@ -408,8 +328,6 @@ function addProp(componentName, options) {
408
328
  required: newProp.required,
409
329
  ...(newProp.groupId ? { groupId: newProp.groupId } : {}),
410
330
  ...(newProp.enumTypeId ? { enumTypeId: newProp.enumTypeId } : {}),
411
- ...(newProp.filteredComponentIds ? { filteredComponentIds: newProp.filteredComponentIds } : {}),
412
- ...(newProp.privateVarMap ? { privateVarMap: newProp.privateVarMap } : {}),
413
331
  },
414
332
  }));
415
333
  }
@@ -504,44 +422,6 @@ function updateProp(componentName, options) {
504
422
  prop.enumTypeId = options.enumTypeId;
505
423
  }
506
424
  }
507
- if (options.filteredComponentIds !== undefined) {
508
- if (options.filteredComponentIds === "" || options.filteredComponentIds === "none") {
509
- delete prop.filteredComponentIds;
510
- }
511
- else {
512
- try {
513
- const parsed = JSON.parse(options.filteredComponentIds);
514
- if (!Array.isArray(parsed)) {
515
- console.log(JSON.stringify({ success: false, error: "--filteredComponentIds must be a JSON array of strings." }));
516
- process.exit(1);
517
- }
518
- prop.filteredComponentIds = parsed;
519
- }
520
- catch {
521
- console.log(JSON.stringify({ success: false, error: `Invalid --filteredComponentIds JSON: ${options.filteredComponentIds}` }));
522
- process.exit(1);
523
- }
524
- }
525
- }
526
- if (options.privateVarMap !== undefined) {
527
- if (options.privateVarMap === "" || options.privateVarMap === "none") {
528
- delete prop.privateVarMap;
529
- }
530
- else {
531
- try {
532
- const parsed = JSON.parse(options.privateVarMap);
533
- if (typeof parsed !== "object" || Array.isArray(parsed)) {
534
- console.log(JSON.stringify({ success: false, error: "--privateVarMap must be a JSON object mapping keys to {id, typeId}." }));
535
- process.exit(1);
536
- }
537
- prop.privateVarMap = parsed;
538
- }
539
- catch {
540
- console.log(JSON.stringify({ success: false, error: `Invalid --privateVarMap JSON: ${options.privateVarMap}` }));
541
- process.exit(1);
542
- }
543
- }
544
- }
545
425
  saveConfig(configPath, config);
546
426
  // Regenerate types.ts and global types
547
427
  regenerateTypes(component, undefined, config);
@@ -557,8 +437,6 @@ function updateProp(componentName, options) {
557
437
  ...(prop.groupId ? { groupId: prop.groupId } : {}),
558
438
  ...(prop.typeId ? { typeId: prop.typeId } : {}),
559
439
  ...(prop.enumTypeId ? { enumTypeId: prop.enumTypeId } : {}),
560
- ...(prop.filteredComponentIds ? { filteredComponentIds: prop.filteredComponentIds } : {}),
561
- ...(prop.privateVarMap ? { privateVarMap: prop.privateVarMap } : {}),
562
440
  },
563
441
  }));
564
442
  }
@@ -765,41 +643,6 @@ function removePropGroup(componentName, options) {
765
643
  remainingPropGroups: component.propGroups.map(g => g.id),
766
644
  }));
767
645
  }
768
- function updateComponent(options) {
769
- const { config, configPath } = loadConfig();
770
- const component = findComponent(config, options.name);
771
- if (!component) {
772
- console.log(JSON.stringify({
773
- success: false,
774
- error: `Component "${options.name}" not found. Available: ${getComponentNames(config).join(", ")}`,
775
- }));
776
- process.exit(1);
777
- }
778
- if (options.isHeader !== undefined) {
779
- if (options.isHeader) {
780
- component.isHeader = true;
781
- }
782
- else {
783
- delete component.isHeader;
784
- }
785
- }
786
- if (options.isFooter !== undefined) {
787
- if (options.isFooter) {
788
- component.isFooter = true;
789
- }
790
- else {
791
- delete component.isFooter;
792
- }
793
- }
794
- saveConfig(configPath, config);
795
- console.log(JSON.stringify({
796
- success: true,
797
- componentName: component.name,
798
- type: component.type ?? "component",
799
- ...(component.isHeader ? { isHeader: true } : {}),
800
- ...(component.isFooter ? { isFooter: true } : {}),
801
- }));
802
- }
803
646
  function listComponents() {
804
647
  const { config } = loadConfig();
805
648
  const components = config.components.map((c) => ({
@@ -827,184 +670,6 @@ function listComponents() {
827
670
  components,
828
671
  }));
829
672
  }
830
- // --- Enum CRUD ---
831
- function addEnum(options) {
832
- const { config, configPath } = loadConfig();
833
- // Validate name
834
- if (!options.name || typeof options.name !== "string" || !options.name.trim()) {
835
- console.log(JSON.stringify({ success: false, error: "Enum name is required." }));
836
- process.exit(1);
837
- }
838
- const enumName = options.name.trim();
839
- // Check for name collision (PascalCase comparison since generated TS types are PascalCase)
840
- if (!config.customTypes)
841
- config.customTypes = [];
842
- const pascalName = toPascalCase(enumName);
843
- const existing = config.customTypes.find((t) => t.type === "enum" && toPascalCase(t.name) === pascalName);
844
- if (existing) {
845
- console.log(JSON.stringify({
846
- success: false,
847
- error: `Enum "${enumName}" already exists (ID: ${existing.id}).`,
848
- }));
849
- process.exit(1);
850
- }
851
- // Parse and validate options JSON
852
- let enumOptions;
853
- try {
854
- enumOptions = JSON.parse(options.options);
855
- }
856
- catch {
857
- console.log(JSON.stringify({
858
- success: false,
859
- error: `Invalid --options JSON: ${options.options}`,
860
- }));
861
- process.exit(1);
862
- }
863
- if (typeof enumOptions !== "object" ||
864
- Array.isArray(enumOptions) ||
865
- Object.keys(enumOptions).length === 0) {
866
- console.log(JSON.stringify({
867
- success: false,
868
- error: 'Options must be a non-empty JSON object, e.g. \'{"Small":"sm","Medium":"md","Large":"lg"}\'.',
869
- }));
870
- process.exit(1);
871
- }
872
- const enumId = generateUniqueId();
873
- config.customTypes.push({
874
- id: enumId,
875
- name: enumName,
876
- type: "enum",
877
- enumOptions,
878
- isDynamic: false,
879
- });
880
- saveConfig(configPath, config);
881
- // Regenerate global types and all component types
882
- regenerateGlobalTypes(config);
883
- for (const component of config.components) {
884
- regenerateTypes(component, undefined, config);
885
- }
886
- console.log(JSON.stringify({
887
- success: true,
888
- enumId,
889
- enumName,
890
- enumOptions,
891
- }));
892
- }
893
- function updateEnum(options) {
894
- const { config, configPath } = loadConfig();
895
- if (!config.customTypes)
896
- config.customTypes = [];
897
- const enumIndex = config.customTypes.findIndex((t) => t.id === options.id && t.type === "enum");
898
- if (enumIndex === -1) {
899
- console.log(JSON.stringify({
900
- success: false,
901
- error: `Enum with ID "${options.id}" not found.`,
902
- }));
903
- process.exit(1);
904
- }
905
- const enumType = config.customTypes[enumIndex];
906
- if (options.name !== undefined) {
907
- const pascalName = toPascalCase(options.name);
908
- const collision = config.customTypes.find((t) => t.type === "enum" &&
909
- t.id !== options.id &&
910
- toPascalCase(t.name) === pascalName);
911
- if (collision) {
912
- console.log(JSON.stringify({
913
- success: false,
914
- error: `Enum name "${options.name}" conflicts with existing enum (ID: ${collision.id}).`,
915
- }));
916
- process.exit(1);
917
- }
918
- enumType.name = options.name;
919
- }
920
- if (options.options !== undefined) {
921
- let enumOptions;
922
- try {
923
- enumOptions = JSON.parse(options.options);
924
- }
925
- catch {
926
- console.log(JSON.stringify({
927
- success: false,
928
- error: `Invalid --options JSON: ${options.options}`,
929
- }));
930
- process.exit(1);
931
- }
932
- if (typeof enumOptions !== "object" ||
933
- Array.isArray(enumOptions) ||
934
- Object.keys(enumOptions).length === 0) {
935
- console.log(JSON.stringify({
936
- success: false,
937
- error: 'Options must be a non-empty JSON object.',
938
- }));
939
- process.exit(1);
940
- }
941
- enumType.enumOptions = enumOptions;
942
- }
943
- saveConfig(configPath, config);
944
- // Regenerate global types and all component types
945
- regenerateGlobalTypes(config);
946
- for (const component of config.components) {
947
- regenerateTypes(component, undefined, config);
948
- }
949
- console.log(JSON.stringify({
950
- success: true,
951
- enumId: enumType.id,
952
- enumName: enumType.name,
953
- enumOptions: enumType.enumOptions,
954
- }));
955
- }
956
- function removeEnum(options) {
957
- const { config, configPath } = loadConfig();
958
- if (!config.customTypes)
959
- config.customTypes = [];
960
- const enumIndex = config.customTypes.findIndex((t) => t.id === options.id && t.type === "enum");
961
- if (enumIndex === -1) {
962
- console.log(JSON.stringify({
963
- success: false,
964
- error: `Enum with ID "${options.id}" not found.`,
965
- }));
966
- process.exit(1);
967
- }
968
- // Check if any component prop references this enum
969
- for (const component of config.components) {
970
- for (const prop of component.props) {
971
- if (prop.enumTypeId === options.id) {
972
- console.log(JSON.stringify({
973
- success: false,
974
- error: `Cannot remove enum "${config.customTypes[enumIndex].name}": prop "${prop.name}" on component "${component.name}" references it. Remove or update the prop first.`,
975
- }));
976
- process.exit(1);
977
- }
978
- }
979
- }
980
- const removed = config.customTypes.splice(enumIndex, 1)[0];
981
- saveConfig(configPath, config);
982
- // Regenerate global types and all component types
983
- regenerateGlobalTypes(config);
984
- for (const component of config.components) {
985
- regenerateTypes(component, undefined, config);
986
- }
987
- console.log(JSON.stringify({
988
- success: true,
989
- removedEnumId: removed.id,
990
- removedEnumName: removed.name,
991
- }));
992
- }
993
- function listEnums() {
994
- const { config } = loadConfig();
995
- const enums = (config.customTypes || [])
996
- .filter((t) => t.type === "enum")
997
- .map((t) => ({
998
- id: t.id,
999
- name: t.name,
1000
- enumOptions: t.enumOptions,
1001
- }));
1002
- console.log(JSON.stringify({
1003
- success: true,
1004
- enumCount: enums.length,
1005
- enums,
1006
- }));
1007
- }
1008
673
  // --- Command registration ---
1009
674
  export function createConfigCommand() {
1010
675
  const config = new Command("config")
@@ -1033,8 +698,6 @@ export function createConfigCommand() {
1033
698
  .option("--group <groupId>", "Assign prop to a prop group")
1034
699
  .option("--typeId <typeId>", "Type ID for TYPE props (required when type is TYPE)")
1035
700
  .option("--enumTypeId <enumTypeId>", "Enum type ID for ENUM props (required when type is ENUM)")
1036
- .option("--filteredComponentIds <json>", "JSON array of component IDs to restrict selection (for COMPONENT/COMPONENT_LIST)")
1037
- .option("--privateVarMap <json>", 'JSON object mapping variable keys to {id, typeId} (for COMPONENT/COMPONENT_LIST)')
1038
701
  .action((options) => {
1039
702
  addProp(options.component, options);
1040
703
  });
@@ -1051,8 +714,6 @@ export function createConfigCommand() {
1051
714
  .option("--group <groupId>", "Move prop to a group (use 'none' to ungroup)")
1052
715
  .option("--typeId <typeId>", "Type ID for TYPE props (use 'none' to clear)")
1053
716
  .option("--enumTypeId <enumTypeId>", "Enum type ID for ENUM props (use 'none' to clear)")
1054
- .option("--filteredComponentIds <json>", "JSON array of component IDs (use 'none' to clear)")
1055
- .option("--privateVarMap <json>", "JSON object mapping variable keys to {id, typeId} (use 'none' to clear)")
1056
717
  .action((options) => {
1057
718
  updateProp(options.component, options);
1058
719
  });
@@ -1064,17 +725,6 @@ export function createConfigCommand() {
1064
725
  .action((options) => {
1065
726
  removeProp(options.component, options);
1066
727
  });
1067
- config
1068
- .command("update-component")
1069
- .description("Update a component's metadata (isHeader, isFooter)")
1070
- .requiredOption("--name <name>", "Component name")
1071
- .option("--isHeader", "Mark as store header")
1072
- .option("--no-isHeader", "Unmark as store header")
1073
- .option("--isFooter", "Mark as store footer")
1074
- .option("--no-isFooter", "Unmark as store footer")
1075
- .action((options) => {
1076
- updateComponent(options);
1077
- });
1078
728
  config
1079
729
  .command("remove-component")
1080
730
  .description("Remove a component from the project (deletes files)")
@@ -1124,36 +774,6 @@ export function createConfigCommand() {
1124
774
  .action(async (options) => {
1125
775
  await listTypes(options.componentType);
1126
776
  });
1127
- config
1128
- .command("add-enum")
1129
- .description("Create a custom enum type (offline, no editor needed)")
1130
- .requiredOption("--name <name>", "Enum name (e.g. Size, AspectRatio)")
1131
- .requiredOption("--options <json>", 'JSON object of label→value pairs, e.g. \'{"Small":"sm","Medium":"md","Large":"lg"}\'')
1132
- .action((options) => {
1133
- addEnum(options);
1134
- });
1135
- config
1136
- .command("update-enum")
1137
- .description("Update a custom enum type")
1138
- .requiredOption("--id <id>", "Enum ID to update")
1139
- .option("--name <name>", "New enum name")
1140
- .option("--options <json>", "New JSON object of label→value pairs")
1141
- .action((options) => {
1142
- updateEnum(options);
1143
- });
1144
- config
1145
- .command("remove-enum")
1146
- .description("Remove a custom enum type (fails if any prop references it)")
1147
- .requiredOption("--id <id>", "Enum ID to remove")
1148
- .action((options) => {
1149
- removeEnum(options);
1150
- });
1151
- config
1152
- .command("list-enums")
1153
- .description("List all custom enum types defined in this project")
1154
- .action(() => {
1155
- listEnums();
1156
- });
1157
777
  return config;
1158
778
  }
1159
779
  async function listTypes(componentType) {