@xbg.solutions/create-frontend 1.1.1 → 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/bin/xbg-frontend.cjs +32 -0
- package/package.json +17 -3
- package/src/commands/add.cjs +470 -0
- package/src/commands/generate.cjs +24 -0
- package/src/manifest.json +1578 -0
- package/src/registry/advanced/ChartWrapper.svelte +587 -0
- package/src/registry/advanced/DataTable.svelte +645 -0
- package/src/registry/advanced/FormWizard.svelte +546 -0
- package/src/registry/advanced/ImageUpload.svelte +663 -0
- package/src/registry/advanced/index.ts +33 -0
- package/src/registry/atoms/calendar/Calendar.svelte +181 -0
- package/src/registry/atoms/calendar/index.ts +1 -0
- package/src/registry/atoms/dialog/Dialog.svelte +179 -0
- package/src/registry/atoms/dialog/DialogDescription.svelte +16 -0
- package/src/registry/atoms/dialog/DialogFooter.svelte +16 -0
- package/src/registry/atoms/dialog/DialogHeader.svelte +16 -0
- package/src/registry/atoms/dialog/DialogTitle.svelte +16 -0
- package/src/registry/atoms/dialog/index.ts +10 -0
- package/src/registry/atoms/icon/BrandIcon.svelte +47 -0
- package/src/registry/atoms/icon/DynamicIcon.svelte +49 -0
- package/src/registry/atoms/icon/index.ts +2 -0
- package/src/registry/atoms/legend/Legend.svelte +32 -0
- package/src/registry/atoms/legend/index.ts +1 -0
- package/src/registry/atoms/menu/MenuItem.svelte +85 -0
- package/src/registry/atoms/menu/index.ts +1 -0
- package/src/registry/atoms/message/Message.svelte +62 -0
- package/src/registry/atoms/message/index.ts +1 -0
- package/src/registry/atoms/nav/NavItem.svelte +67 -0
- package/src/registry/atoms/nav/index.ts +1 -0
- package/src/registry/atoms/notification-badge/NotificationBadge.svelte +30 -0
- package/src/registry/atoms/notification-badge/index.ts +1 -0
- package/src/registry/atoms/otp-input/OtpInput.svelte +108 -0
- package/src/registry/atoms/otp-input/index.ts +1 -0
- package/src/registry/atoms/select/Select.svelte +216 -0
- package/src/registry/atoms/select/index.ts +6 -0
- package/src/registry/atoms/settings-card/SettingsCard.svelte +48 -0
- package/src/registry/atoms/settings-card/index.ts +1 -0
- package/src/registry/atoms/sidebar-item/SidebarItem.svelte +90 -0
- package/src/registry/atoms/sidebar-item/index.ts +1 -0
- package/src/registry/atoms/statistic-card/StatisticCard.svelte +53 -0
- package/src/registry/atoms/statistic-card/index.ts +1 -0
- package/src/registry/atoms/text-editor/TextEditor.svelte +77 -0
- package/src/registry/atoms/text-editor/index.ts +1 -0
- package/src/registry/atoms/uploader/Uploader.svelte +102 -0
- package/src/registry/atoms/uploader/index.ts +1 -0
- package/src/registry/atoms/user-item/UserItem.svelte +39 -0
- package/src/registry/atoms/user-item/index.ts +1 -0
- package/src/registry/blocks/account-section/AccountSection01.svelte +112 -0
- package/src/registry/blocks/account-section/AccountSection02.svelte +190 -0
- package/src/registry/blocks/account-section/AccountSection03.svelte +161 -0
- package/src/registry/blocks/account-section/AccountSection04.svelte +164 -0
- package/src/registry/blocks/account-section/AccountSection05.svelte +76 -0
- package/src/registry/blocks/account-section/index.ts +5 -0
- package/src/registry/blocks/app-shell/AppShell01.svelte +74 -0
- package/src/registry/blocks/app-shell/AppShell02.svelte +87 -0
- package/src/registry/blocks/app-shell/AppShell03.svelte +79 -0
- package/src/registry/blocks/app-shell/AppShell04.svelte +177 -0
- package/src/registry/blocks/app-shell/index.ts +4 -0
- package/src/registry/blocks/auth/AuthSplitScreen.svelte +132 -0
- package/src/registry/blocks/auth/LoginBlock01.svelte +94 -0
- package/src/registry/blocks/auth/LoginBlock02.svelte +103 -0
- package/src/registry/blocks/auth/LoginBlock03.svelte +53 -0
- package/src/registry/blocks/auth/LoginBlock04.svelte +99 -0
- package/src/registry/blocks/auth/LoginBlock05.svelte +101 -0
- package/src/registry/blocks/auth/OtpBlock01.svelte +115 -0
- package/src/registry/blocks/auth/OtpBlock02.svelte +113 -0
- package/src/registry/blocks/auth/OtpBlock03.svelte +143 -0
- package/src/registry/blocks/auth/OtpBlock04.svelte +122 -0
- package/src/registry/blocks/auth/OtpBlock05.svelte +81 -0
- package/src/registry/blocks/auth/SignupBlock01.svelte +103 -0
- package/src/registry/blocks/auth/SignupBlock02.svelte +94 -0
- package/src/registry/blocks/auth/SignupBlock03.svelte +120 -0
- package/src/registry/blocks/auth/SignupBlock04.svelte +112 -0
- package/src/registry/blocks/auth/SignupBlock05.svelte +77 -0
- package/src/registry/blocks/auth/index.ts +31 -0
- package/src/registry/blocks/banner/Banner01.svelte +67 -0
- package/src/registry/blocks/banner/Banner02.svelte +61 -0
- package/src/registry/blocks/banner/Banner03.svelte +54 -0
- package/src/registry/blocks/banner/Banner04.svelte +49 -0
- package/src/registry/blocks/banner/Banner05.svelte +47 -0
- package/src/registry/blocks/banner/index.ts +5 -0
- package/src/registry/blocks/bento-grid/BentoGrid01.svelte +92 -0
- package/src/registry/blocks/bento-grid/BentoGrid02.svelte +79 -0
- package/src/registry/blocks/bento-grid/BentoGrid03.svelte +79 -0
- package/src/registry/blocks/bento-grid/BentoGrid04.svelte +58 -0
- package/src/registry/blocks/bento-grid/BentoGrid05.svelte +92 -0
- package/src/registry/blocks/bento-grid/BentoGrid06.svelte +42 -0
- package/src/registry/blocks/bento-grid/index.ts +14 -0
- package/src/registry/blocks/blog-section/BlogSection01.svelte +100 -0
- package/src/registry/blocks/blog-section/BlogSection02.svelte +93 -0
- package/src/registry/blocks/blog-section/BlogSection03.svelte +92 -0
- package/src/registry/blocks/blog-section/BlogSection04.svelte +97 -0
- package/src/registry/blocks/blog-section/BlogSection05.svelte +120 -0
- package/src/registry/blocks/blog-section/index.ts +15 -0
- package/src/registry/blocks/buttons/ButtonBookmark.svelte +37 -0
- package/src/registry/blocks/buttons/ButtonLike.svelte +37 -0
- package/src/registry/blocks/buttons/ButtonMenu.svelte +37 -0
- package/src/registry/blocks/buttons/ButtonSplitDropdown.svelte +46 -0
- package/src/registry/blocks/buttons/ButtonStepper.svelte +55 -0
- package/src/registry/blocks/buttons/ButtonSteps.svelte +73 -0
- package/src/registry/blocks/buttons/ButtonToggleGroup.svelte +35 -0
- package/src/registry/blocks/buttons/ButtonsGroup.svelte +63 -0
- package/src/registry/blocks/buttons/SocialButtonsHorizontal.svelte +41 -0
- package/src/registry/blocks/buttons/SocialButtonsVertical.svelte +53 -0
- package/src/registry/blocks/buttons/index.ts +10 -0
- package/src/registry/blocks/calendar/CalendarBlock01.svelte +169 -0
- package/src/registry/blocks/calendar/CalendarBlock02.svelte +133 -0
- package/src/registry/blocks/calendar/CalendarBlock03.svelte +194 -0
- package/src/registry/blocks/calendar/CalendarBlock04.svelte +96 -0
- package/src/registry/blocks/calendar/CalendarBlock05.svelte +97 -0
- package/src/registry/blocks/calendar/CalendarBlock06.svelte +98 -0
- package/src/registry/blocks/calendar/CalendarBlock07.svelte +109 -0
- package/src/registry/blocks/calendar/CalendarBlock08.svelte +71 -0
- package/src/registry/blocks/calendar/CalendarBlock09.svelte +99 -0
- package/src/registry/blocks/calendar/CalendarBlock10.svelte +88 -0
- package/src/registry/blocks/calendar/CalendarBlock11.svelte +99 -0
- package/src/registry/blocks/calendar/CalendarBlock12.svelte +121 -0
- package/src/registry/blocks/calendar/CalendarBlock13.svelte +92 -0
- package/src/registry/blocks/calendar/CalendarBlock14.svelte +71 -0
- package/src/registry/blocks/calendar/CalendarBlock15.svelte +96 -0
- package/src/registry/blocks/calendar/CalendarBlock16.svelte +98 -0
- package/src/registry/blocks/calendar/CalendarBlock17.svelte +88 -0
- package/src/registry/blocks/calendar/CalendarBlock18.svelte +84 -0
- package/src/registry/blocks/calendar/CalendarBlock19.svelte +105 -0
- package/src/registry/blocks/calendar/CalendarBlock20.svelte +78 -0
- package/src/registry/blocks/calendar/CalendarBlock21.svelte +115 -0
- package/src/registry/blocks/calendar/CalendarBlock22.svelte +136 -0
- package/src/registry/blocks/calendar/CalendarBlock23.svelte +112 -0
- package/src/registry/blocks/calendar/CalendarBlock24.svelte +116 -0
- package/src/registry/blocks/calendar/CalendarBlock25.svelte +144 -0
- package/src/registry/blocks/calendar/CalendarBlock26.svelte +163 -0
- package/src/registry/blocks/calendar/CalendarBlock27.svelte +112 -0
- package/src/registry/blocks/calendar/CalendarBlock28.svelte +109 -0
- package/src/registry/blocks/calendar/CalendarBlock29.svelte +126 -0
- package/src/registry/blocks/calendar/CalendarBlock30.svelte +122 -0
- package/src/registry/blocks/calendar/CalendarBlock31.svelte +161 -0
- package/src/registry/blocks/calendar/CalendarBlock32.svelte +154 -0
- package/src/registry/blocks/calendar/index.ts +32 -0
- package/src/registry/blocks/card/Card01.svelte +69 -0
- package/src/registry/blocks/card/Card02.svelte +50 -0
- package/src/registry/blocks/card/Card03.svelte +60 -0
- package/src/registry/blocks/card/Card04.svelte +89 -0
- package/src/registry/blocks/card/Card05.svelte +51 -0
- package/src/registry/blocks/card/Card06.svelte +77 -0
- package/src/registry/blocks/card/Card07.svelte +35 -0
- package/src/registry/blocks/card/Card08.svelte +36 -0
- package/src/registry/blocks/card/index.ts +8 -0
- package/src/registry/blocks/cart/Cart01.svelte +183 -0
- package/src/registry/blocks/cart/Cart02.svelte +103 -0
- package/src/registry/blocks/cart/Cart03.svelte +38 -0
- package/src/registry/blocks/cart/Cart04.svelte +174 -0
- package/src/registry/blocks/cart/index.ts +4 -0
- package/src/registry/blocks/checkout/Checkout01.svelte +237 -0
- package/src/registry/blocks/checkout/Checkout02.svelte +205 -0
- package/src/registry/blocks/checkout/Checkout03.svelte +189 -0
- package/src/registry/blocks/checkout/Checkout04.svelte +109 -0
- package/src/registry/blocks/checkout/index.ts +4 -0
- package/src/registry/blocks/comparison-section/ComparisonSection01.svelte +116 -0
- package/src/registry/blocks/comparison-section/ComparisonSection02.svelte +98 -0
- package/src/registry/blocks/comparison-section/ComparisonSection03.svelte +93 -0
- package/src/registry/blocks/comparison-section/ComparisonSection04.svelte +98 -0
- package/src/registry/blocks/comparison-section/ComparisonSection05.svelte +119 -0
- package/src/registry/blocks/comparison-section/ComparisonSection06.svelte +154 -0
- package/src/registry/blocks/comparison-section/index.ts +6 -0
- package/src/registry/blocks/contact-section/ContactSection01.svelte +64 -0
- package/src/registry/blocks/contact-section/ContactSection02.svelte +108 -0
- package/src/registry/blocks/contact-section/ContactSection03.svelte +64 -0
- package/src/registry/blocks/contact-section/ContactSection04.svelte +30 -0
- package/src/registry/blocks/contact-section/ContactSection05.svelte +71 -0
- package/src/registry/blocks/contact-section/ContactSection06.svelte +88 -0
- package/src/registry/blocks/contact-section/index.ts +6 -0
- package/src/registry/blocks/cta/CTA01.svelte +44 -0
- package/src/registry/blocks/cta/CTA02.svelte +48 -0
- package/src/registry/blocks/cta/CTA03.svelte +53 -0
- package/src/registry/blocks/cta/CTA04.svelte +60 -0
- package/src/registry/blocks/cta/CTA05.svelte +53 -0
- package/src/registry/blocks/cta/CTA06.svelte +44 -0
- package/src/registry/blocks/cta/CTA07.svelte +39 -0
- package/src/registry/blocks/cta/index.ts +7 -0
- package/src/registry/blocks/dashboard/ChartsBlock01.svelte +275 -0
- package/src/registry/blocks/dashboard/DashboardBlock01.svelte +207 -0
- package/src/registry/blocks/dashboard/DashboardBlock02.svelte +259 -0
- package/src/registry/blocks/dashboard/DashboardBlock03.svelte +315 -0
- package/src/registry/blocks/dashboard/DashboardBlock04.svelte +220 -0
- package/src/registry/blocks/dashboard/DashboardBlock05.svelte +158 -0
- package/src/registry/blocks/dashboard/DashboardBlock06.svelte +173 -0
- package/src/registry/blocks/dashboard/DashboardBlock07.svelte +103 -0
- package/src/registry/blocks/dashboard/index.ts +16 -0
- package/src/registry/blocks/description-list/DescriptionList01.svelte +75 -0
- package/src/registry/blocks/description-list/DescriptionList02.svelte +50 -0
- package/src/registry/blocks/description-list/DescriptionList03.svelte +74 -0
- package/src/registry/blocks/description-list/DescriptionList04.svelte +88 -0
- package/src/registry/blocks/description-list/index.ts +4 -0
- package/src/registry/blocks/empty-lp/EmptyLP01.svelte +46 -0
- package/src/registry/blocks/empty-lp/EmptyLP02.svelte +49 -0
- package/src/registry/blocks/empty-lp/EmptyLP03.svelte +61 -0
- package/src/registry/blocks/empty-lp/EmptyLP04.svelte +37 -0
- package/src/registry/blocks/empty-lp/index.ts +4 -0
- package/src/registry/blocks/empty-section/EmptySection01.svelte +47 -0
- package/src/registry/blocks/empty-section/EmptySection02.svelte +93 -0
- package/src/registry/blocks/empty-section/EmptySection03.svelte +101 -0
- package/src/registry/blocks/empty-section/EmptySection04.svelte +76 -0
- package/src/registry/blocks/empty-section/index.ts +4 -0
- package/src/registry/blocks/faq-section/FaqSection01.svelte +114 -0
- package/src/registry/blocks/faq-section/FaqSection02.svelte +137 -0
- package/src/registry/blocks/faq-section/FaqSection03.svelte +107 -0
- package/src/registry/blocks/faq-section/FaqSection04.svelte +74 -0
- package/src/registry/blocks/faq-section/FaqSection05.svelte +69 -0
- package/src/registry/blocks/faq-section/index.ts +11 -0
- package/src/registry/blocks/feature-section/FeatureSection01.svelte +94 -0
- package/src/registry/blocks/feature-section/FeatureSection02.svelte +61 -0
- package/src/registry/blocks/feature-section/FeatureSection03.svelte +85 -0
- package/src/registry/blocks/feature-section/FeatureSection04.svelte +67 -0
- package/src/registry/blocks/feature-section/FeatureSection05.svelte +61 -0
- package/src/registry/blocks/feature-section/FeatureSection06.svelte +58 -0
- package/src/registry/blocks/feature-section/FeatureSection07.svelte +79 -0
- package/src/registry/blocks/feature-section/FeatureSection08.svelte +92 -0
- package/src/registry/blocks/feature-section/FeatureSection09.svelte +58 -0
- package/src/registry/blocks/feature-section/FeatureSection10.svelte +87 -0
- package/src/registry/blocks/feature-section/FeatureSection11.svelte +118 -0
- package/src/registry/blocks/feature-section/FeatureSection12.svelte +76 -0
- package/src/registry/blocks/feature-section/FeatureSection13.svelte +88 -0
- package/src/registry/blocks/feature-section/FeatureSection14.svelte +119 -0
- package/src/registry/blocks/feature-section/FeatureSection15.svelte +122 -0
- package/src/registry/blocks/feature-section/FeatureSection16.svelte +113 -0
- package/src/registry/blocks/feature-section/FeatureSection17.svelte +93 -0
- package/src/registry/blocks/feature-section/FeatureSection18.svelte +97 -0
- package/src/registry/blocks/feature-section/FeatureSection19.svelte +74 -0
- package/src/registry/blocks/feature-section/FeatureSection20.svelte +69 -0
- package/src/registry/blocks/feature-section/index.ts +20 -0
- package/src/registry/blocks/footer/Footer01.svelte +62 -0
- package/src/registry/blocks/footer/Footer02.svelte +67 -0
- package/src/registry/blocks/footer/Footer03.svelte +87 -0
- package/src/registry/blocks/footer/Footer04.svelte +67 -0
- package/src/registry/blocks/footer/Footer05.svelte +20 -0
- package/src/registry/blocks/footer/Footer06.svelte +107 -0
- package/src/registry/blocks/footer/Footer07.svelte +88 -0
- package/src/registry/blocks/footer/Footer08.svelte +84 -0
- package/src/registry/blocks/footer/Footer09.svelte +65 -0
- package/src/registry/blocks/footer/index.ts +19 -0
- package/src/registry/blocks/forms/SettingsBlock.svelte +329 -0
- package/src/registry/blocks/forms/index.ts +1 -0
- package/src/registry/blocks/gallery-section/GallerySection01.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection02.svelte +45 -0
- package/src/registry/blocks/gallery-section/GallerySection03.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection04.svelte +49 -0
- package/src/registry/blocks/gallery-section/GallerySection05.svelte +45 -0
- package/src/registry/blocks/gallery-section/GallerySection06.svelte +49 -0
- package/src/registry/blocks/gallery-section/GallerySection07.svelte +48 -0
- package/src/registry/blocks/gallery-section/GallerySection08.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection09.svelte +55 -0
- package/src/registry/blocks/gallery-section/GallerySection10.svelte +43 -0
- package/src/registry/blocks/gallery-section/GallerySection11.svelte +75 -0
- package/src/registry/blocks/gallery-section/GallerySection12.svelte +76 -0
- package/src/registry/blocks/gallery-section/index.ts +12 -0
- package/src/registry/blocks/header-section/HeaderSection01.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection02.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection03.svelte +61 -0
- package/src/registry/blocks/header-section/HeaderSection04.svelte +63 -0
- package/src/registry/blocks/header-section/HeaderSection05.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection06.svelte +70 -0
- package/src/registry/blocks/header-section/HeaderSection07.svelte +97 -0
- package/src/registry/blocks/header-section/HeaderSection08.svelte +61 -0
- package/src/registry/blocks/header-section/HeaderSection09.svelte +53 -0
- package/src/registry/blocks/header-section/HeaderSection10.svelte +63 -0
- package/src/registry/blocks/header-section/HeaderSection11.svelte +68 -0
- package/src/registry/blocks/header-section/HeaderSection12.svelte +60 -0
- package/src/registry/blocks/header-section/HeaderSection13.svelte +92 -0
- package/src/registry/blocks/header-section/HeaderSection14.svelte +77 -0
- package/src/registry/blocks/header-section/HeaderSection15.svelte +49 -0
- package/src/registry/blocks/header-section/HeaderSection16.svelte +74 -0
- package/src/registry/blocks/header-section/HeaderSection17.svelte +58 -0
- package/src/registry/blocks/header-section/HeaderSection18.svelte +66 -0
- package/src/registry/blocks/header-section/HeaderSection19.svelte +47 -0
- package/src/registry/blocks/header-section/HeaderSection20.svelte +53 -0
- package/src/registry/blocks/header-section/index.ts +20 -0
- package/src/registry/blocks/hero-section/HeroSection01.svelte +69 -0
- package/src/registry/blocks/hero-section/HeroSection02.svelte +47 -0
- package/src/registry/blocks/hero-section/HeroSection03.svelte +56 -0
- package/src/registry/blocks/hero-section/HeroSection04.svelte +69 -0
- package/src/registry/blocks/hero-section/HeroSection05.svelte +73 -0
- package/src/registry/blocks/hero-section/HeroSection06.svelte +78 -0
- package/src/registry/blocks/hero-section/HeroSection07.svelte +48 -0
- package/src/registry/blocks/hero-section/HeroSection08.svelte +73 -0
- package/src/registry/blocks/hero-section/HeroSection09.svelte +51 -0
- package/src/registry/blocks/hero-section/HeroSection10.svelte +47 -0
- package/src/registry/blocks/hero-section/HeroSection11.svelte +60 -0
- package/src/registry/blocks/hero-section/HeroSection12.svelte +74 -0
- package/src/registry/blocks/hero-section/HeroSection13.svelte +86 -0
- package/src/registry/blocks/hero-section/HeroSection14.svelte +116 -0
- package/src/registry/blocks/hero-section/HeroSection15.svelte +75 -0
- package/src/registry/blocks/hero-section/HeroSection16.svelte +92 -0
- package/src/registry/blocks/hero-section/HeroSection17.svelte +78 -0
- package/src/registry/blocks/hero-section/HeroSection18.svelte +82 -0
- package/src/registry/blocks/hero-section/HeroSection19.svelte +72 -0
- package/src/registry/blocks/hero-section/HeroSection20.svelte +79 -0
- package/src/registry/blocks/hero-section/HeroSection21.svelte +75 -0
- package/src/registry/blocks/hero-section/HeroSection22.svelte +103 -0
- package/src/registry/blocks/hero-section/index.ts +22 -0
- package/src/registry/blocks/logo-section/LogoSection01.svelte +54 -0
- package/src/registry/blocks/logo-section/LogoSection02.svelte +56 -0
- package/src/registry/blocks/logo-section/LogoSection03.svelte +58 -0
- package/src/registry/blocks/logo-section/LogoSection04.svelte +58 -0
- package/src/registry/blocks/logo-section/LogoSection05.svelte +43 -0
- package/src/registry/blocks/logo-section/LogoSection06.svelte +43 -0
- package/src/registry/blocks/logo-section/LogoSection07.svelte +56 -0
- package/src/registry/blocks/logo-section/index.ts +7 -0
- package/src/registry/blocks/lp-navbar/LPNavbar01.svelte +94 -0
- package/src/registry/blocks/lp-navbar/LPNavbar02.svelte +96 -0
- package/src/registry/blocks/lp-navbar/LPNavbar03.svelte +97 -0
- package/src/registry/blocks/lp-navbar/LPNavbar04.svelte +103 -0
- package/src/registry/blocks/lp-navbar/LPNavbar05.svelte +173 -0
- package/src/registry/blocks/lp-navbar/LPNavbar06.svelte +200 -0
- package/src/registry/blocks/lp-navbar/LPNavbar07.svelte +202 -0
- package/src/registry/blocks/lp-navbar/index.ts +7 -0
- package/src/registry/blocks/mail/MailBlock.svelte +321 -0
- package/src/registry/blocks/mail/index.ts +2 -0
- package/src/registry/blocks/music/MusicBlock.svelte +239 -0
- package/src/registry/blocks/music/index.ts +1 -0
- package/src/registry/blocks/navbar/Navbar01.svelte +234 -0
- package/src/registry/blocks/navbar/Navbar02.svelte +111 -0
- package/src/registry/blocks/navbar/Navbar03.svelte +88 -0
- package/src/registry/blocks/navbar/index.ts +3 -0
- package/src/registry/blocks/not-found/NotFound01.svelte +29 -0
- package/src/registry/blocks/not-found/NotFound02.svelte +28 -0
- package/src/registry/blocks/not-found/NotFound03.svelte +25 -0
- package/src/registry/blocks/not-found/index.ts +3 -0
- package/src/registry/blocks/order-history/OrderHistory01.svelte +208 -0
- package/src/registry/blocks/order-history/OrderHistory02.svelte +131 -0
- package/src/registry/blocks/order-history/OrderHistory03.svelte +133 -0
- package/src/registry/blocks/order-history/index.ts +3 -0
- package/src/registry/blocks/page-header/PageHeader01.svelte +39 -0
- package/src/registry/blocks/page-header/PageHeader02.svelte +58 -0
- package/src/registry/blocks/page-header/PageHeader03.svelte +64 -0
- package/src/registry/blocks/page-header/PageHeader04.svelte +49 -0
- package/src/registry/blocks/page-header/PageHeader05.svelte +49 -0
- package/src/registry/blocks/page-header/PageHeader06.svelte +58 -0
- package/src/registry/blocks/page-header/PageHeader07.svelte +64 -0
- package/src/registry/blocks/page-header/PageHeader08.svelte +68 -0
- package/src/registry/blocks/page-header/index.ts +8 -0
- package/src/registry/blocks/playground/PlaygroundBlock01.svelte +162 -0
- package/src/registry/blocks/playground/PlaygroundBlock02.svelte +156 -0
- package/src/registry/blocks/playground/index.ts +2 -0
- package/src/registry/blocks/pricing-section/PricingSection01.svelte +109 -0
- package/src/registry/blocks/pricing-section/PricingSection02.svelte +145 -0
- package/src/registry/blocks/pricing-section/PricingSection03.svelte +94 -0
- package/src/registry/blocks/pricing-section/PricingSection04.svelte +103 -0
- package/src/registry/blocks/pricing-section/PricingSection05.svelte +128 -0
- package/src/registry/blocks/pricing-section/index.ts +20 -0
- package/src/registry/blocks/product-card/ProductCard01.svelte +74 -0
- package/src/registry/blocks/product-card/ProductCard02.svelte +108 -0
- package/src/registry/blocks/product-card/ProductCard03.svelte +80 -0
- package/src/registry/blocks/product-card/ProductCard04.svelte +50 -0
- package/src/registry/blocks/product-card/ProductCard05.svelte +107 -0
- package/src/registry/blocks/product-card/index.ts +5 -0
- package/src/registry/blocks/product-detail/ProductDetail01.svelte +174 -0
- package/src/registry/blocks/product-detail/ProductDetail02.svelte +170 -0
- package/src/registry/blocks/product-detail/ProductDetail03.svelte +159 -0
- package/src/registry/blocks/product-detail/ProductDetail04.svelte +106 -0
- package/src/registry/blocks/product-detail/ProductDetail05.svelte +181 -0
- package/src/registry/blocks/product-detail/index.ts +5 -0
- package/src/registry/blocks/product-listing/ProductListing01.svelte +194 -0
- package/src/registry/blocks/product-listing/ProductListing02.svelte +163 -0
- package/src/registry/blocks/product-listing/ProductListing03.svelte +173 -0
- package/src/registry/blocks/product-listing/ProductListing04.svelte +179 -0
- package/src/registry/blocks/product-listing/ProductListing05.svelte +126 -0
- package/src/registry/blocks/product-listing/index.ts +5 -0
- package/src/registry/blocks/product-reviews/ProductReviews01.svelte +156 -0
- package/src/registry/blocks/product-reviews/ProductReviews02.svelte +139 -0
- package/src/registry/blocks/product-reviews/ProductReviews03.svelte +137 -0
- package/src/registry/blocks/product-reviews/ProductReviews04.svelte +129 -0
- package/src/registry/blocks/product-reviews/index.ts +4 -0
- package/src/registry/blocks/promo-section/PromoSection01.svelte +72 -0
- package/src/registry/blocks/promo-section/PromoSection02.svelte +61 -0
- package/src/registry/blocks/promo-section/PromoSection03.svelte +110 -0
- package/src/registry/blocks/promo-section/PromoSection04.svelte +103 -0
- package/src/registry/blocks/promo-section/index.ts +4 -0
- package/src/registry/blocks/rich-text/RichText01.svelte +30 -0
- package/src/registry/blocks/rich-text/RichText02.svelte +72 -0
- package/src/registry/blocks/rich-text/RichText03.svelte +52 -0
- package/src/registry/blocks/rich-text/RichText04.svelte +44 -0
- package/src/registry/blocks/rich-text/RichText05.svelte +56 -0
- package/src/registry/blocks/rich-text/index.ts +5 -0
- package/src/registry/blocks/section/Section01.svelte +38 -0
- package/src/registry/blocks/section/Section02.svelte +90 -0
- package/src/registry/blocks/section/Section03.svelte +95 -0
- package/src/registry/blocks/section/Section04.svelte +117 -0
- package/src/registry/blocks/section/index.ts +4 -0
- package/src/registry/blocks/section-footer/SectionFooter01.svelte +39 -0
- package/src/registry/blocks/section-footer/SectionFooter02.svelte +33 -0
- package/src/registry/blocks/section-footer/SectionFooter03.svelte +33 -0
- package/src/registry/blocks/section-footer/SectionFooter04.svelte +34 -0
- package/src/registry/blocks/section-footer/SectionFooter05.svelte +69 -0
- package/src/registry/blocks/section-footer/index.ts +5 -0
- package/src/registry/blocks/section-header/SectionHeader01.svelte +39 -0
- package/src/registry/blocks/section-header/SectionHeader02.svelte +58 -0
- package/src/registry/blocks/section-header/SectionHeader03.svelte +88 -0
- package/src/registry/blocks/section-header/SectionHeader04.svelte +45 -0
- package/src/registry/blocks/section-header/SectionHeader05.svelte +64 -0
- package/src/registry/blocks/section-header/index.ts +5 -0
- package/src/registry/blocks/settings/Settings01.svelte +202 -0
- package/src/registry/blocks/settings/Settings02.svelte +201 -0
- package/src/registry/blocks/settings/Settings03.svelte +156 -0
- package/src/registry/blocks/settings/Settings04.svelte +175 -0
- package/src/registry/blocks/settings/Settings05.svelte +248 -0
- package/src/registry/blocks/settings/Settings06.svelte +120 -0
- package/src/registry/blocks/settings/Settings07.svelte +136 -0
- package/src/registry/blocks/settings/index.ts +7 -0
- package/src/registry/blocks/sidebar/SidebarLayout01.svelte +108 -0
- package/src/registry/blocks/sidebar/SidebarLayout02.svelte +75 -0
- package/src/registry/blocks/sidebar/SidebarLayout03.svelte +108 -0
- package/src/registry/blocks/sidebar/SidebarLayout04.svelte +111 -0
- package/src/registry/blocks/sidebar/SidebarLayout05.svelte +103 -0
- package/src/registry/blocks/sidebar/SidebarLayout06.svelte +122 -0
- package/src/registry/blocks/sidebar/SidebarLayout07.svelte +183 -0
- package/src/registry/blocks/sidebar/SidebarLayout08.svelte +162 -0
- package/src/registry/blocks/sidebar/SidebarLayout09.svelte +167 -0
- package/src/registry/blocks/sidebar/SidebarLayout10.svelte +159 -0
- package/src/registry/blocks/sidebar/SidebarLayout11.svelte +135 -0
- package/src/registry/blocks/sidebar/SidebarLayout12.svelte +159 -0
- package/src/registry/blocks/sidebar/SidebarLayout13.svelte +103 -0
- package/src/registry/blocks/sidebar/SidebarLayout14.svelte +87 -0
- package/src/registry/blocks/sidebar/SidebarLayout15.svelte +228 -0
- package/src/registry/blocks/sidebar/index.ts +15 -0
- package/src/registry/blocks/sign-in/SignIn01.svelte +140 -0
- package/src/registry/blocks/sign-in/SignIn02.svelte +155 -0
- package/src/registry/blocks/sign-in/SignIn03.svelte +214 -0
- package/src/registry/blocks/sign-in/SignIn04.svelte +163 -0
- package/src/registry/blocks/sign-in/SignIn05.svelte +209 -0
- package/src/registry/blocks/sign-in/SignIn06.svelte +233 -0
- package/src/registry/blocks/sign-in/SignIn07.svelte +268 -0
- package/src/registry/blocks/sign-in/SignIn08.svelte +125 -0
- package/src/registry/blocks/sign-in/SignIn09.svelte +93 -0
- package/src/registry/blocks/sign-in/SignIn10.svelte +74 -0
- package/src/registry/blocks/sign-in/index.ts +10 -0
- package/src/registry/blocks/sign-up/SignUp01.svelte +124 -0
- package/src/registry/blocks/sign-up/SignUp02.svelte +110 -0
- package/src/registry/blocks/sign-up/SignUp03.svelte +182 -0
- package/src/registry/blocks/sign-up/SignUp04.svelte +126 -0
- package/src/registry/blocks/sign-up/SignUp05.svelte +182 -0
- package/src/registry/blocks/sign-up/SignUp06.svelte +221 -0
- package/src/registry/blocks/sign-up/SignUp07.svelte +98 -0
- package/src/registry/blocks/sign-up/index.ts +7 -0
- package/src/registry/blocks/stats-section/StatsSection01.svelte +66 -0
- package/src/registry/blocks/stats-section/StatsSection02.svelte +60 -0
- package/src/registry/blocks/stats-section/StatsSection03.svelte +66 -0
- package/src/registry/blocks/stats-section/StatsSection04.svelte +66 -0
- package/src/registry/blocks/stats-section/StatsSection05.svelte +60 -0
- package/src/registry/blocks/stats-section/StatsSection06.svelte +48 -0
- package/src/registry/blocks/stats-section/StatsSection07.svelte +66 -0
- package/src/registry/blocks/stats-section/index.ts +7 -0
- package/src/registry/blocks/store-navbar/StoreNavbar01.svelte +101 -0
- package/src/registry/blocks/store-navbar/StoreNavbar02.svelte +65 -0
- package/src/registry/blocks/store-navbar/StoreNavbar03.svelte +83 -0
- package/src/registry/blocks/store-navbar/StoreNavbar04.svelte +110 -0
- package/src/registry/blocks/store-navbar/StoreNavbar05.svelte +80 -0
- package/src/registry/blocks/store-navbar/index.ts +5 -0
- package/src/registry/blocks/table-header/TableHeader01.svelte +96 -0
- package/src/registry/blocks/table-header/TableHeader02.svelte +86 -0
- package/src/registry/blocks/table-header/TableHeader03.svelte +99 -0
- package/src/registry/blocks/table-header/TableHeader04.svelte +107 -0
- package/src/registry/blocks/table-header/index.ts +4 -0
- package/src/registry/blocks/tasks/TasksBlock.svelte +286 -0
- package/src/registry/blocks/tasks/index.ts +1 -0
- package/src/registry/blocks/team-section/TeamSection01.svelte +80 -0
- package/src/registry/blocks/team-section/TeamSection02.svelte +102 -0
- package/src/registry/blocks/team-section/TeamSection03.svelte +76 -0
- package/src/registry/blocks/team-section/TeamSection04.svelte +106 -0
- package/src/registry/blocks/team-section/index.ts +13 -0
- package/src/registry/blocks/testimonials/Testimonial01.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonial02.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonial03.svelte +79 -0
- package/src/registry/blocks/testimonials/Testimonial04.svelte +113 -0
- package/src/registry/blocks/testimonials/Testimonial05.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonial06.svelte +114 -0
- package/src/registry/blocks/testimonials/Testimonial07.svelte +131 -0
- package/src/registry/blocks/testimonials/Testimonials01.svelte +60 -0
- package/src/registry/blocks/testimonials/Testimonials02.svelte +61 -0
- package/src/registry/blocks/testimonials/Testimonials03.svelte +79 -0
- package/src/registry/blocks/testimonials/Testimonials04.svelte +74 -0
- package/src/registry/blocks/testimonials/Testimonials05.svelte +68 -0
- package/src/registry/blocks/testimonials/Testimonials06.svelte +82 -0
- package/src/registry/blocks/testimonials/Testimonials07.svelte +98 -0
- package/src/registry/blocks/testimonials/index.ts +16 -0
- package/src/registry/templates/cn.ts +42 -0
- package/src/index.ts +0 -2
- package/tsconfig.json +0 -20
- /package/src/{generate-component.cjs → commands/generate-component.cjs} +0 -0
- /package/src/{generate-route.cjs → commands/generate-route.cjs} +0 -0
- /package/src/{generate-service.cjs → commands/generate-service.cjs} +0 -0
- /package/src/{manage-auth-users.cjs → commands/manage-auth-users.cjs} +0 -0
- /package/src/{setup.cjs → commands/setup.cjs} +0 -0
- /package/src/{validate-setup.cjs → commands/validate.cjs} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const command = process.argv[2];
|
|
5
|
+
const args = process.argv.slice(3);
|
|
6
|
+
|
|
7
|
+
// Re-inject args so child scripts see them
|
|
8
|
+
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
9
|
+
|
|
10
|
+
switch (command) {
|
|
11
|
+
case 'setup':
|
|
12
|
+
require('../src/commands/setup.cjs');
|
|
13
|
+
break;
|
|
14
|
+
case 'add':
|
|
15
|
+
require('../src/commands/add.cjs');
|
|
16
|
+
break;
|
|
17
|
+
case 'validate':
|
|
18
|
+
require('../src/commands/validate.cjs');
|
|
19
|
+
break;
|
|
20
|
+
case 'generate':
|
|
21
|
+
require('../src/commands/generate.cjs');
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
console.log('Usage: xbg-frontend <command>');
|
|
25
|
+
console.log('');
|
|
26
|
+
console.log('Commands:');
|
|
27
|
+
console.log(' setup Configure project (--config <path> for non-interactive)');
|
|
28
|
+
console.log(' add Add components from registry');
|
|
29
|
+
console.log(' validate Validate project configuration');
|
|
30
|
+
console.log(' generate Generate component, route, or service');
|
|
31
|
+
process.exit(command ? 1 : 0);
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbg.solutions/create-frontend",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "CLI tool and component registry for XBG frontend projects",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"xbg-frontend": "./bin/xbg-frontend.cjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"src/commands",
|
|
12
|
+
"src/registry",
|
|
13
|
+
"src/manifest.json",
|
|
14
|
+
"lib"
|
|
15
|
+
],
|
|
6
16
|
"scripts": {
|
|
7
17
|
"build": "tsc",
|
|
8
18
|
"build:watch": "tsc --watch",
|
|
9
|
-
"clean": "rm -rf lib"
|
|
19
|
+
"clean": "rm -rf lib",
|
|
20
|
+
"populate-registry": "node scripts/populate-registry.cjs",
|
|
21
|
+
"generate-manifest": "node scripts/generate-component-manifest.cjs",
|
|
22
|
+
"generate-manifest:images": "node scripts/generate-component-manifest.cjs --images",
|
|
23
|
+
"generate-manifest:update-meta": "node scripts/generate-component-manifest.cjs --update-meta"
|
|
10
24
|
},
|
|
11
25
|
"publishConfig": {
|
|
12
26
|
"access": "public"
|
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Component Registry — Add Command
|
|
5
|
+
*
|
|
6
|
+
* Copies components from the XBG registry into a consuming project.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx xbg-frontend add otp-input calendar # Add extended atoms
|
|
10
|
+
* npx xbg-frontend add block-auth block-dashboard # Add block categories
|
|
11
|
+
* npx xbg-frontend add chart-wrapper # Add advanced components
|
|
12
|
+
* npx xbg-frontend add block-auth --yes # Skip prompts (for agents)
|
|
13
|
+
* npx xbg-frontend add block-auth --force # Overwrite existing
|
|
14
|
+
* npx xbg-frontend list # List all available components
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
'use strict';
|
|
18
|
+
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const readline = require('readline');
|
|
22
|
+
|
|
23
|
+
// ─── ANSI colours ────────────────────────────────────────────────────────────
|
|
24
|
+
const C = {
|
|
25
|
+
reset: '\x1b[0m',
|
|
26
|
+
bold: '\x1b[1m',
|
|
27
|
+
green: '\x1b[32m',
|
|
28
|
+
blue: '\x1b[34m',
|
|
29
|
+
yellow: '\x1b[33m',
|
|
30
|
+
red: '\x1b[31m',
|
|
31
|
+
cyan: '\x1b[36m',
|
|
32
|
+
dim: '\x1b[2m',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const log = {
|
|
36
|
+
ok: (m) => console.log(`${C.green}✓${C.reset} ${m}`),
|
|
37
|
+
err: (m) => console.log(`${C.red}✗${C.reset} ${m}`),
|
|
38
|
+
info: (m) => console.log(`${C.blue}ℹ${C.reset} ${m}`),
|
|
39
|
+
warn: (m) => console.log(`${C.yellow}⚠${C.reset} ${m}`),
|
|
40
|
+
title: (m) => console.log(`\n${C.bold}${C.blue}${m}${C.reset}\n`),
|
|
41
|
+
dim: (m) => console.log(`${C.dim}${m}${C.reset}`),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// ─── readline ────────────────────────────────────────────────────────────────
|
|
45
|
+
function askYN(question, defaultYes = true) {
|
|
46
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
47
|
+
const hint = defaultYes ? 'Y/n' : 'y/N';
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
rl.question(`${C.cyan}${question} (${hint})${C.reset} `, (ans) => {
|
|
50
|
+
rl.close();
|
|
51
|
+
const a = ans.trim().toLowerCase();
|
|
52
|
+
if (a === '') resolve(defaultYes);
|
|
53
|
+
else resolve(a === 'y' || a === 'yes');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ─── Registry resolution ─────────────────────────────────────────────────────
|
|
59
|
+
|
|
60
|
+
function getRegistryRoot() {
|
|
61
|
+
const registryRoot = path.resolve(__dirname, '..', 'registry');
|
|
62
|
+
if (!fs.existsSync(registryRoot)) {
|
|
63
|
+
log.err(`Registry not found at ${registryRoot}`);
|
|
64
|
+
log.dim('This usually means the package was not installed correctly.');
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
return registryRoot;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function loadManifest() {
|
|
71
|
+
const manifestPath = path.resolve(__dirname, '..', 'manifest.json');
|
|
72
|
+
if (!fs.existsSync(manifestPath)) {
|
|
73
|
+
log.err(`Manifest not found at ${manifestPath}`);
|
|
74
|
+
log.dim('This usually means the package was not installed correctly.');
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const raw = fs.readFileSync(manifestPath, 'utf-8');
|
|
79
|
+
return JSON.parse(raw);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
log.err(`Failed to parse manifest.json: ${e.message}`);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ─── Component resolution ────────────────────────────────────────────────────
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Look up user-provided names across all manifest sections.
|
|
90
|
+
* Returns an array of manifest entries with an added `type` field.
|
|
91
|
+
*/
|
|
92
|
+
function resolveComponents(names, manifest) {
|
|
93
|
+
const entries = [];
|
|
94
|
+
|
|
95
|
+
for (const name of names) {
|
|
96
|
+
let found = null;
|
|
97
|
+
|
|
98
|
+
// Search atoms first, then advanced, then blocks
|
|
99
|
+
if (manifest.atoms && manifest.atoms[name]) {
|
|
100
|
+
found = { ...manifest.atoms[name], name, type: 'atoms' };
|
|
101
|
+
} else if (manifest.advanced && manifest.advanced[name]) {
|
|
102
|
+
found = { ...manifest.advanced[name], name, type: 'advanced' };
|
|
103
|
+
} else if (manifest.blocks && manifest.blocks[name]) {
|
|
104
|
+
found = { ...manifest.blocks[name], name, type: 'blocks' };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!found) {
|
|
108
|
+
log.err(`Unknown component: "${name}"`);
|
|
109
|
+
console.log('');
|
|
110
|
+
console.log('Available components:');
|
|
111
|
+
const allNames = [
|
|
112
|
+
...Object.keys(manifest.atoms || {}),
|
|
113
|
+
...Object.keys(manifest.advanced || {}),
|
|
114
|
+
...Object.keys(manifest.blocks || {}),
|
|
115
|
+
];
|
|
116
|
+
console.log(` ${allNames.join(', ')}`);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
entries.push(found);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return entries;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Recursively collect extended-atom dependencies from the registry.
|
|
128
|
+
* Returns a deduplicated list of all entries to install.
|
|
129
|
+
*/
|
|
130
|
+
function buildDependencyTree(entries, manifest) {
|
|
131
|
+
const seen = new Set();
|
|
132
|
+
const result = [];
|
|
133
|
+
|
|
134
|
+
function walk(entry) {
|
|
135
|
+
if (seen.has(entry.name)) return;
|
|
136
|
+
seen.add(entry.name);
|
|
137
|
+
|
|
138
|
+
// Recurse into atom dependencies first (so deps are installed before dependents)
|
|
139
|
+
const atomDeps = (entry.dependencies && entry.dependencies.atoms) || [];
|
|
140
|
+
for (const depName of atomDeps) {
|
|
141
|
+
if (manifest.atoms && manifest.atoms[depName]) {
|
|
142
|
+
walk({ ...manifest.atoms[depName], name: depName, type: 'atoms' });
|
|
143
|
+
} else {
|
|
144
|
+
log.warn(`Dependency "${depName}" (required by ${entry.name}) not found in manifest atoms.`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
result.push(entry);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
for (const entry of entries) {
|
|
152
|
+
walk(entry);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ─── Existence checks ────────────────────────────────────────────────────────
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Check which target paths already exist in the project.
|
|
162
|
+
* A component is considered "existing" if targetPath dir exists and contains
|
|
163
|
+
* at least one .svelte file.
|
|
164
|
+
*/
|
|
165
|
+
function checkExisting(projectRoot, entries) {
|
|
166
|
+
const existing = [];
|
|
167
|
+
const toInstall = [];
|
|
168
|
+
|
|
169
|
+
for (const entry of entries) {
|
|
170
|
+
const targetDir = path.join(projectRoot, entry.targetPath);
|
|
171
|
+
if (fs.existsSync(targetDir)) {
|
|
172
|
+
// Check for at least one .svelte file
|
|
173
|
+
try {
|
|
174
|
+
const files = fs.readdirSync(targetDir);
|
|
175
|
+
const hasSvelte = files.some((f) => f.endsWith('.svelte'));
|
|
176
|
+
if (hasSvelte) {
|
|
177
|
+
existing.push(entry);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
} catch {
|
|
181
|
+
// directory read failed — treat as missing
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
toInstall.push(entry);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return { existing, toInstall };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Collect all basicAtoms dependencies and check if they exist in the project.
|
|
192
|
+
* Returns list of missing basic atom names.
|
|
193
|
+
*/
|
|
194
|
+
function checkBasicAtoms(projectRoot, entries, manifest) {
|
|
195
|
+
const needed = new Set();
|
|
196
|
+
|
|
197
|
+
for (const entry of entries) {
|
|
198
|
+
const basicDeps = (entry.dependencies && entry.dependencies.basicAtoms) || [];
|
|
199
|
+
for (const atomName of basicDeps) {
|
|
200
|
+
needed.add(atomName);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const missing = [];
|
|
205
|
+
for (const atomName of needed) {
|
|
206
|
+
const atomDir = path.join(projectRoot, 'src', 'lib', 'components', 'ui', atomName);
|
|
207
|
+
if (!fs.existsSync(atomDir)) {
|
|
208
|
+
missing.push(atomName);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return missing.sort();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ─── cn.ts utility ───────────────────────────────────────────────────────────
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Ensure the cn() utility exists in the project. Copy from registry template
|
|
219
|
+
* if missing. Warn about required npm dependencies.
|
|
220
|
+
*/
|
|
221
|
+
function ensureCn(projectRoot, registryRoot) {
|
|
222
|
+
const cnTarget = path.join(projectRoot, 'src', 'lib', 'utils', 'cn.ts');
|
|
223
|
+
|
|
224
|
+
if (fs.existsSync(cnTarget)) return;
|
|
225
|
+
|
|
226
|
+
const cnSource = path.join(registryRoot, 'templates', 'cn.ts');
|
|
227
|
+
if (!fs.existsSync(cnSource)) {
|
|
228
|
+
log.warn('cn.ts template not found in registry — skipping cn.ts setup.');
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Ensure target directory exists
|
|
233
|
+
const utilsDir = path.dirname(cnTarget);
|
|
234
|
+
fs.mkdirSync(utilsDir, { recursive: true });
|
|
235
|
+
|
|
236
|
+
fs.copyFileSync(cnSource, cnTarget);
|
|
237
|
+
log.ok('Created src/lib/utils/cn.ts');
|
|
238
|
+
|
|
239
|
+
// Check for required npm dependencies
|
|
240
|
+
const pkgPath = path.join(projectRoot, 'package.json');
|
|
241
|
+
if (fs.existsSync(pkgPath)) {
|
|
242
|
+
try {
|
|
243
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
244
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
245
|
+
const missingPkgs = [];
|
|
246
|
+
if (!allDeps['clsx']) missingPkgs.push('clsx');
|
|
247
|
+
if (!allDeps['tailwind-merge']) missingPkgs.push('tailwind-merge');
|
|
248
|
+
if (missingPkgs.length > 0) {
|
|
249
|
+
log.warn(`cn.ts requires: ${missingPkgs.join(', ')}`);
|
|
250
|
+
log.dim(` Run: npm install ${missingPkgs.join(' ')}`);
|
|
251
|
+
}
|
|
252
|
+
} catch {
|
|
253
|
+
// ignore parse errors
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// ─── File copying ────────────────────────────────────────────────────────────
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Copy all files for a component from the registry to the project.
|
|
262
|
+
*/
|
|
263
|
+
function copyComponent(registryRoot, projectRoot, entry) {
|
|
264
|
+
const srcDir = path.join(registryRoot, entry.registryPath);
|
|
265
|
+
const destDir = path.join(projectRoot, entry.targetPath);
|
|
266
|
+
|
|
267
|
+
if (!fs.existsSync(srcDir)) {
|
|
268
|
+
log.err(`Registry source not found: ${entry.registryPath}`);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Ensure target directory exists
|
|
273
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
274
|
+
|
|
275
|
+
const filesToCopy = entry.files || [];
|
|
276
|
+
|
|
277
|
+
if (filesToCopy.length === 0) {
|
|
278
|
+
// If no files array, copy everything in the directory
|
|
279
|
+
const allFiles = fs.readdirSync(srcDir);
|
|
280
|
+
for (const file of allFiles) {
|
|
281
|
+
const srcFile = path.join(srcDir, file);
|
|
282
|
+
const destFile = path.join(destDir, file);
|
|
283
|
+
if (fs.statSync(srcFile).isFile()) {
|
|
284
|
+
fs.copyFileSync(srcFile, destFile);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
for (const file of filesToCopy) {
|
|
289
|
+
const srcFile = path.join(srcDir, file);
|
|
290
|
+
const destFile = path.join(destDir, file);
|
|
291
|
+
if (!fs.existsSync(srcFile)) {
|
|
292
|
+
log.warn(`File not found in registry: ${entry.registryPath}/${file}`);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
fs.copyFileSync(srcFile, destFile);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
log.ok(`${entry.name} → ${entry.targetPath}`);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// ─── Barrel export maintenance ───────────────────────────────────────────────
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Append an export line to the appropriate barrel index.ts if not already present.
|
|
306
|
+
*/
|
|
307
|
+
function updateBarrelExport(projectRoot, entry, manifest) {
|
|
308
|
+
let barrelPath;
|
|
309
|
+
|
|
310
|
+
switch (entry.type) {
|
|
311
|
+
case 'atoms':
|
|
312
|
+
barrelPath = path.join(projectRoot, 'src', 'lib', 'components', 'ui', 'index.ts');
|
|
313
|
+
break;
|
|
314
|
+
case 'advanced':
|
|
315
|
+
barrelPath = path.join(projectRoot, 'src', 'lib', 'components', 'advanced', 'index.ts');
|
|
316
|
+
break;
|
|
317
|
+
case 'blocks':
|
|
318
|
+
barrelPath = path.join(projectRoot, 'src', 'lib', 'components', 'blocks', 'index.ts');
|
|
319
|
+
break;
|
|
320
|
+
default:
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (!fs.existsSync(barrelPath)) return;
|
|
325
|
+
|
|
326
|
+
const exportLine = entry.exportLine || `export { default as ${toPascal(entry.name)} } from './${entry.name}';`;
|
|
327
|
+
|
|
328
|
+
const content = fs.readFileSync(barrelPath, 'utf-8');
|
|
329
|
+
if (content.includes(entry.name)) return; // Already has some export for this component
|
|
330
|
+
|
|
331
|
+
const newContent = content.trimEnd() + '\n' + exportLine + '\n';
|
|
332
|
+
fs.writeFileSync(barrelPath, newContent, 'utf-8');
|
|
333
|
+
log.dim(` Updated ${path.relative(projectRoot, barrelPath)}`);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Convert kebab-case name to PascalCase.
|
|
338
|
+
*/
|
|
339
|
+
function toPascal(str) {
|
|
340
|
+
return str
|
|
341
|
+
.split('-')
|
|
342
|
+
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
343
|
+
.join('');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// ─── List command ────────────────────────────────────────────────────────────
|
|
347
|
+
|
|
348
|
+
function listComponents(manifest) {
|
|
349
|
+
log.title('Available Components');
|
|
350
|
+
|
|
351
|
+
if (manifest.atoms && Object.keys(manifest.atoms).length > 0) {
|
|
352
|
+
console.log(`${C.bold}Extended Atoms${C.reset}`);
|
|
353
|
+
for (const [name, entry] of Object.entries(manifest.atoms)) {
|
|
354
|
+
const desc = entry.description ? `${C.dim} — ${entry.description}${C.reset}` : '';
|
|
355
|
+
console.log(` ${C.green}${name}${C.reset}${desc}`);
|
|
356
|
+
}
|
|
357
|
+
console.log('');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (manifest.advanced && Object.keys(manifest.advanced).length > 0) {
|
|
361
|
+
console.log(`${C.bold}Advanced Components${C.reset}`);
|
|
362
|
+
for (const [name, entry] of Object.entries(manifest.advanced)) {
|
|
363
|
+
const desc = entry.description ? `${C.dim} — ${entry.description}${C.reset}` : '';
|
|
364
|
+
console.log(` ${C.cyan}${name}${C.reset}${desc}`);
|
|
365
|
+
}
|
|
366
|
+
console.log('');
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (manifest.blocks && Object.keys(manifest.blocks).length > 0) {
|
|
370
|
+
console.log(`${C.bold}Blocks${C.reset}`);
|
|
371
|
+
for (const [name, entry] of Object.entries(manifest.blocks)) {
|
|
372
|
+
const desc = entry.description ? `${C.dim} — ${entry.description}${C.reset}` : '';
|
|
373
|
+
console.log(` ${C.blue}${name}${C.reset}${desc}`);
|
|
374
|
+
}
|
|
375
|
+
console.log('');
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const total =
|
|
379
|
+
Object.keys(manifest.atoms || {}).length +
|
|
380
|
+
Object.keys(manifest.advanced || {}).length +
|
|
381
|
+
Object.keys(manifest.blocks || {}).length;
|
|
382
|
+
|
|
383
|
+
log.dim(`${total} component(s) available.`);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// ─── Main ────────────────────────────────────────────────────────────────────
|
|
387
|
+
|
|
388
|
+
async function main() {
|
|
389
|
+
const args = process.argv.slice(2);
|
|
390
|
+
const flags = {
|
|
391
|
+
yes: args.includes('--yes') || args.includes('-y'),
|
|
392
|
+
force: args.includes('--force'),
|
|
393
|
+
};
|
|
394
|
+
const names = args.filter((a) => !a.startsWith('-'));
|
|
395
|
+
|
|
396
|
+
// Handle 'list' sub-command or no arguments
|
|
397
|
+
if (names[0] === 'list' || names.length === 0) {
|
|
398
|
+
const manifest = loadManifest();
|
|
399
|
+
listComponents(manifest);
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const projectRoot = process.cwd();
|
|
404
|
+
const registryRoot = getRegistryRoot();
|
|
405
|
+
const manifest = loadManifest();
|
|
406
|
+
|
|
407
|
+
// Resolve requested components
|
|
408
|
+
const entries = resolveComponents(names, manifest);
|
|
409
|
+
|
|
410
|
+
// Build full dependency tree (extended atoms needed by blocks/advanced)
|
|
411
|
+
const allEntries = buildDependencyTree(entries, manifest);
|
|
412
|
+
|
|
413
|
+
// Check what already exists
|
|
414
|
+
const { existing, toInstall } = checkExisting(projectRoot, allEntries);
|
|
415
|
+
|
|
416
|
+
if (toInstall.length === 0 && !flags.force) {
|
|
417
|
+
log.ok('All requested components already exist in your project.');
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Show what will be installed
|
|
422
|
+
console.log('\nComponents to add:');
|
|
423
|
+
const installList = flags.force ? allEntries : toInstall;
|
|
424
|
+
for (const entry of installList) {
|
|
425
|
+
console.log(` ${C.green}+${C.reset} ${entry.name} → ${C.dim}${entry.targetPath}${C.reset}`);
|
|
426
|
+
}
|
|
427
|
+
if (existing.length > 0 && !flags.force) {
|
|
428
|
+
console.log('\nAlready present (skipping):');
|
|
429
|
+
for (const entry of existing) {
|
|
430
|
+
console.log(` ${C.dim}= ${entry.name}${C.reset}`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Check for missing basic atoms
|
|
435
|
+
const missingBasic = checkBasicAtoms(projectRoot, allEntries, manifest);
|
|
436
|
+
if (missingBasic.length > 0) {
|
|
437
|
+
console.log('');
|
|
438
|
+
log.warn('Required basic atoms not found in your project:');
|
|
439
|
+
console.log(` ${missingBasic.join(', ')}`);
|
|
440
|
+
log.dim(' These are simple shadcn-style components. Code them following the');
|
|
441
|
+
log.dim(' Svelte 5 runes + tv() + cn() pattern documented in bpsk/components skill.');
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Confirm (unless --yes)
|
|
445
|
+
if (!flags.yes) {
|
|
446
|
+
const proceed = await askYN('\nProceed?');
|
|
447
|
+
if (!proceed) {
|
|
448
|
+
console.log('Cancelled.');
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// Ensure cn.ts exists
|
|
454
|
+
ensureCn(projectRoot, registryRoot);
|
|
455
|
+
|
|
456
|
+
// Copy components
|
|
457
|
+
let copied = 0;
|
|
458
|
+
for (const entry of installList) {
|
|
459
|
+
copyComponent(registryRoot, projectRoot, entry);
|
|
460
|
+
updateBarrelExport(projectRoot, entry, manifest);
|
|
461
|
+
copied++;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
console.log(`\n${C.green}✓${C.reset} Added ${C.bold}${copied}${C.reset} component(s).`);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
main().catch((err) => {
|
|
468
|
+
log.err(err.message);
|
|
469
|
+
process.exit(1);
|
|
470
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const subcommand = process.argv[2];
|
|
5
|
+
|
|
6
|
+
switch (subcommand) {
|
|
7
|
+
case 'component':
|
|
8
|
+
process.argv = [process.argv[0], process.argv[1], ...process.argv.slice(3)];
|
|
9
|
+
require('./generate-component.cjs');
|
|
10
|
+
break;
|
|
11
|
+
case 'route':
|
|
12
|
+
process.argv = [process.argv[0], process.argv[1], ...process.argv.slice(3)];
|
|
13
|
+
require('./generate-route.cjs');
|
|
14
|
+
break;
|
|
15
|
+
case 'service':
|
|
16
|
+
process.argv = [process.argv[0], process.argv[1], ...process.argv.slice(3)];
|
|
17
|
+
require('./generate-service.cjs');
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
console.log('Usage: xbg-frontend generate <type> <name> [options]');
|
|
21
|
+
console.log('');
|
|
22
|
+
console.log('Types: component, route, service');
|
|
23
|
+
process.exit(subcommand ? 1 : 0);
|
|
24
|
+
}
|