@@ -5,25 +5,22 @@ It helps you to speed up productivity in React projects and stop copying, pastin
55
66## Installation
77
8- To install the latest version run this command:
8+ To install the latest version run the following command:
99
1010``` sh
11- npm install generate- react-code --save-dev
11+ npm i react-codegen-cli --save-dev
1212```
1313
14- Then add the following script to your ` packages.json ` file:
15- ``` json
16- {
17- "scripts" : {
18- "react-codegen" : " react-codegen"
19- }
20- }
14+ React CodeGen lets you setup everything by simply running the following command:
15+
16+ ``` sh
17+ npx react-codegen-cli init
2118```
2219
23- ## Get started
20+ Question by question, it will guide you through the whole process of setting up a configuration file,
21+ selecting stylesheet format, picking a destination of generated files, and a lot more.
2422
25- ` react-codegen ` will look for a [ configuration file] ( #configuration-file ) in root folder and use it if available.
26- If no config file found it will fallback to a default configuration.
23+ ## Get Started
2724
2825The following command can be used to generate code:
2926``` sh
@@ -38,8 +35,9 @@ such as connecting the `useState`, `useEffect`, `propTypes` and so on.
3835![ Demo] ( https://i.imgur.com/TFykAL4.png )
3936![ Demo2] ( https://i.imgur.com/uEMSlCz.png )
4037
41- ## Configuration file
42-
38+ ## Configuration File
39+
40+ You also can set-up configuration file manually.
4341React codegen uses [ cosmiconfig] ( https://github.com/davidtheclark/cosmiconfig ) for configuration file support. This means you can configure it via:
4442
4543- A ` "react-codegen" ` key in your ` package.json ` file.
@@ -48,11 +46,14 @@ React codegen uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig)
4846
4947The configuration file will be resolved in the root folder of the project. If no configuration file found the default config will be used.
5048
49+ ` react-codegen ` will look for a [ configuration file] ( #configuration-file ) in root folder and use it if available.
50+ If no config file found it will fallback to a default configuration.
51+
5152### Configuration Options
5253
5354| Type | Value | Default | Description |
5455| :------------:| :------------------------------------------------------------:| :--------------:| ----------------------------------------------------------------------|
55- | styles | string | scss | Extension for style file |
56+ | styles | string | scss | Stylesheet format |
5657| typescript | boolean | false | Generate typescript files |
5758| jsxExt | boolean | true | Use ` jsx ` extension for components |
5859| fileNameCase | came,<br /> pascal,<br /> snake,<br /> snakeUpper,<br /> kebab | pascal | File name case for generated files<br /> (default: ` MyComponent.jsx ` ) |
0 commit comments