12 Commits
Author SHA1 Message Date
Rami Bitar aad01eb5c1 fix(storefront): simplify homepage title 2026-10-04 14:39:37 -04:00
Rami BitarandClaude Opus 5.5 55423c7204 Deploy to Vercel as a TanStack Start app via Nitro
Vercel served 404s: with Hydrogen gone it treated the app as a static
Vite site, but TanStack Start's build has no index.html; pages come from
its server. Add the hosting adapter TanStack documents for Vercel:

- nitro() in vite.config, for 'vite build' only (dev and the nodesandbox
  runtime never load it); on Vercel it writes .vercel/output with the
  static assets and one Node.js function running Start + Hono
- vercel.json: tanstack-start preset, Yarn 4 via Corepack
- 'yarn start' runs the Node build; canonical URLs use the Vercel domain

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:47:53 -04:00
Rami BitarandClaude Opus 5.5 7ec0029b08 Update Vite to 8.3.2
Vite 8.3 uses rolldown 1.2.x, so the direct rolldown 1.1.4 pin is
removed (one rolldown copy). Note: nodesandbox runtimes that only ship
WASI glue for rolldown 1.1.x fail to boot this with 'WASI binding not
found'; Vite 8.1.3 is the last release on rolldown 1.1.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:40:36 -04:00
Rami BitarandClaude Opus 5.5 6fcfe59d0d Replace @shopify/hydrogen with direct Storefront API queries
Vercel's 'Hydrogen (v1)' preset matches any project depending on
@shopify/hydrogen and runs its v1 builder, which fails looking for
dist/worker. We only used the preview package as a Storefront API client,
so talk to the API directly instead:

- services/shopify/client.ts: plain fetch to /api/{version}/graphql.json
  with the public token header, @inContext country/language defaults, and
  the same graphql() / unwrapStorefrontResult API as before
- graphql/gql.ts: small helper that joins a document with its fragments
  (de-duplicated); the queries themselves are unchanged
- Explicit response types at each call site in place of the generated
  gql.tada types; local ProductFilter input type
- Drop @shopify/hydrogen, graphql, the TS plugin and 'hydrogen gql check'
- Copy no longer mentions Hydrogen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:28:02 -04:00
Rami BitarandClaude Opus 5.5 d33a6894f3 Stop depending on @rolldown/binding-wasm32-wasi directly
The binding declares cpu: wasm32, so npm on x64 hosts (Vercel) fails
with EBADPLATFORM. The nodesandbox runtime already installs every
package's *-wasm32-wasi optional dependency (rolldown's included), so
the app doesn't need to list it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:16:59 -04:00
Rami BitarandClaude Opus 5.5 fb7ef27621 Provide the QueryClient from the app's own react-query import
In the nodesandbox runtime SSR failed with 'No QueryClient set' in
ShopMenu. react-query ships ESM and CJS builds; when the SSR query
integration resolves through its CJS entry while the app imports ESM,
the integration's QueryClientProvider and the app's hooks use separate
React contexts. Render the provider via the router's Wrap from the
app's own import and pass wrapQueryClient: false so SSR dehydration
still runs but no second provider is added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:13:52 -04:00
Rami BitarandClaude Opus 5.5 dbbfefca48 Drop the stale Nitro PORT note from .env.example
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:59:47 -04:00
Rami BitarandClaude Opus 5.5 e09bc0e1fe Run on the nodesandbox runtime: harness toolchain, Hono server entry
The sandbox loads Vite's native tools as WASI (NAPI_RS_FORCE_WASI=error)
and only ships glue for rolldown 1.1.x. Vite 8.3 pulls rolldown 1.2.x,
whose binding needs emnapi 2.0 alpha, so boot failed with 'WASI binding
not found'. Match the runtime-host harness TanStack sample instead:

- Pin vite 8.1.3, rolldown + @rolldown/binding-wasm32-wasi 1.1.4,
  @vitejs/plugin-react 6.0.0, tailwindcss + @tailwindcss/vite 4.3.1
  (exact versions: the sandbox resolves package.json, not yarn.lock)
- Drop Nitro (it brings rolldown 1.2.x) and the Vercel config
- Hono now sits in src/server.ts, Start's server entry, routing /api/*
  ahead of start.fetch, as in the harness
- dev runs 'vite dev --host 0.0.0.0 --port 3000'; config is .mjs
- Await product recommendations in the loader to fix a hydration
  mismatch between the SSR skeleton and the settled client render

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:51:11 -04:00
Rami BitarandClaude Opus 5.5 099ba454e0 Default the store domain to mock.shop when unset
An unset or blank VITE_SHOPIFY_DOMAIN reached the Hydrogen client as an
empty storeDomain, which throws 'storeDomain is required and must be
non-empty'. Fall back to the tokenless mock.shop store instead, and only
send the public token alongside a configured domain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 11:43:07 -04:00
Rami Bitar 968a243bd4 Deploy 2026-10-03 11:37:44 -04:00
Rami BitarandClaude Opus 5.5 160e65f0ed Migrate to TanStack Start and pin the Vercel preset
Vercel auto-detected the Hydrogen preset from the @shopify/hydrogen
dependency and failed building a 'hydrogen' Edge Function. The app is now
TanStack Start (SSR via Nitro), and vercel.json pins the tanstack-start
preset and installs with Corepack so Yarn 4 is used.

- Router factory with per-request QueryClient and SSR query dehydration
- Hono API mounted as a Start server route at /api/*
- Account reads in loaders go through server functions (cookies on SSR)
- Loaders prefetch listing pages so products are in the server HTML
- Add graphql peer dependency for gql.tada

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 11:35:35 -04:00
Rami BitarandClaude Opus 5.5 c447c51e82 Vite + Hono + TanStack port of the Shopify storefront
Ports nextjs-templates/shopify-storefront to Vite, TanStack Router/Query,
Tailwind v4 and Hono, without the AI store assistant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 11:27:27 -04:00