-
Notifications
You must be signed in to change notification settings - Fork 12k
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(generate): revert change to component dir in generate module #3158
fix(generate): revert change to component dir in generate module #3158
Conversation
8026eb7
to
99a9002
Compare
Adding @filipesilva since @Brocco is traveling and may not have time to check this. This is important because basically |
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.
@Meligy can you add tests to show this worked as you expected? You can use the scenario you mentioned as generating the wrong output, and verify the import is in the right file via a regex in expectFileToMatch
.
99a9002
to
0471178
Compare
…it caused component declaration to go to parent module
0471178
to
b679089
Compare
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.
@filipesilva test updated, CI passed.
Thank you for fixing this @Meligy! |
@filipesilva you are super awesome man. Thanks a lot for the merge, and especially for the testing guidance showing the goodness with e2e tests. Can you please release beta.20-5 or beta.21 with this fix? Again, I really wouldn't be that pushy if it weren't an issue with a common command and released already. Cheers, |
We should have a release soon, that'll include this and some performance fixes. |
Brilliant! Just saw another fairly critical issues in Angular 2.2.0 itself too angular/angular#12911. As per #3175 (comment), there should be a 2.2.1 release with the fix soon. Might be a good idea to wait to include that in the next beta as well. |
Actually 2.2.1 is out already https://github.com/angular/angular/blob/master/CHANGELOG.md. That would be good to have in next release, although the NPM version check should match it anyway. |
…it caused component declaration to go to parent module (angular#3158)
…it caused component declaration to go to parent module (angular#3158)
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. |
fix(generate): revert change to component dir in generate module, as it caused component declaration to go to parent module
This fixes regression introduced in the code-review of PR #3066. The PR deals with
generate module
command, and the component generated with the module.In the code review, it was requested to change the way component was created as
flat
. I did that, but this is causing the following problem:If you run:
The files are created in
src/app/test
correctly (and hence the tests pass), but the componentsrc/app/test/test.component.ts
is added to theNgModule
declarations
ofAppModule
, notTestModule
.This is because with switching
flat
false and giving the module folder as the component folder, the CLI looks for a module to add declarations ABOVE the module folder.So, now I reverted the code to the original code in #3066 before the code review.