Guidance for AI agents and automated tooling working in this repository.
TanStack Start (React) storefront powered by @decocms/* packages, deployed to
Cloudflare Workers via wrangler. Dev server: npm run dev (Vite). Build:
npm run build. Type-check: npm run typecheck.
Source of truth: .deco/blocks/<encoded-key>.json — one JSON file per
block (pages, section props, loader config, site settings). The filename is the
URI-encoded block key. For ANY content change, edit only the matching
.deco/blocks/*.json file(s).
Never hand-edit generated artifacts. These are derived from .deco/blocks/
and regenerated automatically; edits to them look correct in the dev preview
but are silently discarded on the next regeneration/production build:
.deco/blocks.gen.json/.deco/blocks.gen.ts— merged block snapshot (regenerated by the dev watcher and bynpm run buildviagenerate:blocks).deco/meta.gen.json,.deco/sections.gen.ts,.deco/loaders.gen.tssrc/routeTree.gen.ts- any other
*.gen.*file
How a content change propagates (no extra files need touching):
- Dev/preview: the
decoVitePluginwatches.deco/blocks/, patchesblocks.gen.json, POSTs the delta to the dev server's/.decofile, and hot-reloads the preview. - Production:
npm run buildregenerates the bundled snapshot from.deco/blocks/, and the fast-deploy content sync (deco-sync-blocks-to-kv) reads.deco/blocks/*.jsondirectly. Committing the.deco/blocks/*.jsonchange is all that is needed for it to reach production.
- Cite files as
path:linewhen explaining code. - Run
npm run typecheckafter TypeScript changes. npm run format(Prettier) before committingsrc/**changes.