-
Notifications
You must be signed in to change notification settings - Fork 30
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): add custom component schematic #68
Conversation
schematics/component/index.ts
Outdated
@@ -47,8 +119,7 @@ function addImportToNgModule(options: ComponentOptions): Rule { | |||
} | |||
} | |||
host.commitUpdate(importRecorder); | |||
return host; |
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 presume it wasn't necessary to return host... my bad 😛
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.
Host should not to return here. We return the host though further up on line 36, after the modifying the fs.
} | ||
|
||
if (options.entryComponent) { | ||
// Need to refresh the AST because we overwrote the file in the host. |
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.
Can't you just commit the update later? Or does this get a bit messy?
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.
This was copied over from the angular schematic, so Im assuming it's needed. Probably to make sure that the file is properly updated and not overwriting it.
The commit message has usage examples: 527f54e |
# [1.4.0](v1.3.0...v1.4.0) (2019-02-13) ### Features * **component:** add custom component schematic ([#68](#68)) ([527f54e](527f54e))
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.4.0](ionic-team/angular-toolkit@v1.3.0...v1.4.0) (2019-02-13) ### Features * **component:** add custom component schematic ([#68](ionic-team/angular-toolkit#68)) ([527f54e](ionic-team/angular-toolkit@527f54e))
Closes #67