@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,647 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { chmod, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { dirname, isAbsolute, join, parse, resolve } from "node:path";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
10
|
+
import { parseArgs } from "node:util";
|
|
11
|
+
|
|
12
|
+
//#region src/core/logging/types.ts
|
|
13
|
+
const DEFAULT_LOG_LEVEL = "info";
|
|
14
|
+
const LOG_LEVEL_VALUES = {
|
|
15
|
+
trace: 10,
|
|
16
|
+
debug: 20,
|
|
17
|
+
info: 30,
|
|
18
|
+
warn: 40,
|
|
19
|
+
error: 50,
|
|
20
|
+
fatal: 60,
|
|
21
|
+
silent: Number.POSITIVE_INFINITY
|
|
22
|
+
};
|
|
23
|
+
function isLevelEnabled(level, threshold) {
|
|
24
|
+
return LOG_LEVEL_VALUES[level] >= LOG_LEVEL_VALUES[threshold];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/core/logging/logging.ts
|
|
29
|
+
const CONSOLE_METHODS = {
|
|
30
|
+
trace: "debug",
|
|
31
|
+
debug: "debug",
|
|
32
|
+
info: "info",
|
|
33
|
+
warn: "warn",
|
|
34
|
+
error: "error",
|
|
35
|
+
fatal: "error"
|
|
36
|
+
};
|
|
37
|
+
function formatLogPrefix(level, scope) {
|
|
38
|
+
return `[hydrogen:${level}:${scope}]`;
|
|
39
|
+
}
|
|
40
|
+
function writeToConsole(level, message, context) {
|
|
41
|
+
const { scope, error, ...rest } = context ?? {};
|
|
42
|
+
const args = [scope ? `${formatLogPrefix(level, scope)} ${message}` : message];
|
|
43
|
+
if (error !== void 0) args.push(error);
|
|
44
|
+
if (Object.keys(rest).length > 0) args.push(rest);
|
|
45
|
+
console[CONSOLE_METHODS[level]](...args);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Built-in sink: writes `[hydrogen:<level>:<scope>] <message>` to a
|
|
49
|
+
* level-specific `console` method, followed by `context.error` and any extra
|
|
50
|
+
* context fields. `trace` uses `console.debug`; `fatal` uses `console.error`.
|
|
51
|
+
*/
|
|
52
|
+
const consoleLogger = {
|
|
53
|
+
trace: (message, context) => writeToConsole("trace", message, context),
|
|
54
|
+
debug: (message, context) => writeToConsole("debug", message, context),
|
|
55
|
+
info: (message, context) => writeToConsole("info", message, context),
|
|
56
|
+
warn: (message, context) => writeToConsole("warn", message, context),
|
|
57
|
+
error: (message, context) => writeToConsole("error", message, context),
|
|
58
|
+
fatal: (message, context) => writeToConsole("fatal", message, context)
|
|
59
|
+
};
|
|
60
|
+
const state = {
|
|
61
|
+
logger: consoleLogger,
|
|
62
|
+
level: DEFAULT_LOG_LEVEL
|
|
63
|
+
};
|
|
64
|
+
function emit(scope, level, message, context) {
|
|
65
|
+
if (!isLevelEnabled(level, state.level)) return;
|
|
66
|
+
try {
|
|
67
|
+
state.logger[level](message, {
|
|
68
|
+
...context,
|
|
69
|
+
scope
|
|
70
|
+
});
|
|
71
|
+
} catch (error) {
|
|
72
|
+
reportLoggerFailure(error, {
|
|
73
|
+
level,
|
|
74
|
+
scope,
|
|
75
|
+
message,
|
|
76
|
+
context
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function reportLoggerFailure(error, failedEntry) {
|
|
81
|
+
if (state.logger === consoleLogger) return;
|
|
82
|
+
const fallbackContext = {
|
|
83
|
+
scope: "logging",
|
|
84
|
+
error,
|
|
85
|
+
originalLevel: failedEntry.level,
|
|
86
|
+
originalScope: failedEntry.scope,
|
|
87
|
+
originalMessage: failedEntry.message
|
|
88
|
+
};
|
|
89
|
+
if (failedEntry.context !== void 0) fallbackContext.originalContext = failedEntry.context;
|
|
90
|
+
try {
|
|
91
|
+
consoleLogger.error("configured logger failed", fallbackContext);
|
|
92
|
+
} catch {}
|
|
93
|
+
}
|
|
94
|
+
/** @internal Returns the lazily-resolved scoped logger for a Hydrogen subsystem. */
|
|
95
|
+
function getLogger(scope) {
|
|
96
|
+
return {
|
|
97
|
+
trace: (message, context) => emit(scope, "trace", message, context),
|
|
98
|
+
debug: (message, context) => emit(scope, "debug", message, context),
|
|
99
|
+
info: (message, context) => emit(scope, "info", message, context),
|
|
100
|
+
warn: (message, context) => emit(scope, "warn", message, context),
|
|
101
|
+
error: (message, context) => emit(scope, "error", message, context),
|
|
102
|
+
fatal: (message, context) => emit(scope, "fatal", message, context)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/vite/mkcert.ts
|
|
108
|
+
const log = getLogger("local-https");
|
|
109
|
+
function confirm(message) {
|
|
110
|
+
consoleLogger.info(`☑️ ${message}`);
|
|
111
|
+
}
|
|
112
|
+
const MKCERT_VERSION = "v1.4.4";
|
|
113
|
+
const MKCERT_RELEASE_BASE_URL = `https://github.com/FiloSottile/mkcert/releases/download/${MKCERT_VERSION}`;
|
|
114
|
+
const EXECUTABLE_MODE = 493;
|
|
115
|
+
const SUCCESS_EXIT_CODE$2 = 0;
|
|
116
|
+
const DOWNLOAD_TIMEOUT_MS = 6e4;
|
|
117
|
+
const MKCERT_BINARIES = {
|
|
118
|
+
"darwin-arm64": {
|
|
119
|
+
assetName: `mkcert-${MKCERT_VERSION}-darwin-arm64`,
|
|
120
|
+
sha256: "c8af0df44bce04359794dad8ea28d750437411d632748049d08644ffb66a60c6"
|
|
121
|
+
},
|
|
122
|
+
"darwin-x64": {
|
|
123
|
+
assetName: `mkcert-${MKCERT_VERSION}-darwin-amd64`,
|
|
124
|
+
sha256: "a32dfab51f1845d51e810db8e47dcf0e6b51ae3422426514bf5a2b8302e97d4e"
|
|
125
|
+
},
|
|
126
|
+
"linux-arm64": {
|
|
127
|
+
assetName: `mkcert-${MKCERT_VERSION}-linux-arm64`,
|
|
128
|
+
sha256: "b98f2cc69fd9147fe4d405d859c57504571adec0d3611c3eefd04107c7ac00d0"
|
|
129
|
+
},
|
|
130
|
+
"linux-x64": {
|
|
131
|
+
assetName: `mkcert-${MKCERT_VERSION}-linux-amd64`,
|
|
132
|
+
sha256: "6d31c65b03972c6dc4a14ab429f2928300518b26503f58723e532d1b0a3bbb52"
|
|
133
|
+
},
|
|
134
|
+
"win32-arm64": {
|
|
135
|
+
assetName: `mkcert-${MKCERT_VERSION}-windows-arm64.exe`,
|
|
136
|
+
sha256: "793747256c562622d40127c8080df26add2fb44c50906ce9db63b42a5280582e"
|
|
137
|
+
},
|
|
138
|
+
"win32-x64": {
|
|
139
|
+
assetName: `mkcert-${MKCERT_VERSION}-windows-amd64.exe`,
|
|
140
|
+
sha256: "d2660b50a9ed59eada480750561c96abc2ed4c9a38c6a24d93e30e0977631398"
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/** @internal Exported for tests. */
|
|
144
|
+
function resolveMkcertBinary(platform, arch) {
|
|
145
|
+
const binary = MKCERT_BINARIES[`${platform}-${arch}`];
|
|
146
|
+
if (!binary) return void 0;
|
|
147
|
+
return {
|
|
148
|
+
...binary,
|
|
149
|
+
url: `${MKCERT_RELEASE_BASE_URL}/${binary.assetName}`
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function sha256Hex(bytes) {
|
|
153
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
154
|
+
}
|
|
155
|
+
/** @internal Exported for tests. */
|
|
156
|
+
async function downloadVerified(options) {
|
|
157
|
+
let bytes;
|
|
158
|
+
try {
|
|
159
|
+
const response = await fetch(options.url, { signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS) });
|
|
160
|
+
if (!response.ok) throw new Error(`mkcert download failed with status ${response.status}: ${options.url}`);
|
|
161
|
+
bytes = new Uint8Array(await response.arrayBuffer());
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (error instanceof Error && error.name === "TimeoutError") throw new Error(`mkcert download timed out after ${DOWNLOAD_TIMEOUT_MS / 1e3}s: ${options.url}`, { cause: error });
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
const digest = sha256Hex(bytes);
|
|
167
|
+
if (digest !== options.sha256) throw new Error(`mkcert download did not match the pinned SHA-256 checksum; refusing to run it.\n URL: ${options.url}\n Expected: ${options.sha256}\n Received: ${digest}`);
|
|
168
|
+
await mkdir(dirname(options.destination), { recursive: true });
|
|
169
|
+
const temporaryPath = `${options.destination}.tmp-${process.pid}`;
|
|
170
|
+
try {
|
|
171
|
+
await writeFile(temporaryPath, bytes, { mode: EXECUTABLE_MODE });
|
|
172
|
+
await chmod(temporaryPath, EXECUTABLE_MODE);
|
|
173
|
+
await rename(temporaryPath, options.destination);
|
|
174
|
+
} catch (error) {
|
|
175
|
+
await rm(temporaryPath, { force: true });
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function ensureMkcertBinary() {
|
|
180
|
+
const binary = resolveMkcertBinary(process.platform, process.arch);
|
|
181
|
+
if (!binary) throw new Error(`Automatic mkcert download is not available for ${process.platform}-${process.arch}. Install mkcert manually and generate the certificate.`);
|
|
182
|
+
const binaryPath = join(homedir(), ".shopify", "hydrogen", "mkcert", binary.assetName);
|
|
183
|
+
if (existsSync(binaryPath) && sha256Hex(await readFile(binaryPath)) === binary.sha256) return binaryPath;
|
|
184
|
+
log.info(`downloading mkcert ${MKCERT_VERSION}…`);
|
|
185
|
+
await downloadVerified({
|
|
186
|
+
url: binary.url,
|
|
187
|
+
sha256: binary.sha256,
|
|
188
|
+
destination: binaryPath
|
|
189
|
+
});
|
|
190
|
+
confirm(`mkcert ${MKCERT_VERSION} downloaded`);
|
|
191
|
+
return binaryPath;
|
|
192
|
+
}
|
|
193
|
+
function runMkcert(binaryPath, args) {
|
|
194
|
+
return new Promise((resolve, reject) => {
|
|
195
|
+
const child = spawn(binaryPath, args, { stdio: [
|
|
196
|
+
"inherit",
|
|
197
|
+
"pipe",
|
|
198
|
+
"pipe"
|
|
199
|
+
] });
|
|
200
|
+
let output = "";
|
|
201
|
+
const collect = (chunk) => {
|
|
202
|
+
output += chunk.toString();
|
|
203
|
+
};
|
|
204
|
+
child.stdout?.on("data", collect);
|
|
205
|
+
child.stderr?.on("data", collect);
|
|
206
|
+
child.on("error", reject);
|
|
207
|
+
child.on("close", (code, signal) => {
|
|
208
|
+
if (code === SUCCESS_EXIT_CODE$2) {
|
|
209
|
+
resolve(output);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const reason = signal ? `mkcert was killed by ${signal}` : `mkcert exited with code ${code}`;
|
|
213
|
+
reject(new Error(output.trim() === "" ? reason : `${reason}\n${output.trim()}`));
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
async function provisionCertificates(settings) {
|
|
218
|
+
const binaryPath = await ensureMkcertBinary();
|
|
219
|
+
await mkdir(dirname(settings.certPath), { recursive: true });
|
|
220
|
+
await mkdir(dirname(settings.keyPath), { recursive: true });
|
|
221
|
+
log.info("generating a trusted local certificate; mkcert may prompt for your password.");
|
|
222
|
+
confirm((await runMkcert(binaryPath, [
|
|
223
|
+
"-install",
|
|
224
|
+
"-cert-file",
|
|
225
|
+
settings.certPath,
|
|
226
|
+
"-key-file",
|
|
227
|
+
settings.keyPath,
|
|
228
|
+
settings.host
|
|
229
|
+
])).includes("The local CA is already installed") ? "The local CA is already installed in the system trust store" : "The local CA is now installed in the system trust store");
|
|
230
|
+
confirm(`Created a new certificate for "${settings.host}"`);
|
|
231
|
+
log.info("verifying certificates…");
|
|
232
|
+
const missingPaths = [settings.certPath, settings.keyPath].filter((path) => !existsSync(path));
|
|
233
|
+
if (missingPaths.length > 0) throw new Error(`mkcert did not create the expected files: ${missingPaths.join(", ")}`);
|
|
234
|
+
confirm("local https certificates ready");
|
|
235
|
+
}
|
|
236
|
+
async function uninstallCertificateAuthority() {
|
|
237
|
+
const binaryPath = await ensureMkcertBinary();
|
|
238
|
+
log.info("removing the local certificate authority; mkcert may prompt for your password.");
|
|
239
|
+
await runMkcert(binaryPath, ["-uninstall"]);
|
|
240
|
+
confirm("The local CA was removed from the system trust stores");
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/vite/local-https.ts
|
|
245
|
+
const LOCAL_HTTPS_DEFAULTS = {
|
|
246
|
+
host: "local.tryhydrogen.dev",
|
|
247
|
+
port: 5173
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Downloads a pinned, checksum-verified mkcert release and generates the
|
|
251
|
+
* trusted local certificate files when they do not exist yet. The Vite plugin
|
|
252
|
+
* runs this automatically on `vite dev`; call it directly for frameworks that
|
|
253
|
+
* read certificate paths before Vite starts or from setup scripts.
|
|
254
|
+
*/
|
|
255
|
+
async function provisionLocalHttps(options = {}) {
|
|
256
|
+
const settings = resolveLocalHttpsSettings({
|
|
257
|
+
enabled: true,
|
|
258
|
+
...options
|
|
259
|
+
});
|
|
260
|
+
if (!certificateFilesExist(settings)) await provisionCertificates(settings);
|
|
261
|
+
return {
|
|
262
|
+
host: settings.host,
|
|
263
|
+
certPath: settings.certPath,
|
|
264
|
+
keyPath: settings.keyPath
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function resolveLocalHttpsSettings(options) {
|
|
268
|
+
const host = options.host ?? LOCAL_HTTPS_DEFAULTS.host;
|
|
269
|
+
const certificateDirectory = join(homedir(), ".shopify", "hydrogen", "certs");
|
|
270
|
+
return {
|
|
271
|
+
host,
|
|
272
|
+
port: options.port ?? LOCAL_HTTPS_DEFAULTS.port,
|
|
273
|
+
certPath: resolveCertificatePath(options.certPath ?? join(certificateDirectory, `${host}.pem`)),
|
|
274
|
+
keyPath: resolveCertificatePath(options.keyPath ?? join(certificateDirectory, `${host}-key.pem`))
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function resolveCertificatePath(path) {
|
|
278
|
+
if (path instanceof URL) return fileURLToPath(path);
|
|
279
|
+
if (path === "~") return homedir();
|
|
280
|
+
if (path.startsWith("~/")) return resolve(homedir(), path.slice(2));
|
|
281
|
+
return isAbsolute(path) ? path : resolve(path);
|
|
282
|
+
}
|
|
283
|
+
function certificateFilesExist(settings) {
|
|
284
|
+
return existsSync(settings.certPath) && existsSync(settings.keyPath);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/cli/certs.ts
|
|
289
|
+
const REMOVE_CA_FLAG = "--remove-ca";
|
|
290
|
+
async function installLocalHttpsCertificates() {
|
|
291
|
+
const { host, certPath, keyPath } = await provisionLocalHttps();
|
|
292
|
+
console.log(`Local HTTPS is ready for https://${host}`);
|
|
293
|
+
console.log(` Certificate: ${certPath}`);
|
|
294
|
+
console.log(` Private key: ${keyPath}`);
|
|
295
|
+
}
|
|
296
|
+
async function uninstallLocalHttpsCertificates(args = []) {
|
|
297
|
+
const unknownArgument = args.find((argument) => argument !== REMOVE_CA_FLAG);
|
|
298
|
+
if (unknownArgument) throw new Error(`Unknown argument: ${unknownArgument}`);
|
|
299
|
+
const removeCertificateAuthority = args.includes(REMOVE_CA_FLAG);
|
|
300
|
+
if (removeCertificateAuthority) {
|
|
301
|
+
console.warn("Warning: removing mkcert's shared local CA will make certificates created by other projects untrusted.");
|
|
302
|
+
await uninstallCertificateAuthority();
|
|
303
|
+
}
|
|
304
|
+
const hydrogenDirectory = join(homedir(), ".shopify", "hydrogen");
|
|
305
|
+
const certificateDirectory = join(hydrogenDirectory, "certs");
|
|
306
|
+
const host = LOCAL_HTTPS_DEFAULTS.host;
|
|
307
|
+
const binary = resolveMkcertBinary(process.platform, process.arch);
|
|
308
|
+
const removals = [rm(join(certificateDirectory, `${host}.pem`), { force: true }), rm(join(certificateDirectory, `${host}-key.pem`), { force: true })];
|
|
309
|
+
if (binary) removals.push(rm(join(hydrogenDirectory, "mkcert", binary.assetName), { force: true }));
|
|
310
|
+
await Promise.all(removals);
|
|
311
|
+
console.log("Hydrogen's local HTTPS certificate files were removed.");
|
|
312
|
+
if (!removeCertificateAuthority) console.log(`The shared mkcert CA remains trusted. Pass ${REMOVE_CA_FLAG} to remove it.`);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/graphql/plugin-config.ts
|
|
317
|
+
const STOREFRONT_SCHEMA_FILE_NAME = "storefront.schema.json";
|
|
318
|
+
const CUSTOMER_ACCOUNT_SCHEMA_FILE_NAME = "customer-account.schema.json";
|
|
319
|
+
const STOREFRONT_OUTPUT_FILE_NAME = "storefront-graphql-env.d.ts";
|
|
320
|
+
const CUSTOMER_ACCOUNT_OUTPUT_FILE_NAME = "customer-account-graphql-env.d.ts";
|
|
321
|
+
function createGraphQLPluginConfig(schemaDirectory) {
|
|
322
|
+
return {
|
|
323
|
+
name: "gql.tada/ts-plugin",
|
|
324
|
+
schemas: [{
|
|
325
|
+
name: "storefront",
|
|
326
|
+
schema: join(schemaDirectory, STOREFRONT_SCHEMA_FILE_NAME),
|
|
327
|
+
tadaOutputLocation: STOREFRONT_OUTPUT_FILE_NAME
|
|
328
|
+
}, {
|
|
329
|
+
name: "customer-account",
|
|
330
|
+
schema: join(schemaDirectory, CUSTOMER_ACCOUNT_SCHEMA_FILE_NAME),
|
|
331
|
+
tadaOutputLocation: CUSTOMER_ACCOUNT_OUTPUT_FILE_NAME
|
|
332
|
+
}],
|
|
333
|
+
trackFieldUsage: false
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/cli/gql.ts
|
|
339
|
+
const GQL_TADA_CLI_PATH_FROM_PACKAGE_ROOT = "bin/cli.js";
|
|
340
|
+
const PACKAGE_ROOT_FROM_CLI_MODULE$1 = "../../";
|
|
341
|
+
const SUCCESS_EXIT_CODE$1 = 0;
|
|
342
|
+
const TSCONFIG_FILE_NAME = "tsconfig.json";
|
|
343
|
+
const TEMPORARY_TSCONFIG_PREFIX = ".hydrogen-gql-";
|
|
344
|
+
const CHECK_LEVELS = new Set([
|
|
345
|
+
"info",
|
|
346
|
+
"warn",
|
|
347
|
+
"error"
|
|
348
|
+
]);
|
|
349
|
+
function findTsconfig(cwd, configuredPath) {
|
|
350
|
+
if (configuredPath) return resolve(cwd, configuredPath);
|
|
351
|
+
let directory = cwd;
|
|
352
|
+
const root = parse(directory).root;
|
|
353
|
+
while (directory !== root) {
|
|
354
|
+
const candidate = join(directory, TSCONFIG_FILE_NAME);
|
|
355
|
+
if (existsSync(candidate)) return candidate;
|
|
356
|
+
directory = dirname(directory);
|
|
357
|
+
}
|
|
358
|
+
const rootCandidate = join(root, TSCONFIG_FILE_NAME);
|
|
359
|
+
if (existsSync(rootCandidate)) return rootCandidate;
|
|
360
|
+
throw new Error(`Could not find ${TSCONFIG_FILE_NAME}.`);
|
|
361
|
+
}
|
|
362
|
+
function spawnRunCommand$1(command, args, options) {
|
|
363
|
+
return new Promise((resolvePromise, reject) => {
|
|
364
|
+
const child = spawn(command, args, {
|
|
365
|
+
cwd: options.cwd,
|
|
366
|
+
stdio: "inherit"
|
|
367
|
+
});
|
|
368
|
+
child.on("error", reject);
|
|
369
|
+
child.on("close", (code) => {
|
|
370
|
+
if (code === SUCCESS_EXIT_CODE$1) {
|
|
371
|
+
resolvePromise();
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
reject(/* @__PURE__ */ new Error(`Command failed with exit code ${code}: ${command} ${args.join(" ")}`));
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function getPackageRoot$1() {
|
|
379
|
+
return resolve(import.meta.dirname, PACKAGE_ROOT_FROM_CLI_MODULE$1);
|
|
380
|
+
}
|
|
381
|
+
function getGqlTadaCliPath() {
|
|
382
|
+
return join(dirname(createRequire(import.meta.url).resolve("gql.tada/package.json")), GQL_TADA_CLI_PATH_FROM_PACKAGE_ROOT);
|
|
383
|
+
}
|
|
384
|
+
function parseCheckArgs(args) {
|
|
385
|
+
const { values } = parseArgs({
|
|
386
|
+
args,
|
|
387
|
+
options: {
|
|
388
|
+
"fail-on-warn": {
|
|
389
|
+
type: "boolean",
|
|
390
|
+
short: "w",
|
|
391
|
+
default: false
|
|
392
|
+
},
|
|
393
|
+
level: {
|
|
394
|
+
type: "string",
|
|
395
|
+
short: "l",
|
|
396
|
+
default: "info"
|
|
397
|
+
},
|
|
398
|
+
tsconfig: {
|
|
399
|
+
type: "string",
|
|
400
|
+
short: "c"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
strict: true
|
|
404
|
+
});
|
|
405
|
+
if (!CHECK_LEVELS.has(values.level)) throw new Error(`Invalid diagnostic level: ${values.level}`);
|
|
406
|
+
return values;
|
|
407
|
+
}
|
|
408
|
+
async function checkGraphQL(options = {}) {
|
|
409
|
+
const cwd = options.cwd ?? process.cwd();
|
|
410
|
+
const packageRoot = options.packageRoot ?? getPackageRoot$1();
|
|
411
|
+
const gqlTadaCliPath = options.gqlTadaCliPath ?? getGqlTadaCliPath();
|
|
412
|
+
const runCommand = options.runCommand ?? spawnRunCommand$1;
|
|
413
|
+
const values = parseCheckArgs(options.args ?? []);
|
|
414
|
+
const tsconfigPath = findTsconfig(cwd, values.tsconfig);
|
|
415
|
+
const temporaryTsconfigPath = join(dirname(tsconfigPath), `${TEMPORARY_TSCONFIG_PREFIX}${randomUUID()}.json`);
|
|
416
|
+
const pluginConfig = createGraphQLPluginConfig(join(packageRoot, "dist"));
|
|
417
|
+
writeFileSync(temporaryTsconfigPath, JSON.stringify({
|
|
418
|
+
extends: tsconfigPath,
|
|
419
|
+
compilerOptions: { plugins: [pluginConfig] }
|
|
420
|
+
}), { flag: "wx" });
|
|
421
|
+
const cliArgs = [
|
|
422
|
+
gqlTadaCliPath,
|
|
423
|
+
"check",
|
|
424
|
+
"--tsconfig",
|
|
425
|
+
temporaryTsconfigPath,
|
|
426
|
+
"--level",
|
|
427
|
+
values.level
|
|
428
|
+
];
|
|
429
|
+
if (values["fail-on-warn"]) cliArgs.push("--fail-on-warn");
|
|
430
|
+
const cleanup = () => rmSync(temporaryTsconfigPath, { force: true });
|
|
431
|
+
process.once("exit", cleanup);
|
|
432
|
+
try {
|
|
433
|
+
await runCommand(process.execPath, cliArgs, { cwd });
|
|
434
|
+
} finally {
|
|
435
|
+
process.off("exit", cleanup);
|
|
436
|
+
cleanup();
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/core/utils/record.ts
|
|
442
|
+
function isObjectRecord(value) {
|
|
443
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/cli/setup.ts
|
|
448
|
+
const PACKAGE_NAME = "@shopify/hydrogen";
|
|
449
|
+
const PACKAGE_INSTALL_SPEC = `${PACKAGE_NAME}@preview`;
|
|
450
|
+
const PACKAGE_ROOT_FROM_CLI_MODULE = "../../";
|
|
451
|
+
const SKILLS_DIRECTORY_NAME = "skills";
|
|
452
|
+
const CLAUDE_DIRECTORY_NAME = ".claude";
|
|
453
|
+
const AGENTS_DIRECTORY_NAME = ".agents";
|
|
454
|
+
const NODE_MODULES_DIRECTORY_NAME = "node_modules";
|
|
455
|
+
const PACKAGE_JSON_FILE_NAME = "package.json";
|
|
456
|
+
const SUCCESS_EXIT_CODE = 0;
|
|
457
|
+
const PACKAGE_MANAGER_LOCKFILES = [
|
|
458
|
+
["pnpm", "pnpm-lock.yaml"],
|
|
459
|
+
["yarn", "yarn.lock"],
|
|
460
|
+
["npm", "package-lock.json"],
|
|
461
|
+
["bun", "bun.lockb"],
|
|
462
|
+
["bun", "bun.lock"]
|
|
463
|
+
];
|
|
464
|
+
const INSTALL_ARGS = {
|
|
465
|
+
pnpm: ["add", PACKAGE_INSTALL_SPEC],
|
|
466
|
+
npm: ["install", PACKAGE_INSTALL_SPEC],
|
|
467
|
+
yarn: ["add", PACKAGE_INSTALL_SPEC],
|
|
468
|
+
bun: ["add", PACKAGE_INSTALL_SPEC]
|
|
469
|
+
};
|
|
470
|
+
function getStringRecord(value) {
|
|
471
|
+
if (!isObjectRecord(value)) return void 0;
|
|
472
|
+
const entries = Object.entries(value);
|
|
473
|
+
if (entries.some(([, entryValue]) => typeof entryValue !== "string")) return void 0;
|
|
474
|
+
return Object.fromEntries(entries);
|
|
475
|
+
}
|
|
476
|
+
function readPackageJson(appRoot) {
|
|
477
|
+
const packageJsonPath = join(appRoot, PACKAGE_JSON_FILE_NAME);
|
|
478
|
+
if (!existsSync(packageJsonPath)) throw new Error(`No ${PACKAGE_JSON_FILE_NAME} found. Run this command from the app root.`);
|
|
479
|
+
const parsed = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
480
|
+
if (!isObjectRecord(parsed)) throw new Error(`${PACKAGE_JSON_FILE_NAME} must contain a JSON object.`);
|
|
481
|
+
return {
|
|
482
|
+
packageManager: typeof parsed.packageManager === "string" ? parsed.packageManager : void 0,
|
|
483
|
+
dependencies: getStringRecord(parsed.dependencies),
|
|
484
|
+
devDependencies: getStringRecord(parsed.devDependencies)
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
function parsePackageManager(value) {
|
|
488
|
+
if (!value) return void 0;
|
|
489
|
+
for (const packageManager of Object.keys(INSTALL_ARGS)) {
|
|
490
|
+
if (value === packageManager) return packageManager;
|
|
491
|
+
if (value.startsWith(`${packageManager}@`)) return packageManager;
|
|
492
|
+
if (value.startsWith(`${packageManager}/`)) return packageManager;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function detectPackageManager(appRoot, packageJson, env) {
|
|
496
|
+
const packageJsonManager = parsePackageManager(packageJson.packageManager);
|
|
497
|
+
if (packageJsonManager) return packageJsonManager;
|
|
498
|
+
for (const [packageManager, lockfile] of PACKAGE_MANAGER_LOCKFILES) if (existsSync(join(appRoot, lockfile))) return packageManager;
|
|
499
|
+
const userAgentManager = parsePackageManager(env.npm_config_user_agent);
|
|
500
|
+
if (userAgentManager) return userAgentManager;
|
|
501
|
+
throw new Error("Could not detect a package manager. Add a packageManager field or a lockfile before running setup.");
|
|
502
|
+
}
|
|
503
|
+
function hasHydrogenDependency(packageJson) {
|
|
504
|
+
return Boolean(packageJson.dependencies?.[PACKAGE_NAME] ?? packageJson.devDependencies?.[PACKAGE_NAME]);
|
|
505
|
+
}
|
|
506
|
+
async function installHydrogen(appRoot, packageManager, runCommand) {
|
|
507
|
+
await runCommand(packageManager, [...INSTALL_ARGS[packageManager]], { cwd: appRoot });
|
|
508
|
+
}
|
|
509
|
+
function assertDirectory(directoryPath, message) {
|
|
510
|
+
if (!existsSync(directoryPath) || !statSync(directoryPath).isDirectory()) throw new Error(message);
|
|
511
|
+
}
|
|
512
|
+
function getSkillsDestinationRoots(appRoot) {
|
|
513
|
+
const destinationRoots = [];
|
|
514
|
+
const claudeDirectory = join(appRoot, CLAUDE_DIRECTORY_NAME);
|
|
515
|
+
if (existsSync(claudeDirectory)) {
|
|
516
|
+
assertDirectory(claudeDirectory, `${CLAUDE_DIRECTORY_NAME} exists but is not a directory.`);
|
|
517
|
+
destinationRoots.push(join(claudeDirectory, SKILLS_DIRECTORY_NAME));
|
|
518
|
+
}
|
|
519
|
+
const agentsDirectory = join(appRoot, AGENTS_DIRECTORY_NAME);
|
|
520
|
+
if (existsSync(agentsDirectory)) {
|
|
521
|
+
assertDirectory(agentsDirectory, `${AGENTS_DIRECTORY_NAME} exists but is not a directory.`);
|
|
522
|
+
destinationRoots.push(join(agentsDirectory, SKILLS_DIRECTORY_NAME));
|
|
523
|
+
}
|
|
524
|
+
return destinationRoots.length > 0 ? destinationRoots : [join(appRoot, AGENTS_DIRECTORY_NAME, SKILLS_DIRECTORY_NAME)];
|
|
525
|
+
}
|
|
526
|
+
function getSkillNames(sourceSkillsRoot) {
|
|
527
|
+
assertDirectory(sourceSkillsRoot, `No packaged skills found at ${sourceSkillsRoot}.`);
|
|
528
|
+
return readdirSync(sourceSkillsRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
529
|
+
}
|
|
530
|
+
function findConflictingSkills(destinationRoot, skillNames) {
|
|
531
|
+
return skillNames.filter((skillName) => existsSync(join(destinationRoot, skillName, "SKILL.md")));
|
|
532
|
+
}
|
|
533
|
+
function removeIncompleteSkills(destinationRoot, skillNames) {
|
|
534
|
+
for (const skillName of skillNames) {
|
|
535
|
+
const destinationPath = join(destinationRoot, skillName);
|
|
536
|
+
if (!existsSync(destinationPath)) continue;
|
|
537
|
+
if (existsSync(join(destinationPath, "SKILL.md"))) continue;
|
|
538
|
+
rmSync(destinationPath, {
|
|
539
|
+
recursive: true,
|
|
540
|
+
force: true
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
function copySkills(packageRoot, appRoot) {
|
|
545
|
+
const sourceSkillsRoot = join(packageRoot, SKILLS_DIRECTORY_NAME);
|
|
546
|
+
const destinationRoots = getSkillsDestinationRoots(appRoot);
|
|
547
|
+
const skillNames = getSkillNames(sourceSkillsRoot);
|
|
548
|
+
const conflictingSkills = destinationRoots.flatMap((destinationRoot) => findConflictingSkills(destinationRoot, skillNames).map((skillName) => join(destinationRoot, skillName)));
|
|
549
|
+
if (conflictingSkills.length > 0) throw new Error(`Skill directories already exist: ${conflictingSkills.join(", ")}. Remove them and rerun setup.`);
|
|
550
|
+
for (const destinationRoot of destinationRoots) {
|
|
551
|
+
removeIncompleteSkills(destinationRoot, skillNames);
|
|
552
|
+
mkdirSync(destinationRoot, { recursive: true });
|
|
553
|
+
for (const skillName of skillNames) cpSync(join(sourceSkillsRoot, skillName), join(destinationRoot, skillName), {
|
|
554
|
+
recursive: true,
|
|
555
|
+
errorOnExist: true,
|
|
556
|
+
force: false
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
return {
|
|
560
|
+
destinationRoots,
|
|
561
|
+
copiedCount: skillNames.length * destinationRoots.length
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
function getPackageRoot() {
|
|
565
|
+
return fileURLToPath(new URL(PACKAGE_ROOT_FROM_CLI_MODULE, import.meta.url));
|
|
566
|
+
}
|
|
567
|
+
function getLocalPackageRoot(appRoot) {
|
|
568
|
+
const localPackageRoot = join(appRoot, NODE_MODULES_DIRECTORY_NAME, PACKAGE_NAME);
|
|
569
|
+
if (!existsSync(localPackageRoot)) return void 0;
|
|
570
|
+
assertDirectory(localPackageRoot, `${localPackageRoot} exists but is not a directory.`);
|
|
571
|
+
return realpathSync(localPackageRoot);
|
|
572
|
+
}
|
|
573
|
+
function spawnRunCommand(command, args, options) {
|
|
574
|
+
return new Promise((resolve, reject) => {
|
|
575
|
+
const child = spawn(command, args, {
|
|
576
|
+
cwd: options.cwd,
|
|
577
|
+
stdio: "inherit"
|
|
578
|
+
});
|
|
579
|
+
child.on("error", reject);
|
|
580
|
+
child.on("close", (code) => {
|
|
581
|
+
if (code === SUCCESS_EXIT_CODE) {
|
|
582
|
+
resolve();
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
reject(/* @__PURE__ */ new Error(`Command failed with exit code ${code}: ${command} ${args.join(" ")}`));
|
|
586
|
+
});
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
async function setupHydrogen(options = {}) {
|
|
590
|
+
const appRoot = options.cwd ?? process.cwd();
|
|
591
|
+
const env = options.env ?? process.env;
|
|
592
|
+
const runCommand = options.runCommand ?? spawnRunCommand;
|
|
593
|
+
const log = options.log ?? console.log;
|
|
594
|
+
const packageJson = readPackageJson(appRoot);
|
|
595
|
+
if (!hasHydrogenDependency(packageJson)) {
|
|
596
|
+
const packageManager = detectPackageManager(appRoot, packageJson, env);
|
|
597
|
+
log(`Installing ${PACKAGE_NAME} with ${packageManager}...`);
|
|
598
|
+
await installHydrogen(appRoot, packageManager, runCommand);
|
|
599
|
+
}
|
|
600
|
+
const result = copySkills(options.packageRoot ?? getLocalPackageRoot(appRoot) ?? getPackageRoot(), appRoot);
|
|
601
|
+
log(`Copied ${result.copiedCount} Hydrogen skills to ${result.destinationRoots.join(", ")}.`);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region src/cli/index.ts
|
|
606
|
+
const CLI_ARGUMENTS_INDEX = 2;
|
|
607
|
+
const FAILURE_EXIT_CODE = 1;
|
|
608
|
+
const COMMANDS = [
|
|
609
|
+
{
|
|
610
|
+
path: ["certs", "install"],
|
|
611
|
+
run: async (_args) => installLocalHttpsCertificates()
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
path: ["certs", "uninstall"],
|
|
615
|
+
run: async (args) => uninstallLocalHttpsCertificates(args)
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
path: ["setup"],
|
|
619
|
+
run: async (_args) => setupHydrogen()
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
path: ["gql", "check"],
|
|
623
|
+
run: async (args) => checkGraphQL({ args })
|
|
624
|
+
}
|
|
625
|
+
];
|
|
626
|
+
function commandMatches(path, args) {
|
|
627
|
+
return path.every((segment, index) => args[index] === segment);
|
|
628
|
+
}
|
|
629
|
+
function runCli() {
|
|
630
|
+
const args = process.argv.slice(CLI_ARGUMENTS_INDEX);
|
|
631
|
+
const command = COMMANDS.find(({ path }) => commandMatches(path, args));
|
|
632
|
+
if (!command) {
|
|
633
|
+
const commandName = args.join(" ");
|
|
634
|
+
const availableCommands = COMMANDS.map(({ path }) => path.join(" ")).join(", ");
|
|
635
|
+
console.error(commandName ? `Unknown command: ${commandName}` : "No command specified.");
|
|
636
|
+
console.error(`Available commands: ${availableCommands}`);
|
|
637
|
+
process.exit(FAILURE_EXIT_CODE);
|
|
638
|
+
}
|
|
639
|
+
command.run(args.slice(command.path.length)).catch((error) => {
|
|
640
|
+
console.error(error instanceof Error ? error.message : "An unexpected error occurred");
|
|
641
|
+
process.exit(FAILURE_EXIT_CODE);
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
if (process.argv[1] !== void 0 && fileURLToPath(import.meta.url) === realpathSync(process.argv[1])) runCli();
|
|
645
|
+
|
|
646
|
+
//#endregion
|
|
647
|
+
export { runCli };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CachingStrategy } from "../core/cache/strategies.mjs";
|
|
2
|
+
import { CacheInstance } from "../core/cache/run-with-cache.mjs";
|
|
3
|
+
import { ShopifyRequestContext } from "../core/request-context.mjs";
|
|
4
|
+
import { ClientType, CreateStorefrontClientArgs, StorefrontClient } from "./types.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/client/client.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Creates a type-safe Storefront API client.
|
|
9
|
+
*
|
|
10
|
+
* Pick a `type` based on where your code runs and whether buyer context is available:
|
|
11
|
+
*
|
|
12
|
+
* | | public | private | private_no_buyer_context |
|
|
13
|
+
* |-----------------|--------------------------------|-------------------------------|--------------------------|
|
|
14
|
+
* | Runs in | Browser or mobile | Server (SSR) | Server (background) |
|
|
15
|
+
* | Token | Public access token, or none | Private access token | Private access token |
|
|
16
|
+
* | Buyer context | Browser request context | You forward trusted `buyerIp` | None |
|
|
17
|
+
* | Best for | Client-side fetches | SSR with buyer context | Webhooks, background jobs |
|
|
18
|
+
*
|
|
19
|
+
* Pass `requestContext` so the client's SFAPI requests carry request-scoped
|
|
20
|
+
* headers, follow the incoming request's abort signal, and read the resolved
|
|
21
|
+
* `i18n` used for Storefront API variable injection and localized routes.
|
|
22
|
+
*
|
|
23
|
+
* Token-based access is required for some Storefront API fields, including
|
|
24
|
+
* product tags, metaobjects, metafields, menus, and customers. Use a private
|
|
25
|
+
* client only in trusted server code where the token cannot leak to browsers.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://shopify.dev/docs/api/storefront#authentication | Storefront API authentication}
|
|
28
|
+
*/
|
|
29
|
+
declare function createStorefrontClient<const Type extends ClientType, const RequestContext extends ShopifyRequestContext, const CacheConfig extends CacheInstance | undefined = undefined>(args: CreateStorefrontClientArgs<RequestContext, Type, CacheConfig>): StorefrontClient<[CacheConfig] extends [CacheInstance] ? {
|
|
30
|
+
cache?: CachingStrategy;
|
|
31
|
+
} : {}, Type, RequestContext>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { createStorefrontClient };
|
|
34
|
+
//# sourceMappingURL=client.d.mts.map
|