1.3.1 • Published 9 years ago

generator-react-redux-modules v1.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

React & Redux Generator

License

A Yeoman generator for React & Redux for projects vertically integrated.

Of those out there, the React and Redux templates have a horizontal structure for their projects. This means all of your elements belong in the same folder, i.e. your components go in a components folder.

This generator works for vertically integrated React and Redux projects. The sub-generator will create modules for you with a smaller version of the horizontal structure. Each module is self-contained, although there may be a base that is common to everything else.

This repo is copied from React/Flux Vertical generator, which I'm de-comissioning in favor of this one.

Installation

Yeoman

For this generator to work, Yeoman must be globally installed.

npm install -g yo

Then you can install this generator-react-redux-modules module. I do not maintain generator-react-redux.

npm install -g generator-react-redux-modules

Base Generator

Creates the base project. Loosely based off React-starter-kit.

yo react-redux-modules

This will compile base files, including the Source, and Tools folders. (tests pending)

Options

OptionDescriptionDefault
-h, --helpPrint the generator's options and usage
--skip-cacheDo not remember prompt answersDefault: false
--skip-installDo not automatically install dependenciesDefault: false

Sub-generators

The sub generators assumes you already have a project up and running. They are to help you through developing new modules, components, etc.

Module

When you need to start creating new modules, simple use the sub-generator module.

yo react-redux-modules:module [options] <moduleName>

Within the module sub-generator, the following default files are generated for you. Replace with your own module name.

Options

OptionDescriptionDefault
-h, --helpPrint the generator's options and usage
--skip-cacheDo not remember prompt answersDefault: false
--skip-installDo not automatically install dependenciesDefault: false

Arguments

ArgumentsDescriptionTypeRequired
moduleNameName of the moduleStringtrue

Examples

The following command will generate the following:

yo react-redux-modules:module auth
# Generates the auth folder with all necessary files

Component

If you want to create a component other modules depend on, this sub-generator will create the files needed for you.

Within the component sub-generator, the following default files are generated for you. Replace #{CommonComponentName} with your own module name.

.
└── src
    └── common
        └── components
             └── CommonComponentName
                 ├── CommonComponentName.js
                 ├── CommonComponentName.scss
                 └── package.json

Arguments

ArgumentsDescriptionTypeRequired
componentNameName of the moduleStringtrue
componentRootName of the moduleStringtrue

Options

OptionDescriptionDefault
-h, --helpPrint the generator's options and usage
--skip-cacheDo not remember prompt answersDefault: false
--skip-installDo not automatically install dependenciesDefault: false
--rawUse user input raw format for component nameDefault: false

Examples

The following command will generate the following:

yo react-redux-modules:component TextBox ./src/common/components --raw
# Generates the following:
.
└── src
    └── common
        └── components
             └── TextBox
                 ├── TextBox.js
                 ├── TextBox.scss
                 └── package.json

Action Test

If you want to generate an action test, for a known module, this sub-generator will help.

Within the component sub-generator, the following default files are generated for you.

Replace #{module} and #{action} with your own module and action names.

.
└── test
    └── unit
        └── module
             └── actions
                 └── action.spec.js

Arguments

ArgumentsDescriptionTypeRequired
moduleName of the moduleStringtrue
actionName of the actionStringtrue

Examples

The following command will generate the following:

yo react-redux-modules:actionTests Analytics Partners

# Generates the following:
.
└── test
    └── unit
        └── Analytics
            └── actions
                └── Partners.spec.js

Contributing

Anyone and everyone is welcome to contribute, however, if you decide to get involved, please take a moment to review the guidelines:

License

The code is available under the MIT license.

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

10 years ago

1.1.7

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago