-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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) use default project if project is not provided #1598
Refactor(schematics) use default project if project is not provided #1598
Conversation
Preview docs changes for d234c09 at https://previews.ngrx.io/pr1598-d234c09/ |
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.
Could you also write a test for this change?
@@ -13,7 +13,10 @@ export function getProject( | |||
const workspace = getWorkspace(host); | |||
|
|||
if (!options.project) { | |||
options.project = Object.keys(workspace.projects)[0]; | |||
options.project = | |||
workspace.defaultProject != undefined |
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.
workspace.defaultProject != undefined | |
workspace.defaultProject !== undefined |
This is draft PR, will let you know once i complete it. |
Preview docs changes for cc3aeca at https://previews.ngrx.io/pr1598-cc3aeca/ |
Preview docs changes for c5204d3 at https://previews.ngrx.io/pr1598-c5204d3/ |
@@ -18,7 +18,7 @@ describe('Store Schematic', () => { | |||
); | |||
const defaultOptions: StoreOptions = { | |||
name: 'foo', | |||
project: 'bar', |
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.
Don't modify existing defaults. Add an additional test that provides an empty project
Preview docs changes for 69f08c7 at https://previews.ngrx.io/pr1598-69f08c7/ |
…or(Schematics)-use-defaultProject-if-project-is-not-provided
Preview docs changes for 9fc7fe6 at https://previews.ngrx.io/pr1598-9fc7fe6/ |
LGTM. @timdeschryver ? |
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.
Also LGTM 👍
@santoshyadav198613 if you'll mark this a ready for review, we'll get it merged. |
Done. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Take defaultProject in case project flag is not provided.
What is the current behavior?
First project from project array is considered when project flag is not provided.
Closes #1564
What is the new behavior?
Does this PR introduce a breaking change?
Other information