@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
|
@@ -5,7 +5,7 @@ A Vendure e-commerce demo project for **{{companyName}}**, scaffolded with `@ven
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
7
|
- Node.js >= 22
|
|
8
|
-
- Docker & Docker Compose (for PostgreSQL and Typesense)
|
|
8
|
+
- Docker & Docker Compose (for PostgreSQL{{#if usesTypesense}} and Typesense{{/if}})
|
|
9
9
|
|
|
10
10
|
## Setup
|
|
11
11
|
|
|
@@ -35,12 +35,36 @@ The storefront will be available at `http://localhost:3001`.
|
|
|
35
35
|
| `npm run dev` | Start all services in development mode |
|
|
36
36
|
| `npm run build:dashboard` | Build the admin dashboard for production |
|
|
37
37
|
| `npm run populate` | Seed the database with demo data |
|
|
38
|
+
| `npm run migration:generate -- <name>` | Diff the entities against the database and write a migration |
|
|
39
|
+
| `npm run migration:run` | Apply pending migrations |
|
|
40
|
+
|
|
41
|
+
Run from `server/`. The Vendure CLI is installed too, with the Vendure Platform
|
|
42
|
+
plugin enabled:
|
|
43
|
+
|
|
44
|
+
| Command | Description |
|
|
45
|
+
|---------|-------------|
|
|
46
|
+
| `npx vendure downgrade-impact` | After changing to a lower edition, report the tables the departed packages left behind |
|
|
38
47
|
|
|
39
48
|
## Installed Plugins
|
|
40
49
|
|
|
41
50
|
{{#each resolvedPlugins}}
|
|
42
51
|
- **{{this.displayName}}** (`{{this.packageName}}`)
|
|
43
52
|
{{/each}}
|
|
53
|
+
{{#if profile}}
|
|
54
|
+
|
|
55
|
+
## Capability Profile
|
|
56
|
+
|
|
57
|
+
This project is scaffolded for the **{{profile}}** profile. The packages and
|
|
58
|
+
configuration above match these capability grants:
|
|
59
|
+
|
|
60
|
+
{{#each capabilityGrants}}
|
|
61
|
+
- `{{this}}`
|
|
62
|
+
{{/each}}
|
|
63
|
+
|
|
64
|
+
Grants are authorized at runtime by the signed license token in
|
|
65
|
+
`VENDURE_PLATFORM_LICENSE_TOKEN`, never by this list. A module configured
|
|
66
|
+
without its grant stops the server before it serves traffic.
|
|
67
|
+
{{/if}}
|
|
44
68
|
|
|
45
69
|
## Demo Accounts
|
|
46
70
|
|
|
@@ -9,6 +9,7 @@ services:
|
|
|
9
9
|
- '5432:5432'
|
|
10
10
|
volumes:
|
|
11
11
|
- postgres-data:/var/lib/postgresql/data
|
|
12
|
+
{{#if usesTypesense}}
|
|
12
13
|
|
|
13
14
|
typesense:
|
|
14
15
|
image: typesense/typesense:28.0
|
|
@@ -19,7 +20,10 @@ services:
|
|
|
19
20
|
- '8110:8108'
|
|
20
21
|
volumes:
|
|
21
22
|
- typesense-data:/data
|
|
23
|
+
{{/if}}
|
|
22
24
|
|
|
23
25
|
volumes:
|
|
24
26
|
postgres-data:
|
|
27
|
+
{{#if usesTypesense}}
|
|
25
28
|
typesense-data:
|
|
29
|
+
{{/if}}
|
|
@@ -14,26 +14,32 @@ SUPERADMIN_USERNAME=superadmin
|
|
|
14
14
|
SUPERADMIN_PASSWORD=superadmin
|
|
15
15
|
|
|
16
16
|
# Vendure Platform License
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
# enforcement. The flag is only ever read when no token is configured — once
|
|
25
|
-
# you set a real token, the soft-mode code path is no longer reachable.
|
|
17
|
+
# Leave this empty in development. `vendure console link` writes this project's
|
|
18
|
+
# Environment Credential to .vendure/credentials.json, and `vendure dev` passes
|
|
19
|
+
# it to the server, so there is nothing to paste here and no secret sitting in
|
|
20
|
+
# a file your editor has open.
|
|
21
|
+
#
|
|
22
|
+
# In production, set this to that environment's Environment Credential from the
|
|
23
|
+
# Installations page in Vendure Console, through whatever holds your secrets.
|
|
26
24
|
VENDURE_PLATFORM_LICENSE_TOKEN={{licenseToken}}
|
|
25
|
+
# Lets the server start with no credential at all, for a look around before you
|
|
26
|
+
# link. Read only when VENDURE_PLATFORM_LICENSE_TOKEN is empty and no credential
|
|
27
|
+
# was supplied, so a linked project never reaches it.
|
|
27
28
|
VENDURE_PLATFORM_LICENSE_GUARD_LOCAL_DEV=1
|
|
28
29
|
|
|
30
|
+
{{#if usesTypesense}}
|
|
29
31
|
# Advanced Search (Typesense)
|
|
30
32
|
TYPESENSE_API_KEY=your-typesense-api-key
|
|
31
33
|
TYPESENSE_HOST=localhost
|
|
32
34
|
TYPESENSE_PORT=8110
|
|
33
35
|
TYPESENSE_PROTOCOL=http
|
|
34
36
|
|
|
37
|
+
{{/if}}
|
|
35
38
|
# Workflow Engine
|
|
36
39
|
WORKFLOW_ENGINE_SCHEMA=dbos
|
|
40
|
+
# The docker-compose Postgres above does not speak SSL. Set this to `true`
|
|
41
|
+
# against a managed database that requires it.
|
|
42
|
+
WORKFLOW_ENGINE_SSL=false
|
|
37
43
|
|
|
38
44
|
{{#ifPlugin "sso"}}
|
|
39
45
|
# SSO (Google OIDC)
|
|
@@ -46,6 +52,25 @@ VENDURE_HOST=http://localhost:3500
|
|
|
46
52
|
# Audit Trail
|
|
47
53
|
AUDIT_LOG_SCHEMA=audit_trail
|
|
48
54
|
|
|
55
|
+
{{/ifPlugin}}
|
|
56
|
+
{{#ifPlugin "punchout"}}
|
|
57
|
+
# PunchOut
|
|
58
|
+
# Where a buyer's PunchOut session lands. The cXML setup response sends the
|
|
59
|
+
# buyer to this URL, so it must be the storefront the trading partner reaches.
|
|
60
|
+
PUNCHOUT_STOREFRONT_URL=http://localhost:3000
|
|
61
|
+
|
|
62
|
+
{{/ifPlugin}}
|
|
63
|
+
{{#ifPlugin "sso-federation"}}
|
|
64
|
+
# SAML SSO (sso.federation)
|
|
65
|
+
# A SAML provider is registered only when SAML_IDP_SSO_URL is set. Leave these
|
|
66
|
+
# empty until you have an identity provider: an unconfigured SAML provider
|
|
67
|
+
# cannot complete a login, and a second provider makes this configuration
|
|
68
|
+
# unloadable on any edition that does not grant sso.federation.
|
|
69
|
+
SAML_SP_ENTITY_ID=
|
|
70
|
+
SAML_IDP_ENTITY_ID=
|
|
71
|
+
SAML_IDP_SSO_URL=
|
|
72
|
+
SAML_IDP_CERTIFICATE=
|
|
73
|
+
|
|
49
74
|
{{/ifPlugin}}
|
|
50
75
|
{{#if includeStorefront}}
|
|
51
76
|
# Storefront
|
|
@@ -17,6 +17,7 @@ declare namespace NodeJS {
|
|
|
17
17
|
TYPESENSE_PORT?: string;
|
|
18
18
|
TYPESENSE_PROTOCOL?: string;
|
|
19
19
|
WORKFLOW_ENGINE_SCHEMA?: string;
|
|
20
|
+
WORKFLOW_ENGINE_SSL?: string;
|
|
20
21
|
VENDURE_PLATFORM_LICENSE_TOKEN?: string;
|
|
21
22
|
VENDURE_PLATFORM_LICENSE_GUARD_LOCAL_DEV?: string;
|
|
22
23
|
{{#ifPlugin "sso"}}
|
|
@@ -2,12 +2,15 @@ node_modules/
|
|
|
2
2
|
dist/
|
|
3
3
|
.next/
|
|
4
4
|
.env
|
|
5
|
-
# .npmrc
|
|
6
|
-
#
|
|
7
|
-
# If you need a token-less version for CI, write a short script that strips
|
|
8
|
-
# the `_authToken=` line at publish time.
|
|
5
|
+
# .npmrc carries the literal Registry Access Token, so it is never committed.
|
|
6
|
+
# For CI, write a fresh .npmrc at deploy time from a secret.
|
|
9
7
|
.npmrc
|
|
10
8
|
storefront/.npmrc
|
|
9
|
+
# .vendure holds the Project Link Manifest, which is identity metadata and is
|
|
10
|
+
# meant to be committed, next to the development credential, which is a secret
|
|
11
|
+
# and is not. Ignore the directory and un-ignore the one file.
|
|
12
|
+
.vendure/*
|
|
13
|
+
!.vendure/project.json
|
|
11
14
|
*.tsbuildinfo
|
|
12
15
|
static/assets/
|
|
13
16
|
src/gql/
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as dotenv from 'dotenv';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
dotenv.config({ path: path.resolve(__dirname, '../../.env') });
|
|
4
|
+
|
|
5
|
+
import { generateMigration, runMigrations } from '@vendure/core';
|
|
6
|
+
|
|
7
|
+
import { config } from './vendure-config';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Migration runner for this project.
|
|
11
|
+
*
|
|
12
|
+
* `vendure-config.ts` only enables TypeORM's `synchronize` in development.
|
|
13
|
+
* Every other environment applies schema changes through the migration files
|
|
14
|
+
* in `src/migrations`, so generate one whenever a plugin's entities change and
|
|
15
|
+
* run them before the server boots.
|
|
16
|
+
*
|
|
17
|
+
* npm run migration:generate -- <name> # diff against this database
|
|
18
|
+
* npm run migration:generate -- <name> --from-empty # full baseline schema
|
|
19
|
+
* npm run migration:run # apply pending migrations
|
|
20
|
+
*
|
|
21
|
+
* `--from-empty` diffs the entity metadata against a temporary empty database
|
|
22
|
+
* instead of this one, so it emits a complete "zero to current schema"
|
|
23
|
+
* migration. Use it for the first migration of a project whose schema was
|
|
24
|
+
* created by `synchronize`, where a plain diff would find nothing to write.
|
|
25
|
+
*/
|
|
26
|
+
async function main(): Promise<void> {
|
|
27
|
+
const args = process.argv.slice(2);
|
|
28
|
+
const command = args[0];
|
|
29
|
+
const fromEmpty = args.includes('--from-empty');
|
|
30
|
+
const name = args.slice(1).find((arg) => !arg.startsWith('--'));
|
|
31
|
+
|
|
32
|
+
if (command === 'generate') {
|
|
33
|
+
if (!name) {
|
|
34
|
+
throw new Error('Usage: npm run migration:generate -- <name> [--from-empty]');
|
|
35
|
+
}
|
|
36
|
+
await generateMigration(config, {
|
|
37
|
+
name,
|
|
38
|
+
fromEmpty,
|
|
39
|
+
outputDir: path.join(__dirname, './migrations'),
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (command === 'run') {
|
|
45
|
+
await runMigrations(config);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
throw new Error(`Unknown migration command "${command ?? ''}". Use "generate" or "run".`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
main().catch((err: unknown) => {
|
|
53
|
+
console.error(err);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
});
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
@vendure-platform:registry={{registryUrl}}
|
|
2
|
-
{{#if registryToken}}
|
|
3
|
-
{{/if}}
|
|
2
|
+
{{#if registryToken}}{{registryAuthTokenKey}}{{registryToken}}
|
|
3
|
+
{{/if}}
|
|
4
|
+
; The server depends on one edition facade, not on each capability package.
|
|
5
|
+
; pnpm's strict layout would then hide those packages from `import
|
|
6
|
+
; '@vendure-platform/quote-management'`, so hoist the whole scope into the
|
|
7
|
+
; project's node_modules root. npm and bun hoist by default and ignore this.
|
|
8
|
+
public-hoist-pattern[]=@vendure-platform/*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendure Platform edition configuration.
|
|
3
|
+
*
|
|
4
|
+
* The Vendure CLI maintains this file. `vendure edition prepare <edition>`
|
|
5
|
+
* replaces it in full, so an edit made here is lost at the next edition change.
|
|
6
|
+
* Put your own configuration in `vendure-config.ts` instead.
|
|
7
|
+
*
|
|
8
|
+
* @vendure-platform/cli:edition-config
|
|
9
|
+
*/
|
|
10
|
+
import type { VendurePlatformOptions } from '@vendure-platform/platform';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The edition this deployment composes.
|
|
14
|
+
*
|
|
15
|
+
* A composition hint, never an authorization source. License Guard compares the
|
|
16
|
+
* modules this composes against the signed Entitlement Grant while booting and
|
|
17
|
+
* fails closed when they disagree.
|
|
18
|
+
*/
|
|
19
|
+
export const platformEdition = {
|
|
20
|
+
capabilityProfile: '{{profile}}',
|
|
21
|
+
} satisfies Pick<VendurePlatformOptions, 'capabilityProfile'>;
|
|
@@ -9,24 +9,31 @@
|
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"build:dashboard": "vite build",
|
|
11
11
|
"start": "node dist/index.js",
|
|
12
|
-
"populate": "node --require ts-node/register src/populate.ts"
|
|
12
|
+
"populate": "node --require ts-node/register src/populate.ts",
|
|
13
|
+
"migration:generate": "node --require ts-node/register src/migrate.ts generate",
|
|
14
|
+
"migration:run": "node --require ts-node/register src/migrate.ts run"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"@vendure/core": "^3.
|
|
16
|
-
"@vendure/dashboard": "^3.
|
|
17
|
-
"@vendure/asset-server-plugin": "^3.
|
|
17
|
+
"@vendure/core": "^3.8.0-0",
|
|
18
|
+
"@vendure/dashboard": "^3.8.0-0",
|
|
19
|
+
"@vendure/asset-server-plugin": "^3.8.0-0",
|
|
18
20
|
"typeorm": "^0.3.27",
|
|
19
21
|
"@vendure-platform/data-populator": "{{pluginVersionSpec}}",
|
|
20
|
-
"@vendure-platform/integration": "{{pluginVersionSpec}}",
|
|
21
22
|
"@vendure-platform/scenario-default": "{{pluginVersionSpec}}",
|
|
22
|
-
"
|
|
23
|
-
"dotenv": "^16.4.7"{{pluginDependencies}}
|
|
23
|
+
"dotenv": "^16.4.7"{{platformDependencies}}
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"vite": "^6.3.5",
|
|
27
27
|
"ts-node": "^10.9.2",
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
29
|
"@types/node": "^22.0.0",
|
|
30
|
-
"@vendure/
|
|
30
|
+
"@vendure/cli": "^3.8.0-0",
|
|
31
|
+
"@vendure/testing": "^3.8.0-0",
|
|
32
|
+
"@vendure-platform/cli": "{{pluginVersionSpec}}"
|
|
33
|
+
},
|
|
34
|
+
"vendure": {
|
|
35
|
+
"cli": {
|
|
36
|
+
"plugins": ["@vendure-platform/cli"]
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
39
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{{platformPluginImports}}
|
|
2
|
+
{{#if profile}}
|
|
3
|
+
import { platformEdition } from './platform-edition';
|
|
4
|
+
{{/if}}
|
|
2
5
|
import { AssetServerPlugin } from '@vendure/asset-server-plugin';
|
|
3
6
|
import {
|
|
4
7
|
configureDefaultOrderProcess,
|
|
5
8
|
DefaultJobQueuePlugin,
|
|
9
|
+
DefaultSchedulerPlugin,
|
|
6
10
|
dummyPaymentHandler,
|
|
7
11
|
NativeAuthenticationStrategy,
|
|
8
12
|
VendureConfig,
|
|
@@ -72,7 +76,21 @@ export const config: VendureConfig = {
|
|
|
72
76
|
DefaultJobQueuePlugin.init({
|
|
73
77
|
pollInterval: 2000,
|
|
74
78
|
}),
|
|
79
|
+
// Without a scheduler plugin Vendure uses `NoopSchedulerStrategy`, and
|
|
80
|
+
// every scheduled task the platform plugins declare never runs.
|
|
81
|
+
DefaultSchedulerPlugin.init({}),
|
|
75
82
|
...VendurePlatform.init({
|
|
83
|
+
{{#if profile}}
|
|
84
|
+
// The edition this deployment composes. The Vendure CLI maintains
|
|
85
|
+
// `platform-edition.ts`; keep your own options below it.
|
|
86
|
+
...platformEdition,
|
|
87
|
+
{{else}}
|
|
88
|
+
compositionCapabilities: [
|
|
89
|
+
{{#each compositionCapabilities}}
|
|
90
|
+
'{{this}}',
|
|
91
|
+
{{/each}}
|
|
92
|
+
],
|
|
93
|
+
{{/if}}
|
|
76
94
|
{{platformPluginOptions}}
|
|
77
95
|
}),
|
|
78
96
|
DashboardPlugin.init({
|
package/dist/bin/run.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n
|
|
2
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,o,t,n){void 0===n&&(n=t);var r=Object.getOwnPropertyDescriptor(o,t);r&&!("get"in r?!o.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return o[t]}}),Object.defineProperty(e,n,r)}:function(e,o,t,n){void 0===n&&(n=t),e[n]=o[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}:function(e,o){e.default=o}),t=this&&this.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(e){var o=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[o.length]=t);return o},t(e)};return function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i=t(n),s=0;s<i.length;s++)"default"!==i[s]&&e(r,n,i[s]);return o(r,n),r}}();Object.defineProperty(exports,"__esModule",{value:!0});const n=require("commander"),r=t(require("fs")),i=t(require("path")),s=require("../add-to-existing"),a=require("../cli"),l=require("../scaffold-storefront-only"),c=require("../scaffolder");function u(){const e=i.join(__dirname,"..","..","package.json");return JSON.parse(r.readFileSync(e,"utf8")).version}const f=(new n.Command).name("create-vendure-platform").description("Scaffold a Vendure project with Vendure Platform plugins, or a standalone storefront").version(u(),"-v, --version").enablePositionalOptions();f.command("add").description("Add Vendure Platform to an existing Vendure project (run from the project root)").option("--plugins <list>","Comma-separated list of plugin keys to include (skips the interactive prompt)").option("--registry-token <token>","Registry Access Token for CI and offline scaffolds (written to project .npmrc as _authToken). The interactive flow gets one from Vendure Console instead").option("--license-token <token>","Environment Credential for CI and offline scaffolds (written to .env as VENDURE_PLATFORM_LICENSE_TOKEN). The interactive flow leaves this to vendure dev").option("--dry-run","Show what would be changed without writing files").action(async e=>{const o=await(0,s.runAddToExistingCli)({plugins:e.plugins,dryRun:e.dryRun,registryToken:e.registryToken,licenseToken:e.licenseToken});await(0,s.addToExisting)(o)}),f.argument("[project-name]","Name of the project to create").option("--plugins <list>","Comma-separated list of plugin keys to include").option("--profile <name>","Capability profile to scaffold (starter|growth|scale|enterprise). Resolves the plugin set, options, and services from the profile grants").option("--company <name>","Company name for the demo project").option("--no-storefront","Skip the Next.js storefront").option("--github","Create a GitHub repository").option("--github-org <org>","GitHub organization (only used with --github)","vendurehq").option("--no-github","Do not create a GitHub repository").option("--no-install","Skip dependency install").option("--no-git","Skip git init").option("--dry-run","Show what would be created without writing files").option("--storefront-only","Scaffold just the Next.js storefront, no server or plugins").option("--api-url <url>","Vendure Shop API URL (storefront-only mode)").option("--scenario <name>","Storefront scenario (storefront-only mode; default: customer)").option("--pm <bun|npm|pnpm>","Package manager used for the install step (default: bun)").option("--registry-token <token>","Registry Access Token for CI and offline scaffolds (written to project .npmrc as _authToken). The interactive flow gets one from Vendure Console instead").option("--license-token <token>","Environment Credential for CI and offline scaffolds (written to .env as VENDURE_PLATFORM_LICENSE_TOKEN). The interactive flow leaves this to vendure dev").option("--console-project <id>","Use this Vendure Console Project instead of asking which one this is. Needs a stored Console session, or VENDURE_HUB_PROJECTS naming a file that lists it").action(async(e,o)=>{const t={plugins:o.plugins,profile:o.profile,company:o.company,storefront:o.storefront,github:o.github,githubOrg:o.githubOrg,install:o.install,git:o.git,dryRun:o.dryRun,storefrontOnly:o.storefrontOnly,apiUrl:o.apiUrl,scenario:o.scenario,pm:o.pm,registryToken:o.registryToken,licenseToken:o.licenseToken,consoleProject:o.consoleProject};if(t.storefrontOnly){const o=await(0,a.runStorefrontOnlyCli)(e,t);return void await(0,l.scaffoldStorefrontOnly)(o)}const n=await(0,a.runCli)(e,t);await(0,c.scaffold)(n)}),f.parseAsync().catch(e=>{"ConsoleOnboardingCancelled"===(null==e?void 0:e.name)&&(console.log(e.message),process.exit(0)),console.error("Error:",e.message),process.exit(1)});
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ScaffoldOptions, StorefrontOnlyOptions
|
|
1
|
+
import { CliFlags, ScaffoldOptions, StorefrontOnlyOptions } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Run the CLI in storefront-only mode. Returns options for `scaffoldStorefrontOnly`.
|
|
4
4
|
* Interactive prompts kick in for any value not provided via flags.
|
package/dist/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,n,
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,n,o,i){void 0===i&&(i=o);var r=Object.getOwnPropertyDescriptor(n,o);r&&!("get"in r?!n.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(e,i,r)}:function(e,n,o,i){void 0===i&&(i=o),e[i]=n[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),o=this&&this.__importStar||function(){var o=function(e){return o=Object.getOwnPropertyNames||function(e){var n=[];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[n.length]=o);return n},o(e)};return function(i){if(i&&i.__esModule)return i;var r={};if(null!=i)for(var t=o(i),l=0;l<t.length;l++)"default"!==t[l]&&e(r,i,t[l]);return n(r,i),r}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runStorefrontOnlyCli=h,exports.runCli=j;const i=o(require("@clack/prompts")),r=o(require("path")),t=require("./console-onboarding"),l=require("./hub-projects"),a=require("./plugin-registry");function s(e){if(e){if(!(0,a.isCapabilityProfileName)(e))throw new Error(`Invalid --profile value "${e}". Must be one of: ${a.CAPABILITY_PROFILE_NAMES.join(", ")}`);return e}}const c=["bun","npm","pnpm"];function u(e){if(!e)return"bun";if(c.includes(e))return e;throw new Error(`Invalid --pm value "${e}". Must be one of: ${c.join(", ")}`)}function d(e){if(e)try{return new URL(e),e}catch{throw new Error(`Invalid --api-url value "${e}": not a valid URL`)}}function p(e){return 0===e.trim().length?"Project name is required":/[^a-zA-Z0-9._-]/.test(e)?"Project name may only contain letters, numbers, dots, hyphens, and underscores":void 0}function v(){return a.pluginRegistry.filter(e=>"optional"===e.tier||"requires-config"===e.tier).sort((e,n)=>e.category!==n.category?e.category.localeCompare(n.category):e.displayName.localeCompare(n.displayName)).map(e=>({label:`${e.displayName} (${e.category})`,value:e.key,hint:"requires-config"===e.tier?"needs configuration":void 0}))}function f(){return a.pluginRegistry.filter(e=>"optional"===e.tier).map(e=>e.key)}function g(){return Boolean(process.stdin.isTTY&&process.stdout.isTTY)}function m(e){if(!g())throw new Error(`No interactive terminal is available and required values are missing: ${e.join(", ")}. Pass them as flags to scaffold non-interactively.`)}async function y(e){const n=(0,l.resolveHubProjectSource)();if(!n)return;const o=await(0,l.listHubProjects)(n,e=>i.log.warn(`Could not read your Vendure Console projects: ${e}`));if(0===o.length)return;if(e){const n=o.find(n=>n.id===e);if(!n)throw new Error(`--console-project ${e} is not in the project list. Available: ${o.map(e=>e.id).join(", ")}`);return n}const r=await i.select({message:"Which Vendure Console project is this?",options:[...o.map(e=>({label:e.name,value:e.id,hint:`${e.edition} edition`})),{label:"None of these (pick plugins manually)",value:""}]});return i.isCancel(r)&&(i.cancel("Setup cancelled."),process.exit(0)),o.find(e=>e.id===r)}async function h(e,n){var o,r,t;const l=u(null==n?void 0:n.pm),a=d(null==n?void 0:n.apiUrl),s=null!==(o=null==n?void 0:n.scenario)&&void 0!==o?o:"customer";if(e&&a){const o=p(e);return o&&(i.log.error(`Error: ${o}`),process.exit(1)),{projectName:e,apiUrl:a,scenario:s,packageManager:l,skipInstall:!1===(null==n?void 0:n.install),skipGit:!1===(null==n?void 0:n.git),dryRun:null!==(r=null==n?void 0:n.dryRun)&&void 0!==r&&r}}if(m([...e?[]:["<project-name>"],...a?[]:["--api-url"]]),i.intro("create-vendure-platform (storefront-only)"),e){const n=p(e);n&&(i.cancel(n),process.exit(1))}const c=await i.group({projectName:()=>e?Promise.resolve(e):i.text({message:"Project name:",validate:p}),apiUrl:()=>a?Promise.resolve(a):i.text({message:"Vendure Shop API URL (leave blank to use http://localhost:3500/shop-api):",placeholder:"https://shop.example.com/shop-api",validate:e=>{if(e)try{new URL(e)}catch{return"Must be a valid URL"}}}),installDeps:()=>i.confirm({message:`Install dependencies with ${l}?`,initialValue:!0})},{onCancel:()=>{i.cancel("Setup cancelled."),process.exit(0)}});return{projectName:c.projectName,apiUrl:c.apiUrl||void 0,scenario:s,packageManager:l,skipInstall:!c.installDeps,skipGit:!1===(null==n?void 0:n.git),dryRun:null!==(t=null==n?void 0:n.dryRun)&&void 0!==t&&t}}async function j(e,n){var o,l,c,d,g,h,j,b,P,k,R,O,N;const C=u(null==n?void 0:n.pm),$=s(null==n?void 0:n.profile);if($&&void 0!==(null==n?void 0:n.plugins))throw new Error("--profile and --plugins are mutually exclusive. A profile resolves its own plugins.");if((null==n?void 0:n.consoleProject)&&($||void 0!==n.plugins))throw new Error("--console-project is mutually exclusive with --profile and --plugins. The Project names the edition.");if(e&&(null==n?void 0:n.company)&&(void 0!==(null==n?void 0:n.plugins)||$)){const r=p(e);r&&(i.log.error(`Error: ${r}`),process.exit(1));const t=$?(0,a.resolveProfilePluginKeys)($):n.plugins?n.plugins.split(",").map(e=>e.trim()).filter(Boolean):[];return{projectName:e,companyName:n.company,selectedPlugins:t,profile:$,includeStorefront:null===(o=n.storefront)||void 0===o||o,createGithubRepo:null!==(l=n.github)&&void 0!==l&&l,githubOrg:n.githubOrg,packageManager:C,skipInstall:!1===n.install,skipGit:!1===n.git,dryRun:null!==(c=n.dryRun)&&void 0!==c&&c,registryToken:(null===(d=n.registryToken)||void 0===d?void 0:d.trim())||void 0,licenseToken:(null===(g=n.licenseToken)||void 0===g?void 0:g.trim())||void 0}}if(e&&(null==n?void 0:n.company)&&(null==n?void 0:n.consoleProject)&&void 0===(null==n?void 0:n.plugins)){const o=p(e);if(o)throw new Error(o);const i=await y(n.consoleProject);let l,c=null==i?void 0:i.edition;if(!i){if(l=await(0,t.startConsoleOnboarding)({projectDir:r.resolve(process.cwd(),e),interactive:!1,projectId:n.consoleProject}),!l)throw new Error("--console-project needs a stored Vendure Console session, or VENDURE_HUB_PROJECTS naming a file that lists it. Neither was usable, and this run has no terminal to sign in from.");c=l.edition}const u=s(c);if(!u)throw new Error(`Vendure Console reports no edition for project ${n.consoleProject}, so there is no package set to scaffold. Give the Project an edition, or scaffold with --profile instead.`);return{projectName:e,companyName:n.company,selectedPlugins:(0,a.resolveProfilePluginKeys)(u),profile:u,includeStorefront:null===(h=n.storefront)||void 0===h||h,createGithubRepo:null!==(j=n.github)&&void 0!==j&&j,githubOrg:n.githubOrg,packageManager:C,skipInstall:!1===n.install,skipGit:!1===n.git,dryRun:null!==(b=n.dryRun)&&void 0!==b&&b,registryToken:(null===(P=n.registryToken)||void 0===P?void 0:P.trim())||void 0,licenseToken:(null===(k=n.licenseToken)||void 0===k?void 0:k.trim())||void 0,consoleOnboarding:l}}if(m([...e?[]:["<project-name>"],...(null==n?void 0:n.company)?[]:["--company"],...void 0!==(null==n?void 0:n.plugins)||$?[]:["--plugins or --profile"]]),i.intro("create-vendure-platform"),e){const n=p(e);n&&(i.cancel(n),process.exit(1))}const x=null!=e?e:await w();let E,T=$;if(!$&&!(null==n?void 0:n.dryRun)){const e=await y(null==n?void 0:n.consoleProject);e?(T=e.edition,i.log.info(`${e.name} is on the ${e.edition} edition.`)):(E=await(0,t.startConsoleOnboarding)({projectDir:r.resolve(process.cwd(),x),interactive:!0,projectId:null==n?void 0:n.consoleProject}),T=null==E?void 0:E.edition)}const I=v(),_=f(),S=await i.group({companyName:()=>{const e=x.replace(/^vendure-/,"").replace(/-demo$/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase());return i.text({message:"Company name (used in README and project branding):",defaultValue:e,placeholder:e})},selectedPlugins:()=>T?Promise.resolve((0,a.resolveProfilePluginKeys)(T)):i.multiselect({message:"Optional plugins to include (core plugins are always installed):",options:I,initialValues:_,required:!1}),includeStorefront:()=>i.confirm({message:"Include the Next.js storefront?",initialValue:!0}),installDeps:()=>i.confirm({message:`Install dependencies with ${C}?`,initialValue:!0})},{onCancel:()=>{i.cancel("Setup cancelled."),process.exit(0)}});return{projectName:x,companyName:S.companyName,selectedPlugins:S.selectedPlugins,profile:T,includeStorefront:S.includeStorefront,createGithubRepo:!1,githubOrg:void 0,packageManager:C,skipInstall:!S.installDeps,dryRun:null!==(R=null==n?void 0:n.dryRun)&&void 0!==R&&R,registryToken:(null===(O=null==n?void 0:n.registryToken)||void 0===O?void 0:O.trim())||void 0,licenseToken:(null===(N=null==n?void 0:n.licenseToken)||void 0===N?void 0:N.trim())||void 0,consoleOnboarding:E}}async function w(){const e=await i.text({message:"Project name:",validate:p});return i.isCancel(e)&&(i.cancel("Setup cancelled."),process.exit(0)),e}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CapabilityProfileName } from '@vendure-platform/plugin-meta';
|
|
2
|
+
/**
|
|
3
|
+
* What a scaffold learned from Console before it wrote anything, and how to
|
|
4
|
+
* finish once there is a directory to write into.
|
|
5
|
+
*/
|
|
6
|
+
export interface ConsoleOnboarding {
|
|
7
|
+
project: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
/** The edition the Project holds, which decides the facade and the options. */
|
|
12
|
+
edition: CapabilityProfileName | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Write the Project Link Manifest and acquire the Registry Access Token for
|
|
15
|
+
* `projectDir`. Called once the directory exists.
|
|
16
|
+
*/
|
|
17
|
+
finish(projectDir: string): Promise<ConsoleOnboardingResult>;
|
|
18
|
+
}
|
|
19
|
+
export interface ConsoleOnboardingResult {
|
|
20
|
+
registryUrl: string;
|
|
21
|
+
scope: string;
|
|
22
|
+
/** Undefined when no token could be issued; `registryLogin` then says why. */
|
|
23
|
+
registryToken?: string;
|
|
24
|
+
registryLogin?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sign in to Console and decide which Project this scaffold is for.
|
|
28
|
+
*
|
|
29
|
+
* Returns `undefined` for every ordinary reason a scaffold carries on without
|
|
30
|
+
* Console: no terminal to ask in, a declined login, or a session another
|
|
31
|
+
* process holds the lock on. An offline scaffold is a supported flow, so none
|
|
32
|
+
* of those stop the run.
|
|
33
|
+
*/
|
|
34
|
+
export declare function startConsoleOnboarding(options: {
|
|
35
|
+
/** The directory the scaffold will create. Anchors the create Idempotency-Key. */
|
|
36
|
+
projectDir: string;
|
|
37
|
+
interactive: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The Project to use, instead of asking. A Project the account does not
|
|
40
|
+
* hold is an error: creating one is a decision, and naming an id is a
|
|
41
|
+
* different one already taken.
|
|
42
|
+
*/
|
|
43
|
+
projectId?: string;
|
|
44
|
+
}): Promise<ConsoleOnboarding | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,n,t,o){void 0===o&&(o=t);var r=Object.getOwnPropertyDescriptor(n,t);r&&!("get"in r?!n.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,o,r)}:function(e,n,t,o){void 0===o&&(o=t),e[o]=n[t]}),n=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),t=this&&this.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n},t(e)};return function(o){if(o&&o.__esModule)return o;var r={};if(null!=o)for(var i=t(o),s=0;s<i.length;s++)"default"!==i[s]&&e(r,o,i[s]);return n(r,o),r}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.startConsoleOnboarding=a;const o=t(require("@clack/prompts")),r=require("@vendure-platform/console-auth"),i=require("./plugin-registry"),s=require("./registry");async function a(e){let n;try{n=(0,r.consoleOrigins)({apiOrigin:process.env.VENDURE_CONSOLE_API_URL,appOrigin:process.env.VENDURE_CONSOLE_APP_URL})}catch(e){return void o.log.warn(`${d(e)} Continuing without Vendure Console.`)}const t=await l(n,e.interactive);if(!t)return;let s=t;const a=new r.ConsoleApi({apiOrigin:n.apiOrigin,getAccessToken:()=>s,refreshAccessToken:async()=>{s=await(0,r.refreshStoredConsoleToken)(n)}});let g;try{g=await(0,r.selectConsoleProject)({api:a,interaction:u(e.projectId),projectRoot:e.projectDir})}catch(e){if(e instanceof r.ConsoleOnboardingCancelled)throw e;return void o.log.warn(`${d(e)} Continuing without a Vendure Console Project.`)}return{project:{id:g.project.id,name:g.project.name},edition:g.edition&&(0,i.isCapabilityProfileName)(g.edition)?g.edition:void 0,finish:e=>c(a,g.project,e)}}async function c(e,n,t){await(0,r.writeProjectLink)({api:e,interaction:u(),projectRoot:t,projectId:n.id}),o.log.success(`Linked ${t} to ${n.name}.`);const i=await(0,r.acquireRegistryAccess)({api:e,projectId:n.id,interaction:{confirmRotate:async e=>{const n=await o.confirm({message:`Replace the Registry Access Token "${e}"? Whatever installs with the current one stops working.`,initialValue:!1});if(o.isCancel(n))throw new r.ConsoleOnboardingCancelled;return n},report:e=>o.log.info(e),warn:e=>o.log.warn(e)},defaultRegistryUrl:(0,s.getRegistryUrl)(),defaultScope:s.REGISTRY_SCOPE});if("npm-login"===i.fallback){const e=`npm login --auth-type=web --registry=${(0,s.registryLoginUrl)(i.registryUrl)}`;return o.log.warn(`Your Console account cannot issue Registry Access Tokens for ${n.name}. Log in to the registry instead:\n ${e}`),{registryUrl:i.registryUrl,scope:i.scope,registryLogin:e}}return{registryUrl:i.registryUrl,scope:i.scope,registryToken:i.token}}async function l(e,n){try{const n=await(0,r.resolveStoredConsoleToken)(e);if(n)return n}catch(e){return void o.log.warn(`${d(e)} Continuing without Vendure Console.`)}if(!n)return;const t=await o.confirm({message:"Sign in to Vendure Console to set this project up?",initialValue:!0});if(o.isCancel(t))throw new r.ConsoleOnboardingCancelled;if(!t)return;const i=o.spinner();i.start("Waiting for you to finish signing in to Vendure Console");try{const n=await(0,r.loginAndStoreConsoleToken)({client:"create",...e,reportAuthorizationUrl:e=>o.log.info(`Open this URL to sign in: ${e}`)});return i.stop("Signed in to Vendure Console."),n}catch(e){return i.stop("Could not sign in to Vendure Console."),void o.log.warn(`${d(e)} Continuing without it.`)}}function u(e){return{chooseProject:async n=>{if(e){const t=n.find(n=>n.id===e);if(!t)throw new Error(`--console-project ${e} is not one of your Vendure Console Projects.`);return t}const t=await o.select({message:"Which Vendure Console Project is this?",options:[...n.map(e=>({label:e.name,value:e.id,hint:e.edition?`${e.edition} edition`:"no edition yet"})),{label:"Create a new Project",value:""}]});if(o.isCancel(t))throw new r.ConsoleOnboardingCancelled;return n.find(e=>e.id===t)},newProjectName:async()=>{const e=await o.text({message:"Name for the new Vendure Console Project:",validate:e=>e.trim()?void 0:"A name is required"});if(o.isCancel(e))throw new r.ConsoleOnboardingCancelled;return e},chooseEvaluation:async e=>{const n=await o.select({message:"This Project has no edition yet. Which one would you like to evaluate?",options:[...e.map(e=>({label:`${e} edition`,value:e})),{label:"Not now",value:""}]});if(o.isCancel(n))throw new r.ConsoleOnboardingCancelled;return e.find(e=>e===n)},report:e=>o.log.info(e),warn:e=>o.log.warn(e)}}function d(e){return e instanceof Error?e.message:String(e)}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CapabilityProfileName } from '@vendure-platform/plugin-meta';
|
|
2
|
+
/**
|
|
3
|
+
* A project the authenticated account owns in the Vendure Console (Hub), with
|
|
4
|
+
* the edition it was sold. The edition decides which facade the scaffolded
|
|
5
|
+
* project installs, which options block it writes, and whether it receives
|
|
6
|
+
* storefront assets.
|
|
7
|
+
*/
|
|
8
|
+
export interface HubProject {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
edition: CapabilityProfileName;
|
|
12
|
+
}
|
|
13
|
+
/** Where `create` reads the account's projects from. */
|
|
14
|
+
export interface HubProjectSource {
|
|
15
|
+
listProjects(): Promise<HubProject[]>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Environment variable naming a JSON file of `HubProject` records. Used by the
|
|
19
|
+
* create-flow harness and by demo scaffolds that must exercise the Console path
|
|
20
|
+
* offline.
|
|
21
|
+
*/
|
|
22
|
+
export declare const HUB_PROJECTS_FIXTURE_ENV = "VENDURE_HUB_PROJECTS";
|
|
23
|
+
export declare const CONSOLE_ACCESS_TOKEN_ENV = "VENDURE_CONSOLE_ACCESS_TOKEN";
|
|
24
|
+
/** Reads projects from a JSON file. Throws when the file is missing or malformed. */
|
|
25
|
+
export declare function fileHubProjectSource(path: string): HubProjectSource;
|
|
26
|
+
/** Reads projects with the WorkOS bearer token issued by Vendure Console. */
|
|
27
|
+
export declare function httpHubProjectSource(accessToken: string, options?: {
|
|
28
|
+
apiOrigin?: string;
|
|
29
|
+
fetch?: typeof globalThis.fetch;
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
}): HubProjectSource;
|
|
32
|
+
/**
|
|
33
|
+
* The source to use, or `undefined` when no Console credential is configured.
|
|
34
|
+
* A caller that gets `undefined` must fall back to a manual selection rather
|
|
35
|
+
* than blocking — an offline scaffold is a supported flow.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveHubProjectSource(env?: NodeJS.ProcessEnv): HubProjectSource | undefined;
|
|
38
|
+
/** Validates the wire shape. An unknown edition is a hard error, not a silent Starter. */
|
|
39
|
+
export declare function parseHubProjects(value: unknown): HubProject[];
|
|
40
|
+
/**
|
|
41
|
+
* The account's projects, or an empty list when no source is configured or the
|
|
42
|
+
* lookup fails.
|
|
43
|
+
*
|
|
44
|
+
* `onLookupFailed` fires only for the second case. Having no Console credential
|
|
45
|
+
* is the normal state of an offline scaffold, not something to report, and a
|
|
46
|
+
* caller that announced it would print a line on every interactive run.
|
|
47
|
+
*/
|
|
48
|
+
export declare function listHubProjects(source: HubProjectSource | undefined, onLookupFailed?: (reason: string) => void): Promise<HubProject[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var n=Object.getOwnPropertyDescriptor(r,t);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,n)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=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(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var i=t(o),s=0;s<i.length;s++)"default"!==i[s]&&e(n,o,i[s]);return r(n,o),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.CONSOLE_ACCESS_TOKEN_ENV=exports.HUB_PROJECTS_FIXTURE_ENV=void 0,exports.fileHubProjectSource=u,exports.httpHubProjectSource=c,exports.resolveHubProjectSource=l,exports.parseHubProjects=d,exports.listHubProjects=f;const o=require("@vendure-platform/console-auth"),n=t(require("fs-extra")),i=require("./plugin-registry");exports.HUB_PROJECTS_FIXTURE_ENV="VENDURE_HUB_PROJECTS",exports.CONSOLE_ACCESS_TOKEN_ENV="VENDURE_CONSOLE_ACCESS_TOKEN";const s="/v1/projects/editions",a=1e4;function u(e){return{listProjects:async()=>d(await n.readJson(e))}}function c(e,r={}){var t,n;const i=(0,o.consoleApiOrigin)(null!==(t=r.apiOrigin)&&void 0!==t?t:o.DEFAULT_CONSOLE_API_ORIGIN),u=null!==(n=r.fetch)&&void 0!==n?n:globalThis.fetch;return{listProjects:async()=>{var t;const o=new AbortController,n=setTimeout(()=>o.abort(),null!==(t=r.timeoutMs)&&void 0!==t?t:a);let c;try{c=await u(`${i}${s}`,{method:"GET",redirect:"error",signal:o.signal,headers:{Accept:"application/json",Authorization:`Bearer ${e}`}})}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("The Vendure Console project lookup timed out.");throw new Error("Could not reach Vendure Console.")}finally{clearTimeout(n)}if(!c.ok)throw new Error(`Vendure Console returned HTTP ${c.status}.`);try{return d(await c.json())}catch(e){if(e instanceof SyntaxError)throw new Error("Vendure Console returned malformed JSON.");throw e}}}}function l(e=process.env){var r,t;const o=null===(r=e[exports.HUB_PROJECTS_FIXTURE_ENV])||void 0===r?void 0:r.trim();if(o)return u(o);const n=null===(t=e[exports.CONSOLE_ACCESS_TOKEN_ENV])||void 0===t?void 0:t.trim();return n?c(n):void 0}function d(e){if(!Array.isArray(e))throw new Error("Expected a JSON array of Vendure Console projects.");return e.map((e,r)=>{const t=e;if("string"!=typeof(null==t?void 0:t.id)||"string"!=typeof(null==t?void 0:t.name))throw new Error(`Console project at index ${r} has no id or name.`);if("string"!=typeof t.edition||!(0,i.isCapabilityProfileName)(t.edition))throw new Error(`Console project "${t.name}" has an unknown edition "${String(t.edition)}".`);return{id:t.id,name:t.name,edition:t.edition}})}async function f(e,r){if(!e)return[];try{return await e.listProjects()}catch(e){return null==r||r(e instanceof Error?e.message:String(e)),[]}}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { scaffoldStorefrontOnly } from './scaffold-storefront-only';
|
|
3
|
-
export { pluginRegistry, INTERNAL_PACKAGES, resolveActivePluginKeys, ALWAYS_ACTIVE_KEYS, SELECTABLE_KEYS, getPlugin, } from './plugin-registry';
|
|
1
|
+
export type { PluginCategory, PluginKey, PluginMeta, PluginMetaKey, PluginTier, } from '@vendure-platform/plugin-meta';
|
|
4
2
|
export { runCli, runStorefrontOnlyCli } from './cli';
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
3
|
+
export { ALWAYS_ACTIVE_KEYS, INTERNAL_PACKAGES, SELECTABLE_KEYS, getPlugin, pluginRegistry, resolveActivePluginKeys, } from './plugin-registry';
|
|
4
|
+
export { scaffoldStorefrontOnly } from './scaffold-storefront-only';
|
|
5
|
+
export { TEMPLATE_FILES, scaffold, templateFilesFor } from './scaffolder';
|
|
6
|
+
export { CliFlags, EnvVar, PackageManager, PluginDefinition, ScaffoldOptions, ScaffolderPluginExtras, StorefrontOnlyOptions, } from './types';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.templateFilesFor=exports.scaffold=exports.TEMPLATE_FILES=exports.scaffoldStorefrontOnly=exports.resolveActivePluginKeys=exports.pluginRegistry=exports.getPlugin=exports.SELECTABLE_KEYS=exports.INTERNAL_PACKAGES=exports.ALWAYS_ACTIVE_KEYS=exports.runStorefrontOnlyCli=exports.runCli=void 0;var e=require("./cli");Object.defineProperty(exports,"runCli",{enumerable:!0,get:function(){return e.runCli}}),Object.defineProperty(exports,"runStorefrontOnlyCli",{enumerable:!0,get:function(){return e.runStorefrontOnlyCli}});var r=require("./plugin-registry");Object.defineProperty(exports,"ALWAYS_ACTIVE_KEYS",{enumerable:!0,get:function(){return r.ALWAYS_ACTIVE_KEYS}}),Object.defineProperty(exports,"INTERNAL_PACKAGES",{enumerable:!0,get:function(){return r.INTERNAL_PACKAGES}}),Object.defineProperty(exports,"SELECTABLE_KEYS",{enumerable:!0,get:function(){return r.SELECTABLE_KEYS}}),Object.defineProperty(exports,"getPlugin",{enumerable:!0,get:function(){return r.getPlugin}}),Object.defineProperty(exports,"pluginRegistry",{enumerable:!0,get:function(){return r.pluginRegistry}}),Object.defineProperty(exports,"resolveActivePluginKeys",{enumerable:!0,get:function(){return r.resolveActivePluginKeys}});var t=require("./scaffold-storefront-only");Object.defineProperty(exports,"scaffoldStorefrontOnly",{enumerable:!0,get:function(){return t.scaffoldStorefrontOnly}});var n=require("./scaffolder");Object.defineProperty(exports,"TEMPLATE_FILES",{enumerable:!0,get:function(){return n.TEMPLATE_FILES}}),Object.defineProperty(exports,"scaffold",{enumerable:!0,get:function(){return n.scaffold}}),Object.defineProperty(exports,"templateFilesFor",{enumerable:!0,get:function(){return n.templateFilesFor}});
|