Files
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

48 lines
1.9 KiB
TypeScript

import Root from '@/config/root';
import type { UserConfig } from '@/config/types';
import headerEditor from '@/components/shopify/header.editor';
import footerEditor from '@/components/shopify/footer.editor';
import productsEditor from '@/components/shopify/products.editor';
import collectionsEditor from '@/components/shopify/collections.editor';
import collectionDetailEditor from '@/components/shopify/collection-detail.editor';
import productDetailEditor from '@/components/shopify/product-detail.editor';
import productRecommendationsEditor from '@/components/shopify/product-recommendations.editor';
import searchResultsEditor from '@/components/shopify/search-results.editor';
import storeAssistantEditor from '@/components/shopify/store-assistant.editor';
import contentSectionEditor from '@/components/shopify/content-section.editor';
import policyBodyEditor from '@/components/shopify/policy-body.editor';
const categories = {
navigation: { title: 'Navigation' },
commerce: { title: 'Commerce' },
content: { title: 'Content' },
};
/**
* The block library. Every entry pairs a storefront component with a config
* that exposes *content only* — copy, imagery, and which Shopify product or
* collection to show. Design decisions (columns, spacing, tone, typography)
* stay inside the components and `app/globals.css`, so editing a page can
* never take the storefront off-brand.
*/
export const appConfig: UserConfig = {
root: Root,
categories,
components: {
header: headerEditor,
footer: footerEditor,
products: productsEditor,
collections: collectionsEditor,
'collection-detail': collectionDetailEditor,
'product-detail': productDetailEditor,
'product-recommendations': productRecommendationsEditor,
'search-results': searchResultsEditor,
'store-assistant': storeAssistantEditor,
'content-section': contentSectionEditor,
policy: policyBodyEditor,
} as any,
};
export default appConfig;