@ax51/react-component-creator
v1.0.12
Published
CPI utility to simplify creation of react components with default reexport, styles, test file and etc.
Downloads
8
Maintainers
Readme
This is a simple CLI utility to helps create React Components.
You can install it using your favorite package manager:
npm i -D @ax51/react-component-creator
yarn add -D @ax51/react-component-creator
pnpm i -D @ax51/react-component-creator
bun add -d @ax51/react-component-creator
Or you could simply use it without installing as dependence:
npx @ax51/react-component-creator
yarn dlx @ax51/react-component-creator
pnpm dlx @ax51/react-component-creator
It could be configured to create a folder, named as the given component name, which has such structure:
While you use this util first time, it asks you to config fhe followind properties:
- default path to the components (such as ./src/Components)
- your stypesheet files extension (such as .less | .sass | .css etc.)
- would you like to use module stylesheets
- would you like to use TypeScript files (.ts) or plain JavaScript (.js)
- would you like to include test files to your component.
This settings will be saved in component-creator.json file in the root of your project and used next time you call this util.
After initial setup this util, next time you could use it in 2 ways:
- Interactive. Just run it (npx @ax51/react-component-creator) and interactively tells new Component name
- Pass arguments while call util. First argument will be Component name, and the second (optional) is the custom path (doesn't override settings); For example: