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): add custom component schematic #68

Merged
merged 5 commits into from
Feb 6, 2019

Conversation

mhartington
Copy link
Member

Closes #67

imhoffd
imhoffd previously approved these changes Feb 5, 2019
schematics/component/schema.json Outdated Show resolved Hide resolved
@@ -47,8 +119,7 @@ function addImportToNgModule(options: ComponentOptions): Rule {
}
}
host.commitUpdate(importRecorder);
return host;
Copy link
Contributor

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 😛

Copy link
Member Author

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.
Copy link
Contributor

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?

Copy link
Member Author

@mhartington mhartington Feb 6, 2019

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.

@imhoffd imhoffd merged commit 527f54e into master Feb 6, 2019
@imhoffd imhoffd deleted the fix-component-gen branch February 6, 2019 17:42
@imhoffd
Copy link
Contributor

imhoffd commented Feb 6, 2019

The commit message has usage examples: 527f54e

Ionitron added a commit that referenced this pull request Feb 13, 2019
# [1.4.0](v1.3.0...v1.4.0) (2019-02-13)

### Features

* **component:** add custom component schematic ([#68](#68)) ([527f54e](527f54e))
@Ionitron
Copy link
Collaborator

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

wand1252 added a commit to wand1252/angular-toolkit-develop that referenced this pull request Aug 31, 2022
# [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants