@shopify/hydrogen 2026.4.5 → 2026.10.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -13
- package/bin/hydrogen.mjs +7 -0
- package/dist/cli/index.mjs +647 -0
- package/dist/client/client.d.mts +34 -0
- package/dist/client/client.mjs +206 -0
- package/dist/client/client.mjs.map +1 -0
- package/dist/client/errors.d.mts +48 -0
- package/dist/client/errors.mjs +52 -0
- package/dist/client/errors.mjs.map +1 -0
- package/dist/client/index.d.mts +4 -0
- package/dist/client/types.d.mts +147 -0
- package/dist/core/analytics/cart-tracker.d.mts +8 -0
- package/dist/core/analytics/cart-tracker.mjs +144 -0
- package/dist/core/analytics/cart-tracker.mjs.map +1 -0
- package/dist/core/analytics/events.d.mts +15 -0
- package/dist/core/analytics/events.mjs +15 -0
- package/dist/core/analytics/events.mjs.map +1 -0
- package/dist/core/analytics/index.d.mts +3 -0
- package/dist/core/analytics/types.d.mts +143 -0
- package/dist/core/analytics/utils/flatten-connection.d.mts +19 -0
- package/dist/core/analytics/utils/flatten-connection.mjs +25 -0
- package/dist/core/analytics/utils/flatten-connection.mjs.map +1 -0
- package/dist/core/cache/cache-status.mjs +17 -0
- package/dist/core/cache/cache-status.mjs.map +1 -0
- package/dist/core/cache/fetch-with-cache.d.mts +43 -0
- package/dist/core/cache/fetch-with-cache.mjs +188 -0
- package/dist/core/cache/fetch-with-cache.mjs.map +1 -0
- package/dist/core/cache/key.d.mts +6 -0
- package/dist/core/cache/key.mjs +27 -0
- package/dist/core/cache/key.mjs.map +1 -0
- package/dist/core/cache/run-with-cache.d.mts +36 -0
- package/dist/core/cache/run-with-cache.mjs +114 -0
- package/dist/core/cache/run-with-cache.mjs.map +1 -0
- package/dist/core/cache/store.d.mts +19 -0
- package/dist/core/cache/store.mjs +62 -0
- package/dist/core/cache/store.mjs.map +1 -0
- package/dist/core/cache/strategies.d.mts +39 -0
- package/dist/core/cache/strategies.mjs +70 -0
- package/dist/core/cache/strategies.mjs.map +1 -0
- package/dist/core/cart/actions.d.mts +50 -0
- package/dist/core/cart/actions.mjs +240 -0
- package/dist/core/cart/actions.mjs.map +1 -0
- package/dist/core/cart/attach-quantity-input.d.mts +5 -0
- package/dist/core/cart/attach-quantity-input.mjs +17 -0
- package/dist/core/cart/attach-quantity-input.mjs.map +1 -0
- package/dist/core/cart/buyer-identity-sync.d.mts +23 -0
- package/dist/core/cart/buyer-identity-sync.mjs +9 -0
- package/dist/core/cart/buyer-identity-sync.mjs.map +1 -0
- package/dist/core/cart/cart.d.mts +37 -0
- package/dist/core/cart/cart.mjs +1707 -0
- package/dist/core/cart/cart.mjs.map +1 -0
- package/dist/core/cart/cookie.d.mts +5 -0
- package/dist/core/cart/cookie.mjs +28 -0
- package/dist/core/cart/cookie.mjs.map +1 -0
- package/dist/core/cart/form.d.mts +130 -0
- package/dist/core/cart/form.mjs +75 -0
- package/dist/core/cart/form.mjs.map +1 -0
- package/dist/core/cart/get-cart.d.mts +25 -0
- package/dist/core/cart/get-cart.mjs +32 -0
- package/dist/core/cart/get-cart.mjs.map +1 -0
- package/dist/core/cart/index.d.mts +10 -0
- package/dist/core/cart/quantity.d.mts +10 -0
- package/dist/core/cart/quantity.mjs +14 -0
- package/dist/core/cart/quantity.mjs.map +1 -0
- package/dist/core/cart/queries.d.mts +4296 -0
- package/dist/core/cart/queries.mjs +70 -0
- package/dist/core/cart/queries.mjs.map +1 -0
- package/dist/core/cart/server-handlers.d.mts +82 -0
- package/dist/core/cart/server-handlers.mjs +322 -0
- package/dist/core/cart/server-handlers.mjs.map +1 -0
- package/dist/core/cart/state.d.mts +137 -0
- package/dist/core/cart/state.mjs +76 -0
- package/dist/core/cart/state.mjs.map +1 -0
- package/dist/core/cart/sync-quantity-inputs.mjs +16 -0
- package/dist/core/cart/sync-quantity-inputs.mjs.map +1 -0
- package/dist/core/collection/collection.d.mts +134 -0
- package/dist/core/collection/collection.mjs +170 -0
- package/dist/core/collection/collection.mjs.map +1 -0
- package/dist/core/collection/index.d.mts +6 -0
- package/dist/core/collection/reconciler.d.mts +32 -0
- package/dist/core/collection/reconciler.mjs +89 -0
- package/dist/core/collection/reconciler.mjs.map +1 -0
- package/dist/core/collection/state.d.mts +66 -0
- package/dist/core/collection/state.mjs +20 -0
- package/dist/core/collection/state.mjs.map +1 -0
- package/dist/core/collection/url.d.mts +71 -0
- package/dist/core/collection/url.mjs +376 -0
- package/dist/core/collection/url.mjs.map +1 -0
- package/dist/core/constants.d.mts +5 -0
- package/dist/core/constants.mjs +8 -0
- package/dist/core/constants.mjs.map +1 -0
- package/dist/core/headers.mjs +43 -0
- package/dist/core/headers.mjs.map +1 -0
- package/dist/core/index.d.mts +56 -0
- package/dist/core/index.mjs +45 -0
- package/dist/core/logging/logging.d.mts +21 -0
- package/dist/core/logging/logging.mjs +99 -0
- package/dist/core/logging/logging.mjs.map +1 -0
- package/dist/core/logging/types.d.mts +40 -0
- package/dist/core/logging/types.mjs +18 -0
- package/dist/core/logging/types.mjs.map +1 -0
- package/dist/core/money/cache.mjs +25 -0
- package/dist/core/money/cache.mjs.map +1 -0
- package/dist/core/money/format.d.mts +15 -0
- package/dist/core/money/format.mjs +243 -0
- package/dist/core/money/format.mjs.map +1 -0
- package/dist/core/money/types.d.mts +47 -0
- package/dist/core/observable.mjs +46 -0
- package/dist/core/observable.mjs.map +1 -0
- package/dist/core/predictive-search/constants.d.mts +5 -0
- package/dist/core/predictive-search/constants.mjs +6 -0
- package/dist/core/predictive-search/constants.mjs.map +1 -0
- package/dist/core/predictive-search/form.d.mts +31 -0
- package/dist/core/predictive-search/form.mjs +31 -0
- package/dist/core/predictive-search/form.mjs.map +1 -0
- package/dist/core/predictive-search/index.d.mts +6 -0
- package/dist/core/predictive-search/queries.d.mts +118 -0
- package/dist/core/predictive-search/queries.mjs +81 -0
- package/dist/core/predictive-search/queries.mjs.map +1 -0
- package/dist/core/predictive-search/search.d.mts +32 -0
- package/dist/core/predictive-search/search.mjs +74 -0
- package/dist/core/predictive-search/search.mjs.map +1 -0
- package/dist/core/predictive-search/server-handlers.d.mts +36 -0
- package/dist/core/predictive-search/server-handlers.mjs +113 -0
- package/dist/core/predictive-search/server-handlers.mjs.map +1 -0
- package/dist/core/predictive-search/store.d.mts +44 -0
- package/dist/core/predictive-search/store.mjs +224 -0
- package/dist/core/predictive-search/store.mjs.map +1 -0
- package/dist/core/predictive-search/url.d.mts +41 -0
- package/dist/core/predictive-search/url.mjs +71 -0
- package/dist/core/predictive-search/url.mjs.map +1 -0
- package/dist/core/product/accept-variant-id.mjs +98 -0
- package/dist/core/product/accept-variant-id.mjs.map +1 -0
- package/dist/core/product/form.d.mts +63 -0
- package/dist/core/product/form.mjs +44 -0
- package/dist/core/product/form.mjs.map +1 -0
- package/dist/core/product/index.d.mts +5 -0
- package/dist/core/product/options.d.mts +43 -0
- package/dist/core/product/options.mjs +296 -0
- package/dist/core/product/options.mjs.map +1 -0
- package/dist/core/product/product-form.d.mts +72 -0
- package/dist/core/product/product-form.mjs +158 -0
- package/dist/core/product/product-form.mjs.map +1 -0
- package/dist/core/product/state.d.mts +68 -0
- package/dist/core/product/url.d.mts +47 -0
- package/dist/core/product/url.mjs +69 -0
- package/dist/core/product/url.mjs.map +1 -0
- package/dist/core/request-context.d.mts +75 -0
- package/dist/core/request-context.mjs +141 -0
- package/dist/core/request-context.mjs.map +1 -0
- package/dist/core/request-routing/handle-shopify-redirects.d.mts +17 -0
- package/dist/core/request-routing/handle-shopify-redirects.mjs +31 -0
- package/dist/core/request-routing/handle-shopify-redirects.mjs.map +1 -0
- package/dist/core/request-routing/handle-shopify-routes.d.mts +14 -0
- package/dist/core/request-routing/handle-shopify-routes.mjs +42 -0
- package/dist/core/request-routing/handle-shopify-routes.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/admin-redirect.mjs +12 -0
- package/dist/core/request-routing/interceptors/admin-redirect.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/ajax-api.mjs +16 -0
- package/dist/core/request-routing/interceptors/ajax-api.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/api-proxy.mjs +20 -0
- package/dist/core/request-routing/interceptors/api-proxy.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/checkout.mjs +58 -0
- package/dist/core/request-routing/interceptors/checkout.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/mcp-proxy.mjs +23 -0
- package/dist/core/request-routing/interceptors/mcp-proxy.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/proxy.mjs +73 -0
- package/dist/core/request-routing/interceptors/proxy.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/query-param-redirect.mjs +22 -0
- package/dist/core/request-routing/interceptors/query-param-redirect.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/sfapi-proxy.mjs +27 -0
- package/dist/core/request-routing/interceptors/sfapi-proxy.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/standard-routes.mjs +19 -0
- package/dist/core/request-routing/interceptors/standard-routes.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/url-redirects.mjs +27 -0
- package/dist/core/request-routing/interceptors/url-redirects.mjs.map +1 -0
- package/dist/core/request-routing/interceptors/well-known.mjs +22 -0
- package/dist/core/request-routing/interceptors/well-known.mjs.map +1 -0
- package/dist/core/request-routing/registered-routes.d.mts +7 -0
- package/dist/core/request-routing/registered-routes.mjs +72 -0
- package/dist/core/request-routing/registered-routes.mjs.map +1 -0
- package/dist/core/request-routing/route-types.d.mts +56 -0
- package/dist/core/request-routing/safe-apply-response-headers.mjs +16 -0
- package/dist/core/request-routing/safe-apply-response-headers.mjs.map +1 -0
- package/dist/core/shop-pay/shop-pay.d.mts +102 -0
- package/dist/core/shop-pay/shop-pay.mjs +289 -0
- package/dist/core/shop-pay/shop-pay.mjs.map +1 -0
- package/dist/core/shopify-scripts/analytics.mjs +26 -0
- package/dist/core/shopify-scripts/analytics.mjs.map +1 -0
- package/dist/core/shopify-scripts/consent.mjs +17 -0
- package/dist/core/shopify-scripts/consent.mjs.map +1 -0
- package/dist/core/shopify-scripts/constants.mjs +19 -0
- package/dist/core/shopify-scripts/constants.mjs.map +1 -0
- package/dist/core/shopify-scripts/deprecated-cookies.mjs +97 -0
- package/dist/core/shopify-scripts/deprecated-cookies.mjs.map +1 -0
- package/dist/core/shopify-scripts/global.d.mts +1 -0
- package/dist/core/shopify-scripts/global.mjs +86 -0
- package/dist/core/shopify-scripts/global.mjs.map +1 -0
- package/dist/core/shopify-scripts/index.d.mts +27 -0
- package/dist/core/shopify-scripts/index.mjs +135 -0
- package/dist/core/shopify-scripts/index.mjs.map +1 -0
- package/dist/core/shopify-scripts/initialize.d.mts +18 -0
- package/dist/core/shopify-scripts/initialize.mjs +27 -0
- package/dist/core/shopify-scripts/initialize.mjs.map +1 -0
- package/dist/core/shopify-scripts/page-view.mjs +49 -0
- package/dist/core/shopify-scripts/page-view.mjs.map +1 -0
- package/dist/core/shopify-scripts/perfkit.mjs +33 -0
- package/dist/core/shopify-scripts/perfkit.mjs.map +1 -0
- package/dist/core/shopify-scripts/render.d.mts +1 -0
- package/dist/core/shopify-scripts/render.mjs +23 -0
- package/dist/core/shopify-scripts/render.mjs.map +1 -0
- package/dist/core/shopify-scripts/types.d.mts +76 -0
- package/dist/core/shopify-scripts/utils/cookie-domain.mjs +43 -0
- package/dist/core/shopify-scripts/utils/cookie-domain.mjs.map +1 -0
- package/dist/core/shopify-scripts/utils/inline-script.mjs +8 -0
- package/dist/core/shopify-scripts/utils/inline-script.mjs.map +1 -0
- package/dist/core/shopify-scripts/utils/navigation.mjs +46 -0
- package/dist/core/shopify-scripts/utils/navigation.mjs.map +1 -0
- package/dist/core/shopify-scripts/utils/tracking-values.mjs +65 -0
- package/dist/core/shopify-scripts/utils/tracking-values.mjs.map +1 -0
- package/dist/core/shopify-scripts/utils/uuid.mjs +17 -0
- package/dist/core/shopify-scripts/utils/uuid.mjs.map +1 -0
- package/dist/core/shopify-scripts/webmcp.mjs +22 -0
- package/dist/core/shopify-scripts/webmcp.mjs.map +1 -0
- package/dist/core/standard-routes/build.d.mts +34 -0
- package/dist/core/standard-routes/build.mjs +54 -0
- package/dist/core/standard-routes/build.mjs.map +1 -0
- package/dist/core/standard-routes/defaults.mjs +31 -0
- package/dist/core/standard-routes/defaults.mjs.map +1 -0
- package/dist/core/standard-routes/match.mjs +108 -0
- package/dist/core/standard-routes/match.mjs.map +1 -0
- package/dist/core/standard-routes/path.mjs +58 -0
- package/dist/core/standard-routes/path.mjs.map +1 -0
- package/dist/core/standard-routes/redirects.mjs +51 -0
- package/dist/core/standard-routes/redirects.mjs.map +1 -0
- package/dist/core/standard-routes/types.d.mts +95 -0
- package/dist/core/url.mjs +42 -0
- package/dist/core/url.mjs.map +1 -0
- package/dist/core/utils/load-script.mjs +34 -0
- package/dist/core/utils/load-script.mjs.map +1 -0
- package/dist/core/utils/parse-gid.mjs +33 -0
- package/dist/core/utils/parse-gid.mjs.map +1 -0
- package/dist/core/utils/record.mjs +8 -0
- package/dist/core/utils/record.mjs.map +1 -0
- package/dist/customer-account/client.d.mts +50 -0
- package/dist/customer-account/client.mjs +239 -0
- package/dist/customer-account/client.mjs.map +1 -0
- package/dist/customer-account/errors.d.mts +28 -0
- package/dist/customer-account/errors.mjs +39 -0
- package/dist/customer-account/errors.mjs.map +1 -0
- package/dist/customer-account/graphql.d.mts +29 -0
- package/dist/customer-account/graphql.mjs +39 -0
- package/dist/customer-account/graphql.mjs.map +1 -0
- package/dist/customer-account/index.d.mts +7 -0
- package/dist/customer-account/index.mjs +7 -0
- package/dist/customer-account/session.d.mts +117 -0
- package/dist/customer-account/session.mjs +733 -0
- package/dist/customer-account/session.mjs.map +1 -0
- package/dist/customer-account/type-resolver.d.mts +11 -0
- package/dist/customer-account-api-types.d.ts +3269 -3270
- package/dist/customer-account.schema.json +50753 -1
- package/dist/development/_virtual/_@oxc-project_runtime@0.127.0/helpers/taggedTemplateLiteral.mjs +7 -0
- package/dist/development/client/client.d.mts +34 -0
- package/dist/development/client/client.mjs +206 -0
- package/dist/development/client/client.mjs.map +1 -0
- package/dist/development/client/errors.d.mts +48 -0
- package/dist/development/client/errors.mjs +57 -0
- package/dist/development/client/errors.mjs.map +1 -0
- package/dist/development/client/index.d.mts +4 -0
- package/dist/development/client/types.d.mts +147 -0
- package/dist/development/core/analytics/cart-tracker.d.mts +8 -0
- package/dist/development/core/analytics/cart-tracker.mjs +144 -0
- package/dist/development/core/analytics/cart-tracker.mjs.map +1 -0
- package/dist/development/core/analytics/events.d.mts +15 -0
- package/dist/development/core/analytics/events.mjs +15 -0
- package/dist/development/core/analytics/events.mjs.map +1 -0
- package/dist/development/core/analytics/index.d.mts +3 -0
- package/dist/development/core/analytics/types.d.mts +143 -0
- package/dist/development/core/analytics/utils/flatten-connection.d.mts +19 -0
- package/dist/development/core/analytics/utils/flatten-connection.mjs +25 -0
- package/dist/development/core/analytics/utils/flatten-connection.mjs.map +1 -0
- package/dist/development/core/cache/cache-status.mjs +17 -0
- package/dist/development/core/cache/cache-status.mjs.map +1 -0
- package/dist/development/core/cache/fetch-with-cache.d.mts +43 -0
- package/dist/development/core/cache/fetch-with-cache.mjs +188 -0
- package/dist/development/core/cache/fetch-with-cache.mjs.map +1 -0
- package/dist/development/core/cache/key.d.mts +6 -0
- package/dist/development/core/cache/key.mjs +27 -0
- package/dist/development/core/cache/key.mjs.map +1 -0
- package/dist/development/core/cache/run-with-cache.d.mts +36 -0
- package/dist/development/core/cache/run-with-cache.mjs +114 -0
- package/dist/development/core/cache/run-with-cache.mjs.map +1 -0
- package/dist/development/core/cache/store.d.mts +19 -0
- package/dist/development/core/cache/store.mjs +62 -0
- package/dist/development/core/cache/store.mjs.map +1 -0
- package/dist/development/core/cache/strategies.d.mts +39 -0
- package/dist/development/core/cache/strategies.mjs +70 -0
- package/dist/development/core/cache/strategies.mjs.map +1 -0
- package/dist/development/core/cart/actions.d.mts +50 -0
- package/dist/development/core/cart/actions.mjs +240 -0
- package/dist/development/core/cart/actions.mjs.map +1 -0
- package/dist/development/core/cart/attach-quantity-input.d.mts +5 -0
- package/dist/development/core/cart/attach-quantity-input.mjs +17 -0
- package/dist/development/core/cart/attach-quantity-input.mjs.map +1 -0
- package/dist/development/core/cart/buyer-identity-sync.d.mts +19 -0
- package/dist/development/core/cart/buyer-identity-sync.mjs +6 -0
- package/dist/development/core/cart/buyer-identity-sync.mjs.map +1 -0
- package/dist/development/core/cart/cart.d.mts +37 -0
- package/dist/development/core/cart/cart.mjs +1707 -0
- package/dist/development/core/cart/cart.mjs.map +1 -0
- package/dist/development/core/cart/cookie.d.mts +5 -0
- package/dist/development/core/cart/cookie.mjs +28 -0
- package/dist/development/core/cart/cookie.mjs.map +1 -0
- package/dist/development/core/cart/form.d.mts +130 -0
- package/dist/development/core/cart/form.mjs +75 -0
- package/dist/development/core/cart/form.mjs.map +1 -0
- package/dist/development/core/cart/get-cart.d.mts +25 -0
- package/dist/development/core/cart/get-cart.mjs +32 -0
- package/dist/development/core/cart/get-cart.mjs.map +1 -0
- package/dist/development/core/cart/index.d.mts +10 -0
- package/dist/development/core/cart/quantity.d.mts +10 -0
- package/dist/development/core/cart/quantity.mjs +14 -0
- package/dist/development/core/cart/quantity.mjs.map +1 -0
- package/dist/development/core/cart/queries.d.mts +4296 -0
- package/dist/development/core/cart/queries.mjs +70 -0
- package/dist/development/core/cart/queries.mjs.map +1 -0
- package/dist/development/core/cart/server-handlers.d.mts +82 -0
- package/dist/development/core/cart/server-handlers.mjs +322 -0
- package/dist/development/core/cart/server-handlers.mjs.map +1 -0
- package/dist/development/core/cart/state.d.mts +137 -0
- package/dist/development/core/cart/state.mjs +76 -0
- package/dist/development/core/cart/state.mjs.map +1 -0
- package/dist/development/core/cart/sync-quantity-inputs.mjs +16 -0
- package/dist/development/core/cart/sync-quantity-inputs.mjs.map +1 -0
- package/dist/development/core/collection/collection.d.mts +134 -0
- package/dist/development/core/collection/collection.mjs +170 -0
- package/dist/development/core/collection/collection.mjs.map +1 -0
- package/dist/development/core/collection/index.d.mts +6 -0
- package/dist/development/core/collection/reconciler.d.mts +32 -0
- package/dist/development/core/collection/reconciler.mjs +89 -0
- package/dist/development/core/collection/reconciler.mjs.map +1 -0
- package/dist/development/core/collection/state.d.mts +66 -0
- package/dist/development/core/collection/state.mjs +20 -0
- package/dist/development/core/collection/state.mjs.map +1 -0
- package/dist/development/core/collection/url.d.mts +71 -0
- package/dist/development/core/collection/url.mjs +376 -0
- package/dist/development/core/collection/url.mjs.map +1 -0
- package/dist/development/core/constants.mjs +7 -0
- package/dist/development/core/constants.mjs.map +1 -0
- package/dist/development/core/development.d.mts +56 -0
- package/dist/development/core/development.mjs +45 -0
- package/dist/development/core/headers.mjs +43 -0
- package/dist/development/core/headers.mjs.map +1 -0
- package/dist/development/core/index.d.mts +54 -0
- package/dist/development/core/logging/logging.d.mts +21 -0
- package/dist/development/core/logging/logging.mjs +99 -0
- package/dist/development/core/logging/logging.mjs.map +1 -0
- package/dist/development/core/logging/types.d.mts +40 -0
- package/dist/development/core/logging/types.mjs +18 -0
- package/dist/development/core/logging/types.mjs.map +1 -0
- package/dist/development/core/money/cache.mjs +25 -0
- package/dist/development/core/money/cache.mjs.map +1 -0
- package/dist/development/core/money/format.d.mts +15 -0
- package/dist/development/core/money/format.mjs +243 -0
- package/dist/development/core/money/format.mjs.map +1 -0
- package/dist/development/core/money/types.d.mts +47 -0
- package/dist/development/core/observable.mjs +46 -0
- package/dist/development/core/observable.mjs.map +1 -0
- package/dist/development/core/predictive-search/constants.d.mts +5 -0
- package/dist/development/core/predictive-search/constants.mjs +6 -0
- package/dist/development/core/predictive-search/constants.mjs.map +1 -0
- package/dist/development/core/predictive-search/form.d.mts +31 -0
- package/dist/development/core/predictive-search/form.mjs +31 -0
- package/dist/development/core/predictive-search/form.mjs.map +1 -0
- package/dist/development/core/predictive-search/index.d.mts +6 -0
- package/dist/development/core/predictive-search/queries.d.mts +118 -0
- package/dist/development/core/predictive-search/queries.mjs +81 -0
- package/dist/development/core/predictive-search/queries.mjs.map +1 -0
- package/dist/development/core/predictive-search/search.d.mts +32 -0
- package/dist/development/core/predictive-search/search.mjs +74 -0
- package/dist/development/core/predictive-search/search.mjs.map +1 -0
- package/dist/development/core/predictive-search/server-handlers.d.mts +36 -0
- package/dist/development/core/predictive-search/server-handlers.mjs +113 -0
- package/dist/development/core/predictive-search/server-handlers.mjs.map +1 -0
- package/dist/development/core/predictive-search/store.d.mts +44 -0
- package/dist/development/core/predictive-search/store.mjs +224 -0
- package/dist/development/core/predictive-search/store.mjs.map +1 -0
- package/dist/development/core/predictive-search/url.d.mts +41 -0
- package/dist/development/core/predictive-search/url.mjs +71 -0
- package/dist/development/core/predictive-search/url.mjs.map +1 -0
- package/dist/development/core/product/accept-variant-id.mjs +98 -0
- package/dist/development/core/product/accept-variant-id.mjs.map +1 -0
- package/dist/development/core/product/form.d.mts +63 -0
- package/dist/development/core/product/form.mjs +44 -0
- package/dist/development/core/product/form.mjs.map +1 -0
- package/dist/development/core/product/index.d.mts +5 -0
- package/dist/development/core/product/options.d.mts +43 -0
- package/dist/development/core/product/options.mjs +296 -0
- package/dist/development/core/product/options.mjs.map +1 -0
- package/dist/development/core/product/product-form.d.mts +72 -0
- package/dist/development/core/product/product-form.mjs +158 -0
- package/dist/development/core/product/product-form.mjs.map +1 -0
- package/dist/development/core/product/state.d.mts +68 -0
- package/dist/development/core/product/url.d.mts +47 -0
- package/dist/development/core/product/url.mjs +69 -0
- package/dist/development/core/product/url.mjs.map +1 -0
- package/dist/development/core/request-context.d.mts +75 -0
- package/dist/development/core/request-context.mjs +141 -0
- package/dist/development/core/request-context.mjs.map +1 -0
- package/dist/development/core/request-routing/handle-shopify-redirects.d.mts +17 -0
- package/dist/development/core/request-routing/handle-shopify-redirects.mjs +31 -0
- package/dist/development/core/request-routing/handle-shopify-redirects.mjs.map +1 -0
- package/dist/development/core/request-routing/handle-shopify-routes.d.mts +1 -0
- package/dist/development/core/request-routing/handle-shopify-routes.development.d.mts +11 -0
- package/dist/development/core/request-routing/handle-shopify-routes.development.mjs +16 -0
- package/dist/development/core/request-routing/handle-shopify-routes.development.mjs.map +1 -0
- package/dist/development/core/request-routing/handle-shopify-routes.mjs +42 -0
- package/dist/development/core/request-routing/handle-shopify-routes.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/admin-redirect.mjs +12 -0
- package/dist/development/core/request-routing/interceptors/admin-redirect.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/ajax-api.mjs +16 -0
- package/dist/development/core/request-routing/interceptors/ajax-api.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/api-proxy.mjs +20 -0
- package/dist/development/core/request-routing/interceptors/api-proxy.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/checkout.mjs +58 -0
- package/dist/development/core/request-routing/interceptors/checkout.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/graphiql.mjs +46 -0
- package/dist/development/core/request-routing/interceptors/graphiql.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/mcp-proxy.mjs +23 -0
- package/dist/development/core/request-routing/interceptors/mcp-proxy.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/proxy.mjs +73 -0
- package/dist/development/core/request-routing/interceptors/proxy.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/query-param-redirect.mjs +22 -0
- package/dist/development/core/request-routing/interceptors/query-param-redirect.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/sfapi-proxy.mjs +27 -0
- package/dist/development/core/request-routing/interceptors/sfapi-proxy.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/standard-routes.mjs +19 -0
- package/dist/development/core/request-routing/interceptors/standard-routes.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/url-redirects.mjs +27 -0
- package/dist/development/core/request-routing/interceptors/url-redirects.mjs.map +1 -0
- package/dist/development/core/request-routing/interceptors/well-known.mjs +22 -0
- package/dist/development/core/request-routing/interceptors/well-known.mjs.map +1 -0
- package/dist/development/core/request-routing/registered-routes.d.mts +7 -0
- package/dist/development/core/request-routing/registered-routes.mjs +72 -0
- package/dist/development/core/request-routing/registered-routes.mjs.map +1 -0
- package/dist/development/core/request-routing/route-types.d.mts +56 -0
- package/dist/development/core/request-routing/safe-apply-response-headers.mjs +16 -0
- package/dist/development/core/request-routing/safe-apply-response-headers.mjs.map +1 -0
- package/dist/development/core/shop-pay/shop-pay.d.mts +102 -0
- package/dist/development/core/shop-pay/shop-pay.mjs +289 -0
- package/dist/development/core/shop-pay/shop-pay.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/analytics.mjs +26 -0
- package/dist/development/core/shopify-scripts/analytics.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/consent.mjs +17 -0
- package/dist/development/core/shopify-scripts/consent.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/constants.mjs +19 -0
- package/dist/development/core/shopify-scripts/constants.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/deprecated-cookies.mjs +97 -0
- package/dist/development/core/shopify-scripts/deprecated-cookies.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/global.d.mts +1 -0
- package/dist/development/core/shopify-scripts/global.mjs +86 -0
- package/dist/development/core/shopify-scripts/global.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/index.d.mts +27 -0
- package/dist/development/core/shopify-scripts/index.mjs +145 -0
- package/dist/development/core/shopify-scripts/index.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/initialize.d.mts +18 -0
- package/dist/development/core/shopify-scripts/initialize.mjs +27 -0
- package/dist/development/core/shopify-scripts/initialize.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/page-view.mjs +49 -0
- package/dist/development/core/shopify-scripts/page-view.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/perfkit.mjs +33 -0
- package/dist/development/core/shopify-scripts/perfkit.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/render.d.mts +1 -0
- package/dist/development/core/shopify-scripts/render.mjs +23 -0
- package/dist/development/core/shopify-scripts/render.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/types.d.mts +76 -0
- package/dist/development/core/shopify-scripts/utils/cookie-domain.mjs +43 -0
- package/dist/development/core/shopify-scripts/utils/cookie-domain.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/utils/inline-script.mjs +8 -0
- package/dist/development/core/shopify-scripts/utils/inline-script.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/utils/navigation.mjs +46 -0
- package/dist/development/core/shopify-scripts/utils/navigation.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/utils/tracking-values.mjs +65 -0
- package/dist/development/core/shopify-scripts/utils/tracking-values.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/utils/uuid.mjs +17 -0
- package/dist/development/core/shopify-scripts/utils/uuid.mjs.map +1 -0
- package/dist/development/core/shopify-scripts/webmcp.mjs +22 -0
- package/dist/development/core/shopify-scripts/webmcp.mjs.map +1 -0
- package/dist/development/core/standard-routes/build.d.mts +34 -0
- package/dist/development/core/standard-routes/build.mjs +54 -0
- package/dist/development/core/standard-routes/build.mjs.map +1 -0
- package/dist/development/core/standard-routes/defaults.mjs +31 -0
- package/dist/development/core/standard-routes/defaults.mjs.map +1 -0
- package/dist/development/core/standard-routes/match.mjs +108 -0
- package/dist/development/core/standard-routes/match.mjs.map +1 -0
- package/dist/development/core/standard-routes/path.mjs +58 -0
- package/dist/development/core/standard-routes/path.mjs.map +1 -0
- package/dist/development/core/standard-routes/redirects.mjs +51 -0
- package/dist/development/core/standard-routes/redirects.mjs.map +1 -0
- package/dist/development/core/standard-routes/types.d.mts +95 -0
- package/dist/development/core/types.d.mts +11 -0
- package/dist/development/core/url.mjs +42 -0
- package/dist/development/core/url.mjs.map +1 -0
- package/dist/development/core/utils/load-script.mjs +34 -0
- package/dist/development/core/utils/load-script.mjs.map +1 -0
- package/dist/development/core/utils/parse-gid.mjs +33 -0
- package/dist/development/core/utils/parse-gid.mjs.map +1 -0
- package/dist/development/customer-account/session.d.mts +46 -0
- package/dist/development/customer-account/session.mjs +21 -0
- package/dist/development/customer-account/session.mjs.map +1 -0
- package/dist/development/globals.d.mts +64 -0
- package/dist/development/graphql/generated/customer-account-api-types.d.mts +13 -0
- package/dist/development/graphql/generated/graphql-env.d.mts +19280 -0
- package/dist/development/graphql/generated/storefront-api-types.d.mts +47 -0
- package/dist/development/graphql/graphql.d.mts +40 -0
- package/dist/development/graphql/graphql.mjs +16 -0
- package/dist/development/graphql/graphql.mjs.map +1 -0
- package/dist/development/graphql/index.d.mts +2 -0
- package/dist/development/graphql/scalars.d.mts +15 -0
- package/dist/development/graphql/type-resolver.d.mts +229 -0
- package/dist/development/react/cart.d.mts +44 -0
- package/dist/development/react/cart.mjs +155 -0
- package/dist/development/react/cart.mjs.map +1 -0
- package/dist/development/react/collection.d.mts +91 -0
- package/dist/development/react/collection.mjs +129 -0
- package/dist/development/react/collection.mjs.map +1 -0
- package/dist/development/react/index.d.mts +13 -0
- package/dist/development/react/index.mjs +10 -0
- package/dist/development/react/predictive-search.d.mts +49 -0
- package/dist/development/react/predictive-search.mjs +133 -0
- package/dist/development/react/predictive-search.mjs.map +1 -0
- package/dist/development/react/product.d.mts +72 -0
- package/dist/development/react/product.mjs +127 -0
- package/dist/development/react/product.mjs.map +1 -0
- package/dist/development/react/shop-pay.d.mts +9 -0
- package/dist/development/react/shop-pay.mjs +16 -0
- package/dist/development/react/shop-pay.mjs.map +1 -0
- package/dist/development/react/shopify-scripts.d.mts +20 -0
- package/dist/development/react/shopify-scripts.mjs +39 -0
- package/dist/development/react/shopify-scripts.mjs.map +1 -0
- package/dist/development/vendor/standard-actions.d.mts +134 -0
- package/dist/development/vendor/standard-events.d.mts +1107 -0
- package/dist/development/vue/cart.d.mts +46 -0
- package/dist/development/vue/cart.mjs +122 -0
- package/dist/development/vue/cart.mjs.map +1 -0
- package/dist/development/vue/collection.d.mts +46 -0
- package/dist/development/vue/collection.mjs +108 -0
- package/dist/development/vue/collection.mjs.map +1 -0
- package/dist/development/vue/index.d.mts +11 -0
- package/dist/development/vue/index.mjs +8 -0
- package/dist/development/vue/predictive-search.d.mts +124 -0
- package/dist/development/vue/predictive-search.mjs +171 -0
- package/dist/development/vue/predictive-search.mjs.map +1 -0
- package/dist/development/vue/product.d.mts +57 -0
- package/dist/development/vue/product.mjs +167 -0
- package/dist/development/vue/product.mjs.map +1 -0
- package/dist/development/vue/shop-pay.d.mts +25 -0
- package/dist/development/vue/shop-pay.mjs +35 -0
- package/dist/development/vue/shop-pay.mjs.map +1 -0
- package/dist/development/vue/shopify-scripts.d.mts +127 -0
- package/dist/development/vue/shopify-scripts.mjs +79 -0
- package/dist/development/vue/shopify-scripts.mjs.map +1 -0
- package/dist/globals.d.mts +64 -0
- package/dist/graphql/generated/customer-account-api-types.d.mts +13 -0
- package/dist/graphql/generated/customer-account-graphql-env.d.mts +22170 -0
- package/dist/graphql/generated/graphql-env.d.mts +19280 -0
- package/dist/graphql/generated/storefront-api-types.d.mts +47 -0
- package/dist/graphql/graphql.d.mts +40 -0
- package/dist/graphql/graphql.mjs +16 -0
- package/dist/graphql/graphql.mjs.map +1 -0
- package/dist/graphql/index.d.mts +2 -0
- package/dist/graphql/scalars.d.mts +26 -0
- package/dist/graphql/type-resolver.d.mts +229 -0
- package/dist/react/cart.d.mts +44 -0
- package/dist/react/cart.mjs +155 -0
- package/dist/react/cart.mjs.map +1 -0
- package/dist/react/collection.d.mts +91 -0
- package/dist/react/collection.mjs +129 -0
- package/dist/react/collection.mjs.map +1 -0
- package/dist/react/index.d.mts +13 -0
- package/dist/react/index.mjs +10 -0
- package/dist/react/predictive-search.d.mts +49 -0
- package/dist/react/predictive-search.mjs +133 -0
- package/dist/react/predictive-search.mjs.map +1 -0
- package/dist/react/product.d.mts +72 -0
- package/dist/react/product.mjs +127 -0
- package/dist/react/product.mjs.map +1 -0
- package/dist/react/shop-pay.d.mts +9 -0
- package/dist/react/shop-pay.mjs +16 -0
- package/dist/react/shop-pay.mjs.map +1 -0
- package/dist/react/shopify-scripts.d.mts +20 -0
- package/dist/react/shopify-scripts.mjs +39 -0
- package/dist/react/shopify-scripts.mjs.map +1 -0
- package/dist/storefront-api-types.d.ts +2351 -2390
- package/dist/storefront.schema.json +41534 -1
- package/dist/ts-plugin/index.cjs +68 -0
- package/dist/ts-plugin/index.cjs.map +1 -0
- package/dist/ts-plugin/index.d.cts +4 -0
- package/dist/vendor/standard-actions.d.mts +134 -0
- package/dist/vendor/standard-events.d.mts +1107 -0
- package/dist/vite/certificate-prompt.mjs +24 -0
- package/dist/vite/certificate-prompt.mjs.map +1 -0
- package/dist/vite/index.d.mts +2 -0
- package/dist/vite/index.mjs +3 -0
- package/dist/vite/local-https.d.mts +47 -0
- package/dist/vite/local-https.mjs +276 -0
- package/dist/vite/local-https.mjs.map +1 -0
- package/dist/vite/mkcert.mjs +141 -0
- package/dist/vite/mkcert.mjs.map +1 -0
- package/dist/vue/cart.d.mts +46 -0
- package/dist/vue/cart.mjs +122 -0
- package/dist/vue/cart.mjs.map +1 -0
- package/dist/vue/collection.d.mts +46 -0
- package/dist/vue/collection.mjs +108 -0
- package/dist/vue/collection.mjs.map +1 -0
- package/dist/vue/index.d.mts +11 -0
- package/dist/vue/index.mjs +8 -0
- package/dist/vue/predictive-search.d.mts +124 -0
- package/dist/vue/predictive-search.mjs +171 -0
- package/dist/vue/predictive-search.mjs.map +1 -0
- package/dist/vue/product.d.mts +57 -0
- package/dist/vue/product.mjs +167 -0
- package/dist/vue/product.mjs.map +1 -0
- package/dist/vue/shop-pay.d.mts +25 -0
- package/dist/vue/shop-pay.mjs +35 -0
- package/dist/vue/shop-pay.mjs.map +1 -0
- package/dist/vue/shopify-scripts.d.mts +127 -0
- package/dist/vue/shopify-scripts.mjs +79 -0
- package/dist/vue/shopify-scripts.mjs.map +1 -0
- package/package.json +116 -86
- package/skills/hydrogen-analytics/SKILL.md +80 -0
- package/skills/hydrogen-analytics/references/react.md +160 -0
- package/skills/hydrogen-analytics/references/vue.md +80 -0
- package/skills/hydrogen-cart-drawer/SKILL.md +248 -0
- package/skills/hydrogen-cart-drawer/references/accessibility.md +109 -0
- package/skills/hydrogen-cart-drawer/references/css.md +67 -0
- package/skills/hydrogen-cart-ui/SKILL.md +224 -0
- package/skills/hydrogen-cart-ui/references/nextjs.md +89 -0
- package/skills/hydrogen-cart-ui/references/react.md +285 -0
- package/skills/hydrogen-cart-ui/references/vue.md +228 -0
- package/skills/hydrogen-collection-browser/SKILL.md +83 -0
- package/skills/hydrogen-collection-browser/references/nextjs.md +118 -0
- package/skills/hydrogen-collection-browser/references/nuxt.md +108 -0
- package/skills/hydrogen-collection-browser/references/react.md +301 -0
- package/skills/hydrogen-customer-account/SKILL.md +107 -0
- package/skills/hydrogen-image/SKILL.md +65 -0
- package/skills/hydrogen-local-https/SKILL.md +142 -0
- package/skills/hydrogen-markets/SKILL.md +221 -0
- package/skills/hydrogen-markets/references/nextjs.md +157 -0
- package/skills/hydrogen-money/SKILL.md +67 -0
- package/skills/hydrogen-oxygen/SKILL.md +245 -0
- package/skills/hydrogen-oxygen/references/react-router.md +230 -0
- package/skills/hydrogen-predictive-search/SKILL.md +130 -0
- package/skills/hydrogen-predictive-search/references/react.md +32 -0
- package/skills/hydrogen-predictive-search/references/vue.md +40 -0
- package/skills/hydrogen-request-handlers/SKILL.md +107 -0
- package/skills/hydrogen-request-handlers/references/frameworks.md +179 -0
- package/skills/hydrogen-request-handlers/references/nextjs.md +137 -0
- package/skills/hydrogen-request-handlers/references/nuxt.md +215 -0
- package/skills/hydrogen-routing/SKILL.md +171 -0
- package/skills/hydrogen-setup/SKILL.md +50 -0
- package/skills/hydrogen-setup/references/analytics.md +624 -0
- package/skills/hydrogen-setup/steps/1-inspect-app.md +62 -0
- package/skills/hydrogen-setup/steps/10-analytics.md +10 -0
- package/skills/hydrogen-setup/steps/11-verify.md +31 -0
- package/skills/hydrogen-setup/steps/2-scaffold.md +86 -0
- package/skills/hydrogen-setup/steps/3-build-home-page.md +37 -0
- package/skills/hydrogen-setup/steps/4-collection-and-search.md +14 -0
- package/skills/hydrogen-setup/steps/5-cart.md +10 -0
- package/skills/hydrogen-setup/steps/6-product-detail-page.md +416 -0
- package/skills/hydrogen-setup/steps/7-shopify-runtime-scripts.md +69 -0
- package/skills/hydrogen-setup/steps/8-cart-drawer-and-navbar.md +35 -0
- package/skills/hydrogen-setup/steps/9-account-page.md +54 -0
- package/skills/hydrogen-shop-pay/SKILL.md +79 -0
- package/skills/hydrogen-shop-pay/references/core.md +66 -0
- package/skills/hydrogen-shop-pay/references/react.md +50 -0
- package/skills/hydrogen-shop-pay/references/vue.md +39 -0
- package/skills/hydrogen-smoke-test/SKILL.md +205 -0
- package/skills/hydrogen-storefront-client/SKILL.md +322 -0
- package/skills/hydrogen-storefront-client/references/astro.md +125 -0
- package/skills/hydrogen-storefront-client/references/caching.md +25 -0
- package/skills/hydrogen-storefront-client/references/nextjs.md +121 -0
- package/skills/hydrogen-storefront-client/references/nuxt.md +121 -0
- package/skills/hydrogen-storefront-client/references/query-validation.md +95 -0
- package/skills/hydrogen-storefront-client/references/react-router.md +81 -0
- package/skills/hydrogen-storefront-client/references/solidstart.md +131 -0
- package/skills/hydrogen-storefront-client/references/sveltekit.md +169 -0
- package/skills/hydrogen-variant-form/SKILL.md +267 -0
- package/skills/hydrogen-variant-form/references/nextjs.md +207 -0
- package/skills/hydrogen-variant-form/references/nuxt.md +95 -0
- package/skills/hydrogen-variant-form/references/react.md +71 -0
- package/dist/dev/get-virtual-routes-H72465VB.js +0 -74
- package/dist/dev/hydrogen-routes.d.ts +0 -5
- package/dist/dev/hydrogen-routes.js +0 -25
- package/dist/development/get-virtual-routes-ACFZHU42.js +0 -71
- package/dist/development/get-virtual-routes-ACFZHU42.js.map +0 -1
- package/dist/development/index.cjs +0 -6978
- package/dist/development/index.cjs.map +0 -1
- package/dist/development/index.js +0 -6631
- package/dist/development/index.js.map +0 -1
- package/dist/development/log-seo-tags-IG37ONQ2.js +0 -74
- package/dist/development/log-seo-tags-IG37ONQ2.js.map +0 -1
- package/dist/development/react-router-preset.d.ts +0 -45
- package/dist/development/react-router-preset.js +0 -49
- package/dist/development/react-router-preset.js.map +0 -1
- package/dist/index.cjs +0 -1
- package/dist/oxygen/index.d.ts +0 -197
- package/dist/oxygen/index.js +0 -107
- package/dist/production/get-virtual-routes-ZZEGQQDV.js +0 -3
- package/dist/production/get-virtual-routes-ZZEGQQDV.js.map +0 -1
- package/dist/production/index.cjs +0 -1019
- package/dist/production/index.cjs.map +0 -1
- package/dist/production/index.d.cts +0 -3260
- package/dist/production/index.d.ts +0 -3260
- package/dist/production/index.js +0 -1019
- package/dist/production/index.js.map +0 -1
- package/dist/production/log-seo-tags-TY72EQWZ.js +0 -2
- package/dist/production/log-seo-tags-TY72EQWZ.js.map +0 -1
- package/dist/production/react-router-preset.d.ts +0 -45
- package/dist/production/react-router-preset.js +0 -11
- package/dist/react-router.d.ts +0 -75
- package/dist/vite/chunk-4O5OI3OO.js +0 -127
- package/dist/vite/chunk-FAQ7TVHC.js +0 -9
- package/dist/vite/chunk-QXBQVDMY.js +0 -68
- package/dist/vite/compat-date.d.ts +0 -3
- package/dist/vite/compat-date.js +0 -6
- package/dist/vite/get-virtual-routes.d.ts +0 -21
- package/dist/vite/get-virtual-routes.js +0 -74
- package/dist/vite/hydrogen-middleware.d.ts +0 -9
- package/dist/vite/hydrogen-middleware.js +0 -7
- package/dist/vite/plugin.d.ts +0 -22
- package/dist/vite/plugin.js +0 -171
- package/dist/vite/request-events.d.ts +0 -144
- package/dist/vite/request-events.js +0 -10
- package/dist/vite/types.d.ts +0 -5
- package/dist/vite/types.js +0 -0
- package/dist/vite/virtual-routes/assets/debug-network.css +0 -609
- package/dist/vite/virtual-routes/assets/favicon-dark.svg +0 -20
- package/dist/vite/virtual-routes/assets/favicon.svg +0 -28
- package/dist/vite/virtual-routes/assets/inter-variable-font.woff2 +0 -0
- package/dist/vite/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
- package/dist/vite/virtual-routes/assets/styles.css +0 -249
- package/dist/vite/virtual-routes/components/FlameChartWrapper.jsx +0 -123
- package/dist/vite/virtual-routes/components/HydrogenLogoBaseBW.jsx +0 -32
- package/dist/vite/virtual-routes/components/HydrogenLogoBaseColor.jsx +0 -47
- package/dist/vite/virtual-routes/components/IconBanner.jsx +0 -292
- package/dist/vite/virtual-routes/components/IconClose.jsx +0 -38
- package/dist/vite/virtual-routes/components/IconDiscard.jsx +0 -44
- package/dist/vite/virtual-routes/components/IconError.jsx +0 -61
- package/dist/vite/virtual-routes/components/IconGithub.jsx +0 -23
- package/dist/vite/virtual-routes/components/IconTwitter.jsx +0 -21
- package/dist/vite/virtual-routes/components/Layout.jsx +0 -7
- package/dist/vite/virtual-routes/components/RequestDetails.jsx +0 -171
- package/dist/vite/virtual-routes/components/RequestTable.jsx +0 -91
- package/dist/vite/virtual-routes/components/RequestWaterfall.jsx +0 -151
- package/dist/vite/virtual-routes/layout.jsx +0 -33
- package/dist/vite/virtual-routes/lib/useDebugNetworkServer.jsx +0 -178
- package/dist/vite/virtual-routes/routes/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx +0 -37
- package/dist/vite/virtual-routes/routes/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.tsx +0 -79
- package/dist/vite/virtual-routes/routes/graphiql.jsx +0 -5
- package/dist/vite/virtual-routes/routes/index.jsx +0 -265
- package/dist/vite/virtual-routes/routes/subrequest-profiler.jsx +0 -243
- package/dist/vite/virtual-routes/virtual-root-with-layout.jsx +0 -63
- package/dist/vite/virtual-routes/virtual-root.jsx +0 -67
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# 1. Inspect App
|
|
2
|
+
|
|
3
|
+
## Basic Compatibility
|
|
4
|
+
|
|
5
|
+
Read `package.json` in the current directory.
|
|
6
|
+
|
|
7
|
+
If it does not exist, stop and tell the user this skill must run in a javascript application with a `package.json` at its root.
|
|
8
|
+
|
|
9
|
+
If it does not contain `@shopify/hydrogen@preview` (or a more specific hash) in its dependencies, ask the user to install it. Do not assume package managers or install for the user.
|
|
10
|
+
|
|
11
|
+
### Continue when
|
|
12
|
+
|
|
13
|
+
- [ ] Current directrory has `package.json`
|
|
14
|
+
- [ ] Current project includes `@shopify/hydrogen@preview` or similar in its dependencies
|
|
15
|
+
|
|
16
|
+
## Styling
|
|
17
|
+
|
|
18
|
+
Identify how the app handles styling. You must follow an already established design system or library if present. Do not introduce a new styling approach when one already exists.
|
|
19
|
+
|
|
20
|
+
Common fingerprints:
|
|
21
|
+
|
|
22
|
+
| Library | Look for |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Tailwind CSS | `tailwind.config.*` at root; `@tailwindcss/vite` / `@tailwindcss/postcss` / `tailwindcss` in dependencies; `@import "tailwindcss"` or `@tailwind` directives in CSS; utility-heavy `className` / `class` usage |
|
|
25
|
+
| StyleX | `@stylexjs/stylex` in dependencies; `stylex.config.*` or StyleX Babel/SWC plugin config; `stylex.create(...)` / `stylex.props(...)` in components |
|
|
26
|
+
| CSS Modules | `*.module.css` / `*.module.scss` co-located with components; `import styles from '...module.css'` |
|
|
27
|
+
| Sass / SCSS | `sass` / `sass-embedded` in dependencies; `*.scss` / `*.sass` stylesheets |
|
|
28
|
+
| Panda CSS | `@pandacss/dev` / styled-system output; `panda.config.*` at root |
|
|
29
|
+
| UnoCSS | `unocss` in dependencies; `uno.config.*` / `unocss.config.*` at root |
|
|
30
|
+
| styled-components | `styled-components` in dependencies; `styled.*` / `createGlobalStyle` usage |
|
|
31
|
+
| Plain CSS | Global `*.css` imports with no module/utility/runtime styling library detected |
|
|
32
|
+
|
|
33
|
+
If multiple signals appear, prefer the one the app already uses for layout and components (config + component usage), not a transitive dependency alone. If none of the above match, treat the app as plain CSS / unstyled and keep new UI minimal semantic HTML.
|
|
34
|
+
|
|
35
|
+
### Continue when
|
|
36
|
+
|
|
37
|
+
- [ ] Styling approach identified (or confirmed absent)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Framework specific references
|
|
41
|
+
|
|
42
|
+
Every skill prefixed with `hydrogen-` *may* ship a framework-specific instruction file under its own `references/`. After detecting the framework, check that skill's `references/` for the matching file and read it before making framework-specific choices. If no matching reference exists, continue from the generic instructions and follow the app's existing conventions.
|
|
43
|
+
|
|
44
|
+
Inspect dependencies, configuration files, server entry points, route directories, and existing request lifecycle code. Identify whether the app has a framework that can run server code and expose request handlers, middleware, loaders, server functions, or route handlers.
|
|
45
|
+
|
|
46
|
+
Common root-level fingerprints:
|
|
47
|
+
|
|
48
|
+
| Framework | Look for | Reference file to look for |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| Astro | `astro.config.ts` / `astro.config.mjs` at root | `astro.md` |
|
|
51
|
+
| Next.js | `next.config.ts` / `next.config.js` / `next.config.mjs` at root | `nextjs.md` |
|
|
52
|
+
| React Router | `react-router.config.ts` at root | `react-router.md` |
|
|
53
|
+
| Nuxt | `nuxt.config.ts` / `nuxt.config.js` at root | `nuxt.md` |
|
|
54
|
+
| SvelteKit | `svelte.config.js` / `svelte.config.ts` at root | `sveltekit.md` |
|
|
55
|
+
| SolidStart | `app.config.ts` at root with `@solidjs/start` | `solidstart.md` |
|
|
56
|
+
| Marko | `marko.config.js` / `marko.config.ts` at root, or `@marko/run` | `marko.md` |
|
|
57
|
+
|
|
58
|
+
Do not hard block just because no reference file exists. Continue when the app has a real server request lifecycle where Hydrogen can run before routing and handle 404 redirects after routing. Stop only when the app is clearly browser-only, static-only, or has no way to run server code.
|
|
59
|
+
|
|
60
|
+
### Continue when
|
|
61
|
+
|
|
62
|
+
- [ ] Able to determine that the application serves HTTP requests
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Analytics
|
|
2
|
+
|
|
3
|
+
Invoke the `hydrogen-analytics` skill to wire storefront analytics. This depends on the request handlers (scaffold step) and Shopify runtime scripts being in place. Read `../references/analytics.md` for the full consent and setup details when needed.
|
|
4
|
+
|
|
5
|
+
## Continue when
|
|
6
|
+
|
|
7
|
+
- [ ] Page view analytics events publish on route navigation, including client-side navigations
|
|
8
|
+
- [ ] Product, collection, search, and cart view events publish on their routes
|
|
9
|
+
- [ ] Cart update tracking publishes deltas when line items change
|
|
10
|
+
- [ ] Analytics events respect consent: no destination receives events before consent is granted where consent is required
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Final Verification
|
|
2
|
+
|
|
3
|
+
Run this step only after every previous step's criteria pass. If any command fails, fix the app and rerun the failed command before moving on.
|
|
4
|
+
|
|
5
|
+
This step is mandatory and executable: every command below must actually run in this session, and its output must show it passed. Do not mark a check passed from memory, from an earlier run before subsequent code changes, or from reading the code. Do not report the setup as complete while any command is failing or unrun — a summary written before verification is a failed setup.
|
|
6
|
+
|
|
7
|
+
## Run The App's Own Checks
|
|
8
|
+
|
|
9
|
+
Inspect `package.json` scripts and run the applicable commands in this order:
|
|
10
|
+
|
|
11
|
+
1. Formatting fixer when present: `format`.
|
|
12
|
+
2. Static checks when present: `lint`, `typecheck`, or `check`. These must include `hydrogen gql check` — the `hydrogen-storefront-client` and `hydrogen-customer-account` skills chain it into `typecheck`; verify the chain is still in place before trusting a green run.
|
|
13
|
+
3. Build when present: `build`.
|
|
14
|
+
4. Tests when present: `test`.
|
|
15
|
+
5. Formatting check when present and distinct from `format`: `format:check`.
|
|
16
|
+
|
|
17
|
+
If Playwright is present, run it headless.
|
|
18
|
+
|
|
19
|
+
### Continue when
|
|
20
|
+
|
|
21
|
+
- [ ] Every applicable script was executed in this session, after the last code change, and passed
|
|
22
|
+
- [ ] `hydrogen gql check` ran as part of static checks (not skipped)
|
|
23
|
+
|
|
24
|
+
## Run Runtime Smoke Tests
|
|
25
|
+
|
|
26
|
+
Invoke the `hydrogen-smoke-test` skill for runtime verification of request handlers, navigation links, cart, product, collection/search, account, analytics, markets, money, and production-mode behavior. Run the request-handler curl checks against both dev and production builds when the framework supports both.
|
|
27
|
+
|
|
28
|
+
### Continue when
|
|
29
|
+
|
|
30
|
+
- [ ] Smoke checks pass against the dev server
|
|
31
|
+
- [ ] Smoke checks pass against the production build when the framework supports running one locally
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Scaffold
|
|
2
|
+
|
|
3
|
+
## Use Storefront Route Conventions
|
|
4
|
+
|
|
5
|
+
Preserve the app's existing route shape when present. When there is no established convention, use the standard paths:
|
|
6
|
+
|
|
7
|
+
- `/collections` for collection listing.
|
|
8
|
+
- `/collections/{handle}` for collection detail.
|
|
9
|
+
- `/search` for search results.
|
|
10
|
+
- `/products/{handle}` for product detail. Use plural `products`, not `/product`.
|
|
11
|
+
- `/cart` for the full cart page.
|
|
12
|
+
|
|
13
|
+
Hydrogen-owned handlers are not page routes: `/api/cart`, `/api/{api-version}/graphql.json`, the generic `/__shopify/*` API proxy, `/checkout`, cart permalinks like `/cart/{variantId}:{quantity}`, AJAX cart URLs like `/cart.js` and `/cart/add.js`, `/api/mcp`, `/graphiql` in development, Liquid-style `?variant=<numeric id>` product redirects, `/admin` redirects, and Storefront URL redirects belong in the `hydrogen-request-handlers` wiring.
|
|
14
|
+
|
|
15
|
+
Invoke the `hydrogen-routing` skill and create the shared route template manifest for Shopify resources such as products, collections, pages, blogs, or articles.
|
|
16
|
+
|
|
17
|
+
### Continue when
|
|
18
|
+
|
|
19
|
+
- [ ] Route templates are set up
|
|
20
|
+
|
|
21
|
+
## Use Standard Environment Names
|
|
22
|
+
|
|
23
|
+
Use these canonical environment variable names throughout the app (kept in sync with `hydrogen-storefront-client`):
|
|
24
|
+
|
|
25
|
+
- `PUBLIC_STORE_DOMAIN` for the Shopify store domain.
|
|
26
|
+
- `PUBLIC_STOREFRONT_API_TOKEN` for the public Storefront API token.
|
|
27
|
+
- `PRIVATE_STOREFRONT_API_TOKEN` for the private Storefront API token.
|
|
28
|
+
- `PUBLIC_STOREFRONT_ID` for analytics `storefrontId`; use `"0"` when the app does not have a storefront ID.
|
|
29
|
+
- `PUBLIC_CHECKOUT_DOMAIN` for app-level checkout-domain configuration such as CSP setup. Checkout links should come from cart data, usually `cart.checkoutUrl`.
|
|
30
|
+
- `SHOP_ID` for the numeric Shopify shop ID string. Required by Shopify runtime scripts (`ShopifyScripts`) for every storefront, and by Customer Account API.
|
|
31
|
+
- `PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID` for Customer Account OAuth.
|
|
32
|
+
- `CUSTOMER_ACCOUNT_SESSION_SECRET` for encrypted cookie examples. Prefer opaque server-side sessions in production apps.
|
|
33
|
+
|
|
34
|
+
If the framework requires a prefix to expose client-side variables, preserve the canonical suffix and add only the required framework prefix. Never expose `PRIVATE_STOREFRONT_API_TOKEN` to the client.
|
|
35
|
+
|
|
36
|
+
List `PUBLIC_STOREFRONT_API_TOKEN` in the app's env example file as a commented-out entry (`# PUBLIC_STOREFRONT_API_TOKEN=`). The Storefront client accepts `undefined` as tokenless access, which is all mock.shop supports, so the scaffold works before the user has tokens and upgrades in place when they add one. Do not write an uncommented empty assignment (`PUBLIC_STOREFRONT_API_TOKEN=`): env loaders parse that as an empty string, and the client rejects empty tokens. Recommend filling it in (or switching to a private client) once the app targets a real store.
|
|
37
|
+
|
|
38
|
+
### Continue when
|
|
39
|
+
|
|
40
|
+
- [ ] Env vars follow the canonical names (plus any required framework prefix)
|
|
41
|
+
- [ ] `PUBLIC_STOREFRONT_API_TOKEN` is listed commented-out in the env example until the user provides a token
|
|
42
|
+
- [ ] `PRIVATE_STOREFRONT_API_TOKEN` is not exposed to the client
|
|
43
|
+
|
|
44
|
+
## Keep Environment Access Server-Side
|
|
45
|
+
|
|
46
|
+
Never read `process.env`, `import.meta.env`, or framework environment modules from client components, browser singletons, or modules imported by client components. Environment access belongs in server-only modules, route loaders, route handlers, middleware, server functions, or the framework's server environment API.
|
|
47
|
+
|
|
48
|
+
Prefer resolving and formatting values on the server and passing them to client UI as serialized data. Any object or property derived from env or server config — such as the `shop` object passed to `ShopifyScripts` — should be assembled in the framework's server boundary (RSC, route loaders, server functions, worker request handlers) and flow down as props or loader data, never assembled in client code.
|
|
49
|
+
|
|
50
|
+
Client code should use same-origin Hydrogen endpoints/handlers for Shopify work. Private tokens and server-only config must never cross the server boundary.
|
|
51
|
+
|
|
52
|
+
### Continue when
|
|
53
|
+
|
|
54
|
+
- [ ] No client component or browser-imported module reads `process.env`, `import.meta.env`, or framework env modules
|
|
55
|
+
- [ ] Values derived from env are resolved in server boundaries and reach client UI only as serialized props or loader data
|
|
56
|
+
|
|
57
|
+
## Set Up The Storefront API Client
|
|
58
|
+
|
|
59
|
+
Invoke the `hydrogen-storefront-client` skill to wire the Storefront API client or client factory for the detected framework.
|
|
60
|
+
|
|
61
|
+
### Continue when
|
|
62
|
+
|
|
63
|
+
- [ ] Storefront client is initialised with a shopify request context
|
|
64
|
+
- [ ] A test graphql query can be ran on the home page and returns the correct type
|
|
65
|
+
- [ ] `hydrogen gql check` is chained into the `typecheck` script (per the `hydrogen-storefront-client` skill) and passes
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Install API Route Handlers
|
|
69
|
+
|
|
70
|
+
Invoke the `hydrogen-request-handlers` skill to wire `handleShopifyRoutes` before routing, `handleShopifyRedirects` after a 404 or in the framework's catch-all route, and request-context response-header propagation for custom and framework responses.
|
|
71
|
+
|
|
72
|
+
### Continue when
|
|
73
|
+
|
|
74
|
+
- [ ] `/api/graphiql` returns 200 in development mode
|
|
75
|
+
- [ ] `/admin` redirects to the Shopify Admin in development mode
|
|
76
|
+
|
|
77
|
+
## Set Up The Customer Account API
|
|
78
|
+
|
|
79
|
+
Invoke the `hydrogen-customer-account` skill to create the `customerSession` module and register the account route handlers through the `handleShopifyRoutes` setup from the previous section.
|
|
80
|
+
|
|
81
|
+
### Continue when
|
|
82
|
+
|
|
83
|
+
- [ ] `customerSession` is created at module scope
|
|
84
|
+
- [ ] customer account handlers (result of calling `createCustomerAccountServerHandlers`) is registered through `handleShopifyRoutes`
|
|
85
|
+
- [ ] `/account/login` does not 404
|
|
86
|
+
- [ ] `hydrogen gql check` passes when any page renders Customer Account API data
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Build home page
|
|
2
|
+
|
|
3
|
+
Create a simple server-rendered home page that proves Hydrogen is wired correctly.
|
|
4
|
+
|
|
5
|
+
## Data Requirements
|
|
6
|
+
|
|
7
|
+
Use the shared Storefront API client to fetch both collections and products in the page's server data-loading boundary.
|
|
8
|
+
|
|
9
|
+
The home query should include:
|
|
10
|
+
|
|
11
|
+
- Collection `id`, `title`, `handle`, and optional `image { url altText }`.
|
|
12
|
+
- Product `id`, `title`, `handle`, optional `featuredImage { url altText }`, and `priceRange { minVariantPrice { amount currencyCode } }`.
|
|
13
|
+
|
|
14
|
+
Do not fetch cart data for the home page. Cart belongs to the cart route and navbar link state, not to the home page sample.
|
|
15
|
+
|
|
16
|
+
## Rendering Requirements
|
|
17
|
+
|
|
18
|
+
- Render collections and products as separate sections.
|
|
19
|
+
- Link collection cards using the app's routing template (`hydrogen-routing` skill).
|
|
20
|
+
- Link product cards using the app's existing product route templates (`hydrogen-routing` skill).
|
|
21
|
+
- Format money with the local `hydrogen-money` skill; never do client-side currency arithmetic.
|
|
22
|
+
- Use empty states when collections or products are missing.
|
|
23
|
+
- Keep styles local to the app's existing styling approach. If there is no styling system, use minimal semantic HTML.
|
|
24
|
+
|
|
25
|
+
## Framework Notes
|
|
26
|
+
|
|
27
|
+
- Next.js App Router: fetch in `app/page.tsx` or a server helper it imports.
|
|
28
|
+
- React Router framework mode: fetch in the index route `loader` and render from loader data.
|
|
29
|
+
- SvelteKit: fetch in `+page.server.ts` and render in `+page.svelte`.
|
|
30
|
+
- Astro: fetch in `src/pages/index.astro` frontmatter.
|
|
31
|
+
- SolidStart: fetch through a server query or route data API used by `src/routes/index.tsx`.
|
|
32
|
+
|
|
33
|
+
## Continue when
|
|
34
|
+
|
|
35
|
+
- [ ] The home page renders products and collections
|
|
36
|
+
- [ ] Product and collection links point to the app's actual route shape
|
|
37
|
+
- [ ] Prices display with digits and units (e.g.: $20.95)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Build Collection And Search Browsing
|
|
2
|
+
|
|
3
|
+
Invoke the `hydrogen-collection-browser` skill when adding collection routes, search routes, filter sidebars, sort controls, active filter chips, or URL-synced product grids.
|
|
4
|
+
|
|
5
|
+
## Continue when
|
|
6
|
+
|
|
7
|
+
- [ ] Filtering and sorting update the URL without scroll reset when hydrated.
|
|
8
|
+
- [ ] Checkbox filters and price min/max controls both render, apply, and persist after reloading the URL.
|
|
9
|
+
- [ ] Reloading the filtered URL server-renders the same filtered state.
|
|
10
|
+
- [ ] With JavaScript disabled, checking filters and submitting the form loads the filtered URL.
|
|
11
|
+
- [ ] With JavaScript disabled, the load-more / pagination link loads the next page server-side.
|
|
12
|
+
- [ ] Active filter chips remove only one filter and preserve unrelated params.
|
|
13
|
+
- [ ] Searching with a search term does not erase the search term (preserves `q` search param).
|
|
14
|
+
- [ ] Back/forward navigation settles loading state.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Cart
|
|
2
|
+
|
|
3
|
+
## Add The Cart Route
|
|
4
|
+
|
|
5
|
+
Use the local `hydrogen-cart-ui` skill to create the cart route at the framework's idiomatic `/cart` path.
|
|
6
|
+
|
|
7
|
+
### Continue when
|
|
8
|
+
|
|
9
|
+
- [ ] The `/cart` route (or its custom route template) loads the cart and shows the empty state UI
|
|
10
|
+
- [ ] With javascript disabled, the `/cart` route still shows the empty state UI (progressive enhancement)
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
# Product Detail Page
|
|
2
|
+
|
|
3
|
+
Create a server-rendered product detail route with a variant picker and image.
|
|
4
|
+
|
|
5
|
+
## Route And Data
|
|
6
|
+
|
|
7
|
+
- Use the app's existing product route convention when present; otherwise create `/products/{handle}`.
|
|
8
|
+
- Fetch the product by handle in the framework's server data-loading boundary.
|
|
9
|
+
- Derive URL-selected options with `getSelectedProductOptions` and pass them as `$selectedOptions` to the product query.
|
|
10
|
+
- Start from the sample query below. Extend it for UI needs (extra media, SEO fields, related products). Keep one reusable `VariantFields` fragment shared by `firstSelectableVariant`, `selectedOrFirstAvailableVariant`, and `adjacentVariants` so `selectedVariant` always has the fields the UI needs after option selection.
|
|
11
|
+
- After writing or changing the product query, run the `hydrogen-storefront-client` skill's headless query validation check. Do not rely on TypeScript alone to catch invalid Storefront API fields.
|
|
12
|
+
- Check GraphQL `errors` before checking `data.product`. If the query returns errors, log them in the server console and return a 500 response. Return a 404 only when the query has no GraphQL errors and `data.product` is missing.
|
|
13
|
+
|
|
14
|
+
### `getSelectedProductOptions`
|
|
15
|
+
|
|
16
|
+
Treat each search param as an option name/value pair (`?Color=Red&Size=M` → `[{name:"Color",value:"Red"},{name:"Size",value:"M"}]`). Pass the result into the Storefront API query.
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { getSelectedProductOptions } from "@shopify/hydrogen";
|
|
20
|
+
|
|
21
|
+
const selectedOptions = getSelectedProductOptions({
|
|
22
|
+
searchParams: new URL(request.url).searchParams,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Optional: ignore non-option params (utm, ref, etc.) once option names are known
|
|
26
|
+
const selectedOptions = getSelectedProductOptions({
|
|
27
|
+
searchParams,
|
|
28
|
+
allowedOptionNames: product.options.map((option) => option.name),
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Passing `allowedOptionNames: []` filters out every option.
|
|
33
|
+
|
|
34
|
+
The `variant` search param is reserved for Liquid-style numeric variant ids and is never treated as an option name. Pass `routeTemplates` to `handleShopifyRoutes` (see the local `hydrogen-request-handlers` skill) so `?variant=<id>` product links redirect to the canonical option-params URL before this loader runs.
|
|
35
|
+
|
|
36
|
+
### Minimum product query
|
|
37
|
+
|
|
38
|
+
Extend and adjust fields as the UI needs them.
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { gql, type StorefrontApi } from "@shopify/hydrogen";
|
|
42
|
+
|
|
43
|
+
export const VARIANT_FIELDS_FRAGMENT = gql(`
|
|
44
|
+
fragment VariantFields on ProductVariant {
|
|
45
|
+
id
|
|
46
|
+
title
|
|
47
|
+
availableForSale
|
|
48
|
+
selectedOptions {
|
|
49
|
+
name
|
|
50
|
+
value
|
|
51
|
+
}
|
|
52
|
+
price {
|
|
53
|
+
amount
|
|
54
|
+
currencyCode
|
|
55
|
+
}
|
|
56
|
+
compareAtPrice {
|
|
57
|
+
amount
|
|
58
|
+
currencyCode
|
|
59
|
+
}
|
|
60
|
+
image {
|
|
61
|
+
url
|
|
62
|
+
altText
|
|
63
|
+
width
|
|
64
|
+
height
|
|
65
|
+
}
|
|
66
|
+
product {
|
|
67
|
+
title
|
|
68
|
+
handle
|
|
69
|
+
}
|
|
70
|
+
sku
|
|
71
|
+
}
|
|
72
|
+
`);
|
|
73
|
+
|
|
74
|
+
export const PRODUCT_QUERY = gql(
|
|
75
|
+
`
|
|
76
|
+
query Product(
|
|
77
|
+
$handle: String!
|
|
78
|
+
$selectedOptions: [SelectedOptionInput!]!
|
|
79
|
+
$country: CountryCode
|
|
80
|
+
$language: LanguageCode
|
|
81
|
+
) @inContext(country: $country, language: $language) {
|
|
82
|
+
product(handle: $handle) {
|
|
83
|
+
id
|
|
84
|
+
handle
|
|
85
|
+
title
|
|
86
|
+
vendor
|
|
87
|
+
description
|
|
88
|
+
descriptionHtml
|
|
89
|
+
requiresSellingPlan
|
|
90
|
+
options {
|
|
91
|
+
name
|
|
92
|
+
optionValues {
|
|
93
|
+
name
|
|
94
|
+
firstSelectableVariant {
|
|
95
|
+
...VariantFields
|
|
96
|
+
}
|
|
97
|
+
swatch {
|
|
98
|
+
color
|
|
99
|
+
image {
|
|
100
|
+
... on MediaImage {
|
|
101
|
+
image {
|
|
102
|
+
url
|
|
103
|
+
altText
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
encodedVariantExistence
|
|
111
|
+
encodedVariantAvailability
|
|
112
|
+
selectedOrFirstAvailableVariant(
|
|
113
|
+
selectedOptions: $selectedOptions
|
|
114
|
+
ignoreUnknownOptions: true
|
|
115
|
+
caseInsensitiveMatch: true
|
|
116
|
+
) {
|
|
117
|
+
...VariantFields
|
|
118
|
+
}
|
|
119
|
+
adjacentVariants(
|
|
120
|
+
selectedOptions: $selectedOptions
|
|
121
|
+
ignoreUnknownOptions: true
|
|
122
|
+
caseInsensitiveMatch: true
|
|
123
|
+
) {
|
|
124
|
+
...VariantFields
|
|
125
|
+
}
|
|
126
|
+
media(first: 8) {
|
|
127
|
+
nodes {
|
|
128
|
+
__typename
|
|
129
|
+
id
|
|
130
|
+
mediaContentType
|
|
131
|
+
alt
|
|
132
|
+
... on MediaImage {
|
|
133
|
+
image {
|
|
134
|
+
url
|
|
135
|
+
altText
|
|
136
|
+
width
|
|
137
|
+
height
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
previewImage {
|
|
141
|
+
url
|
|
142
|
+
altText
|
|
143
|
+
width
|
|
144
|
+
height
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
priceRange {
|
|
149
|
+
minVariantPrice {
|
|
150
|
+
amount
|
|
151
|
+
currencyCode
|
|
152
|
+
}
|
|
153
|
+
maxVariantPrice {
|
|
154
|
+
amount
|
|
155
|
+
currencyCode
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`,
|
|
161
|
+
[VARIANT_FIELDS_FRAGMENT],
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
export type ProductData = NonNullable<StorefrontApi.ResultOf<typeof PRODUCT_QUERY>["product"]>;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Example data fetching
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
const selectedOptions = getSelectedProductOptions({
|
|
171
|
+
searchParams: new URL(request.url).searchParams,
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const { data, errors } = await storefrontClient.graphql(PRODUCT_QUERY, {
|
|
175
|
+
variables: { handle, selectedOptions },
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
if (errors) {
|
|
179
|
+
console.error("[hydrogen] Product query failed", errors);
|
|
180
|
+
throw new Response("Product query failed", { status: 500 });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (!data?.product) {
|
|
184
|
+
throw new Response("Product not found", { status: 404 });
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## UI
|
|
189
|
+
|
|
190
|
+
- You must invoke the `hydrogen-variant-form` skill for option controls, add-to-cart form structure, URL selection, combined listings, price display, disabled states, sold-out states, cart error display, and user acceptance tests. Do not duplicate its rules or invent separate variant matrix logic.
|
|
191
|
+
- When the cart drawer is configured with the canonical anchor trigger, follow the `hydrogen-cart-drawer` skill's guidance and open optimistic state via `formProps({ beforeSubmit: openCartDrawer })`; the samples below use `beforeSubmit`.
|
|
192
|
+
- Product route loaders and server helpers may read env indirectly through server-only client/config modules. Product client components must not read `process.env`, `import.meta.env`, or framework env modules.
|
|
193
|
+
|
|
194
|
+
### React
|
|
195
|
+
|
|
196
|
+
Create typed bindings once from `@shopify/hydrogen/react`:
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
// lib/product.ts
|
|
200
|
+
import { createProductComponents } from "@shopify/hydrogen/react";
|
|
201
|
+
import type { ProductData } from "./product-query";
|
|
202
|
+
|
|
203
|
+
export const { ProductProvider, useProduct, useProductForm } =
|
|
204
|
+
createProductComponents<ProductData>();
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Wrap the purchase UI in `ProductProvider`. Put same-product URL navigation in `onSelect`, not inside each option control:
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { ProductProvider, useProductForm } from "~/lib/product";
|
|
211
|
+
|
|
212
|
+
export function ProductDetails({ product }: { product: ProductData }) {
|
|
213
|
+
const navigate = useNavigate(); // or Next.js router.replace
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<ProductProvider
|
|
217
|
+
product={product}
|
|
218
|
+
onSelect={(result) => {
|
|
219
|
+
const targetHandle =
|
|
220
|
+
result.selectedVariant?.product?.handle ?? product.handle;
|
|
221
|
+
void navigate(variantUrl(targetHandle, result.selectedOptions), {
|
|
222
|
+
replace: true,
|
|
223
|
+
preventScrollReset: true,
|
|
224
|
+
});
|
|
225
|
+
}}
|
|
226
|
+
>
|
|
227
|
+
<ProductPurchasePanel product={product} />
|
|
228
|
+
</ProductProvider>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`useProduct` is for read-only selection state (price, gallery, analytics). `useProductForm` adds form bindings (`register`, `formProps`, `pending`):
|
|
234
|
+
|
|
235
|
+
```tsx
|
|
236
|
+
function ProductPrice({ product }: { product: ProductData }) {
|
|
237
|
+
const { selectedVariant } = useProduct();
|
|
238
|
+
const price = selectedVariant?.price ?? product.priceRange.minVariantPrice;
|
|
239
|
+
return <p>{formatPrice(price)}</p>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function ProductPurchasePanel({ product }: { product: ProductData }) {
|
|
243
|
+
const { options, selectedVariant, formProps, register, errors } =
|
|
244
|
+
useProductForm();
|
|
245
|
+
const addable = canAddToCart(product, options);
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<>
|
|
249
|
+
{/* Option controls: see hydrogen-variant-form + its React reference */}
|
|
250
|
+
<form {...formProps({ beforeSubmit: openCartDrawer })}>
|
|
251
|
+
<input type="hidden" {...register("merchandiseId", {})} />
|
|
252
|
+
<input {...register("quantity", { defaultValue: 1 })} />
|
|
253
|
+
<button {...register("addToCart", {})} disabled={!addable}>
|
|
254
|
+
{addable
|
|
255
|
+
? "Add to cart"
|
|
256
|
+
: selectedVariant
|
|
257
|
+
? "Sold out"
|
|
258
|
+
: "Select options"}
|
|
259
|
+
</button>
|
|
260
|
+
</form>
|
|
261
|
+
{errors.userErrors.length > 0 ? (
|
|
262
|
+
<ul role="alert">
|
|
263
|
+
{errors.userErrors.map((error, index) => (
|
|
264
|
+
<li key={index}>{error.message}</li>
|
|
265
|
+
))}
|
|
266
|
+
</ul>
|
|
267
|
+
) : null}
|
|
268
|
+
</>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Framework notes:
|
|
274
|
+
|
|
275
|
+
- Next.js App Router: fetch in the server page; put `ProductProvider` and the form in a `"use client"` component. Use `router.replace(url, { scroll: false })` in `onSelect`.
|
|
276
|
+
- React Router: put URL sync in provider `onSelect`. Same-product option values are GET `<Link>`s that spread `register("optionValue", ...)` (no-JS fallback). Cross-product values use `<Link preventScrollReset>`. See the `hydrogen-variant-form` React reference.
|
|
277
|
+
|
|
278
|
+
### Vue
|
|
279
|
+
|
|
280
|
+
Create typed bindings once from `@shopify/hydrogen/vue`:
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
// storefront/product.ts
|
|
284
|
+
import { createProductComponents } from "@shopify/hydrogen/vue";
|
|
285
|
+
import type { ProductData } from "./product-types";
|
|
286
|
+
|
|
287
|
+
export const { ProductProvider, useProduct, useProductForm } =
|
|
288
|
+
createProductComponents<ProductData>();
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Wrap the page (or purchase panel) in `ProductProvider`. Sync the URL from `onSelect`:
|
|
292
|
+
|
|
293
|
+
```vue
|
|
294
|
+
<script setup lang="ts">
|
|
295
|
+
import { buildProductSelectionSearchParams } from "@shopify/hydrogen";
|
|
296
|
+
import { ProductProvider, type ProductData } from "~/storefront/product";
|
|
297
|
+
|
|
298
|
+
const props = defineProps<{ product: ProductData }>();
|
|
299
|
+
const router = useRouter();
|
|
300
|
+
const route = useRoute();
|
|
301
|
+
|
|
302
|
+
function handleSelect(result: {
|
|
303
|
+
selectedOptions: { name: string; value: string }[];
|
|
304
|
+
selectedVariant: { product?: { handle: string } | null } | null;
|
|
305
|
+
}) {
|
|
306
|
+
const targetHandle =
|
|
307
|
+
result.selectedVariant?.product?.handle ?? props.product.handle;
|
|
308
|
+
const params = buildProductSelectionSearchParams({
|
|
309
|
+
selectedOptions: result.selectedOptions,
|
|
310
|
+
optionNames: props.product.options.map((option) => option.name),
|
|
311
|
+
base: queryToSearchParams(route.query),
|
|
312
|
+
});
|
|
313
|
+
const query = searchParamsToQuery(params);
|
|
314
|
+
router.replace({ path: `/products/${targetHandle}`, query });
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function queryToSearchParams(query: typeof route.query) {
|
|
318
|
+
const params = new URLSearchParams();
|
|
319
|
+
for (const [key, value] of Object.entries(query)) {
|
|
320
|
+
const values = Array.isArray(value) ? value : [value];
|
|
321
|
+
for (const item of values) {
|
|
322
|
+
params.append(key, item ?? "");
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return params;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function searchParamsToQuery(params: URLSearchParams) {
|
|
329
|
+
const query: Record<string, string | string[]> = Object.create(null);
|
|
330
|
+
for (const [key, value] of params) {
|
|
331
|
+
const current = query[key];
|
|
332
|
+
if (current === undefined) query[key] = value;
|
|
333
|
+
else if (Array.isArray(current)) current.push(value);
|
|
334
|
+
else query[key] = [current, value];
|
|
335
|
+
}
|
|
336
|
+
return query;
|
|
337
|
+
}
|
|
338
|
+
</script>
|
|
339
|
+
|
|
340
|
+
<template>
|
|
341
|
+
<ProductProvider :product="product" :on-select="handleSelect">
|
|
342
|
+
<ProductPurchasePanel :product="product" />
|
|
343
|
+
</ProductProvider>
|
|
344
|
+
</template>
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
`useProduct` for read-only state; `useProductForm` for form bindings. Do not destructure the Vue composable return values — keep the object so getters stay reactive:
|
|
348
|
+
|
|
349
|
+
```vue
|
|
350
|
+
<script setup lang="ts">
|
|
351
|
+
import { canAddToCart } from "@shopify/hydrogen";
|
|
352
|
+
import {
|
|
353
|
+
useProduct,
|
|
354
|
+
useProductForm,
|
|
355
|
+
type ProductData,
|
|
356
|
+
} from "~/storefront/product";
|
|
357
|
+
import { openCartDrawer } from "~/storefront/cart-drawer";
|
|
358
|
+
|
|
359
|
+
const props = defineProps<{ product: ProductData }>();
|
|
360
|
+
|
|
361
|
+
const productState = useProduct();
|
|
362
|
+
const form = useProductForm();
|
|
363
|
+
const addable = computed(() => canAddToCart(props.product, form.options));
|
|
364
|
+
</script>
|
|
365
|
+
|
|
366
|
+
<template>
|
|
367
|
+
<p>
|
|
368
|
+
{{
|
|
369
|
+
formatMoney(
|
|
370
|
+
productState.selectedVariant?.price ??
|
|
371
|
+
product.priceRange.minVariantPrice,
|
|
372
|
+
)
|
|
373
|
+
}}
|
|
374
|
+
</p>
|
|
375
|
+
|
|
376
|
+
<!-- Option controls: see hydrogen-variant-form + its Nuxt/Vue reference -->
|
|
377
|
+
|
|
378
|
+
<form v-bind="form.formProps({ beforeSubmit: openCartDrawer })">
|
|
379
|
+
<input type="hidden" v-bind="form.register('merchandiseId', {})" />
|
|
380
|
+
<input v-bind="form.register('quantity', { defaultValue: 1 })" />
|
|
381
|
+
<button
|
|
382
|
+
v-bind="form.register('addToCart', {})"
|
|
383
|
+
:disabled="!addable || form.pending.value"
|
|
384
|
+
>
|
|
385
|
+
{{
|
|
386
|
+
addable
|
|
387
|
+
? "Add to cart"
|
|
388
|
+
: form.selectedVariant
|
|
389
|
+
? "Sold out"
|
|
390
|
+
: "Select options"
|
|
391
|
+
}}
|
|
392
|
+
</button>
|
|
393
|
+
</form>
|
|
394
|
+
</template>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Same-product option values should be `NuxtLink` (or the app's link component) GET links that `v-bind` `form.register('optionValue', ...)`. Cross-product combined-listing values navigate to the other product. See the `hydrogen-variant-form` Nuxt reference.
|
|
398
|
+
|
|
399
|
+
### Other Framework Gotchas
|
|
400
|
+
|
|
401
|
+
- SvelteKit: if using the core store directly, create it once, hydrate on product identity changes, and destroy it on unmount.
|
|
402
|
+
- Astro: only build this route when the app has server output or a server adapter. Put the interactive product form in a hydrated island or client script that owns the store lifecycle.
|
|
403
|
+
- SolidStart: manage the core store lifecycle inside the client component unless a local binding already exists.
|
|
404
|
+
|
|
405
|
+
## Continue when
|
|
406
|
+
|
|
407
|
+
- [ ] Directly loading `/products/{handle}` renders product data and a selected or first available variant when one exists
|
|
408
|
+
- [ ] Option values render as interactive elements (links/buttons)
|
|
409
|
+
- [ ] Clicking an option value in the browser changes the selected variant and the URL
|
|
410
|
+
- [ ] Adding a product to cart opens the cart drawer and shows the product in the cart
|
|
411
|
+
- [ ] An invalid or failing product query (e.g.: invalid field) logs the GraphQL error server-side and returns 500, not 404
|
|
412
|
+
- [ ] A valid query for a missing product returns 404
|
|
413
|
+
- [ ] Selecting a variant and refreshing the page persists the same variant selected
|
|
414
|
+
- [ ] With javascript disabled, clicking on a variant option navigates to the selected variant
|
|
415
|
+
- [ ] Cross-product option values use the framework's client-side link component when the app has one.
|
|
416
|
+
- [ ] The product variants form passes the `hydrogen-variant-form` skill's user acceptance tests.
|