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): implement router store ng-add #1487

Merged
merged 2 commits into from
Dec 31, 2018

Conversation

ngfelixl
Copy link
Contributor

Add ng-add schematics for the router-store
add schema
implement tests

Closes #1479

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?

The user is not able to use Angular CLI to add the NgRX Router Store.

What is the new behavior?

The user is able to use Angular CLI to add the NgRX Router Store.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Read the ng-add schematics implementation of the store-devtools and effects modules first. I have done this implementation with their code style in mind.

Is it correct to leave the module attribute inside the schema? Was not sure about this, since it just belongs in the root module, doesn't it? But the store-devtools schematics provides a module specification as well, so I decided to leave it as is.

add ng-add schematics, add schema
implement tests

Closes ngrx#1479
@ngrxbot
Copy link
Collaborator

ngrxbot commented Dec 26, 2018

Preview docs changes for 51790c2 at https://previews.ngrx.io/pr1487-51790c2/

"aliases": ["init"],
"factory": "./ng-add",
"schema": "./ng-add/schema.json",
"description": "Add router store class"
Copy link
Member

Choose a reason for hiding this comment

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

Update description to "Register @ngrx/router-store within your application"

"description": "Allows specification of the declaring module.",
"alias": "m",
"subtype": "filepath"
}
Copy link
Member

Choose a reason for hiding this comment

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

The project key is missing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The project keys are also missing in /modules/MODULE/schematics/ng-add/schema.json as they are merged with #1067, at least for effects, store or store-devtools. But for example in /modules/schematics/src/MODULE/schema.json they are included.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. That can be done in a separate PR.

add project property in collection.json
change description in schema.json
@ngrxbot
Copy link
Collaborator

ngrxbot commented Dec 27, 2018

Preview docs changes for 442109a at https://previews.ngrx.io/pr1487-442109a/

ngfelixl added a commit to ngfelixl/platform that referenced this pull request Dec 29, 2018
Add missing project keys to schema.json
for store, store-devtools and effects
Line-break remove related to "lint-staged"

Related to ngrx#1487
@brandonroberts brandonroberts merged commit 9da4aac into ngrx:master Dec 31, 2018
@brandonroberts
Copy link
Member

Thanks @ngfelixl!

brandonroberts pushed a commit that referenced this pull request Dec 31, 2018
@ngfelixl ngfelixl deleted the router-store-ng-add branch January 1, 2019 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Router Store: Add ng-add schematic
3 participants