@pattern-stack/codegen 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.7.8] — 2026-05-25
|
|
8
|
+
|
|
9
|
+
Fixes a NestJS DI-resolution bug in cross-entity module wiring. A generated service that injects a sibling entity's **repository** — junction `.list()` composition (CGP-60), EAV value→definition resolution (`eav_value_table`) — failed at runtime because the sibling module exported only its **service**, never its repository (ADR-002). The code typechecked (`tsc` can't see DI wiring), so it shipped and only surfaced on a consumer's first `NestFactory` boot (dealbrain-integrations).
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **`fix(templates)` — entity modules export their repository.** `templates/entity/new/clean-lite-ps/module.ejs.t` now emits `exports: [<Service>, <Repository>]`. Cross-module consumers already imported the sibling *module*; the repository was just never exported, so DI couldn't resolve it. Exporting it means the consumer injects the **home-module instance** — the only place the repo's own dependencies are wired (e.g. an EAV entity's repository injects `FieldValueService` for the sync dual-write transaction, so it can only be constructed in its home module; local-providing it elsewhere can't satisfy that dep). ADR-002 revised: the repository is part of a module's public surface; use-case internals stay unexported.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **DI-resolution smoke gate (`test/smoke/verify-boot.ts`).** Boots the generated `AppModule` via `NestFactory.create` + `app.init()` — instantiating every provider across every module — wired into the junction smoke (`run-smoke-junction.ts` step 10). Closes the gap that let the bug ship: the junction + EAV pipelines were gated only by `tsc` + grep, neither of which exercises runtime DI. Verified: reverting the repository export passes `tsc` but fails the boot gate with the exact `UnknownDependencies` error.
|
|
18
|
+
|
|
7
19
|
## [0.7.3] — 2026-05-23
|
|
8
20
|
|
|
9
21
|
Auto-emits `<generated>/subsystems.ts` — a `SUBSYSTEM_MODULES` barrel of `forRoot()` calls for every installed subsystem. Removes the "did I forget to wire `SyncModule`?" class of silent-failure bug when a subsystem is declared in `subsystems.install` but never imported into AppModule.
|
package/package.json
CHANGED
|
@@ -112,7 +112,13 @@ import { <%= classNames.searchController %> } from './<%= entityName %>-search.c
|
|
|
112
112
|
<%= searchQuery.useCaseClassName %>,
|
|
113
113
|
<% } -%>
|
|
114
114
|
],
|
|
115
|
-
|
|
115
|
+
// ADR-002 (revised): the service is the public API; the repository is ALSO
|
|
116
|
+
// exported so sibling modules that compose this entity cross-module (junction
|
|
117
|
+
// `.list()`, EAV value→definition resolution) inject the home-module instance
|
|
118
|
+
// — the only place the repo's own deps are wired (e.g. an EAV entity's repo
|
|
119
|
+
// injects FieldValueService for the #374 sync dual-write tx). Local-providing
|
|
120
|
+
// such a repo elsewhere can't satisfy those deps. Use-case internals stay unexported.
|
|
121
|
+
exports: [<%= classNames.service %>, <%= classNames.repository %>],
|
|
116
122
|
})
|
|
117
123
|
export class <%= classNames.module %> implements OnModuleInit {
|
|
118
124
|
// OPENAPI-2: register this entity's Zod schemas with the shared
|