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 App Name Configurable on Scaffold #546

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 Piral instance 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 --app-name (i.e., having app-name / appName) 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-piral.ts#L138

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 appName from the options.