question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add template prompt for tns create

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tjvantollcommented, 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.

1reaction
sebawitacommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

tns create - NativeScript Docs
--template - Specifies a valid npm package which you want to use as a base to create your project. If --template is not...
Read more >
Starting NativeScript Apps From Templates - TJ VanToll
The easiest way to use the --template option is to point it at an existing NativeScript template up on GitHub or npm.
Read more >
Feature Request: TNS plugin create <xyz> [--template <plugin ...
I worked on a plugin template that would make making plugins a whole lot easier. Basically it would generate everything you needed for...
Read more >
tns-template-plugin - npm
tns -template-plugin. Quickly builds a NativeScriot plugins This will automatically create: source code; License; Readme; package.json ...
Read more >
Creating Design-Time Prompts for Custom Templates
Custom templates and design-time prompts are supported in Oracle Hyperion Financial Management, Oracle Hyperion Planning, and Oracle Essbase Block Storage ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found