-
Notifications
You must be signed in to change notification settings - Fork 6.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(ng-update): properly handle update from different working directory #19934
fix(ng-update): properly handle update from different working directory #19934
Conversation
d41fd2c
to
841ea3a
Compare
841ea3a
to
ce40cfd
Compare
} | ||
|
||
readDirectory(dirPath: Path): DirectoryEntry { | ||
const {subdirs: directories, subfiles: files} = this._tree.getDir(dirPath); |
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.
Not something we control, but it's a little weird for this to be called "sub files" since all files are nested in each other. Maybe we can change it if we're changing other things.
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.
Yeah, it's definitely a bit ambiguous. You mean that we create a proposal upstream for them to change it?
In some situations, developers will run `ng update` from a sub directory of the project. This currently results in a noop migration as file system paths were computed incorrectly. This is because ng-update always assumed that the CWD is the workspace root in the real file system. This is not the case and therefore threw off path resolution. We fix this by fully relying on the virtual file system now. Previously we mixed virtual and real file system as TypeScript relied on the real file system for parsing configuration, matching and reading files. This commit adds a new compiler host for config parsing and program creation that works fully with a virtual file system. This is something we had planned a long time ago as schematics should never deal with the real file system. We can re-use this logic in other repositories too (such as Angular framework, potentially the CLI, and universal schematics). Ideally we will share this as part of better tooling for migrations. Fixes angular#19779.
…lesheets Previously we globbed the project directory for global stylesheets per target of a project. This is unnecessary and slowing down the update as the project root remains the same across arbitrary targets.
ce40cfd
to
196feda
Compare
@crisbeto I've addressed the feedback. Thanks! |
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.
LGTM
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. |
In some situations, developers will run
ng update
from a sub directoryof the project. This currently results in a noop migration as file
system paths were computed incorrectly. This is because ng-update
always assumed that the CWD is the workspace root in the real file
system. This is not the case and therefore threw off path resolution.
We fix this by fully relying on the virtual file system now. Previously
we mixed virtual and real file system as TypeScript relied on the
real file system for parsing configuration, matching and reading files.
This commit adds a new compiler host for config parsing and program
creation that works fully with a virtual file system. This is something
we had planned a long time ago as schematics should never deal with
the real file system. We can re-use this logic in other repositories
too (such as Angular framework, potentially the CLI, and universal
schematics). Ideally we will share this as part of better tooling for
migrations.
Fixes #19779. Resolves COMP-387.