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

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
@@ -88,6 +88,16 @@ Disable checking for update:
88
88
 
89
89
  ## Version
90
90
 
91
+ ### 1.2.0-alpha.7
92
+
93
+ New features:
94
+
95
+ * init netcore: Support some new set-functions: `ToLowerCase`, `ToUpperCase`, `Trim`
96
+
97
+ Changes:
98
+
99
+ * init netcore: Operating fail if unknown command or set-function found
100
+
91
101
  ### 1.2.0-alpha.6
92
102
 
93
103
  New features:
package/common.js CHANGED
@@ -12,7 +12,7 @@ function ensureFolder(path, isFolder) {
12
12
  return;
13
13
 
14
14
  if (!fs.existsSync(path)) {
15
- fs.mkdirSync(path, { recursive: true, mode: 0755 });
15
+ fs.mkdirSync(path, { recursive: true, mode: 0o755 });
16
16
  }
17
17
  }
18
18
 
@@ -160,6 +160,8 @@ function processCommand(command, basePath, variables) {
160
160
  case "replace":
161
161
  processReplaceCommand(command, basePath, variables);
162
162
  return;
163
+ default:
164
+ throw new Error(`Unknown command: ${command.command}`);
163
165
  }
164
166
  }
165
167
 
@@ -181,6 +183,17 @@ function processSetCommand(command, variables) {
181
183
  case "New-GUID":
182
184
  processSetGuidCommand(command.variable, variables);
183
185
  break;
186
+ case "ToLowerCase":
187
+ toLowerCommand(command.variable, variables, command.input);
188
+ break;
189
+ case "ToUpperCase":
190
+ toUpperCaseCommand(command.variable, variables, command.input);
191
+ break;
192
+ case "Trim":
193
+ trimCommand(command.variable, variables, command.input);
194
+ break;
195
+ default:
196
+ throw new Error(`Unknown set-command: ${command["function"]}`);
184
197
  }
185
198
  }
186
199
 
@@ -191,6 +204,18 @@ function processSetGuidCommand(variable, variables) {
191
204
  }).toUpperCase();
192
205
  }
193
206
 
207
+ function toLowerCommand(variable, variables, input) {
208
+ variables[variable] = (variables[input] || "").toLowerCase();
209
+ }
210
+
211
+ function toUpperCaseCommand(variable, variables, input) {
212
+ variables[variable] = (variables[input] || "").toUpperCase();
213
+ }
214
+
215
+ function trimCommand(variable, variables, input) {
216
+ variables[variable] = (variables[input] || "").trim();
217
+ }
218
+
194
219
  function processRenameCommand(command, basePath, variables) {
195
220
  const input = replaceVariables(command.input, variables);
196
221
  const output = replaceVariables(command.output, variables);
package/gen/gen-csharp.js CHANGED
@@ -638,7 +638,7 @@ function generateCSharpClassMongoDbToFolder(source, className, fields, isRoot, d
638
638
 
639
639
  let strEnumClasses = generateEnumClass(source, {}, field, `${className.toUpperCase()}_${propertyName.toUpperCase()}_ENUM`);
640
640
 
641
- const match = strEnumClasses.match(/public class\s+(\w+)/);
641
+ const match = strEnumClasses.match(/public partial class\s+(\w+)/);
642
642
  if (!match) continue;
643
643
  common.ensureFolder(aliasProject.output + "/Enums", true);
644
644
  strEnumClasses = `${header}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mushroom-cli",
3
- "version": "1.2.0-alpha.6",
3
+ "version": "1.2.0-alpha.7",
4
4
  "description": "Mushroom CLI",
5
5
  "main": "mr.js",
6
6
  "scripts": {
@@ -17,10 +17,10 @@
17
17
  "author": "suco2007",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "jsdom": "^21.0.0",
20
+ "jsdom": "^22.1.0",
21
21
  "json5": "^2.2.3",
22
- "node-fetch": "^2.6.7",
23
- "open": "^8.4.0",
22
+ "node-fetch": "^2.6.11",
23
+ "open": "^9.1.0",
24
24
  "readline-sync": "^1.4.10",
25
25
  "targz": "^1.0.1"
26
26
  }