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
This commit is contained in:
co-authored by
Claude Opus 5
parent
63ecc5e284
commit
f11a764426
+1
-9
@@ -11,8 +11,6 @@ import type { SearchResultsBlockProps } from '@/components/shopify/search-result
|
||||
import type { StoreAssistantBlockProps } from '@/components/shopify/store-assistant.editor';
|
||||
import type { ContentSectionProps } from '@/components/shopify/content-section';
|
||||
import type { PolicyBodyProps } from '@/components/shopify/policy-body';
|
||||
import type { AccountPanelProps } from '@/components/shopify/account-panel';
|
||||
import type { AccountOrdersProps } from '@/components/shopify/account-orders';
|
||||
|
||||
import type { RootProps } from './root';
|
||||
|
||||
@@ -30,18 +28,12 @@ export type Components = {
|
||||
'store-assistant': StoreAssistantBlockProps;
|
||||
'content-section': ContentSectionProps;
|
||||
policy: PolicyBodyProps;
|
||||
'account-login': AccountPanelProps;
|
||||
'account-register': AccountPanelProps;
|
||||
'account-recover': AccountPanelProps;
|
||||
'account-reset': AccountPanelProps;
|
||||
'account-activate': AccountPanelProps;
|
||||
'account-orders': AccountOrdersProps;
|
||||
};
|
||||
|
||||
export type UserConfig = Config<{
|
||||
components: Components;
|
||||
root: RootProps;
|
||||
categories: ['navigation', 'commerce', 'content', 'account'];
|
||||
categories: ['navigation', 'commerce', 'content'];
|
||||
}>;
|
||||
|
||||
export type UserData = Data<Components, RootProps>;
|
||||
|
||||
Reference in New Issue
Block a user