
Quickly create React components using CLI
- Quickly create React components using CLI
- Supports atomic design structure (atoms, molecules, organisms)
- Configurable component paths
yarn add @acrool/react-component-cli
Create configuration file .acrool-react-component
in your project root:
module.exports = {
atom: 'src/components/atoms',
molecule: 'src/components/molecule',
organize: 'src/components/organize',
form: 'src/components/form',
};
run generate
# type: atom|molecule|organize|form
npx acrool-react-component generate -t {type} -n {componentName}
Here is a faster way your can add in your package.json
{
"scripts": {
"dev": "next dev",
"comp": "acrool-react-component generate"
}
}
fast run
yarn comp -n TitleBlock
# ✔ The component has been successfully generated to ./src/components/atoms/TitleName
# ✨ Done in 0.12s.
build
yarn build && npx acrool-react-component generate -n TitleBlock