Loading...
Use this checklist when creating a new block for multi-store.
my-awesome-block) Created directory: apps/multi-store/src/blocks/MyBlock/
Created config.ts with Block definition:
slug propertyinterfaceName for TypeScriptlabels.singular and labels.pluralfields arraycondition functions Created Component.tsx with React component:
disableInnerContainer propkey with block id Added import to /apps/multi-store/src/blocks/RenderBlocks.tsx:
import { MyBlockComponent } from "@/blocks/MyBlock/Component";
import { MyBlock } from "@/blocks/MyBlock/config";
Added to blockComponents object in RenderBlocks.tsx:
"my-block": MyBlockComponent,
Choose one or more:
collections/contentTabField.ts:
import { MyBlock } from "@/blocks/MyBlock/config";
blocks array in contentTabField.tsglobals/Shop/config.ts:
import { MyBlock } from "@/blocks/MyBlock/config";
blocks array (shopHome, productPages, etc.)collections/contentTabField.tsblocks array for product-specific sectionbun run lint:check - no errorsbun run lint - auto-fixed all issuesbun run gen - generated types successfully{BlockName}Props interfaceAdded block to documentation:
BLOCKS_SYSTEM_GUIDE.md if complexDocumented in code:
# Check formatting
bun run lint:check
# Auto-fix any issues
bun run lint
# Generate types
bun run gen
# Build to verify compilation
bun run build --filter multi-store
fields: [
{ name: "title", type: "text", required: true },
{ name: "content", type: "richText", editor: lexicalEditor() },
]
fields: [
{ name: "image", type: "upload", relationTo: "media" },
{ name: "alt", type: "text", label: "Alt Text" },
{ name: "title", type: "text" },
]
fields: [
{
name: "items",
type: "array",
fields: [
{ name: "title", type: "text" },
{ name: "description", type: "text" },
],
},
]
fields: [
{ name: "showAdvanced", type: "checkbox", defaultValue: false },
{
name: "advancedOption",
type: "text",
admin: { condition: (_, data) => data.showAdvanced },
},
]
fields: [
{
name: "variant",
type: "select",
defaultValue: "default",
options: [
{ label: "Default", value: "default" },
{ label: "Primary", value: "primary" },
{ label: "Secondary", value: "secondary" },
],
},
]
Tell me:
Then I'll create: ✅ Complete config file with all fields ✅ React component with proper typing ✅ Integration into RenderBlocks ✅ Collection registration ✅ Full verification (linting, types, formatting)
Ready? 🚀