Repository navigation
Set rootDir so library imports resolve in tsc - #71
Merged
Merged
Conversation
The components and api.service.ts import the shared interfaces straight from library/src/models instead of a built package, so the program's inputs reach outside frontend/. tsc inferred rootDir as frontend/ and rejected all eleven import sites with TS6059. TypeScript 5.9 tolerated this, but bd4cb9a bumped the frontend to ^6.0.3, which enforces rootDir. ng build stayed green the whole time because @angular/build's esbuild pipeline does not check it, so only tsc broke. Point rootDir at the repo root, which contains both frontend/src and library/src.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tscrejects every one of the elevenlibrary/src/modelsimport sites in the frontend:The components and
api.service.tsimport the shared interfaces straight from the library source (../../../library/src/models) rather than from a built package, so the program's inputs reach outsidefrontend/. With norootDirconfigured, tsc infersfrontend/and rejects them.TypeScript 5.9 tolerated this.
bd4cb9a("Upgrade to Angular 22") bumped the frontend fromtypescript: ^5.9.3to^6.0.3, which enforcesrootDir. That is the regression.Why CI stayed green
bun run buildrunsng build, whose@angular/buildesbuild pipeline does not enforcerootDir. Only a directtscinvocation breaks, which is why this surfaced in the editor rather than in a failing build. The Frontend CI workflow never caught it.Fix
One line in
frontend/tsconfig.app.json:The repo root contains both
frontend/srcandlibrary/src, so the program's inputs are all covered.Verification
npx tsc -p tsconfig.app.json --noEmit(TS 6.0.3)npx ng buildTS 5.9.3 was also run against the pre-fix config to confirm it was clean there, isolating the TypeScript bump as the trigger.
Not included
This fixes the type-check only. Two unrelated local issues surfaced during diagnosis and are left alone:
mock-api.cjsfrom a prior session was sharing port 3000 with the real backend, splitting requests between the two. Its/brand/:idlookup used a raw string id, so every brand detail request returned404 {"error":"not found"}. Killed locally; nothing in the repo.bunon PATH resolves to a 1.3.14 install whilebackend/src/bun-version-guard.tsrequires >= 1.4.1. A freshbuninvocation can fail to start the backend. Needsbun upgrade; an environment fix, not a repo one.