CLI for Relay.js
npm install -g relay-cli
Quickest way to get started with relay-cli
$ relay init awesome-project
$ cd awesome-project
$ relay g component dashboard index
$ relay v -c
$ relay g container dashboard index
$ relay v -d
$ relay g route dashboard index
$ relay v -r
alias: i
Project name.
alias: g
Module name where the react component should be placed within. (Subdirectory within components directory)
React component name.
alias: g
Module name where the Relay container should be placed within. (Subdirectory within components directory)
Relay container name.
alias: g
Module name where the Relay route should be placed within. (Subdirectory within components directory)
Relay container name.
alias: g
Module name where the Relay route should be placed within. (Subdirectory within components directory)
Relay route name.
To use realy-cli in existing React project navigate to directory where React components are created.
Create realy-cli configuration file, .relayclirc
. Add configuration in key value pairs.
{
"client": "js"
}
Example: This specifies that React components are placed in js/components
directory.
- Fork the repository.
- Clone the forked repository.
- Create your own branch.
- Create tests and make sure tests pass on travis.
- Create a pull request with changes made.
- Generate Relay projects
- Generate customizable React components
- Create containers, routes
- Configurable for existing Relay projects
MIT © 99XT