react-cli-scaffolding
Creates React components from the command line in Typescript
Install
npm i -g react-cli-scaffolding
API
rcc
Creates a new tsx React component, css file, types css file, test file, and index.ts file for easier importing in the given directory.
Params
ComponentName
{string}: component namepath
{string}: path the component will be created at. Optional
Example
rcc Footer ./src/components/ui/Footer
project
└─ src
│ └─ components
│ └─ ui
│ └─ Footer
│ │ Footer.tsx
│ │ Footer.css
│ │ index.ts
│ │ Footer.css.d.ts
└─ test
│ └─ functional
│ └─ components
│ └─ ui
│ │ Footer.test.tsx
└─ rsc.config.js
Config
Create a rcs.config.js file in the root of the directory to override the default configuration
Example
moduleexports = useTypescript: true componentsFolder: './src/components' testsFolder: './test/functional/components' // Files will get overridden if they already exist overrideFiles: false includeTestFile: true styleFileExtension: 'css' componentFileExtension: 'tsx' // Use custom templates templates: component: './templates/component.template' style: './templates/style.template' styleTypes: './templates/styletypes.template' index: './templates/index.template' test: './templates/test.template' ;
Templates
Component:
;; ; ; ;
Test:
;;; describe'Footer',;
CSS:
Type definition CSS:
Index:
;
Author
License
Copyright © 2018, Victor Beristain. Released under the MIT License.