smapiot / piral

🚀 Framework for next generation web apps using micro frontends. ⭐️ Star to support our work!
https://piral.io
MIT License
1.71k stars 127 forks source link

Make Pilet Name Configurable on Scaffold #547

Closed FlorianRappl closed 2 years ago

FlorianRappl commented 2 years ago

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

Right now the pilet's name is decided by the base name of the used directory (target). This should be made configurable, with the current setting (base name of the used directory) being the default.

Background

Maybe the directory is a bit misleading, the package should be scoped, or similar. We should support such cases without need to edit the package.json afterwards.

Discussion

What should the parameter name be? I think --pilet-name (i.e., having pilet-name / piletName) would be good.

Implementation

Right now the project name is determined here https://github.com/smapiot/piral/blob/develop/src/tooling/piral-cli/src/apps/new-pilet.ts#L132

It should be made available as options, where undefined is the default. This way, we can just assign basename(root) as default value when getting the piletName from the options.

mgarciaar commented 2 years ago

Hello! I would like to take this issue too. I did the #546 and it's a very similar issue. Are you comfortable with this? Maybe you prefer that someone new fix this.

Regards

FlorianRappl commented 2 years ago

Nope you can take it @mgarciaar - much appreciated!

mgarciaar commented 2 years ago

Hi @FlorianRappl , I was thinking... Wouldn't it be more clear if we add the parameter "--name" instead of --pilet-name? Same goes for piral new --app-name. As there are two separate commands for piral and pilets, doing: piral new --name=test and/or pilet new --name=piletname would have a better syntax.

What do you think?

FlorianRappl commented 2 years ago

What do you think?

I think this is a great idea 💡 ! It would be the same for both commands, so less confusion and easier to remember.

Yeah let's have --name for pilet new and --name for piral new :beers: