Template
Completes the migration started in f8c3ef9. That commit put hydrogen
underneath the existing shopifyFetch wrapper; this one removes the
wrapper so every query uses the package's own client API.
- All 22 call sites now call storefront.graphql(DOCUMENT, { variables })
(cachedStorefront for shop policies) instead of shopifyFetch, which
emulated the old client's {query, variables} -> {data} shape.
- shopifyFetch is replaced by unwrapStorefrontResult(result, operation),
which is only an error policy, not a transport wrapper: it returns
data and throws when Shopify reports GraphQL errors, since hydrogen
returns those rather than throwing. Naming the operation means a
failure points at the call site instead of just at "Shopify".
- Environment reads move to services/shopify/config, so client.ts is
only the hydrogen clients and shop-pay-button no longer imports from
a query module just to get the store domain.
- Removes @shopify/storefront-api-client, the superseded client. It had
no importers.
The SHOPIFY_STOREFRONT_API_URL export is gone too — hydrogen builds the
endpoint from storeDomain and apiVersion, and nothing else used it.
No behaviour change intended: same documents, same env var names, same
2025-07 API pin, same caching split between the two clients.
yarn typecheck passes with 0 errors. Verified against mock.shop: build
prerenders the policy pages, and in the browser product grid, search,
collection filters, cart restore, quantity update and discount-code
apply all work with no console errors. Customer account flows remain
untested — they need real credentials.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JaxgqPbFxLsSuLPZom2kdC
59 lines
1.9 KiB
JSON
59 lines
1.9 KiB
JSON
{
|
|
"name": "nextjs-app",
|
|
"type": "module",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev --webpack",
|
|
"build": "next build --webpack",
|
|
"start": "next start",
|
|
"typecheck": "tsc --noEmit && hydrogen gql check"
|
|
},
|
|
"version": "0.0.0",
|
|
"dependencies": {
|
|
"@ai-sdk/react": "^4.0.47",
|
|
"@next/swc-wasm-web": "16.2.10",
|
|
"@openrouter/ai-sdk-provider": "^3.0.0",
|
|
"@radix-ui/react-slot": "^1.3.3",
|
|
"@radix-ui/react-use-controllable-state": "^1.2.6",
|
|
"@remixicon/react": "^4.9.0",
|
|
"@shopify/hydrogen": "0.0.0-preview-116d5d7-20260730141607",
|
|
"ai": "^7",
|
|
"class-variance-authority": "0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"embla-carousel-react": "^8.6.0",
|
|
"framer-motion": "12.42.2",
|
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
"input-otp": "^1.4.2",
|
|
"lucide-react": "^0.562.0",
|
|
"motion": "^12.23.26",
|
|
"nanoid": "^6.0.0",
|
|
"next": "16.2.10",
|
|
"radix-ui": "^1.6.7",
|
|
"react": "^19.0.0",
|
|
"react-dom": "^19.0.0",
|
|
"rehype-sanitize": "^6.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"remark-parse": "^11.0.0",
|
|
"remark-rehype": "^11.1.2",
|
|
"remend": "^1.3.0",
|
|
"sonner": "^2.0.7",
|
|
"tailwind-merge": "^3.4.0",
|
|
"tailwindcss": "^4",
|
|
"tw-animate-css": "1.4.0",
|
|
"unified": "^11.0.5",
|
|
"use-stick-to-bottom": "^1.1.6",
|
|
"zod": "^4.4.3",
|
|
"zustand": "^5.0.11"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4",
|
|
"@types/hast": "^3.0.5",
|
|
"@types/node": "^22",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"typescript": "^5.7.3"
|
|
},
|
|
"packageManager": "yarn@4.18.0+sha512.fcb8716fe7cd0eece141ffc18b92193a9df9204c1ba83189c288835223fc0bbe64af473bab0d5e9927a7daeb5caf2bb07eb2787cc9338ca040ea125f2a1f2f7e"
|
|
}
|