not-bad-react / generator-not-bad-react-component

Generator for simple but modern react component folder (SPA oriented, not Component Library)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not Bad Generator For React Component Scaffolding

Made with 💟 to DX

  • PureComponent by default
  • An option to use stateless component
  • An option to omit props even
  • An option to choose files extensions
  • Ability to add Jest spec file
  • ES6 syntax for the component

How To Use

Install Yeoman locally for better DX.

npm i -g yo

Add Not Bad generator to dev dependencies for your React-based project:

npm i --save-dev generator-not-bad-react-component

Then add special script inside package.json, similar to

...
"scripts": {
  "scaffold:component": "yo not-bad-react-component"
}
...

So everybody in your team can just type npm run scaffold:component in order to create a folder for the new React component.

What To Expect

The structure of the component folder is a little bit excessive:

/components
|-- UiComponent
|  |--  __tests__
|  |   `-- UiComponent.spec.jsx
|  |-- UiComponent.css
|  |-- UiComponent.jsx
|  `-- index.js

Roadmap

  • redux support
  • ✅ Jest support

Ancestor

https://github.com/booxood/generator-react-new-component

About

Generator for simple but modern react component folder (SPA oriented, not Component Library)


Languages

Language:JavaScript 100.0%