You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -141,16 +141,21 @@ We use babel to transpile code in both server and client with `stage-0` plugin.
141
141
142
142
### Make your MERN
143
143
In this version, we enabled the `mern-cli` to clone not only this project but also the variants of `mern-starter` like one project with MaterialUI or JWT auth. To make your version of MERN, follow these steps
2. Make your changes. Add a package, add authentication, modify the file structure, replace Redux with MobX or anything else.
151
+
149
152
3. In this version, we also added code generators. Blueprints for those generators are located at `config/blueprints`, and config is located at `mern.json`. Make sure to edit them if necessary after your made modifications in the previous step. There is a section below which explains how to modify generators.
153
+
150
154
4. Next clone `mern-cli` project
151
155
```
152
156
git clone https://github.com/Hashnode/mern-cli
153
157
```
158
+
154
159
5. Add your project details to `variants.json` in the cloned project and send a pull request.
155
160
156
161
### Modifying Generators
@@ -172,12 +177,17 @@ It contains a blueprints array. Each object in it is the config for a generator.
172
177
```
173
178
174
179
A file object contains
180
+
175
181
1. `blueprint-path` - location of the blueprint file
182
+
176
183
2. `target-path` - location where the file should be generated
184
+
177
185
3. `parent-path` - optional parameter, used if you want to generate the file inside an already existing folder in your project.
178
186
179
-
`target-path` supports [ejs](https://github.com/mde/ejs) and the following variables will be passed while rendering,
187
+
Also, `target-path` supports [ejs](https://github.com/mde/ejs) and the following variables will be passed while rendering,
188
+
180
189
1. `name` - `<component-name>` input from user
190
+
181
191
2. `parent` - in particular special cases where you need to generate files inside an already existing folder, you can obtain this parent variable from the user. A config using that will look like,
182
192
```
183
193
{
@@ -194,6 +204,7 @@ A file object contains
194
204
}
195
205
```
196
206
Here, notice the usage. In `<module-name>/<component-name>`, `<module-name>` will be passed as `parent` and `<component-name>` will be passed as `<name>`.
207
+
197
208
3. `helpers` - an helper object is passed which include common utility functions. For now, it contains `capitalize`. If you want to add more, send a PR to [mern-cli](https://github.com/Hashnode/mern-cli).
0 commit comments