react-reality-cli
Command line interface for react-reality projects
Installation
yarn global add rhdeck/react-reality-cli
or
npm i g rhdeck/react-reality-cli
Usage
init
Create a new react-reality project
react-reality init myproject
or use the short alias:
rr init myproject
Fun Fact You can use rr
as an alias for any of your react-native
commands. rr run-ios
helps, and is shorter!
Templates
Specify the react-reality template you want to use for faster initialization:
react-reality init myproject --template <mytemplate>
or try the short version
rr init myproject -t <mytemplate>
Pre-Built Templates
To help with learning react-reality, some basic apps are available as templates
holokit
Deploys a package designed for use with HoloKit heads-up stereoscopic display.
rr init myproject -t holokit
URL
Any url specified with a file://, http:// or https:// scheme will reference a react-reality template a that location.
rr init myproject -t https://github.com/rhdeck/react-reality-template-holokit
npm scoped project
Any argument prefixed with a @ and containing a slash is assumed to be a scoped npm project, in the form @scope/project. Passes through to npm
rr init myproject -t @myscope/mytemplate
GitHub repository
Any argument containing a slash (that does not start with the @) is assumed to refer to a github repository, and builds a https url to access it.
rr init myproject -t rhdeck/react-reality-template-holokit
NPM projects
Any other string tries to build a URL from NPM with the prefix "react-reality-template-", like a react-native template would.
rr init myproject -t holokit
Note on building templates of your own
Templates parallel the build system from react-native. They must contain:
package.json
used for identification only. Should include a name and version.dependencies.json
indicating dependencies that should be added to the project. (should include the react-reality package and react-native-swift at a minimum)- Any other files you want copied into your package that would override the core react-native files. Usually
App.js
is defined here, since it is the center of the app experience.
Note Templates are installed by first adding then removing from your dependencies. So you will not find them in your project post-install.