Commit a22b4c8
fix(NG0203): eliminate duplicate @angular/core via workspaces + tsconfig paths
Root cause: the library source (../src/) and the example app (example/src/)
each resolved @angular/core from their own separate node_modules trees.
esbuild bundled both instances, and Angular's injection-context check (which
uses a module-level singleton) failed in production because the directive
was registered against one instance while inject() ran against the other.
Fix 1 – npm workspaces ("workspaces": ["example"])
Declares the example as a workspace so npm hoists shared packages.
All Angular packages from example/package.json are merged into the root
devDependencies, which were also expanded to cover the full Angular set.
Fix 2 – tsconfig paths in example/tsconfig.json
Explicit path aliases for @angular/* and rxjs point every import
(including those in library source files processed via the path alias
../src/public-api.ts) to example/node_modules, guaranteeing a single
physical module regardless of which directory a source file lives in.
Also updates the CI workflow to a single `npm ci` at root (workspaces
installs everything in one pass) and supersedes the separate
setup-gh-pages workflow PR (#24).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b9f1e88 commit a22b4c8
4 files changed
Lines changed: 8861 additions & 4399 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
| |||
0 commit comments