Skip to content

Add template prompt for tns create #1498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tjvantoll opened this issue Feb 17, 2016 · 11 comments
Closed

Add template prompt for tns create #1498

tjvantoll opened this issue Feb 17, 2016 · 11 comments
Labels

Comments

@tjvantoll
Copy link
Contributor

Now that we have a lot of templates available I think we should do more to expose them. The --template option is great but it’s somewhat hidden, and I don’t think people will find most of the templates we have out there.

I propose that we add a prompt to tns create that asks which template you’d like to start with if you don’t provide the --template option. Something like this:

$ tns create foo
What template would you like to start with?
[1] Hello world (a minimal starting point)
[2] Master/detail
[3] Tab view
[4] TypeScript hello world
[5] Angular 2
$ Your selection: [ ]

Thoughts?

@Daxito
Copy link

Daxito commented Feb 17, 2016

+1

@NathanaelA

This comment was marked as abuse.

@burkeholland
Copy link

👍 BUT with a caveat. I don't think Angular 2 should be a lone template. All of the listed templates should be available as Angular 2 flavors with something like a ng flag on the command line.

@tjvantoll
Copy link
Contributor Author

Just to throw a simpler idea out there, we could simply add on to the informational message we already spit out with tns create.

From:
“Project foo was successfully created”

To:
“Project foo was successfully created using the Blank template. Start with alternative templates using tns create --template

@Plamen5kov
Copy link
Contributor

👍 for Project foo was successfully created using the Blank template. Start with alternative templates using tns create --template

@enchev
Copy link
Contributor

enchev commented Jun 3, 2016

Maybe we can list all available templates when you call tns create without project name? In this case the developer will be able to choose which template to be used when creating the project and later (answering to second question) specify the project name.

@enchev enchev added the feature label Jun 13, 2016
@tjvantoll
Copy link
Contributor Author

tjvantoll commented Jul 20, 2017

Since we’re about to release a new suite of starting templates, I think this feature is somewhat essential to ensure that our users find these templates we’re putting out there. Here’s my more up-to-date suggestion for how this could work.

> tns create MyApp

Which template would you like to start with?

   [1] JavaScript — Master/Detail
   [2] JavaScript — Drawer Navigation
   [3] JavaScript — Tab Navigation
   [4] TypeScript — Master/Detail
   [5] TypeScript — Drawer Navigation
   [6] TypeScript — Tab Navigation
>  [7] Angular    — Master/Detail
   [8] Angular    — Drawer Navigation
   [9] Angular    — Tab Navigation

All set! Documentation for the “Angular—Master/detail” template is available at https://github.com/NativeScript/template-master-detail-ng/tree/myankov/readme.

Use “cd MyApp” to get started developing your new app!

We could also consider breaking that up into two separate questions—aka ask JS vs. TS vs. ng first, then ask master/detail vs. tabs vs. drawer next—although I think that might be a bit much.

Regardless though I think we need something like this to expose all the new templates we now have.

@Plamen5kov
Copy link
Contributor

@tjvantoll I think the idea to provide the user with options about what template to use is great, and I also believe there needs to be a separation between js and ts templates. Having said that, I believe there's no need for further separation like: master/detail vs. tabs vs drawer next.

@tjvantoll
Copy link
Contributor Author

tjvantoll commented Jul 20, 2017

@Plamen5kov I do worry that there are a whole ton of options now, and the CLI repo is probably not the greatest place for this list to live for maintenance purposes.

Way earlier in this thread I suggested that we use a simple message, and we could still go with that approach. Something like...


$ tns create MyApp

Project MyApp was successfully created using the JavaScript—Blank template.
View a full list of starter templates at https://docs.nativescript.org/starter-templates/.

Use cd MyApp to get started developing your new app!


With this approach we could create a big list of the templates on the docs, which would be a heck of a lot easier to maintain. cc @sebawita, as I know he wanted to be involved in how we document these new templates.

@sebawita
Copy link

sebawita commented Jul 25, 2017

I am actually thinking of creating a custom CLI extension (just as a temporary solution) that would let us search and create the templates :)

tns template list
tns template new ProjName

@tjvantoll
Copy link
Contributor Author

Closing in favor of #3829 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants