ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Configurable Starters

Open imhoffd opened this issue 7 years ago • 12 comments

Many framework CLIs have a single starter with feature flags to enable/disable/switch certain features and preferences such as TypeScript, testing frameworks, theme, etc. We've already seen requests for this, such as https://github.com/ionic-team/ionic-cli/issues/3490, https://github.com/ionic-team/ionic-cli/issues/4236

The starters in place for Ionic 4 beta are the typical Ionic-style starters, but can we make one starter where the contents and options are configurable? Can ionic start prompt for all these options?

Examples:

ionic start --nav-style=tabs
ionic start --no-karma
ionic start --theme=dark
ionic start --no-lazy-loading
ionic start --css

imhoffd avatar Aug 08 '18 20:08 imhoffd

I think this(--no-karma, --theme=dark, --no-lazy-loading) is possible. After git clone, CLI change templates is not difficult. For examle, this. https://github.com/ionic-team/ionic-cli/pull/3477/commits/578ab613cdb26a99e5a4afcfa6ac47e5ba0122a5#diff-4a980f27a232e57ec064ec6e999db520R655

rdlabo avatar Aug 09 '18 11:08 rdlabo

I'm not certain how scalable that is. If the starter's file structure changes even slightly, it could result in runtime errors and will be difficult to maintain.

Your PR for the -s flag could easily be a part of this new type of starter, however:

ionic start --no-karma --feature-structure=type

^ This would start a new app without karma and the old way of structuring features (pages, components, etc).

imhoffd avatar Aug 09 '18 14:08 imhoffd

I'm glad for v3's folder structure can also be used in v4! May I try to challenge implementation?

rdlabo avatar Aug 25 '18 02:08 rdlabo

A note: the important conceptual change here is that the logic of how to structure a starter is shifted onto the starter template itself, and the Ionic CLI becomes just a way to ask for inputs and write files. This makes ionic start more bullet-proof and future-proof, on top of unlocking a bunch of features.

cc @johneast

imhoffd avatar Aug 20 '19 00:08 imhoffd

Hi, @dwieeb Will we have this feature soon on the Ionic 5 app? i.e. create CSS apps. Because of @adamdbradley instruct us to use CSS only apps. It is here: https://twitter.com/adamdbradley/status/1250790908833955840

Sampath-Lokuge avatar Apr 21 '20 19:04 Sampath-Lokuge

Probably not soon, no. I wouldn't make decisions for your organization based on opinions on Twitter. Use what works best for you and your team. In the meantime, it isn't terribly difficult to change an Ionic Angular app to use CSS if that's what you want.

imhoffd avatar Apr 21 '20 19:04 imhoffd

@dwieeb it isn't terribly difficult to change an Ionic Angular app to use CSS if that's what you want. Yes, what is the best way to do that? Are you telling me to change each and every SCSS file manually after it was generated by the CLI or else?

Sampath-Lokuge avatar Apr 21 '20 20:04 Sampath-Lokuge

Are you telling me to change each and every SCSS file manually after it was generated by the CLI

Yes. You could also start with an Angular app (with the css option) and run the ng add @ionic/angular, but I haven't tried that myself.

imhoffd avatar Apr 21 '20 20:04 imhoffd

@dwieeb

You could also start with an Angular app (with the css option) and run the ng add @ionic/angular

I don't think this is a good option since we cannot create Side menu, Tabs and Capacitor apps by default here. It will be a big loss for us.

The manual change also an annoying thing since we need to change the file extension and its usage file and etc.

So our only hope here is you'll give this soon for us!

Sampath-Lokuge avatar Apr 21 '20 21:04 Sampath-Lokuge

Yeah, there isn't an ideal workaround right now. Hopefully I can prioritize configurable starters soon.

imhoffd avatar Apr 22 '20 01:04 imhoffd

@dwieeb Thanks a lot. We'll highly appreciate it since now CSS is the default template for almost all the top frameworks. That is manually due to CSS supports variables and a lot more now and evolving it rapidly.

Sampath-Lokuge avatar Apr 22 '20 11:04 Sampath-Lokuge

Any progress on this?

eliashdezr avatar May 05 '23 08:05 eliashdezr