@ikas/component-cli 0.133.0 → 1.2.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/create.d.ts +8 -3
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +8 -227
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +120 -31
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/proxy.d.ts.map +1 -1
- package/dist/commands/proxy.js +5 -1
- package/dist/commands/proxy.js.map +1 -1
- package/package.json +4 -5
- package/bin/create-ikas-component.js +0 -8
- package/templates/create/README.md +0 -50
- package/templates/create/claude-md +0 -275
- package/templates/create/cursorrules +0 -123
- package/templates/create/gitignore +0 -6
- package/templates/create/ikas.config.json +0 -95
- package/templates/create/mcp.json +0 -10
- package/templates/create/package.json +0 -22
- package/templates/create/src/components/ExampleComponent/index.tsx +0 -22
- package/templates/create/src/components/ExampleComponent/styles.css +0 -36
- package/templates/create/src/components/ExampleComponent/types.ts +0 -7
- package/templates/create/src/components/ExampleSection/index.tsx +0 -14
- package/templates/create/src/components/ExampleSection/styles.css +0 -29
- package/templates/create/src/components/ExampleSection/types.ts +0 -6
- package/templates/create/src/components/index.ts +0 -2
- package/templates/create/src/global-types.ts +0 -5
- package/templates/create/src/global.css +0 -29
- package/templates/create/src/ikas-component-utils.d.ts +0 -3
- package/templates/create/tsconfig.json +0 -30
- package/templates/create/vite.config.ts +0 -15
- package/templates/create-full/README.md +0 -78
- package/templates/create-full/claude-md +0 -752
- package/templates/create-full/cursorrules +0 -117
- package/templates/create-full/gitignore +0 -4
- package/templates/create-full/ikas.config.json +0 -5009
- package/templates/create-full/mcp.json +0 -10
- package/templates/create-full/package.json +0 -23
- 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 -298
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +0 -23
- 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 -46
- 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 -46
- package/templates/create-full/src/components/Header/styles.css +0 -4
- package/templates/create-full/src/components/Header/types.ts +0 -4
- 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 -339
- package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +0 -191
- package/templates/create-full/src/components/Navbar/index.tsx +0 -254
- package/templates/create-full/src/components/Navbar/styles.css +0 -254
- package/templates/create-full/src/components/Navbar/types.ts +0 -42
- 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 -11
- package/templates/create-full/src/global.css +0 -598
- 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 -19
- 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 -120
- 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,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { createCreateCommand as createCreateCommandImpl } from "create-ikas-component";
|
|
2
|
+
/**
|
|
3
|
+
* Re-export of the `create` command. The actual implementation (and the
|
|
4
|
+
* project templates) live in the standalone `create-ikas-component` package
|
|
5
|
+
* so users can run `npx create-ikas-component` without pulling in the full
|
|
6
|
+
* dev/build/publish CLI.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createCreateCommand: typeof createCreateCommandImpl;
|
|
4
9
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gCAA0B,CAAC"}
|
package/dist/commands/create.js
CHANGED
|
@@ -1,228 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
async function createProject(projectName, template = "blank") {
|
|
10
|
-
const spinner = ora("Creating project...").start();
|
|
11
|
-
try {
|
|
12
|
-
const projectPath = path.resolve(process.cwd(), projectName);
|
|
13
|
-
// Check if directory exists
|
|
14
|
-
if (fs.existsSync(projectPath)) {
|
|
15
|
-
spinner.fail(`Directory "${projectName}" already exists`);
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
// Generate project ID
|
|
19
|
-
const projectId = generateProjectId();
|
|
20
|
-
const vars = {
|
|
21
|
-
PROJECT_NAME: projectName,
|
|
22
|
-
PROJECT_ID: projectId,
|
|
23
|
-
EXAMPLE_COMPONENT_ID: generateComponentId(projectId, "example-component"),
|
|
24
|
-
EXAMPLE_SECTION_ID: generateComponentId(projectId, "example-section"),
|
|
25
|
-
};
|
|
26
|
-
if (template === "full") {
|
|
27
|
-
// Generate unique IDs for custom enum types and privateVarMap entries
|
|
28
|
-
vars.ENUM_COLUMNS_ID = generateUniqueId();
|
|
29
|
-
vars.ENUM_ASPECT_RATIO_ID = generateUniqueId();
|
|
30
|
-
vars.ENUM_OBJECT_FIT_ID = generateUniqueId();
|
|
31
|
-
vars.ENUM_VERTICAL_ALIGN_ID = generateUniqueId();
|
|
32
|
-
vars.PVM_ID_1 = `pvm_${Date.now()}_1`;
|
|
33
|
-
vars.PVM_ID_2 = `pvm_${Date.now()}_2`;
|
|
34
|
-
vars.PVM_ID_3 = `pvm_${Date.now()}_3`;
|
|
35
|
-
vars.PVM_ID_4 = `pvm_${Date.now()}_4`;
|
|
36
|
-
await createFullProject(projectPath, vars, spinner);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
await createBlankProject(projectPath, vars, spinner);
|
|
40
|
-
}
|
|
41
|
-
// Create or merge .cursor/mcp.json for Cursor editor
|
|
42
|
-
const cursorDir = path.join(projectPath, ".cursor");
|
|
43
|
-
const cursorMcpPath = path.join(cursorDir, "mcp.json");
|
|
44
|
-
fs.mkdirSync(cursorDir, { recursive: true });
|
|
45
|
-
let cursorMcpConfig = { mcpServers: {} };
|
|
46
|
-
if (fs.existsSync(cursorMcpPath)) {
|
|
47
|
-
try {
|
|
48
|
-
cursorMcpConfig = JSON.parse(fs.readFileSync(cursorMcpPath, "utf-8"));
|
|
49
|
-
if (!cursorMcpConfig.mcpServers) {
|
|
50
|
-
cursorMcpConfig.mcpServers = {};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
cursorMcpConfig = { mcpServers: {} };
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
cursorMcpConfig.mcpServers["ikas-code-components"] = {
|
|
58
|
-
command: "node",
|
|
59
|
-
args: ["${workspaceFolder}/node_modules/@ikas/code-components-mcp/dist/index.js"]
|
|
60
|
-
};
|
|
61
|
-
fs.writeFileSync(cursorMcpPath, JSON.stringify(cursorMcpConfig, null, 2));
|
|
62
|
-
spinner.succeed(chalk.green(`Project "${projectName}" created successfully! (template: ${template})`));
|
|
63
|
-
console.log("\n" + chalk.cyan("Next steps:"));
|
|
64
|
-
console.log(chalk.white(` cd ${projectName}`));
|
|
65
|
-
console.log(chalk.white(" npm install"));
|
|
66
|
-
console.log(chalk.white(" npm run dev"));
|
|
67
|
-
if (template === "full") {
|
|
68
|
-
console.log("\n" + chalk.yellow("This is a complete theme with 20 sections and 30+ components."));
|
|
69
|
-
console.log(chalk.yellow("See README.md for the full project structure."));
|
|
70
|
-
}
|
|
71
|
-
console.log("\n" + chalk.gray("Happy coding! 🚀"));
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
spinner.fail("Failed to create project");
|
|
75
|
-
console.error(error);
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
async function createBlankProject(projectPath, vars, spinner) {
|
|
80
|
-
// Create directory structure
|
|
81
|
-
fs.mkdirSync(projectPath, { recursive: true });
|
|
82
|
-
fs.mkdirSync(path.join(projectPath, "src/components/ExampleComponent"), { recursive: true });
|
|
83
|
-
fs.mkdirSync(path.join(projectPath, "src/components/ExampleSection"), { recursive: true });
|
|
84
|
-
// Write all template files
|
|
85
|
-
const files = [
|
|
86
|
-
{ template: "create/package.json", dest: "package.json", vars },
|
|
87
|
-
{ template: "create/tsconfig.json", dest: "tsconfig.json" },
|
|
88
|
-
{ template: "create/vite.config.ts", dest: "vite.config.ts" },
|
|
89
|
-
{ template: "create/ikas.config.json", dest: "ikas.config.json", vars },
|
|
90
|
-
{ template: "create/gitignore", dest: ".gitignore" },
|
|
91
|
-
{ template: "create/mcp.json", dest: ".mcp.json" },
|
|
92
|
-
{ template: "create/README.md", dest: "README.md", vars },
|
|
93
|
-
{ template: "create/claude-md", dest: "CLAUDE.md" },
|
|
94
|
-
{ template: "create/cursorrules", dest: ".cursorrules" },
|
|
95
|
-
{ template: "create/src/global.css", dest: "src/global.css" },
|
|
96
|
-
{ template: "create/src/global-types.ts", dest: "src/global-types.ts" },
|
|
97
|
-
{ template: "create/src/ikas-component-utils.d.ts", dest: "src/ikas-component-utils.d.ts" },
|
|
98
|
-
{ template: "create/src/components/index.ts", dest: "src/components/index.ts" },
|
|
99
|
-
{ template: "create/src/components/ExampleComponent/index.tsx", dest: "src/components/ExampleComponent/index.tsx" },
|
|
100
|
-
{ template: "create/src/components/ExampleComponent/types.ts", dest: "src/components/ExampleComponent/types.ts" },
|
|
101
|
-
{ template: "create/src/components/ExampleComponent/styles.css", dest: "src/components/ExampleComponent/styles.css" },
|
|
102
|
-
{ template: "create/src/components/ExampleSection/index.tsx", dest: "src/components/ExampleSection/index.tsx" },
|
|
103
|
-
{ template: "create/src/components/ExampleSection/types.ts", dest: "src/components/ExampleSection/types.ts" },
|
|
104
|
-
{ template: "create/src/components/ExampleSection/styles.css", dest: "src/components/ExampleSection/styles.css" },
|
|
105
|
-
];
|
|
106
|
-
for (const file of files) {
|
|
107
|
-
fs.writeFileSync(path.join(projectPath, file.dest), readTemplate(file.template, file.vars));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
async function createFullProject(projectPath, vars, spinner) {
|
|
111
|
-
fs.mkdirSync(projectPath, { recursive: true });
|
|
112
|
-
spinner.text = "Creating full theme project (350+ files)...";
|
|
113
|
-
const templateFiles = readTemplateDirectory("create-full", vars);
|
|
114
|
-
for (const file of templateFiles) {
|
|
115
|
-
// Map template filenames to actual filenames
|
|
116
|
-
let destPath = file.relativePath;
|
|
117
|
-
if (destPath === "gitignore")
|
|
118
|
-
destPath = ".gitignore";
|
|
119
|
-
else if (destPath === "claude-md")
|
|
120
|
-
destPath = "CLAUDE.md";
|
|
121
|
-
else if (destPath === "cursorrules")
|
|
122
|
-
destPath = ".cursorrules";
|
|
123
|
-
else if (destPath === "mcp.json")
|
|
124
|
-
destPath = ".mcp.json";
|
|
125
|
-
const fullDest = path.join(projectPath, destPath);
|
|
126
|
-
fs.mkdirSync(path.dirname(fullDest), { recursive: true });
|
|
127
|
-
fs.writeFileSync(fullDest, file.content);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export function createCreateCommand() {
|
|
131
|
-
return new Command("create")
|
|
132
|
-
.description("Create a new ikas component project")
|
|
133
|
-
.argument("[name]", "Project name")
|
|
134
|
-
.option("-t, --template <template>", "Template to use: blank or full (complete theme)")
|
|
135
|
-
.action(async (name, opts) => {
|
|
136
|
-
let projectName = name;
|
|
137
|
-
let template;
|
|
138
|
-
if (opts.template) {
|
|
139
|
-
template = opts.template === "full" ? "full" : "blank";
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
const answers = await inquirer.prompt([
|
|
143
|
-
{
|
|
144
|
-
type: "list",
|
|
145
|
-
name: "template",
|
|
146
|
-
message: "Which template would you like to use?",
|
|
147
|
-
choices: [
|
|
148
|
-
{ name: "Blank — minimal project with example component and section", value: "blank" },
|
|
149
|
-
{ name: "Full — complete storefront theme with 20 sections and 30+ components", value: "full" },
|
|
150
|
-
],
|
|
151
|
-
}
|
|
152
|
-
]);
|
|
153
|
-
template = answers.template;
|
|
154
|
-
}
|
|
155
|
-
if (!projectName) {
|
|
156
|
-
const answers = await inquirer.prompt([
|
|
157
|
-
{
|
|
158
|
-
type: "input",
|
|
159
|
-
name: "projectName",
|
|
160
|
-
message: "What is your project name?",
|
|
161
|
-
default: "my-ikas-components",
|
|
162
|
-
validate: (input) => {
|
|
163
|
-
if (!input.trim())
|
|
164
|
-
return "Project name is required";
|
|
165
|
-
if (!/^[a-z0-9-_]+$/i.test(input)) {
|
|
166
|
-
return "Project name can only contain letters, numbers, hyphens, and underscores";
|
|
167
|
-
}
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
]);
|
|
172
|
-
projectName = answers.projectName;
|
|
173
|
-
}
|
|
174
|
-
await createProject(projectName, template);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
// Standalone runner for create-ikas-component command
|
|
178
|
-
export async function run() {
|
|
179
|
-
const program = new Command();
|
|
180
|
-
program
|
|
181
|
-
.name("create-ikas-component")
|
|
182
|
-
.description("Create a new ikas component project")
|
|
183
|
-
.argument("[name]", "Project name")
|
|
184
|
-
.option("-t, --template <template>", "Template to use: blank or full (complete theme)")
|
|
185
|
-
.action(async (name, opts) => {
|
|
186
|
-
let projectName = name;
|
|
187
|
-
let template;
|
|
188
|
-
if (opts.template) {
|
|
189
|
-
template = opts.template === "full" ? "full" : "blank";
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
const answers = await inquirer.prompt([
|
|
193
|
-
{
|
|
194
|
-
type: "list",
|
|
195
|
-
name: "template",
|
|
196
|
-
message: "Which template would you like to use?",
|
|
197
|
-
choices: [
|
|
198
|
-
{ name: "Blank — minimal project with example component and section", value: "blank" },
|
|
199
|
-
{ name: "Full — complete storefront theme with 20 sections and 30+ components", value: "full" },
|
|
200
|
-
],
|
|
201
|
-
}
|
|
202
|
-
]);
|
|
203
|
-
template = answers.template;
|
|
204
|
-
}
|
|
205
|
-
if (!projectName) {
|
|
206
|
-
const answers = await inquirer.prompt([
|
|
207
|
-
{
|
|
208
|
-
type: "input",
|
|
209
|
-
name: "projectName",
|
|
210
|
-
message: "What is your project name?",
|
|
211
|
-
default: "my-ikas-components",
|
|
212
|
-
validate: (input) => {
|
|
213
|
-
if (!input.trim())
|
|
214
|
-
return "Project name is required";
|
|
215
|
-
if (!/^[a-z0-9-_]+$/i.test(input)) {
|
|
216
|
-
return "Project name can only contain letters, numbers, hyphens, and underscores";
|
|
217
|
-
}
|
|
218
|
-
return true;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
]);
|
|
222
|
-
projectName = answers.projectName;
|
|
223
|
-
}
|
|
224
|
-
await createProject(projectName, template);
|
|
225
|
-
});
|
|
226
|
-
program.parse(process.argv);
|
|
227
|
-
}
|
|
1
|
+
import { createCreateCommand as createCreateCommandImpl } from "create-ikas-component";
|
|
2
|
+
/**
|
|
3
|
+
* Re-export of the `create` command. The actual implementation (and the
|
|
4
|
+
* project templates) live in the standalone `create-ikas-component` package
|
|
5
|
+
* so users can run `npx create-ikas-component` without pulling in the full
|
|
6
|
+
* dev/build/publish CLI.
|
|
7
|
+
*/
|
|
8
|
+
export const createCreateCommand = createCreateCommandImpl;
|
|
228
9
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA26CpC,wBAAgB,gBAAgB,IAAI,OAAO,CA4B1C"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -5,9 +5,9 @@ import * as fs from "fs";
|
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { toPascalCase, toKebabCase, generateTypesFile, generateGlobalTypesFile, collectUsedEnumIds, collectUsedCustomTypeIds, generateComponentFile, generateStylesFile, updateBarrelExport, generateProjectId, generateComponentId, generateUniqueId, buildPropGroupHierarchy, findPropGroup, collectPropGroupIds, movePropGroupInTree, } from "../utils/component-helpers.js";
|
|
7
7
|
import { compileAllComponents as compileAllComponentsMulti } from "../utils/compile.js";
|
|
8
|
-
import { transformEsmToWindowGlobals, transformChunkForCanvas, buildChunkMapping } from "../utils/esm-transform.js";
|
|
9
|
-
import { DevServerWebSocket } from "../utils/websocket-server.js";
|
|
10
|
-
import { DEFAULT_ADMIN_PORT, DEFAULT_EDITOR_PORT, printProxyBanner, promptForStore, resolveEnvironmentDefaults, startProxy } from "./proxy.js";
|
|
8
|
+
import { transformEsmToWindowGlobals, transformChunkForCanvas, buildChunkMapping, } from "../utils/esm-transform.js";
|
|
9
|
+
import { DevServerWebSocket, } from "../utils/websocket-server.js";
|
|
10
|
+
import { DEFAULT_ADMIN_PORT, DEFAULT_EDITOR_PORT, printProxyBanner, promptForStore, resolveEnvironmentDefaults, startProxy, } from "./proxy.js";
|
|
11
11
|
const DEV_STATE_FILENAME = ".ikas-dev-state.json";
|
|
12
12
|
function readDevState() {
|
|
13
13
|
const p = path.resolve(process.cwd(), DEV_STATE_FILENAME);
|
|
@@ -25,7 +25,9 @@ function writeDevState(state) {
|
|
|
25
25
|
try {
|
|
26
26
|
fs.writeFileSync(p, JSON.stringify(state, null, 2) + "\n", "utf-8");
|
|
27
27
|
}
|
|
28
|
-
catch {
|
|
28
|
+
catch {
|
|
29
|
+
/* non-fatal */
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
const DEV_SERVER_PORT = 5201;
|
|
31
33
|
// Store compiled components, shared modules, and global styles
|
|
@@ -112,7 +114,7 @@ function findComponentForFile(config, filePath) {
|
|
|
112
114
|
* Updates compiledComponents and compiledSharedModules maps.
|
|
113
115
|
*/
|
|
114
116
|
async function compileAllComponentsForDev(config) {
|
|
115
|
-
const components = config.components.map(c => ({
|
|
117
|
+
const components = config.components.map((c) => ({
|
|
116
118
|
id: c.id,
|
|
117
119
|
entryPath: c.entry,
|
|
118
120
|
stylesPath: c.styles,
|
|
@@ -128,7 +130,9 @@ async function compileAllComponentsForDev(config) {
|
|
|
128
130
|
// Process shared chunks
|
|
129
131
|
compiledSharedModules.clear();
|
|
130
132
|
for (const [chunkId, chunk] of result.chunks) {
|
|
131
|
-
const prefixedChunkId = config.projectId
|
|
133
|
+
const prefixedChunkId = config.projectId
|
|
134
|
+
? `${config.projectId}-${chunkId}`
|
|
135
|
+
: chunkId;
|
|
132
136
|
const canvasClientJs = transformChunkForCanvas(chunk.clientJs, prefixedChunkId, chunkMapping);
|
|
133
137
|
compiledSharedModules.set(prefixedChunkId, {
|
|
134
138
|
id: prefixedChunkId,
|
|
@@ -167,7 +171,9 @@ async function compileAllComponentsForDev(config) {
|
|
|
167
171
|
}
|
|
168
172
|
const scopedCss = result.css.get(component.id) || "";
|
|
169
173
|
// Transform ESM to window globals for canvas mode, with chunk mapping
|
|
170
|
-
const canvasClientJs = transformEsmToWindowGlobals(entry.clientJs, {
|
|
174
|
+
const canvasClientJs = transformEsmToWindowGlobals(entry.clientJs, {
|
|
175
|
+
chunkMapping,
|
|
176
|
+
});
|
|
171
177
|
const propsWithIds = component.props.map((prop, index) => ({
|
|
172
178
|
id: `${component.id}_prop_${index}`,
|
|
173
179
|
name: prop.name,
|
|
@@ -180,7 +186,9 @@ async function compileAllComponentsForDev(config) {
|
|
|
180
186
|
typeId: prop.typeId,
|
|
181
187
|
enumTypeId: prop.enumTypeId,
|
|
182
188
|
...(prop.privateVarMap ? { privateVarMap: prop.privateVarMap } : {}),
|
|
183
|
-
...(prop.filteredComponentIds
|
|
189
|
+
...(prop.filteredComponentIds
|
|
190
|
+
? { filteredComponentIds: prop.filteredComponentIds }
|
|
191
|
+
: {}),
|
|
184
192
|
}));
|
|
185
193
|
// Build prop group hierarchy if groups are defined
|
|
186
194
|
const propGroups = component.propGroups && component.propGroups.length > 0
|
|
@@ -208,7 +216,9 @@ async function compileAllComponentsForDev(config) {
|
|
|
208
216
|
configPropGroups: component.propGroups && component.propGroups.length > 0
|
|
209
217
|
? component.propGroups
|
|
210
218
|
: undefined,
|
|
211
|
-
...(componentCustomTypes && componentCustomTypes.length > 0
|
|
219
|
+
...(componentCustomTypes && componentCustomTypes.length > 0
|
|
220
|
+
? { customTypes: componentCustomTypes }
|
|
221
|
+
: {}),
|
|
212
222
|
};
|
|
213
223
|
compiledComponents.set(component.id, data);
|
|
214
224
|
console.log(chalk.green(` Compiled: ${component.name}`));
|
|
@@ -221,6 +231,59 @@ async function compileAllComponentsForDev(config) {
|
|
|
221
231
|
function getAllComponents() {
|
|
222
232
|
return Array.from(compiledComponents.values());
|
|
223
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Rebuild the config-derived metadata of a compiled component entry without
|
|
236
|
+
* re-compiling JS/CSS. Preserves cached `compiledServerJs`, `compiledClientJs`,
|
|
237
|
+
* `compiledCss`, `canvasClientJs`. Used after pure config mutations (prop
|
|
238
|
+
* group add/update/delete/move, prop-to-group move) so the editor sees the
|
|
239
|
+
* change immediately via a targeted `component-update` broadcast — independent
|
|
240
|
+
* of chokidar picking up the `ikas.config.json` write.
|
|
241
|
+
*
|
|
242
|
+
* Returns null if the component hasn't been compiled yet.
|
|
243
|
+
*/
|
|
244
|
+
function rebuildCompiledComponentFromConfig(config, componentId) {
|
|
245
|
+
const existing = compiledComponents.get(componentId);
|
|
246
|
+
if (!existing)
|
|
247
|
+
return null;
|
|
248
|
+
const component = config.components.find((c) => c.id === componentId);
|
|
249
|
+
if (!component)
|
|
250
|
+
return null;
|
|
251
|
+
const propsWithIds = component.props.map((prop, index) => ({
|
|
252
|
+
id: `${component.id}_prop_${index}`,
|
|
253
|
+
name: prop.name,
|
|
254
|
+
displayName: prop.displayName,
|
|
255
|
+
description: prop.description,
|
|
256
|
+
type: prop.type,
|
|
257
|
+
isRequired: prop.required,
|
|
258
|
+
defaultValue: prop.defaultValue,
|
|
259
|
+
groupId: prop.groupId,
|
|
260
|
+
typeId: prop.typeId,
|
|
261
|
+
enumTypeId: prop.enumTypeId,
|
|
262
|
+
...(prop.privateVarMap ? { privateVarMap: prop.privateVarMap } : {}),
|
|
263
|
+
...(prop.filteredComponentIds
|
|
264
|
+
? { filteredComponentIds: prop.filteredComponentIds }
|
|
265
|
+
: {}),
|
|
266
|
+
}));
|
|
267
|
+
const propGroups = component.propGroups && component.propGroups.length > 0
|
|
268
|
+
? buildPropGroupHierarchy(component.id, component.propGroups, propsWithIds)
|
|
269
|
+
: undefined;
|
|
270
|
+
const componentCustomTypes = cachedCustomTypes
|
|
271
|
+
? matchCustomTypesForProps(propsWithIds, cachedCustomTypes)
|
|
272
|
+
: undefined;
|
|
273
|
+
const updated = {
|
|
274
|
+
...existing,
|
|
275
|
+
props: propsWithIds,
|
|
276
|
+
propGroups,
|
|
277
|
+
configPropGroups: component.propGroups && component.propGroups.length > 0
|
|
278
|
+
? component.propGroups
|
|
279
|
+
: undefined,
|
|
280
|
+
customTypes: componentCustomTypes && componentCustomTypes.length > 0
|
|
281
|
+
? componentCustomTypes
|
|
282
|
+
: undefined,
|
|
283
|
+
};
|
|
284
|
+
compiledComponents.set(componentId, updated);
|
|
285
|
+
return updated;
|
|
286
|
+
}
|
|
224
287
|
/**
|
|
225
288
|
* Get all compiled shared modules as an array
|
|
226
289
|
*/
|
|
@@ -268,7 +331,16 @@ function regenerateAllComponentTypes(config) {
|
|
|
268
331
|
/**
|
|
269
332
|
* Create handler functions for editor commands
|
|
270
333
|
*/
|
|
271
|
-
function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
334
|
+
function createEditorHandlers(configPath, getConfig, setConfig, wsServer) {
|
|
335
|
+
// Rebuild + broadcast a component after a pure config change, so the editor
|
|
336
|
+
// doesn't have to wait for chokidar to pick up the ikas.config.json write
|
|
337
|
+
// (which can be unreliable when no other file changes alongside).
|
|
338
|
+
const broadcastConfigChange = (componentId) => {
|
|
339
|
+
const updated = rebuildCompiledComponentFromConfig(getConfig(), componentId);
|
|
340
|
+
if (updated) {
|
|
341
|
+
wsServer.broadcastComponentUpdate(updated);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
272
344
|
return {
|
|
273
345
|
onRequestState: () => ({
|
|
274
346
|
components: getAllComponents(),
|
|
@@ -403,7 +475,9 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
403
475
|
const newGroup = {
|
|
404
476
|
id: propGroup.id,
|
|
405
477
|
name: propGroup.name,
|
|
406
|
-
...(propGroup.description
|
|
478
|
+
...(propGroup.description
|
|
479
|
+
? { description: propGroup.description }
|
|
480
|
+
: {}),
|
|
407
481
|
};
|
|
408
482
|
if (propGroup.parentGroupId) {
|
|
409
483
|
const found = findPropGroup(component.propGroups, propGroup.parentGroupId);
|
|
@@ -420,6 +494,7 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
420
494
|
}
|
|
421
495
|
writeConfig(configPath, config);
|
|
422
496
|
setConfig(config);
|
|
497
|
+
broadcastConfigChange(componentId);
|
|
423
498
|
console.log(chalk.green(` Added prop group "${propGroup.id}" to ${component.name}`));
|
|
424
499
|
},
|
|
425
500
|
onUpdatePropGroup: async (componentId, propGroupId, updates) => {
|
|
@@ -438,6 +513,7 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
438
513
|
found.group.description = updates.description || undefined;
|
|
439
514
|
writeConfig(configPath, config);
|
|
440
515
|
setConfig(config);
|
|
516
|
+
broadcastConfigChange(componentId);
|
|
441
517
|
console.log(chalk.green(` Updated prop group "${propGroupId}" on ${component.name}`));
|
|
442
518
|
},
|
|
443
519
|
onDeletePropGroup: async (componentId, propGroupId) => {
|
|
@@ -452,11 +528,11 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
452
528
|
throw new Error(`Prop group "${propGroupId}" not found on ${component.name}`);
|
|
453
529
|
if (found.parent) {
|
|
454
530
|
// Remove from parent's children
|
|
455
|
-
found.parent.children = found.parent.children.filter(c => c.id !== propGroupId);
|
|
531
|
+
found.parent.children = found.parent.children.filter((c) => c.id !== propGroupId);
|
|
456
532
|
}
|
|
457
533
|
else {
|
|
458
534
|
// Remove from root
|
|
459
|
-
component.propGroups = component.propGroups.filter(g => g.id !== propGroupId);
|
|
535
|
+
component.propGroups = component.propGroups.filter((g) => g.id !== propGroupId);
|
|
460
536
|
}
|
|
461
537
|
// Clear groupId from props referencing the deleted group
|
|
462
538
|
for (const prop of component.props) {
|
|
@@ -466,6 +542,7 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
466
542
|
}
|
|
467
543
|
writeConfig(configPath, config);
|
|
468
544
|
setConfig(config);
|
|
545
|
+
broadcastConfigChange(componentId);
|
|
469
546
|
console.log(chalk.green(` Deleted prop group "${propGroupId}" from ${component.name}`));
|
|
470
547
|
},
|
|
471
548
|
onMovePropGroup: async (componentId, propGroupId, parentGroupId, index) => {
|
|
@@ -479,6 +556,7 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
479
556
|
component.propGroups = movePropGroupInTree(component.propGroups, propGroupId, parentGroupId, index);
|
|
480
557
|
writeConfig(configPath, config);
|
|
481
558
|
setConfig(config);
|
|
559
|
+
broadcastConfigChange(componentId);
|
|
482
560
|
console.log(chalk.green(` Moved prop group "${propGroupId}" under "${parentGroupId || "(root)"}" on ${component.name}`));
|
|
483
561
|
},
|
|
484
562
|
onMovePropToGroup: async (componentId, propName, groupId) => {
|
|
@@ -486,7 +564,7 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
486
564
|
const component = config.components.find((c) => c.id === componentId);
|
|
487
565
|
if (!component)
|
|
488
566
|
throw new Error(`Component not found: ${componentId}`);
|
|
489
|
-
const prop = component.props.find(p => p.name === propName);
|
|
567
|
+
const prop = component.props.find((p) => p.name === propName);
|
|
490
568
|
if (!prop)
|
|
491
569
|
throw new Error(`Prop "${propName}" not found on ${component.name}`);
|
|
492
570
|
if (groupId) {
|
|
@@ -502,6 +580,7 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
502
580
|
}
|
|
503
581
|
writeConfig(configPath, config);
|
|
504
582
|
setConfig(config);
|
|
583
|
+
broadcastConfigChange(componentId);
|
|
505
584
|
console.log(chalk.green(` Moved prop "${propName}" to group "${groupId || "(ungrouped)"}" on ${component.name}`));
|
|
506
585
|
},
|
|
507
586
|
onCreateEnum: async (name, enumOptions) => {
|
|
@@ -519,7 +598,9 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
519
598
|
if (existingInEditor) {
|
|
520
599
|
throw new Error(`Enum "${name}" already exists in the connected editor (ID: ${existingInEditor.id})`);
|
|
521
600
|
}
|
|
522
|
-
if (!enumOptions ||
|
|
601
|
+
if (!enumOptions ||
|
|
602
|
+
typeof enumOptions !== "object" ||
|
|
603
|
+
Object.keys(enumOptions).length === 0) {
|
|
523
604
|
throw new Error("enumOptions must be a non-empty object");
|
|
524
605
|
}
|
|
525
606
|
const enumId = generateUniqueId();
|
|
@@ -559,14 +640,18 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
559
640
|
}
|
|
560
641
|
if (name !== undefined) {
|
|
561
642
|
const pascalName = toPascalCase(name);
|
|
562
|
-
const collision = config.customTypes.find((t) => t.type === "enum" &&
|
|
643
|
+
const collision = config.customTypes.find((t) => t.type === "enum" &&
|
|
644
|
+
t.id !== enumId &&
|
|
645
|
+
toPascalCase(t.name) === pascalName);
|
|
563
646
|
if (collision) {
|
|
564
647
|
throw new Error(`Enum name "${name}" conflicts with existing enum (ID: ${collision.id})`);
|
|
565
648
|
}
|
|
566
649
|
enumType.name = name;
|
|
567
650
|
}
|
|
568
651
|
if (enumOptions !== undefined) {
|
|
569
|
-
if (!enumOptions ||
|
|
652
|
+
if (!enumOptions ||
|
|
653
|
+
typeof enumOptions !== "object" ||
|
|
654
|
+
Object.keys(enumOptions).length === 0) {
|
|
570
655
|
throw new Error("enumOptions must be a non-empty object");
|
|
571
656
|
}
|
|
572
657
|
enumType.enumOptions = enumOptions;
|
|
@@ -643,7 +728,9 @@ function createEditorHandlers(configPath, getConfig, setConfig) {
|
|
|
643
728
|
}
|
|
644
729
|
}
|
|
645
730
|
if (incomingEnumNames.size > 0) {
|
|
646
|
-
const incomingEnumIds = new Set(customTypes
|
|
731
|
+
const incomingEnumIds = new Set(customTypes
|
|
732
|
+
.filter((t) => t.type === "enum")
|
|
733
|
+
.map((t) => t.id));
|
|
647
734
|
for (const [id, t] of Array.from(typeMap.entries())) {
|
|
648
735
|
if (t.type === "enum" &&
|
|
649
736
|
typeof t.name === "string" &&
|
|
@@ -698,13 +785,13 @@ async function startDevServer(opts = {}) {
|
|
|
698
785
|
console.log(chalk.gray(` Project: ${config.name}`));
|
|
699
786
|
console.log(chalk.gray(` Components: ${config.components.length}\n`));
|
|
700
787
|
// Validate isHeader/isFooter flags
|
|
701
|
-
const headers = config.components.filter(c => c.isHeader);
|
|
702
|
-
const footers = config.components.filter(c => c.isFooter);
|
|
788
|
+
const headers = config.components.filter((c) => c.isHeader);
|
|
789
|
+
const footers = config.components.filter((c) => c.isFooter);
|
|
703
790
|
if (headers.length > 1) {
|
|
704
|
-
console.log(chalk.yellow(` Warning: Multiple components have isHeader set: ${headers.map(c => c.name).join(", ")}. Only one header is supported.`));
|
|
791
|
+
console.log(chalk.yellow(` Warning: Multiple components have isHeader set: ${headers.map((c) => c.name).join(", ")}. Only one header is supported.`));
|
|
705
792
|
}
|
|
706
793
|
if (footers.length > 1) {
|
|
707
|
-
console.log(chalk.yellow(` Warning: Multiple components have isFooter set: ${footers.map(c => c.name).join(", ")}. Only one footer is supported.`));
|
|
794
|
+
console.log(chalk.yellow(` Warning: Multiple components have isFooter set: ${footers.map((c) => c.name).join(", ")}. Only one footer is supported.`));
|
|
708
795
|
}
|
|
709
796
|
for (const c of config.components) {
|
|
710
797
|
if ((c.isHeader || c.isFooter) && c.type !== "section") {
|
|
@@ -724,7 +811,9 @@ async function startDevServer(opts = {}) {
|
|
|
724
811
|
console.log("");
|
|
725
812
|
// Start WebSocket server
|
|
726
813
|
const wsServer = new DevServerWebSocket(DEV_SERVER_PORT);
|
|
727
|
-
const handlers = createEditorHandlers(configPath, () => config, (newConfig) => {
|
|
814
|
+
const handlers = createEditorHandlers(configPath, () => config, (newConfig) => {
|
|
815
|
+
config = newConfig;
|
|
816
|
+
}, wsServer);
|
|
728
817
|
try {
|
|
729
818
|
await wsServer.start(handlers);
|
|
730
819
|
console.log(chalk.green(` WebSocket server running on ws://localhost:${DEV_SERVER_PORT}`));
|
|
@@ -746,7 +835,7 @@ async function startDevServer(opts = {}) {
|
|
|
746
835
|
adminPort: Number(opts.proxyPort) || DEFAULT_ADMIN_PORT,
|
|
747
836
|
editorPort: Number(opts.editorPort) || DEFAULT_EDITOR_PORT,
|
|
748
837
|
editorUrl: opts.editor || envDefaults.editorUrl,
|
|
749
|
-
adminDomain: opts.domain || envDefaults.adminDomain
|
|
838
|
+
adminDomain: opts.domain || envDefaults.adminDomain,
|
|
750
839
|
});
|
|
751
840
|
}
|
|
752
841
|
catch (error) {
|
|
@@ -759,15 +848,15 @@ async function startDevServer(opts = {}) {
|
|
|
759
848
|
"src/**/*.tsx",
|
|
760
849
|
"src/**/*.ts",
|
|
761
850
|
"src/**/*.css",
|
|
762
|
-
"ikas.config.json"
|
|
851
|
+
"ikas.config.json",
|
|
763
852
|
];
|
|
764
853
|
const watcher = chokidar.watch(watchPaths, {
|
|
765
854
|
ignored: ["**/global-types.ts"],
|
|
766
855
|
ignoreInitial: true,
|
|
767
856
|
awaitWriteFinish: {
|
|
768
857
|
stabilityThreshold: 100,
|
|
769
|
-
pollInterval: 50
|
|
770
|
-
}
|
|
858
|
+
pollInterval: 50,
|
|
859
|
+
},
|
|
771
860
|
});
|
|
772
861
|
// Debounce full recompilation for rapid changes
|
|
773
862
|
let recompileTimer = null;
|
|
@@ -788,8 +877,8 @@ async function startDevServer(opts = {}) {
|
|
|
788
877
|
components: getAllComponents(),
|
|
789
878
|
sharedModules: getAllSharedModules(),
|
|
790
879
|
globalStyles: compiledGlobalStyles,
|
|
791
|
-
timestamp: Date.now()
|
|
792
|
-
}
|
|
880
|
+
timestamp: Date.now(),
|
|
881
|
+
},
|
|
793
882
|
});
|
|
794
883
|
}
|
|
795
884
|
else {
|
|
@@ -818,8 +907,8 @@ async function startDevServer(opts = {}) {
|
|
|
818
907
|
components: getAllComponents(),
|
|
819
908
|
sharedModules: getAllSharedModules(),
|
|
820
909
|
globalStyles: compiledGlobalStyles,
|
|
821
|
-
timestamp: Date.now()
|
|
822
|
-
}
|
|
910
|
+
timestamp: Date.now(),
|
|
911
|
+
},
|
|
823
912
|
});
|
|
824
913
|
}
|
|
825
914
|
catch (e) {
|