mushroom-cli 1.2.0-alpha.7 → 1.2.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,7 +44,7 @@ Config gen entities for CSharp project which calls Mushroom API
44
44
 
45
45
  Generate docs api (html format)
46
46
 
47
- npx mushroom-cli gen projectName[@aliasName] docs [tmp]
47
+ npx mushroom-cli gen projectName[@aliasName] docs [v1] [tmp]
48
48
 
49
49
  Generate database docs (html format)
50
50
 
@@ -88,11 +88,19 @@ Disable checking for update:
88
88
 
89
89
  ## Version
90
90
 
91
+ ### 1.2.0-alpha.8
92
+
93
+ Improvement:
94
+
95
+ * gen-docs
96
+ * v1.2: deal with very big api docs
97
+ * v1: prerender all docs html (need more RAM, less performance)
98
+
91
99
  ### 1.2.0-alpha.7
92
100
 
93
101
  New features:
94
102
 
95
- * init netcore: Support some new set-functions: `ToLowerCase`, `ToUpperCase`, `Trim`
103
+ * init netcore: Support some new set-functions: `ToLowerCase`, `ToUpperCase`, `Trim`, `Replace`
96
104
 
97
105
  Changes:
98
106
 
package/common.js CHANGED
@@ -66,6 +66,7 @@ function getEntities(projectApiConfiguration, roles, getAll) {
66
66
 
67
67
  if (!(entity.name in entities))
68
68
  entities[entity.name] = {
69
+ name: entity.name,
69
70
  description: entity.description,
70
71
  storageName: entity.storageName ? entity.storageName : entity.name,
71
72
  fields: entity.fields,
@@ -105,6 +106,7 @@ function getEntities(projectApiConfiguration, roles, getAll) {
105
106
 
106
107
  if (!(entity.name in entities))
107
108
  entities[entity.name] = {
109
+ name: entity.name,
108
110
  description: entity.description,
109
111
  storageName: entity.storageName ? entity.storageName : entity.name,
110
112
  fields: entity.fields,
@@ -192,11 +194,15 @@ function processSetCommand(command, variables) {
192
194
  case "Trim":
193
195
  trimCommand(command.variable, variables, command.input);
194
196
  break;
197
+ case "Replace":
198
+ replaceCommand(command.variable, variables, command.input, command.replacement, command.pattern, command.mode);
199
+ break;
195
200
  default:
196
201
  throw new Error(`Unknown set-command: ${command["function"]}`);
197
202
  }
198
203
  }
199
204
 
205
+ //#region set-commands
200
206
  function processSetGuidCommand(variable, variables) {
201
207
  variables[variable] = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
202
208
  var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
@@ -216,6 +222,12 @@ function trimCommand(variable, variables, input) {
216
222
  variables[variable] = (variables[input] || "").trim();
217
223
  }
218
224
 
225
+ function replaceCommand(variable, variables, input, replacement, pattern, mode) {
226
+ var regex = new RegExp(pattern, mode);
227
+ variables[variable] = (variables[input] || "").replace(regex, replacement === undefined || replacement === null ? "" : replacement);
228
+ }
229
+ //#endregion
230
+
219
231
  function processRenameCommand(command, basePath, variables) {
220
232
  const input = replaceVariables(command.input, variables);
221
233
  const output = replaceVariables(command.output, variables);