@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,237 @@
1
+ # React And React Router
2
+
3
+ ## Contents
4
+
5
+ - Loader
6
+ - Provider
7
+ - Browse Form
8
+ - Filters
9
+ - Search Pages
10
+
11
+ Use the React binding:
12
+
13
+ ```tsx
14
+ import {
15
+ getFilterRemovalUrl,
16
+ getSortByValue,
17
+ isFilterInputActive,
18
+ parseCollectionParams,
19
+ serializeCollectionParams,
20
+ type AvailableFilter,
21
+ type CollectionState,
22
+ type ProductFilter,
23
+ } from "@shopify/hydrogen";
24
+ import { CollectionProvider, useCollection, useCollectionForm } from "@shopify/hydrogen/react";
25
+ import type { ProductFilter as StorefrontApiProductFilter } from "@shopify/hydrogen/storefront-api-types";
26
+ ```
27
+
28
+ Use `getSortByValue(...)` for option values so the `sort_by` query param round-trips through `parseCollectionParams()`:
29
+
30
+ ```ts
31
+ const COLLECTION_SORT_OPTIONS = [
32
+ { label: "Featured", value: getSortByValue("COLLECTION_DEFAULT", false) },
33
+ { label: "Best selling", value: getSortByValue("BEST_SELLING", false) },
34
+ { label: "Alphabetically, A-Z", value: getSortByValue("TITLE", false) },
35
+ { label: "Alphabetically, Z-A", value: getSortByValue("TITLE", true) },
36
+ { label: "Price, low to high", value: getSortByValue("PRICE", false) },
37
+ { label: "Price, high to low", value: getSortByValue("PRICE", true) },
38
+ { label: "Date, old to new", value: getSortByValue("CREATED", false) },
39
+ { label: "Date, new to old", value: getSortByValue("CREATED", true) },
40
+ ];
41
+
42
+ const SEARCH_SORT_OPTIONS = [
43
+ { label: "Relevance", value: getSortByValue("RELEVANCE", false) },
44
+ { label: "Price, low to high", value: getSortByValue("PRICE", false) },
45
+ { label: "Price, high to low", value: getSortByValue("PRICE", true) },
46
+ ];
47
+ ```
48
+
49
+ ## Loader
50
+
51
+ In a route loader, parse the current URL and query the Storefront API with the parsed browse state:
52
+
53
+ ```ts
54
+ export async function loader({ context, params, request }: Route.LoaderArgs) {
55
+ const storefrontClient = context.get(storefrontClientContext);
56
+ const url = new URL(request.url);
57
+ const browse = parseCollectionParams(url.searchParams);
58
+
59
+ const { data } = await storefrontClient.graphql(COLLECTION_QUERY, {
60
+ variables: {
61
+ handle: params.handle,
62
+ first: 24,
63
+ filters:
64
+ browse.filters.length > 0 ? (browse.filters as StorefrontApiProductFilter[]) : undefined,
65
+ sortKey: browse.sortKey,
66
+ reverse: browse.reverse || undefined,
67
+ },
68
+ });
69
+
70
+ if (!data?.collection) throw new Response("Collection not found", { status: 404 });
71
+
72
+ return {
73
+ collection: data.collection,
74
+ products: data.collection.products.nodes,
75
+ availableFilters: data.collection.products.filters,
76
+ dataSearch: url.searchParams.toString(),
77
+ };
78
+ }
79
+ ```
80
+
81
+ Keep `dataSearch` exactly aligned with the query used for the server data.
82
+
83
+ ## Provider
84
+
85
+ Wrap the browse UI in `CollectionProvider` and let it own filter/sort intent:
86
+
87
+ ```tsx
88
+ export default function CollectionRoute({ loaderData }: Route.ComponentProps) {
89
+ const navigate = useNavigate();
90
+ const [searchParams] = useSearchParams();
91
+
92
+ return (
93
+ <CollectionProvider
94
+ data={{ handle: loaderData.collection.handle, dataSearch: loaderData.dataSearch }}
95
+ urlSearch={searchParams.toString()}
96
+ onChange={(search) =>
97
+ navigate(
98
+ { search },
99
+ {
100
+ replace: searchParams.size > 0,
101
+ preventScrollReset: true,
102
+ },
103
+ )
104
+ }
105
+ >
106
+ <CollectionPage {...loaderData} />
107
+ </CollectionProvider>
108
+ );
109
+ }
110
+ ```
111
+
112
+ ## Browse Form
113
+
114
+ Inside the browse UI:
115
+
116
+ ```tsx
117
+ function CollectionPage({ availableFilters, products }: Props) {
118
+ const state = useCollection();
119
+ const { formProps } = useCollectionForm();
120
+ const isLoading = state.status === "loading";
121
+
122
+ return (
123
+ <form {...formProps()} method="get" action={collectionPath} className="browse">
124
+ <FilterSidebar
125
+ availableFilters={availableFilters}
126
+ activeFilters={state.filters}
127
+ disabled={isLoading}
128
+ />
129
+ <select name="sort_by" defaultValue={currentSortValue(state)} onChange={requestFormSubmit}>
130
+ {COLLECTION_SORT_OPTIONS.map((option) => (
131
+ <option key={option.label} value={option.value}>
132
+ {option.label}
133
+ </option>
134
+ ))}
135
+ </select>
136
+ <ProductGrid products={products} pending={isLoading} />
137
+ </form>
138
+ );
139
+ }
140
+
141
+ function requestFormSubmit(event: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) {
142
+ event.currentTarget.form?.requestSubmit();
143
+ }
144
+ ```
145
+
146
+ Pass `method="get"` and an explicit `action={collectionPath}` (the current `/collections/:handle` or `/search` route URL) literally — `formProps()` only wires the submit handler (see the SKILL.md UI rule).
147
+
148
+ Use uncontrolled form controls. When a route needs to remount checkboxes after external navigation, put `key={serializeCollectionParams({ filters: state.filters, sortKey: undefined, reverse: false }).toString()}` on the filter subtree (for search, include the term in the key) — keyed by serialized **filter state**, not the live URL. The URL clears before the `CollectionProvider` reconciler settles `state.filters`, so a URL-keyed remount bakes in stale `defaultChecked`. This resets checkbox DOM state without coupling active filter chips to the form remount.
149
+
150
+ ## Filters
151
+
152
+ For each Storefront `FilterValue`, treat `value.input` as the canonical JSON-encoded `ProductFilter`. Convert it to checkbox params by parsing the JSON, wrapping it in the minimal collection state shape, and calling `serializeCollectionParams(...)`. Use Hydrogen helpers for active checks:
153
+
154
+ ```tsx
155
+ function filterValueInputParamEntries(input: string): Array<{ name: string; value: string }> {
156
+ let filter: ProductFilter;
157
+ try {
158
+ filter = JSON.parse(input) as ProductFilter;
159
+ } catch {
160
+ return [];
161
+ }
162
+
163
+ return Array.from(
164
+ serializeCollectionParams({ filters: [filter], sortKey: undefined, reverse: false }),
165
+ ([name, value]) => ({ name, value }),
166
+ );
167
+ }
168
+
169
+ function FilterValueInput({ activeFilters, filter, value }: Props) {
170
+ const entries = filterValueInputParamEntries(value.input);
171
+ if (entries.length !== 1) return null;
172
+
173
+ const [{ name, value: paramValue }] = entries;
174
+
175
+ return (
176
+ <input
177
+ type="checkbox"
178
+ name={name}
179
+ value={paramValue}
180
+ defaultChecked={isFilterInputActive(activeFilters, value.input)}
181
+ onChange={(event) => {
182
+ if (isMutuallyExclusive(filter) && event.currentTarget.checked) {
183
+ uncheckSiblings(event.currentTarget);
184
+ }
185
+ requestFormSubmit(event);
186
+ }}
187
+ />
188
+ );
189
+ }
190
+ ```
191
+
192
+ `filterValueInputParamEntries` is app glue code, not a Hydrogen export. Its body should stay this thin: `JSON.parse(value.input)` plus `serializeCollectionParams(...)`. Do not replace it with a custom mapping table for availability, product type, vendor, tags, options, metafields, or price. The app should not create its own `ProductFilter` from `filter.id`, `filter.label`, `filter.type`, `value.id`, or display labels; those are UI metadata, not the Storefront API filter contract.
193
+
194
+ For active chips, use parsed active `ProductFilter` values from collection state:
195
+
196
+ ```tsx
197
+ function ActiveFilterChip({ collectionPath, filter, state }: Props) {
198
+ const currentParams = serializeCollectionParams(state);
199
+ const removal = getFilterRemovalUrl(currentParams, filter);
200
+ const href = removal === "?" ? collectionPath : `${collectionPath}${removal}`;
201
+
202
+ return (
203
+ <a href={href}>
204
+ {describeFilter(filter)}
205
+ </a>
206
+ );
207
+ }
208
+ ```
209
+
210
+ When passing `browse.filters` into a `gql()` query variable typed from Storefront API introspection, match the app's established pattern. The Hydrogen examples cast the parsed filters to the generated Storefront API `ProductFilter` type at the query variable boundary:
211
+
212
+ ```ts
213
+ import type { ProductFilter as StorefrontApiProductFilter } from "@shopify/hydrogen/storefront-api-types";
214
+
215
+ variables: {
216
+ filters:
217
+ browse.filters.length > 0 ? (browse.filters as StorefrontApiProductFilter[]) : undefined,
218
+ }
219
+ ```
220
+
221
+ Keep this as a generated-type cast scoped to the query variable boundary.
222
+
223
+ ## Search Pages
224
+
225
+ Use the same binding with a synthetic handle:
226
+
227
+ ```tsx
228
+ <CollectionProvider
229
+ data={{ handle: `search:${term}`, dataSearch }}
230
+ urlSearch={searchParams.toString()}
231
+ onChange={(search) => navigate({ search }, { replace: searchParams.size > 0 })}
232
+ >
233
+ <input type="hidden" name="q" value={term} />
234
+ </CollectionProvider>
235
+ ```
236
+
237
+ When the search term changes, include it in the browse form `key` so old unchecked/checked inputs do not carry over.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: hydrogen-customer-account
3
+ description: >
4
+ Customer Account API setup for Hydrogen storefronts. Use when wiring customer
5
+ sessions, login/logout/OAuth route handlers, account profile, order history,
6
+ account-gated UI, cart buyer identity sync, or Customer Account
7
+ GraphQL queries.
8
+ ---
9
+
10
+ # Customer Account API
11
+
12
+ The Customer Account API powers login, account profile, order history, and account-gated UI. Hydrogen provides typed GraphQL helpers and OAuth/session primitives; the app still owns framework integration, UI, and session storage.
13
+
14
+ ## Configuration
15
+
16
+ Use server-side configuration for:
17
+
18
+ - `SHOP_ID` — numeric Shopify shop ID string. Do not use a Shop GID or shop domain.
19
+ - `PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID` — Customer Account API client ID.
20
+ - `CUSTOMER_ACCOUNT_SESSION_SECRET` — private per-app secret for encrypted cookie examples, or replace cookie storage with opaque server-side sessions in production.
21
+
22
+ Do not expose access tokens, refresh tokens, ID tokens, or session secrets to client components or browser storage.
23
+
24
+ ## Session Module
25
+
26
+ Create `customerSession` at module scope with `createCustomerSession({ shopId, customerAccountApiClientId })`. Create request-scoped session managers from the framework request, backed by protected server storage or encrypted HttpOnly cookies.
27
+
28
+ Use the same `requestContext` for Storefront and Customer Account work in a request. Customer Account reads and GraphQL calls mark responses personalized so final response headers must run through `requestContext.applyResponseHeaders()`.
29
+
30
+ Expose two app-owned session-manager helpers when the framework has both read-only render paths and writable response boundaries:
31
+
32
+ - Read-only helpers return or accept `ReadonlyCustomerSessionManager`. Use them in Server Components, layouts, loaders, and account header UI.
33
+ - Writable helpers return or accept `WritableCustomerSessionManager`. Use them only where the returned response can commit `Set-Cookie`, such as Hydrogen route handlers, route handlers, server functions, middleware/proxy responses, or framework finalizers.
34
+
35
+ This makes the dangerous path harder to hold wrong: TypeScript rejects `customerSession.getOrRefreshAccessToken()` when the caller only has a `ReadonlyCustomerSessionManager`.
36
+
37
+ ## Route Wiring
38
+
39
+ Register `createCustomerAccountServerHandlers({ customerSession })` with the app's `handleShopifyRoutes` setup.
40
+
41
+ ## Cart Buyer Identity Sync
42
+
43
+ To keep the browser cart's buyer identity in step with the customer session, create the cart handlers with the same `customerSession` and pass them to the Customer Account handlers:
44
+
45
+ ```ts
46
+ import { createCartServerHandlers } from "@shopify/hydrogen";
47
+ import { createCustomerAccountServerHandlers } from "@shopify/hydrogen/customer-account";
48
+
49
+ const cartHandlers = createCartServerHandlers({ customerSession });
50
+
51
+ const customerAccountHandlers = createCustomerAccountServerHandlers({
52
+ customerSession,
53
+ cartServerHandlers: cartHandlers,
54
+ });
55
+ ```
56
+
57
+ With this wiring, Hydrogen owns the whole loop:
58
+
59
+ - New carts are created with the current customer's buyer identity when the session has a usable access token or successfully refreshed access token, and authenticated cart reads mark checkout URLs with `logged_in=true` (from the cart handlers' `customerSession` option).
60
+ - Authorization and refresh attach the customer to the cart from the request's cart cookie; a definitive refresh rejection detaches it. Transient refresh failures leave the cart untouched.
61
+ - Logout detaches the customer from the cart.
62
+
63
+ Sync is best-effort: a failed cart mutation never blocks the route's redirect. Attach failures are logged and can be retried by a later refresh. If detach fails during logout or definitive refresh rejection, the handler expires the cart cookie so a shared device never keeps a cart bound to the previous customer.
64
+
65
+ `cartServerHandlers` requires both handler groups to share the `customerSession` returned by `createCustomerSession`; TypeScript rejects cart handlers created without `customerSession`.
66
+
67
+ The Customer Account handlers own:
68
+
69
+ - `GET /account/login`
70
+ - `GET /account/authorize`
71
+ - `GET /account/refresh`
72
+ - `POST /account/logout`
73
+
74
+ Do not reimplement login, authorize, refresh, or logout unless the app needs custom behavior that preserves the same safeguards: sanitized `return_to`, same-origin logout POST checks, `cache-control: no-store`, committed session cookies on the returned response, and request-context response headers.
75
+
76
+ ## Server Rendering
77
+
78
+ Server-rendered account UI must keep session reads and token refresh separate:
79
+
80
+ - Use `customerSession.isLoggedIn()` for read-only signed-in UI such as an account link. It treats a refreshable session as logged in without refreshing tokens.
81
+ - Use `customerSession.getAccessToken()` before Customer Account GraphQL calls. It returns only a currently usable access token.
82
+ - If `isLoggedIn()` is true but `getAccessToken()` returns `undefined`, redirect once to `/account/refresh?return_to=...` from a dynamic server route, then retry the account page after the refresh route commits cookies.
83
+ - If `isLoggedIn()` is false, show login UI or redirect to `/account/login` instead of sending the user to `/account/refresh`.
84
+ - Include a one-shot refresh guard in `return_to`; if the refreshed page still has no usable access token, fall back to login or an account error state.
85
+ - Server Components and layouts should only receive `ReadonlyCustomerSessionManager`, so they cannot call `getOrRefreshAccessToken()`.
86
+
87
+ Wrap header/account-link UI in the framework's streaming primitive when possible so the shell can render before session state resolves.
88
+
89
+ ## Account Page
90
+
91
+ Hydrogen ships no account UI yet — the app owns it. A storefront with the handlers wired but no account page has working auth endpoints a buyer can never reach. Build at least a minimal `/account` route:
92
+
93
+ - **Signed out** — render a sign-in panel linking to `/account/login?return_to=/account`. The login link must be a full-document navigation (plain `<a>` or the framework link's reload-document mode): the handler returns a raw redirect to Shopify's hosted login page that client-side routing cannot follow.
94
+ - **Signed in** — fetch and render a minimal profile (`customer { firstName lastName emailAddress { emailAddress } }`). Check GraphQL `errors` and render an error state instead of crashing.
95
+ - **Logout** — a plain HTML `<form method="post" action="/account/logout">` with a submit button. The handler enforces same-origin POST and returns a raw redirect (to Shopify's logout endpoint when an `id_token` exists); a native browser submit follows it, a client-side form component or fetch call does not. This also keeps logout working without JavaScript. An optional `return_to` search param on the action URL controls the post-logout destination.
96
+ - **Navbar** — link to `/account`. A static link is enough; the page handles both states. If showing signed-in state in the header, use `isLoggedIn()` behind the framework's streaming primitive per the Server Rendering rules above.
97
+ - Never serialize tokens or session objects into loader data or HTML; render only derived profile fields.
98
+
99
+ ## Typed Queries
100
+
101
+ Use `gql` and `createCustomerAccountClient` from `@shopify/hydrogen/customer-account` in server code only. Pass the access token per GraphQL call.
102
+
103
+ The same `@shopify/hydrogen/ts-plugin` and `hydrogen gql check` setup from the `hydrogen-storefront-client` skill validates Customer Account API documents too. If the check is not already chained into the app's `typecheck` package script, add it there (create the script if the app has none), then run it before treating setup as complete — framework typecheck commands do not validate `gql()` documents on their own.
104
+
105
+ ## Local OAuth
106
+
107
+ Customer Account OAuth needs a public HTTPS callback origin. For local examples, use a trusted local HTTPS hostname and register the exact `/account/authorize` callback URL in the Customer Account app configuration.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: hydrogen-image
3
+ description: >
4
+ Helper-only sizing of Shopify CDN image URLs. Use when rendering Storefront
5
+ API images in product/collection cards, PDP galleries, PLP heroes, cart
6
+ thumbnails, or other img element surfaces.
7
+ ---
8
+
9
+ # Hydrogen Image Sizing
10
+
11
+ Hydrogen ships no Image component. Size Shopify CDN image URLs with a tiny local helper and render plain `<img>`.
12
+
13
+ ## Param contract
14
+
15
+ CDN sizing params (`width`, `height`, `crop`, plus format/scale/no-upscale) are documented by Shopify — Storefront API `ImageTransformInput`: https://shopify.dev/docs/api/storefront/latest/input-objects/ImageTransformInput
16
+
17
+ ## The 3 rules
18
+
19
+ 1. **Host allowlist.** Only rewrite `cdn.shopify.com` / `mock.shop` and their subdomains. Pass third-party images through unchanged (e.g. an Unsplash hero with its own `w=`).
20
+ 2. **`mock.shop` counts as a Shopify CDN host.**
21
+ 3. **Append params with `URL.searchParams`** to preserve any existing query string — never string-concat.
22
+
23
+ ## Helper
24
+
25
+ ```ts
26
+ type ShopifyImageOptions = {
27
+ width?: number;
28
+ height?: number;
29
+ crop?: "center" | "top" | "bottom" | "left" | "right";
30
+ };
31
+
32
+ const SHOPIFY_CDN_HOSTS = ["cdn.shopify.com", "mock.shop"];
33
+
34
+ function isShopifyImageHost(hostname: string) {
35
+ return SHOPIFY_CDN_HOSTS.some((host) => hostname === host || hostname.endsWith(`.${host}`));
36
+ }
37
+
38
+ export function shopifyImageUrl(url: string, options: ShopifyImageOptions = {}) {
39
+ let parsed: URL;
40
+ try {
41
+ parsed = new URL(url);
42
+ } catch {
43
+ return url;
44
+ }
45
+
46
+ if (!isShopifyImageHost(parsed.hostname)) return url;
47
+
48
+ if (options.width) parsed.searchParams.set("width", String(options.width));
49
+ if (options.height) parsed.searchParams.set("height", String(options.height));
50
+ if (options.crop) parsed.searchParams.set("crop", options.crop);
51
+
52
+ return parsed.toString();
53
+ }
54
+
55
+ export function srcSetFor(url: string, options: ShopifyImageOptions) {
56
+ const oneX = shopifyImageUrl(url, options);
57
+ const twoX = shopifyImageUrl(url, {
58
+ ...options,
59
+ width: options.width ? options.width * 2 : undefined,
60
+ height: options.height ? options.height * 2 : undefined,
61
+ });
62
+
63
+ return `${oneX} 1x, ${twoX} 2x`;
64
+ }
65
+ ```
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: hydrogen-local-https
3
+ description: >
4
+ Configure trusted local HTTPS for Customer Account API development with
5
+ Vite-based frameworks or Next.js.
6
+ ---
7
+
8
+ # Local HTTPS
9
+
10
+ Customer Account login, logout, and OAuth callbacks require an HTTPS, non-`localhost` origin that exactly matches the URLs registered in Shopify admin. `local.tryhydrogen.dev` is a Shopify-owned domain that resolves publicly to `127.0.0.1`, so it provides a stable local hostname.
11
+
12
+ ## Vite Certificate Setup
13
+
14
+ Vite-based frameworks need manual certificates until automatic provisioning is available. Install and trust [mkcert](https://github.com/FiloSottile/mkcert), then create the default certificate files:
15
+
16
+ ```sh
17
+ brew install mkcert
18
+ mkcert -install
19
+ mkdir -p ~/.shopify/hydrogen/certs
20
+ mkcert \
21
+ -cert-file ~/.shopify/hydrogen/certs/local.tryhydrogen.dev.pem \
22
+ -key-file ~/.shopify/hydrogen/certs/local.tryhydrogen.dev-key.pem \
23
+ local.tryhydrogen.dev
24
+ ```
25
+
26
+ Pass `certPath` and `keyPath` to use another location. Certificate generation is intentionally separate from the plugin.
27
+
28
+ ## Vite
29
+
30
+ ```ts
31
+ import { localHttps } from "@shopify/hydrogen/vite";
32
+ import { defineConfig } from "vite";
33
+
34
+ const httpsOptions = {
35
+ enabled: process.env.npm_lifecycle_event === "https:dev" || process.env.VITE_LOCAL_HTTPS === "1",
36
+ };
37
+
38
+ export default defineConfig({
39
+ plugins: [localHttps(httpsOptions)],
40
+ });
41
+ ```
42
+
43
+ Start Vite through an `https:dev` package script. A normal `vite dev` remains plain HTTP.
44
+
45
+ ```json
46
+ {
47
+ "scripts": {
48
+ "dev": "vite dev",
49
+ "https:dev": "vite dev"
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Astro
55
+
56
+ Astro needs its own host and port in addition to the Vite plugin:
57
+
58
+ ```js
59
+ import { LOCAL_HTTPS_DEFAULTS, localHttps } from "@shopify/hydrogen/vite";
60
+ import { defineConfig } from "astro/config";
61
+
62
+ const enabled = process.env.npm_lifecycle_event === "https:dev" || process.env.VITE_LOCAL_HTTPS === "1";
63
+ const httpsOptions = { enabled };
64
+
65
+ export default defineConfig({
66
+ server: enabled
67
+ ? { host: LOCAL_HTTPS_DEFAULTS.host, port: LOCAL_HTTPS_DEFAULTS.port }
68
+ : undefined,
69
+ vite: { plugins: [localHttps(httpsOptions)] },
70
+ });
71
+ ```
72
+
73
+ ## Nuxt
74
+
75
+ Nitro terminates TLS, so provide certificate paths to both Nitro and Vite:
76
+
77
+ ```ts
78
+ import { localHttps } from "@shopify/hydrogen/vite";
79
+ import type { NuxtConfig } from "nuxt/schema";
80
+
81
+ type VitePlugin = NonNullable<NonNullable<NuxtConfig["vite"]>["plugins"]>[number];
82
+
83
+ const httpsOptions = {
84
+ enabled: process.env.npm_lifecycle_event === "https:dev" || process.env.VITE_LOCAL_HTTPS === "1",
85
+ };
86
+ const httpsPlugin = localHttps(httpsOptions);
87
+
88
+ export default defineNuxtConfig({
89
+ devServer: httpsPlugin.api.getDevServerConfig(),
90
+ vite: {
91
+ plugins: [httpsPlugin as VitePlugin],
92
+ },
93
+ });
94
+ ```
95
+
96
+ ## SolidStart/Vinxi
97
+
98
+ Vinxi terminates TLS outside Vite:
99
+
100
+ ```ts
101
+ import { defineConfig } from "@solidjs/start/config";
102
+ import { localHttps } from "@shopify/hydrogen/vite";
103
+
104
+ const httpsOptions = {
105
+ enabled: process.env.npm_lifecycle_event === "https:dev" || process.env.VITE_LOCAL_HTTPS === "1",
106
+ };
107
+ const httpsPlugin = localHttps(httpsOptions);
108
+ const devServer = httpsPlugin.api.getDevServerConfig();
109
+
110
+ export default defineConfig({
111
+ server: { https: devServer?.https },
112
+ vite: { plugins: [httpsPlugin] },
113
+ });
114
+ ```
115
+
116
+ Vinxi also needs its bind target and port on startup:
117
+
118
+ ```json
119
+ {
120
+ "scripts": {
121
+ "https:dev": "vinxi dev --host local.tryhydrogen.dev --port 5173"
122
+ }
123
+ }
124
+ ```
125
+
126
+ ## Next.js
127
+
128
+ Next.js provisions its own trusted certificate:
129
+
130
+ ```sh
131
+ next dev --experimental-https --hostname local.tryhydrogen.dev --port 5173
132
+ ```
133
+
134
+ ## Shopify Admin
135
+
136
+ In the Hydrogen or Headless sales channel, open the storefront's **Customer Account API settings** and configure:
137
+
138
+ ```text
139
+ Callback URI(s): https://local.tryhydrogen.dev:5173/account/authorize
140
+ JavaScript origin(s): https://local.tryhydrogen.dev
141
+ Logout URI: https://local.tryhydrogen.dev:5173
142
+ ```
143
+
144
+ The JavaScript origin intentionally has no port. Shopify's server-side validation rejects JavaScript origins containing a port.