A CLI tool to generate React components with ease.
This will install the CLI tool globally under the name rcc.
deno install -A -n rcc jsr:@sebkolind/react-component-clircc <component-name>/<sub-component-name> [/<sub-component-name> ...]barrels(boolean): Generate barrel files for each component. Default:trueflat(boolean): Generate files in a flat structure. Default:falsestyles(boolean): Generate style files for each component. Default:true
With the default configuration, which can be seen below, this command:
rcc MyComponent/MySubComponentwill generate the following files:
MyComponent.tsxMyComponent.module.scssMyComponent/index.tsMyComponent/MySubComponent/MySubComponent.tsxMyComponent/MySubComponent/MySubComponent.module.scssMyComponent/MySubComponent/index.ts
Create a configuration file at ~/.config/@sebkolind/rcc/config.yml to customize the
generated files.
More details about the configuration file can be found here.
mainFile:
path: ""
prefix: ""
extension: ".tsx"
caseFormat: "PascalCase"
styleFile:
path: ""
prefix: ""
extension: ".module.scss"
nameFromComponent: true
barrelFiles:
extension: ".ts"
structure: "nested"