Closed discosultan closed 6 years ago
please also update the README of frint-cli
.
and also the root README of the repo under Quickstart
.
@fahad19 Before updating all the docs, is the command interface final? I mean mostly naming for params: path
& example
and using the structure --<param>=<value>
.
if --path
is already present in the command, do we need an additional --example
too?
The <name>
option can be renamed as <directory>
or something more descriptive to avoid any confusion. I first thought <name>
is for example's name :)
I think both --name
and --example
are confusing flags in this context. If you're creating a new project, I suppose you want to determine the --template
instead of the location/name of the example project it will download. Just my opinion but I'm ok with the current flags if you've had discussions on it already.
if --path is already present in the command, do we need an additional --example too?
Currently they are separated in order not to always have to specify the full path with <example>
. If you don't specify <path>
, it will default to the official repo. Alternative would be to make <example>
"smarter" to figure out itself whether it is defined as a full path or only an example name.
The
option can be renamed as or something more descriptive to avoid any confusion. I first thought is for example's name :)
I agree only because all it currently does is create and name a directory. If it were to also transform package.json
, for example, to name the application, then <name>
would feel better. But this is something that can be changed in the future without compat issues. Therefore, I'll rename it to <directory>
😁.
I think both --name and --example are confusing flags in this context. If you're creating a new project, I suppose you want to determine the --template instead of the location/name of the example project it will download. Just my opinion but I'm ok with the current flags if you've had discussions on it already.
Yeah, it's a bit confusing, because the intents of scaffolding a template vs setting up an example are sort of mixed. But previous frint init
worked the same way, so I'm happy with keeping it the way it is.
I kinda like the way dotnet new
works:
--output
--name
--language
, --auth
, etc.)So you can do:
dotnet new mvc
: scaffolds an MVC app in the current directory with the default name. I like that this command looks really intuitive, and usually this is what you want.dotnet new console --output ~/myapp --name foo --language f#
: scaffolds an F# Console app in the folder ~/myapp
, but uses the name foo
Not saying that we should do the same, just wanted to mention as an example.
this is the guide from Ember CLI for example: https://ember-cli.com/user-guide/#using-ember-cli
Also with Yeoman, the name of the template (which I think is the most important thing) is a non-flag argument.
@markvincze Yeah, that's the difficult part - there are so many different CLI schemes out there. This particular impl is based on a scheme used by Node Express framework CLI.
Very good point, @jackTheRipper ! We should definitely make both tools "feel" the same. We still have frint init
, but I'm not aware of how appix
CLI works. We might want to review both of them and make necessary adjustments before this PR gets merged.
@discosultan: any update on this? :)
I need to compare it to appix
to ensure interface similarity. Hopefully will get to it soon :)
@fahad19 I think this one is good to go now.
new
'ing in current dir, specified dir and from custom repo@discosultan: awesome work! 🎉
this PR is gonna be highly impactful for beginners!
do you think it is wise to wait until we move to frintjs
org before we merge this? the download URL can then point to the correct URL then.
let me know what you think.
@fahad19 Sure, I don't see any reason to rush it. Let's make the switch to new org, then I will update the init
and new
commands and then we can merge it.
cool! 👍
Refs #355
@discosultan: can merge as soon as the URL is updated.
@fahad19: will update after lunch
All should be done now
About
Closes https://github.com/Travix-International/frint/issues/220
Introduces the
frint new
command which will replacefrint init
in the future. For more information, see the issue above.where:
<directory>
(optional) - name of the app folder to create. If not specified, will populate current working dir<path>
(optional, default=frintjs/frint/tree/master/examples
) - GitHub repository path for example apps<example>
(optional, default=i.) - has two different shapes:<name>
(default=counter
) - name of the example to fetch from FrintJS official repository<organization>/<repository>/tree/<branch>/**
- full path to arbitrary GitHub repository to fetch an example fromTesting
Can be tested running the following script:
The script will generate four test folders in the current working dir for various
frint new
scenarios.