@shopify/hydrogen 1.6.5 → 2.0.0-alpha.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/dist/development/index.cjs +637 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +626 -0
- package/dist/development/index.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/production/index.cjs +61 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.d.ts +218 -0
- package/dist/production/index.js +50 -0
- package/dist/production/index.js.map +1 -0
- package/package.json +42 -146
- package/README.md +0 -29
- package/dist/esnext/FileSessionStorage.d.ts +0 -1
- package/dist/esnext/FileSessionStorage.js +0 -1
- package/dist/esnext/client.d.ts +0 -16
- package/dist/esnext/client.js +0 -16
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +0 -23
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +0 -49
- package/dist/esnext/components/AddToCartButton/index.d.ts +0 -1
- package/dist/esnext/components/AddToCartButton/index.js +0 -1
- package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +0 -16
- package/dist/esnext/components/BaseButton/BaseButton.client.js +0 -16
- package/dist/esnext/components/BaseButton/index.d.ts +0 -1
- package/dist/esnext/components/BaseButton/index.js +0 -1
- package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +0 -16
- package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +0 -27
- package/dist/esnext/components/BuyNowButton/index.d.ts +0 -1
- package/dist/esnext/components/BuyNowButton/index.js +0 -1
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +0 -11
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +0 -17
- package/dist/esnext/components/CartCheckoutButton/index.d.ts +0 -1
- package/dist/esnext/components/CartCheckoutButton/index.js +0 -1
- package/dist/esnext/components/CartCost/CartCost.client.d.ts +0 -14
- package/dist/esnext/components/CartCost/CartCost.client.js +0 -29
- package/dist/esnext/components/CartCost/index.d.ts +0 -1
- package/dist/esnext/components/CartCost/index.js +0 -1
- package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +0 -9
- package/dist/esnext/components/CartLineImage/CartLineImage.client.js +0 -11
- package/dist/esnext/components/CartLineImage/index.d.ts +0 -1
- package/dist/esnext/components/CartLineImage/index.js +0 -1
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +0 -12
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +0 -18
- package/dist/esnext/components/CartLinePrice/index.d.ts +0 -1
- package/dist/esnext/components/CartLinePrice/index.js +0 -1
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +0 -8
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +0 -12
- package/dist/esnext/components/CartLineProductTitle/index.d.ts +0 -1
- package/dist/esnext/components/CartLineProductTitle/index.js +0 -1
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +0 -11
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +0 -8
- package/dist/esnext/components/CartLineProvider/context.d.ts +0 -36
- package/dist/esnext/components/CartLineProvider/context.js +0 -2
- package/dist/esnext/components/CartLineProvider/index.d.ts +0 -2
- package/dist/esnext/components/CartLineProvider/index.js +0 -2
- package/dist/esnext/components/CartLineProvider/tests/fixtures.d.ts +0 -86
- package/dist/esnext/components/CartLineProvider/tests/fixtures.js +0 -34
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +0 -8
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +0 -12
- package/dist/esnext/components/CartLineQuantity/index.d.ts +0 -1
- package/dist/esnext/components/CartLineQuantity/index.js +0 -1
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +0 -12
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +0 -26
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +0 -1
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +0 -1
- package/dist/esnext/components/CartLines/CartLines.client.d.ts +0 -15
- package/dist/esnext/components/CartLines/CartLines.client.js +0 -17
- package/dist/esnext/components/CartLines/index.d.ts +0 -1
- package/dist/esnext/components/CartLines/index.js +0 -1
- package/dist/esnext/components/CartProvider/CartActions.client.d.ts +0 -61
- package/dist/esnext/components/CartProvider/CartActions.client.js +0 -132
- package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +0 -49
- package/dist/esnext/components/CartProvider/CartProvider.client.js +0 -433
- package/dist/esnext/components/CartProvider/cart-queries.d.ts +0 -10
- package/dist/esnext/components/CartProvider/cart-queries.js +0 -206
- package/dist/esnext/components/CartProvider/constants.d.ts +0 -2
- package/dist/esnext/components/CartProvider/constants.js +0 -2
- package/dist/esnext/components/CartProvider/context.d.ts +0 -2
- package/dist/esnext/components/CartProvider/context.js +0 -2
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +0 -95
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +0 -82
- package/dist/esnext/components/CartProvider/graphql/CartFragment.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +0 -96
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.js +0 -1
- package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +0 -91
- package/dist/esnext/components/CartProvider/graphql/CartQuery.js +0 -1
- package/dist/esnext/components/CartProvider/hooks.client.d.ts +0 -15
- package/dist/esnext/components/CartProvider/hooks.client.js +0 -71
- package/dist/esnext/components/CartProvider/index.d.ts +0 -4
- package/dist/esnext/components/CartProvider/index.js +0 -3
- package/dist/esnext/components/CartProvider/tests/fixtures.d.ts +0 -254
- package/dist/esnext/components/CartProvider/tests/fixtures.js +0 -53
- package/dist/esnext/components/CartProvider/types.d.ts +0 -275
- package/dist/esnext/components/CartProvider/types.js +0 -1
- package/dist/esnext/components/CartProvider/useCartAPIStateMachine.client.d.ts +0 -21
- package/dist/esnext/components/CartProvider/useCartAPIStateMachine.client.js +0 -270
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +0 -7
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +0 -17
- package/dist/esnext/components/CartShopPayButton/index.d.ts +0 -1
- package/dist/esnext/components/CartShopPayButton/index.js +0 -1
- package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +0 -21
- package/dist/esnext/components/ExternalVideo/ExternalVideo.js +0 -14
- package/dist/esnext/components/ExternalVideo/index.d.ts +0 -1
- package/dist/esnext/components/ExternalVideo/index.js +0 -1
- package/dist/esnext/components/Image/Image.d.ts +0 -105
- package/dist/esnext/components/Image/Image.js +0 -145
- package/dist/esnext/components/Image/index.d.ts +0 -2
- package/dist/esnext/components/Image/index.js +0 -1
- package/dist/esnext/components/Link/Link.client.d.ts +0 -27
- package/dist/esnext/components/Link/Link.client.js +0 -145
- package/dist/esnext/components/Link/index.d.ts +0 -1
- package/dist/esnext/components/Link/index.js +0 -1
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +0 -6
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +0 -5
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +0 -22
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +0 -23
- package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
- package/dist/esnext/components/LocalizationProvider/index.js +0 -1
- package/dist/esnext/components/MediaFile/MediaFile.d.ts +0 -19
- package/dist/esnext/components/MediaFile/MediaFile.js +0 -32
- package/dist/esnext/components/MediaFile/index.d.ts +0 -1
- package/dist/esnext/components/MediaFile/index.js +0 -1
- package/dist/esnext/components/Metafield/Metafield.client.d.ts +0 -17
- package/dist/esnext/components/Metafield/Metafield.client.js +0 -102
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +0 -12
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +0 -48
- package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +0 -1
- package/dist/esnext/components/Metafield/components/StarRating/index.js +0 -1
- package/dist/esnext/components/Metafield/components/index.d.ts +0 -1
- package/dist/esnext/components/Metafield/components/index.js +0 -1
- package/dist/esnext/components/Metafield/index.d.ts +0 -2
- package/dist/esnext/components/Metafield/index.js +0 -1
- package/dist/esnext/components/Metafield/types.d.ts +0 -4
- package/dist/esnext/components/Metafield/types.js +0 -1
- package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +0 -128
- package/dist/esnext/components/ModelViewer/ModelViewer.client.js +0 -104
- package/dist/esnext/components/ModelViewer/index.d.ts +0 -1
- package/dist/esnext/components/ModelViewer/index.js +0 -1
- package/dist/esnext/components/Money/Money.client.d.ts +0 -25
- package/dist/esnext/components/Money/Money.client.js +0 -39
- package/dist/esnext/components/Money/index.d.ts +0 -1
- package/dist/esnext/components/Money/index.js +0 -1
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +0 -21
- package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +0 -133
- package/dist/esnext/components/ProductOptionsProvider/context.d.ts +0 -2
- package/dist/esnext/components/ProductOptionsProvider/context.js +0 -2
- package/dist/esnext/components/ProductOptionsProvider/index.d.ts +0 -1
- package/dist/esnext/components/ProductOptionsProvider/index.js +0 -1
- package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +0 -18
- package/dist/esnext/components/ProductPrice/ProductPrice.client.js +0 -54
- package/dist/esnext/components/ProductPrice/index.d.ts +0 -1
- package/dist/esnext/components/ProductPrice/index.js +0 -1
- package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/CollectionSeo.client.js +0 -14
- package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/DefaultPageSeo.client.js +0 -18
- package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +0 -4
- package/dist/esnext/components/Seo/DescriptionSeo.client.js +0 -10
- package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +0 -2
- package/dist/esnext/components/Seo/HomePageSeo.client.js +0 -25
- package/dist/esnext/components/Seo/ImageSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/ImageSeo.client.js +0 -10
- package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/NoIndexSeo.client.js +0 -10
- package/dist/esnext/components/Seo/PageSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/PageSeo.client.js +0 -12
- package/dist/esnext/components/Seo/ProductSeo.client.d.ts +0 -5
- package/dist/esnext/components/Seo/ProductSeo.client.js +0 -62
- package/dist/esnext/components/Seo/Seo.client.d.ts +0 -30
- package/dist/esnext/components/Seo/Seo.client.js +0 -31
- package/dist/esnext/components/Seo/TitleSeo.client.d.ts +0 -3
- package/dist/esnext/components/Seo/TitleSeo.client.js +0 -10
- package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +0 -2
- package/dist/esnext/components/Seo/TwitterSeo.client.js +0 -9
- package/dist/esnext/components/Seo/index.d.ts +0 -1
- package/dist/esnext/components/Seo/index.js +0 -1
- package/dist/esnext/components/Seo/seo-types.d.ts +0 -18
- package/dist/esnext/components/Seo/seo-types.js +0 -1
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +0 -40
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +0 -56
- package/dist/esnext/components/ShopPayButton/index.d.ts +0 -1
- package/dist/esnext/components/ShopPayButton/index.js +0 -1
- package/dist/esnext/components/Video/Video.d.ts +0 -19
- package/dist/esnext/components/Video/Video.js +0 -23
- package/dist/esnext/components/Video/index.d.ts +0 -1
- package/dist/esnext/components/Video/index.js +0 -1
- package/dist/esnext/components/index.d.ts +0 -27
- package/dist/esnext/components/index.js +0 -25
- package/dist/esnext/components/types.d.ts +0 -71
- package/dist/esnext/components/types.js +0 -10
- package/dist/esnext/config.d.ts +0 -7
- package/dist/esnext/config.js +0 -5
- package/dist/esnext/constants.d.ts +0 -14
- package/dist/esnext/constants.js +0 -14
- package/dist/esnext/entry-client.d.ts +0 -3
- package/dist/esnext/entry-client.js +0 -197
- package/dist/esnext/entry-server.d.ts +0 -6
- package/dist/esnext/entry-server.js +0 -642
- package/dist/esnext/experimental.d.ts +0 -2
- package/dist/esnext/experimental.js +0 -2
- package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/Analytics.client.js +0 -30
- package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/Analytics.server.js +0 -47
- package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +0 -27
- package/dist/esnext/foundation/Analytics/ClientAnalytics.js +0 -99
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +0 -4
- package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +0 -51
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +0 -7
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +0 -83
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +0 -23
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +0 -7
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +0 -7
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +0 -191
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +0 -49
- package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +0 -31
- package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +0 -54
- package/dist/esnext/foundation/Analytics/connectors/Shopify/customer-events.client.d.ts +0 -2
- package/dist/esnext/foundation/Analytics/connectors/Shopify/customer-events.client.js +0 -182
- package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +0 -6
- package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +0 -125
- package/dist/esnext/foundation/Analytics/const.d.ts +0 -9
- package/dist/esnext/foundation/Analytics/const.js +0 -9
- package/dist/esnext/foundation/Analytics/hook.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/hook.js +0 -9
- package/dist/esnext/foundation/Analytics/index.d.ts +0 -1
- package/dist/esnext/foundation/Analytics/index.js +0 -1
- package/dist/esnext/foundation/Analytics/types.d.ts +0 -5
- package/dist/esnext/foundation/Analytics/types.js +0 -1
- package/dist/esnext/foundation/Analytics/utils.d.ts +0 -3
- package/dist/esnext/foundation/Analytics/utils.js +0 -29
- package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +0 -4
- package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +0 -8
- package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +0 -2
- package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +0 -23
- package/dist/esnext/foundation/BuiltInRoutes/healthCheck.d.ts +0 -1
- package/dist/esnext/foundation/BuiltInRoutes/healthCheck.js +0 -3
- package/dist/esnext/foundation/Cache/cache-sub-request.d.ts +0 -17
- package/dist/esnext/foundation/Cache/cache-sub-request.js +0 -64
- package/dist/esnext/foundation/Cache/cache.d.ts +0 -17
- package/dist/esnext/foundation/Cache/cache.js +0 -126
- package/dist/esnext/foundation/Cache/strategies/index.d.ts +0 -7
- package/dist/esnext/foundation/Cache/strategies/index.js +0 -54
- package/dist/esnext/foundation/Cookie/Cookie.d.ts +0 -48
- package/dist/esnext/foundation/Cookie/Cookie.js +0 -72
- package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +0 -5
- package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +0 -32
- package/dist/esnext/foundation/DevTools/DevTools.client.d.ts +0 -3
- package/dist/esnext/foundation/DevTools/DevTools.client.js +0 -17
- package/dist/esnext/foundation/DevTools/DevTools.server.d.ts +0 -1
- package/dist/esnext/foundation/DevTools/DevTools.server.js +0 -15
- package/dist/esnext/foundation/DevTools/components/GraphQL.client.d.ts +0 -1
- package/dist/esnext/foundation/DevTools/components/GraphQL.client.js +0 -25
- package/dist/esnext/foundation/DevTools/components/Heading.d.ts +0 -5
- package/dist/esnext/foundation/DevTools/components/Heading.js +0 -12
- package/dist/esnext/foundation/DevTools/components/Interface.client.d.ts +0 -11
- package/dist/esnext/foundation/DevTools/components/Interface.client.js +0 -47
- package/dist/esnext/foundation/DevTools/components/Panels.d.ts +0 -8
- package/dist/esnext/foundation/DevTools/components/Panels.js +0 -66
- package/dist/esnext/foundation/DevTools/components/Performance.client.d.ts +0 -14
- package/dist/esnext/foundation/DevTools/components/Performance.client.js +0 -25
- package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +0 -8
- package/dist/esnext/foundation/DevTools/components/Settings.client.js +0 -17
- package/dist/esnext/foundation/DevTools/components/Table.d.ts +0 -9
- package/dist/esnext/foundation/DevTools/components/Table.js +0 -7
- package/dist/esnext/foundation/DevTools/components/icons.d.ts +0 -2
- package/dist/esnext/foundation/DevTools/components/icons.js +0 -13
- package/dist/esnext/foundation/DevTools/components/index.d.ts +0 -2
- package/dist/esnext/foundation/DevTools/components/index.js +0 -2
- package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +0 -22
- package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +0 -69
- package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +0 -6
- package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +0 -149
- package/dist/esnext/foundation/Form/Form.client.d.ts +0 -14
- package/dist/esnext/foundation/Form/Form.client.js +0 -51
- package/dist/esnext/foundation/Head/Head.client.d.ts +0 -5
- package/dist/esnext/foundation/Head/Head.client.js +0 -10
- package/dist/esnext/foundation/Head/index.d.ts +0 -1
- package/dist/esnext/foundation/Head/index.js +0 -1
- package/dist/esnext/foundation/Html/Html.d.ts +0 -13
- package/dist/esnext/foundation/Html/Html.js +0 -96
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +0 -78
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +0 -206
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +0 -23
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +0 -49
- package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +0 -5
- package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +0 -53
- package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +0 -5
- package/dist/esnext/foundation/Redirect/Redirect.client.js +0 -15
- package/dist/esnext/foundation/Route/Route.server.d.ts +0 -14
- package/dist/esnext/foundation/Route/Route.server.js +0 -28
- package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +0 -14
- package/dist/esnext/foundation/Router/BrowserRouter.client.js +0 -144
- package/dist/esnext/foundation/Router/Router.server.d.ts +0 -10
- package/dist/esnext/foundation/Router/Router.server.js +0 -8
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +0 -43
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +0 -65
- package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +0 -1
- package/dist/esnext/foundation/ServerPropsProvider/index.js +0 -1
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +0 -23
- package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +0 -125
- package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +0 -1
- package/dist/esnext/foundation/ServerRequestProvider/index.js +0 -1
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +0 -30
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +0 -59
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +0 -9
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +0 -10
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +0 -19
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +0 -94
- package/dist/esnext/foundation/ShopifyProvider/index.d.ts +0 -1
- package/dist/esnext/foundation/ShopifyProvider/index.js +0 -1
- package/dist/esnext/foundation/ShopifyProvider/types.d.ts +0 -35
- package/dist/esnext/foundation/ShopifyProvider/types.js +0 -1
- package/dist/esnext/foundation/constants.d.ts +0 -2
- package/dist/esnext/foundation/constants.js +0 -4
- package/dist/esnext/foundation/fetchSync/ResponseSync.d.ts +0 -15
- package/dist/esnext/foundation/fetchSync/ResponseSync.js +0 -50
- package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +0 -10
- package/dist/esnext/foundation/fetchSync/client/fetchSync.js +0 -23
- package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +0 -8
- package/dist/esnext/foundation/fetchSync/server/fetchSync.js +0 -39
- package/dist/esnext/foundation/index.d.ts +0 -3
- package/dist/esnext/foundation/index.js +0 -3
- package/dist/esnext/foundation/runtime.d.ts +0 -2
- package/dist/esnext/foundation/runtime.js +0 -6
- package/dist/esnext/foundation/session/session-types.d.ts +0 -15
- package/dist/esnext/foundation/session/session-types.js +0 -1
- package/dist/esnext/foundation/session/session.d.ts +0 -18
- package/dist/esnext/foundation/session/session.js +0 -53
- package/dist/esnext/foundation/ssr-interop.d.ts +0 -29
- package/dist/esnext/foundation/ssr-interop.js +0 -35
- package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +0 -17
- package/dist/esnext/foundation/useNavigate/useNavigate.js +0 -39
- package/dist/esnext/foundation/useQuery/hooks.d.ts +0 -41
- package/dist/esnext/foundation/useQuery/hooks.js +0 -105
- package/dist/esnext/foundation/useQuery/index.d.ts +0 -1
- package/dist/esnext/foundation/useQuery/index.js +0 -1
- package/dist/esnext/foundation/useRequestContext/index.d.ts +0 -15
- package/dist/esnext/foundation/useRequestContext/index.js +0 -23
- package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +0 -13
- package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +0 -12
- package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +0 -4
- package/dist/esnext/foundation/useRouteParams/useRouteParams.js +0 -9
- package/dist/esnext/foundation/useServerProps/index.d.ts +0 -1
- package/dist/esnext/foundation/useServerProps/index.js +0 -1
- package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +0 -21
- package/dist/esnext/foundation/useServerProps/use-server-props.js +0 -35
- package/dist/esnext/foundation/useSession/useSession.d.ts +0 -3
- package/dist/esnext/foundation/useSession/useSession.js +0 -20
- package/dist/esnext/foundation/useShop/index.d.ts +0 -1
- package/dist/esnext/foundation/useShop/index.js +0 -1
- package/dist/esnext/foundation/useShop/use-shop.d.ts +0 -6
- package/dist/esnext/foundation/useShop/use-shop.js +0 -14
- package/dist/esnext/foundation/useUrl/index.d.ts +0 -1
- package/dist/esnext/foundation/useUrl/index.js +0 -1
- package/dist/esnext/foundation/useUrl/useUrl.d.ts +0 -4
- package/dist/esnext/foundation/useUrl/useUrl.js +0 -29
- package/dist/esnext/framework/cache/in-memory.d.ts +0 -17
- package/dist/esnext/framework/cache/in-memory.js +0 -80
- package/dist/esnext/framework/graphiql.d.ts +0 -1
- package/dist/esnext/framework/graphiql.js +0 -34
- package/dist/esnext/framework/load-config.d.ts +0 -5
- package/dist/esnext/framework/load-config.js +0 -7
- package/dist/esnext/framework/middleware.d.ts +0 -21
- package/dist/esnext/framework/middleware.js +0 -97
- package/dist/esnext/framework/plugin.d.ts +0 -8
- package/dist/esnext/framework/plugin.js +0 -35
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.js +0 -12
- package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +0 -28
- package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +0 -101
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.js +0 -213
- package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +0 -41
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.js +0 -36
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +0 -4
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +0 -113
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +0 -11
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +0 -60
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +0 -2
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +0 -23
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +0 -24
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +0 -7
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +0 -149
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +0 -112
- package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.d.ts +0 -3
- package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +0 -20
- package/dist/esnext/framework/types.d.ts +0 -20
- package/dist/esnext/framework/types.js +0 -1
- package/dist/esnext/framework/viteception.d.ts +0 -5
- package/dist/esnext/framework/viteception.js +0 -22
- package/dist/esnext/hooks/index.d.ts +0 -6
- package/dist/esnext/hooks/index.js +0 -6
- package/dist/esnext/hooks/useCart/index.d.ts +0 -1
- package/dist/esnext/hooks/useCart/index.js +0 -1
- package/dist/esnext/hooks/useCart/useCart.d.ts +0 -4
- package/dist/esnext/hooks/useCart/useCart.js +0 -12
- package/dist/esnext/hooks/useCartLine/index.d.ts +0 -1
- package/dist/esnext/hooks/useCartLine/index.js +0 -1
- package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +0 -39
- package/dist/esnext/hooks/useCartLine/useCartLine.js +0 -12
- package/dist/esnext/hooks/useDelay/useDelay.d.ts +0 -1
- package/dist/esnext/hooks/useDelay/useDelay.js +0 -17
- package/dist/esnext/hooks/useLoadScript/index.d.ts +0 -1
- package/dist/esnext/hooks/useLoadScript/index.js +0 -1
- package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +0 -8
- package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +0 -23
- package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +0 -4
- package/dist/esnext/hooks/useLocalization/useLocalization.js +0 -9
- package/dist/esnext/hooks/useMeasurement/hooks.d.ts +0 -9
- package/dist/esnext/hooks/useMeasurement/hooks.js +0 -13
- package/dist/esnext/hooks/useMeasurement/index.d.ts +0 -1
- package/dist/esnext/hooks/useMeasurement/index.js +0 -1
- package/dist/esnext/hooks/useMoney/hooks.d.ts +0 -54
- package/dist/esnext/hooks/useMoney/hooks.js +0 -80
- package/dist/esnext/hooks/useMoney/index.d.ts +0 -1
- package/dist/esnext/hooks/useMoney/index.js +0 -1
- package/dist/esnext/hooks/useProductOptions/helpers.d.ts +0 -6
- package/dist/esnext/hooks/useProductOptions/helpers.js +0 -36
- package/dist/esnext/hooks/useProductOptions/index.d.ts +0 -2
- package/dist/esnext/hooks/useProductOptions/index.js +0 -2
- package/dist/esnext/hooks/useProductOptions/types.d.ts +0 -44
- package/dist/esnext/hooks/useProductOptions/types.js +0 -1
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +0 -1
- package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +0 -9
- package/dist/esnext/hooks/useShopQuery/hooks.d.ts +0 -28
- package/dist/esnext/hooks/useShopQuery/hooks.js +0 -176
- package/dist/esnext/hooks/useShopQuery/index.d.ts +0 -1
- package/dist/esnext/hooks/useShopQuery/index.js +0 -1
- package/dist/esnext/index.d.ts +0 -45
- package/dist/esnext/index.js +0 -41
- package/dist/esnext/node.d.ts +0 -1
- package/dist/esnext/node.js +0 -1
- package/dist/esnext/platforms/index.d.ts +0 -1
- package/dist/esnext/platforms/index.js +0 -1
- package/dist/esnext/platforms/node.d.ts +0 -9
- package/dist/esnext/platforms/node.js +0 -35
- package/dist/esnext/platforms/virtual.d.ts +0 -8
- package/dist/esnext/platforms/virtual.js +0 -12
- package/dist/esnext/platforms/worker-event.d.ts +0 -1
- package/dist/esnext/platforms/worker-event.js +0 -3
- package/dist/esnext/platforms/worker.d.ts +0 -14
- package/dist/esnext/platforms/worker.js +0 -25
- package/dist/esnext/shared-types.d.ts +0 -31
- package/dist/esnext/shared-types.js +0 -4
- package/dist/esnext/storefront-api-types.d.ts +0 -6326
- package/dist/esnext/storefront-api-types.js +0 -1775
- package/dist/esnext/streaming.server.d.ts +0 -16
- package/dist/esnext/streaming.server.js +0 -24
- package/dist/esnext/testing.d.ts +0 -2
- package/dist/esnext/testing.js +0 -2
- package/dist/esnext/types.d.ts +0 -117
- package/dist/esnext/types.js +0 -1
- package/dist/esnext/utilities/apiRoutes.d.ts +0 -44
- package/dist/esnext/utilities/apiRoutes.js +0 -200
- package/dist/esnext/utilities/bot-ua.d.ts +0 -4
- package/dist/esnext/utilities/bot-ua.js +0 -65
- package/dist/esnext/utilities/defer.d.ts +0 -6
- package/dist/esnext/utilities/defer.js +0 -14
- package/dist/esnext/utilities/devtools.d.ts +0 -11
- package/dist/esnext/utilities/devtools.js +0 -11
- package/dist/esnext/utilities/empty-hydrogen-config.d.ts +0 -2
- package/dist/esnext/utilities/empty-hydrogen-config.js +0 -2
- package/dist/esnext/utilities/error.d.ts +0 -1
- package/dist/esnext/utilities/error.js +0 -6
- package/dist/esnext/utilities/fetch.d.ts +0 -9
- package/dist/esnext/utilities/fetch.js +0 -34
- package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +0 -7
- package/dist/esnext/utilities/flattenConnection/flattenConnection.js +0 -18
- package/dist/esnext/utilities/flattenConnection/index.d.ts +0 -1
- package/dist/esnext/utilities/flattenConnection/index.js +0 -1
- package/dist/esnext/utilities/graphql-tag.d.ts +0 -1
- package/dist/esnext/utilities/graphql-tag.js +0 -6
- package/dist/esnext/utilities/graphql-tracker.d.ts +0 -17
- package/dist/esnext/utilities/graphql-tracker.js +0 -121
- package/dist/esnext/utilities/hash.d.ts +0 -2
- package/dist/esnext/utilities/hash.js +0 -26
- package/dist/esnext/utilities/html-encoding.d.ts +0 -1
- package/dist/esnext/utilities/html-encoding.js +0 -8
- package/dist/esnext/utilities/image_size.d.ts +0 -34
- package/dist/esnext/utilities/image_size.js +0 -96
- package/dist/esnext/utilities/index.d.ts +0 -12
- package/dist/esnext/utilities/index.js +0 -12
- package/dist/esnext/utilities/isBrowser/index.d.ts +0 -1
- package/dist/esnext/utilities/isBrowser/index.js +0 -1
- package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +0 -4
- package/dist/esnext/utilities/isBrowser/isBrowser.js +0 -6
- package/dist/esnext/utilities/isServer/index.d.ts +0 -1
- package/dist/esnext/utilities/isServer/index.js +0 -1
- package/dist/esnext/utilities/isServer/isServer.d.ts +0 -4
- package/dist/esnext/utilities/isServer/isServer.js +0 -7
- package/dist/esnext/utilities/load_script.d.ts +0 -4
- package/dist/esnext/utilities/load_script.js +0 -28
- package/dist/esnext/utilities/locale/index.d.ts +0 -1
- package/dist/esnext/utilities/locale/index.js +0 -1
- package/dist/esnext/utilities/locale/locale.d.ts +0 -7
- package/dist/esnext/utilities/locale/locale.js +0 -22
- package/dist/esnext/utilities/log/index.d.ts +0 -4
- package/dist/esnext/utilities/log/index.js +0 -4
- package/dist/esnext/utilities/log/log-cache-api-status.d.ts +0 -1
- package/dist/esnext/utilities/log/log-cache-api-status.js +0 -17
- package/dist/esnext/utilities/log/log-cache-header.d.ts +0 -10
- package/dist/esnext/utilities/log/log-cache-header.js +0 -30
- package/dist/esnext/utilities/log/log-query-timeline.d.ts +0 -12
- package/dist/esnext/utilities/log/log-query-timeline.js +0 -105
- package/dist/esnext/utilities/log/log.d.ts +0 -28
- package/dist/esnext/utilities/log/log.js +0 -89
- package/dist/esnext/utilities/log/utils.d.ts +0 -3
- package/dist/esnext/utilities/log/utils.js +0 -11
- package/dist/esnext/utilities/matchPath.d.ts +0 -10
- package/dist/esnext/utilities/matchPath.js +0 -54
- package/dist/esnext/utilities/measurement.d.ts +0 -3
- package/dist/esnext/utilities/measurement.js +0 -98
- package/dist/esnext/utilities/object.d.ts +0 -5
- package/dist/esnext/utilities/object.js +0 -7
- package/dist/esnext/utilities/parse.d.ts +0 -2
- package/dist/esnext/utilities/parse.js +0 -28
- package/dist/esnext/utilities/parseMetafield/index.d.ts +0 -1
- package/dist/esnext/utilities/parseMetafield/index.js +0 -1
- package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +0 -15
- package/dist/esnext/utilities/parseMetafield/parseMetafield.js +0 -62
- package/dist/esnext/utilities/random.d.ts +0 -1
- package/dist/esnext/utilities/random.js +0 -11
- package/dist/esnext/utilities/storefrontApi.d.ts +0 -8
- package/dist/esnext/utilities/storefrontApi.js +0 -63
- package/dist/esnext/utilities/suspense.d.ts +0 -12
- package/dist/esnext/utilities/suspense.js +0 -58
- package/dist/esnext/utilities/template.d.ts +0 -10
- package/dist/esnext/utilities/template.js +0 -60
- package/dist/esnext/utilities/tests/MockedServerRequestProvider.server.d.ts +0 -6
- package/dist/esnext/utilities/tests/MockedServerRequestProvider.server.js +0 -9
- package/dist/esnext/utilities/tests/price.d.ts +0 -5
- package/dist/esnext/utilities/tests/price.js +0 -8
- package/dist/esnext/utilities/tests/provider-helpers.d.ts +0 -31
- package/dist/esnext/utilities/tests/provider-helpers.js +0 -36
- package/dist/esnext/utilities/timing.d.ts +0 -7
- package/dist/esnext/utilities/timing.js +0 -14
- package/dist/esnext/utilities/video_parameters.d.ts +0 -47
- package/dist/esnext/utilities/video_parameters.js +0 -22
- package/dist/esnext/utilities/vite.d.ts +0 -1
- package/dist/esnext/utilities/vite.js +0 -4
- package/dist/esnext/utilities/web-api-polyfill.d.ts +0 -1
- package/dist/esnext/utilities/web-api-polyfill.js +0 -25
- package/dist/esnext/version.d.ts +0 -1
- package/dist/esnext/version.js +0 -1
- package/dist/node/foundation/session/session-types.d.ts +0 -15
- package/dist/node/foundation/session/session-types.js +0 -2
- package/dist/node/framework/cache/in-memory.d.ts +0 -17
- package/dist/node/framework/cache/in-memory.js +0 -84
- package/dist/node/framework/graphiql.d.ts +0 -1
- package/dist/node/framework/graphiql.js +0 -38
- package/dist/node/framework/load-config.d.ts +0 -5
- package/dist/node/framework/load-config.js +0 -11
- package/dist/node/framework/middleware.d.ts +0 -21
- package/dist/node/framework/middleware.js +0 -124
- package/dist/node/framework/plugin.d.ts +0 -5
- package/dist/node/framework/plugin.js +0 -40
- package/dist/node/framework/plugins/vite-plugin-assets-version.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-assets-version.js +0 -15
- package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-client-imports.js +0 -31
- package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +0 -107
- package/dist/node/framework/plugins/vite-plugin-css-rsc.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-css-rsc.js +0 -219
- package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +0 -46
- package/dist/node/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-hydrogen-client-components-cache.js +0 -38
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +0 -4
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +0 -118
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +0 -11
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +0 -66
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +0 -2
- package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +0 -29
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +0 -26
- package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +0 -7
- package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +0 -155
- package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-platform-entry.js +0 -117
- package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +0 -3
- package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +0 -22
- package/dist/node/framework/types.d.ts +0 -20
- package/dist/node/framework/types.js +0 -2
- package/dist/node/framework/viteception.d.ts +0 -5
- package/dist/node/framework/viteception.js +0 -26
- package/dist/node/shared-types.d.ts +0 -31
- package/dist/node/shared-types.js +0 -5
- package/dist/node/utilities/vite.d.ts +0 -1
- package/dist/node/utilities/vite.js +0 -30
- package/dist/node/utilities/web-api-polyfill.d.ts +0 -1
- package/dist/node/utilities/web-api-polyfill.js +0 -53
- package/vendor/react-server-dom-vite/LICENSE +0 -21
- package/vendor/react-server-dom-vite/README.md +0 -5
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +0 -632
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +0 -1884
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +0 -48
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +0 -1945
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +0 -49
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +0 -629
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +0 -19
- package/vendor/react-server-dom-vite/esm/package.json +0 -3
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +0 -83
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +0 -628
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +0 -1876
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +0 -1937
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +0 -619
- package/vendor/react-server-dom-vite/index.js +0 -7
- package/vendor/react-server-dom-vite/package.json +0 -67
- package/vendor/react-server-dom-vite/plugin.js +0 -3
- package/vendor/react-server-dom-vite/writer.browser.server.js +0 -7
- package/vendor/react-server-dom-vite/writer.node.server.js +0 -7
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import type { HydrogenVitePluginOptions } from '../types.js';
|
|
3
|
-
export declare const HYDROGEN_DEFAULT_SERVER_ENTRY: string;
|
|
4
|
-
declare const _default: (pluginOptions: HydrogenVitePluginOptions) => Plugin;
|
|
5
|
-
export default _default;
|
|
6
|
-
declare global {
|
|
7
|
-
var Oxygen: {
|
|
8
|
-
env: any;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HYDROGEN_DEFAULT_SERVER_ENTRY = void 0;
|
|
7
|
-
const vite_1 = require("vite");
|
|
8
|
-
const body_parser_1 = __importDefault(require("body-parser"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const fs_1 = require("fs");
|
|
11
|
-
const middleware_js_1 = require("../middleware.js");
|
|
12
|
-
const in_memory_js_1 = require("../cache/in-memory.js");
|
|
13
|
-
const vite_plugin_hydrogen_virtual_files_js_1 = require("./vite-plugin-hydrogen-virtual-files.js");
|
|
14
|
-
exports.HYDROGEN_DEFAULT_SERVER_ENTRY = process.env.HYDROGEN_SERVER_ENTRY || '/src/App.server';
|
|
15
|
-
/* -- Plugin notes:
|
|
16
|
-
* By adding a middleware to the Vite dev server, we can handle SSR without needing
|
|
17
|
-
* a custom node script. It works by handling any requests for `text/html` documents,
|
|
18
|
-
* loading them in an SSR context, rendering them using the `entry-server` endpoint in the
|
|
19
|
-
* user's project, and injecting the static HTML into the template.
|
|
20
|
-
*/
|
|
21
|
-
exports.default = (pluginOptions) => {
|
|
22
|
-
return {
|
|
23
|
-
name: 'hydrogen:middleware',
|
|
24
|
-
async configureServer(server) {
|
|
25
|
-
const resolve = (p) => path_1.default.resolve(server.config.root, p);
|
|
26
|
-
async function getIndexTemplate(url) {
|
|
27
|
-
const indexHtml = await fs_1.promises.readFile(resolve('index.html'), 'utf-8');
|
|
28
|
-
return await server.transformIndexHtml(url, indexHtml);
|
|
29
|
-
}
|
|
30
|
-
await polyfillOxygenEnv(server.config);
|
|
31
|
-
// The default vite middleware rewrites the URL `/graphqil` to `/index.html`
|
|
32
|
-
// By running this middleware first, we avoid that.
|
|
33
|
-
server.middlewares.use((0, middleware_js_1.graphiqlMiddleware)({
|
|
34
|
-
dev: true,
|
|
35
|
-
getShopifyConfig: async (incomingMessage) => {
|
|
36
|
-
const { default: hydrogenConfig } = await server.ssrLoadModule(vite_plugin_hydrogen_virtual_files_js_1.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID);
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
const { address = 'localhost', port = '3000' } = server.httpServer?.address() || {};
|
|
39
|
-
const url = new URL(`http://${address}:${port}${incomingMessage.url}`);
|
|
40
|
-
const request = new Request(url.toString(), {
|
|
41
|
-
headers: incomingMessage.headers,
|
|
42
|
-
});
|
|
43
|
-
// @ts-expect-error Manually set `normalizedUrl` which a developer expects to be available
|
|
44
|
-
// via `HydrogenRequest` during production runtime.
|
|
45
|
-
request.normalizedUrl = request.url;
|
|
46
|
-
const { shopify } = hydrogenConfig;
|
|
47
|
-
return typeof shopify === 'function' ? shopify(request) : shopify;
|
|
48
|
-
},
|
|
49
|
-
}));
|
|
50
|
-
server.middlewares.use(body_parser_1.default.raw({ type: '*/*' }));
|
|
51
|
-
return () => server.middlewares.use((0, middleware_js_1.hydrogenMiddleware)({
|
|
52
|
-
dev: true,
|
|
53
|
-
indexTemplate: getIndexTemplate,
|
|
54
|
-
getServerEntrypoint: () => server.ssrLoadModule(exports.HYDROGEN_DEFAULT_SERVER_ENTRY),
|
|
55
|
-
devServer: server,
|
|
56
|
-
cache: pluginOptions?.devCache
|
|
57
|
-
? new in_memory_js_1.InMemoryCache()
|
|
58
|
-
: undefined,
|
|
59
|
-
}));
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
async function polyfillOxygenEnv(config) {
|
|
64
|
-
const env = await (0, vite_1.loadEnv)(config.mode, config.root, '');
|
|
65
|
-
globalThis.Oxygen = { env };
|
|
66
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
const plugin_js_1 = __importDefault(require("@shopify/hydrogen/vendor/react-server-dom-vite/plugin.js"));
|
|
8
|
-
const vite_plugin_hydrogen_middleware_js_1 = require("./vite-plugin-hydrogen-middleware.js");
|
|
9
|
-
const vite_plugin_hydrogen_virtual_files_js_1 = require("./vite-plugin-hydrogen-virtual-files.js");
|
|
10
|
-
function default_1(options) {
|
|
11
|
-
return (0, plugin_js_1.default)({
|
|
12
|
-
serverBuildEntries: [
|
|
13
|
-
vite_plugin_hydrogen_middleware_js_1.HYDROGEN_DEFAULT_SERVER_ENTRY,
|
|
14
|
-
vite_plugin_hydrogen_virtual_files_js_1.VIRTUAL_PROXY_HYDROGEN_ROUTES_ID,
|
|
15
|
-
],
|
|
16
|
-
isServerComponentImporterAllowed(importer, source) {
|
|
17
|
-
return (
|
|
18
|
-
// Always allow the entry server (e.g. App.server.jsx) to be imported
|
|
19
|
-
// in other files such as worker.js or server.js.
|
|
20
|
-
source.includes(vite_plugin_hydrogen_middleware_js_1.HYDROGEN_DEFAULT_SERVER_ENTRY) ||
|
|
21
|
-
/(index|provider-helpers|entry-server|testing|hydrogen\.config)\.[jt]s/.test(importer) ||
|
|
22
|
-
// Support importing server components for testing
|
|
23
|
-
// TODO: revisit this when RSC splits into two bundles
|
|
24
|
-
/\.(test|vitest|spec)\.[tj]sx?$/.test(importer));
|
|
25
|
-
},
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.default = default_1;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* -- Plugin notes:
|
|
4
|
-
* Vite prints some warnings automatically are not important and
|
|
5
|
-
* not actionable. We hide them here to prevent confusing devs when
|
|
6
|
-
* real warnings or errors appear.
|
|
7
|
-
*/
|
|
8
|
-
exports.default = () => {
|
|
9
|
-
return {
|
|
10
|
-
name: 'hydrogen:suppress-warnings',
|
|
11
|
-
configResolved(config) {
|
|
12
|
-
// TODO: Fix the actual issues that cause these warnings
|
|
13
|
-
const filterOut = (msg) => msg.startsWith("@shopify/hydrogen doesn't appear to be written in CJS") ||
|
|
14
|
-
(msg.includes('missing source files') &&
|
|
15
|
-
['kolorist'].some((lib) => msg.includes(lib)));
|
|
16
|
-
for (const method of ['warn', 'warnOnce']) {
|
|
17
|
-
const original = config.logger[method];
|
|
18
|
-
config.logger[method] = (msg, ...args) => {
|
|
19
|
-
if (filterOut(msg))
|
|
20
|
-
return;
|
|
21
|
-
return original(msg, ...args);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import type { HydrogenVitePluginOptions } from '../types.js';
|
|
3
|
-
export declare const HYDROGEN_DEFAULT_SERVER_ENTRY: string;
|
|
4
|
-
export declare const VIRTUAL_PROXY_HYDROGEN_CONFIG_ID: string;
|
|
5
|
-
export declare const VIRTUAL_PROXY_HYDROGEN_ROUTES_ID: string;
|
|
6
|
-
declare const _default: (pluginOptions: HydrogenVitePluginOptions) => Plugin;
|
|
7
|
-
export default _default;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VIRTUAL_PROXY_HYDROGEN_ROUTES_ID = exports.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID = exports.HYDROGEN_DEFAULT_SERVER_ENTRY = void 0;
|
|
7
|
-
const vite_1 = require("vite");
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const fs_1 = require("fs");
|
|
10
|
-
const viteception_js_1 = require("../viteception.js");
|
|
11
|
-
const magic_string_1 = __importDefault(require("magic-string"));
|
|
12
|
-
const vite_js_1 = require("../../utilities/vite.js");
|
|
13
|
-
/* -- Plugin notes:
|
|
14
|
-
* The Hydrogen framework needs to import certain files from the user app, such as
|
|
15
|
-
* routes and config. A priori, we can't import these files from the framework
|
|
16
|
-
* because we don't know the user path to write it in an `import * from '...'` statement.
|
|
17
|
-
* Instead, we import "virtual files" that are resolved by Vite in this plugin.
|
|
18
|
-
* These virtual files can include the user path and re-export the in-app files.
|
|
19
|
-
*/
|
|
20
|
-
exports.HYDROGEN_DEFAULT_SERVER_ENTRY = process.env.HYDROGEN_SERVER_ENTRY || '/src/App.server';
|
|
21
|
-
// The character ":" breaks Vite with Node >= 16.15. Use "_" instead
|
|
22
|
-
const VIRTUAL_PREFIX = 'virtual__';
|
|
23
|
-
const PROXY_PREFIX = 'proxy__';
|
|
24
|
-
const ERROR_FILE = 'error.jsx';
|
|
25
|
-
const VIRTUAL_ERROR_FILE = VIRTUAL_PREFIX + ERROR_FILE;
|
|
26
|
-
const HYDROGEN_CONFIG_ID = 'hydrogen.config.ts';
|
|
27
|
-
const VIRTUAL_HYDROGEN_CONFIG_ID = VIRTUAL_PREFIX + HYDROGEN_CONFIG_ID;
|
|
28
|
-
exports.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID = VIRTUAL_PREFIX + PROXY_PREFIX + HYDROGEN_CONFIG_ID;
|
|
29
|
-
const HYDROGEN_ROUTES_ID = 'hydrogen-routes.server.jsx';
|
|
30
|
-
const VIRTUAL_HYDROGEN_ROUTES_ID = VIRTUAL_PREFIX + HYDROGEN_ROUTES_ID;
|
|
31
|
-
exports.VIRTUAL_PROXY_HYDROGEN_ROUTES_ID = VIRTUAL_PREFIX + PROXY_PREFIX + HYDROGEN_ROUTES_ID;
|
|
32
|
-
const VIRTUAL_STREAM_ID = 'virtual__stream';
|
|
33
|
-
exports.default = (pluginOptions) => {
|
|
34
|
-
let config;
|
|
35
|
-
let server;
|
|
36
|
-
let resolvedConfigPath;
|
|
37
|
-
return {
|
|
38
|
-
name: 'hydrogen:virtual-files',
|
|
39
|
-
configResolved(_config) {
|
|
40
|
-
config = _config;
|
|
41
|
-
},
|
|
42
|
-
configureServer(_server) {
|
|
43
|
-
server = _server;
|
|
44
|
-
},
|
|
45
|
-
resolveId(source, importer) {
|
|
46
|
-
if (source === VIRTUAL_HYDROGEN_CONFIG_ID) {
|
|
47
|
-
return findHydrogenConfigPath(config.root, pluginOptions.configPath).then((hcPath) => {
|
|
48
|
-
resolvedConfigPath = (0, vite_1.normalizePath)(hcPath);
|
|
49
|
-
// This direct dependency on a real file
|
|
50
|
-
// makes HMR work for the virtual module.
|
|
51
|
-
return this.resolve(hcPath, importer, { skipSelf: true });
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if ([
|
|
55
|
-
exports.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID,
|
|
56
|
-
exports.VIRTUAL_PROXY_HYDROGEN_ROUTES_ID,
|
|
57
|
-
VIRTUAL_HYDROGEN_ROUTES_ID,
|
|
58
|
-
VIRTUAL_ERROR_FILE,
|
|
59
|
-
VIRTUAL_STREAM_ID,
|
|
60
|
-
].includes(source)) {
|
|
61
|
-
// Virtual modules convention
|
|
62
|
-
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
63
|
-
return '\0' + source;
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
load(id) {
|
|
67
|
-
if (id === '\0' + VIRTUAL_STREAM_ID) {
|
|
68
|
-
return {
|
|
69
|
-
code: process.env.WORKER
|
|
70
|
-
? `export default {};`
|
|
71
|
-
: `export {default} from 'stream';`,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Likely due to a bug in Vite, but virtual modules cannot be loaded
|
|
75
|
-
// directly using ssrLoadModule from a Vite plugin. It needs to be proxied as follows:
|
|
76
|
-
if (id === '\0' + exports.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID) {
|
|
77
|
-
return `import hc from '${VIRTUAL_HYDROGEN_CONFIG_ID}'; export default typeof hc === 'function' ? hc() : hc;`;
|
|
78
|
-
}
|
|
79
|
-
if (id === '\0' + exports.VIRTUAL_PROXY_HYDROGEN_ROUTES_ID) {
|
|
80
|
-
return `import hr from '${VIRTUAL_HYDROGEN_ROUTES_ID}'; export default hr;`;
|
|
81
|
-
}
|
|
82
|
-
if (id === '\0' + VIRTUAL_HYDROGEN_ROUTES_ID) {
|
|
83
|
-
return importHydrogenConfig().then((hc) => {
|
|
84
|
-
let routesPath = (typeof hc.routes === 'string' ? hc.routes : hc.routes?.files) ??
|
|
85
|
-
'/src/routes';
|
|
86
|
-
if (routesPath.startsWith('./')) {
|
|
87
|
-
routesPath = routesPath.slice(1);
|
|
88
|
-
}
|
|
89
|
-
if (!routesPath.includes('*')) {
|
|
90
|
-
if (!routesPath.endsWith('/')) {
|
|
91
|
-
routesPath += '/';
|
|
92
|
-
}
|
|
93
|
-
routesPath += '**/*.server.[jt](s|sx)';
|
|
94
|
-
}
|
|
95
|
-
const [dirPrefix] = routesPath.split('/*');
|
|
96
|
-
const importGlob = vite_js_1.isVite3
|
|
97
|
-
? `import.meta.glob('${routesPath}', {eager: true})`
|
|
98
|
-
: `import.meta.globEager('${routesPath}')`;
|
|
99
|
-
let code = `export default {\n dirPrefix: '${dirPrefix}',\n basePath: '${hc.routes?.basePath ?? ''}',\n files: ${importGlob}\n};`;
|
|
100
|
-
if (config.command === 'serve') {
|
|
101
|
-
// Add dependency on Hydrogen config for HMR
|
|
102
|
-
code += `\nimport '${VIRTUAL_HYDROGEN_CONFIG_ID}';`;
|
|
103
|
-
}
|
|
104
|
-
return { code };
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (id === '\0' + VIRTUAL_ERROR_FILE) {
|
|
108
|
-
return importHydrogenConfig().then((hc) => {
|
|
109
|
-
const errorPath = hc.serverErrorPage ?? '/src/Error.{jsx,tsx}';
|
|
110
|
-
const code = `const errorPage = import.meta.glob("${errorPath}");\n export default Object.values(errorPage)[0];`;
|
|
111
|
-
return { code };
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
transform(code, id) {
|
|
116
|
-
if (id === resolvedConfigPath) {
|
|
117
|
-
const s = new magic_string_1.default(code);
|
|
118
|
-
// Wrap in function to avoid evaluating `Oxygen.env`
|
|
119
|
-
// in the config until we have polyfilled it properly.
|
|
120
|
-
s.replace(/export\s+default\s+(\w+)\s*\(/g, (all, m1) => all.replace(m1, `() => ${m1}`));
|
|
121
|
-
return {
|
|
122
|
-
code: s.toString(),
|
|
123
|
-
map: s.generateMap({ file: id, source: id }),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
async function importHydrogenConfig() {
|
|
129
|
-
if (server) {
|
|
130
|
-
const loaded = await server.ssrLoadModule(exports.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID);
|
|
131
|
-
return loaded.default;
|
|
132
|
-
}
|
|
133
|
-
const { loaded } = await (0, viteception_js_1.viteception)([exports.VIRTUAL_PROXY_HYDROGEN_CONFIG_ID], {
|
|
134
|
-
root: config.root,
|
|
135
|
-
});
|
|
136
|
-
return loaded[0].default;
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
async function findHydrogenConfigPath(root, userProvidedPath) {
|
|
140
|
-
let configPath = userProvidedPath;
|
|
141
|
-
if (!configPath) {
|
|
142
|
-
// Find the config file in the project root
|
|
143
|
-
const files = await fs_1.promises.readdir(root);
|
|
144
|
-
configPath = files.find((file) => /^hydrogen\.config\.[jt]s$/.test(file));
|
|
145
|
-
}
|
|
146
|
-
if (configPath) {
|
|
147
|
-
configPath = (0, vite_1.normalizePath)(configPath);
|
|
148
|
-
if (!configPath.startsWith('/'))
|
|
149
|
-
configPath = path_1.default.resolve(root, configPath);
|
|
150
|
-
}
|
|
151
|
-
return (configPath ||
|
|
152
|
-
require.resolve(
|
|
153
|
-
// eslint-disable-next-line node/no-missing-require
|
|
154
|
-
'@shopify/hydrogen/utilities/empty-hydrogen-config'));
|
|
155
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const vite_1 = require("vite");
|
|
7
|
-
const vite_plugin_hydrogen_middleware_js_1 = require("./vite-plugin-hydrogen-middleware.js");
|
|
8
|
-
const magic_string_1 = __importDefault(require("magic-string"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const fs_1 = __importDefault(require("fs"));
|
|
11
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
12
|
-
const vite_js_1 = require("../../utilities/vite.js");
|
|
13
|
-
const SSR_BUNDLE_NAME = 'index.js';
|
|
14
|
-
// Keep this in the outer scope to share it
|
|
15
|
-
// across client <> server builds.
|
|
16
|
-
let clientBuildPath;
|
|
17
|
-
/* -- Plugin notes:
|
|
18
|
-
* This plugin simplifies the way a platform entry file imports user files. This is
|
|
19
|
-
* needed to write generic integrations with different platform providers.
|
|
20
|
-
*
|
|
21
|
-
* Instead of using relative paths:
|
|
22
|
-
* `import handleRequest from '../../<arbitrary_path>/src/App.server';`
|
|
23
|
-
* `import indexTemplate from '../../<arbitrary_path>/dist/client/index.html?raw';`
|
|
24
|
-
*
|
|
25
|
-
* It allows importing from a known static path which dynamically resolves the user files:
|
|
26
|
-
* `import {handleRequest, indexTemplate} from '@shopify/hydrogen/platforms';`
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
exports.default = () => {
|
|
30
|
-
let config;
|
|
31
|
-
let isESM;
|
|
32
|
-
return {
|
|
33
|
-
name: 'hydrogen:platform-entry',
|
|
34
|
-
enforce: 'pre',
|
|
35
|
-
configResolved(_config) {
|
|
36
|
-
config = _config;
|
|
37
|
-
if (config.build.ssr) {
|
|
38
|
-
const { output = {} } = config.build.rollupOptions || {};
|
|
39
|
-
const { format = vite_js_1.isVite3 ? 'es' : '' } = (Array.isArray(output) ? output[0] : output) || {};
|
|
40
|
-
isESM = Boolean(process.env.WORKER) || ['es', 'esm'].includes(format);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
resolveId(source, importer) {
|
|
44
|
-
if ((0, vite_1.normalizePath)(source).includes('/hydrogen/platforms/')) {
|
|
45
|
-
const hydrogenPath = path_1.default.dirname(require.resolve('@shopify/hydrogen/package.json'));
|
|
46
|
-
const platformEntryName = source.split(path_1.default.sep).pop() || '';
|
|
47
|
-
const platformEntryPath = path_1.default.resolve(hydrogenPath, 'dist', 'esnext', 'platforms', platformEntryName);
|
|
48
|
-
return this.resolve(platformEntryPath, importer, {
|
|
49
|
-
skipSelf: true,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
},
|
|
54
|
-
async transform(code, id, options) {
|
|
55
|
-
if (config.command === 'build' &&
|
|
56
|
-
options?.ssr &&
|
|
57
|
-
/\/hydrogen\/.+platforms\/virtual\./.test((0, vite_1.normalizePath)(id))) {
|
|
58
|
-
const ms = new magic_string_1.default(code);
|
|
59
|
-
ms.replace('__HYDROGEN_ENTRY__', vite_plugin_hydrogen_middleware_js_1.HYDROGEN_DEFAULT_SERVER_ENTRY);
|
|
60
|
-
if (!clientBuildPath) {
|
|
61
|
-
// Default value
|
|
62
|
-
clientBuildPath = (0, vite_1.normalizePath)(path_1.default.resolve(config.root, config.build.outDir, '..', 'client'));
|
|
63
|
-
}
|
|
64
|
-
ms.replace('__HYDROGEN_HTML_TEMPLATE__', (0, vite_1.normalizePath)(path_1.default.resolve(clientBuildPath, 'index.html')));
|
|
65
|
-
ms.replace('__HYDROGEN_RELATIVE_CLIENT_BUILD__', (0, vite_1.normalizePath)(path_1.default.relative((0, vite_1.normalizePath)(path_1.default.resolve(config.root, config.build.outDir)), clientBuildPath)));
|
|
66
|
-
const files = clientBuildPath
|
|
67
|
-
? (await (0, fast_glob_1.default)('**/*', {
|
|
68
|
-
cwd: clientBuildPath,
|
|
69
|
-
ignore: ['**/index.html', `**/${config.build.assetsDir}/**`],
|
|
70
|
-
})).map((file) => '/' + file)
|
|
71
|
-
: [];
|
|
72
|
-
ms.replace("\\['__HYDROGEN_ASSETS__'\\]", JSON.stringify(files));
|
|
73
|
-
ms.replace('__HYDROGEN_ASSETS_DIR__', config.build.assetsDir);
|
|
74
|
-
ms.replace('__HYDROGEN_ASSETS_BASE_URL__', (process.env.HYDROGEN_ASSET_BASE_URL || '').replace(/\/$/, ''));
|
|
75
|
-
// Remove the poison pill
|
|
76
|
-
ms.replace('throw', '//');
|
|
77
|
-
return {
|
|
78
|
-
code: ms.toString(),
|
|
79
|
-
map: ms.generateMap({ file: id, source: id }),
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
buildEnd(err) {
|
|
84
|
-
if (!err && !config.build.ssr && config.command === 'build') {
|
|
85
|
-
// Save outDir from client build in the outer scope in order
|
|
86
|
-
// to read it during the server build. The CLI runs Vite in
|
|
87
|
-
// the same process so the scope is shared across builds.
|
|
88
|
-
clientBuildPath = (0, vite_1.normalizePath)(path_1.default.resolve(config.root, config.build.outDir));
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
generateBundle(options, bundle) {
|
|
92
|
-
if (config.build.ssr) {
|
|
93
|
-
const [key, value] = Object.entries(bundle).find(([, value]) => value.type === 'chunk' && value.isEntry);
|
|
94
|
-
delete bundle[key];
|
|
95
|
-
value.fileName = SSR_BUNDLE_NAME;
|
|
96
|
-
bundle[SSR_BUNDLE_NAME] = value;
|
|
97
|
-
// This ensures the file has a proper
|
|
98
|
-
// default export instead of exporting an
|
|
99
|
-
// object containing a 'default' property.
|
|
100
|
-
if (value.type === 'chunk' && !isESM) {
|
|
101
|
-
value.code += `\nmodule.exports = exports.default || exports;`;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
writeBundle(options) {
|
|
106
|
-
if (config.build.ssr && options.dir) {
|
|
107
|
-
const mainFile = `./${SSR_BUNDLE_NAME}`;
|
|
108
|
-
const packageJson = {
|
|
109
|
-
type: isESM ? 'module' : 'commonjs',
|
|
110
|
-
main: mainFile,
|
|
111
|
-
exports: { '.': mainFile, [mainFile]: mainFile },
|
|
112
|
-
};
|
|
113
|
-
fs_1.default.writeFileSync(path_1.default.join(options.dir, 'package.json'), JSON.stringify(packageJson, null, 2), 'utf-8');
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* -- Plugin notes:
|
|
4
|
-
* This plugin makes sure we don't leak server logic to the browser when importing
|
|
5
|
-
* the `useEnvContext` utility.
|
|
6
|
-
*/
|
|
7
|
-
exports.default = () => {
|
|
8
|
-
return {
|
|
9
|
-
name: 'hydrogen:ssr-interop',
|
|
10
|
-
enforce: 'pre',
|
|
11
|
-
transform(code, id, options = {}) {
|
|
12
|
-
if (options.ssr && id.includes('foundation/ssr-interop')) {
|
|
13
|
-
return {
|
|
14
|
-
code: code
|
|
15
|
-
.replace(/(\s*META_ENV_SSR\s*=\s*)false/, '$1import.meta.env.SSR')
|
|
16
|
-
.replace(/\/\/@SSR\s*/g, ''),
|
|
17
|
-
map: { mappings: '' },
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface HydrogenVitePluginOptions {
|
|
2
|
-
devCache?: boolean;
|
|
3
|
-
purgeQueryCacheOnBuild?: boolean;
|
|
4
|
-
configPath?: string;
|
|
5
|
-
optimizeBoundaries?: boolean | 'build';
|
|
6
|
-
assetHashVersion?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Experimental features
|
|
9
|
-
*/
|
|
10
|
-
experimental?: {
|
|
11
|
-
/**
|
|
12
|
-
* CSS compatibility with React Server Components.
|
|
13
|
-
* - `global` inlines all the styles in the DOM and works for all types of CSS.
|
|
14
|
-
* - `modules-only` inlines the styles in RSC responses and only works for CSS Modules.
|
|
15
|
-
* @defaultValue `modules-only`
|
|
16
|
-
* @experimental
|
|
17
|
-
*/
|
|
18
|
-
css: 'global' | 'modules-only';
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.viteception = void 0;
|
|
4
|
-
const vite_1 = require("vite");
|
|
5
|
-
const vite_js_1 = require("../utilities/vite.js");
|
|
6
|
-
async function viteception(paths, options) {
|
|
7
|
-
const isWorker = process.env.WORKER;
|
|
8
|
-
delete process.env.WORKER;
|
|
9
|
-
const server = await (0, vite_1.createServer)({
|
|
10
|
-
clearScreen: false,
|
|
11
|
-
server: {
|
|
12
|
-
middlewareMode: vite_js_1.isVite3 ? true : 'ssr',
|
|
13
|
-
hmr: false,
|
|
14
|
-
},
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
appType: 'custom',
|
|
17
|
-
...options,
|
|
18
|
-
});
|
|
19
|
-
if (isWorker) {
|
|
20
|
-
process.env.WORKER = isWorker;
|
|
21
|
-
}
|
|
22
|
-
const loaded = await Promise.all(paths.map((path) => server.ssrLoadModule(path)));
|
|
23
|
-
await server.close();
|
|
24
|
-
return { server, loaded };
|
|
25
|
-
}
|
|
26
|
-
exports.viteception = viteception;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
import type { SessionStorageAdapter } from './foundation/session/session-types';
|
|
4
|
-
export interface RuntimeContext {
|
|
5
|
-
waitUntil: (fn: Promise<any>) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface RequestHandlerOptions {
|
|
8
|
-
indexTemplate: string | ((url: string) => Promise<string | {
|
|
9
|
-
default: string;
|
|
10
|
-
}>);
|
|
11
|
-
cache?: Cache;
|
|
12
|
-
streamableResponse?: ServerResponse;
|
|
13
|
-
dev?: boolean;
|
|
14
|
-
context?: RuntimeContext;
|
|
15
|
-
nonce?: string;
|
|
16
|
-
buyerIpHeader?: string;
|
|
17
|
-
sessionApi?: SessionStorageAdapter;
|
|
18
|
-
headers?: Headers;
|
|
19
|
-
}
|
|
20
|
-
export interface RequestHandler {
|
|
21
|
-
(request: Request | IncomingMessage, options: RequestHandlerOptions): Promise<Response | undefined>;
|
|
22
|
-
}
|
|
23
|
-
export declare type ShopifyConfig = {
|
|
24
|
-
defaultLanguageCode?: string;
|
|
25
|
-
defaultCountryCode?: string;
|
|
26
|
-
storeDomain: string;
|
|
27
|
-
storefrontToken: string;
|
|
28
|
-
storefrontApiVersion: string;
|
|
29
|
-
privateStorefrontToken?: string;
|
|
30
|
-
storefrontId?: string;
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isVite3: any;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.isVite3 = void 0;
|
|
27
|
-
// `version` is only exported in Vite 3
|
|
28
|
-
const vite = __importStar(require("vite"));
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
exports.isVite3 = vite.version?.startsWith('3.');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const node_fetch_1 = __importStar(require("node-fetch"));
|
|
30
|
-
const abort_controller_1 = __importDefault(require("abort-controller"));
|
|
31
|
-
const ponyfill_1 = require("web-streams-polyfill/ponyfill");
|
|
32
|
-
const undici_1 = require("undici");
|
|
33
|
-
if (!globalThis.fetch) {
|
|
34
|
-
Object.assign(globalThis, {
|
|
35
|
-
fetch: node_fetch_1.default,
|
|
36
|
-
Request: node_fetch_1.Request,
|
|
37
|
-
Response: node_fetch_1.Response,
|
|
38
|
-
Headers: node_fetch_1.Headers,
|
|
39
|
-
AbortController: abort_controller_1.default,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
if (!globalThis.FormData) {
|
|
43
|
-
Object.assign(globalThis, {
|
|
44
|
-
FormData: undici_1.FormData,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (!globalThis.ReadableStream) {
|
|
48
|
-
Object.assign(globalThis, {
|
|
49
|
-
ReadableStream: ponyfill_1.ReadableStream,
|
|
50
|
-
WritableStream: ponyfill_1.WritableStream,
|
|
51
|
-
TransformStream: ponyfill_1.TransformStream,
|
|
52
|
-
});
|
|
53
|
-
}
|