/crc

Create-React-Component

Primary LanguageShell

CRC (Create-React-Component)

Create the directory and files with followed structure

index.ts
styles.ts
<ComponentName>.tsx
<ComponentName>.stories.tsx
__tests__/<ComponentName>.test.tsx

Created files are meant to use with the followed stack and vendors

TypeScript
React
styled-components
react-testing-library
storybook

Setup

  • cp this repository content to the ~/.crc
cp -r <dir path> ~/.crc
  • make the script executable
sudo chmod +x ~/.crc/crc.sh
  • create the symlink in the usr/local/bin directory
ln -s ~/.crc/crc.sh /usr/local/bin/crc

Usage

Run the script in the location where the new directory with the component should be created.

Creating component

crc -n <ComponentName>

Creating component wrapped with React.memo

crc -n <ComponentName> -m