fix(generators): emit cms barrel in feature template

The feature generator emitted no `src/integrations/cms/index.ts`, but
`gen job` and `gen event consume` both `assertAnchors` on that file's
`<gen:job-tasks>` anchor — so they failed on any freshly-scaffolded
feature. Add a `cms/index.ts.hbs` template carrying the anchor, wire the
add action into the generator, and export `./cms` from the package.json
template to match all five existing features.
This commit is contained in:
2026-05-21 11:25:55 +02:00
parent ae4062b607
commit 291e128489
3 changed files with 19 additions and 1 deletions

View File

@@ -20,7 +20,8 @@ import { registerFeatureInReleasePlease } from "./lib/release-please-utils.js";
*
* Scope (intentionally limited):
* - Single entity, single use case (`getX`)
* - Skips Payload CMS collection/global templates (integrations/cms/**)
* - Skips Payload CMS collection/global templates — emits only the
* integrations/cms/index.ts barrel (with the `<gen:job-tasks>` anchor)
* - Skips UI query helpers (ui/query.ts) — emits an empty barrel
* - Skips faker-driven factories — emits empty stubs
* - Skips multi-entity / multi-use-case
@@ -276,6 +277,15 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
"templates/feature/src/integrations/api/router.test.ts.hbs",
},
// Integrations: cms barrel — carries no collections (the generator skips
// Payload templates) but provides the `<gen:job-tasks>` anchor that
// `gen job` and `gen event consume` splice into.
{
type: "add",
path: "packages/{{kebabCase name}}/src/integrations/cms/index.ts",
templateFile: "templates/feature/src/integrations/cms/index.ts.hbs",
},
// Seeds + factories + contracts (minimal stubs that still typecheck/test)
{
type: "add",