1.1.2 • Published 6 years ago

generator-react16-component v1.1.2

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

Generator React16 Component

Yeoman generator for basic/empty React components.

Options

  • Component name
  • Stateful/Stateless component
  • Connect with Redux using mapStateToProps, mapDispatchToProps and connect()

Installation

Globally:

yarn global add generator-react16-component

Locally:

yarn add generator-react16-component

Usage

yo react16-component

You can insert the component name directly as an argument with:

yo react16-component [ComponentName]

Generated files

.
├── src
│   ...
│   ├── components
│   │   ...
│   │   ├── ComponentName
│   │   │   ├── index.js
│   │   │   ├── ComponentName.jsx
│   │   │   ├── ComponentName.scss
│   │   │   └── ComponentName.spec.js
│   │   ...
│   ...

Config file

You can use a .yo-rc.json to configure a set of rules for the files creation.

These are the available options:

"generator-react16-component": {
  "componentFileExtension": "jsx", // ['jsx', 'tsx', 'js']
  "componentsFolder": "src/components", // path string
  "testFileExtension": "spec.js", // ['spec.js', 'test.js']
  "testFolder": "src/components/[ComponentName]", // path string
  "stylesFileExtension": "scss", // ['scss', 'css', 'less', 'styl']
  "createStylesFile": true // [true, false]
}

Check https://yeoman.io/authoring/storage.html for more information.

Known issues

  • When sending the tests files to a different folder, the component import in the test file points to the same directory

TODO:

Add possibility for yeoman config file for

  • Typechecking (Proptypes/etc)
1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago