Skip to content

feat(generators): add --minimal flag #2799

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

Closed
wants to merge 5 commits into from

Conversation

CoreyCole
Copy link

@CoreyCole CoreyCole commented Oct 11, 2017

Short description of what this resolves:

I want to implement a flag for the generate command that uses alternative templates that only include the bare minimum copypasta. Inspired from the--minimal flag in the angular-cli.

The things I would omit would be:
  • auto generated comments i.e. "Generated template for the ... "
  • ionViewDidLoad() console log
  • spec
  • ngModule
  • separate html template file (use inline template instead)

But I'm open to suggestions about what else could be altered to be more "minimal". These are just the things that I often delete straight away when I use the generator, so I'd love to automate this.

Changes proposed in this pull request:

For ionic-cli repo:
  • add minimal flag to request object
  • and metadata/description for the flag
For ionic-app-scripts repo:
  • add constant for .minimal pre extension in ionic-app-scripts/src/generators/constants.ts
  • add to skip logic in the filterOutTemplates() function in ionic-app-scripts/src/generators/util.ts
For ionic repo:
  • Add minimal ts.minimal.tmpl files for all modules except tabs

Refactors:

  • removed a comma from the page template in ionic/scripts/templates/page/ts.tmpl for consistency with other templates

@CoreyCole
Copy link
Author

@CoreyCole
Copy link
Author

Note: This is just a draft and I'd love some feedback. Honestly not sure how to build this locally & test especially because the touches are spread across 3 repos..

@imhoffd
Copy link
Contributor

imhoffd commented Oct 11, 2017

@CoreyCole Haha, yeah. Working on generators requires coordinating three repos/releases.

I personally love this idea: just generating a skeleton of the components. Just so you're aware, we are going to be taking another look at the generator architecture in the coming months. We're planning on building on the shoulders of the Angular DevKit and their "schematics" (see https://github.com/angular/devkit/tree/master/packages/angular_devkit/schematics). This is the placeholder for that project: #2407

@imhoffd
Copy link
Contributor

imhoffd commented Jan 24, 2018

@CoreyCole Would you mind joining the #ionic-cli channel on Ionic Worldwide?

@imhoffd
Copy link
Contributor

imhoffd commented May 4, 2018

@CoreyCole I think it's time to close this PR. We really want to be focusing on the future of Ionic Angular using Ionic v4 and the Angular CLI generators. If you're curious what this looks like, please see this 👉 #3019

The generators for v4 are powered by schematics and the Angular CLI. Right now they still need some work, but we're almost there.

Thanks for the PR, I apologize I wasn't able to get it in for v3 apps.

@imhoffd imhoffd closed this May 4, 2018
@CoreyCole
Copy link
Author

No worries! Thanks for the pointer

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.

2 participants