react-native/local-cli/generator
Martin Konicek 17c175a149 CLI: Add support for templates fetched from npm
Summary:
This PR allows anyone to publish templates for React Native.

It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
https://github.com/mkonicek/AppTemplateFeedback/issues/1

I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).

(GitHub: https://github.com/mkonicek/react-native-template-demo)

With this PR anyone can then use that template:

`react-native init MyApp --template demo`

The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.

Use a template called `react-native-template-demo` from npm:

`react-native init MyApp --template demo`

Use a local template:

`react-native init MyApp --template file:///path_to/react-native-template-dem
Closes https://github.com/facebook/react-native/pull/12548

Differential Revision: D4620567

Pulled By: mkonicek

fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a
2017-02-27 14:04:57 -08:00
..
copyProjectTemplateAndReplace.js CLI: Add support for templates fetched from npm 2017-02-27 14:04:57 -08:00
printRunInstructions.js Fix instructions in 'react-native init' 2016-12-12 09:13:30 -08:00
promptSync.js Rewrite 'react-native init' and 'react-native upgrade' without using Yeoman in preparation for templates support 2016-11-18 18:28:51 -08:00
templates.js CLI: Add support for templates fetched from npm 2017-02-27 14:04:57 -08:00