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
stringReplacers: ['__store__', {question:'Insert model name', slot:'__model__'}],
46
46
output: {
47
47
path:'./src/stores/__store__(lowerCase)',
48
48
pathAndFileNameDefaultCase:'(kebabCase)',
@@ -89,11 +89,12 @@ The `generateTemplateFiles` function takes an array of `IConfigItem` items.
89
89
#### `IConfigItem`
90
90
91
91
-`option` - The name of the option to choose when asked.
92
-
-`defaultCase` - The default [Case Converters](#case-converters) to use with the [Replacer Slots](#replacer-slots) in the template files. Default is `(noCase)`.
92
+
-`defaultCase` - The default [Case Converters](#case-converters) to use with the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) in the template files. Default is `(noCase)`.
93
93
-`entry.folderPath` - Path to a folder of files or a single template file.
94
-
-`stringReplacers` - An array of [Replacer Slots](#replacer-slots) used to replace content in the designated `entry.folderPath`.
94
+
95
+
-`stringReplacers` - An array of [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) used to replace content in the designated `entry.folderPath`.
95
96
-`dynamicReplacers` - (Optional) An array of IReplacer used to replace content in the designated `entry.folderPath`.
96
-
-`output.path` - The desired output path for generated files. [Case Converters](#case-converters) and [Replacer Slots](#replacer-slots) can be used to make the path somewhat dynamic.
97
+
-`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.
97
98
-`output.pathAndFileNameDefaultCase` - The [Case Converters](#case-converters) to use for the file path and file name(s).
98
99
-`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.
99
100
@@ -106,7 +107,7 @@ The `generateTemplateFiles` function takes an array of `IConfigItem` items.
@@ -123,13 +124,13 @@ The `generateTemplateFiles` function takes an array of `IConfigItem` items.
123
124
124
125
#### `IResults`
125
126
126
-
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) with the value entered.
127
+
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.
127
128
128
129
-`output.path` - The file(s) output path
129
130
-`output.files` - List of files created
130
-
-`stringReplacers` - List of [Replacer Slots](#replacer-slots); name and values entered during the setup process
131
+
-`stringReplacers` - List of [Replacer Slots](#replacer-slots-or-ireplacerslotquestion); name and values entered during the setup process
131
132
132
-
###### Example data you would get from the onComplate callback
133
+
###### Example data you would get from the onComplete callback
133
134
134
135
```javascript
135
136
{
@@ -158,16 +159,31 @@ Below is an example of what you receive from the `onComplete` callback. It has t
158
159
}
159
160
```
160
161
161
-
### Replacer Slots
162
+
### Replacer Slots or IReplacerSlotQuestion
163
+
164
+
[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.
162
165
163
-
[Replacer Slots](#replacer-slots) are unique string value(s) to be replaced by the generator.
166
+
```javascript
167
+
stringReplacers: ['__store__', {question:'Insert model name', slot:'__model__'}];
168
+
```
164
169
165
-
For example you can use something like this in your template files and/or in the file path names.
170
+
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.
166
171
167
172
-`~replacerSlot~`
168
173
-`{{something else}}`
169
174
-`__AnythingYouWant__`
170
175
176
+
#### `IReplacerSlotQuestion`
177
+
178
+
Below is an example of a `IReplacerSlotQuestion`
179
+
180
+
```javascript
181
+
{question:'Insert model name', slot:'__model__'}
182
+
```
183
+
184
+
-`question` - The question to ask the use what value should be used for the replacer `slot`
185
+
-`slot` - The string value for the [Replacer Slots](#replacer-slots-or-ireplacerslotquestion)
186
+
171
187
### Case Converters
172
188
173
189
[Case Converters](#case-converters) transform the string value entered upon use of the generator.
@@ -192,7 +208,7 @@ Here is the string `Lives down BY the River` with each of the converters:
192
208
(snakeCase) // lives_down_by_the_river
193
209
(titleCase) // Lives Down By The River
194
210
195
-
One Rule: no spaces between the [Replacer Slots](#replacer-slots) and [Case Converters](#case-converters). If there is a space, [Case Converters](#case-converters) will not work.
211
+
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.
0 commit comments