https://github.com/yannvr/react-components-cli
React command line template generator
https://github.com/yannvr/react-components-cli
command-line plop react react-cli react-component-cli react-components-cli styled-component styled-component-cli template
Last synced: 13 days ago
JSON representation
React command line template generator
- Host: GitHub
- URL: https://github.com/yannvr/react-components-cli
- Owner: yannvr
- Created: 2019-01-09T10:14:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T03:50:07.000Z (over 2 years ago)
- Last Synced: 2025-04-19T15:13:19.486Z (about 1 month ago)
- Topics: command-line, plop, react, react-cli, react-component-cli, react-components-cli, styled-component, styled-component-cli, template
- Language: HTML
- Size: 254 KB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## React styled component generator
"Automate every single boring and repetitive tasks" -- DevOps Handbook
Create a styled component with test (Jest ready) including optionals story and style
component. Supports Typescript.Create components based on the following structure (example given in js)
- `src/components/new-component/index.jsx`
- `src/components/new-component/test.jsx`
- `src/components/new-component/story.js` (optional)
- `src/components/new-component/style.js` (optional)### Installation
- `yarn global add react-components-cli`Note: You will need to add yarn global bin to your path like adding `export PATH="$(yarn global bin):$PATH"` in your .bashrc or .zshrc (or whatever on windows)
### Usage
- Create any components type using prompts:
- `create-component` (note: if global not found, add `yarn global dir` to your PATH)
### Examples- `create-component -- --name FunctionComponent --directory src/components --componentType stateless --styled true --story false --componentCase camel`
will create a function component `` in `src/component/profile` including test and story files
### TODO
- Cypress templateNote: the template can generate unstyled component but you'll just have to remove styled component references.
PR welcome for different handling templates with other conventions/libraries