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
@@ -89,16 +89,16 @@ The `generateTemplateFiles` function takes an array of `IConfigItem` items.
89
89
90
90
#### `IConfigItem`
91
91
92
-
-`option` - The name of the option to choose when asked.
93
-
-`defaultCase` - The default [Case Converters](#case-converters) to use with the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) in the template files. Default is `(noCase)`.
94
-
-`entry.folderPath` - Path to a folder of files or a single template file.
92
+
-`option` - The name of the option to choose when asked.
93
+
-`defaultCase` - The default [Case Converters](#case-converters) to use with the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) in the template files. Default is `(noCase)`.
94
+
-`entry.folderPath` - Path to a folder of files or a single template file.
95
95
96
-
-`stringReplacers` - An array of [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) used to replace content in the designated `entry.folderPath`.
97
-
-`dynamicReplacers` - (Optional) An array of IReplacer used to replace content in the designated `entry.folderPath`.
98
-
-`output.path` - The desired output path for generated files. [Case Converters](#case-converters) and [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) can be used to make the path somewhat dynamic.
99
-
-`output.pathAndFileNameDefaultCase` - The [Case Converters](#case-converters) to use for the file path and file name(s).
100
-
-`output.overwrite` - (Optional) When `true` it will overwrite any files that are named the same.
101
-
-`onComplete` - (Optional) Takes a callback function that is called once the file(s) have been outputted. A [IResults](#iresults) object will be passed to the callback.
96
+
-`stringReplacers` - An array of [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) used to replace content in the designated `entry.folderPath`.
97
+
-`dynamicReplacers` - (Optional) An array of IReplacer used to replace content in the designated `entry.folderPath`.
98
+
-`output.path` - The desired output path for generated files. [Case Converters](#case-converters) and [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) can be used to make the path somewhat dynamic.
99
+
-`output.pathAndFileNameDefaultCase` - The [Case Converters](#case-converters) to use for the file path and file name(s).
100
+
-`output.overwrite` - (Optional) When `true` it will overwrite any files that are named the same.
101
+
-`onComplete` - (Optional) Takes a callback function that is called once the file(s) have been outputted. A [IResults](#iresults) object will be passed to the callback.
102
102
103
103
###### Example
104
104
@@ -128,9 +128,9 @@ The `generateTemplateFiles` function takes an array of `IConfigItem` items.
128
128
129
129
Below is an example of what you receive from the `onComplete` callback. It has the output path, list of files created and the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) with the value entered.
130
130
131
-
-`output.path` - The file(s) output path
132
-
-`output.files` - List of files created
133
-
-`stringReplacers` - List of [Replacer Slots](#replacer-slots-or-ireplacerslotquestion); name and values entered during the setup process
131
+
-`output.path` - The file(s) output path
132
+
-`output.files` - List of files created
133
+
-`stringReplacers` - List of [Replacer Slots](#replacer-slots-or-ireplacerslotquestion); name and values entered during the setup process
134
134
135
135
###### Example data you would get from the onComplete callback
136
136
@@ -166,14 +166,14 @@ Below is an example of what you receive from the `onComplete` callback. It has t
166
166
[Replacer Slots](#replacer-slots-or-ireplacerslotquestion) are unique string value(s) to be replaced by the generator. An array of string values and/or `IReplacerSlotQuestion` objects can be used.
167
167
168
168
```javascript
169
-
stringReplacers: ['__store__', {question:'Insert model name', slot:'__model__'}];
169
+
stringReplacers: ['__store__', {question:'Insert model name', slot:'__model__'}];
170
170
```
171
171
172
172
Replacer slot can be any string value you want to use. You can use something like this in your template files and/or in the file path names.
173
173
174
-
-`~replacerSlot~`
175
-
-`{{something else}}`
176
-
-`__AnythingYouWant__`
174
+
-`~replacerSlot~`
175
+
-`{{something else}}`
176
+
-`__AnythingYouWant__`
177
177
178
178
#### `IReplacerSlotQuestion`
179
179
@@ -183,8 +183,8 @@ Below is an example of a `IReplacerSlotQuestion`
183
183
{question:'Insert model name', slot:'__model__'}
184
184
```
185
185
186
-
-`question` - The question to ask the use what value should be used for the replacer `slot`
187
-
-`slot` - The string value for the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion)
186
+
-`question` - The question to ask the use what value should be used for the replacer `slot`
187
+
-`slot` - The string value for the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion)
188
188
189
189
#### Dynamic Replacer Slots
190
190
@@ -202,9 +202,9 @@ dynamicReplacers: [
202
202
203
203
Example
204
204
205
-
-In the generator template `__replacerSlot__` is appended by the `(pascalCase)` converter such as `__replacerSlot__(pascalCase)`.
206
-
-When the generator is ran, the string `"product reducer"` is provided for `__replacerSlot__`.
207
-
-As a result, the converter will produce `ProductReducer`.
205
+
- In the generator template `__replacerSlot__` is appended by the `(pascalCase)` converter such as `__replacerSlot__(pascalCase)`.
206
+
- When the generator is ran, the string `"product reducer"` is provided for `__replacerSlot__`.
207
+
- As a result, the converter will produce `ProductReducer`.
208
208
209
209
Here is the string `Lives down BY the River` with each of the converters:
210
210
@@ -222,34 +222,34 @@ Here is the string `Lives down BY the River` with each of the converters:
222
222
223
223
One Rule: no spaces between the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) and [Case Converters](#case-converters). If there is a space, [Case Converters](#case-converters) will not work.
224
224
225
-
-:white_check_mark:`__name__(camelCase)`
226
-
-:warning:`__name__ (camelCase)`
225
+
-:white_check_mark:`__name__(camelCase)`
226
+
-:warning:`__name__ (camelCase)`
227
227
228
228
## Command Line Usage
229
229
230
230
You can use `generate-template-files` with the command line to generate your template files.
-`node ./tools/generate.js` - Runs the `generate-template-files` library
271
-
-`create-reduce-action` - The template name; It uses the same option name in the [IConfigItem](#iconfigitem) but converts all options names to kebab-case. For example `option: 'Create Reduce Action'` will be converted to `create-reduce-action` when using the command line
272
-
-`__store__=some-name` - Are [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) and will be converted to `{ slot: "__store__", slotValue: "some-name" }`
273
-
-`--outputpath=./src/here` - Will override the `output.path` in the [IConfigItem](#iconfigitem)
274
-
-`--overwrite` - Will overwrite files if the files already exists
270
+
-`node ./tools/generate.js` - Runs the `generate-template-files` library
271
+
-`create-reduce-action` - The template name; It uses the same option name in the [IConfigItem](#iconfigitem) but converts all options names to kebab-case. For example `option: 'Create Reduce Action'` will be converted to `create-reduce-action` when using the command line
272
+
-`__store__=some-name` - Are [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) and will be converted to `{ slot: "__store__", slotValue: "some-name" }`
273
+
-`--outputpath=./src/here` - Will override the `output.path` in the [IConfigItem](#iconfigitem)
274
+
-`--overwrite` - Will overwrite files if the files already exists
0 commit comments