@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.
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +5 -385
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +43 -118
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +5 -135
- package/dist/commands/dev.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/component-helpers.d.ts +0 -5
- package/dist/utils/component-helpers.d.ts.map +1 -1
- package/dist/utils/component-helpers.js +1 -14
- package/dist/utils/component-helpers.js.map +1 -1
- package/dist/utils/template.d.ts +0 -12
- package/dist/utils/template.d.ts.map +1 -1
- package/dist/utils/template.js +0 -44
- package/dist/utils/template.js.map +1 -1
- package/dist/utils/websocket-server.d.ts +0 -26
- package/dist/utils/websocket-server.d.ts.map +1 -1
- package/dist/utils/websocket-server.js +0 -42
- package/dist/utils/websocket-server.js.map +1 -1
- package/package.json +2 -3
- package/templates/create/claude-md +1 -2
- package/templates/create/cursorrules +1 -1
- package/templates/create/package.json +0 -1
- package/templates/create/src/components/ExampleComponent/types.ts +1 -1
- package/templates/create/src/components/ExampleSection/types.ts +1 -1
- package/templates/create-full/README.md +0 -78
- package/templates/create-full/claude-md +0 -721
- package/templates/create-full/cursorrules +0 -103
- package/templates/create-full/gitignore +0 -4
- package/templates/create-full/ikas.config.json +0 -5007
- package/templates/create-full/mcp.json +0 -10
- package/templates/create-full/package.json +0 -22
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/index.tsx +0 -55
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/styles.css +0 -46
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/index.tsx +0 -301
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +0 -22
- package/templates/create-full/src/components/AccountAddresses/index.tsx +0 -127
- package/templates/create-full/src/components/AccountAddresses/styles.css +0 -41
- package/templates/create-full/src/components/AccountAddresses/types.ts +0 -15
- package/templates/create-full/src/components/AccountFavorites/index.tsx +0 -82
- package/templates/create-full/src/components/AccountFavorites/styles.css +0 -52
- package/templates/create-full/src/components/AccountFavorites/types.ts +0 -7
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/index.tsx +0 -171
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/styles.css +0 -144
- package/templates/create-full/src/components/AccountInfo/index.tsx +0 -91
- package/templates/create-full/src/components/AccountInfo/styles.css +0 -35
- package/templates/create-full/src/components/AccountInfo/types.ts +0 -9
- package/templates/create-full/src/components/AccountInfoContent/index.tsx +0 -134
- package/templates/create-full/src/components/AccountInfoContent/styles.css +0 -57
- package/templates/create-full/src/components/AccountInfoContent/types.ts +0 -8
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/index.tsx +0 -78
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/styles.css +0 -46
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/index.tsx +0 -20
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/styles.css +0 -16
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/index.tsx +0 -112
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/styles.css +0 -86
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/index.tsx +0 -195
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/styles.css +0 -93
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/index.tsx +0 -156
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/styles.css +0 -100
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/index.tsx +0 -56
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/styles.css +0 -57
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/index.tsx +0 -159
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/styles.css +0 -29
- package/templates/create-full/src/components/AccountOrderDetail/index.tsx +0 -244
- package/templates/create-full/src/components/AccountOrderDetail/styles.css +0 -125
- package/templates/create-full/src/components/AccountOrderDetail/types.ts +0 -32
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/index.tsx +0 -122
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/styles.css +0 -114
- package/templates/create-full/src/components/AccountOrders/index.tsx +0 -105
- package/templates/create-full/src/components/AccountOrders/styles.css +0 -36
- package/templates/create-full/src/components/AccountOrders/types.ts +0 -11
- package/templates/create-full/src/components/Announcement/index.tsx +0 -11
- package/templates/create-full/src/components/Announcement/styles.css +0 -4
- package/templates/create-full/src/components/Announcement/types.ts +0 -4
- package/templates/create-full/src/components/Announcements/index.tsx +0 -91
- package/templates/create-full/src/components/Announcements/styles.css +0 -45
- package/templates/create-full/src/components/Announcements/types.ts +0 -8
- package/templates/create-full/src/components/BlogHome/components/BlogCard/index.tsx +0 -89
- package/templates/create-full/src/components/BlogHome/components/BlogCard/styles.css +0 -121
- package/templates/create-full/src/components/BlogHome/index.tsx +0 -124
- package/templates/create-full/src/components/BlogHome/styles.css +0 -118
- package/templates/create-full/src/components/BlogHome/types.ts +0 -15
- package/templates/create-full/src/components/BlogPost/index.tsx +0 -128
- package/templates/create-full/src/components/BlogPost/styles.css +0 -120
- package/templates/create-full/src/components/BlogPost/types.ts +0 -12
- package/templates/create-full/src/components/CardProductName/index.tsx +0 -25
- package/templates/create-full/src/components/CardProductName/styles.css +0 -22
- package/templates/create-full/src/components/CardProductName/types.ts +0 -7
- package/templates/create-full/src/components/CardProductPrice/index.tsx +0 -30
- package/templates/create-full/src/components/CardProductPrice/styles.css +0 -13
- package/templates/create-full/src/components/CardProductPrice/types.ts +0 -6
- package/templates/create-full/src/components/CardProductVariants/index.tsx +0 -10
- package/templates/create-full/src/components/CardProductVariants/styles.css +0 -1
- package/templates/create-full/src/components/CardProductVariants/types.ts +0 -6
- package/templates/create-full/src/components/CartPage/components/CouponCode/index.tsx +0 -108
- package/templates/create-full/src/components/CartPage/components/CouponCode/styles.css +0 -68
- package/templates/create-full/src/components/CartPage/components/EmptyState/index.tsx +0 -31
- package/templates/create-full/src/components/CartPage/components/EmptyState/styles.css +0 -18
- package/templates/create-full/src/components/CartPage/components/OrderSummary/index.tsx +0 -106
- package/templates/create-full/src/components/CartPage/components/OrderSummary/styles.css +0 -70
- package/templates/create-full/src/components/CartPage/index.tsx +0 -107
- package/templates/create-full/src/components/CartPage/styles.css +0 -54
- package/templates/create-full/src/components/CartPage/types.ts +0 -16
- package/templates/create-full/src/components/CategoryImageItem/components/Card/index.tsx +0 -64
- package/templates/create-full/src/components/CategoryImageItem/components/Card/styles.css +0 -56
- package/templates/create-full/src/components/CategoryImageItem/index.tsx +0 -64
- package/templates/create-full/src/components/CategoryImageItem/styles.css +0 -10
- package/templates/create-full/src/components/CategoryImageItem/types.ts +0 -16
- package/templates/create-full/src/components/CategoryImages/index.tsx +0 -62
- package/templates/create-full/src/components/CategoryImages/styles.css +0 -38
- package/templates/create-full/src/components/CategoryImages/types.ts +0 -11
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/index.tsx +0 -129
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/styles.css +0 -99
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/index.tsx +0 -42
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/styles.css +0 -27
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/index.tsx +0 -43
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/styles.css +0 -20
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/index.tsx +0 -114
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/styles.css +0 -1
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/index.tsx +0 -54
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/styles.css +0 -22
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/index.tsx +0 -50
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/styles.css +0 -25
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/index.tsx +0 -189
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/styles.css +0 -89
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/index.tsx +0 -92
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/styles.css +0 -27
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/index.tsx +0 -63
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/styles.css +0 -48
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/index.tsx +0 -146
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/styles.css +0 -133
- package/templates/create-full/src/components/CategoryList/index.tsx +0 -333
- package/templates/create-full/src/components/CategoryList/styles.css +0 -110
- package/templates/create-full/src/components/CategoryList/types.ts +0 -30
- package/templates/create-full/src/components/CollapsibleContent/index.tsx +0 -23
- package/templates/create-full/src/components/CollapsibleContent/styles.css +0 -11
- package/templates/create-full/src/components/CollapsibleContent/types.ts +0 -6
- package/templates/create-full/src/components/CookieBar/index.tsx +0 -78
- package/templates/create-full/src/components/CookieBar/styles.css +0 -111
- package/templates/create-full/src/components/CookieBar/types.ts +0 -10
- package/templates/create-full/src/components/CustomerEmailVerification/index.tsx +0 -168
- package/templates/create-full/src/components/CustomerEmailVerification/styles.css +0 -118
- package/templates/create-full/src/components/CustomerEmailVerification/types.ts +0 -17
- package/templates/create-full/src/components/FeatureItem/index.tsx +0 -27
- package/templates/create-full/src/components/FeatureItem/styles.css +0 -19
- package/templates/create-full/src/components/FeatureItem/types.ts +0 -7
- package/templates/create-full/src/components/Features/index.tsx +0 -25
- package/templates/create-full/src/components/Features/styles.css +0 -39
- package/templates/create-full/src/components/Features/types.ts +0 -5
- package/templates/create-full/src/components/Footer/index.tsx +0 -154
- package/templates/create-full/src/components/Footer/styles.css +0 -175
- package/templates/create-full/src/components/Footer/types.ts +0 -15
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/index.tsx +0 -129
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/ForgotPassword/index.tsx +0 -30
- package/templates/create-full/src/components/ForgotPassword/styles.css +0 -85
- package/templates/create-full/src/components/ForgotPassword/types.ts +0 -13
- package/templates/create-full/src/components/Header/index.tsx +0 -53
- package/templates/create-full/src/components/Header/styles.css +0 -6
- package/templates/create-full/src/components/Header/types.ts +0 -6
- package/templates/create-full/src/components/HeroSlider/index.tsx +0 -110
- package/templates/create-full/src/components/HeroSlider/styles.css +0 -129
- package/templates/create-full/src/components/HeroSlider/types.ts +0 -9
- package/templates/create-full/src/components/HeroSliderItem/index.tsx +0 -231
- package/templates/create-full/src/components/HeroSliderItem/styles.css +0 -152
- package/templates/create-full/src/components/HeroSliderItem/types.ts +0 -34
- package/templates/create-full/src/components/Login/components/LoginForm/index.tsx +0 -181
- package/templates/create-full/src/components/Login/components/LoginForm/styles.css +0 -0
- package/templates/create-full/src/components/Login/index.tsx +0 -37
- package/templates/create-full/src/components/Login/styles.css +0 -129
- package/templates/create-full/src/components/Login/types.ts +0 -18
- package/templates/create-full/src/components/Navbar/components/CartSidebar/index.tsx +0 -203
- package/templates/create-full/src/components/Navbar/components/CartSidebar/styles.css +0 -175
- package/templates/create-full/src/components/Navbar/components/MobileMenu/index.tsx +0 -198
- package/templates/create-full/src/components/Navbar/components/MobileMenu/styles.css +0 -122
- package/templates/create-full/src/components/Navbar/components/NavItem/index.tsx +0 -65
- package/templates/create-full/src/components/Navbar/components/SearchModal/index.tsx +0 -267
- package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +0 -182
- package/templates/create-full/src/components/Navbar/index.tsx +0 -250
- package/templates/create-full/src/components/Navbar/styles.css +0 -243
- package/templates/create-full/src/components/Navbar/types.ts +0 -37
- package/templates/create-full/src/components/NotFound/index.tsx +0 -39
- package/templates/create-full/src/components/NotFound/styles.css +0 -46
- package/templates/create-full/src/components/NotFound/types.ts +0 -8
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/index.tsx +0 -316
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/styles.css +0 -213
- package/templates/create-full/src/components/ProductDetail/index.tsx +0 -92
- package/templates/create-full/src/components/ProductDetail/styles.css +0 -58
- package/templates/create-full/src/components/ProductDetail/types.ts +0 -12
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx +0 -34
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/styles.css +0 -4
- package/templates/create-full/src/components/ProductDetailAddToCart/index.tsx +0 -146
- package/templates/create-full/src/components/ProductDetailAddToCart/styles.css +0 -27
- package/templates/create-full/src/components/ProductDetailAddToCart/types.ts +0 -18
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureRow/index.tsx +0 -164
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/index.tsx +0 -134
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/styles.css +0 -188
- package/templates/create-full/src/components/ProductDetailBundleFurniture/index.tsx +0 -61
- package/templates/create-full/src/components/ProductDetailBundleFurniture/styles.css +0 -12
- package/templates/create-full/src/components/ProductDetailBundleFurniture/types.ts +0 -21
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/index.tsx +0 -169
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/styles.css +0 -141
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/index.tsx +0 -35
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/styles.css +0 -85
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/index.tsx +0 -51
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/styles.css +0 -30
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/index.tsx +0 -54
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/styles.css +0 -22
- package/templates/create-full/src/components/ProductDetailBundleProduct/index.tsx +0 -101
- package/templates/create-full/src/components/ProductDetailBundleProduct/styles.css +0 -20
- package/templates/create-full/src/components/ProductDetailBundleProduct/types.ts +0 -18
- package/templates/create-full/src/components/ProductDetailDescription/index.tsx +0 -56
- package/templates/create-full/src/components/ProductDetailDescription/styles.css +0 -21
- package/templates/create-full/src/components/ProductDetailDescription/types.ts +0 -13
- package/templates/create-full/src/components/ProductDetailFeatureItem/index.tsx +0 -28
- package/templates/create-full/src/components/ProductDetailFeatureItem/styles.css +0 -22
- package/templates/create-full/src/components/ProductDetailFeatureItem/types.ts +0 -7
- package/templates/create-full/src/components/ProductDetailFeatures/index.tsx +0 -40
- package/templates/create-full/src/components/ProductDetailFeatures/styles.css +0 -17
- package/templates/create-full/src/components/ProductDetailFeatures/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailNameFavorite/index.tsx +0 -66
- package/templates/create-full/src/components/ProductDetailNameFavorite/styles.css +0 -45
- package/templates/create-full/src/components/ProductDetailNameFavorite/types.ts +0 -11
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/index.tsx +0 -209
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/styles.css +0 -146
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferSummary/index.tsx +0 -175
- package/templates/create-full/src/components/ProductDetailOffer/index.tsx +0 -199
- package/templates/create-full/src/components/ProductDetailOffer/styles.css +0 -211
- package/templates/create-full/src/components/ProductDetailOffer/types.ts +0 -24
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/index.tsx +0 -52
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/styles.css +0 -19
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/index.tsx +0 -60
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/styles.css +0 -38
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/index.tsx +0 -102
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/styles.css +0 -34
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/index.tsx +0 -121
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/styles.css +0 -87
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/index.tsx +0 -57
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/index.tsx +0 -54
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/styles.css +0 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/index.tsx +0 -124
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/styles.css +0 -1
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/index.tsx +0 -217
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/styles.css +0 -87
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionRenderer/index.tsx +0 -133
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/index.tsx +0 -60
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/styles.css +0 -1
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/index.tsx +0 -74
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/styles.css +0 -10
- package/templates/create-full/src/components/ProductDetailOptionSet/index.tsx +0 -99
- package/templates/create-full/src/components/ProductDetailOptionSet/styles.css +0 -30
- package/templates/create-full/src/components/ProductDetailOptionSet/types.ts +0 -21
- package/templates/create-full/src/components/ProductDetailPrices/index.tsx +0 -62
- package/templates/create-full/src/components/ProductDetailPrices/styles.css +0 -32
- package/templates/create-full/src/components/ProductDetailPrices/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailProductGroup/index.tsx +0 -74
- package/templates/create-full/src/components/ProductDetailProductGroup/styles.css +0 -33
- package/templates/create-full/src/components/ProductDetailProductGroup/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailReviews/index.tsx +0 -205
- package/templates/create-full/src/components/ProductDetailReviews/styles.css +0 -43
- package/templates/create-full/src/components/ProductDetailReviews/types.ts +0 -19
- package/templates/create-full/src/components/ProductDetailSku/index.tsx +0 -38
- package/templates/create-full/src/components/ProductDetailSku/styles.css +0 -16
- package/templates/create-full/src/components/ProductDetailSku/types.ts +0 -11
- package/templates/create-full/src/components/ProductDetailVariant/index.tsx +0 -38
- package/templates/create-full/src/components/ProductDetailVariant/styles.css +0 -14
- package/templates/create-full/src/components/ProductDetailVariant/types.ts +0 -12
- package/templates/create-full/src/components/ProductSlider/index.tsx +0 -151
- package/templates/create-full/src/components/ProductSlider/styles.css +0 -105
- package/templates/create-full/src/components/ProductSlider/types.ts +0 -17
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/index.tsx +0 -133
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/RecoverPassword/index.tsx +0 -30
- package/templates/create-full/src/components/RecoverPassword/styles.css +0 -93
- package/templates/create-full/src/components/RecoverPassword/types.ts +0 -13
- package/templates/create-full/src/components/Register/components/RegisterForm/index.tsx +0 -326
- package/templates/create-full/src/components/Register/components/RegisterForm/styles.css +0 -0
- package/templates/create-full/src/components/Register/index.tsx +0 -30
- package/templates/create-full/src/components/Register/styles.css +0 -152
- package/templates/create-full/src/components/Register/types.ts +0 -27
- package/templates/create-full/src/components/RichText/index.tsx +0 -25
- package/templates/create-full/src/components/RichText/styles.css +0 -51
- package/templates/create-full/src/components/RichText/types.ts +0 -5
- package/templates/create-full/src/components/SocialMediaIcon/index.tsx +0 -26
- package/templates/create-full/src/components/SocialMediaIcon/styles.css +0 -17
- package/templates/create-full/src/components/SocialMediaIcon/types.ts +0 -7
- package/templates/create-full/src/components/index.ts +0 -50
- package/templates/create-full/src/global-types.ts +0 -13
- package/templates/create-full/src/global.css +0 -582
- package/templates/create-full/src/hooks/useBundleProducts.ts +0 -75
- package/templates/create-full/src/hooks/useColumnPreference.ts +0 -26
- package/templates/create-full/src/hooks/useInfiniteScroll.ts +0 -49
- package/templates/create-full/src/hooks/usePageTracking.ts +0 -56
- package/templates/create-full/src/hooks/usePayWithIkas.ts +0 -114
- package/templates/create-full/src/hooks/useRedirectIfLoggedIn.ts +0 -35
- package/templates/create-full/src/hooks/useScrollLock.ts +0 -20
- package/templates/create-full/src/hooks/useToast.ts +0 -27
- package/templates/create-full/src/ikas-component-utils.d.ts +0 -3
- package/templates/create-full/src/sub-components/Badge/index.tsx +0 -208
- package/templates/create-full/src/sub-components/Badge/styles.css +0 -129
- package/templates/create-full/src/sub-components/Breadcrumb/index.tsx +0 -57
- package/templates/create-full/src/sub-components/Breadcrumb/styles.css +0 -49
- package/templates/create-full/src/sub-components/BundleMedia/index.tsx +0 -72
- package/templates/create-full/src/sub-components/BundleQuantityBox/index.tsx +0 -73
- package/templates/create-full/src/sub-components/BundleQuantityBox/styles.css +0 -43
- package/templates/create-full/src/sub-components/Button/index.tsx +0 -52
- package/templates/create-full/src/sub-components/Button/styles.css +0 -114
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/index.tsx +0 -59
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/styles.css +0 -24
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/index.tsx +0 -55
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/styles.css +0 -30
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/index.tsx +0 -31
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/styles.css +0 -6
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/index.tsx +0 -79
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/styles.css +0 -28
- package/templates/create-full/src/sub-components/CartItem/index.tsx +0 -216
- package/templates/create-full/src/sub-components/CartItem/styles.css +0 -170
- package/templates/create-full/src/sub-components/Checkbox/index.tsx +0 -42
- package/templates/create-full/src/sub-components/Checkbox/styles.css +0 -65
- package/templates/create-full/src/sub-components/CollapsibleGroup/index.tsx +0 -52
- package/templates/create-full/src/sub-components/CollapsibleGroup/styles.css +0 -51
- package/templates/create-full/src/sub-components/ColorInput/index.tsx +0 -33
- package/templates/create-full/src/sub-components/ColorInput/styles.css +0 -53
- package/templates/create-full/src/sub-components/ConfirmModal/index.tsx +0 -60
- package/templates/create-full/src/sub-components/ConfirmModal/styles.css +0 -20
- package/templates/create-full/src/sub-components/FormItem/index.tsx +0 -66
- package/templates/create-full/src/sub-components/FormItem/styles.css +0 -38
- package/templates/create-full/src/sub-components/ImagePreviewModal/index.tsx +0 -55
- package/templates/create-full/src/sub-components/ImagePreviewModal/styles.css +0 -50
- package/templates/create-full/src/sub-components/Input/index.tsx +0 -69
- package/templates/create-full/src/sub-components/Input/styles.css +0 -162
- package/templates/create-full/src/sub-components/Modal/index.tsx +0 -118
- package/templates/create-full/src/sub-components/Modal/styles.css +0 -70
- package/templates/create-full/src/sub-components/PageLoader/index.tsx +0 -14
- package/templates/create-full/src/sub-components/PageLoader/styles.css +0 -12
- package/templates/create-full/src/sub-components/Pagination/index.tsx +0 -107
- package/templates/create-full/src/sub-components/Pagination/styles.css +0 -88
- package/templates/create-full/src/sub-components/ProductCard/index.tsx +0 -276
- package/templates/create-full/src/sub-components/ProductCard/styles.css +0 -99
- package/templates/create-full/src/sub-components/QuantitySelector/index.tsx +0 -41
- package/templates/create-full/src/sub-components/QuantitySelector/styles.css +0 -51
- package/templates/create-full/src/sub-components/ReviewCard/index.tsx +0 -103
- package/templates/create-full/src/sub-components/ReviewCard/styles.css +0 -95
- package/templates/create-full/src/sub-components/ReviewForm/index.tsx +0 -115
- package/templates/create-full/src/sub-components/ReviewForm/styles.css +0 -11
- package/templates/create-full/src/sub-components/ReviewSummary/index.tsx +0 -65
- package/templates/create-full/src/sub-components/ReviewSummary/styles.css +0 -86
- package/templates/create-full/src/sub-components/Select/index.tsx +0 -86
- package/templates/create-full/src/sub-components/Select/styles.css +0 -110
- package/templates/create-full/src/sub-components/SkeletonField/index.tsx +0 -12
- package/templates/create-full/src/sub-components/SkeletonField/styles.css +0 -29
- package/templates/create-full/src/sub-components/SliderArrow/index.tsx +0 -26
- package/templates/create-full/src/sub-components/SliderArrow/styles.css +0 -24
- package/templates/create-full/src/sub-components/SocialLoginButton/index.tsx +0 -24
- package/templates/create-full/src/sub-components/SocialLoginButton/styles.css +0 -19
- package/templates/create-full/src/sub-components/SpinnerIcon/index.tsx +0 -10
- package/templates/create-full/src/sub-components/SpinnerIcon/styles.css +0 -8
- package/templates/create-full/src/sub-components/StarRating/index.tsx +0 -76
- package/templates/create-full/src/sub-components/StarRating/styles.css +0 -40
- package/templates/create-full/src/sub-components/Tag/index.tsx +0 -21
- package/templates/create-full/src/sub-components/Tag/styles.css +0 -30
- package/templates/create-full/src/sub-components/Textarea/index.tsx +0 -45
- package/templates/create-full/src/sub-components/Textarea/styles.css +0 -82
- package/templates/create-full/src/sub-components/Toast/index.tsx +0 -257
- package/templates/create-full/src/sub-components/Toast/styles.css +0 -3
- package/templates/create-full/src/sub-components/Toggle/index.tsx +0 -46
- package/templates/create-full/src/sub-components/Toggle/styles.css +0 -86
- package/templates/create-full/src/sub-components/VariantBadge/index.tsx +0 -153
- package/templates/create-full/src/sub-components/VariantBadge/styles.css +0 -47
- package/templates/create-full/src/sub-components/icons/index.tsx +0 -981
- package/templates/create-full/src/utils/bundle.ts +0 -70
- package/templates/create-full/src/utils/cx.ts +0 -4
- package/templates/create-full/src/utils/fullName.ts +0 -6
- package/templates/create-full/src/utils/media.ts +0 -36
- package/templates/create-full/src/utils/optionPrice.ts +0 -19
- package/templates/create-full/src/utils/optionSet.ts +0 -17
- package/templates/create-full/src/utils/orderStatus.ts +0 -28
- package/templates/create-full/src/utils/pagination.ts +0 -29
- package/templates/create-full/src/utils/toast.ts +0 -5
- package/templates/create-full/tsconfig.json +0 -30
- 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;
|
|
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"}
|
package/dist/commands/config.js
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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) {
|