@vendure-platform/create 0.1.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/README.md +70 -0
- package/dist/assets/demo-data/branding/logo.svg +4 -0
- package/dist/assets/demo-data/images/absorbent-pad.webp +0 -0
- package/dist/assets/demo-data/images/adjustable-wrench.webp +0 -0
- package/dist/assets/demo-data/images/anchor-bolt.webp +0 -0
- package/dist/assets/demo-data/images/angle-grinder.webp +0 -0
- package/dist/assets/demo-data/images/barrier-tape.webp +0 -0
- package/dist/assets/demo-data/images/bench-grinder.webp +0 -0
- package/dist/assets/demo-data/images/bracket.webp +0 -0
- package/dist/assets/demo-data/images/broom.webp +0 -0
- package/dist/assets/demo-data/images/bucket.webp +0 -0
- package/dist/assets/demo-data/images/cable-gland.webp +0 -0
- package/dist/assets/demo-data/images/cable-tie.webp +0 -0
- package/dist/assets/demo-data/images/cable-tray.webp +0 -0
- package/dist/assets/demo-data/images/cable.webp +0 -0
- package/dist/assets/demo-data/images/chimney-base-kit.webp +0 -0
- package/dist/assets/demo-data/images/chimney-cowl-bird-guard.webp +0 -0
- package/dist/assets/demo-data/images/chimney-cowl-open.webp +0 -0
- package/dist/assets/demo-data/images/chimney-storm-collar.webp +0 -0
- package/dist/assets/demo-data/images/chimney-wall-bracket.webp +0 -0
- package/dist/assets/demo-data/images/circular-saw.webp +0 -0
- package/dist/assets/demo-data/images/cleaning-spray.webp +0 -0
- package/dist/assets/demo-data/images/conduit.webp +0 -0
- package/dist/assets/demo-data/images/cordless-drill.webp +0 -0
- package/dist/assets/demo-data/images/drill-bits.webp +0 -0
- package/dist/assets/demo-data/images/dust-mask.webp +0 -0
- package/dist/assets/demo-data/images/ear-defenders.webp +0 -0
- package/dist/assets/demo-data/images/ear-plugs.webp +0 -0
- package/dist/assets/demo-data/images/extension-lead.webp +0 -0
- package/dist/assets/demo-data/images/eye-wash-station.webp +0 -0
- package/dist/assets/demo-data/images/face-shield.webp +0 -0
- package/dist/assets/demo-data/images/file-set.webp +0 -0
- package/dist/assets/demo-data/images/first-aid-kit.webp +0 -0
- package/dist/assets/demo-data/images/floor-sign.webp +0 -0
- package/dist/assets/demo-data/images/flue-bend-45.webp +0 -0
- package/dist/assets/demo-data/images/flue-bend-90.webp +0 -0
- package/dist/assets/demo-data/images/flue-section-1000mm.webp +0 -0
- package/dist/assets/demo-data/images/flue-section-250mm.webp +0 -0
- package/dist/assets/demo-data/images/flue-section-500mm.webp +0 -0
- package/dist/assets/demo-data/images/fuse.webp +0 -0
- package/dist/assets/demo-data/images/glove-dispenser.webp +0 -0
- package/dist/assets/demo-data/images/grinding-disc.webp +0 -0
- package/dist/assets/demo-data/images/hacksaw.webp +0 -0
- package/dist/assets/demo-data/images/hammer.webp +0 -0
- package/dist/assets/demo-data/images/hand-sanitiser.webp +0 -0
- package/dist/assets/demo-data/images/head-torch.webp +0 -0
- package/dist/assets/demo-data/images/heat-gun.webp +0 -0
- package/dist/assets/demo-data/images/hex-bolt.webp +0 -0
- package/dist/assets/demo-data/images/hex-key-set.webp +0 -0
- package/dist/assets/demo-data/images/hex-nut.webp +0 -0
- package/dist/assets/demo-data/images/hi-vis-jacket.webp +0 -0
- package/dist/assets/demo-data/images/hi-vis-vest.webp +0 -0
- package/dist/assets/demo-data/images/hose-clamp.webp +0 -0
- package/dist/assets/demo-data/images/impact-driver.webp +0 -0
- package/dist/assets/demo-data/images/jigsaw.webp +0 -0
- package/dist/assets/demo-data/images/junction-box.webp +0 -0
- package/dist/assets/demo-data/images/knee-pads.webp +0 -0
- package/dist/assets/demo-data/images/machine-screw.webp +0 -0
- package/dist/assets/demo-data/images/made-to-order-configurable-chimney.webp +0 -0
- package/dist/assets/demo-data/images/mallet.webp +0 -0
- package/dist/assets/demo-data/images/mcb.webp +0 -0
- package/dist/assets/demo-data/images/mop.webp +0 -0
- package/dist/assets/demo-data/images/paper-towels.webp +0 -0
- package/dist/assets/demo-data/images/pipe-wrench.webp +0 -0
- package/dist/assets/demo-data/images/pliers-set.webp +0 -0
- package/dist/assets/demo-data/images/pry-bar.webp +0 -0
- package/dist/assets/demo-data/images/rcd.webp +0 -0
- package/dist/assets/demo-data/images/reciprocating-saw.webp +0 -0
- package/dist/assets/demo-data/images/rivet.webp +0 -0
- package/dist/assets/demo-data/images/roof-flashing-high-pitch.webp +0 -0
- package/dist/assets/demo-data/images/roof-flashing-low-pitch.webp +0 -0
- package/dist/assets/demo-data/images/safety-boots.webp +0 -0
- package/dist/assets/demo-data/images/safety-glasses.webp +0 -0
- package/dist/assets/demo-data/images/safety-harness.webp +0 -0
- package/dist/assets/demo-data/images/safety-helmet.webp +0 -0
- package/dist/assets/demo-data/images/safety-sign.webp +0 -0
- package/dist/assets/demo-data/images/sanding-disc.webp +0 -0
- package/dist/assets/demo-data/images/saw-blade.webp +0 -0
- package/dist/assets/demo-data/images/screwdriver-set.webp +0 -0
- package/dist/assets/demo-data/images/screwdriver.webp +0 -0
- package/dist/assets/demo-data/images/self-tapping-screw.webp +0 -0
- package/dist/assets/demo-data/images/socket-set.webp +0 -0
- package/dist/assets/demo-data/images/socket.webp +0 -0
- package/dist/assets/demo-data/images/spanner-set.webp +0 -0
- package/dist/assets/demo-data/images/spanner.webp +0 -0
- package/dist/assets/demo-data/images/spill-kit.webp +0 -0
- package/dist/assets/demo-data/images/spirit-level.webp +0 -0
- package/dist/assets/demo-data/images/switch.webp +0 -0
- package/dist/assets/demo-data/images/tape-measure.webp +0 -0
- package/dist/assets/demo-data/images/terminal-block.webp +0 -0
- package/dist/assets/demo-data/images/threaded-rod.webp +0 -0
- package/dist/assets/demo-data/images/torque-wrench.webp +0 -0
- package/dist/assets/demo-data/images/utility-knife.webp +0 -0
- package/dist/assets/demo-data/images/wall-pass-sleeve.webp +0 -0
- package/dist/assets/demo-data/images/wall-plug.webp +0 -0
- package/dist/assets/demo-data/images/washer.webp +0 -0
- package/dist/assets/demo-data/images/waste-bin.webp +0 -0
- package/dist/assets/demo-data/images/wire-connector.webp +0 -0
- package/dist/assets/demo-data/images/wire-cutters.webp +0 -0
- package/dist/assets/demo-data/images/wood-screw.webp +0 -0
- package/dist/assets/demo-data/images/work-gloves.webp +0 -0
- package/dist/assets/demo-data/images/work-light.webp +0 -0
- package/dist/assets/demo-data/initial-data.json +667 -0
- package/dist/assets/demo-data/products.csv +779 -0
- package/dist/assets/storefront/.env.example +14 -0
- package/dist/assets/storefront/.env.local +1 -0
- package/dist/assets/storefront/components.json +22 -0
- package/dist/assets/storefront/eslint.config.mjs +23 -0
- package/dist/assets/storefront/graphql.config.yml +2 -0
- package/dist/assets/storefront/messages/de.json +1196 -0
- package/dist/assets/storefront/messages/en.json +1196 -0
- package/dist/assets/storefront/next-env.d.ts +6 -0
- package/dist/assets/storefront/next.config.ts +73 -0
- package/dist/assets/storefront/package.json +77 -0
- package/dist/assets/storefront/postcss.config.mjs +5 -0
- package/dist/assets/storefront/public/next.svg +22 -0
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/logo.svg +4 -0
- package/dist/assets/storefront/public/scenarios/default/logo.svg +4 -0
- package/dist/assets/storefront/public/scenarios/kaminpro/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/kaminpro/logo.svg +7 -0
- package/dist/assets/storefront/public/vendure.svg +4 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +65 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/loading.tsx +24 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +194 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +9 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +139 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/loading.tsx +46 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +330 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/actions.ts +11 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/loading.tsx +20 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +97 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-analytics-tracker.tsx +46 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +53 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +31 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +56 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +32 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +85 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +125 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +180 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +292 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +48 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +54 -0
- package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +28 -0
- package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +340 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +33 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +83 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +267 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +253 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +75 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +70 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +153 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +210 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +66 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +8 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +57 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +89 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +65 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +55 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +66 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +93 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +51 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +57 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +326 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +74 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +157 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +133 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +104 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +266 -0
- package/dist/assets/storefront/src/app/[locale]/account/error.tsx +24 -0
- package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +50 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +463 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +160 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +386 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +45 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +309 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +106 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +82 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +88 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +80 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +54 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +44 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/actions.ts +103 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +148 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +112 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +170 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/quick-order-form.tsx +243 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +153 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +118 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +40 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +260 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +253 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +28 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +51 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +248 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/loading.tsx +44 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +51 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +562 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +235 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +86 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +48 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +176 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +31 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +41 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +190 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +38 -0
- package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +117 -0
- package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +128 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +228 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +55 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +158 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +36 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +151 -0
- package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +49 -0
- package/dist/assets/storefront/src/app/[locale]/cart/loading.tsx +10 -0
- package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +178 -0
- package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +33 -0
- package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +142 -0
- package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +76 -0
- package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +80 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +192 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +30 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +214 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +181 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/loading.tsx +90 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +160 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +154 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +107 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +110 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +180 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +518 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/types.ts +7 -0
- package/dist/assets/storefront/src/app/[locale]/error.tsx +28 -0
- package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +28 -0
- package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +128 -0
- package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +24 -0
- package/dist/assets/storefront/src/app/[locale]/globals.css +72 -0
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +202 -0
- package/dist/assets/storefront/src/app/[locale]/not-found.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +296 -0
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +18 -0
- package/dist/assets/storefront/src/app/[locale]/page.tsx +125 -0
- package/dist/assets/storefront/src/app/[locale]/register/actions.ts +50 -0
- package/dist/assets/storefront/src/app/[locale]/register/page.tsx +82 -0
- package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +237 -0
- package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +40 -0
- package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +43 -0
- package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +48 -0
- package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +40 -0
- package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +32 -0
- package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +96 -0
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +31 -0
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/loading.tsx +29 -0
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +157 -0
- package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +76 -0
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +177 -0
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +81 -0
- package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +41 -0
- package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +40 -0
- package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +127 -0
- package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +67 -0
- package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +26 -0
- package/dist/assets/storefront/src/app/api/draft/disable/route.ts +12 -0
- package/dist/assets/storefront/src/app/api/draft/route.ts +17 -0
- package/dist/assets/storefront/src/app/api/revalidate/route.ts +110 -0
- package/dist/assets/storefront/src/app/api/search-analytics/route.ts +16 -0
- package/dist/assets/storefront/src/app/favicon.ico +0 -0
- package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +56 -0
- package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +112 -0
- package/dist/assets/storefront/src/components/commerce/active-filters.tsx +107 -0
- package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +70 -0
- package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +37 -0
- package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +56 -0
- package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +83 -0
- package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +69 -0
- package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +133 -0
- package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +36 -0
- package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +32 -0
- package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +58 -0
- package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +606 -0
- package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +286 -0
- package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +43 -0
- package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +137 -0
- package/dist/assets/storefront/src/components/commerce/highlighted-text.tsx +30 -0
- package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +377 -0
- package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +41 -0
- package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +146 -0
- package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +20 -0
- package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +111 -0
- package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +98 -0
- package/dist/assets/storefront/src/components/commerce/price.tsx +29 -0
- package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +121 -0
- package/dist/assets/storefront/src/components/commerce/product-card.tsx +89 -0
- package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +42 -0
- package/dist/assets/storefront/src/components/commerce/product-grid.tsx +54 -0
- package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +127 -0
- package/dist/assets/storefront/src/components/commerce/product-info.tsx +525 -0
- package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +393 -0
- package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +34 -0
- package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +175 -0
- package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +107 -0
- package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +235 -0
- package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +320 -0
- package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +52 -0
- package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +97 -0
- package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +139 -0
- package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +252 -0
- package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +41 -0
- package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +33 -0
- package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +88 -0
- package/dist/assets/storefront/src/components/commerce/related-products.tsx +56 -0
- package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +59 -0
- package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +158 -0
- package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +51 -0
- package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +45 -0
- package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +56 -0
- package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +15 -0
- package/dist/assets/storefront/src/components/layout/draft-mode-action.ts +8 -0
- package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +54 -0
- package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +29 -0
- package/dist/assets/storefront/src/components/layout/footer.tsx +168 -0
- package/dist/assets/storefront/src/components/layout/navbar/actions.ts +33 -0
- package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +50 -0
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +19 -0
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +53 -0
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +21 -0
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +52 -0
- package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +51 -0
- package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +34 -0
- package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +74 -0
- package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +51 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +5 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +291 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +28 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +147 -0
- package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +39 -0
- package/dist/assets/storefront/src/components/layout/navbar.tsx +117 -0
- package/dist/assets/storefront/src/components/layout/search-input.tsx +71 -0
- package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +58 -0
- package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +31 -0
- package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +47 -0
- package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +14 -0
- package/dist/assets/storefront/src/components/providers/theme-provider.tsx +16 -0
- package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +39 -0
- package/dist/assets/storefront/src/components/shared/catalog-sidebar-skeleton.tsx +21 -0
- package/dist/assets/storefront/src/components/shared/country-select.tsx +83 -0
- package/dist/assets/storefront/src/components/shared/error-state.tsx +16 -0
- package/dist/assets/storefront/src/components/shared/pagination.tsx +119 -0
- package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +36 -0
- package/dist/assets/storefront/src/components/shared/product-grid-skeleton.tsx +26 -0
- package/dist/assets/storefront/src/components/shared/scenario-paused.tsx +80 -0
- package/dist/assets/storefront/src/components/shared/skeletons/cart-skeleton.tsx +48 -0
- package/dist/assets/storefront/src/components/shared/skeletons/navbar-user-skeleton.tsx +9 -0
- package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +7 -0
- package/dist/assets/storefront/src/components/shared/skeletons/search-results-skeleton.tsx +17 -0
- package/dist/assets/storefront/src/components/ui/accordion.tsx +66 -0
- package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +157 -0
- package/dist/assets/storefront/src/components/ui/alert.tsx +66 -0
- package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +11 -0
- package/dist/assets/storefront/src/components/ui/avatar.tsx +53 -0
- package/dist/assets/storefront/src/components/ui/badge.tsx +46 -0
- package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +109 -0
- package/dist/assets/storefront/src/components/ui/button.tsx +58 -0
- package/dist/assets/storefront/src/components/ui/calendar.tsx +213 -0
- package/dist/assets/storefront/src/components/ui/card.tsx +92 -0
- package/dist/assets/storefront/src/components/ui/carousel.tsx +241 -0
- package/dist/assets/storefront/src/components/ui/chart.tsx +357 -0
- package/dist/assets/storefront/src/components/ui/checkbox.tsx +32 -0
- package/dist/assets/storefront/src/components/ui/collapsible.tsx +33 -0
- package/dist/assets/storefront/src/components/ui/command.tsx +184 -0
- package/dist/assets/storefront/src/components/ui/context-menu.tsx +252 -0
- package/dist/assets/storefront/src/components/ui/dialog.tsx +143 -0
- package/dist/assets/storefront/src/components/ui/drawer.tsx +135 -0
- package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +257 -0
- package/dist/assets/storefront/src/components/ui/empty-state.tsx +37 -0
- package/dist/assets/storefront/src/components/ui/field.tsx +244 -0
- package/dist/assets/storefront/src/components/ui/form.tsx +167 -0
- package/dist/assets/storefront/src/components/ui/hover-card.tsx +44 -0
- package/dist/assets/storefront/src/components/ui/input-otp.tsx +77 -0
- package/dist/assets/storefront/src/components/ui/input.tsx +21 -0
- package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +20 -0
- package/dist/assets/storefront/src/components/ui/label.tsx +24 -0
- package/dist/assets/storefront/src/components/ui/menubar.tsx +276 -0
- package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +168 -0
- package/dist/assets/storefront/src/components/ui/pagination.tsx +127 -0
- package/dist/assets/storefront/src/components/ui/popover.tsx +48 -0
- package/dist/assets/storefront/src/components/ui/progress.tsx +31 -0
- package/dist/assets/storefront/src/components/ui/radio-group.tsx +45 -0
- package/dist/assets/storefront/src/components/ui/resizable.tsx +56 -0
- package/dist/assets/storefront/src/components/ui/scroll-area.tsx +58 -0
- package/dist/assets/storefront/src/components/ui/select.tsx +185 -0
- package/dist/assets/storefront/src/components/ui/separator.tsx +28 -0
- package/dist/assets/storefront/src/components/ui/sheet.tsx +139 -0
- package/dist/assets/storefront/src/components/ui/sidebar.tsx +728 -0
- package/dist/assets/storefront/src/components/ui/skeleton.tsx +13 -0
- package/dist/assets/storefront/src/components/ui/slider.tsx +63 -0
- package/dist/assets/storefront/src/components/ui/sonner.tsx +25 -0
- package/dist/assets/storefront/src/components/ui/switch.tsx +31 -0
- package/dist/assets/storefront/src/components/ui/table.tsx +116 -0
- package/dist/assets/storefront/src/components/ui/tabs.tsx +66 -0
- package/dist/assets/storefront/src/components/ui/textarea.tsx +18 -0
- package/dist/assets/storefront/src/components/ui/toggle-group.tsx +73 -0
- package/dist/assets/storefront/src/components/ui/toggle.tsx +47 -0
- package/dist/assets/storefront/src/components/ui/tooltip.tsx +61 -0
- package/dist/assets/storefront/src/config/branding.ts +4 -0
- package/dist/assets/storefront/src/config/scenario-meta.ts +46 -0
- package/dist/assets/storefront/src/config/scenario.ts +313 -0
- package/dist/assets/storefront/src/contexts/auth-context.tsx +35 -0
- package/dist/assets/storefront/src/graphql.ts +14 -0
- package/dist/assets/storefront/src/hooks/use-mobile.ts +19 -0
- package/dist/assets/storefront/src/i18n/locale-utils.ts +33 -0
- package/dist/assets/storefront/src/i18n/locales.ts +18 -0
- package/dist/assets/storefront/src/i18n/navigation.ts +35 -0
- package/dist/assets/storefront/src/i18n/request.ts +19 -0
- package/dist/assets/storefront/src/i18n/routing.ts +19 -0
- package/dist/assets/storefront/src/i18n/server.ts +16 -0
- package/dist/assets/storefront/src/lib/actions/switch-channel.ts +32 -0
- package/dist/assets/storefront/src/lib/actions/switch-currency.ts +25 -0
- package/dist/assets/storefront/src/lib/auth.ts +18 -0
- package/dist/assets/storefront/src/lib/backend-health.ts +38 -0
- package/dist/assets/storefront/src/lib/cart-count-context.tsx +59 -0
- package/dist/assets/storefront/src/lib/cart-guard-utils.ts +10 -0
- package/dist/assets/storefront/src/lib/cart-guard.ts +104 -0
- package/dist/assets/storefront/src/lib/channel-server.ts +28 -0
- package/dist/assets/storefront/src/lib/channel.ts +2 -0
- package/dist/assets/storefront/src/lib/company-context.ts +35 -0
- package/dist/assets/storefront/src/lib/company-permissions-context.tsx +40 -0
- package/dist/assets/storefront/src/lib/currency-server.ts +20 -0
- package/dist/assets/storefront/src/lib/currency.ts +2 -0
- package/dist/assets/storefront/src/lib/format.ts +48 -0
- package/dist/assets/storefront/src/lib/metadata.ts +85 -0
- package/dist/assets/storefront/src/lib/quantity.test.js +20 -0
- package/dist/assets/storefront/src/lib/quantity.ts +20 -0
- package/dist/assets/storefront/src/lib/search-bar-context.tsx +45 -0
- package/dist/assets/storefront/src/lib/search-helpers.ts +69 -0
- package/dist/assets/storefront/src/lib/use-recent-searches.ts +55 -0
- package/dist/assets/storefront/src/lib/utils.ts +6 -0
- package/dist/assets/storefront/src/lib/vendure/actions.ts +96 -0
- package/dist/assets/storefront/src/lib/vendure/api.ts +164 -0
- package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +21 -0
- package/dist/assets/storefront/src/lib/vendure/cached.ts +71 -0
- package/dist/assets/storefront/src/lib/vendure/fragments.ts +213 -0
- package/dist/assets/storefront/src/lib/vendure/instant-search-action.ts +104 -0
- package/dist/assets/storefront/src/lib/vendure/mutations.ts +1136 -0
- package/dist/assets/storefront/src/lib/vendure/queries.ts +1406 -0
- package/dist/assets/storefront/src/middleware.ts +11 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/branding.ts +180 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/hero.tsx +122 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/index.ts +21 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/meta.ts +3 -0
- package/dist/assets/storefront/src/scenarios/default/branding.ts +148 -0
- package/dist/assets/storefront/src/scenarios/default/hero.tsx +107 -0
- package/dist/assets/storefront/src/scenarios/default/index.ts +12 -0
- package/dist/assets/storefront/src/scenarios/default/meta.ts +3 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/auth-gate.tsx +36 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/branding.ts +238 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/cart-items.tsx +359 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/hero.tsx +123 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/index.ts +50 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/meta.ts +9 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/banners.tsx +21 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/bom-basket.tsx +221 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/btn.tsx +38 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/chip.tsx +35 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/config-header.tsx +72 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/field-row.tsx +126 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/info-dot.tsx +38 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/login-notice.tsx +81 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/module-panel.tsx +144 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/quote-dialog.tsx +110 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/schematic.tsx +674 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/why-panel.tsx +66 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-pdp.tsx +43 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-shell.tsx +320 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/data.ts +150 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/types.ts +30 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/styles.css +104 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/shop-by-system.tsx +97 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/decision-tree.ts +261 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/page.tsx +21 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/wizard.tsx +600 -0
- package/dist/assets/storefront/src/schema.graphql.placeholder +5 -0
- package/dist/assets/storefront/tsconfig.json +37 -0
- package/dist/assets/templates/CLAUDE.md.hbs +63 -0
- package/dist/assets/templates/README.md.hbs +53 -0
- package/dist/assets/templates/custom-populate.ts.hbs +28 -0
- package/dist/assets/templates/docker-compose.yml.hbs +29 -0
- package/dist/assets/templates/env.hbs +44 -0
- package/dist/assets/templates/environment.d.ts.hbs +32 -0
- package/dist/assets/templates/gitignore.hbs +7 -0
- package/dist/assets/templates/index.ts.hbs +16 -0
- package/dist/assets/templates/npmrc.hbs +1 -0
- package/dist/assets/templates/populate.ts.hbs +27 -0
- package/dist/assets/templates/root-package.json.hbs +17 -0
- package/dist/assets/templates/server-package.json.hbs +31 -0
- package/dist/assets/templates/tsconfig.dashboard.json.hbs +17 -0
- package/dist/assets/templates/tsconfig.root.json.hbs +16 -0
- package/dist/assets/templates/tsconfig.server.json.hbs +20 -0
- package/dist/assets/templates/vendure-config.ts.hbs +80 -0
- package/dist/assets/templates/vite.config.mts.hbs +27 -0
- package/dist/bin/run.d.ts +2 -0
- package/dist/bin/run.js +79 -0
- package/dist/bin/run.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +154 -0
- package/dist/cli.js.map +1 -0
- package/dist/git-init.d.ts +4 -0
- package/dist/git-init.js +60 -0
- package/dist/git-init.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-registry.d.ts +10 -0
- package/dist/plugin-registry.js +485 -0
- package/dist/plugin-registry.js.map +1 -0
- package/dist/scaffolder.d.ts +10 -0
- package/dist/scaffolder.js +218 -0
- package/dist/scaffolder.js.map +1 -0
- package/dist/storefront-copier.d.ts +6 -0
- package/dist/storefront-copier.js +68 -0
- package/dist/storefront-copier.js.map +1 -0
- package/dist/template-renderer.d.ts +30 -0
- package/dist/template-renderer.js +177 -0
- package/dist/template-renderer.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TEMPLATE_FILES = void 0;
|
|
37
|
+
exports.scaffold = scaffold;
|
|
38
|
+
const fs = __importStar(require("fs-extra"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const p = __importStar(require("@clack/prompts"));
|
|
41
|
+
const plugin_registry_1 = require("./plugin-registry");
|
|
42
|
+
const template_renderer_1 = require("./template-renderer");
|
|
43
|
+
const storefront_copier_1 = require("./storefront-copier");
|
|
44
|
+
const git_init_1 = require("./git-init");
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const util_1 = require("util");
|
|
47
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
48
|
+
/** Template-to-output mapping used by the scaffolder. */
|
|
49
|
+
exports.TEMPLATE_FILES = [
|
|
50
|
+
{ template: 'vendure-config.ts.hbs', output: 'server/src/vendure-config.ts' },
|
|
51
|
+
{ template: 'populate.ts.hbs', output: 'server/src/populate.ts' },
|
|
52
|
+
{ template: 'custom-populate.ts.hbs', output: 'server/src/custom-populate.ts' },
|
|
53
|
+
{ template: 'index.ts.hbs', output: 'server/src/index.ts' },
|
|
54
|
+
{ template: 'server-package.json.hbs', output: 'server/package.json' },
|
|
55
|
+
{ template: 'root-package.json.hbs', output: 'package.json' },
|
|
56
|
+
{ template: 'env.hbs', output: '.env' },
|
|
57
|
+
{ template: 'docker-compose.yml.hbs', output: 'docker-compose.yml' },
|
|
58
|
+
{ template: 'CLAUDE.md.hbs', output: 'CLAUDE.md' },
|
|
59
|
+
{ template: 'README.md.hbs', output: 'README.md' },
|
|
60
|
+
{ template: 'tsconfig.root.json.hbs', output: 'tsconfig.json' },
|
|
61
|
+
{ template: 'tsconfig.server.json.hbs', output: 'server/tsconfig.json' },
|
|
62
|
+
{ template: 'vite.config.mts.hbs', output: 'server/vite.config.mts' },
|
|
63
|
+
{ template: 'tsconfig.dashboard.json.hbs', output: 'server/tsconfig.dashboard.json' },
|
|
64
|
+
{ template: 'environment.d.ts.hbs', output: 'server/src/environment.d.ts' },
|
|
65
|
+
{ template: 'gitignore.hbs', output: '.gitignore' },
|
|
66
|
+
{ template: 'npmrc.hbs', output: '.npmrc' },
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* Scaffold a complete Vendure demo project.
|
|
70
|
+
*/
|
|
71
|
+
async function scaffold(options) {
|
|
72
|
+
var _a;
|
|
73
|
+
const { projectName, companyName, selectedPlugins, includeStorefront, createGithubRepo, githubOrg, skipInstall, skipGit, dryRun } = options;
|
|
74
|
+
const projectDir = path.resolve(process.cwd(), projectName);
|
|
75
|
+
// 1. Resolve plugin dependencies
|
|
76
|
+
const resolvedPluginKeys = (0, plugin_registry_1.resolvePluginDependencies)(selectedPlugins);
|
|
77
|
+
const autoIncluded = resolvedPluginKeys.filter((k) => !selectedPlugins.includes(k));
|
|
78
|
+
if (autoIncluded.length > 0) {
|
|
79
|
+
p.log.warn(`Auto-including dependencies: ${autoIncluded.map((k) => { var _a, _b; return (_b = (_a = (0, plugin_registry_1.getPlugin)(k)) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : k; }).join(', ')}`);
|
|
80
|
+
}
|
|
81
|
+
// 2. Create project directory (abort if it already has content)
|
|
82
|
+
if (await fs.pathExists(projectDir)) {
|
|
83
|
+
const entries = await fs.readdir(projectDir);
|
|
84
|
+
if (entries.length > 0) {
|
|
85
|
+
p.log.error(`Directory "${projectDir}" already exists and is not empty.`);
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Dry-run: print summary and exit without writing anything
|
|
90
|
+
if (dryRun) {
|
|
91
|
+
const resolvedPlugins = resolvedPluginKeys.map((k) => { var _a, _b; return (_b = (_a = (0, plugin_registry_1.getPlugin)(k)) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : k; });
|
|
92
|
+
const fileList = exports.TEMPLATE_FILES.map((f) => ` ${f.output}`).join('\n');
|
|
93
|
+
const demoDataFiles = [
|
|
94
|
+
' server/src/demo-data/products.csv',
|
|
95
|
+
' server/src/demo-data/initial-data.json',
|
|
96
|
+
' server/src/demo-data/images/.gitkeep',
|
|
97
|
+
].join('\n');
|
|
98
|
+
const summary = [
|
|
99
|
+
`Project: ${projectName} → ${projectDir}`,
|
|
100
|
+
'',
|
|
101
|
+
'Files to generate:',
|
|
102
|
+
fileList,
|
|
103
|
+
demoDataFiles,
|
|
104
|
+
' server/src/migrations/ (empty dir)',
|
|
105
|
+
'',
|
|
106
|
+
`Plugins (${resolvedPlugins.length}):`,
|
|
107
|
+
` ${resolvedPlugins.join(', ')}`,
|
|
108
|
+
'',
|
|
109
|
+
`Storefront: ${includeStorefront ? 'yes' : 'no'}`,
|
|
110
|
+
`npm install: ${skipInstall ? 'no' : 'yes'}`,
|
|
111
|
+
`Git init: ${skipGit ? 'no' : 'yes'}`,
|
|
112
|
+
`GitHub repo: ${createGithubRepo ? 'yes' : 'no'}`,
|
|
113
|
+
].join('\n');
|
|
114
|
+
p.note(summary, 'Dry run');
|
|
115
|
+
p.outro('Dry run complete — no files written.');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const s = p.spinner();
|
|
119
|
+
s.start('Creating project directory...');
|
|
120
|
+
await fs.ensureDir(projectDir);
|
|
121
|
+
// 3. Build template context
|
|
122
|
+
const { context, hbs } = (0, template_renderer_1.buildTemplateContext)(projectName, companyName, resolvedPluginKeys, includeStorefront);
|
|
123
|
+
// 4. Render and write server files
|
|
124
|
+
s.message('Generating server files...');
|
|
125
|
+
const serverDir = path.join(projectDir, 'server');
|
|
126
|
+
const serverSrcDir = path.join(serverDir, 'src');
|
|
127
|
+
await fs.ensureDir(serverSrcDir);
|
|
128
|
+
for (const { template, output } of exports.TEMPLATE_FILES) {
|
|
129
|
+
const templatePath = (0, template_renderer_1.getTemplatePath)(template);
|
|
130
|
+
const rendered = (0, template_renderer_1.renderTemplate)(templatePath, context, hbs);
|
|
131
|
+
const outputPath = path.join(projectDir, output);
|
|
132
|
+
await fs.ensureDir(path.dirname(outputPath));
|
|
133
|
+
await fs.writeFile(outputPath, rendered);
|
|
134
|
+
}
|
|
135
|
+
// 5. Create demo-data skeleton
|
|
136
|
+
s.message('Creating demo data skeleton...');
|
|
137
|
+
await createDemoData(serverSrcDir);
|
|
138
|
+
// 6. Create migrations directory
|
|
139
|
+
await fs.ensureDir(path.join(serverSrcDir, 'migrations'));
|
|
140
|
+
// 7. Copy storefront (if selected)
|
|
141
|
+
if (includeStorefront) {
|
|
142
|
+
s.message('Copying storefront...');
|
|
143
|
+
try {
|
|
144
|
+
await (0, storefront_copier_1.copyStorefront)(projectDir);
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
s.stop('Storefront copy failed.');
|
|
148
|
+
p.log.warn('Storefront copy failed — you can set it up manually later.');
|
|
149
|
+
s.start('Continuing...');
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// 8. Install dependencies
|
|
153
|
+
if (!skipInstall) {
|
|
154
|
+
s.message('Installing dependencies (this may take a few minutes)...');
|
|
155
|
+
try {
|
|
156
|
+
await execAsync('npm install', { cwd: projectDir });
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
s.stop('npm install failed.');
|
|
160
|
+
const stderr = err instanceof Error && 'stderr' in err
|
|
161
|
+
? (_a = err.stderr) === null || _a === void 0 ? void 0 : _a.trim()
|
|
162
|
+
: undefined;
|
|
163
|
+
if (stderr) {
|
|
164
|
+
p.log.error(stderr.split('\n').slice(-5).join('\n'));
|
|
165
|
+
}
|
|
166
|
+
p.log.warn('npm install failed — run `npm install` manually in the project directory.');
|
|
167
|
+
s.start('Continuing...');
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// 9. Git init + GitHub repo
|
|
171
|
+
if (!skipGit) {
|
|
172
|
+
s.message('Initializing git...');
|
|
173
|
+
try {
|
|
174
|
+
await (0, git_init_1.initGit)(projectDir, createGithubRepo, githubOrg);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
s.stop('Git setup had issues.');
|
|
178
|
+
p.log.warn('Git/GitHub setup had issues. Make sure the gh CLI is installed and authenticated.');
|
|
179
|
+
s.start('Continuing...');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
s.stop(`Project "${projectName}" created successfully!`);
|
|
183
|
+
// 10. Print next steps
|
|
184
|
+
const steps = [
|
|
185
|
+
`cd ${projectName}`,
|
|
186
|
+
'docker compose up -d',
|
|
187
|
+
'npm run populate',
|
|
188
|
+
'npm run dev',
|
|
189
|
+
'',
|
|
190
|
+
`Dashboard: http://localhost:3500/dashboard`,
|
|
191
|
+
includeStorefront ? `Storefront: http://localhost:3001` : '',
|
|
192
|
+
].filter(Boolean).join('\n');
|
|
193
|
+
p.note(steps, 'Next steps');
|
|
194
|
+
p.outro('Happy building!');
|
|
195
|
+
}
|
|
196
|
+
function getScenarioDefaultAssetsPath() {
|
|
197
|
+
const candidates = [
|
|
198
|
+
// In dev (monorepo): resolve relative to this file's source location
|
|
199
|
+
path.join(__dirname, '..', '..', 'scenario-default', 'assets'),
|
|
200
|
+
// In published package: bundled during build
|
|
201
|
+
path.join(__dirname, 'assets', 'demo-data'),
|
|
202
|
+
];
|
|
203
|
+
for (const candidate of candidates) {
|
|
204
|
+
if (fs.pathExistsSync(candidate)) {
|
|
205
|
+
return candidate;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
throw new Error('Could not find scenario-default assets. Tried:\n' + candidates.map(p => ` - ${p}`).join('\n'));
|
|
209
|
+
}
|
|
210
|
+
async function createDemoData(serverSrcDir) {
|
|
211
|
+
const assetsDir = getScenarioDefaultAssetsPath();
|
|
212
|
+
const demoDataDir = path.join(serverSrcDir, 'demo-data');
|
|
213
|
+
await fs.ensureDir(demoDataDir);
|
|
214
|
+
await fs.copy(path.join(assetsDir, 'initial-data.json'), path.join(demoDataDir, 'initial-data.json'));
|
|
215
|
+
await fs.copy(path.join(assetsDir, 'products.csv'), path.join(demoDataDir, 'products.csv'));
|
|
216
|
+
await fs.copy(path.join(assetsDir, 'images'), path.join(demoDataDir, 'images'));
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=scaffolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffolder.js","sourceRoot":"","sources":["../src/scaffolder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,4BA8IC;AAnLD,6CAA+B;AAC/B,2CAA6B;AAC7B,kDAAoC;AAEpC,uDAAyE;AACzE,2DAA0G;AAC1G,2DAAqD;AACrD,yCAAqC;AACrC,iDAAqC;AACrC,+BAAiC;AAEjC,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC,yDAAyD;AAC5C,QAAA,cAAc,GAAwD;IAC/E,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,EAAE,8BAA8B,EAAE;IAC7E,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,wBAAwB,EAAE;IACjE,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,+BAA+B,EAAE;IAC/E,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,qBAAqB,EAAE;IAC3D,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,EAAE,qBAAqB,EAAE;IACtE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,EAAE,cAAc,EAAE;IAC7D,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;IACvC,EAAE,QAA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W,EAAE,cAAc,CAAC,CAAC,CAAC;IAC5F,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy the bundled storefront from dist/assets/storefront/ into the scaffolded project.
|
|
3
|
+
* The build-time script (tools/scripts/copy-storefront.js) already handles exclusions
|
|
4
|
+
* and next.config.ts dotenv patching, so this is a straight copy.
|
|
5
|
+
*/
|
|
6
|
+
export declare function copyStorefront(projectDir: string): Promise<void>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.copyStorefront = copyStorefront;
|
|
37
|
+
const fs = __importStar(require("fs-extra"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
/**
|
|
40
|
+
* Copy the bundled storefront from dist/assets/storefront/ into the scaffolded project.
|
|
41
|
+
* The build-time script (tools/scripts/copy-storefront.js) already handles exclusions
|
|
42
|
+
* and next.config.ts dotenv patching, so this is a straight copy.
|
|
43
|
+
*/
|
|
44
|
+
async function copyStorefront(projectDir) {
|
|
45
|
+
const bundledStorefrontPath = getBundledStorefrontPath();
|
|
46
|
+
const destPath = path.join(projectDir, 'storefront');
|
|
47
|
+
await fs.copy(bundledStorefrontPath, destPath);
|
|
48
|
+
// Remove the placeholder file left by the build script
|
|
49
|
+
const placeholderPath = path.join(destPath, 'src/schema.graphql.placeholder');
|
|
50
|
+
if (await fs.pathExists(placeholderPath)) {
|
|
51
|
+
await fs.remove(placeholderPath);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function getBundledStorefrontPath() {
|
|
55
|
+
const candidates = [
|
|
56
|
+
// When running from dist/ (installed package): dist/assets/storefront/
|
|
57
|
+
path.join(__dirname, 'assets', 'storefront'),
|
|
58
|
+
// When running from src/ during development/tests: assets/storefront/
|
|
59
|
+
path.join(__dirname, '..', 'assets', 'storefront'),
|
|
60
|
+
];
|
|
61
|
+
for (const candidate of candidates) {
|
|
62
|
+
if (fs.existsSync(candidate)) {
|
|
63
|
+
return candidate;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
throw new Error('Bundled storefront not found. The package may not have been built correctly.');
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=storefront-copier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-copier.js","sourceRoot":"","sources":["../src/storefront-copier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wCAWC;AAnBD,6CAA+B;AAC/B,2CAA6B;AAE7B;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAAC,UAAkB;IACnD,MAAM,qBAAqB,GAAG,wBAAwB,EAAE,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAErD,MAAM,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IAE/C,uDAAuD;IACvD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,gCAAgC,CAAC,CAAC;IAC9E,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACvC,MAAM,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACrC,CAAC;AACL,CAAC;AAED,SAAS,wBAAwB;IAC7B,MAAM,UAAU,GAAG;QACf,uEAAuE;QACvE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC;QAC5C,sEAAsE;QACtE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC;KACrD,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CACX,8EAA8E,CACjF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Handlebars from 'handlebars';
|
|
2
|
+
import { PluginDefinition } from './types';
|
|
3
|
+
export interface TemplateContext {
|
|
4
|
+
projectName: string;
|
|
5
|
+
companyName: string;
|
|
6
|
+
resolvedPluginKeys: string[];
|
|
7
|
+
resolvedPlugins: PluginDefinition[];
|
|
8
|
+
includeStorefront: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TemplateContextResult {
|
|
11
|
+
context: TemplateContext;
|
|
12
|
+
hbs: typeof Handlebars;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildTemplateContext(projectName: string, companyName: string, resolvedPluginKeys: string[], includeStorefront: boolean): TemplateContextResult;
|
|
15
|
+
/**
|
|
16
|
+
* Render a Handlebars template file with the given context.
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderTemplate(templatePath: string, context: TemplateContext, hbs: typeof Handlebars): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get the path to a bundled asset file.
|
|
21
|
+
* At runtime these live in dist/assets/.
|
|
22
|
+
* During development they live in assets/.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getAssetPath(assetName: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the path to a bundled template file.
|
|
27
|
+
* At runtime these live in dist/assets/templates/.
|
|
28
|
+
* During development they live in assets/templates/.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getTemplatePath(templateName: string): string;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.buildTemplateContext = buildTemplateContext;
|
|
40
|
+
exports.renderTemplate = renderTemplate;
|
|
41
|
+
exports.getAssetPath = getAssetPath;
|
|
42
|
+
exports.getTemplatePath = getTemplatePath;
|
|
43
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
44
|
+
const fs = __importStar(require("fs"));
|
|
45
|
+
const path = __importStar(require("path"));
|
|
46
|
+
const plugin_registry_1 = require("./plugin-registry");
|
|
47
|
+
function createHandlebarsInstance(resolvedPluginKeys) {
|
|
48
|
+
const hbs = handlebars_1.default.create();
|
|
49
|
+
const resolvedSet = new Set(resolvedPluginKeys);
|
|
50
|
+
hbs.registerHelper('ifPlugin', function (pluginKey, options) {
|
|
51
|
+
if (resolvedSet.has(pluginKey)) {
|
|
52
|
+
return options.fn(this);
|
|
53
|
+
}
|
|
54
|
+
return options.inverse(this);
|
|
55
|
+
});
|
|
56
|
+
hbs.registerHelper('pluginImports', function () {
|
|
57
|
+
const lines = [];
|
|
58
|
+
for (const key of resolvedPluginKeys) {
|
|
59
|
+
const plugin = (0, plugin_registry_1.getPlugin)(key);
|
|
60
|
+
if (!plugin || plugin.imports.length === 0)
|
|
61
|
+
continue;
|
|
62
|
+
const names = plugin.imports.join(', ');
|
|
63
|
+
lines.push(`import { ${names} } from '${plugin.packageName}';`);
|
|
64
|
+
}
|
|
65
|
+
return new hbs.SafeString(lines.join('\n'));
|
|
66
|
+
});
|
|
67
|
+
hbs.registerHelper('pluginConfigBlocks', function () {
|
|
68
|
+
const blocks = [];
|
|
69
|
+
for (const key of resolvedPluginKeys) {
|
|
70
|
+
const plugin = (0, plugin_registry_1.getPlugin)(key);
|
|
71
|
+
if (!plugin)
|
|
72
|
+
continue;
|
|
73
|
+
// Compile configBlock through Handlebars so it can use {{#ifPlugin}} guards
|
|
74
|
+
const compiled = hbs.compile(plugin.configBlock, { noEscape: true });
|
|
75
|
+
blocks.push(` ${compiled({})},`);
|
|
76
|
+
}
|
|
77
|
+
return new hbs.SafeString(blocks.join('\n'));
|
|
78
|
+
});
|
|
79
|
+
hbs.registerHelper('pluginDependencies', function () {
|
|
80
|
+
const lines = [];
|
|
81
|
+
for (const key of resolvedPluginKeys) {
|
|
82
|
+
const plugin = (0, plugin_registry_1.getPlugin)(key);
|
|
83
|
+
if (!plugin || plugin.internal)
|
|
84
|
+
continue;
|
|
85
|
+
lines.push(` "${plugin.packageName}": "nightly"`);
|
|
86
|
+
}
|
|
87
|
+
if (lines.length === 0) {
|
|
88
|
+
return new hbs.SafeString('');
|
|
89
|
+
}
|
|
90
|
+
return new hbs.SafeString(',\n' + lines.join(',\n'));
|
|
91
|
+
});
|
|
92
|
+
hbs.registerHelper('platformPluginImports', function () {
|
|
93
|
+
const lines = [`import { VendurePlatform } from '@vendure-platform/platform';`];
|
|
94
|
+
for (const key of resolvedPluginKeys) {
|
|
95
|
+
const plugin = (0, plugin_registry_1.getPlugin)(key);
|
|
96
|
+
if (!(plugin === null || plugin === void 0 ? void 0 : plugin.platformImports))
|
|
97
|
+
continue;
|
|
98
|
+
lines.push(...plugin.platformImports);
|
|
99
|
+
}
|
|
100
|
+
return new hbs.SafeString(lines.join('\n'));
|
|
101
|
+
});
|
|
102
|
+
hbs.registerHelper('platformPluginOptions', function () {
|
|
103
|
+
const blocks = [];
|
|
104
|
+
for (const key of resolvedPluginKeys) {
|
|
105
|
+
const plugin = (0, plugin_registry_1.getPlugin)(key);
|
|
106
|
+
if (!plugin || !plugin.platformOptionsBlock)
|
|
107
|
+
continue;
|
|
108
|
+
blocks.push(` ${plugin.platformOptionsBlock},`);
|
|
109
|
+
}
|
|
110
|
+
return new hbs.SafeString(blocks.join('\n'));
|
|
111
|
+
});
|
|
112
|
+
return hbs;
|
|
113
|
+
}
|
|
114
|
+
function buildTemplateContext(projectName, companyName, resolvedPluginKeys, includeStorefront) {
|
|
115
|
+
const resolvedPlugins = resolvedPluginKeys
|
|
116
|
+
.map((key) => (0, plugin_registry_1.getPlugin)(key))
|
|
117
|
+
.filter((p) => p != null);
|
|
118
|
+
return {
|
|
119
|
+
context: {
|
|
120
|
+
projectName,
|
|
121
|
+
companyName,
|
|
122
|
+
resolvedPluginKeys,
|
|
123
|
+
resolvedPlugins,
|
|
124
|
+
includeStorefront,
|
|
125
|
+
},
|
|
126
|
+
hbs: createHandlebarsInstance(resolvedPluginKeys),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Render a Handlebars template file with the given context.
|
|
131
|
+
*/
|
|
132
|
+
function renderTemplate(templatePath, context, hbs) {
|
|
133
|
+
const source = fs.readFileSync(templatePath, 'utf8');
|
|
134
|
+
const template = hbs.compile(source, { noEscape: true });
|
|
135
|
+
return template(context);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get the path to a bundled asset file.
|
|
139
|
+
* At runtime these live in dist/assets/.
|
|
140
|
+
* During development they live in assets/.
|
|
141
|
+
*/
|
|
142
|
+
function getAssetPath(assetName) {
|
|
143
|
+
const candidates = [
|
|
144
|
+
path.join(__dirname, 'assets', assetName),
|
|
145
|
+
path.join(__dirname, '..', 'assets', assetName),
|
|
146
|
+
];
|
|
147
|
+
for (const candidate of candidates) {
|
|
148
|
+
if (fs.existsSync(candidate)) {
|
|
149
|
+
return candidate;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
throw new Error(`Asset not found: ${assetName}\n` +
|
|
153
|
+
` __dirname: ${__dirname}\n` +
|
|
154
|
+
` Searched:\n${candidates.map((c) => ` - ${c} (exists: ${fs.existsSync(path.dirname(c))})`).join('\n')}`);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get the path to a bundled template file.
|
|
158
|
+
* At runtime these live in dist/assets/templates/.
|
|
159
|
+
* During development they live in assets/templates/.
|
|
160
|
+
*/
|
|
161
|
+
function getTemplatePath(templateName) {
|
|
162
|
+
const candidates = [
|
|
163
|
+
// When running from dist/ (installed package): dist/assets/templates/
|
|
164
|
+
path.join(__dirname, 'assets', 'templates', templateName),
|
|
165
|
+
// When running from src/ during development/tests: assets/templates/
|
|
166
|
+
path.join(__dirname, '..', 'assets', 'templates', templateName),
|
|
167
|
+
];
|
|
168
|
+
for (const candidate of candidates) {
|
|
169
|
+
if (fs.existsSync(candidate)) {
|
|
170
|
+
return candidate;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
throw new Error(`Template not found: ${templateName}\n` +
|
|
174
|
+
` __dirname: ${__dirname}\n` +
|
|
175
|
+
` Searched:\n${candidates.map((c) => ` - ${c} (exists: ${fs.existsSync(path.dirname(c))})`).join('\n')}`);
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=template-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-renderer.js","sourceRoot":"","sources":["../src/template-renderer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,oDAoBC;AAKD,wCAIC;AAOD,oCAeC;AAOD,0CAiBC;AApKD,4DAAoC;AACpC,uCAAyB;AACzB,2CAA6B;AAE7B,uDAA8C;AAe9C,SAAS,wBAAwB,CAAC,kBAA4B;IAC1D,MAAM,GAAG,GAAG,oBAAU,CAAC,MAAM,EAAE,CAAC;IAChC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAEhD,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,UAAyB,SAAiB,EAAE,OAAiC;QACxG,IAAI,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,OAAO,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,cAAc,CAAC,eAAe,EAAE;QAChC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACnC,MAAM,MAAM,GAAG,IAAA,2BAAS,EAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACrD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxC,KAAK,CAAC,IAAI,C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AC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACnH,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,YAAoB;IAChD,MAAM,UAAU,GAAG;QACf,sEAAsE;QACtE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC;QACzD,qEAAqE;QACrE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC;KAClE,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CACX,uBAAuB,YAAY,IAAI;QACnC,gBAAgB,SAAS,IAAI;QAC7B,gBAAgB,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACnH,CAAC;AACN,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface ScaffoldOptions {
|
|
2
|
+
projectName: string;
|
|
3
|
+
companyName: string;
|
|
4
|
+
selectedPlugins: string[];
|
|
5
|
+
includeStorefront: boolean;
|
|
6
|
+
createGithubRepo: boolean;
|
|
7
|
+
githubOrg?: string;
|
|
8
|
+
skipInstall?: boolean;
|
|
9
|
+
skipGit?: boolean;
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CliFlags {
|
|
13
|
+
plugins?: string;
|
|
14
|
+
company?: string;
|
|
15
|
+
storefront?: boolean;
|
|
16
|
+
github?: boolean;
|
|
17
|
+
githubOrg?: string;
|
|
18
|
+
install?: boolean;
|
|
19
|
+
git?: boolean;
|
|
20
|
+
dryRun?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface PluginDefinition {
|
|
23
|
+
/** Unique key matching the lib folder name */
|
|
24
|
+
key: string;
|
|
25
|
+
/** npm package name */
|
|
26
|
+
packageName: string;
|
|
27
|
+
/** Human-readable name */
|
|
28
|
+
displayName: string;
|
|
29
|
+
/** Grouping for the multi-select prompt */
|
|
30
|
+
category: 'b2b' | 'commerce' | 'platform' | 'search';
|
|
31
|
+
/** Other plugin keys this plugin depends on */
|
|
32
|
+
requires: string[];
|
|
33
|
+
/** Named imports from the package for vendure-config.ts (legacy, individual plugin mode) */
|
|
34
|
+
imports: string[];
|
|
35
|
+
/** Environment variables this plugin needs */
|
|
36
|
+
envVars: EnvVar[];
|
|
37
|
+
/** The .init({...}) or plugin expression code for vendure-config.ts (legacy, individual plugin mode) */
|
|
38
|
+
configBlock: string;
|
|
39
|
+
/**
|
|
40
|
+
* The options fragment emitted under this plugin's key in `VendurePlatform.init({...})`.
|
|
41
|
+
* Compiled through Handlebars so it can use `{{#ifPlugin}}` guards.
|
|
42
|
+
*/
|
|
43
|
+
platformOptionsBlock: string;
|
|
44
|
+
/**
|
|
45
|
+
* Additional imports needed when this plugin is selected in VendurePlatform mode.
|
|
46
|
+
* These are imports beyond `VendurePlatform` itself (e.g. strategy classes the user
|
|
47
|
+
* references in their options).
|
|
48
|
+
*/
|
|
49
|
+
platformImports?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* If true, this plugin is not shown in the interactive plugin selection prompt.
|
|
52
|
+
* Used for internal/infrastructure plugins like `platform`.
|
|
53
|
+
*/
|
|
54
|
+
internal?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface EnvVar {
|
|
57
|
+
name: string;
|
|
58
|
+
defaultValue: string;
|
|
59
|
+
comment?: string;
|
|
60
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vendure-platform/create",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI tool to scaffold a Vendure demo project with Vendure Platform plugins",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/vendurehq/vendure-platform.git",
|
|
9
|
+
"directory": "libs/create"
|
|
10
|
+
},
|
|
11
|
+
"type": "commonjs",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"bin": {
|
|
15
|
+
"create-vendure-platform": "./dist/bin/run.js"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/**/*",
|
|
26
|
+
"!**/*.tsbuildinfo",
|
|
27
|
+
"!**/*.spec.*",
|
|
28
|
+
"!**/*.test.*",
|
|
29
|
+
"dist/assets/**"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "restricted"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@clack/prompts": "^0.10.0",
|
|
39
|
+
"commander": "^13.1.0",
|
|
40
|
+
"fs-extra": "^11.3.0",
|
|
41
|
+
"handlebars": "^4.7.8",
|
|
42
|
+
"tslib": "^2.3.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/fs-extra": "^11.0.4",
|
|
46
|
+
"vitest": "^3.2.4"
|
|
47
|
+
}
|
|
48
|
+
}
|