mushroom-cli 1.2.0-alpha.25 → 1.2.0-alpha.26
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/dist/gen/gen-csharp.js +4 -4
- package/package.json +4 -4
package/dist/gen/gen-csharp.js
CHANGED
|
@@ -214,7 +214,7 @@ function generateCSharpClassMongoDb(source, className, fields, isRoot, descripti
|
|
|
214
214
|
[MongoDB.Bson.Serialization.Attributes.BsonIgnoreIfNull]
|
|
215
215
|
[Newtonsoft.Json.JsonProperty(PropertyName = "${fieldName}", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore${type === 'System.DateTime' ? ', DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore' : ''})]
|
|
216
216
|
[System.Text.Json.Serialization.JsonPropertyName("${fieldName}")]
|
|
217
|
-
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'JsonIgnoreCondition.WhenWritingDefault' : 'JsonIgnoreCondition.WhenWritingNull'})]
|
|
217
|
+
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault' : 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull'})]
|
|
218
218
|
`;
|
|
219
219
|
if ((field.type === 'AutoId' || field.type === 'IdRef') && source.idType === 'ObjectId') {
|
|
220
220
|
content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]\n';
|
|
@@ -561,7 +561,7 @@ function generateCSharpClassMongoDbToFolder(source, className, fields, isRoot, d
|
|
|
561
561
|
[MongoDB.Bson.Serialization.Attributes.BsonIgnoreIfNull]
|
|
562
562
|
[Newtonsoft.Json.JsonProperty(PropertyName = "${fieldName}", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore${type === 'System.DateTime' ? ', DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore' : ''})]
|
|
563
563
|
[System.Text.Json.Serialization.JsonPropertyName("${fieldName}")]
|
|
564
|
-
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'JsonIgnoreCondition.WhenWritingDefault' : 'JsonIgnoreCondition.WhenWritingNull'})]
|
|
564
|
+
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault' : 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull'})]
|
|
565
565
|
`;
|
|
566
566
|
if ((field.type === 'AutoId' || field.type === 'IdRef') && source.idType === 'ObjectId') {
|
|
567
567
|
content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]\n';
|
|
@@ -907,7 +907,7 @@ function generateCSharpClassDriver(source, className, fields, description, out)
|
|
|
907
907
|
/// </summary>
|
|
908
908
|
[Newtonsoft.Json.JsonProperty(PropertyName ="${fieldName}", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore${type === 'System.Datetime' ? ', DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore' : ''})]
|
|
909
909
|
[System.Text.Json.Serialization.JsonPropertyName("${fieldName}")]
|
|
910
|
-
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'JsonIgnoreCondition.WhenWritingDefault' : 'JsonIgnoreCondition.WhenWritingNull'})]
|
|
910
|
+
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault' : 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull'})]
|
|
911
911
|
public ${type} ${propertyName} { get; set; }
|
|
912
912
|
|
|
913
913
|
`;
|
|
@@ -1145,7 +1145,7 @@ export function genCSharpDriver(args, projectName, project, alias, source) {
|
|
|
1145
1145
|
type = `System.Collections.Generic.List<${type}>`;
|
|
1146
1146
|
viewExtraClass += ` [Newtonsoft.Json.JsonProperty(PropertyName = "${p.field}", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore${type === 'System.Datetime' ? ', DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore' : ''})]
|
|
1147
1147
|
[System.Text.Json.Serialization.JsonPropertyName("${p.field}")]
|
|
1148
|
-
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'JsonIgnoreCondition.WhenWritingDefault' : 'JsonIgnoreCondition.WhenWritingNull'})]
|
|
1148
|
+
[System.Text.Json.Serialization.JsonIgnore(Condition = ${type === 'System.DateTime' ? 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault' : 'System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull'})]
|
|
1149
1149
|
public ${type} ${toCSharpName(p.field)} { get; set; }
|
|
1150
1150
|
|
|
1151
1151
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mushroom-cli",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.26",
|
|
4
4
|
"description": "Mushroom CLI",
|
|
5
5
|
"main": "dist/mr.js",
|
|
6
6
|
"type": "module",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"targz": "^1.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@eslint/js": "^9.
|
|
45
|
+
"@eslint/js": "^9.28.0",
|
|
46
46
|
"@types/jsdom": "^21.1.7",
|
|
47
47
|
"@types/minify": "^9.1.4",
|
|
48
|
-
"@types/node": "^22.15.
|
|
48
|
+
"@types/node": "^22.15.29",
|
|
49
49
|
"@types/node-fetch": "^2.6.12",
|
|
50
50
|
"@types/readline-sync": "^1.4.8",
|
|
51
51
|
"@types/targz": "^1.0.5",
|
|
52
52
|
"copyfiles": "^2.4.1",
|
|
53
|
-
"eslint": "^9.
|
|
53
|
+
"eslint": "^9.28.0",
|
|
54
54
|
"husky": "^9.1.7",
|
|
55
55
|
"lint-staged": "^16.1.0",
|
|
56
56
|
"only-allow": "^1.2.1",
|