@shopify/hydrogen 2026.4.4 → 2026.10.0-preview.1

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.
Files changed (754) hide show
  1. package/README.md +73 -13
  2. package/bin/hydrogen.mjs +7 -0
  3. package/dist/cli/index.mjs +330 -0
  4. package/dist/client/client.d.mts +34 -0
  5. package/dist/client/client.mjs +193 -0
  6. package/dist/client/client.mjs.map +1 -0
  7. package/dist/client/errors.d.mts +48 -0
  8. package/dist/client/errors.mjs +52 -0
  9. package/dist/client/errors.mjs.map +1 -0
  10. package/dist/client/index.d.mts +4 -0
  11. package/dist/client/types.d.mts +147 -0
  12. package/dist/core/analytics/cart-tracker.d.mts +8 -0
  13. package/dist/core/analytics/cart-tracker.mjs +144 -0
  14. package/dist/core/analytics/cart-tracker.mjs.map +1 -0
  15. package/dist/core/analytics/events.d.mts +15 -0
  16. package/dist/core/analytics/events.mjs +15 -0
  17. package/dist/core/analytics/events.mjs.map +1 -0
  18. package/dist/core/analytics/index.d.mts +3 -0
  19. package/dist/core/analytics/types.d.mts +143 -0
  20. package/dist/core/analytics/utils/flatten-connection.d.mts +19 -0
  21. package/dist/core/analytics/utils/flatten-connection.mjs +25 -0
  22. package/dist/core/analytics/utils/flatten-connection.mjs.map +1 -0
  23. package/dist/core/cache/cache-status.mjs +17 -0
  24. package/dist/core/cache/cache-status.mjs.map +1 -0
  25. package/dist/core/cache/fetch-with-cache.d.mts +43 -0
  26. package/dist/core/cache/fetch-with-cache.mjs +188 -0
  27. package/dist/core/cache/fetch-with-cache.mjs.map +1 -0
  28. package/dist/core/cache/key.d.mts +6 -0
  29. package/dist/core/cache/key.mjs +27 -0
  30. package/dist/core/cache/key.mjs.map +1 -0
  31. package/dist/core/cache/run-with-cache.d.mts +36 -0
  32. package/dist/core/cache/run-with-cache.mjs +114 -0
  33. package/dist/core/cache/run-with-cache.mjs.map +1 -0
  34. package/dist/core/cache/store.d.mts +19 -0
  35. package/dist/core/cache/store.mjs +62 -0
  36. package/dist/core/cache/store.mjs.map +1 -0
  37. package/dist/core/cache/strategies.d.mts +39 -0
  38. package/dist/core/cache/strategies.mjs +70 -0
  39. package/dist/core/cache/strategies.mjs.map +1 -0
  40. package/dist/core/cart/actions.d.mts +50 -0
  41. package/dist/core/cart/actions.mjs +240 -0
  42. package/dist/core/cart/actions.mjs.map +1 -0
  43. package/dist/core/cart/attach-quantity-input.d.mts +5 -0
  44. package/dist/core/cart/attach-quantity-input.mjs +17 -0
  45. package/dist/core/cart/attach-quantity-input.mjs.map +1 -0
  46. package/dist/core/cart/buyer-identity-sync.d.mts +23 -0
  47. package/dist/core/cart/buyer-identity-sync.mjs +9 -0
  48. package/dist/core/cart/buyer-identity-sync.mjs.map +1 -0
  49. package/dist/core/cart/cart.d.mts +32 -0
  50. package/dist/core/cart/cart.mjs +1687 -0
  51. package/dist/core/cart/cart.mjs.map +1 -0
  52. package/dist/core/cart/cookie.d.mts +5 -0
  53. package/dist/core/cart/cookie.mjs +28 -0
  54. package/dist/core/cart/cookie.mjs.map +1 -0
  55. package/dist/core/cart/form.d.mts +130 -0
  56. package/dist/core/cart/form.mjs +75 -0
  57. package/dist/core/cart/form.mjs.map +1 -0
  58. package/dist/core/cart/get-cart.d.mts +25 -0
  59. package/dist/core/cart/get-cart.mjs +32 -0
  60. package/dist/core/cart/get-cart.mjs.map +1 -0
  61. package/dist/core/cart/index.d.mts +10 -0
  62. package/dist/core/cart/quantity.d.mts +10 -0
  63. package/dist/core/cart/quantity.mjs +14 -0
  64. package/dist/core/cart/quantity.mjs.map +1 -0
  65. package/dist/core/cart/queries.d.mts +4296 -0
  66. package/dist/core/cart/queries.mjs +70 -0
  67. package/dist/core/cart/queries.mjs.map +1 -0
  68. package/dist/core/cart/server-handlers.d.mts +82 -0
  69. package/dist/core/cart/server-handlers.mjs +322 -0
  70. package/dist/core/cart/server-handlers.mjs.map +1 -0
  71. package/dist/core/cart/state.d.mts +137 -0
  72. package/dist/core/cart/state.mjs +76 -0
  73. package/dist/core/cart/state.mjs.map +1 -0
  74. package/dist/core/cart/sync-quantity-inputs.mjs +16 -0
  75. package/dist/core/cart/sync-quantity-inputs.mjs.map +1 -0
  76. package/dist/core/collection/collection.d.mts +134 -0
  77. package/dist/core/collection/collection.mjs +170 -0
  78. package/dist/core/collection/collection.mjs.map +1 -0
  79. package/dist/core/collection/index.d.mts +6 -0
  80. package/dist/core/collection/reconciler.d.mts +32 -0
  81. package/dist/core/collection/reconciler.mjs +89 -0
  82. package/dist/core/collection/reconciler.mjs.map +1 -0
  83. package/dist/core/collection/state.d.mts +66 -0
  84. package/dist/core/collection/state.mjs +20 -0
  85. package/dist/core/collection/state.mjs.map +1 -0
  86. package/dist/core/collection/url.d.mts +70 -0
  87. package/dist/core/collection/url.mjs +367 -0
  88. package/dist/core/collection/url.mjs.map +1 -0
  89. package/dist/core/constants.d.mts +5 -0
  90. package/dist/core/constants.mjs +8 -0
  91. package/dist/core/constants.mjs.map +1 -0
  92. package/dist/core/headers.mjs +44 -0
  93. package/dist/core/headers.mjs.map +1 -0
  94. package/dist/core/index.d.mts +55 -0
  95. package/dist/core/index.mjs +44 -0
  96. package/dist/core/logging/logging.d.mts +21 -0
  97. package/dist/core/logging/logging.mjs +99 -0
  98. package/dist/core/logging/logging.mjs.map +1 -0
  99. package/dist/core/logging/types.d.mts +40 -0
  100. package/dist/core/logging/types.mjs +18 -0
  101. package/dist/core/logging/types.mjs.map +1 -0
  102. package/dist/core/money/cache.mjs +25 -0
  103. package/dist/core/money/cache.mjs.map +1 -0
  104. package/dist/core/money/format.d.mts +15 -0
  105. package/dist/core/money/format.mjs +243 -0
  106. package/dist/core/money/format.mjs.map +1 -0
  107. package/dist/core/money/types.d.mts +47 -0
  108. package/dist/core/observable.mjs +46 -0
  109. package/dist/core/observable.mjs.map +1 -0
  110. package/dist/core/predictive-search/constants.d.mts +5 -0
  111. package/dist/core/predictive-search/constants.mjs +6 -0
  112. package/dist/core/predictive-search/constants.mjs.map +1 -0
  113. package/dist/core/predictive-search/form.d.mts +31 -0
  114. package/dist/core/predictive-search/form.mjs +31 -0
  115. package/dist/core/predictive-search/form.mjs.map +1 -0
  116. package/dist/core/predictive-search/index.d.mts +6 -0
  117. package/dist/core/predictive-search/queries.d.mts +118 -0
  118. package/dist/core/predictive-search/queries.mjs +81 -0
  119. package/dist/core/predictive-search/queries.mjs.map +1 -0
  120. package/dist/core/predictive-search/search.d.mts +32 -0
  121. package/dist/core/predictive-search/search.mjs +74 -0
  122. package/dist/core/predictive-search/search.mjs.map +1 -0
  123. package/dist/core/predictive-search/server-handlers.d.mts +36 -0
  124. package/dist/core/predictive-search/server-handlers.mjs +113 -0
  125. package/dist/core/predictive-search/server-handlers.mjs.map +1 -0
  126. package/dist/core/predictive-search/store.d.mts +44 -0
  127. package/dist/core/predictive-search/store.mjs +224 -0
  128. package/dist/core/predictive-search/store.mjs.map +1 -0
  129. package/dist/core/predictive-search/url.d.mts +41 -0
  130. package/dist/core/predictive-search/url.mjs +71 -0
  131. package/dist/core/predictive-search/url.mjs.map +1 -0
  132. package/dist/core/product/form.d.mts +63 -0
  133. package/dist/core/product/form.mjs +44 -0
  134. package/dist/core/product/form.mjs.map +1 -0
  135. package/dist/core/product/index.d.mts +4 -0
  136. package/dist/core/product/options.d.mts +40 -0
  137. package/dist/core/product/options.mjs +291 -0
  138. package/dist/core/product/options.mjs.map +1 -0
  139. package/dist/core/product/product-form.d.mts +72 -0
  140. package/dist/core/product/product-form.mjs +158 -0
  141. package/dist/core/product/product-form.mjs.map +1 -0
  142. package/dist/core/product/state.d.mts +68 -0
  143. package/dist/core/request-context.d.mts +70 -0
  144. package/dist/core/request-context.mjs +120 -0
  145. package/dist/core/request-context.mjs.map +1 -0
  146. package/dist/core/request-routing/handle-shopify-redirects.d.mts +17 -0
  147. package/dist/core/request-routing/handle-shopify-redirects.mjs +31 -0
  148. package/dist/core/request-routing/handle-shopify-redirects.mjs.map +1 -0
  149. package/dist/core/request-routing/handle-shopify-routes.d.mts +14 -0
  150. package/dist/core/request-routing/handle-shopify-routes.mjs +42 -0
  151. package/dist/core/request-routing/handle-shopify-routes.mjs.map +1 -0
  152. package/dist/core/request-routing/interceptors/admin-redirect.mjs +12 -0
  153. package/dist/core/request-routing/interceptors/admin-redirect.mjs.map +1 -0
  154. package/dist/core/request-routing/interceptors/agent-proxy.mjs +19 -0
  155. package/dist/core/request-routing/interceptors/agent-proxy.mjs.map +1 -0
  156. package/dist/core/request-routing/interceptors/ajax-api.mjs +16 -0
  157. package/dist/core/request-routing/interceptors/ajax-api.mjs.map +1 -0
  158. package/dist/core/request-routing/interceptors/api-proxy.mjs +20 -0
  159. package/dist/core/request-routing/interceptors/api-proxy.mjs.map +1 -0
  160. package/dist/core/request-routing/interceptors/checkout.mjs +58 -0
  161. package/dist/core/request-routing/interceptors/checkout.mjs.map +1 -0
  162. package/dist/core/request-routing/interceptors/mcp-proxy.mjs +23 -0
  163. package/dist/core/request-routing/interceptors/mcp-proxy.mjs.map +1 -0
  164. package/dist/core/request-routing/interceptors/proxy.mjs +68 -0
  165. package/dist/core/request-routing/interceptors/proxy.mjs.map +1 -0
  166. package/dist/core/request-routing/interceptors/query-param-redirect.mjs +22 -0
  167. package/dist/core/request-routing/interceptors/query-param-redirect.mjs.map +1 -0
  168. package/dist/core/request-routing/interceptors/sfapi-proxy.mjs +27 -0
  169. package/dist/core/request-routing/interceptors/sfapi-proxy.mjs.map +1 -0
  170. package/dist/core/request-routing/interceptors/standard-routes.mjs +19 -0
  171. package/dist/core/request-routing/interceptors/standard-routes.mjs.map +1 -0
  172. package/dist/core/request-routing/interceptors/url-redirects.mjs +27 -0
  173. package/dist/core/request-routing/interceptors/url-redirects.mjs.map +1 -0
  174. package/dist/core/request-routing/interceptors/well-known.mjs +19 -0
  175. package/dist/core/request-routing/interceptors/well-known.mjs.map +1 -0
  176. package/dist/core/request-routing/registered-routes.d.mts +7 -0
  177. package/dist/core/request-routing/registered-routes.mjs +59 -0
  178. package/dist/core/request-routing/registered-routes.mjs.map +1 -0
  179. package/dist/core/request-routing/route-types.d.mts +51 -0
  180. package/dist/core/request-routing/safe-apply-response-headers.mjs +16 -0
  181. package/dist/core/request-routing/safe-apply-response-headers.mjs.map +1 -0
  182. package/dist/core/shop-pay/shop-pay.d.mts +102 -0
  183. package/dist/core/shop-pay/shop-pay.mjs +289 -0
  184. package/dist/core/shop-pay/shop-pay.mjs.map +1 -0
  185. package/dist/core/shopify-scripts/analytics.mjs +26 -0
  186. package/dist/core/shopify-scripts/analytics.mjs.map +1 -0
  187. package/dist/core/shopify-scripts/consent.mjs +17 -0
  188. package/dist/core/shopify-scripts/consent.mjs.map +1 -0
  189. package/dist/core/shopify-scripts/constants.mjs +19 -0
  190. package/dist/core/shopify-scripts/constants.mjs.map +1 -0
  191. package/dist/core/shopify-scripts/deprecated-cookies.mjs +97 -0
  192. package/dist/core/shopify-scripts/deprecated-cookies.mjs.map +1 -0
  193. package/dist/core/shopify-scripts/global.d.mts +1 -0
  194. package/dist/core/shopify-scripts/global.mjs +86 -0
  195. package/dist/core/shopify-scripts/global.mjs.map +1 -0
  196. package/dist/core/shopify-scripts/index.d.mts +27 -0
  197. package/dist/core/shopify-scripts/index.mjs +135 -0
  198. package/dist/core/shopify-scripts/index.mjs.map +1 -0
  199. package/dist/core/shopify-scripts/initialize.d.mts +18 -0
  200. package/dist/core/shopify-scripts/initialize.mjs +27 -0
  201. package/dist/core/shopify-scripts/initialize.mjs.map +1 -0
  202. package/dist/core/shopify-scripts/page-view.mjs +49 -0
  203. package/dist/core/shopify-scripts/page-view.mjs.map +1 -0
  204. package/dist/core/shopify-scripts/perfkit.mjs +33 -0
  205. package/dist/core/shopify-scripts/perfkit.mjs.map +1 -0
  206. package/dist/core/shopify-scripts/render.d.mts +1 -0
  207. package/dist/core/shopify-scripts/render.mjs +23 -0
  208. package/dist/core/shopify-scripts/render.mjs.map +1 -0
  209. package/dist/core/shopify-scripts/types.d.mts +76 -0
  210. package/dist/core/shopify-scripts/utils/cookie-domain.mjs +43 -0
  211. package/dist/core/shopify-scripts/utils/cookie-domain.mjs.map +1 -0
  212. package/dist/core/shopify-scripts/utils/inline-script.mjs +8 -0
  213. package/dist/core/shopify-scripts/utils/inline-script.mjs.map +1 -0
  214. package/dist/core/shopify-scripts/utils/navigation.mjs +46 -0
  215. package/dist/core/shopify-scripts/utils/navigation.mjs.map +1 -0
  216. package/dist/core/shopify-scripts/utils/tracking-values.mjs +65 -0
  217. package/dist/core/shopify-scripts/utils/tracking-values.mjs.map +1 -0
  218. package/dist/core/shopify-scripts/utils/uuid.mjs +17 -0
  219. package/dist/core/shopify-scripts/utils/uuid.mjs.map +1 -0
  220. package/dist/core/shopify-scripts/webmcp.mjs +22 -0
  221. package/dist/core/shopify-scripts/webmcp.mjs.map +1 -0
  222. package/dist/core/standard-routes/build.d.mts +34 -0
  223. package/dist/core/standard-routes/build.mjs +54 -0
  224. package/dist/core/standard-routes/build.mjs.map +1 -0
  225. package/dist/core/standard-routes/defaults.mjs +31 -0
  226. package/dist/core/standard-routes/defaults.mjs.map +1 -0
  227. package/dist/core/standard-routes/match.mjs +108 -0
  228. package/dist/core/standard-routes/match.mjs.map +1 -0
  229. package/dist/core/standard-routes/path.mjs +58 -0
  230. package/dist/core/standard-routes/path.mjs.map +1 -0
  231. package/dist/core/standard-routes/redirects.mjs +51 -0
  232. package/dist/core/standard-routes/redirects.mjs.map +1 -0
  233. package/dist/core/standard-routes/types.d.mts +95 -0
  234. package/dist/core/url.mjs +35 -0
  235. package/dist/core/url.mjs.map +1 -0
  236. package/dist/core/utils/load-script.mjs +34 -0
  237. package/dist/core/utils/load-script.mjs.map +1 -0
  238. package/dist/core/utils/parse-gid.mjs +33 -0
  239. package/dist/core/utils/parse-gid.mjs.map +1 -0
  240. package/dist/core/utils/record.mjs +8 -0
  241. package/dist/core/utils/record.mjs.map +1 -0
  242. package/dist/customer-account/client.d.mts +50 -0
  243. package/dist/customer-account/client.mjs +239 -0
  244. package/dist/customer-account/client.mjs.map +1 -0
  245. package/dist/customer-account/errors.d.mts +28 -0
  246. package/dist/customer-account/errors.mjs +39 -0
  247. package/dist/customer-account/errors.mjs.map +1 -0
  248. package/dist/customer-account/graphql.d.mts +29 -0
  249. package/dist/customer-account/graphql.mjs +39 -0
  250. package/dist/customer-account/graphql.mjs.map +1 -0
  251. package/dist/customer-account/index.d.mts +7 -0
  252. package/dist/customer-account/index.mjs +7 -0
  253. package/dist/customer-account/session.d.mts +117 -0
  254. package/dist/customer-account/session.mjs +733 -0
  255. package/dist/customer-account/session.mjs.map +1 -0
  256. package/dist/customer-account/type-resolver.d.mts +11 -0
  257. package/dist/customer-account-api-types.d.ts +3269 -3270
  258. package/dist/customer-account.schema.json +50753 -1
  259. package/dist/development/_virtual/_@oxc-project_runtime@0.127.0/helpers/taggedTemplateLiteral.mjs +7 -0
  260. package/dist/development/client/client.d.mts +34 -0
  261. package/dist/development/client/client.mjs +193 -0
  262. package/dist/development/client/client.mjs.map +1 -0
  263. package/dist/development/client/errors.d.mts +48 -0
  264. package/dist/development/client/errors.mjs +57 -0
  265. package/dist/development/client/errors.mjs.map +1 -0
  266. package/dist/development/client/index.d.mts +4 -0
  267. package/dist/development/client/types.d.mts +147 -0
  268. package/dist/development/core/analytics/cart-tracker.d.mts +8 -0
  269. package/dist/development/core/analytics/cart-tracker.mjs +144 -0
  270. package/dist/development/core/analytics/cart-tracker.mjs.map +1 -0
  271. package/dist/development/core/analytics/events.d.mts +15 -0
  272. package/dist/development/core/analytics/events.mjs +15 -0
  273. package/dist/development/core/analytics/events.mjs.map +1 -0
  274. package/dist/development/core/analytics/index.d.mts +3 -0
  275. package/dist/development/core/analytics/types.d.mts +143 -0
  276. package/dist/development/core/analytics/utils/flatten-connection.d.mts +19 -0
  277. package/dist/development/core/analytics/utils/flatten-connection.mjs +25 -0
  278. package/dist/development/core/analytics/utils/flatten-connection.mjs.map +1 -0
  279. package/dist/development/core/cache/cache-status.mjs +17 -0
  280. package/dist/development/core/cache/cache-status.mjs.map +1 -0
  281. package/dist/development/core/cache/fetch-with-cache.d.mts +43 -0
  282. package/dist/development/core/cache/fetch-with-cache.mjs +188 -0
  283. package/dist/development/core/cache/fetch-with-cache.mjs.map +1 -0
  284. package/dist/development/core/cache/key.d.mts +6 -0
  285. package/dist/development/core/cache/key.mjs +27 -0
  286. package/dist/development/core/cache/key.mjs.map +1 -0
  287. package/dist/development/core/cache/run-with-cache.d.mts +36 -0
  288. package/dist/development/core/cache/run-with-cache.mjs +114 -0
  289. package/dist/development/core/cache/run-with-cache.mjs.map +1 -0
  290. package/dist/development/core/cache/store.d.mts +19 -0
  291. package/dist/development/core/cache/store.mjs +62 -0
  292. package/dist/development/core/cache/store.mjs.map +1 -0
  293. package/dist/development/core/cache/strategies.d.mts +39 -0
  294. package/dist/development/core/cache/strategies.mjs +70 -0
  295. package/dist/development/core/cache/strategies.mjs.map +1 -0
  296. package/dist/development/core/cart/actions.d.mts +50 -0
  297. package/dist/development/core/cart/actions.mjs +240 -0
  298. package/dist/development/core/cart/actions.mjs.map +1 -0
  299. package/dist/development/core/cart/attach-quantity-input.d.mts +5 -0
  300. package/dist/development/core/cart/attach-quantity-input.mjs +17 -0
  301. package/dist/development/core/cart/attach-quantity-input.mjs.map +1 -0
  302. package/dist/development/core/cart/buyer-identity-sync.d.mts +19 -0
  303. package/dist/development/core/cart/buyer-identity-sync.mjs +6 -0
  304. package/dist/development/core/cart/buyer-identity-sync.mjs.map +1 -0
  305. package/dist/development/core/cart/cart.d.mts +32 -0
  306. package/dist/development/core/cart/cart.mjs +1687 -0
  307. package/dist/development/core/cart/cart.mjs.map +1 -0
  308. package/dist/development/core/cart/cookie.d.mts +5 -0
  309. package/dist/development/core/cart/cookie.mjs +28 -0
  310. package/dist/development/core/cart/cookie.mjs.map +1 -0
  311. package/dist/development/core/cart/form.d.mts +130 -0
  312. package/dist/development/core/cart/form.mjs +75 -0
  313. package/dist/development/core/cart/form.mjs.map +1 -0
  314. package/dist/development/core/cart/get-cart.d.mts +25 -0
  315. package/dist/development/core/cart/get-cart.mjs +32 -0
  316. package/dist/development/core/cart/get-cart.mjs.map +1 -0
  317. package/dist/development/core/cart/index.d.mts +10 -0
  318. package/dist/development/core/cart/quantity.d.mts +10 -0
  319. package/dist/development/core/cart/quantity.mjs +14 -0
  320. package/dist/development/core/cart/quantity.mjs.map +1 -0
  321. package/dist/development/core/cart/queries.d.mts +4296 -0
  322. package/dist/development/core/cart/queries.mjs +70 -0
  323. package/dist/development/core/cart/queries.mjs.map +1 -0
  324. package/dist/development/core/cart/server-handlers.d.mts +82 -0
  325. package/dist/development/core/cart/server-handlers.mjs +322 -0
  326. package/dist/development/core/cart/server-handlers.mjs.map +1 -0
  327. package/dist/development/core/cart/state.d.mts +137 -0
  328. package/dist/development/core/cart/state.mjs +76 -0
  329. package/dist/development/core/cart/state.mjs.map +1 -0
  330. package/dist/development/core/cart/sync-quantity-inputs.mjs +16 -0
  331. package/dist/development/core/cart/sync-quantity-inputs.mjs.map +1 -0
  332. package/dist/development/core/collection/collection.d.mts +134 -0
  333. package/dist/development/core/collection/collection.mjs +170 -0
  334. package/dist/development/core/collection/collection.mjs.map +1 -0
  335. package/dist/development/core/collection/index.d.mts +6 -0
  336. package/dist/development/core/collection/reconciler.d.mts +32 -0
  337. package/dist/development/core/collection/reconciler.mjs +89 -0
  338. package/dist/development/core/collection/reconciler.mjs.map +1 -0
  339. package/dist/development/core/collection/state.d.mts +66 -0
  340. package/dist/development/core/collection/state.mjs +20 -0
  341. package/dist/development/core/collection/state.mjs.map +1 -0
  342. package/dist/development/core/collection/url.d.mts +70 -0
  343. package/dist/development/core/collection/url.mjs +367 -0
  344. package/dist/development/core/collection/url.mjs.map +1 -0
  345. package/dist/development/core/constants.mjs +7 -0
  346. package/dist/development/core/constants.mjs.map +1 -0
  347. package/dist/development/core/development.d.mts +55 -0
  348. package/dist/development/core/development.mjs +44 -0
  349. package/dist/development/core/headers.mjs +44 -0
  350. package/dist/development/core/headers.mjs.map +1 -0
  351. package/dist/development/core/index.d.mts +53 -0
  352. package/dist/development/core/logging/logging.d.mts +21 -0
  353. package/dist/development/core/logging/logging.mjs +99 -0
  354. package/dist/development/core/logging/logging.mjs.map +1 -0
  355. package/dist/development/core/logging/types.d.mts +40 -0
  356. package/dist/development/core/logging/types.mjs +18 -0
  357. package/dist/development/core/logging/types.mjs.map +1 -0
  358. package/dist/development/core/money/cache.mjs +25 -0
  359. package/dist/development/core/money/cache.mjs.map +1 -0
  360. package/dist/development/core/money/format.d.mts +15 -0
  361. package/dist/development/core/money/format.mjs +243 -0
  362. package/dist/development/core/money/format.mjs.map +1 -0
  363. package/dist/development/core/money/types.d.mts +47 -0
  364. package/dist/development/core/observable.mjs +46 -0
  365. package/dist/development/core/observable.mjs.map +1 -0
  366. package/dist/development/core/predictive-search/constants.d.mts +5 -0
  367. package/dist/development/core/predictive-search/constants.mjs +6 -0
  368. package/dist/development/core/predictive-search/constants.mjs.map +1 -0
  369. package/dist/development/core/predictive-search/form.d.mts +31 -0
  370. package/dist/development/core/predictive-search/form.mjs +31 -0
  371. package/dist/development/core/predictive-search/form.mjs.map +1 -0
  372. package/dist/development/core/predictive-search/index.d.mts +6 -0
  373. package/dist/development/core/predictive-search/queries.d.mts +118 -0
  374. package/dist/development/core/predictive-search/queries.mjs +81 -0
  375. package/dist/development/core/predictive-search/queries.mjs.map +1 -0
  376. package/dist/development/core/predictive-search/search.d.mts +32 -0
  377. package/dist/development/core/predictive-search/search.mjs +74 -0
  378. package/dist/development/core/predictive-search/search.mjs.map +1 -0
  379. package/dist/development/core/predictive-search/server-handlers.d.mts +36 -0
  380. package/dist/development/core/predictive-search/server-handlers.mjs +113 -0
  381. package/dist/development/core/predictive-search/server-handlers.mjs.map +1 -0
  382. package/dist/development/core/predictive-search/store.d.mts +44 -0
  383. package/dist/development/core/predictive-search/store.mjs +224 -0
  384. package/dist/development/core/predictive-search/store.mjs.map +1 -0
  385. package/dist/development/core/predictive-search/url.d.mts +41 -0
  386. package/dist/development/core/predictive-search/url.mjs +71 -0
  387. package/dist/development/core/predictive-search/url.mjs.map +1 -0
  388. package/dist/development/core/product/form.d.mts +63 -0
  389. package/dist/development/core/product/form.mjs +44 -0
  390. package/dist/development/core/product/form.mjs.map +1 -0
  391. package/dist/development/core/product/index.d.mts +4 -0
  392. package/dist/development/core/product/options.d.mts +40 -0
  393. package/dist/development/core/product/options.mjs +291 -0
  394. package/dist/development/core/product/options.mjs.map +1 -0
  395. package/dist/development/core/product/product-form.d.mts +72 -0
  396. package/dist/development/core/product/product-form.mjs +158 -0
  397. package/dist/development/core/product/product-form.mjs.map +1 -0
  398. package/dist/development/core/product/state.d.mts +68 -0
  399. package/dist/development/core/request-context.d.mts +70 -0
  400. package/dist/development/core/request-context.mjs +120 -0
  401. package/dist/development/core/request-context.mjs.map +1 -0
  402. package/dist/development/core/request-routing/handle-shopify-redirects.d.mts +17 -0
  403. package/dist/development/core/request-routing/handle-shopify-redirects.mjs +31 -0
  404. package/dist/development/core/request-routing/handle-shopify-redirects.mjs.map +1 -0
  405. package/dist/development/core/request-routing/handle-shopify-routes.d.mts +1 -0
  406. package/dist/development/core/request-routing/handle-shopify-routes.development.d.mts +11 -0
  407. package/dist/development/core/request-routing/handle-shopify-routes.development.mjs +16 -0
  408. package/dist/development/core/request-routing/handle-shopify-routes.development.mjs.map +1 -0
  409. package/dist/development/core/request-routing/handle-shopify-routes.mjs +42 -0
  410. package/dist/development/core/request-routing/handle-shopify-routes.mjs.map +1 -0
  411. package/dist/development/core/request-routing/interceptors/admin-redirect.mjs +12 -0
  412. package/dist/development/core/request-routing/interceptors/admin-redirect.mjs.map +1 -0
  413. package/dist/development/core/request-routing/interceptors/agent-proxy.mjs +19 -0
  414. package/dist/development/core/request-routing/interceptors/agent-proxy.mjs.map +1 -0
  415. package/dist/development/core/request-routing/interceptors/ajax-api.mjs +16 -0
  416. package/dist/development/core/request-routing/interceptors/ajax-api.mjs.map +1 -0
  417. package/dist/development/core/request-routing/interceptors/api-proxy.mjs +20 -0
  418. package/dist/development/core/request-routing/interceptors/api-proxy.mjs.map +1 -0
  419. package/dist/development/core/request-routing/interceptors/checkout.mjs +58 -0
  420. package/dist/development/core/request-routing/interceptors/checkout.mjs.map +1 -0
  421. package/dist/development/core/request-routing/interceptors/graphiql.mjs +46 -0
  422. package/dist/development/core/request-routing/interceptors/graphiql.mjs.map +1 -0
  423. package/dist/development/core/request-routing/interceptors/mcp-proxy.mjs +23 -0
  424. package/dist/development/core/request-routing/interceptors/mcp-proxy.mjs.map +1 -0
  425. package/dist/development/core/request-routing/interceptors/proxy.mjs +68 -0
  426. package/dist/development/core/request-routing/interceptors/proxy.mjs.map +1 -0
  427. package/dist/development/core/request-routing/interceptors/query-param-redirect.mjs +22 -0
  428. package/dist/development/core/request-routing/interceptors/query-param-redirect.mjs.map +1 -0
  429. package/dist/development/core/request-routing/interceptors/sfapi-proxy.mjs +27 -0
  430. package/dist/development/core/request-routing/interceptors/sfapi-proxy.mjs.map +1 -0
  431. package/dist/development/core/request-routing/interceptors/standard-routes.mjs +19 -0
  432. package/dist/development/core/request-routing/interceptors/standard-routes.mjs.map +1 -0
  433. package/dist/development/core/request-routing/interceptors/url-redirects.mjs +27 -0
  434. package/dist/development/core/request-routing/interceptors/url-redirects.mjs.map +1 -0
  435. package/dist/development/core/request-routing/interceptors/well-known.mjs +19 -0
  436. package/dist/development/core/request-routing/interceptors/well-known.mjs.map +1 -0
  437. package/dist/development/core/request-routing/registered-routes.d.mts +7 -0
  438. package/dist/development/core/request-routing/registered-routes.mjs +59 -0
  439. package/dist/development/core/request-routing/registered-routes.mjs.map +1 -0
  440. package/dist/development/core/request-routing/route-types.d.mts +51 -0
  441. package/dist/development/core/request-routing/safe-apply-response-headers.mjs +16 -0
  442. package/dist/development/core/request-routing/safe-apply-response-headers.mjs.map +1 -0
  443. package/dist/development/core/shop-pay/shop-pay.d.mts +102 -0
  444. package/dist/development/core/shop-pay/shop-pay.mjs +289 -0
  445. package/dist/development/core/shop-pay/shop-pay.mjs.map +1 -0
  446. package/dist/development/core/shopify-scripts/analytics.mjs +26 -0
  447. package/dist/development/core/shopify-scripts/analytics.mjs.map +1 -0
  448. package/dist/development/core/shopify-scripts/consent.mjs +17 -0
  449. package/dist/development/core/shopify-scripts/consent.mjs.map +1 -0
  450. package/dist/development/core/shopify-scripts/constants.mjs +19 -0
  451. package/dist/development/core/shopify-scripts/constants.mjs.map +1 -0
  452. package/dist/development/core/shopify-scripts/deprecated-cookies.mjs +97 -0
  453. package/dist/development/core/shopify-scripts/deprecated-cookies.mjs.map +1 -0
  454. package/dist/development/core/shopify-scripts/global.d.mts +1 -0
  455. package/dist/development/core/shopify-scripts/global.mjs +86 -0
  456. package/dist/development/core/shopify-scripts/global.mjs.map +1 -0
  457. package/dist/development/core/shopify-scripts/index.d.mts +27 -0
  458. package/dist/development/core/shopify-scripts/index.mjs +145 -0
  459. package/dist/development/core/shopify-scripts/index.mjs.map +1 -0
  460. package/dist/development/core/shopify-scripts/initialize.d.mts +18 -0
  461. package/dist/development/core/shopify-scripts/initialize.mjs +27 -0
  462. package/dist/development/core/shopify-scripts/initialize.mjs.map +1 -0
  463. package/dist/development/core/shopify-scripts/page-view.mjs +49 -0
  464. package/dist/development/core/shopify-scripts/page-view.mjs.map +1 -0
  465. package/dist/development/core/shopify-scripts/perfkit.mjs +33 -0
  466. package/dist/development/core/shopify-scripts/perfkit.mjs.map +1 -0
  467. package/dist/development/core/shopify-scripts/render.d.mts +1 -0
  468. package/dist/development/core/shopify-scripts/render.mjs +23 -0
  469. package/dist/development/core/shopify-scripts/render.mjs.map +1 -0
  470. package/dist/development/core/shopify-scripts/types.d.mts +76 -0
  471. package/dist/development/core/shopify-scripts/utils/cookie-domain.mjs +43 -0
  472. package/dist/development/core/shopify-scripts/utils/cookie-domain.mjs.map +1 -0
  473. package/dist/development/core/shopify-scripts/utils/inline-script.mjs +8 -0
  474. package/dist/development/core/shopify-scripts/utils/inline-script.mjs.map +1 -0
  475. package/dist/development/core/shopify-scripts/utils/navigation.mjs +46 -0
  476. package/dist/development/core/shopify-scripts/utils/navigation.mjs.map +1 -0
  477. package/dist/development/core/shopify-scripts/utils/tracking-values.mjs +65 -0
  478. package/dist/development/core/shopify-scripts/utils/tracking-values.mjs.map +1 -0
  479. package/dist/development/core/shopify-scripts/utils/uuid.mjs +17 -0
  480. package/dist/development/core/shopify-scripts/utils/uuid.mjs.map +1 -0
  481. package/dist/development/core/shopify-scripts/webmcp.mjs +22 -0
  482. package/dist/development/core/shopify-scripts/webmcp.mjs.map +1 -0
  483. package/dist/development/core/standard-routes/build.d.mts +34 -0
  484. package/dist/development/core/standard-routes/build.mjs +54 -0
  485. package/dist/development/core/standard-routes/build.mjs.map +1 -0
  486. package/dist/development/core/standard-routes/defaults.mjs +31 -0
  487. package/dist/development/core/standard-routes/defaults.mjs.map +1 -0
  488. package/dist/development/core/standard-routes/match.mjs +108 -0
  489. package/dist/development/core/standard-routes/match.mjs.map +1 -0
  490. package/dist/development/core/standard-routes/path.mjs +58 -0
  491. package/dist/development/core/standard-routes/path.mjs.map +1 -0
  492. package/dist/development/core/standard-routes/redirects.mjs +51 -0
  493. package/dist/development/core/standard-routes/redirects.mjs.map +1 -0
  494. package/dist/development/core/standard-routes/types.d.mts +95 -0
  495. package/dist/development/core/types.d.mts +11 -0
  496. package/dist/development/core/url.mjs +35 -0
  497. package/dist/development/core/url.mjs.map +1 -0
  498. package/dist/development/core/utils/load-script.mjs +34 -0
  499. package/dist/development/core/utils/load-script.mjs.map +1 -0
  500. package/dist/development/core/utils/parse-gid.mjs +33 -0
  501. package/dist/development/core/utils/parse-gid.mjs.map +1 -0
  502. package/dist/development/customer-account/session.d.mts +46 -0
  503. package/dist/development/customer-account/session.mjs +21 -0
  504. package/dist/development/customer-account/session.mjs.map +1 -0
  505. package/dist/development/globals.d.mts +64 -0
  506. package/dist/development/graphql/generated/customer-account-api-types.d.mts +13 -0
  507. package/dist/development/graphql/generated/graphql-env.d.mts +19280 -0
  508. package/dist/development/graphql/generated/storefront-api-types.d.mts +47 -0
  509. package/dist/development/graphql/graphql.d.mts +40 -0
  510. package/dist/development/graphql/graphql.mjs +16 -0
  511. package/dist/development/graphql/graphql.mjs.map +1 -0
  512. package/dist/development/graphql/index.d.mts +2 -0
  513. package/dist/development/graphql/scalars.d.mts +15 -0
  514. package/dist/development/graphql/type-resolver.d.mts +229 -0
  515. package/dist/development/react/cart.d.mts +40 -0
  516. package/dist/development/react/cart.mjs +150 -0
  517. package/dist/development/react/cart.mjs.map +1 -0
  518. package/dist/development/react/collection.d.mts +91 -0
  519. package/dist/development/react/collection.mjs +129 -0
  520. package/dist/development/react/collection.mjs.map +1 -0
  521. package/dist/development/react/index.d.mts +13 -0
  522. package/dist/development/react/index.mjs +10 -0
  523. package/dist/development/react/predictive-search.d.mts +49 -0
  524. package/dist/development/react/predictive-search.mjs +133 -0
  525. package/dist/development/react/predictive-search.mjs.map +1 -0
  526. package/dist/development/react/product.d.mts +72 -0
  527. package/dist/development/react/product.mjs +127 -0
  528. package/dist/development/react/product.mjs.map +1 -0
  529. package/dist/development/react/shop-pay.d.mts +9 -0
  530. package/dist/development/react/shop-pay.mjs +16 -0
  531. package/dist/development/react/shop-pay.mjs.map +1 -0
  532. package/dist/development/react/shopify-scripts.d.mts +20 -0
  533. package/dist/development/react/shopify-scripts.mjs +39 -0
  534. package/dist/development/react/shopify-scripts.mjs.map +1 -0
  535. package/dist/development/vendor/standard-actions.d.mts +134 -0
  536. package/dist/development/vendor/standard-events.d.mts +1107 -0
  537. package/dist/development/vue/cart.d.mts +42 -0
  538. package/dist/development/vue/cart.mjs +118 -0
  539. package/dist/development/vue/cart.mjs.map +1 -0
  540. package/dist/development/vue/collection.d.mts +46 -0
  541. package/dist/development/vue/collection.mjs +108 -0
  542. package/dist/development/vue/collection.mjs.map +1 -0
  543. package/dist/development/vue/index.d.mts +11 -0
  544. package/dist/development/vue/index.mjs +8 -0
  545. package/dist/development/vue/predictive-search.d.mts +124 -0
  546. package/dist/development/vue/predictive-search.mjs +171 -0
  547. package/dist/development/vue/predictive-search.mjs.map +1 -0
  548. package/dist/development/vue/product.d.mts +57 -0
  549. package/dist/development/vue/product.mjs +167 -0
  550. package/dist/development/vue/product.mjs.map +1 -0
  551. package/dist/development/vue/shop-pay.d.mts +25 -0
  552. package/dist/development/vue/shop-pay.mjs +35 -0
  553. package/dist/development/vue/shop-pay.mjs.map +1 -0
  554. package/dist/development/vue/shopify-scripts.d.mts +127 -0
  555. package/dist/development/vue/shopify-scripts.mjs +79 -0
  556. package/dist/development/vue/shopify-scripts.mjs.map +1 -0
  557. package/dist/globals.d.mts +64 -0
  558. package/dist/graphql/generated/customer-account-api-types.d.mts +13 -0
  559. package/dist/graphql/generated/customer-account-graphql-env.d.mts +22170 -0
  560. package/dist/graphql/generated/graphql-env.d.mts +19280 -0
  561. package/dist/graphql/generated/storefront-api-types.d.mts +47 -0
  562. package/dist/graphql/graphql.d.mts +40 -0
  563. package/dist/graphql/graphql.mjs +16 -0
  564. package/dist/graphql/graphql.mjs.map +1 -0
  565. package/dist/graphql/index.d.mts +2 -0
  566. package/dist/graphql/scalars.d.mts +26 -0
  567. package/dist/graphql/type-resolver.d.mts +229 -0
  568. package/dist/react/cart.d.mts +40 -0
  569. package/dist/react/cart.mjs +150 -0
  570. package/dist/react/cart.mjs.map +1 -0
  571. package/dist/react/collection.d.mts +91 -0
  572. package/dist/react/collection.mjs +129 -0
  573. package/dist/react/collection.mjs.map +1 -0
  574. package/dist/react/index.d.mts +13 -0
  575. package/dist/react/index.mjs +10 -0
  576. package/dist/react/predictive-search.d.mts +49 -0
  577. package/dist/react/predictive-search.mjs +133 -0
  578. package/dist/react/predictive-search.mjs.map +1 -0
  579. package/dist/react/product.d.mts +72 -0
  580. package/dist/react/product.mjs +127 -0
  581. package/dist/react/product.mjs.map +1 -0
  582. package/dist/react/shop-pay.d.mts +9 -0
  583. package/dist/react/shop-pay.mjs +16 -0
  584. package/dist/react/shop-pay.mjs.map +1 -0
  585. package/dist/react/shopify-scripts.d.mts +20 -0
  586. package/dist/react/shopify-scripts.mjs +39 -0
  587. package/dist/react/shopify-scripts.mjs.map +1 -0
  588. package/dist/storefront-api-types.d.ts +2351 -2390
  589. package/dist/storefront.schema.json +41534 -1
  590. package/dist/ts-plugin/index.cjs +68 -0
  591. package/dist/ts-plugin/index.cjs.map +1 -0
  592. package/dist/ts-plugin/index.d.cts +4 -0
  593. package/dist/vendor/standard-actions.d.mts +134 -0
  594. package/dist/vendor/standard-events.d.mts +1107 -0
  595. package/dist/vite/index.d.mts +2 -0
  596. package/dist/vite/index.mjs +3 -0
  597. package/dist/vite/local-https.d.mts +35 -0
  598. package/dist/vite/local-https.mjs +202 -0
  599. package/dist/vite/local-https.mjs.map +1 -0
  600. package/dist/vue/cart.d.mts +42 -0
  601. package/dist/vue/cart.mjs +118 -0
  602. package/dist/vue/cart.mjs.map +1 -0
  603. package/dist/vue/collection.d.mts +46 -0
  604. package/dist/vue/collection.mjs +108 -0
  605. package/dist/vue/collection.mjs.map +1 -0
  606. package/dist/vue/index.d.mts +11 -0
  607. package/dist/vue/index.mjs +8 -0
  608. package/dist/vue/predictive-search.d.mts +124 -0
  609. package/dist/vue/predictive-search.mjs +171 -0
  610. package/dist/vue/predictive-search.mjs.map +1 -0
  611. package/dist/vue/product.d.mts +57 -0
  612. package/dist/vue/product.mjs +167 -0
  613. package/dist/vue/product.mjs.map +1 -0
  614. package/dist/vue/shop-pay.d.mts +25 -0
  615. package/dist/vue/shop-pay.mjs +35 -0
  616. package/dist/vue/shop-pay.mjs.map +1 -0
  617. package/dist/vue/shopify-scripts.d.mts +127 -0
  618. package/dist/vue/shopify-scripts.mjs +79 -0
  619. package/dist/vue/shopify-scripts.mjs.map +1 -0
  620. package/package.json +116 -86
  621. package/skills/hydrogen-analytics/SKILL.md +80 -0
  622. package/skills/hydrogen-analytics/references/react.md +160 -0
  623. package/skills/hydrogen-analytics/references/vue.md +80 -0
  624. package/skills/hydrogen-cart-drawer/SKILL.md +248 -0
  625. package/skills/hydrogen-cart-drawer/references/accessibility.md +109 -0
  626. package/skills/hydrogen-cart-drawer/references/css.md +67 -0
  627. package/skills/hydrogen-cart-ui/SKILL.md +218 -0
  628. package/skills/hydrogen-cart-ui/references/nextjs.md +89 -0
  629. package/skills/hydrogen-cart-ui/references/react.md +263 -0
  630. package/skills/hydrogen-cart-ui/references/vue.md +204 -0
  631. package/skills/hydrogen-collection-browser/SKILL.md +80 -0
  632. package/skills/hydrogen-collection-browser/references/nextjs.md +118 -0
  633. package/skills/hydrogen-collection-browser/references/nuxt.md +108 -0
  634. package/skills/hydrogen-collection-browser/references/react.md +237 -0
  635. package/skills/hydrogen-customer-account/SKILL.md +107 -0
  636. package/skills/hydrogen-image/SKILL.md +65 -0
  637. package/skills/hydrogen-local-https/SKILL.md +144 -0
  638. package/skills/hydrogen-markets/SKILL.md +221 -0
  639. package/skills/hydrogen-markets/references/nextjs.md +157 -0
  640. package/skills/hydrogen-money/SKILL.md +67 -0
  641. package/skills/hydrogen-oxygen/SKILL.md +245 -0
  642. package/skills/hydrogen-oxygen/references/react-router.md +230 -0
  643. package/skills/hydrogen-predictive-search/SKILL.md +130 -0
  644. package/skills/hydrogen-predictive-search/references/react.md +32 -0
  645. package/skills/hydrogen-predictive-search/references/vue.md +40 -0
  646. package/skills/hydrogen-request-handlers/SKILL.md +90 -0
  647. package/skills/hydrogen-request-handlers/references/frameworks.md +174 -0
  648. package/skills/hydrogen-request-handlers/references/nextjs.md +136 -0
  649. package/skills/hydrogen-request-handlers/references/nuxt.md +214 -0
  650. package/skills/hydrogen-routing/SKILL.md +154 -0
  651. package/skills/hydrogen-setup/SKILL.md +50 -0
  652. package/skills/hydrogen-setup/references/analytics.md +624 -0
  653. package/skills/hydrogen-setup/steps/1-inspect-app.md +62 -0
  654. package/skills/hydrogen-setup/steps/10-analytics.md +10 -0
  655. package/skills/hydrogen-setup/steps/11-verify.md +31 -0
  656. package/skills/hydrogen-setup/steps/2-scaffold.md +86 -0
  657. package/skills/hydrogen-setup/steps/3-build-home-page.md +37 -0
  658. package/skills/hydrogen-setup/steps/4-collection-and-search.md +13 -0
  659. package/skills/hydrogen-setup/steps/5-cart.md +10 -0
  660. package/skills/hydrogen-setup/steps/6-product-detail-page.md +390 -0
  661. package/skills/hydrogen-setup/steps/7-shopify-runtime-scripts.md +69 -0
  662. package/skills/hydrogen-setup/steps/8-cart-drawer-and-navbar.md +35 -0
  663. package/skills/hydrogen-setup/steps/9-account-page.md +54 -0
  664. package/skills/hydrogen-shop-pay/SKILL.md +79 -0
  665. package/skills/hydrogen-shop-pay/references/core.md +66 -0
  666. package/skills/hydrogen-shop-pay/references/react.md +50 -0
  667. package/skills/hydrogen-shop-pay/references/vue.md +39 -0
  668. package/skills/hydrogen-smoke-test/SKILL.md +203 -0
  669. package/skills/hydrogen-storefront-client/SKILL.md +322 -0
  670. package/skills/hydrogen-storefront-client/references/astro.md +125 -0
  671. package/skills/hydrogen-storefront-client/references/caching.md +25 -0
  672. package/skills/hydrogen-storefront-client/references/nextjs.md +121 -0
  673. package/skills/hydrogen-storefront-client/references/nuxt.md +121 -0
  674. package/skills/hydrogen-storefront-client/references/query-validation.md +95 -0
  675. package/skills/hydrogen-storefront-client/references/react-router.md +81 -0
  676. package/skills/hydrogen-storefront-client/references/solidstart.md +131 -0
  677. package/skills/hydrogen-storefront-client/references/sveltekit.md +169 -0
  678. package/skills/hydrogen-variant-form/SKILL.md +250 -0
  679. package/skills/hydrogen-variant-form/references/nextjs.md +203 -0
  680. package/skills/hydrogen-variant-form/references/nuxt.md +95 -0
  681. package/skills/hydrogen-variant-form/references/react.md +71 -0
  682. package/dist/dev/get-virtual-routes-H72465VB.js +0 -74
  683. package/dist/dev/hydrogen-routes.d.ts +0 -5
  684. package/dist/dev/hydrogen-routes.js +0 -25
  685. package/dist/development/get-virtual-routes-ACFZHU42.js +0 -71
  686. package/dist/development/get-virtual-routes-ACFZHU42.js.map +0 -1
  687. package/dist/development/index.cjs +0 -6948
  688. package/dist/development/index.cjs.map +0 -1
  689. package/dist/development/index.js +0 -6601
  690. package/dist/development/index.js.map +0 -1
  691. package/dist/development/log-seo-tags-IG37ONQ2.js +0 -74
  692. package/dist/development/log-seo-tags-IG37ONQ2.js.map +0 -1
  693. package/dist/development/react-router-preset.d.ts +0 -45
  694. package/dist/development/react-router-preset.js +0 -49
  695. package/dist/development/react-router-preset.js.map +0 -1
  696. package/dist/index.cjs +0 -1
  697. package/dist/oxygen/index.d.ts +0 -197
  698. package/dist/oxygen/index.js +0 -107
  699. package/dist/production/get-virtual-routes-ZZEGQQDV.js +0 -3
  700. package/dist/production/get-virtual-routes-ZZEGQQDV.js.map +0 -1
  701. package/dist/production/index.cjs +0 -1019
  702. package/dist/production/index.cjs.map +0 -1
  703. package/dist/production/index.d.cts +0 -3260
  704. package/dist/production/index.d.ts +0 -3260
  705. package/dist/production/index.js +0 -1019
  706. package/dist/production/index.js.map +0 -1
  707. package/dist/production/log-seo-tags-TY72EQWZ.js +0 -2
  708. package/dist/production/log-seo-tags-TY72EQWZ.js.map +0 -1
  709. package/dist/production/react-router-preset.d.ts +0 -45
  710. package/dist/production/react-router-preset.js +0 -11
  711. package/dist/react-router.d.ts +0 -75
  712. package/dist/vite/chunk-4O5OI3OO.js +0 -127
  713. package/dist/vite/chunk-FAQ7TVHC.js +0 -9
  714. package/dist/vite/chunk-QXBQVDMY.js +0 -68
  715. package/dist/vite/compat-date.d.ts +0 -3
  716. package/dist/vite/compat-date.js +0 -6
  717. package/dist/vite/get-virtual-routes.d.ts +0 -21
  718. package/dist/vite/get-virtual-routes.js +0 -74
  719. package/dist/vite/hydrogen-middleware.d.ts +0 -9
  720. package/dist/vite/hydrogen-middleware.js +0 -7
  721. package/dist/vite/plugin.d.ts +0 -22
  722. package/dist/vite/plugin.js +0 -171
  723. package/dist/vite/request-events.d.ts +0 -144
  724. package/dist/vite/request-events.js +0 -10
  725. package/dist/vite/types.d.ts +0 -5
  726. package/dist/vite/types.js +0 -0
  727. package/dist/vite/virtual-routes/assets/debug-network.css +0 -609
  728. package/dist/vite/virtual-routes/assets/favicon-dark.svg +0 -20
  729. package/dist/vite/virtual-routes/assets/favicon.svg +0 -28
  730. package/dist/vite/virtual-routes/assets/inter-variable-font.woff2 +0 -0
  731. package/dist/vite/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
  732. package/dist/vite/virtual-routes/assets/styles.css +0 -249
  733. package/dist/vite/virtual-routes/components/FlameChartWrapper.jsx +0 -123
  734. package/dist/vite/virtual-routes/components/HydrogenLogoBaseBW.jsx +0 -32
  735. package/dist/vite/virtual-routes/components/HydrogenLogoBaseColor.jsx +0 -47
  736. package/dist/vite/virtual-routes/components/IconBanner.jsx +0 -292
  737. package/dist/vite/virtual-routes/components/IconClose.jsx +0 -38
  738. package/dist/vite/virtual-routes/components/IconDiscard.jsx +0 -44
  739. package/dist/vite/virtual-routes/components/IconError.jsx +0 -61
  740. package/dist/vite/virtual-routes/components/IconGithub.jsx +0 -23
  741. package/dist/vite/virtual-routes/components/IconTwitter.jsx +0 -21
  742. package/dist/vite/virtual-routes/components/Layout.jsx +0 -7
  743. package/dist/vite/virtual-routes/components/RequestDetails.jsx +0 -171
  744. package/dist/vite/virtual-routes/components/RequestTable.jsx +0 -91
  745. package/dist/vite/virtual-routes/components/RequestWaterfall.jsx +0 -151
  746. package/dist/vite/virtual-routes/layout.jsx +0 -33
  747. package/dist/vite/virtual-routes/lib/useDebugNetworkServer.jsx +0 -178
  748. package/dist/vite/virtual-routes/routes/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx +0 -37
  749. package/dist/vite/virtual-routes/routes/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.tsx +0 -79
  750. package/dist/vite/virtual-routes/routes/graphiql.jsx +0 -5
  751. package/dist/vite/virtual-routes/routes/index.jsx +0 -265
  752. package/dist/vite/virtual-routes/routes/subrequest-profiler.jsx +0 -243
  753. package/dist/vite/virtual-routes/virtual-root-with-layout.jsx +0 -63
  754. package/dist/vite/virtual-routes/virtual-root.jsx +0 -67
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: hydrogen-markets
3
+ description: >
4
+ Guide for implementing Shopify Markets with Hydrogen. Use when adding
5
+ market routing, country/language localization, Shopify Markets, subdomains,
6
+ per-market domains, path-prefixed markets, Next.js App Router market routing,
7
+ or Storefront API @inContext wiring.
8
+ ---
9
+
10
+ # Markets
11
+
12
+ Markets are an application routing concern plus Storefront API context. Hydrogen does not prescribe how a storefront chooses a market. Use domains, subdomains, paths, cookies, buyer preferences, geolocation, or merchant config as needed.
13
+
14
+ The Hydrogen part is request-scoped `i18n` on `createShopifyRequestContext`. Resolve the market first, then create the request context with `i18n`. When a query declares `$country` and `$language` and uses `@inContext(country: $country, language: $language)`, the client injects those values from the resolved `i18n`.
15
+
16
+ If the storefront uses Next.js App Router, read `references/nextjs.md` before writing code. Server Components do not receive a full `Request`, so host-based and path-prefixed markets need Next-specific wiring.
17
+
18
+ ---
19
+
20
+ ## Core Rule
21
+
22
+ Add `i18n` where the app already creates its Shopify request context:
23
+
24
+ ```diff
25
+ import {
26
+ createStorefrontClient,
27
+ createShopifyRequestContext,
28
+ gql,
29
+ } from "@shopify/hydrogen";
30
+
31
+ const PRODUCTS_PAGE_SIZE = 12;
32
+
33
+ const PRODUCTS_QUERY = gql(`
34
+ - query Products($first: Int!) {
35
+ + query Products($first: Int!, $country: CountryCode, $language: LanguageCode)
36
+ + @inContext(country: $country, language: $language) {
37
+ products(first: $first) {
38
+ nodes {
39
+ title
40
+ }
41
+ }
42
+ }
43
+ `);
44
+
45
+ export async function loadProducts(request: Request) {
46
+ - const requestContext = createShopifyRequestContext({
47
+ - request,
48
+ - i18n: DEFAULT_MARKET,
49
+ - });
50
+ + const i18n = getMarketFromRequest(request);
51
+ + const requestContext = createShopifyRequestContext({
52
+ + request,
53
+ + i18n,
54
+ + });
55
+
56
+ const client = createStorefrontClient({
57
+ type: "public",
58
+ requestContext,
59
+ config: {
60
+ storeDomain: process.env.PUBLIC_STORE_DOMAIN!,
61
+ publicStorefrontToken: process.env.PUBLIC_STOREFRONT_API_TOKEN!,
62
+ },
63
+ });
64
+
65
+ return client.graphql(PRODUCTS_QUERY, {
66
+ variables: { first: PRODUCTS_PAGE_SIZE },
67
+ });
68
+ }
69
+ ```
70
+
71
+ Do not pass `country` or `language` in every query call. Resolve the market once at the request boundary, set `i18n` when creating the request context, and let the client inject the context variables into queries that declare them.
72
+
73
+ The returned Storefront client exposes the resolved locale as `client.i18n`. Use `client.i18n.pathPrefix` when app route helpers need to prepend a market path; Hydrogen normalizes it to `""` or a leading-slash prefix with no trailing slash.
74
+
75
+ ---
76
+
77
+ ## Market Shape
78
+
79
+ Keep the resolver small and explicit. The Storefront API expects uppercase enum values like `US`, `CA`, `EN`, and `FR`.
80
+
81
+ ```ts
82
+ type Market = {
83
+ country: string;
84
+ language: string;
85
+ pathPrefix?: string;
86
+ };
87
+
88
+ const DEFAULT_MARKET = {
89
+ country: "US",
90
+ language: "EN",
91
+ } satisfies Market;
92
+ ```
93
+
94
+ If the app needs labels or alternate domains, keep those as application fields. `country` and `language` are required in `i18n`; `pathPrefix` is optional on input and is normalized on the request context to `""` or a leading-slash prefix with no trailing slash.
95
+
96
+ ---
97
+
98
+ ## Subdomains
99
+
100
+ Use this when each market lives under one storefront domain, like `ca.example.com` or `fr.example.com`.
101
+
102
+ ```ts
103
+ const MARKET_BY_SUBDOMAIN = {
104
+ ca: { country: "CA", language: "EN" },
105
+ fr: { country: "FR", language: "FR" },
106
+ } satisfies Record<string, Market>;
107
+
108
+ export function getMarketFromRequest(request: Request): Market {
109
+ const { hostname } = new URL(request.url);
110
+ const [subdomain] = hostname.toLowerCase().split(".");
111
+
112
+ return MARKET_BY_SUBDOMAIN[subdomain] ?? DEFAULT_MARKET;
113
+ }
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Per-Market Domains
119
+
120
+ Use this when markets have separate buyer-facing domains, like `example.com`, `example.ca`, and `example.fr`.
121
+
122
+ ```ts
123
+ const MARKET_BY_HOST = {
124
+ "example.com": { country: "US", language: "EN" },
125
+ "example.ca": { country: "CA", language: "EN" },
126
+ "example.fr": { country: "FR", language: "FR" },
127
+ } satisfies Record<string, Market>;
128
+
129
+ export function getMarketFromRequest(request: Request): Market {
130
+ const { hostname } = new URL(request.url);
131
+ const host = hostname.toLowerCase();
132
+
133
+ return MARKET_BY_HOST[host] ?? DEFAULT_MARKET;
134
+ }
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Path Prefixes
140
+
141
+ Use this when markets share one domain and the market is encoded in the pathname, like `/en-ca/products/shirt` or `/fr-fr/products/shirt`.
142
+
143
+ ```ts
144
+ type PathMarket = Market & {
145
+ pathPrefix: string;
146
+ };
147
+
148
+ const FIRST_PATH_SEGMENT_INDEX = 0;
149
+
150
+ const MARKET_BY_PATH_PREFIX = {
151
+ "en-ca": { country: "CA", language: "EN", pathPrefix: "/en-ca" },
152
+ "fr-fr": { country: "FR", language: "FR", pathPrefix: "/fr-fr" },
153
+ } satisfies Record<string, PathMarket>;
154
+
155
+ function getFirstPathSegment(pathname: string): string | undefined {
156
+ return pathname.split("/").filter(Boolean)[FIRST_PATH_SEGMENT_INDEX];
157
+ }
158
+
159
+ export function getMarketFromRequest(request: Request): PathMarket | Market {
160
+ const { pathname } = new URL(request.url);
161
+ const pathPrefix = getFirstPathSegment(pathname);
162
+
163
+ if (!pathPrefix) return DEFAULT_MARKET;
164
+
165
+ return MARKET_BY_PATH_PREFIX[pathPrefix.toLowerCase()] ?? DEFAULT_MARKET;
166
+ }
167
+
168
+ export function localizePath(pathname: string, market: PathMarket | Market): string {
169
+ if (!("pathPrefix" in market)) return pathname;
170
+
171
+ const normalizedPathname = pathname.replace(/^\/+/, "");
172
+ return `${market.pathPrefix}/${normalizedPathname}`;
173
+ }
174
+ ```
175
+
176
+ The router should strip or interpret the prefix before matching product and collection routes. Hydrogen's Storefront API variable injection uses `country` and `language`; `pathPrefix` is carried as a leading-slash app route prefix for helpers.
177
+
178
+ When the app uses custom Shopify resource paths, use the local `hydrogen-routing` skill. Keep market prefixes in `i18n.pathPrefix`, not in route template values.
179
+
180
+ ---
181
+
182
+ ## Framework Exceptions
183
+
184
+ Read the relevant reference before applying the generic `Request` examples in frameworks that do not expose the full incoming request to server code.
185
+
186
+ - **Next.js App Router** — read `references/nextjs.md` first. Server Components can read `headers()` and route `params`, but not the current URL or a standard `Request`; host-based markets, path-prefix markets, and raw URL fallback each need different wiring.
187
+
188
+ ---
189
+
190
+ ## Rules
191
+
192
+ - **Use whatever market strategy fits the store.** Hydrogen should not force domains, subdomains, pathnames, or detection policy.
193
+ - **Resolve the market on the server from a standard `Request`.** `new URL(request.url)` is enough for host and path strategies.
194
+ - **Use request-context `i18n` as the Storefront API boundary.** Prefer `createShopifyRequestContext({ request, i18n })`. Always provide a default market rather than letting it be undefined.
195
+ - **Use market-contextualized queries.** The Storefront client injects `country` and `language` variable values when the document declares `$country` and `$language`; it does not rewrite query text. Market-sensitive queries still need `@inContext(country: $country, language: $language)` or equivalent Storefront API context in the document.
196
+ - **Do not calculate currency locally.** Render `amount` and `currencyCode` returned by Shopify and format them with the local `hydrogen-money` skill's `formatMoney()` guidance.
197
+ - **Keep ShopifyScripts in the same market.** When the app renders Shopify browser runtime scripts, pass the resolved `country` and `language` into `ShopifyScripts` i18n so Shopify globals match Storefront API context.
198
+ - **Keep route templates prefix-free.** When route templates are configured, pass market prefixes through `i18n.pathPrefix`; do not bake prefixes such as `/en-ca` into template values.
199
+ - **Keep translations separate.** Shopify Markets context localizes Shopify data. Application UI strings still need the app's translation system.
200
+ - **Treat geolocation as a hint, not truth.** Buyers travel, use VPNs, and intentionally choose markets. Persist explicit choices when the app supports switching.
201
+ - **Ask before choosing the strategy.** If the app does not already make market selection clear, ask whether domains, subdomains, path prefixes, cookies, buyer preference, geolocation, or merchant config should own it before writing code.
202
+
203
+ ---
204
+
205
+ ## Testing
206
+
207
+ Test market resolution with plain `Request` objects. You do not need a framework test harness.
208
+
209
+ ```ts
210
+ import { describe, expect, it } from "vitest";
211
+
212
+ describe("getMarketFromRequest", () => {
213
+ it("resolves a subdomain market", () => {
214
+ const request = new Request("https://ca.example.com/products/shirt");
215
+
216
+ expect(getMarketFromRequest(request)).toEqual({ country: "CA", language: "EN" });
217
+ });
218
+ });
219
+ ```
220
+
221
+ Also test at least one Storefront API call through a mocked fetch and assert the GraphQL variables include the expected `country` and `language` when the query declares them.
@@ -0,0 +1,157 @@
1
+ # Next.js App Router
2
+
3
+ ## Contents
4
+
5
+ - Host-Based Markets
6
+ - Path-Prefix Markets
7
+ - Raw URL Fallback
8
+
9
+ Next.js App Router Server Components do not receive a standard `Request` object or direct access to the current URL. Use the source that matches the market strategy:
10
+
11
+ - Host or subdomain markets: read the URL from Hydrogen's request context when the app proxy forwards it.
12
+ - Path-prefix markets: model the market as a route segment, such as `app/[market]/products/[handle]/page.tsx`, and read it from `params`.
13
+ - Raw URL markets: use a request-context handoff in `proxy.ts`; do not invent a second URL header.
14
+
15
+ ---
16
+
17
+ ## Host-Based Markets
18
+
19
+ Use this for domain or subdomain routing, like `example.ca`, `fr.example.com`, or `ca.example.com`.
20
+
21
+ `proxy.ts` creates a request context from the `NextRequest`, forwards `requestContext.getForwardedRequestHeaders()`, and Server Components recreate the request context from `headers()`. That handoff includes the original URL.
22
+
23
+ ```ts
24
+ // lib/markets.ts
25
+ type Market = {
26
+ country: string;
27
+ language: string;
28
+ pathPrefix?: string;
29
+ };
30
+
31
+ const DEFAULT_MARKET = {
32
+ country: "US",
33
+ language: "EN",
34
+ } satisfies Market;
35
+
36
+ const MARKET_BY_HOST = {
37
+ "example.com": { country: "US", language: "EN" },
38
+ "example.ca": { country: "CA", language: "EN" },
39
+ "fr.example.com": { country: "FR", language: "FR" },
40
+ } satisfies Record<string, Market>;
41
+
42
+ export function getMarketFromHeaders(headers: Pick<Headers, "get">): Market {
43
+ const forwardedUrl = headers.get("x-storefront-url");
44
+ if (!forwardedUrl) return DEFAULT_MARKET;
45
+
46
+ const { hostname } = new URL(forwardedUrl);
47
+ const host = hostname.toLowerCase();
48
+
49
+ return MARKET_BY_HOST[host] ?? DEFAULT_MARKET;
50
+ }
51
+ ```
52
+
53
+ Use an allowlist like `MARKET_BY_HOST`; do not blindly trust request hosts for anything security-sensitive.
54
+
55
+ ```ts
56
+ // lib/storefront.ts
57
+ import "server-only";
58
+ import {
59
+ createStorefrontClient,
60
+ createShopifyRequestContext,
61
+ } from "@shopify/hydrogen";
62
+ import { headers } from "next/headers";
63
+ import { cache } from "react";
64
+
65
+ import { storefrontConfig } from "./config";
66
+ import { getMarketFromHeaders } from "./markets";
67
+
68
+ export const getStorefrontClient = cache(async () => {
69
+ const requestHeaders = await headers();
70
+ const request = { headers: requestHeaders };
71
+ const requestContext = createShopifyRequestContext({
72
+ request,
73
+ i18n: getMarketFromHeaders(requestHeaders),
74
+ });
75
+
76
+ return createStorefrontClient({
77
+ type: "public",
78
+ requestContext,
79
+ config: {
80
+ storeDomain: storefrontConfig.storeDomain,
81
+ publicStorefrontToken: storefrontConfig.publicStorefrontToken,
82
+ },
83
+ });
84
+ });
85
+ ```
86
+
87
+ `headers()` is a request-time API, so pages using this helper are dynamically rendered.
88
+
89
+ ---
90
+
91
+ ## Path-Prefix Markets
92
+
93
+ Use this for routes like `/en-ca/products/shirt` or `/fr-fr/products/shirt`. Model the market prefix as a route segment so Server Components can read it from `params` without `headers()`.
94
+
95
+ ```ts
96
+ // lib/path-markets.ts
97
+ type Market = {
98
+ country: string;
99
+ language: string;
100
+ pathPrefix?: string;
101
+ };
102
+
103
+ const DEFAULT_MARKET = {
104
+ country: "US",
105
+ language: "EN",
106
+ } satisfies Market;
107
+
108
+ const MARKET_BY_PARAM = {
109
+ "en-ca": { country: "CA", language: "EN", pathPrefix: "/en-ca" },
110
+ "fr-fr": { country: "FR", language: "FR", pathPrefix: "/fr-fr" },
111
+ } satisfies Record<string, Market>;
112
+
113
+ export function getMarketFromParam(marketParam: string): Market {
114
+ return MARKET_BY_PARAM[marketParam.toLowerCase()] ?? DEFAULT_MARKET;
115
+ }
116
+ ```
117
+
118
+ For static or ISR-cached pages, use a `private_no_buyer_context` client and pass the market from route params. The page can be prerendered when the route uses `generateStaticParams` and does not call request-time APIs like `headers()` or `cookies()`.
119
+
120
+ ```ts
121
+ // lib/static-storefront.ts
122
+ import { createStorefrontClient, createShopifyRequestContext } from "@shopify/hydrogen";
123
+
124
+ import { getMarketFromParam } from "./path-markets";
125
+
126
+ export function createStaticStorefrontClient(marketParam: string) {
127
+ const requestContext = createShopifyRequestContext({
128
+ request: { headers: new Headers() },
129
+ i18n: getMarketFromParam(marketParam),
130
+ });
131
+
132
+ return createStorefrontClient({
133
+ type: "private_no_buyer_context",
134
+ requestContext,
135
+ config: {
136
+ storeDomain: process.env.NEXT_PUBLIC_STORE_DOMAIN!,
137
+ privateStorefrontToken: process.env.PRIVATE_STOREFRONT_API_TOKEN!,
138
+ },
139
+ });
140
+ }
141
+ ```
142
+
143
+ Use the query shape from `SKILL.md`: declare `$country` and `$language`, use `@inContext`, and let the client inject the market variables. Use the private client with trusted buyer context instead when the page needs buyer-specific headers, cookies, or personalized data. That path becomes dynamic because it must read request-time data.
144
+
145
+ ---
146
+
147
+ ## Raw URL Fallback
148
+
149
+ Use raw URLs only when host headers or route params cannot represent the market, usually with rewrites or catch-all route setups.
150
+
151
+ Use this proxy handoff:
152
+
153
+ - In `proxy.ts`, create a request context from the `NextRequest`.
154
+ - Forward `requestContext.getForwardedRequestHeaders()` through `NextResponse.next({ request: { headers } })`.
155
+ - In Server Components, recreate a request-like object with `request: { headers: await headers() }`, resolve the market from the forwarded URL header, then create the client request context with that `i18n`.
156
+
157
+ `createShopifyRequestContext` already persists the URL through `x-storefront-url`, so do not set a parallel URL header unless the app cannot use the proxy handoff.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: hydrogen-money
3
+ description: >
4
+ Guide for formatting Shopify money values in Hydrogen storefronts. Use when
5
+ rendering product prices, compare-at prices, cart totals, collection price
6
+ ranges, Shop Pay prices, or any MoneyV2 amount/currencyCode values.
7
+ ---
8
+
9
+ # Money Formatting
10
+
11
+ Use Hydrogen's `formatMoney()` for Storefront API `MoneyV2` values. Never build money strings by concatenating currency symbols or computing totals client-side.
12
+
13
+ ```ts
14
+ import { formatMoney, type MoneyV2 } from "@shopify/hydrogen";
15
+
16
+ // `locale` should come from the resolved market. Default only in
17
+ // single-market storefronts; market-aware stores must pass the active locale.
18
+ export function formatPrice(money: MoneyV2, locale = "en-US"): string {
19
+ return formatMoney(money, { locale }).toString();
20
+ }
21
+ ```
22
+
23
+ ## Rules
24
+
25
+ - Display server-provided money fields: `variant.price`, `variant.compareAtPrice`, `product.priceRange.minVariantPrice`, `line.cost.totalAmount`, `cart.cost.subtotalAmount`, etc.
26
+ - Do not multiply quantity by unit price in the browser. Cart totals are affected by discounts, duties, tax, rounding, and selling plans.
27
+ - Use the active market locale when the app has markets. Do not hardcode `en-US` in market-aware storefronts.
28
+ - Prefer a small app wrapper such as `formatPrice()` so locale and display options are consistent.
29
+ - Use `withoutTrailingZeros` only for presentation choices, never by editing amount strings manually.
30
+ - For price ranges, pass a readonly array of `MoneyV2` values to `formatMoney([...])`.
31
+
32
+ ## Structured Output
33
+
34
+ `formatMoney()` returns an object that stringifies to the localized price. Use
35
+ `toString()` or template literals for normal UI. Call `formatMoney()` directly
36
+ or add an object-returning wrapper when the design needs split markup:
37
+
38
+ - `localizedString` - full display string, same as `toString()`.
39
+ - `amount` - localized numeric portion without currency.
40
+ - `numericAmount` - parsed number; do not use for cart totals or currency math.
41
+ - `currencySymbol`, `currencyNarrowSymbol`, `currencyName` - currency display variants.
42
+ - `parts` - `Intl.NumberFormatPart[]` for custom markup.
43
+ - `withoutTrailingZeros`, `withoutTrailingZerosAndCurrency` - presentation-only variants.
44
+
45
+ For ranges, `formatMoney([min, max], options)` returns an object that stringifies
46
+ to the localized range and exposes `min`, `max`, and `currencyCode`. Range
47
+ inputs must share one currency.
48
+
49
+ ## Examples
50
+
51
+ ```tsx
52
+ <p>{formatPrice(selectedVariant?.price ?? product.priceRange.minVariantPrice, locale)}</p>
53
+ ```
54
+
55
+ ```ts
56
+ const range = formatMoney(
57
+ [product.priceRange.minVariantPrice, product.priceRange.maxVariantPrice],
58
+ { locale, withoutTrailingZeros: true },
59
+ ).toString();
60
+ ```
61
+
62
+ ## Anti-Patterns
63
+
64
+ - `"$" + amount`
65
+ - `Number(amount).toFixed(2)`
66
+ - `line.quantity * Number(line.merchandise.price.amount)`
67
+ - Showing cart totals at full opacity while a related cart mutation is pending.
@@ -0,0 +1,245 @@
1
+ ---
2
+ name: hydrogen-oxygen
3
+ description: >
4
+ Audit and adapt an existing Hydrogen storefront for Shopify Oxygen and local MiniOxygen. Use when asked to make a
5
+ server-capable Hydrogen project Oxygen-compatible, add or repair its Worker server entrypoint, configure MiniOxygen,
6
+ remove Node runtime assumptions, wire Worker environment, cache, and waitUntil, or verify dev, preview, and deploy
7
+ behavior.
8
+ ---
9
+
10
+ # Making A Hydrogen App Oxygen-Compatible
11
+
12
+ Treat Oxygen as a Web Worker runtime, not a Node server. Preserve the app's routes and storefront behavior while
13
+ adapting its server runtime, build output, and request lifecycle.
14
+
15
+ Master checklist:
16
+
17
+ ```text
18
+ - [ ] Inspect the framework, server entrypoint, and build target
19
+ - [ ] Read the matching framework reference when available
20
+ - [ ] Produce an Oxygen-compatible module Worker at `<root>/server.ts` or configure its custom path
21
+ - [ ] Produce one server bundle and a public assets directory
22
+ - [ ] Run the Worker locally with MiniOxygen
23
+ - [ ] Thread env, cache, and waitUntil through each request
24
+ - [ ] Create request-dependent Shopify resources per request
25
+ - [ ] Remove Node-only runtime assumptions
26
+ - [ ] Typecheck and build
27
+ - [ ] Exercise dynamic routes in dev and preview
28
+ - [ ] Run Hydrogen smoke tests
29
+ ```
30
+
31
+ ## Inspect The App
32
+
33
+ Run from the app root. Read `package.json`, framework and bundler configuration, server and client entries, SSR setup,
34
+ request middleware, environment declarations, deployment scripts, and the existing production adapter. If there is no
35
+ `package.json`, stop and tell the user to run the skill from the app root.
36
+
37
+ Identify how the framework:
38
+
39
+ - turns an incoming Web `Request` into the app's request handler
40
+ - renders SSR responses and hydrates the browser
41
+ - passes request-scoped context to loaders, middleware, or server functions
42
+ - builds and selects its server entrypoint
43
+ - serves static assets alongside dynamic Worker responses
44
+
45
+ Read [references/react-router.md](references/react-router.md) for a React Router framework-mode app. For another
46
+ framework, apply the generic Oxygen contract below through its Worker adapter and existing conventions. Do not copy
47
+ React Router filenames or APIs into another framework. If no Worker adapter or build target exists, identify that gap
48
+ explicitly before changing application code.
49
+
50
+ ## Preserve App Behavior
51
+
52
+ Keep existing routes, middleware, cart, customer accounts, analytics, search, redirects, cookies, and response headers
53
+ unless the user explicitly asks to remove them. Reuse the app's context and middleware architecture where possible. Do
54
+ not replace the app with a starter or rewrite framework-owned routing merely to change runtimes.
55
+
56
+ Keep route-template wiring used by `handleShopifyRedirects`, Shopify scripts, and predictive search. Oxygen compatibility
57
+ does not make those routes optional.
58
+
59
+ ## Implement The Oxygen Worker Contract
60
+
61
+ Use `<root>/server.ts` as the default Worker entrypoint. Oxygen and MiniOxygen discover that path without extra
62
+ configuration. If the entrypoint lives elsewhere, configure the same project-relative path everywhere it is consumed:
63
+
64
+ - pass `entry` to MiniOxygen, for example `oxygen({ entry: "./src/worker.ts" })`
65
+ - pass `--entry ./src/worker.ts` to Shopify Hydrogen CLI commands that run or deploy the Worker
66
+
67
+ Do not rely on a framework's server-file convention to make a custom entrypoint discoverable by Oxygen.
68
+
69
+ Produce a module Worker whose default export handles requests with the platform values Oxygen provides:
70
+
71
+ ```ts
72
+ export default {
73
+ async fetch(request: Request, env: Env, executionContext: ExecutionContext) {
74
+ const waitUntil = executionContext.waitUntil.bind(executionContext);
75
+ const cache = await caches.open("hydrogen");
76
+
77
+ return handleRequest(request, { env, waitUntil, cache });
78
+ },
79
+ };
80
+ ```
81
+
82
+ Adapt `handleRequest` and the context shape to the framework. The server build must bundle this entry as a Web-compatible
83
+ module Worker and return a standard `Response`. Use Web APIs such as `Request`, `Response`, `Headers`, `URL`, `fetch`,
84
+ Web Crypto, and Web streams throughout runtime code.
85
+
86
+ Keep server rendering Web-compatible. Use the framework's Worker renderer or Web-stream renderer instead of a Node
87
+ stream renderer. Add or change a browser hydration entry only when the framework requires it; see the matching reference
88
+ for exact entry files.
89
+
90
+ ## Configure MiniOxygen And Deployment
91
+
92
+ Use MiniOxygen to run the same Worker contract locally. For a Vite app:
93
+
94
+ - preserve an existing compatible `@shopify/mini-oxygen` version; otherwise install the latest available version
95
+ - add `@shopify/oxygen-workers-types`
96
+ - add `oxygen()` from `@shopify/mini-oxygen/vite` to the Vite plugins
97
+ - make both development and built preview modes execute the Worker entrypoint
98
+
99
+ Require MiniOxygen 4.2.0 or newer for the behavior described here. Do not replace a compatible existing version merely
100
+ to change its version range.
101
+
102
+ Use plain `oxygen()` when the app uses `<root>/server.ts` and does not need explicit binding configuration; MiniOxygen
103
+ uses Vite's environment loading when no `env` option is provided. Values can come from the active mode's `.env` files
104
+ and from variables already exported into `process.env`; Vite merges both sources. Worker runtime code receives the
105
+ result through its `env` argument rather than reading `process.env`. Otherwise pass the custom `entry` or bindings
106
+ explicitly. For a non-Vite build, use the framework's Worker adapter or MiniOxygen integration instead of introducing
107
+ Vite only to copy another framework's setup.
108
+
109
+ Add `@shopify/cli` and a `shopify hydrogen deploy` script when the project does not already have a supported Oxygen
110
+ deployment path. Use the latest available `@shopify/cli`. Preserve the installed `@shopify/hydrogen` version unless the
111
+ user separately asks to upgrade it.
112
+
113
+ ## Produce Deployable Build Output
114
+
115
+ Build two deployable outputs:
116
+
117
+ - one bundled Worker server module
118
+ - one directory containing public client assets
119
+
120
+ Configure the server build to avoid code splitting. Oxygen expects a single executable Worker bundle rather than a
121
+ server entry that depends on additional server chunks.
122
+
123
+ ### Default Vite Layout
124
+
125
+ For the common Vite setup with `<root>/server.ts`, let the Oxygen plugin detect output locations from Vite
126
+ configuration. `vite preview` and `shopify hydrogen deploy` generally need no `previewEntry`, `--assets-dir`, or
127
+ `--worker-dir` overrides. When Vite does not expose custom locations, Oxygen prefers this fallback layout:
128
+
129
+ ```text
130
+ dist/
131
+ ├── client/
132
+ └── server/
133
+ └── index.js
134
+ ```
135
+
136
+ The Worker file may use `.js` or `.mjs`. A build may also emit `oxygen.json` beside the Worker as a compatibility-date
137
+ artifact; preserve and deploy it with the server output.
138
+
139
+ ### Custom Or Non-Default Layout
140
+
141
+ Only add explicit output configuration when the framework emits a layout that Oxygen or MiniOxygen does not discover:
142
+
143
+ - pass the built Worker file to MiniOxygen as `previewEntry` so `vite preview` executes it
144
+ - pass the asset directory to deployment with `--assets-dir <path>`
145
+ - pass the Worker directory to deployment with `--worker-dir <path>`
146
+
147
+ For example:
148
+
149
+ ```ts
150
+ oxygen({
151
+ entry: "./src/worker.ts",
152
+ previewEntry: "./build/server/index.mjs",
153
+ });
154
+ ```
155
+
156
+ ```sh
157
+ shopify hydrogen deploy --assets-dir ./build/client --worker-dir ./build/server
158
+ ```
159
+
160
+ Treat `entry` and `previewEntry` as different stages: `entry` points to the source Worker used during development;
161
+ `previewEntry` points to the built Worker module. The directory passed to `--worker-dir` must contain `index.js` or
162
+ `index.mjs` at its root. Pass directories, not individual files, to `--assets-dir` and `--worker-dir`.
163
+
164
+ ## Keep Request State Request-Scoped
165
+
166
+ Pass the incoming `env`, bound `waitUntil`, and an Oxygen cache through the framework's request context. Pass `cache`
167
+ and `waitUntil` together in the Hydrogen client config:
168
+
169
+ ```ts
170
+ createStorefrontClient({
171
+ // Existing client options...
172
+ config: {
173
+ // Existing config options...
174
+ cache,
175
+ waitUntil,
176
+ },
177
+ });
178
+ ```
179
+
180
+ The `Cache` returned by `caches.open("hydrogen")` is accepted directly by Hydrogen clients. Remove custom cache
181
+ adapters and process-local cache dependencies such as `lru-cache`; do not wrap the Workers cache in an adapter.
182
+ `waitUntil` lets background cache revalidation continue after the response has been returned, so pass the bound
183
+ function whenever the platform provides it.
184
+
185
+ Create values that depend on the request, environment, headers, locale, session, or response headers inside the request
186
+ lifecycle, including:
187
+
188
+ - `createShopifyRequestContext(...)`
189
+ - `createStorefrontClient(...)`
190
+ - `createCustomerAccountClient(...)`
191
+ - cart and customer session managers
192
+ - request-specific response header collections
193
+
194
+ Keep only pure constants and stateless factories at module scope. Use `caches.open("hydrogen")` instead of a process-local
195
+ LRU cache for Hydrogen request caching, and use `executionContext.waitUntil` for background cache work.
196
+
197
+ ## Configure Environment And Types
198
+
199
+ Declare the Worker's actual `Env` bindings and include `@shopify/oxygen-workers-types` in app runtime types. Keep
200
+ `.env.example` committed with placeholders and `.env` ignored. Let Oxygen provide deployed secrets as environment
201
+ bindings and MiniOxygen provide local bindings.
202
+
203
+ Read server secrets from the request's `env`, never from `process.env` or browser-importable modules. Keep public browser
204
+ configuration separate from private Worker bindings. Start from the existing TypeScript config rather than replacing it;
205
+ retain Node types where build tooling genuinely needs them. Node and Worker types can usually coexist when one TypeScript
206
+ program includes both Worker runtime code and Vite or build files. If their globals conflict, use separate runtime and
207
+ build-tool tsconfigs instead of masking the conflict with `skipLibCheck`.
208
+
209
+ ## Remove Incompatible Runtime Assumptions
210
+
211
+ Inspect server runtime code for:
212
+
213
+ - `process`, `Buffer`, `node:*`, filesystem, and Node crypto APIs
214
+ - Node streams and Node-specific SSR renderers
215
+ - framework Node server adapters and start commands
216
+ - CommonJS globals or dependencies that require `module` or `require` at runtime
217
+ - in-memory caches used in place of the Workers Cache API
218
+ - classic Hydrogen runtime or Vite integrations
219
+
220
+ Replace each runtime dependency with a Web API or the framework's Worker adapter. Do not mechanically remove packages
221
+ used only by build configuration, tests, or transitive dependencies.
222
+
223
+ ## Verify The Result
224
+
225
+ Run the applicable formatter, lint, typecheck, GraphQL validation, tests, and production build. Run both development and
226
+ built preview modes under MiniOxygen, then request routes that exercise server rendering and Hydrogen data rather than
227
+ only static assets.
228
+
229
+ At minimum, check `/`, one product, one collection, `/search`, `/cart`, and `/account` when those routes exist. Confirm
230
+ environment bindings load, dynamic responses come from the Worker, mutations preserve cookies and headers, cache work
231
+ uses `waitUntil`, and no Node or CommonJS runtime error appears. A server starting is not sufficient evidence that the
232
+ Worker request path works.
233
+
234
+ Use the local `hydrogen-smoke-test` skill for broader Hydrogen request-handler, cart, analytics, markets, and production
235
+ checks. Exercise mutations through the real cart UI or the framework's cart action rather than hand-crafting an internal
236
+ Hydrogen payload; follow that skill for the concrete cookie and header checks. Fix failures and rerun the affected checks.
237
+ Report every validation step that could not be completed and why.
238
+
239
+ ## Stop Conditions
240
+
241
+ - No `package.json` exists at the current app root.
242
+ - The app is static-only and has no server request lifecycle to deploy.
243
+ - The framework cannot produce a module Worker and no suitable adapter or server-build hook is available.
244
+ - Required production secrets are unavailable for live route verification; complete static/build verification and
245
+ report runtime checks as blocked instead of inventing values.