# @krab7191/react-cli

> A flexible set of command line tools which mimics angular-cli functionality for some common React design patterns.

Latest version **1.0.10** (published 2019-07-03) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @krab7191/react-cli
pnpm add @krab7191/react-cli
yarn add @krab7191/react-cli
bun add @krab7191/react-cli
```

Provides the command `rc`.

## 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.10 |
| Published | 2019-07-03 |
| First published | 2019-07-03 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 49.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Karsten Rabe |
| Maintainers | krab7191 |
| Keywords | React |

## Links

- npm: https://www.npmjs.com/package/@krab7191/react-cli
- Repository: https://github.com/krab7191/react-cli
- Homepage: https://github.com/krab7191/react-cli#readme
- Issues: https://github.com/krab7191/react-cli/issues
- npm.io page: https://npm.io/package/@krab7191/react-cli

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [inquirer](https://npm.io/package/inquirer.md) ^6.3.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2019-07-03
- 1.0.9 — 2019-07-03
- 1.0.8 — 2019-07-03
- 1.0.7 — 2019-07-03
- 1.0.6 — 2019-07-03
- 1.0.5 — 2019-07-03
- 1.0.4 — 2019-07-03
- 1.0.3 — 2019-07-03
- 1.0.2-e — 2019-07-03
- 1.0.2-d — 2019-07-03
- 1.0.2-c — 2019-07-03
- 1.0.2-b — 2019-07-03
- 1.0.2-a — 2019-07-03
- 1.0.2 — 2019-07-03
- 1.0.1 — 2019-07-03
- … 1 more at https://npm.io/package/@krab7191/react-cli/versions

## README

# react-cli
A flexible set of command line tools which mimics Angular's component generation functionality for some common React design patterns.

# NOTE: This package is not finished and should not be installed yet. It does not work.

## `rc <command> <options> <name>`

- command: ['gc', 'gp', 'help' | '--help' | '-h', 'config', 'version' | '--version' | '-v' ]
	- gc <options> <name>: Generate a component following command line options and falling back to defaults
	- gp <options> <name>: Generate a page component following command line arguments, and falling back to defaults
	- help: Print this help documentation
	- config: Answer a set of questions in order to generate a custom config file for your specific workflow
	- version: Print the installed version of React-cli

- options: 
	- -o <output directory>: Specifies directory to write to. Default: ./src/components | ./src/pages respectively
	- -s <suffix>: Specify the suffix to use for files. Default: 'jsx'
	- -t <type>: Specify the componentType (class | functional)
	- -e <type>: Specify the exportType: 
		Default: 
		```
		// index.js
		export { default } from './Component';
		```
		Wildcard: (more useful for named exports, TS)
		```
		// index.js
		export * from './Component';
		```
	- -c : Instructs to containerize the component
	- -n : Instructs to nest component in parent folder, and create the parent if it doesn't exist. Requires parent folder name after component name, for example `rc gc -n ImgCard ImgContainer` will generate an 'ImgCard' subcomponent of existing (or newly created) 'ImgContainer' component.


## Config options:

- componentDirPath: The relative path from your root to the folder where your components reside

- pageDirPath: The relative path to the directory where your page components reside. May be called 'routes'; whatever you call the folder which holds your frontend routes.

- suffix: 'js' | 'jsx' | 'ts' | 'tsx' : The file type you want generated

- componentType: 'functional' | 'class' : Class components will be stateful by default, and functional components stateless

- exportType: 'default' | 'wildcard' : Define how your component's index.js exports your component's exports. Default results in `export { default } from './<ComponentName>';` and wildcard results in `export * from './<ComponentName>'`

- casingFix: true | false : If true, component names will be converted to uppercase if lowercase

- containerize: true | false : If true, a stateful (container) parent component will be created which renders a stateless (presentational) component child

- classStateful: Default true. Whether or not to generate state in your class component

- functionHooks: Default false. Whether or not to generate hook code in your functional component

- nest: Default false. If true the component will be generated as a child of a newly created parent component (must specify both component names)

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