-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ngcc): compute the correct package paths for a target entry-points #40376
fix(ngcc): compute the correct package paths for a target entry-points #40376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a typo in the commit message header, which mentions "a target entry-points"
packages/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.ts
Outdated
Show resolved
Hide resolved
Previously, if there were path-mapped entry-points, where one contaied the string of another - for example `worker-client` and `worker` - then the base paths were incorrectly computed resulting in the wrong package path for the longer entry-point. This was because, when searching for a matching base path, the strings were tested using `startsWith()`, whereas we should only match if the path was contained in a directory from a file-system point of view. Now we not only check whether the target path "starts with" the base path but then also whether the target path is actually contained in the base path using `fs.relative()`. Fixes angular#40352 Fixes angular#40357
09c9c56
to
7e7769a
Compare
Since the commit message needed updating I just amended the commit. |
…40376) Previously, if there were path-mapped entry-points, where one contaied the string of another - for example `worker-client` and `worker` - then the base paths were incorrectly computed resulting in the wrong package path for the longer entry-point. This was because, when searching for a matching base path, the strings were tested using `startsWith()`, whereas we should only match if the path was contained in a directory from a file-system point of view. Now we not only check whether the target path "starts with" the base path but then also whether the target path is actually contained in the base path using `fs.relative()`. Fixes #40352 Fixes #40357 PR Close #40376
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously, if an entry-point started with the string of another package that
is included in
paths
mappings, then the base path was incorrectly computedresulting in the wrong package path for the entry point.
Now we not only check whether the target path "starts with" the base path
but then also whether the target path is actually contained in the base path
from a file-system directory point of view.
Fixes #40352
Fixes #40357