Skip to content
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

feat(schematics): use schematicCollections instead of defaultCollection #3441

Conversation

suke
Copy link
Contributor

@suke suke commented May 28, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #3383

What is the new behavior?

Throw an exception if schematicCollections is not defined because the user may not have upgraded Angular to v14.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@netlify
Copy link

netlify bot commented May 28, 2022

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 47ffda1
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/629234b156418d0008e65b87
😎 Deploy Preview https://deploy-preview-3441--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

...value,
};
if (!(workspace['cli'] && workspace['cli']['schematicCollections'])) {
throw new Error(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we throwing an error here? If the schematicCollections property doesn't exist, we should create it and add @ngrx/schematics to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be on me 😅
#3383 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's 2vs1, I'm fine with creating the property.
I don't know what Angular's schematic will do with it though (in the case that NgRx is updated before Angular)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh ok. I was thinking of cases like Nx where it may not be present, but I think they account for that anyway. Throwing the error should be ok for now

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!
After this, we should also update the docs.

@brandonroberts brandonroberts merged commit 5abf828 into ngrx:master Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use schematicCollections instead of defaultCollection
3 participants