Closed FlorianRappl closed 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
Nope you can take it @mgarciaar - much appreciated!
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?
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:
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., havingpilet-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 assignbasename(root)
as default value when getting thepiletName
from the options.