# rctr

> React CLI

Latest version **1.0.5** (published 2020-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install rctr
pnpm add rctr
yarn add rctr
bun add rctr
```

Provides the command `rx`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-02-10 |
| First published | 2020-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 270.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Steve Belovarich |
| Maintainers | steveblue |

## Links

- npm: https://www.npmjs.com/package/rctr
- Repository: https://github.com/steveblue/reactor
- Homepage: https://github.com/steveblue/reactor#readme
- Issues: https://github.com/steveblue/reactor/issues
- npm.io page: https://npm.io/package/rctr

## Dependencies (10)

- [ora](https://npm.io/package/ora.md) ^4.0.3
- [glob](https://npm.io/package/glob.md) ^7.1.6
- [rxjs](https://npm.io/package/rxjs.md) ^6.5.4
- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [findup](https://npm.io/package/findup.md) ^0.1.5
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.1
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [prettier](https://npm.io/package/prettier.md) ^1.19.1
- [commander](https://npm.io/package/commander.md) ^4.1.0
- [single-line-log](https://npm.io/package/single-line-log.md) ^1.1.2

## Recent versions

- 1.0.5 (latest) — 2020-02-10
- 1.0.4 — 2020-02-06
- 1.0.3 — 2020-02-01
- 1.0.2 — 2020-02-01
- 1.0.1 — 2020-01-30
- 1.0.0 — 2020-01-23

## README

# rx

CLI for React projects built with Parcel.

## Install

```
npm i -g rctr
```

## Commands

Below are the avilable commands you can run with the `rx` cli.

### new

```
rx new my-app
```

`rx new` scaffolds a new app with support for SSR, lazyloading, i18n, SCSS, and more. We chose the kitchen sink approach.

For an example of what gets scaffolded, see [react-starter](https://github.com/steveblue/react-starter).

### generate

`rx generate` scaffolds code snippets in the directory the command is run.

![](img/rx-generate-demo.gif)

Here is a list of arguments the `rx generate` command will take.

| type                    | file                                       |
| ----------------------- | ------------------------------------------ |
| fn-component, fc        | pure function component                    |
| arrow-fn-component, afc | arrow function component                   |
| component, c            | class component                            |
| view, v                 | class component with imported styles, test |
| ssr                     | server-side rendered view                  |
| test, t                 | spec file                                  |
| state, s                | state with reducer                         |
| context , ctx           | context                                    |

#### Example

`rx generate view Map`

- Map.tsx created
- Map.spec.tsx created
- Map.scss created

Some generators support optional arguments `--routing` and `--lazy`.

`rx g ssr About --routing --lazy`

- About.tsx created
- About.spec.tsx created
- About.scss created
- App.tsx has new routes

The first argument `--routing` adds a route to the nearest implementation of React Router.

```
<Route exact={true} path="/about" render={() => <About />} />
```

The second argument `--lazy` optionally lazyloads the component.

```
const About = importComponent(() => import("./view/about/About"));
```

## Development

If you want to contribute fork this repo, make your changes and submit a pull request.

To get started with development run `yarn install` and `yarn link`.

---
_Source: https://npm.io/package/rctr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
