Skip to content

Commit da8e521

Browse files
committed
updated the readme easier instructions to configuration
1 parent 0ec118a commit da8e521

File tree

1 file changed

+22
-61
lines changed

1 file changed

+22
-61
lines changed

README.md

Lines changed: 22 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -81,71 +81,32 @@ and searching up the file tree until a config file is (or isn't) found.
8181

8282
### Basic Configuration
8383

84-
JSON:
85-
86-
```json
87-
// .ccarc
88-
{
89-
"type": "class",
90-
"path": "./src/components"
91-
}
92-
```
93-
94-
YAML:
95-
96-
```yaml
97-
# .ccarc
98-
type: class
99-
path: ./src/components
100-
```
84+
An example configuration file can be found here: [.ccarc.example](.ccarc.example), you can use this
85+
file by copying it to the root of your project.
86+
87+
Currently supported options are:
88+
89+
Option | Description
90+
--- | ---
91+
`type` | Default type of the component `["stateless", "class", "pure"]`
92+
`templatesDirPath` | Default path to get the templates from the custom templates folder
93+
`path` | Default path to create component file and folder
94+
`jsExtension` | Default extension for your javascript file `["js", "jsx"]`
95+
`cssExtension` | Default extension for your css file `["css", "scss", "sass", "less", false]`. Set to false if you don't want a style file
96+
`includeTests` | Default flag to include a test file in the folder `[true, false]`
97+
`includeStories` | Default flag to include a storybook file in the folder `[true, false]`
98+
`indexFile` | Default flag to create an index file in the folder `[false, true]`
99+
`connected` | Default flag to integrate connect redux in the index file `[false, true]`
100+
`componentMethods` | Only for "class" and "pure", insert method inside the component (i.e. `["componentDidMount", "shouldComponentUpdate", "onClick"]`)
101+
`fileNames` | Choose the specific filename for your component's file.
102+
`fileNames.testFileMatch` | specify the match part of test file
103+
`fileNames.testFileName` | specify the file name of your test file
104+
`fileNames.componentFileName` | specify the component file name
105+
`fileNames.styleFileName` | specify the style file name !!IMPORTANT: Include cssExtension.
101106

102107
### You can also pass a config file
103108

104109
1) Create a JSON file `config.json`:
105-
106-
```javascript
107-
{
108-
// Default type of component ["stateless", "class", "pure"]
109-
"type": "stateless",
110-
111-
// Default path to get the templates from the custom templates folder
112-
"templatesDirPath": "./templates",
113-
114-
// Default path to create component file and folder
115-
"path": "./src/components",
116-
117-
// Default extension for your javascript file ["js", "jsx"]
118-
"jsExtension": "js",
119-
120-
// Default extension for your css file ["css", "scss", "sass", "less", false]
121-
// Set to false if you don't want a style file
122-
"cssExtension": "css",
123-
124-
// Default flag to include a test file in the folder [true, false]
125-
"includeTests": true,
126-
127-
// Default flag to include a storybook file in the folder [true, false]
128-
"includeStories": true,
129-
130-
// Default flag to create an index file in the folder [false, true]
131-
"indexFile": false,
132-
133-
// Default flag to integrate connect redux in the index file [false, true]
134-
"connected": false,
135-
136-
// Only for "class" and "pure", insert method inside the component
137-
"componentMethods": ["componentDidMount", "shouldComponentUpdate", "onClick"],
138-
139-
// Choose the specific filename for your component's file.
140-
"fileNames": {
141-
"testFileMatch": "spec", // specify the match part of test file
142-
"testFileName": "myTest", // specify the file name of your test file
143-
"componentFileName": "template", // specify the component file name
144-
"styleFileName": "style" // specify the style file name !!IMPORTANT: Include cssExtension.
145-
}
146-
}
147-
```
148-
149110
2) and pass the path to config param
150111

151112
```sh

0 commit comments

Comments
 (0)