Repository navigation
fix(graph): resolve Vue paths aliases against the declaring tsconfig without baseUrl - #268
Merged
Conversation
…ctory
A .vue specifier is resolved by findAssetCandidate so the edge reaches the SFC, not a declaration shim. Without baseUrl its alias root was the importer's directory, but TypeScript resolves paths against the declaring tsconfig (pathsBasePath). @/components/A.vue under paths { "@/*": ["./src/*"] } was never found and every change fell back with "Unresolved Vue dependencies". Root aliases now resolve from the root baseUrl or the repository root, as for assets.
Signed-off-by: FredApps <[email protected]>
FredApps
commented
Nov 17, 2026
FredApps
left a comment
Contributor
Author
There was a problem hiding this comment.
Cross-review of 1bd1d17.
Checked:
- The fix matches #267. With the importer's own
paths, the.vuelookup now resolves againstbaseUrlor TypeScript'spathsBasePath, asresolvePatternTargetsalready does. Without them it resolves the root aliases from the repository root (or the rootbaseUrl) instead of the importer's directory. - The new test fails with
src/reverted (2 of 3 fail) and passes with the fix.tests/repo/vue-alias-paths-base.test.tsis listed inrelease-files.json. The commit is DCO-signed. The branch is level with main. CI is green.
Fixed: nothing.
Still open (minor, not blocking): the comment says root aliases resolve "as for assets". The asset lookup further down passes repoPath with no baseUrl, so the two differ when the root tsconfig sets a baseUrl other than .. In a Vue-scoped package, profile.pathAliases already carry the package prefix, so applying the root baseUrl on top could miss. A miss there keeps the existing "Unresolved Vue dependencies" fallback, so it stays safe.
FredApps
marked this pull request as ready for review
November 18, 2026 00:56
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.
Fixes #267
.vuecandidates frompathsare now resolved againstbaseUrl, then the declaring tsconfig's directory (pathsBasePath), and only then the importer's directory. Root-alias resolution is unchanged.The solution-style layout (paths only in a referenced
tsconfig.app.json) is not covered and still falls back.Validation:
tests/repo/vue-alias-paths-base.test.ts: root and nested tsconfig withoutbaseUrlfail onmainand pass here. ThebaseUrlcase passes on both.npm run typecheck,npm test(1170 pass),npm run build,npm run audit:boundary.