A CLI for generating React Components.
rcomp create component
orrcomp c component
will generate a component in the components folder ofsrc
by defaultrcomp create page
orrcomp c page
will generate a page / route in the pages folder ofsrc
by default
Currently this plugin supports 2 options:
- Creating a function or class Component
- Creating a scss or styled-component file
- You can specify the following configuration in your
package.json
. Default values for all are shown below
"rcomp": {
"componentsDirectory": "components",
"pagesDirectory": "pages",
"createStories": false,
"outputExtension": "js"
}
componentsDirectory
: The custom folder for componentspagesDirectory
: The custom folder for pagescreateStories
: If you want to generate stories for your component (if using Storybook)outputExtension
: The generated extension for your project (.js or .ts)
Note: The base directory will be src
though.
MIT - see LICENSE
- Write robust tests!
-
Read components and pages folder from project config (currently statically set tocomponents
andpages
) -
Add support for .ts/.tsx
Version 1.1.2
- Fix an issue where the users' custom config was not imported
Version 1.0.3
- Add support for generating stories for components (if using Storybook)
Version 1.0.2
- Add support for the .ts/.tsx extension