Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidhu2000/react_redux_generator

A npm script for generating all parts of react and redux web application.
https://github.com/davidhu2000/react_redux_generator

file-generator filesystem javascript npm npm-module react redux

Last synced: 23 days ago
JSON representation

A npm script for generating all parts of react and redux web application.

Awesome Lists containing this project

README

        

# React-Redux File Generator

[![npm version](https://badge.fury.io/js/redux-file-gen.svg)][npm_url]
[![downloads](https://img.shields.io/npm/dt/redux-file-gen.svg)][npm_url]
[![license](https://img.shields.io/npm/l/redux-file-gen.svg)][npm_url]
[![Build Status](https://travis-ci.org/davidhu2000/react_redux_generator.svg?branch=master)](https://travis-ci.org/davidhu2000/react_redux_generator)
[![CircleCI](https://circleci.com/gh/davidhu2000/react_redux_generator.svg?style=shield)](https://circleci.com/gh/davidhu2000/react_redux_generator)

[![Code Triagers Badge](https://www.codetriage.com/davidhu2000/react_redux_generator/badges/users.svg)](https://www.codetriage.com/davidhu2000/react_redux_generator)
[![dependencies Status](https://david-dm.org/davidhu2000/react_redux_generator/status.svg)](https://david-dm.org/davidhu2000/react_redux_generator)
[![devDependencies Status](https://david-dm.org/davidhu2000/react_redux_generator/dev-status.svg)](https://david-dm.org/davidhu2000/react_redux_generator?type=dev)

[npm_url]: https://www.npmjs.org/package/redux-file-gen

This generator helps to create the necessary files for a react-redux application. It follows the file structure below. The `frontend` folder is stored at the root directory of the application.

## Installation

npm install -g redux-file-gen

In order to create the terminal command `redux`, this package needs to be installed globally.

## Usage

redux [command] [fileType] [options]

## File structure

```file
frontend
|- actions
|- _actions.js
|- components
|-
|- .jsx
|- index.jsx
|- app.jsx
|- root.jsx
|- reducers
|- root_reducer.js
|- _reducer.js
|- store
|- store.js
|- util
|- _util.js
|- .jsx
```

## Commands

| Command | Alias | Function |
|-------------|-------|-----------------------------|
| `generate` | `g` | use the file generator |
| `remove` | `r` | remove the generated files |
| `--help` | `-h` | see available commands |
| `--version` | `-v` | see current package version |

## FileTypes

| FileType | Function |
|------------------------------------------|---------------------------------------------------------------------|
| `base ` | generate `app.jsx`, `root.jsx`, `.jsx`, and `store.js` |
| `action [action1] [action2] ...` | generate `_actions.js` with specified actions |
| `component [options]` | generate `.jsx` and `_container.jsx` |
| `reducer [action1] [action2] ...` | generate `_reducer.js` |
| `util [util1] [util2] ...` | generate `_util.js` with specified utils |

## Options

| Option | Alias | Function |
|------------------|-------|-----------------------------------|
| `--functional` | `-f` | create functional component |
| `--no-container` | `-nc` | do not create component container |

## For more details regard different types of files

- [Base](docs/base.md)
- [Action](docs/action.md)
- [Component](docs/component.md)
- [Reducer](docs/reducer.md)
- [Store](docs/store.md)
- [Utility](docs/util.md)

## Version notes

To see what features are added during each update, click [here](docs/update_notes.md)

## Contributing

To request a feature or report an issue, click [here](https://github.com/davidhu2000/react_redux_generator/issues).