-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(schematics): detect package version from node modules #12535
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
refactor(schematics): detect package version from node modules #12535
Conversation
* No longer hard codes the Angular Material and Angular version name in the schematics. The schematics will look for the Material or CDK `VERSION` object in the node modules. * For the Angular version, we look for the `@angular/core´ version in the `package.json` and try to use that. Falling back to the the `0.0.0-NG` placeholder that specifies the required Angular version for Material and the CDK.
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.
I actually don't want to read the Angular version from the package.json
. the way it is now, we have the flexibility to publish a range that is more broad than what we're installing. The required version should always be an explicit choice.
Are we talking just about the version for the Otherwise the peer dependencies of I'm fine just switching the |
I think I misunderstood your description. Would it be accurate to say
? |
Sorry, the PR actually has two changes and I probably wasn't too clear in the description.
This is needed because when running: |
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
I should have just looked at the code instead of only reading the description
haha, my fault, sorry 😄 I felt like this was clear enough, but apparently it was too difficult to cover both two things in a short but clear way. |
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. |
No longer hard codes the Angular Material and Angular version name in the schematics.
For the CDK and Material version, the schematics will look for the according
VERSION
object in the node modules.For the Angular version, we look for the
@angular/core
version in thepackage.json
and try to use that. Falling back to the the0.0.0-NG
placeholder that specifies the required Angular version for Material and the CDK.