Generate-plop is a simple cli for generating new components really fast and consistently. It can help you to scaffold components, templates, hooks, services and pages (Next.js) simply by running few cli commands. Say goodbye to copy-paste existing components and cleaning them up before you can work on actual task.
Automating the component generation process makes it really easy for the teams to maintain consistency across project and saves a lot of development time.
Generate-plop is by default configured to generate files in TypeScript format. However, you can generate javascript files as well by passing --js flag in script command.
Generate-plop as of now supports React components generation
- React Components: Class and Functional in Atomic Design structure.
- React Custom Hooks.
- React Context.
- React Query Services.
- Next.js Pages/Routes.
- Checks for name collisions.
Run following command at the root level of your project.
yarn add --dev @xt-pagesource/generate-plop
npm i @xt-pagesource/generate-plop --save-dev
Post installation add a script to generate TypeScript files in your package.json.
#package.json
script: {
...
"generate": "generate"
}
To generate javascript files instead of TypeScript add following script to package.json.
#package.json
script: {
...
"generate": "generate --js"
}
It works seamlessly with node versions >= ^12.20.0
Its only dependent on two packages:
- Angular Templates
- Remix Templates
- Raise issues/requests for other capabilities.