diff --git a/biome.json b/biome.json index 0c8f6d5..db28d2f 100644 --- a/biome.json +++ b/biome.json @@ -39,7 +39,8 @@ "vtex/**", "resend/**", "website/**", - "vitest.config.ts" + "vitest.config.ts", + "registry.ts" ] } } diff --git a/package.json b/package.json index aec54c1..04a5f0c 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "type": "module", "description": "Deco commerce apps for TanStack Start - Shopify, VTEX, commerce types, analytics utils", "exports": { + "./registry": "./registry.ts", "./commerce/types": "./commerce/types/commerce.ts", "./commerce/app-types": "./commerce/app-types.ts", "./commerce/resolve": "./commerce/resolve.ts", @@ -87,6 +88,7 @@ "url": "https://github.com/decocms/apps-start.git" }, "files": [ + "registry.ts", "commerce/", "shopify/", "vtex/", diff --git a/registry.ts b/registry.ts new file mode 100644 index 0000000..2ec388b --- /dev/null +++ b/registry.ts @@ -0,0 +1,13 @@ +/** + * App registry — maps CMS block keys to their module loaders. + * + * @decocms/start imports this registry instead of hardcoding known apps. + * To register a new app, add an entry here and it will be auto-discovered + * by the framework's `autoconfigApps()`. + */ +export const apps: Record Promise<{ configure: (...args: never[]) => unknown }>> = { + "deco-vtex": () => import("./vtex/mod"), + "deco-shopify": () => import("./shopify/mod"), + "deco-resend": () => import("./resend/mod"), + "deco-website": () => import("./website/mod"), +};