--- id: 07-update-feature-generator epic: binder-wrap-helper title: Update feature generator template to emit wireUseCase calls type: technical-story status: todo feature: tooling depends-on: [01-wire-use-case-helper] blocks: [08-holistic-validation] --- ## Goal Update `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` and `bind-dev-seed.ts.hbs` to emit `wireUseCase` calls instead of inline `withSpan + withCapture` blocks, so that `pnpm turbo gen feature` scaffolds conformant binders from the first commit. ## Why Without this change, every new feature scaffolded after the migration would drift back to the inline wrap shape, silently undoing the consolidation. The generator is the only enforcement point for new-feature defaults. ## Done when - `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` emits a `wireUseCase` call for the scaffolded use case, not an inline wrap block. - `turbo/generators/templates/feature/src/di/bind-dev-seed.ts.hbs` emits a `wireUseCase` call for the scaffolded use case. - The inline `withSpan(... withCapture(...))` pattern is absent from both templates. - `@repo/core-shared/conformance` is imported in the generated binder output (the `wireUseCase` import). - Running `pnpm turbo gen feature` (dry-run or against a scratch location) produces binders that match the migration shape from stories 02–06. ## In scope - `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` — replace use-case wrap block. - `turbo/generators/templates/feature/src/di/bind-dev-seed.ts.hbs` — replace use-case wrap block. - Import statement update in both templates to pull in `wireUseCase` from `@repo/core-shared/conformance`. ## Out of scope - Other generator templates (entity, repository, controller, etc.) — unchanged. - The generator's interactive prompts or `index.ts` config — unchanged unless needed to pass new template variables. - Updating already-scaffolded features (covered by stories 02–06). ## Tasks - [ ] Read `turbo/generators/templates/feature/src/di/bind-production.ts.hbs` — understand current inline wrap shape and Handlebars variables used - [ ] Read `turbo/generators/templates/feature/src/di/bind-dev-seed.ts.hbs` — same - [ ] Update `bind-production.ts.hbs` — replace inline wrap block with `wireUseCase` call; add `wireUseCase` import from `@repo/core-shared/conformance` - [ ] Update `bind-dev-seed.ts.hbs` — same - [ ] Verify template output by inspecting rendered Handlebars (or running `pnpm turbo gen feature` in dry-run / scratch mode) to confirm generated binder matches the migration shape