Rami BitarandClaude Opus 5 f11a764426 Load page.json by import, publish via fs, drop cookie auth
The editor no longer round-trips through /api/pages. Each route's
editor/page.tsx imports its own `../page.json` and hands it to
PageEditor as a prop, so the editor opens with the page already in
hand — no fetch, no loading state, no undo history seeded from a
placeholder. Globals still come from app.globals.json.

Publishing moves from `PUT /api/pages` to a `publishPage` server
action that writes the route's page.json with node:fs directly.
The target path is still built from the lib/pages.ts registry rather
than from the caller, so an unknown route key is rejected instead of
escaping app/.

Removes the customer account auth entirely: the httpOnly cookie
session, the /api/account/* handlers, the customer service and
GraphQL documents, the account-* blocks, and the /account/* routes.
The template has no auth, so nothing reads a cookie now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STGDvL4X7FhHHnxdRE2ayo
2026-08-09 16:36:18 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00
2026-06-06 11:45:24 -04:00
2026-08-09 16:00:10 -04:00
2026-08-09 16:00:10 -04:00

React Editor Demo (Shopify)

Standalone Vite SPA wiring up the Shopify-aware React Editor via <App /> from @reacteditor/core.

What's here

  • index.html — Vite entrypoint.
  • src/main.tsx — mounts <App /> into #root.
  • src/App.tsx — wires <App /> from @reacteditor/core with the schema, plugins, and the Shopify provider.
  • editor/ — drop-in copy of the editor scaffold from fe-shopify-client/app/editor. Components, config, theme, Shopify client/queries/hooks/contexts, plugin-ai vendor css.
  • app.schema.json — source of truth for every page in the demo. Shape: { "/": { root, content }, "/about": { ... }, ... }.
  • api/chat.tsaiPlugin endpoint exposed in dev via a Vite middleware. Talks to Claude via @ai-sdk/anthropic with the editor + Shopify tool surface (updatePage, searchProducts, etc.).

Run

cp .env.local.example .env.local   # optional — defaults to mock.shop
yarn install
yarn dev   # → http://localhost:3001

Shopify

Defaults to the public mock.shop storefront (no token needed) so commerce blocks render demo data immediately. Override via VITE_SHOPIFY_DOMAIN and VITE_SHOPIFY_STOREFRONT_ACCESS_TOKEN in .env.local.

AI

/api/chat is served in dev by a Vite middleware that loads api/chat.ts via ssrLoadModule. Set ANTHROPIC_API_KEY in .env.local. Tools include the React Editor built-ins plus Shopify search/lookup helpers. For production deployment you'll need to host api/chat.ts behind your own Node server (the handler exports a standard POST(req: Request): Promise<Response>).

S
Description
No description provided
Readme
617 KiB
Languages
TypeScript 98.5%
CSS 1.2%
JavaScript 0.3%