@vendure-platform/create 0.5.0 → 1.0.0-major.202609091053.0.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/CHANGELOG.md +4 -0
- package/README.md +53 -41
- package/dist/add-to-existing.d.ts +19 -13
- package/dist/add-to-existing.js +1 -1
- package/dist/assets/demo-data/assets/branding/logo.svg +4 -0
- package/dist/assets/demo-data/assets/images/absorbent-pad.webp +0 -0
- package/dist/assets/demo-data/assets/images/adjustable-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/anchor-bolt.webp +0 -0
- package/dist/assets/demo-data/assets/images/angle-grinder.webp +0 -0
- package/dist/assets/demo-data/assets/images/barrier-tape.webp +0 -0
- package/dist/assets/demo-data/assets/images/bench-grinder.webp +0 -0
- package/dist/assets/demo-data/assets/images/bracket.webp +0 -0
- package/dist/assets/demo-data/assets/images/broom.webp +0 -0
- package/dist/assets/demo-data/assets/images/bucket.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-gland.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-tie.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-tray.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-base-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-cowl-bird-guard.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-cowl-open.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-storm-collar.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-wall-bracket.webp +0 -0
- package/dist/assets/demo-data/assets/images/circular-saw.webp +0 -0
- package/dist/assets/demo-data/assets/images/cleaning-spray.webp +0 -0
- package/dist/assets/demo-data/assets/images/conduit.webp +0 -0
- package/dist/assets/demo-data/assets/images/cordless-drill.webp +0 -0
- package/dist/assets/demo-data/assets/images/drill-bits.webp +0 -0
- package/dist/assets/demo-data/assets/images/dust-mask.webp +0 -0
- package/dist/assets/demo-data/assets/images/ear-defenders.webp +0 -0
- package/dist/assets/demo-data/assets/images/ear-plugs.webp +0 -0
- package/dist/assets/demo-data/assets/images/extension-lead.webp +0 -0
- package/dist/assets/demo-data/assets/images/eye-wash-station.webp +0 -0
- package/dist/assets/demo-data/assets/images/face-shield.webp +0 -0
- package/dist/assets/demo-data/assets/images/file-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/first-aid-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/floor-sign.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-bend-45.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-bend-90.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-1000mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-250mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-500mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/fuse.webp +0 -0
- package/dist/assets/demo-data/assets/images/glove-dispenser.webp +0 -0
- package/dist/assets/demo-data/assets/images/grinding-disc.webp +0 -0
- package/dist/assets/demo-data/assets/images/hacksaw.webp +0 -0
- package/dist/assets/demo-data/assets/images/hammer.webp +0 -0
- package/dist/assets/demo-data/assets/images/hand-sanitiser.webp +0 -0
- package/dist/assets/demo-data/assets/images/head-torch.webp +0 -0
- package/dist/assets/demo-data/assets/images/heat-gun.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-bolt.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-key-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-nut.webp +0 -0
- package/dist/assets/demo-data/assets/images/hi-vis-jacket.webp +0 -0
- package/dist/assets/demo-data/assets/images/hi-vis-vest.webp +0 -0
- package/dist/assets/demo-data/assets/images/hose-clamp.webp +0 -0
- package/dist/assets/demo-data/assets/images/impact-driver.webp +0 -0
- package/dist/assets/demo-data/assets/images/jigsaw.webp +0 -0
- package/dist/assets/demo-data/assets/images/junction-box.webp +0 -0
- package/dist/assets/demo-data/assets/images/knee-pads.webp +0 -0
- package/dist/assets/demo-data/assets/images/machine-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/made-to-order-configurable-chimney.webp +0 -0
- package/dist/assets/demo-data/assets/images/mallet.webp +0 -0
- package/dist/assets/demo-data/assets/images/mcb.webp +0 -0
- package/dist/assets/demo-data/assets/images/mop.webp +0 -0
- package/dist/assets/demo-data/assets/images/paper-towels.webp +0 -0
- package/dist/assets/demo-data/assets/images/pipe-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/pliers-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/pry-bar.webp +0 -0
- package/dist/assets/demo-data/assets/images/rcd.webp +0 -0
- package/dist/assets/demo-data/assets/images/reciprocating-saw.webp +0 -0
- package/dist/assets/demo-data/assets/images/rivet.webp +0 -0
- package/dist/assets/demo-data/assets/images/roof-flashing-high-pitch.webp +0 -0
- package/dist/assets/demo-data/assets/images/roof-flashing-low-pitch.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-boots.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-glasses.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-harness.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-helmet.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-sign.webp +0 -0
- package/dist/assets/demo-data/assets/images/sanding-disc.webp +0 -0
- package/dist/assets/demo-data/assets/images/saw-blade.webp +0 -0
- package/dist/assets/demo-data/assets/images/screwdriver-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/screwdriver.webp +0 -0
- package/dist/assets/demo-data/assets/images/self-tapping-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/socket-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/socket.webp +0 -0
- package/dist/assets/demo-data/assets/images/spanner-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/spanner.webp +0 -0
- package/dist/assets/demo-data/assets/images/spill-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/spirit-level.webp +0 -0
- package/dist/assets/demo-data/assets/images/switch.webp +0 -0
- package/dist/assets/demo-data/assets/images/tape-measure.webp +0 -0
- package/dist/assets/demo-data/assets/images/terminal-block.webp +0 -0
- package/dist/assets/demo-data/assets/images/threaded-rod.webp +0 -0
- package/dist/assets/demo-data/assets/images/torque-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/utility-knife.webp +0 -0
- package/dist/assets/demo-data/assets/images/wall-pass-sleeve.webp +0 -0
- package/dist/assets/demo-data/assets/images/wall-plug.webp +0 -0
- package/dist/assets/demo-data/assets/images/washer.webp +0 -0
- package/dist/assets/demo-data/assets/images/waste-bin.webp +0 -0
- package/dist/assets/demo-data/assets/images/wire-connector.webp +0 -0
- package/dist/assets/demo-data/assets/images/wire-cutters.webp +0 -0
- package/dist/assets/demo-data/assets/images/wood-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/work-gloves.webp +0 -0
- package/dist/assets/demo-data/assets/images/work-light.webp +0 -0
- package/dist/assets/demo-data/assets/initial-data.json +667 -0
- package/dist/assets/demo-data/assets/products.csv +779 -0
- package/dist/assets/demo-data/initial-data.json +663 -663
- package/dist/assets/storefront/components.json +20 -20
- package/dist/assets/storefront/eslint.config.mjs +10 -10
- package/dist/assets/storefront/graphql.config.yml +1 -1
- package/dist/assets/storefront/next-env.d.ts +2 -1
- package/dist/assets/storefront/next.config.ts +19 -17
- package/dist/assets/storefront/package.json +3 -2
- package/dist/assets/storefront/postcss.config.mjs +1 -1
- package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +17 -21
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +64 -42
- package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +1 -5
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +69 -65
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +64 -38
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +24 -27
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +11 -9
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +4 -4
- package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +1 -1
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +8 -13
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +11 -14
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +30 -33
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +6 -6
- package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +30 -45
- package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +166 -159
- package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +35 -26
- package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +1 -3
- package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +18 -18
- package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +5 -8
- package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +79 -69
- package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +10 -11
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +6 -15
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +57 -49
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +23 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +30 -30
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +20 -29
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +32 -37
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +32 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +26 -24
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +7 -4
- package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +11 -21
- package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +25 -28
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +26 -24
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +5 -7
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +24 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +11 -26
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +6 -10
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +18 -16
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +74 -67
- package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +16 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +27 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +27 -19
- package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +34 -29
- package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +35 -38
- package/dist/assets/storefront/src/app/[locale]/account/error.tsx +1 -3
- package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +16 -22
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +151 -103
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +6 -7
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +22 -48
- package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +8 -8
- package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +101 -61
- package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +32 -23
- package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +6 -16
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +7 -17
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +6 -16
- package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +12 -18
- package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +17 -15
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +2 -6
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +18 -15
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +5 -6
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +10 -2
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +24 -26
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +19 -10
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +3 -8
- package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +93 -62
- package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +38 -45
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +6 -6
- package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +92 -59
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +11 -9
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +31 -15
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +52 -33
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +22 -14
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +34 -13
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +117 -72
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +21 -14
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +10 -10
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +54 -41
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +22 -8
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +62 -49
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +9 -4
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +5 -11
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +1 -1
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +32 -42
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +8 -8
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +6 -10
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +76 -55
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +10 -6
- package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +32 -39
- package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +29 -23
- package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +111 -40
- package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +9 -9
- package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +61 -48
- package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +15 -9
- package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +38 -41
- package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +8 -8
- package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +56 -35
- package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +11 -11
- package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +56 -47
- package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +22 -20
- package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +7 -16
- package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +39 -65
- package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +5 -5
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +202 -202
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +142 -142
- package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +158 -139
- package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +58 -47
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +86 -88
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +90 -91
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +166 -161
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +573 -494
- package/dist/assets/storefront/src/app/[locale]/error.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +10 -7
- package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +10 -25
- package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +5 -5
- package/dist/assets/storefront/src/app/[locale]/globals.css +48 -48
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +56 -50
- package/dist/assets/storefront/src/app/[locale]/not-found.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +71 -102
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +7 -5
- package/dist/assets/storefront/src/app/[locale]/page.tsx +33 -35
- package/dist/assets/storefront/src/app/[locale]/register/actions.ts +7 -7
- package/dist/assets/storefront/src/app/[locale]/register/page.tsx +22 -16
- package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +22 -34
- package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +15 -19
- package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +17 -15
- package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +9 -15
- package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +7 -8
- package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +18 -12
- package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +8 -16
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +10 -4
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +62 -30
- package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +14 -16
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +17 -30
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +35 -30
- package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +8 -8
- package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +18 -14
- package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +25 -27
- package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +23 -23
- package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +6 -3
- package/dist/assets/storefront/src/app/api/revalidate/route.ts +19 -28
- package/dist/assets/storefront/src/app/api/search-analytics/route.ts +1 -1
- package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +43 -18
- package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +30 -22
- package/dist/assets/storefront/src/components/commerce/active-filters.tsx +1 -1
- package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +49 -27
- package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +9 -13
- package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +23 -15
- package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +11 -11
- package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +2 -2
- package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +28 -16
- package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +31 -18
- package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +2 -4
- package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +10 -16
- package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +12 -12
- package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +188 -79
- package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +29 -49
- package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +4 -4
- package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +20 -30
- package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +258 -227
- package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +27 -19
- package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +27 -26
- package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +4 -4
- package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +5 -5
- package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +38 -21
- package/dist/assets/storefront/src/components/commerce/price.tsx +3 -3
- package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +39 -16
- package/dist/assets/storefront/src/components/commerce/product-card.tsx +35 -18
- package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +20 -12
- package/dist/assets/storefront/src/components/commerce/product-grid.tsx +14 -13
- package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +10 -8
- package/dist/assets/storefront/src/components/commerce/product-info.tsx +118 -74
- package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +102 -74
- package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +1 -1
- package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +36 -11
- package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +33 -21
- package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +80 -45
- package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +126 -50
- package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +9 -13
- package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +6 -6
- package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +22 -18
- package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +28 -27
- package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +26 -18
- package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +7 -7
- package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +50 -30
- package/dist/assets/storefront/src/components/commerce/related-products.tsx +37 -28
- package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +12 -8
- package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +8 -7
- package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +14 -20
- package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +9 -16
- package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +30 -32
- package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +11 -13
- package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +2 -2
- package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +2 -7
- package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +4 -2
- package/dist/assets/storefront/src/components/layout/footer.tsx +70 -28
- package/dist/assets/storefront/src/components/layout/navbar/actions.ts +9 -12
- package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +9 -9
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +4 -9
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +13 -8
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +4 -4
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +11 -6
- package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +7 -7
- package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +24 -21
- package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +8 -8
- package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +4 -6
- package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +1 -1
- package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +41 -42
- package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +7 -10
- package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +18 -23
- package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +9 -9
- package/dist/assets/storefront/src/components/layout/navbar.tsx +36 -31
- package/dist/assets/storefront/src/components/layout/search-input.tsx +35 -32
- package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +12 -10
- package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +14 -12
- package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +4 -4
- package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +2 -6
- package/dist/assets/storefront/src/components/providers/theme-provider.tsx +3 -3
- package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +4 -1
- package/dist/assets/storefront/src/components/shared/country-select.tsx +63 -67
- package/dist/assets/storefront/src/components/shared/pagination.tsx +15 -28
- package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +1 -1
- package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +1 -3
- package/dist/assets/storefront/src/components/ui/accordion.tsx +46 -51
- package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +94 -121
- package/dist/assets/storefront/src/components/ui/alert.tsx +48 -54
- package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +5 -7
- package/dist/assets/storefront/src/components/ui/avatar.tsx +29 -44
- package/dist/assets/storefront/src/components/ui/badge.tsx +28 -37
- package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +82 -89
- package/dist/assets/storefront/src/components/ui/button.tsx +43 -49
- package/dist/assets/storefront/src/components/ui/calendar.tsx +157 -198
- package/dist/assets/storefront/src/components/ui/card.tsx +53 -76
- package/dist/assets/storefront/src/components/ui/carousel.tsx +194 -212
- package/dist/assets/storefront/src/components/ui/chart.tsx +274 -317
- package/dist/assets/storefront/src/components/ui/checkbox.tsx +24 -27
- package/dist/assets/storefront/src/components/ui/collapsible.tsx +9 -21
- package/dist/assets/storefront/src/components/ui/command.tsx +114 -159
- package/dist/assets/storefront/src/components/ui/context-menu.tsx +167 -199
- package/dist/assets/storefront/src/components/ui/dialog.tsx +97 -114
- package/dist/assets/storefront/src/components/ui/drawer.tsx +93 -107
- package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +171 -206
- package/dist/assets/storefront/src/components/ui/empty-state.tsx +5 -5
- package/dist/assets/storefront/src/components/ui/field.tsx +196 -208
- package/dist/assets/storefront/src/components/ui/form.tsx +115 -139
- package/dist/assets/storefront/src/components/ui/hover-card.tsx +27 -33
- package/dist/assets/storefront/src/components/ui/input-otp.tsx +50 -59
- package/dist/assets/storefront/src/components/ui/input.tsx +17 -17
- package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +3 -1
- package/dist/assets/storefront/src/components/ui/label.tsx +16 -19
- package/dist/assets/storefront/src/components/ui/menubar.tsx +193 -223
- package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +123 -130
- package/dist/assets/storefront/src/components/ui/pagination.tsx +87 -108
- package/dist/assets/storefront/src/components/ui/popover.tsx +29 -35
- package/dist/assets/storefront/src/components/ui/progress.tsx +19 -26
- package/dist/assets/storefront/src/components/ui/radio-group.tsx +32 -38
- package/dist/assets/storefront/src/components/ui/resizable.tsx +37 -42
- package/dist/assets/storefront/src/components/ui/scroll-area.tsx +41 -47
- package/dist/assets/storefront/src/components/ui/select.tsx +130 -152
- package/dist/assets/storefront/src/components/ui/separator.tsx +21 -21
- package/dist/assets/storefront/src/components/ui/sheet.tsx +90 -111
- package/dist/assets/storefront/src/components/ui/sidebar.tsx +611 -649
- package/dist/assets/storefront/src/components/ui/skeleton.tsx +10 -10
- package/dist/assets/storefront/src/components/ui/slider.tsx +50 -55
- package/dist/assets/storefront/src/components/ui/sonner.tsx +20 -20
- package/dist/assets/storefront/src/components/ui/switch.tsx +23 -26
- package/dist/assets/storefront/src/components/ui/table.tsx +65 -97
- package/dist/assets/storefront/src/components/ui/tabs.tsx +39 -55
- package/dist/assets/storefront/src/components/ui/textarea.tsx +14 -14
- package/dist/assets/storefront/src/components/ui/toggle-group.tsx +56 -62
- package/dist/assets/storefront/src/components/ui/toggle.tsx +37 -38
- package/dist/assets/storefront/src/components/ui/tooltip.tsx +38 -46
- package/dist/assets/storefront/src/config/capabilities.ts +41 -0
- package/dist/assets/storefront/src/config/scenario-meta.ts +2 -2
- package/dist/assets/storefront/src/config/scenario.ts +24 -16
- package/dist/assets/storefront/src/contexts/auth-context.tsx +5 -6
- package/dist/assets/storefront/src/graphql-env.d.ts +47 -41
- package/dist/assets/storefront/src/graphql.ts +5 -5
- package/dist/assets/storefront/src/hooks/use-mobile.ts +13 -13
- package/dist/assets/storefront/src/i18n/locale-utils.ts +3 -3
- package/dist/assets/storefront/src/i18n/navigation.ts +4 -4
- package/dist/assets/storefront/src/i18n/request.ts +4 -4
- package/dist/assets/storefront/src/i18n/routing.ts +5 -5
- package/dist/assets/storefront/src/i18n/server.ts +35 -7
- package/dist/assets/storefront/src/lib/actions/switch-channel.ts +9 -9
- package/dist/assets/storefront/src/lib/actions/switch-currency.ts +7 -7
- package/dist/assets/storefront/src/lib/auth.ts +1 -1
- package/dist/assets/storefront/src/lib/backend-health.ts +14 -6
- package/dist/assets/storefront/src/lib/cart-count-context.tsx +10 -4
- package/dist/assets/storefront/src/lib/cart-guard-utils.ts +2 -1
- package/dist/assets/storefront/src/lib/cart-guard.ts +7 -6
- package/dist/assets/storefront/src/lib/channel-server.ts +4 -4
- package/dist/assets/storefront/src/lib/company-context.ts +1 -1
- package/dist/assets/storefront/src/lib/company-permissions-context.tsx +1 -5
- package/dist/assets/storefront/src/lib/currency-server.ts +4 -4
- package/dist/assets/storefront/src/lib/format.ts +16 -7
- package/dist/assets/storefront/src/lib/metadata.ts +39 -44
- package/dist/assets/storefront/src/lib/quantity.ts +2 -4
- package/dist/assets/storefront/src/lib/search-bar-context.tsx +7 -4
- package/dist/assets/storefront/src/lib/use-recent-searches.ts +8 -6
- package/dist/assets/storefront/src/lib/utils.ts +3 -3
- package/dist/assets/storefront/src/lib/vendure/actions.ts +18 -16
- package/dist/assets/storefront/src/lib/vendure/api.ts +36 -23
- package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +9 -8
- package/dist/assets/storefront/src/lib/vendure/cached.ts +20 -15
- package/dist/assets/storefront/src/lib/vendure/capability-documents.ts +246 -0
- package/dist/assets/storefront/src/lib/vendure/capability-schema.ts +358 -0
- package/dist/assets/storefront/src/lib/vendure/capability-ui.ts +15 -0
- package/dist/assets/storefront/src/lib/vendure/mutations.ts +835 -532
- package/dist/assets/storefront/src/lib/vendure/queries.ts +877 -524
- package/dist/assets/storefront/src/proxy.ts +11 -0
- package/dist/assets/storefront/src/scenarios/customer/hero.tsx +2 -2
- package/dist/assets/storefront/src/scenarios/customer/meta.ts +1 -1
- package/dist/assets/storefront/src/schema.graphql +337 -243
- package/dist/assets/templates/README.md.hbs +25 -1
- package/dist/assets/templates/docker-compose.yml.hbs +4 -0
- package/dist/assets/templates/env.hbs +34 -9
- package/dist/assets/templates/environment.d.ts.hbs +1 -0
- package/dist/assets/templates/gitignore.hbs +7 -4
- package/dist/assets/templates/migrate.ts.hbs +55 -0
- package/dist/assets/templates/npmrc.hbs +7 -2
- package/dist/assets/templates/platform-edition.ts.hbs +21 -0
- package/dist/assets/templates/server-package.json.hbs +15 -8
- package/dist/assets/templates/vendure-config.ts.hbs +18 -0
- package/dist/bin/run.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/console-onboarding.d.ts +44 -0
- package/dist/console-onboarding.js +1 -0
- package/dist/hub-projects.d.ts +48 -0
- package/dist/hub-projects.js +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/plugin-registry.d.ts +61 -2
- package/dist/plugin-registry.js +1 -1
- package/dist/registry.d.ts +16 -13
- package/dist/registry.js +1 -1
- package/dist/scaffold-shared.js +1 -1
- package/dist/scaffold-storefront-only.js +1 -1
- package/dist/scaffolder.d.ts +11 -0
- package/dist/scaffolder.js +1 -1
- package/dist/storefront-copier.d.ts +7 -2
- package/dist/storefront-copier.js +1 -1
- package/dist/template-renderer.d.ts +26 -5
- package/dist/template-renderer.js +1 -1
- package/dist/types.d.ts +54 -23
- package/package.json +14 -2
- package/dist/assets/storefront/src/middleware.ts +0 -11
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type CapabilityProfileName } from '@vendure-platform/plugin-meta';
|
|
2
|
+
import { PluginDefinition, ScaffolderPluginExtras } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* The full registry consumed by the scaffolder: the shared `PluginMeta` from
|
|
4
5
|
* `@vendure-platform/plugin-meta` joined with the local scaffolder extras.
|
|
@@ -36,7 +37,8 @@ export declare function getPlugin(key: string): PluginDefinition | undefined;
|
|
|
36
37
|
export declare const ALWAYS_ACTIVE_KEYS: ReadonlyArray<string>;
|
|
37
38
|
/**
|
|
38
39
|
* Plugin keys that are eligible to appear in the interactive selection prompt:
|
|
39
|
-
* everything except the always-active core plugins
|
|
40
|
+
* everything except the always-active core plugins and the mutually exclusive
|
|
41
|
+
* families, which follow the edition rather than a tick box.
|
|
40
42
|
*/
|
|
41
43
|
export declare const SELECTABLE_KEYS: ReadonlyArray<string>;
|
|
42
44
|
/**
|
|
@@ -45,3 +47,60 @@ export declare const SELECTABLE_KEYS: ReadonlyArray<string>;
|
|
|
45
47
|
* selected optional / requires-config plugins. Result preserves registry order.
|
|
46
48
|
*/
|
|
47
49
|
export declare function resolveActivePluginKeys(selected: ReadonlyArray<string>): string[];
|
|
50
|
+
export declare const CAPABILITY_PROFILE_NAMES: CapabilityProfileName[];
|
|
51
|
+
export declare function isCapabilityProfileName(value: string): value is CapabilityProfileName;
|
|
52
|
+
/**
|
|
53
|
+
* The edition facade a profile installs. The facade is the only
|
|
54
|
+
* `@vendure-platform` capability line a scaffolded project carries — it pulls
|
|
55
|
+
* the kernel and that edition's capability packages. Generated from the same
|
|
56
|
+
* profiles by `tools/scripts/generate-edition-facades.ts`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function facadePackageName(profile: CapabilityProfileName): string;
|
|
59
|
+
/** Every edition facade package name, for tooling that must list them all. */
|
|
60
|
+
export declare const FACADE_PACKAGE_NAMES: ReadonlyArray<string>;
|
|
61
|
+
/**
|
|
62
|
+
* The plugin keys a capability profile needs, in registry order.
|
|
63
|
+
*
|
|
64
|
+
* Derived from the profile's grant set through the module manifests, so a
|
|
65
|
+
* catalog change moves the scaffolded package list with it. Always-active core
|
|
66
|
+
* plugins are included; a plugin whose every module is unentitled is left out
|
|
67
|
+
* so the project never installs a package it cannot activate.
|
|
68
|
+
*/
|
|
69
|
+
export declare function resolveProfilePluginKeys(profile: CapabilityProfileName): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Same resolution as `resolveProfilePluginKeys`, from an arbitrary grant set.
|
|
72
|
+
*
|
|
73
|
+
* The edition-facade generator needs this so it can build a facade from a
|
|
74
|
+
* hypothetical grant set in its drift tests without a second copy of the
|
|
75
|
+
* grant-to-package chain.
|
|
76
|
+
*
|
|
77
|
+
* Seeded from `CORE_KEYS` rather than `ALWAYS_ACTIVE_KEYS`: the grant set names
|
|
78
|
+
* the search engine, and a facade must carry only the one it names. Facades do
|
|
79
|
+
* not nest, so Growth dropping the database engine has to show up here as an
|
|
80
|
+
* absent package rather than an inherited one.
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolvePluginKeysForGrants(grants: readonly string[]): string[];
|
|
83
|
+
/**
|
|
84
|
+
* Capability set needed to compose a hand-picked plugin selection before the
|
|
85
|
+
* v2 Environment Credential can be exchanged for a signed grant.
|
|
86
|
+
*
|
|
87
|
+
* This is a local composition hint only. License Guard validates the resulting
|
|
88
|
+
* module graph against the signed grant during boot and fails closed when they
|
|
89
|
+
* differ.
|
|
90
|
+
*/
|
|
91
|
+
export declare function resolveCompositionCapabilities(pluginKeys: readonly string[]): string[];
|
|
92
|
+
/**
|
|
93
|
+
* The storefront ships only with the `storefront.b2b` grant, which Scale and
|
|
94
|
+
* Enterprise hold and Starter and Growth do not. Deciding from the grant set
|
|
95
|
+
* rather than a profile name keeps the rule self-documenting: a profile that
|
|
96
|
+
* gains the capability later starts receiving the storefront with no change
|
|
97
|
+
* here.
|
|
98
|
+
*/
|
|
99
|
+
export declare const STOREFRONT_CAPABILITY = "storefront.b2b";
|
|
100
|
+
/** True when a grant set includes the storefront capability. */
|
|
101
|
+
export declare function grantsIncludeStorefront(grants: readonly string[]): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Resolve a plugin's scaffolder extras for a profile. Falls back to the
|
|
104
|
+
* profile-independent extras when the plugin declares no override.
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolvePluginExtras(plugin: PluginDefinition, profile?: CapabilityProfileName): ScaffolderPluginExtras;
|
package/dist/plugin-registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SELECTABLE_KEYS=exports.ALWAYS_ACTIVE_KEYS=exports.INTERNAL_PACKAGES=exports.pluginRegistry=void 0,exports.getPlugin=o,exports.resolveActivePluginKeys=t;const e=require("@vendure-platform/plugin-meta"),n={"license-guard":{envVars:[{name:"VENDURE_PLATFORM_LICENSE_TOKEN",defaultValue:"dev-license-token"}],platformOptionsBlock:"licenseGuard: {\n token: process.env.VENDURE_PLATFORM_LICENSE_TOKEN,\n }"},"org-hierarchy":{envVars:[],platformOptionsBlock:""},"advanced-search":{envVars:[{name:"TYPESENSE_API_KEY",defaultValue:"your-typesense-api-key"},{name:"TYPESENSE_HOST",defaultValue:"localhost"},{name:"TYPESENSE_PORT",defaultValue:"8108"},{name:"TYPESENSE_PROTOCOL",defaultValue:"http"}],platformOptionsBlock:"advancedSearch: {\n typeSenseClientOptions: {\n apiKey: process.env.TYPESENSE_API_KEY as string,\n nodes: [\n {\n host: process.env.TYPESENSE_HOST as string,\n port: Number(process.env.TYPESENSE_PORT ?? 8108),\n protocol: (process.env.TYPESENSE_PROTOCOL ?? 'http') as 'http' | 'https',\n },\n ],\n },\n analytics: {\n analyticsStrategy: new SqlAnalyticsStrategy(),\n },\n }",platformImports:["import { SqlAnalyticsStrategy } from '@vendure-platform/advanced-search';"]},"workflow-engine":{envVars:[{name:"WORKFLOW_ENGINE_SCHEMA",defaultValue:"dbos"}],platformOptionsBlock:"workflowEngine: {\n databaseConnection: {\n host: process.env.DB_HOST ?? 'localhost',\n port: Number(process.env.DB_PORT ?? 5432),\n database: process.env.DB_NAME ?? 'vendure',\n username: process.env.DB_USERNAME ?? 'vendure',\n password: process.env.DB_PASSWORD ?? 'vendure',\n ssl: process.env.APP_ENV === 'production',\n },\n systemDatabaseSchemaName: process.env.WORKFLOW_ENGINE_SCHEMA ?? 'dbos',\n applicationVersion: 'v1',\n }"},"approval-workflows":{envVars:[],platformOptionsBlock:""},"global-search":{envVars:[],platformOptionsBlock:""},"entity-access-control":{envVars:[],platformOptionsBlock:""},"tax-id-management":{envVars:[],platformOptionsBlock:""},"shopping-list":{envVars:[],platformOptionsBlock:""},"quick-order":{envVars:[],platformOptionsBlock:""},"reorder-from-history":{envVars:[],platformOptionsBlock:""},"store-credit":{envVars:[],platformOptionsBlock:"storeCredit: {\n availableFontStacks: [\n 'Arial, Helvetica Neue, Helvetica, sans-serif',\n 'Impact, Charcoal, sans-serif',\n ],\n createDefaultGiftCardProduct: {\n name: 'Gift Card',\n sku: 'GC01',\n },\n }"},"quote-management":{envVars:[],platformOptionsBlock:""},"shared-carts":{envVars:[],platformOptionsBlock:""},"price-rules":{envVars:[],platformOptionsBlock:""},"packaging-units":{envVars:[],platformOptionsBlock:""},"product-types":{envVars:[],platformOptionsBlock:""},"content-versioning":{envVars:[],platformOptionsBlock:""},configurator:{envVars:[],platformOptionsBlock:""},sso:{envVars:[{name:"GOOGLE_CLIENT_ID",defaultValue:""},{name:"GOOGLE_CLIENT_SECRET",defaultValue:""},{name:"VENDURE_HOST",defaultValue:"http://localhost:3500"}],platformOptionsBlock:"sso: {\n vendureHost: process.env.VENDURE_HOST ?? 'http://localhost:3500',\n providers: [\n {\n type: 'oidc',\n id: 'google',\n displayName: 'Google SSO',\n issuerUrl: 'https://accounts.google.com',\n clientId: process.env.GOOGLE_CLIENT_ID ?? '',\n clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '',\n scopes: ['openid', 'profile', 'email'],\n },\n ],\n }"},"audit-trail":{envVars:[],platformOptionsBlock:"auditTrail: (defaults) => ({\n ...defaults,\n logSink: new DatabaseLogSink({\n dataSourceOptions: {\n type: 'postgres',\n host: process.env.DB_HOST ?? 'localhost',\n port: Number(process.env.DB_PORT ?? 5432),\n database: process.env.DB_NAME ?? 'vendure',\n schema: process.env.AUDIT_LOG_SCHEMA ?? 'audit_trail',\n username: process.env.DB_USERNAME ?? 'vendure',\n password: process.env.DB_PASSWORD ?? 'vendure',\n synchronize: true,\n },\n }),\n })",platformImports:["import { DatabaseLogSink } from '@vendure-platform/audit-trail';"]},punchout:{envVars:[{name:"PUNCHOUT_STOREFRONT_URL",defaultValue:"http://localhost:3000"}],platformOptionsBlock:"punchout: {\n storefrontUrl: process.env.PUNCHOUT_STOREFRONT_URL ?? 'http://localhost:3000',\n }"}};function o(e){return exports.pluginRegistry.find(n=>n.key===e)}function t(e){const n=new Set(exports.ALWAYS_ACTIVE_KEYS);for(const t of e){if(!o(t))throw new Error(`Unknown plugin key: "${t}"`);n.add(t)}return exports.pluginRegistry.filter(e=>n.has(e.key)).map(e=>e.key)}exports.pluginRegistry=e.PLUGIN_META.map(e=>({...e,...n[e.key]})),exports.INTERNAL_PACKAGES=[{packageName:"@vendure-platform/platform"},{packageName:"@vendure-platform/integration"},{packageName:"@vendure-platform/demo-center"}],exports.ALWAYS_ACTIVE_KEYS=exports.pluginRegistry.filter(e=>"core"===e.tier||"core-requires-config"===e.tier).map(e=>e.key),exports.SELECTABLE_KEYS=exports.pluginRegistry.filter(e=>"core"!==e.tier&&"core-requires-config"!==e.tier).map(e=>e.key);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.STOREFRONT_CAPABILITY=exports.FACADE_PACKAGE_NAMES=exports.CAPABILITY_PROFILE_NAMES=exports.SELECTABLE_KEYS=exports.ALWAYS_ACTIVE_KEYS=exports.INTERNAL_PACKAGES=exports.pluginRegistry=void 0,exports.getPlugin=t,exports.resolveActivePluginKeys=i,exports.isCapabilityProfileName=c,exports.facadePackageName=m,exports.resolveProfilePluginKeys=u,exports.resolvePluginKeysForGrants=f,exports.resolveCompositionCapabilities=d,exports.grantsIncludeStorefront=v,exports.resolvePluginExtras=E;const e=require("@vendure-platform/plugin-meta"),o={"license-guard":{envVars:[{name:"VENDURE_PLATFORM_LICENSE_TOKEN",defaultValue:"dev-license-token"}],platformOptionsBlock:"licenseGuard: {\n token: process.env.VENDURE_PLATFORM_LICENSE_TOKEN,\n }"},"org-accounts":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/org-accounts';"]},"org-hierarchy":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/org-hierarchy';"]},"advanced-search":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/advanced-search';"]},"search-engine-database":{envVars:[],platformOptionsBlock:"advancedSearch: {\n engine: 'database',\n }",platformImports:["import '@vendure-platform/search-engine-database';"]},"search-engine-typesense":{envVars:[{name:"TYPESENSE_API_KEY",defaultValue:"your-typesense-api-key"},{name:"TYPESENSE_HOST",defaultValue:"localhost"},{name:"TYPESENSE_PORT",defaultValue:"8108"},{name:"TYPESENSE_PROTOCOL",defaultValue:"http"}],platformOptionsBlock:"advancedSearch: {\n typeSenseClientOptions: {\n apiKey: process.env.TYPESENSE_API_KEY as string,\n nodes: [\n {\n host: process.env.TYPESENSE_HOST as string,\n port: Number(process.env.TYPESENSE_PORT ?? 8108),\n protocol: (process.env.TYPESENSE_PROTOCOL ?? 'http') as 'http' | 'https',\n },\n ],\n },\n {{#ifPlugin \"search-analytics-clickhouse\"}}\n analytics: {\n analyticsStrategy: new SqlAnalyticsStrategy(),\n },\n {{/ifPlugin}}\n }",platformImports:["import '@vendure-platform/search-engine-typesense';"]},"search-analytics-clickhouse":{envVars:[],platformOptionsBlock:"",platformImports:["import { SqlAnalyticsStrategy } from '@vendure-platform/search-analytics-clickhouse';"]},"workflow-engine":{envVars:[{name:"WORKFLOW_ENGINE_SCHEMA",defaultValue:"dbos"},{name:"WORKFLOW_ENGINE_SSL",defaultValue:"false"}],platformOptionsBlock:"workflowEngine: {\n databaseConnection: {\n host: process.env.DB_HOST ?? 'localhost',\n port: Number(process.env.DB_PORT ?? 5432),\n database: process.env.DB_NAME ?? 'vendure',\n username: process.env.DB_USERNAME ?? 'vendure',\n password: process.env.DB_PASSWORD ?? 'vendure',\n // Managed Postgres usually requires SSL; the local\n // docker-compose container does not speak it at all.\n // WORKFLOW_ENGINE_SSL decides, so running with\n // APP_ENV=production against a local database (migrations,\n // CI, a production-shaped smoke test) does not fail on a\n // connection the environment cannot make.\n ssl: process.env.WORKFLOW_ENGINE_SSL === 'true',\n },\n systemDatabaseSchemaName: process.env.WORKFLOW_ENGINE_SCHEMA ?? 'dbos',\n applicationVersion: 'v1',\n }",platformImports:["import '@vendure-platform/workflow-engine';"]},"approval-workflows":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/approval-workflows';"]},"approval-advanced":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/approval-advanced';"]},"global-search":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/global-search';"]},"entity-access-control":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/entity-access-control';"]},"tax-id-management":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/tax-id-management';"]},"shopping-list":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/shopping-list';"]},"shopping-list-managed":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/shopping-list-managed';"]},"quick-order":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/quick-order';"]},"reorder-from-history":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/reorder-from-history';"]},"store-credit":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/store-credit';"]},"gift-cards":{envVars:[],platformOptionsBlock:"giftCards: {\n availableFontStacks: [\n 'Arial, Helvetica Neue, Helvetica, sans-serif',\n 'Impact, Charcoal, sans-serif',\n ],\n createDefaultGiftCardProduct: {\n name: 'Gift Card',\n sku: 'GC01',\n },\n }",platformImports:["import '@vendure-platform/gift-cards';"]},"quote-management":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/quote-management';"]},"quote-negotiation":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/quote-negotiation';"]},"shared-carts":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/shared-carts';"]},"price-rules":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/price-rules';"]},"price-rules-advanced":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/price-rules-advanced';"]},"packaging-units":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/packaging-units';"]},"product-types":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/product-types';"]},"content-versioning":{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/content-versioning';"]},configurator:{envVars:[],platformOptionsBlock:"",platformImports:["import '@vendure-platform/configurator';"]},sso:{envVars:[{name:"GOOGLE_CLIENT_ID",defaultValue:""},{name:"GOOGLE_CLIENT_SECRET",defaultValue:""},{name:"VENDURE_HOST",defaultValue:"http://localhost:3500"}],platformOptionsBlock:"sso: {\n vendureHost: process.env.VENDURE_HOST ?? 'http://localhost:3500',\n providers: [\n {\n type: 'oidc',\n id: 'google',\n displayName: 'Google SSO',\n issuerUrl: 'https://accounts.google.com',\n clientId: process.env.GOOGLE_CLIENT_ID ?? '',\n clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '',\n scopes: ['openid', 'profile', 'email'],\n },\n ],\n }",platformImports:["import '@vendure-platform/sso';"],profileOverrides:{enterprise:{platformOptionsBlock:"sso: {\n vendureHost: process.env.VENDURE_HOST ?? 'http://localhost:3500',\n providers: [\n {\n type: 'oidc',\n id: 'google',\n displayName: 'Google SSO',\n issuerUrl: 'https://accounts.google.com',\n clientId: process.env.GOOGLE_CLIENT_ID ?? '',\n clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '',\n scopes: ['openid', 'profile', 'email'],\n },\n ...(process.env.SAML_IDP_SSO_URL\n ? [\n {\n type: 'saml' as const,\n id: 'saml',\n displayName: 'SAML SSO',\n // `||`, not `??`: `.env` ships the key with\n // an empty value, which `??` would accept as\n // a configured entity ID.\n spEntityId:\n process.env.SAML_SP_ENTITY_ID ||\n `${process.env.VENDURE_HOST ?? 'http://localhost:3500'}/sso/metadata/saml`,\n idpEntityId: process.env.SAML_IDP_ENTITY_ID ?? '',\n idpCertificate: process.env.SAML_IDP_CERTIFICATE ?? '',\n idpSsoUrl: process.env.SAML_IDP_SSO_URL,\n },\n ]\n : []),\n ],\n }"}}},"sso-federation":{envVars:[{name:"SAML_SP_ENTITY_ID",defaultValue:""},{name:"SAML_IDP_ENTITY_ID",defaultValue:""},{name:"SAML_IDP_SSO_URL",defaultValue:""},{name:"SAML_IDP_CERTIFICATE",defaultValue:""}],platformOptionsBlock:"",platformImports:["import '@vendure-platform/sso-federation';"]},"audit-trail":{envVars:[],platformOptionsBlock:"auditTrail: (defaults) => ({\n ...defaults,\n logSink: new DatabaseLogSink({\n dataSourceOptions: {\n type: 'postgres',\n host: process.env.DB_HOST ?? 'localhost',\n port: Number(process.env.DB_PORT ?? 5432),\n database: process.env.DB_NAME ?? 'vendure',\n schema: process.env.AUDIT_LOG_SCHEMA ?? 'audit_trail',\n username: process.env.DB_USERNAME ?? 'vendure',\n password: process.env.DB_PASSWORD ?? 'vendure',\n synchronize: true,\n },\n }),\n })",platformImports:["import { DatabaseLogSink } from '@vendure-platform/audit-trail';"]},"audit-governance":{envVars:[],platformOptionsBlock:"auditGovernance: {\n exportStrategy: new JsonFileExportStrategy({\n outputDir: path.join(__dirname, '../static/audit-exports'),\n }),\n }",platformImports:["import { JsonFileExportStrategy } from '@vendure-platform/audit-governance';"]},punchout:{envVars:[{name:"PUNCHOUT_STOREFRONT_URL",defaultValue:"http://localhost:3000"}],platformOptionsBlock:"punchout: {\n storefrontUrl: process.env.PUNCHOUT_STOREFRONT_URL ?? 'http://localhost:3000',\n }",platformImports:["import '@vendure-platform/punchout';"]}};function t(e){return exports.pluginRegistry.find(o=>o.key===e)}exports.pluginRegistry=e.PLUGIN_META.map(e=>({...e,...o[e.key]})),exports.INTERNAL_PACKAGES=[{packageName:"@vendure-platform/platform"},{packageName:"@vendure-platform/integration"},{packageName:"@vendure-platform/demo-center"}];const r={"search-engine":"search-engine-typesense"},n=(()=>{const o=new Map;for(const t of e.CAPABILITY_CATALOG){if(!t.exclusiveGroup)continue;let r=o.get(t.exclusiveGroup);r||(r=new Set,o.set(t.exclusiveGroup,r));for(const o of e.MODULE_MANIFESTS){const e=o.requiredGrants;o.plugin&&e.includes(t.key)&&r.add(o.plugin)}}return[...o.values()].map(e=>[...e])})(),s=n.flat(),a=r["search-engine"];function p(e){const o=new Set(e);for(const e of n){const t=exports.pluginRegistry.filter(t=>e.includes(t.key)&&o.has(t.key));if(t.length<2)continue;const n=t.find(e=>Object.values(r).includes(e.key)),s=(null!=n?n:t[0]).key;for(const e of t)e.key!==s&&o.delete(e.key)}return o}const l=exports.pluginRegistry.filter(e=>"core"===e.tier||"core-requires-config"===e.tier).map(e=>e.key);function i(e){const o=new Set;for(const r of e){if(!t(r))throw new Error(`Unknown plugin key: "${r}"`);o.add(r)}const r=p(o),n=s.some(e=>r.has(e));for(const e of exports.ALWAYS_ACTIVE_KEYS)n&&s.includes(e)||r.add(e);return exports.pluginRegistry.filter(e=>r.has(e.key)).map(e=>e.key)}function c(e){return exports.CAPABILITY_PROFILE_NAMES.includes(e)}function m(e){return`@vendure-platform/${e}`}function u(o){return f(e.CAPABILITY_PROFILES[o])}function f(o){var r;const n=new Set(l);for(const s of(0,e.resolveComposableModules)(o)){const o=null===(r=(0,e.getModuleManifest)(s))||void 0===r?void 0:r.plugin;o&&t(o)&&n.add(o)}return exports.pluginRegistry.filter(e=>p(n).has(e.key)).map(e=>e.key)}function d(o){const t=new Set(o),r=new Set(e.MODULE_MANIFESTS.filter(e=>e.plugin&&t.has(e.plugin)).map(e=>e.id)),n=o=>{var t;const s=e.MODULE_MANIFESTS.find(e=>e.id===o);for(const e of null!==(t=null==s?void 0:s.dependencies)&&void 0!==t?t:[])r.has(e)||(r.add(e),n(e))};for(const e of[...r])n(e);const s=new Set(e.MODULE_MANIFESTS.filter(e=>r.has(e.id)).flatMap(e=>e.requiredGrants));return e.CAPABILITY_CATALOG.map(({key:e})=>e).filter(e=>s.has(e))}function v(e){return e.includes(exports.STOREFRONT_CAPABILITY)}function E(e,o){var t,r,n,s;const a=o?null===(t=e.profileOverrides)||void 0===t?void 0:t[o]:void 0;return{envVars:null!==(r=null==a?void 0:a.envVars)&&void 0!==r?r:e.envVars,platformOptionsBlock:null!==(n=null==a?void 0:a.platformOptionsBlock)&&void 0!==n?n:e.platformOptionsBlock,platformImports:null!==(s=null==a?void 0:a.platformImports)&&void 0!==s?s:e.platformImports}}exports.ALWAYS_ACTIVE_KEYS=exports.pluginRegistry.filter(e=>l.includes(e.key)||e.key===a).map(e=>e.key),exports.SELECTABLE_KEYS=exports.pluginRegistry.filter(e=>!exports.ALWAYS_ACTIVE_KEYS.includes(e.key)&&!s.includes(e.key)).map(e=>e.key),exports.CAPABILITY_PROFILE_NAMES=Object.keys(e.CAPABILITY_PROFILES),exports.FACADE_PACKAGE_NAMES=exports.CAPABILITY_PROFILE_NAMES.map(m),exports.STOREFRONT_CAPABILITY="storefront.b2b";
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
import { REGISTRY_SCOPE } from '@vendure-platform/console-auth';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* The registry the scaffolded project installs from.
|
|
3
4
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* regex that fingerprints private-registry failures in stderr)
|
|
9
|
-
*
|
|
10
|
-
* Keeping the URL in one place means the next registry rename is a single-
|
|
11
|
-
* file edit. The `VENDURE_REGISTRY_URL` override is intended for local
|
|
12
|
-
* Verdaccio testing — set it before invoking the create CLI to scaffold a
|
|
13
|
-
* project pointed at a local registry without needing to patch the template
|
|
14
|
-
* post-scaffold.
|
|
5
|
+
* The values live in `@vendure-platform/console-auth` because
|
|
6
|
+
* `vendure console link` writes the same `.npmrc` and a second copy would be a
|
|
7
|
+
* second thing to change. These wrappers are what the templates and the install
|
|
8
|
+
* failure message here read.
|
|
15
9
|
*/
|
|
16
|
-
export
|
|
10
|
+
export { DEFAULT_REGISTRY_URL, registryAuthTokenKey, registryLoginUrl } from '@vendure-platform/console-auth';
|
|
11
|
+
export { REGISTRY_SCOPE };
|
|
17
12
|
export declare function getRegistryUrl(): string;
|
|
18
13
|
export declare function getRegistryHostname(): string;
|
|
14
|
+
/**
|
|
15
|
+
* The registry a scaffold writes when it never reached Console: the default
|
|
16
|
+
* origin and scope, and no token.
|
|
17
|
+
*/
|
|
18
|
+
export declare function offlineRegistry(): {
|
|
19
|
+
registryUrl: string;
|
|
20
|
+
scope: string;
|
|
21
|
+
};
|
package/dist/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.REGISTRY_SCOPE=exports.registryLoginUrl=exports.registryAuthTokenKey=exports.DEFAULT_REGISTRY_URL=void 0,exports.getRegistryUrl=t,exports.getRegistryHostname=n,exports.offlineRegistry=o;const e=require("@vendure-platform/console-auth");Object.defineProperty(exports,"REGISTRY_SCOPE",{enumerable:!0,get:function(){return e.REGISTRY_SCOPE}});var r=require("@vendure-platform/console-auth");function t(){return(0,e.registryUrl)()}function n(){return new URL(t()).hostname}function o(){return{registryUrl:t(),scope:e.REGISTRY_SCOPE}}Object.defineProperty(exports,"DEFAULT_REGISTRY_URL",{enumerable:!0,get:function(){return r.DEFAULT_REGISTRY_URL}}),Object.defineProperty(exports,"registryAuthTokenKey",{enumerable:!0,get:function(){return r.registryAuthTokenKey}}),Object.defineProperty(exports,"registryLoginUrl",{enumerable:!0,get:function(){return r.registryLoginUrl}});
|
package/dist/scaffold-shared.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(){var i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)};return function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var s=i(n),o=0;o<s.length;o++)"default"!==s[o]&&e(r,n,s[o]);return t(r,n),r}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.installDependencies=u,exports.initRepository=g;const n=i(require("@clack/prompts")),r=require("child_process"),s=require("util"),o=require("./git-init"),a=require("./registry"),c=(0,s.promisify)(r.exec);async function u(e,t,i){var r;i.message(`Installing dependencies with ${t} (this may take a few minutes)...`);try{await c(`${t} install`,{cwd:e})}catch(s){i.stop(`${t} install failed.`);const o=s instanceof Error&&"stderr"in s?null===(r=s.stderr)||void 0===r?void 0:r.trim():void 0;o&&n.log.error(o.split("\n").slice(-5).join("\n")),o&&l(o)?n.log.warn(d(t,e)):n.log.warn(`Dependency install failed \u2014 run \`${t} install\` manually in the project directory.`),i.start("Continuing...")}}function l(e){const t=(0,a.getRegistryHostname)().replace(/\./g,"\\.");return new RegExp(`\\bE401\\b|401 Unauthorized|${t}`,"i").test(e)}function d(e,t){return["Install failed: this project is not authenticated to the Vendure registry","(or its Registry Access Token has expired).","","The quickest fix is to let the CLI get a fresh token for you:",` vendure console link (run it in ${t})`,"","If your Console account cannot manage Registry Access Tokens, log in to","the registry directly instead. This writes to ~/.npmrc:",` npm login --auth-type=web --registry=${(0,a.registryLoginUrl)()}`,` then re-run \`${e} install\` in ${t}.`,"","Docs: https://docs.platform.vendure.io"].join("\n")}async function g(e,t,i,r){r.message("Initializing git...");try{await(0,o.initGit)(e,t,i)}catch(e){r.stop("Git setup had issues.");const i=e instanceof Error?e.message:String(e);n.log.warn(t?`Git/GitHub setup had issues \u2014 make sure the gh CLI is installed and authenticated. (${i})`:`Git init had issues \u2014 initialise the repo manually if needed. (${i})`),r.start("Continuing...")}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var i=r(n),a=0;a<i.length;a++)"default"!==i[a]&&e(o,n,i[a]);return t(o,n),o}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.scaffoldStorefrontOnly=c;const n=r(require("@clack/prompts")),o=r(require("fs-extra")),i=r(require("path")),a=require("./scaffold-shared"),s=require("./storefront-copier");async function c(e){var t;const{projectName:r,apiUrl:c,scenario:l,capabilities:u,packageManager:p,skipInstall:d,skipGit:f,dryRun:y}=e,v=i.resolve(process.cwd(),r);if(await o.pathExists(v)&&(await o.readdir(v)).length>0&&(n.log.error(`Directory "${v}" already exists and is not empty.`),process.exit(1)),y){const e=[`Project: ${r} \u2192 ${v}`,"","Mode: storefront-only",`Scenario: ${l}`,`API URL: ${null!=c?c:"(use default localhost)"}`,`Capabilities: ${null!==(t=null==u?void 0:u.join(","))&&void 0!==t?t:"(all)"}`,`Package manager: ${p}`,"Install deps: "+(d?"no":"yes"),"Git init: "+(f?"no":"yes")].join("\n");return n.note(e,"Dry run"),void n.outro("Dry run complete \u2014 no files written.")}const g=n.spinner();g.start("Creating project directory..."),await o.ensureDir(v),g.message("Copying storefront..."),await(0,s.copyStorefront)(v,{mode:"storefront-only",scenario:l,apiUrl:c,capabilities:u,packageName:r}),d||await(0,a.installDependencies)(v,p,g),f||await(0,a.initRepository)(v,!1,void 0,g),g.stop(`Project "${r}" created successfully!`);const _=[`cd ${r}`,c?`# .env.local already points VENDURE_SHOP_API_URL at ${c}`:"# Edit .env.local and set VENDURE_SHOP_API_URL to your Vendure server","npm"===p?"npm run dev":`${p} run dev`,"","Storefront: http://localhost:${STOREFRONT_PORT:-3001}"].join("\n");n.note(_,"Next steps"),n.outro("Happy building!")}
|
package/dist/scaffolder.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
import { type CapabilityProfileName } from '@vendure-platform/plugin-meta';
|
|
1
2
|
import { ScaffoldOptions } from './types';
|
|
2
3
|
/** Template-to-output mapping used by the scaffolder. */
|
|
3
4
|
export declare const TEMPLATE_FILES: ReadonlyArray<{
|
|
4
5
|
template: string;
|
|
5
6
|
output: string;
|
|
7
|
+
profileOnly?: true;
|
|
6
8
|
}>;
|
|
9
|
+
/**
|
|
10
|
+
* The files to write for one scaffold.
|
|
11
|
+
*
|
|
12
|
+
* The edition configuration file is written only for a project scaffolded from
|
|
13
|
+
* an edition. A hand-picked plugin selection composes from an explicit
|
|
14
|
+
* capability list instead, and there is no edition for `vendure edition` to
|
|
15
|
+
* maintain.
|
|
16
|
+
*/
|
|
17
|
+
export declare function templateFilesFor(profile?: CapabilityProfileName): typeof TEMPLATE_FILES;
|
|
7
18
|
/**
|
|
8
19
|
* Scaffold a complete Vendure demo project.
|
|
9
20
|
*/
|
package/dist/scaffolder.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,o
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var s=r(o),i=0;i<s.length;i++)"default"!==s[i]&&e(n,o,s[i]);return t(n,o),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEMPLATE_FILES=void 0,exports.templateFilesFor=d,exports.scaffold=f;const o=r(require("@clack/prompts")),n=require("@vendure-platform/plugin-meta"),s=r(require("fs-extra")),i=r(require("path")),a=require("./plugin-registry"),u=require("./registry"),l=require("./scaffold-shared"),p=require("./storefront-copier"),c=require("./template-renderer");function d(e){return e?exports.TEMPLATE_FILES:exports.TEMPLATE_FILES.filter(e=>!e.profileOnly)}async function f(e){var t;const{projectName:r,companyName:u,selectedPlugins:f,profile:m,includeStorefront:y,createGithubRepo:v,githubOrg:b,packageManager:j="bun",skipInstall:w,skipGit:E,dryRun:T,registryToken:k,licenseToken:_,consoleOnboarding:$}=e,P=i.resolve(process.cwd(),r),S=(0,a.resolveActivePluginKeys)(f);m&&o.log.info(`Capability profile: ${m}`);const O=a.ALWAYS_ACTIVE_KEYS.map(e=>(0,a.getPlugin)(e).displayName);O.length>0&&o.log.info(`Always-on core plugins: ${O.join(", ")}`);const x=m?[...n.CAPABILITY_PROFILES[m]]:void 0,A=!x||(0,a.grantsIncludeStorefront)(x),C=y&&A;if(y&&!A&&o.log.warn(`The ${m} profile does not grant "${a.STOREFRONT_CAPABILITY}", so no storefront was emitted. The storefront ships with Scale and Enterprise.`),await s.pathExists(P)&&(await s.readdir(P)).length>0&&(o.log.error(`Directory "${P}" already exists and is not empty.`),process.exit(1)),T){const e=S.map(e=>(0,a.getPlugin)(e).displayName),t=[`Project: ${r} \u2192 ${P}`,...m?[`Profile: ${m}`]:[],"","Files to generate:",d(m).map(e=>` ${e.output}`).join("\n"),[" server/src/demo-data/products.csv"," server/src/demo-data/initial-data.json"," server/src/demo-data/images/.gitkeep"].join("\n")," server/src/migrations/ (empty dir)","",`Plugins (${e.length}):`,` ${e.join(", ")}`,"","Storefront: "+(C?"yes":A?"no":`no (needs ${a.STOREFRONT_CAPABILITY})`),`Install deps with ${j}: ${w?"no":"yes"}`,"Git init: "+(E?"no":"yes"),"GitHub repo: "+(v?"yes":"no")].join("\n");return o.note(t,"Dry run"),void o.outro("Dry run complete \u2014 no files written.")}const L=o.spinner();L.start("Creating project directory..."),await s.ensureDir(P);const D=await g($,P,L),{context:I,hbs:R}=(0,c.buildTemplateContext)(r,u,f,C,{registryUrl:D.registryUrl,registryToken:null!=k?k:D.registryToken,licenseToken:_,profile:m});L.message("Generating server files...");const F=i.join(P,"server"),M=i.join(F,"src");await s.ensureDir(M);for(const{template:e,output:t}of d(m)){const r=(0,c.getTemplatePath)(e),o=(0,c.renderTemplate)(r,I,R),n=i.join(P,t);await s.ensureDir(i.dirname(n)),await s.writeFile(n,o)}if(L.message("Creating demo data skeleton..."),await h(M),await s.ensureDir(i.join(M,"migrations")),C){L.message("Copying storefront...");try{await(0,p.copyStorefront)(P,{mode:"full-project",scenario:"customer",packageName:`${r}-storefront`,capabilities:x,registryToken:null!=k?k:D.registryToken})}catch(e){L.stop("Storefront copy failed.");const t=e instanceof Error?e.message:String(e);o.log.warn(`Storefront copy failed \u2014 you can set it up manually later. (${t})`),L.start("Continuing...")}}w||await(0,l.installDependencies)(P,j,L),E||await(0,l.initRepository)(P,v,b,L),L.stop(`Project "${r}" created successfully!`);const q="npm"===j?"npm run":`${j} run`,N=[`cd ${r}`,null!==(t=D.registryLogin)&&void 0!==t?t:"",$?"":"npx vendure console link","docker compose up -d",`${q} populate`,`${q} dev`,"","Dashboard: http://localhost:3500/dashboard",C?"Storefront: http://localhost:3001":""].filter(Boolean).join("\n");o.note(N,"Next steps"),o.outro("Happy building!")}async function g(e,t,r){if(!e)return(0,u.offlineRegistry)();r.message("Linking the project to Vendure Console...");try{return await e.finish(t)}catch(e){return r.stop("Could not finish linking to Vendure Console."),o.log.warn(`${e instanceof Error?e.message:String(e)} Run "npx vendure console link" in ${t} to finish.`),r.start("Continuing..."),(0,u.offlineRegistry)()}}function m(){const e=[i.join(__dirname,"..","..","scenario-default","assets"),i.join(__dirname,"assets","demo-data")];for(const t of e)if(s.pathExistsSync(t))return t;throw new Error("Could not find scenario-default assets. Tried:\n"+e.map(e=>` - ${e}`).join("\n"))}async function h(e){const t=m(),r=i.join(e,"demo-data");await s.ensureDir(r),await s.copy(i.join(t,"initial-data.json"),i.join(r,"initial-data.json")),await s.copy(i.join(t,"products.csv"),i.join(r,"products.csv")),await s.copy(i.join(t,"images"),i.join(r,"images"))}exports.TEMPLATE_FILES=[{template:"vendure-config.ts.hbs",output:"server/src/vendure-config.ts"},{template:"platform-edition.ts.hbs",output:"server/src/platform-edition.ts",profileOnly:!0},{template:"populate.ts.hbs",output:"server/src/populate.ts"},{template:"migrate.ts.hbs",output:"server/src/migrate.ts"},{template:"custom-populate.ts.hbs",output:"server/src/custom-populate.ts"},{template:"index.ts.hbs",output:"server/src/index.ts"},{template:"server-package.json.hbs",output:"server/package.json"},{template:"root-package.json.hbs",output:"package.json"},{template:"env.hbs",output:".env"},{template:"docker-compose.yml.hbs",output:"docker-compose.yml"},{template:"CLAUDE.md.hbs",output:"CLAUDE.md"},{template:"README.md.hbs",output:"README.md"},{template:"tsconfig.root.json.hbs",output:"tsconfig.json"},{template:"tsconfig.server.json.hbs",output:"server/tsconfig.json"},{template:"vite.config.mts.hbs",output:"server/vite.config.mts"},{template:"tsconfig.dashboard.json.hbs",output:"server/tsconfig.dashboard.json"},{template:"environment.d.ts.hbs",output:"server/src/environment.d.ts"},{template:"gitignore.hbs",output:".gitignore"},{template:"npmrc.hbs",output:".npmrc"},{template:"bunfig.toml.hbs",output:"bunfig.toml"}];
|
|
@@ -20,6 +20,11 @@ export interface CopyStorefrontOptions {
|
|
|
20
20
|
* storefront target.
|
|
21
21
|
*/
|
|
22
22
|
packageName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Capability keys exposed to the storefront as a public build-time
|
|
25
|
+
* composition hint. Omit this list to keep full composition.
|
|
26
|
+
*/
|
|
27
|
+
capabilities?: readonly string[];
|
|
23
28
|
/**
|
|
24
29
|
* Vendure private-registry npm auth token. When supplied, baked into the
|
|
25
30
|
* storefront's `.npmrc` as `_authToken` alongside the scope mapping so
|
|
@@ -28,8 +33,8 @@ export interface CopyStorefrontOptions {
|
|
|
28
33
|
* Only the **registry** token belongs here — the storefront is a Next.js
|
|
29
34
|
* app that doesn't boot a Vendure server, so it has no use for the
|
|
30
35
|
* server-side `licenseToken`. Keeping these separate matches the
|
|
31
|
-
*
|
|
32
|
-
*
|
|
36
|
+
* Vendure Console's model (two distinct credentials) and avoids writing
|
|
37
|
+
* the runtime Environment Credential anywhere it is not needed.
|
|
33
38
|
*/
|
|
34
39
|
registryToken?: string;
|
|
35
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(){var n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},n(e)};return function(r){if(r&&r.__esModule)return r;var i={};if(null!=r)for(var o=n(r),a=0;a<o.length;a++)"default"!==o[a]&&e(i,r,o[a]);return t(i,r),i}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.copyStorefront=s;const r=n(require("crypto")),i=n(require("fs-extra")),o=n(require("path")),a=require("./registry");async function s(e,t){var n;const r=d(),a="storefront-only"===t.mode?e:o.join(e,"storefront");await i.copy(r,a),await l(a,t),await u(a,t.registryToken),await c(a),await p(a,null!==(n=t.packageName)&&void 0!==n?n:o.basename(a))}async function c(e){const t=o.join(e,".gitignore");let n="";await i.pathExists(t)&&(n=await i.readFile(t,"utf8"));const r=n.split("\n").map(e=>e.trim());if(r.includes(".npmrc")||r.includes("/.npmrc"))return;const a=""===n||n.endsWith("\n")?"":"\n";await i.writeFile(t,n+a+".npmrc\n")}async function u(e,t){const n=(0,a.getRegistryUrl)(),r=[`@vendure-platform:registry=${n}`];t&&r.push(`${(0,a.registryAuthTokenKey)(n)}${t}`),await i.writeFile(o.join(e,".npmrc"),r.join("\n")+"\n")}async function l(e,t){var n,a;const s=r.randomBytes(32).toString("hex"),c=null!==(n=t.scenario)&&void 0!==n?n:"customer",u=null!==(a=t.apiUrl)&&void 0!==a?a:"",l=["# Generated by @vendure-platform/create. Safe to edit.","","# Used to authenticate revalidation webhooks. Treat as a secret.",`REVALIDATION_SECRET=${s}`,"",`NEXT_PUBLIC_SCENARIO=${c}`,"","# Public build-time GraphQL composition hint. The server remains authoritative."];void 0!==t.capabilities?l.push(`NEXT_PUBLIC_VENDURE_CAPABILITIES=${t.capabilities.join(",")}`,""):l.push("# Unset means all capabilities.",""),u?l.push("# Vendure Shop API URL.",`VENDURE_SHOP_API_URL=${u}`,""):l.push("# Vendure Shop API URL. Defaults to http://localhost:3500/shop-api when unset.","# VENDURE_SHOP_API_URL=https://shop.example.com/shop-api",""),await i.writeFile(o.join(e,".env.local"),l.join("\n"))}async function p(e,t){const n=o.join(e,"package.json");if(!await i.pathExists(n))return;const r=await i.readJson(n);r.name=f(t),await i.writeJson(n,r,{spaces:4})}function f(e){return e.toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"storefront"}function d(){const e=[o.join(__dirname,"assets","storefront"),o.join(__dirname,"..","dist","assets","storefront")];for(const t of e)if(i.existsSync(t))return t;throw new Error("Bundled storefront not found. Build @vendure-platform/create first (`bunx nx run @vendure-platform/create:build`).")}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CapabilityProfileName } from '@vendure-platform/plugin-meta';
|
|
1
2
|
import Handlebars from 'handlebars';
|
|
2
3
|
import { PluginDefinition } from './types';
|
|
3
4
|
/**
|
|
@@ -46,9 +47,9 @@ export interface TemplateContext {
|
|
|
46
47
|
disabledPluginKeys: string[];
|
|
47
48
|
includeStorefront: boolean;
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* default. See `registry.ts`.
|
|
50
|
+
* Registry URL baked into the project's `.npmrc` scope mapping. Console
|
|
51
|
+
* names it for the linked Project; otherwise it comes from
|
|
52
|
+
* `VENDURE_REGISTRY_URL` or the default. See `registry.ts`.
|
|
52
53
|
*/
|
|
53
54
|
registryUrl: string;
|
|
54
55
|
/**
|
|
@@ -63,7 +64,8 @@ export interface TemplateContext {
|
|
|
63
64
|
* `npmrc.hbs` template to emit the `//<host>/:_authToken=` line when a
|
|
64
65
|
* `registryToken` is supplied. Derived from `registryUrl`.
|
|
65
66
|
*/
|
|
66
|
-
|
|
67
|
+
/** The `//host/:_authToken=` prefix npm looks the credential up by. */
|
|
68
|
+
registryAuthTokenKey: string;
|
|
67
69
|
/**
|
|
68
70
|
* npm auth token for the private registry, when supplied. Baked into the
|
|
69
71
|
* project `.npmrc` as the literal value of `_authToken` (npm doesn't
|
|
@@ -81,6 +83,22 @@ export interface TemplateContext {
|
|
|
81
83
|
* where to paste their token.
|
|
82
84
|
*/
|
|
83
85
|
licenseToken: string;
|
|
86
|
+
/**
|
|
87
|
+
* Capability profile the project was scaffolded for, or `''` for a
|
|
88
|
+
* hand-picked plugin selection. The server config uses it to compose the
|
|
89
|
+
* synchronous plugin graph before License Guard can verify the signed
|
|
90
|
+
* grant. It is not an authorization source.
|
|
91
|
+
*/
|
|
92
|
+
profile: string;
|
|
93
|
+
/** Capabilities needed to compose a hand-picked plugin selection. */
|
|
94
|
+
compositionCapabilities: string[];
|
|
95
|
+
/** The profile's capability grants, for the generated README. */
|
|
96
|
+
capabilityGrants: string[];
|
|
97
|
+
/**
|
|
98
|
+
* Whether the composition needs a Typesense instance. False for a Starter
|
|
99
|
+
* project, which runs the portable search contract on the database engine.
|
|
100
|
+
*/
|
|
101
|
+
usesTypesense: boolean;
|
|
84
102
|
}
|
|
85
103
|
export interface TemplateContextResult {
|
|
86
104
|
context: TemplateContext;
|
|
@@ -88,14 +106,17 @@ export interface TemplateContextResult {
|
|
|
88
106
|
}
|
|
89
107
|
export declare function buildTemplateContext(projectName: string, companyName: string, selectedPluginKeys: ReadonlyArray<string>, includeStorefront: boolean, options?: {
|
|
90
108
|
versionOverride?: string;
|
|
109
|
+
/** The origin Console named for this Project. Falls back to the default. */
|
|
110
|
+
registryUrl?: string;
|
|
91
111
|
registryToken?: string;
|
|
92
112
|
licenseToken?: string;
|
|
113
|
+
profile?: CapabilityProfileName;
|
|
93
114
|
}): TemplateContextResult;
|
|
94
115
|
/**
|
|
95
116
|
* Render a Handlebars template file with the given context.
|
|
96
117
|
*
|
|
97
118
|
* For `*package.json.hbs` templates the dependency blocks are re-sorted
|
|
98
|
-
* lexicographically before returning — the `
|
|
119
|
+
* lexicographically before returning — the `platformDependencies` helper
|
|
99
120
|
* emits entries in `PLUGIN_ORDER` (meaningful at runtime, noisy in
|
|
100
121
|
* `package.json`), so sorting at the render boundary keeps the
|
|
101
122
|
* generated file tidy and stable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,o)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),r=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),t=this&&this.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(e){var r=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r},t(e)};return function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var i=t(n),s=0;s<i.length;s++)"default"!==i[s]&&e(o,n,i[s]);return r(o,n),o}}(),n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolvePluginVersionSpec=c,exports.buildTemplateContext=m,exports.renderTemplate=d,exports.getTemplatePath=v;const o=require("@vendure-platform/plugin-meta"),i=t(require("fs")),s=n(require("handlebars")),a=t(require("path")),l=require("./plugin-registry"),u=require("./registry"),p=require("./sort-package-json");function c(e){const r=null!=e?e:f();return r.includes("-")?"nightly":`^${r}`}function f(){const e=a.join(__dirname,"..","package.json");return JSON.parse(i.readFileSync(e,"utf8")).version}function g(e,r,t,n){const i=s.default.create(),a=new Set(e);return i.registerHelper("ifPlugin",function(e,r){return a.has(e)?r.fn(this):r.inverse(this)}),i.registerHelper("platformDependencies",function(){const r=(n?[(0,l.facadePackageName)(n)]:["@vendure-platform/platform","@vendure-platform/integration",...e.map(e=>(0,l.getPlugin)(e).packageName)]).map(e=>` "${e}": "${t}"`);return new i.SafeString(",\n"+r.join(",\n"))}),i.registerHelper("platformPackageExcludes",function(){const e=["@vendure-platform/cli","@vendure-platform/data-populator","@vendure-platform/integration","@vendure-platform/platform","@vendure-platform/scenario-default","@vendure-platform/storefront-client",...l.FACADE_PACKAGE_NAMES],r=l.pluginRegistry.map(e=>e.packageName),t=Array.from(new Set([...e,...r])).sort().map(e=>` "${e}",`);return new i.SafeString(t.join("\n"))}),i.registerHelper("platformPluginImports",function(){const r=["import { VendurePlatform } from '@vendure-platform/platform';"];for(const t of e){const e=(0,l.resolvePluginExtras)((0,l.getPlugin)(t),n).platformImports;e&&r.push(...e)}const t=e.map(e=>(0,l.getPlugin)(e).platformKey);for(const e of(0,o.resolveIntegrationOverlays)(t))r.push(`import '${(0,o.integrationOverlayModule)(e.id)}';`);return new i.SafeString(r.join("\n"))}),i.registerHelper("platformPluginOptions",function(){const t=[];for(const r of e){const e=(0,l.resolvePluginExtras)((0,l.getPlugin)(r),n).platformOptionsBlock;e&&t.push(` ${i.compile(e)(this)},`)}for(const e of r)t.push(` ${(0,l.getPlugin)(e).platformKey}: false,`);return new i.SafeString(t.join("\n"))}),i}function m(e,r,t,n,i={}){var s,a,p;const f=i.profile,m=(0,l.resolveActivePluginKeys)(t),d=m.map(e=>(0,l.getPlugin)(e)),v=new Set(m),y=l.pluginRegistry.filter(e=>"optional"===e.tier&&!v.has(e.key)).map(e=>e.key),h=c(i.versionOverride),P=f?[...o.CAPABILITY_PROFILES[f]]:[],_=!f||P.includes("search.engine.typesense"),S=null!==(s=i.registryUrl)&&void 0!==s?s:(0,u.getRegistryUrl)();return{context:{projectName:e,companyName:r,resolvedPluginKeys:m,resolvedPlugins:d,disabledPluginKeys:y,includeStorefront:n,registryUrl:S,registryAuthTokenKey:(0,u.registryAuthTokenKey)(S),pluginVersionSpec:h,registryToken:null!==(a=i.registryToken)&&void 0!==a?a:"",licenseToken:null!==(p=i.licenseToken)&&void 0!==p?p:"",profile:null!=f?f:"",compositionCapabilities:f?[]:(0,l.resolveCompositionCapabilities)(m),capabilityGrants:P,usesTypesense:_},hbs:g(m,y,h,f)}}function d(e,r,t){const n=i.readFileSync(e,"utf8"),o=t.compile(n,{noEscape:!0})(r);return a.basename(e).endsWith("package.json.hbs")?(0,p.sortPackageJson)(o):o}function v(e){const r=[a.join(__dirname,"assets","templates",e),a.join(__dirname,"..","assets","templates",e)];for(const e of r)if(i.existsSync(e))return e;throw new Error(`Template not found: ${e}\n __dirname: ${__dirname}\n Searched:\n${r.map(e=>` - ${e} (exists: ${i.existsSync(a.dirname(e))})`).join("\n")}`)}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import type { PluginMeta } from '@vendure-platform/plugin-meta';
|
|
1
|
+
import type { CapabilityProfileName, PluginMeta } from '@vendure-platform/plugin-meta';
|
|
2
|
+
import type { ConsoleOnboarding } from './console-onboarding';
|
|
2
3
|
export interface ScaffoldOptions {
|
|
3
4
|
projectName: string;
|
|
4
5
|
companyName: string;
|
|
5
6
|
selectedPlugins: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Capability profile the project is scaffolded for. Drives which packages,
|
|
9
|
+
* options blocks, environment variables, and infrastructure services are
|
|
10
|
+
* emitted. Omitted for a hand-picked plugin selection.
|
|
11
|
+
*/
|
|
12
|
+
profile?: CapabilityProfileName;
|
|
6
13
|
includeStorefront: boolean;
|
|
7
14
|
createGithubRepo: boolean;
|
|
8
15
|
githubOrg?: string;
|
|
@@ -15,33 +22,35 @@ export interface ScaffoldOptions {
|
|
|
15
22
|
skipGit?: boolean;
|
|
16
23
|
dryRun?: boolean;
|
|
17
24
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* gitignored so the token never gets committed.
|
|
25
|
+
* A Registry Access Token supplied on the command line, for CI and offline
|
|
26
|
+
* scaffolds. The interactive flow does not ask for one: it signs in to
|
|
27
|
+
* Console and has Console issue a scoped token instead.
|
|
22
28
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* token, pastes it into `.npmrc` manually, or sets up `~/.npmrc`.
|
|
29
|
+
* When present it is baked into the project `.npmrc` as the `_authToken`
|
|
30
|
+
* line, which `.gitignore` covers so the literal never gets committed.
|
|
26
31
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* checked at server boot.
|
|
32
|
+
* Distinct from `licenseToken`. This one controls package downloads; that
|
|
33
|
+
* one is checked at server boot.
|
|
30
34
|
*/
|
|
31
35
|
registryToken?: string;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* `
|
|
36
|
-
*
|
|
37
|
+
* An Environment Credential supplied on the command line, for CI and
|
|
38
|
+
* offline scaffolds. The interactive flow does not ask for one and writes
|
|
39
|
+
* no secret into `.env`: `vendure dev` reads the credential that
|
|
40
|
+
* `vendure console link` wrote to `.vendure/credentials.json`.
|
|
37
41
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* flag emitted into `.env` by default.
|
|
42
|
+
* When present it is written into `.env` as
|
|
43
|
+
* `VENDURE_PLATFORM_LICENSE_TOKEN`, which License Guard reads at boot.
|
|
41
44
|
*
|
|
42
|
-
*
|
|
45
|
+
* Distinct from `registryToken`.
|
|
43
46
|
*/
|
|
44
47
|
licenseToken?: string;
|
|
48
|
+
/**
|
|
49
|
+
* What the interactive flow learned from Console, and how to finish once
|
|
50
|
+
* the project directory exists. Absent for a non-interactive or offline
|
|
51
|
+
* scaffold.
|
|
52
|
+
*/
|
|
53
|
+
consoleOnboarding?: ConsoleOnboarding;
|
|
45
54
|
}
|
|
46
55
|
export type PackageManager = 'bun' | 'npm' | 'pnpm';
|
|
47
56
|
export interface StorefrontOnlyOptions {
|
|
@@ -50,6 +59,8 @@ export interface StorefrontOnlyOptions {
|
|
|
50
59
|
apiUrl?: string;
|
|
51
60
|
/** Scenario baked into `NEXT_PUBLIC_SCENARIO`. Default: `customer`. */
|
|
52
61
|
scenario: string;
|
|
62
|
+
/** Capability keys baked into the public storefront composition hint. */
|
|
63
|
+
capabilities?: readonly string[];
|
|
53
64
|
packageManager: PackageManager;
|
|
54
65
|
skipInstall?: boolean;
|
|
55
66
|
skipGit?: boolean;
|
|
@@ -57,6 +68,8 @@ export interface StorefrontOnlyOptions {
|
|
|
57
68
|
}
|
|
58
69
|
export interface CliFlags {
|
|
59
70
|
plugins?: string;
|
|
71
|
+
/** `starter` | `growth` | `scale` | `enterprise`. */
|
|
72
|
+
profile?: string;
|
|
60
73
|
company?: string;
|
|
61
74
|
storefront?: boolean;
|
|
62
75
|
github?: boolean;
|
|
@@ -68,10 +81,21 @@ export interface CliFlags {
|
|
|
68
81
|
apiUrl?: string;
|
|
69
82
|
scenario?: string;
|
|
70
83
|
pm?: PackageManager;
|
|
71
|
-
/**
|
|
84
|
+
/** Registry Access Token for CI and offline scaffolds (see `ScaffoldOptions.registryToken`). */
|
|
72
85
|
registryToken?: string;
|
|
73
|
-
/**
|
|
86
|
+
/** Environment Credential for CI and offline scaffolds (see `ScaffoldOptions.licenseToken`). */
|
|
74
87
|
licenseToken?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The Console Project this scaffold is for, chosen by id instead of asked
|
|
90
|
+
* for.
|
|
91
|
+
*
|
|
92
|
+
* Answers the one question the Console path cannot answer from flags. The
|
|
93
|
+
* rest of the flow is unchanged: the session still has to exist, the
|
|
94
|
+
* edition is still read from the Project, and a Project the account does
|
|
95
|
+
* not hold is an error rather than a new Project. Creating one is a
|
|
96
|
+
* decision, and a run that names an id has already made a different one.
|
|
97
|
+
*/
|
|
98
|
+
consoleProject?: string;
|
|
75
99
|
}
|
|
76
100
|
/**
|
|
77
101
|
* Scaffolder-specific data for a plugin — env vars, options-block template
|
|
@@ -94,10 +118,17 @@ export interface ScaffolderPluginExtras {
|
|
|
94
118
|
*/
|
|
95
119
|
platformOptionsBlock: string;
|
|
96
120
|
/**
|
|
97
|
-
* Extra
|
|
98
|
-
*
|
|
121
|
+
* Extra imports the generated config needs. These can supply values used
|
|
122
|
+
* by `platformOptionsBlock` or expose an optional peer package to Vendure's
|
|
123
|
+
* static Dashboard extension scanner.
|
|
99
124
|
*/
|
|
100
125
|
platformImports?: string[];
|
|
126
|
+
/**
|
|
127
|
+
* Per-profile replacements for the fields above. A profile that grants a
|
|
128
|
+
* different implementation of the same plugin (e.g. the database search
|
|
129
|
+
* engine in Starter) needs different options and environment variables.
|
|
130
|
+
*/
|
|
131
|
+
profileOverrides?: Partial<Record<CapabilityProfileName, Partial<ScaffolderPluginExtras>>>;
|
|
101
132
|
}
|
|
102
133
|
/**
|
|
103
134
|
* The joined view used by the scaffolder: shared metadata + scaffolder extras.
|
package/package.json
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure-platform/create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-major.202609091053.0.0",
|
|
4
4
|
"description": "CLI tool to scaffold a Vendure demo project with Vendure Platform plugins",
|
|
5
|
+
"vendurePlugin": {
|
|
6
|
+
"slug": "create",
|
|
7
|
+
"name": "Create",
|
|
8
|
+
"tagline": "Scaffold a Vendure Platform project for the edition the project licenses.",
|
|
9
|
+
"description": "Asks Console which project this is and writes the matching edition facade, the VendurePlatform options for that edition, Docker infrastructure, demo data, and an optional Next.js storefront. Runs under npx with no registry token.",
|
|
10
|
+
"category": "tooling",
|
|
11
|
+
"requiredCapabilities": [],
|
|
12
|
+
"docsPath": "getting-started/quick-start",
|
|
13
|
+
"pluginClasses": [],
|
|
14
|
+
"kind": "tooling"
|
|
15
|
+
},
|
|
5
16
|
"license": "MIT",
|
|
6
17
|
"repository": {
|
|
7
18
|
"type": "git",
|
|
@@ -38,7 +49,8 @@
|
|
|
38
49
|
},
|
|
39
50
|
"dependencies": {
|
|
40
51
|
"@clack/prompts": "^0.10.0",
|
|
41
|
-
"@vendure-platform/
|
|
52
|
+
"@vendure-platform/console-auth": "1.0.0-major.202609091053.0.0",
|
|
53
|
+
"@vendure-platform/plugin-meta": "1.0.0-major.202609091053.0.0",
|
|
42
54
|
"commander": "^13.1.0",
|
|
43
55
|
"fs-extra": "^11.3.0",
|
|
44
56
|
"handlebars": "^4.7.8",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import createMiddleware from 'next-intl/middleware';
|
|
2
|
-
import {routing} from './i18n/routing';
|
|
3
|
-
|
|
4
|
-
// Next.js 16 renamed "middleware" to "proxy" but next-intl still uses the
|
|
5
|
-
// middleware convention. The deprecation warning is cosmetic and doesn't
|
|
6
|
-
// affect functionality.
|
|
7
|
-
export default createMiddleware(routing);
|
|
8
|
-
|
|
9
|
-
export const config = {
|
|
10
|
-
matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'],
|
|
11
|
-
};
|