Skip to content

Commit fb2eb38

Browse files
committed
docs(README): clarify platform governance and dependency checks for client builds
1 parent 0a1b980 commit fb2eb38

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,22 +478,24 @@ When a feature is removed from a client config, its initializer disappears autom
478478

479479
## Platform Governance
480480

481-
To ensure each client build is a hermetically sealed artifact, the pre-build engine enforces strict governance. When a feature is loaded from the registry by version, the script enforces that the feature's `peerDependencies` are satisfied by the shell's installed dependencies.
481+
To ensure each client build is a **hermetically sealed** artifact, the pre-build engine enforces strict dependency governance on every feature — catching incompatibilities at build time, long before a bad artifact reaches your deployment pipeline.
482482

483-
This prevents "Module Federation version mismatch" errors by catching framework or library version mismatches (e.g. an Angular 18 feature in an Angular 21 shell) before a bad build ever reaches your deployment pipeline.
483+
When `prepare-build` resolves a feature's `package.json`, it iterates over **all** `peerDependencies` declared by that feature and verifies each one is satisfied by the shell's installed dependencies. This applies universally — both versioned registry packages and local workspace features are checked. (In practice, local features naturally satisfy their peers because they share the workspace's `node_modules`, but the check remains as a safety net.)
484484

485-
The enforced peers are: `@angular/core`, `@angular/common`, `@angular/router`, `rxjs`.
486-
487-
If a violation is detected, the build fails immediately with a clear message:
485+
This semantic governance loop prevents framework or library version mismatches (e.g. an Angular 18 feature composed into an Angular 21 shell) from silently producing a broken build. The build fails immediately with a typed `NacsGovernanceError` and an actionable message:
488486

489487
```
490-
STRICT GOVERNANCE FAILURE: Version mismatch in @nacs/feature-a@1.0.0
491-
The shell's core dependencies do not satisfy the feature's peer requirements:
488+
NACS GOVERNANCE FAILURE: Version mismatch in @nacs/feature-a@1.0.0
489+
The shell's dependencies do not satisfy the feature's peer requirements:
492490
- @angular/core: Feature requires '>=18 <19', Shell provides '~21.2.0'
493-
Resolution: Update the client config to a newer feature version, or recompile the feature.
491+
Resolution: Update the client config to a newer feature version, or align the feature's dependencies.
494492
```
495493

496-
Local workspace features (no `version` field) are not checked — they share the workspace's `node_modules` directly and are always in sync.
494+
If a peer dependency is missing entirely from the shell, the error surfaces that too:
495+
496+
```
497+
- some-dep: Feature requires '^3.0.0', but Shell does not provide it.
498+
```
497499

498500
---
499501

0 commit comments

Comments
 (0)