mushroom-cli 2.0.0-alpha.1 → 2.0.0-alpha.2
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 +6 -0
- package/dist/gen/gen-csharp.js +33 -4
- package/dist/gen.js +1 -1
- package/dist/merge.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
package/dist/gen/gen-csharp.js
CHANGED
|
@@ -4,7 +4,8 @@ import { getExtensionEventsCode } from './csharp/extEvents.js';
|
|
|
4
4
|
const packageVersion = common.getPackageVersion();
|
|
5
5
|
const newLine = '\n';
|
|
6
6
|
const header = `// NOTE: Please do not modify this file
|
|
7
|
-
// NOTE: Version and compatibility information: please see in Info.cs file
|
|
7
|
+
// NOTE: Version and compatibility information: please see in Info.cs file`;
|
|
8
|
+
const resharperDisable = `
|
|
8
9
|
|
|
9
10
|
// ReSharper disable CheckNamespace
|
|
10
11
|
// ReSharper disable ClassCannotBeInstantiated
|
|
@@ -12,6 +13,7 @@ const header = `// NOTE: Please do not modify this file
|
|
|
12
13
|
// ReSharper disable EmptyNamespace
|
|
13
14
|
// ReSharper disable IdentifierTypo
|
|
14
15
|
// ReSharper disable InconsistentNaming
|
|
16
|
+
// ReSharper disable MemberCanBeMadeStatic.Local
|
|
15
17
|
// ReSharper disable PartialTypeWithSinglePart
|
|
16
18
|
// ReSharper disable RedundantTypeArgumentsOfMethod
|
|
17
19
|
// ReSharper disable RedundantUsingDirective
|
|
@@ -21,6 +23,31 @@ const header = `// NOTE: Please do not modify this file
|
|
|
21
23
|
// ReSharper disable UnusedParameter.Local
|
|
22
24
|
// ReSharper disable UnusedTypeParameter
|
|
23
25
|
`;
|
|
26
|
+
const resharperEditorConfig = `[*.cs]
|
|
27
|
+
# Disable Namespace & Class rules
|
|
28
|
+
resharper_check_namespace_highlighting = none
|
|
29
|
+
resharper_class_cannot_be_instantiated_highlighting = none
|
|
30
|
+
resharper_empty_namespace_highlighting = none
|
|
31
|
+
resharper_partial_type_with_single_part_highlighting = none
|
|
32
|
+
resharper_inconsistent_naming_highlighting = none
|
|
33
|
+
|
|
34
|
+
# Disable Typo checks
|
|
35
|
+
resharper_comment_typo_highlighting = none
|
|
36
|
+
resharper_identifier_typo_highlighting = none
|
|
37
|
+
resharper_string_literal_typo_highlighting = none
|
|
38
|
+
|
|
39
|
+
# Disable Redundant code rules
|
|
40
|
+
resharper_redundant_type_arguments_of_method_highlighting = none
|
|
41
|
+
resharper_redundant_using_directive_highlighting = none
|
|
42
|
+
|
|
43
|
+
# Disable Unused elements
|
|
44
|
+
resharper_unused_member_global_highlighting = none
|
|
45
|
+
resharper_unused_member_local_highlighting = none
|
|
46
|
+
resharper_unused_parameter_local_highlighting = none
|
|
47
|
+
resharper_unused_type_parameter_highlighting = none
|
|
48
|
+
|
|
49
|
+
# Disable Code Suggestions
|
|
50
|
+
resharper_member_can_be_made_static_local_highlighting = none`;
|
|
24
51
|
const infoContent = `// Mushroom CLI version: ${packageVersion} (https://www.npmjs.com/package/mushroomjs)${newLine}// Compatible with Mushroom Server version: 0.3 or higher (https://www.nuget.org/packages/Mushroom/)`;
|
|
25
52
|
const helperMethods = `
|
|
26
53
|
public delegate T GetT<out T>(Mushroom.ActionArguments arg);
|
|
@@ -532,7 +559,7 @@ ${roleNames}
|
|
|
532
559
|
#if DEBUG
|
|
533
560
|
namespace ${namespace}
|
|
534
561
|
{
|
|
535
|
-
class RefactorHelper
|
|
562
|
+
internal class RefactorHelper
|
|
536
563
|
{
|
|
537
564
|
private RefactorHelper() { }
|
|
538
565
|
${helperMethods}
|
|
@@ -555,12 +582,14 @@ ${strExtensionEventHandlers}
|
|
|
555
582
|
fs.writeFileSync(aliasProject.output + '/RoleNames.cs', roleNamesFileContent);
|
|
556
583
|
fs.writeFileSync(aliasProject.output + '/RefactorHelper.cs', refactorHelperFileContent);
|
|
557
584
|
fs.writeFileSync(aliasProject.output + '/Info.cs', infoContent);
|
|
585
|
+
fs.writeFileSync(aliasProject.output + '/.editorconfig', resharperEditorConfig);
|
|
558
586
|
common.logInfo(`Generated CSharp MongoDb Classes for ${projectName}@${alias} to folder ${aliasProject.output}`);
|
|
559
587
|
}
|
|
560
588
|
else {
|
|
561
589
|
const fullCode = `${infoContent}
|
|
562
590
|
|
|
563
|
-
|
|
591
|
+
// NOTE: Please do not modify this file
|
|
592
|
+
${resharperDisable}
|
|
564
593
|
|
|
565
594
|
namespace ${namespace}
|
|
566
595
|
{
|
|
@@ -599,7 +628,7 @@ ${out.strEnumClasses ?? ''}
|
|
|
599
628
|
#if DEBUG
|
|
600
629
|
namespace ${namespace}.CodeHelper
|
|
601
630
|
{
|
|
602
|
-
class RefactorHelper
|
|
631
|
+
internal class RefactorHelper
|
|
603
632
|
{
|
|
604
633
|
private RefactorHelper() { }
|
|
605
634
|
${helperMethods}
|
package/dist/gen.js
CHANGED
|
@@ -55,7 +55,7 @@ export default async function gen(args) {
|
|
|
55
55
|
}
|
|
56
56
|
if (!master || typeof master !== 'object')
|
|
57
57
|
throw new Error(`Invalid api project configuration. Please re-check file ${project.src}`);
|
|
58
|
-
let source
|
|
58
|
+
let source;
|
|
59
59
|
if (Array.isArray(master.fragments)) {
|
|
60
60
|
common.logInfo('Process master file', project.src);
|
|
61
61
|
source = masterFile.processMasterFile(path.dirname(project.src), master);
|
package/dist/merge.js
CHANGED
|
@@ -50,7 +50,7 @@ export default async function merge(args) {
|
|
|
50
50
|
}
|
|
51
51
|
if (!master || typeof master !== 'object')
|
|
52
52
|
throw new Error(`Invalid api project configuration. Please re-check file ${project.src}`);
|
|
53
|
-
let projectApi
|
|
53
|
+
let projectApi;
|
|
54
54
|
if (Array.isArray(master.fragments)) {
|
|
55
55
|
common.logInfo('Process master file:', project.src);
|
|
56
56
|
projectApi = masterFile.processMasterFile(path.dirname(project.src), master);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mushroom-cli",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.2",
|
|
4
4
|
"description": "Mushroom CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"readline-sync": "^1.4.10"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@eslint/js": "^
|
|
41
|
+
"@eslint/js": "^10.0.1",
|
|
42
42
|
"@types/html-minifier-terser": "^7.0.2",
|
|
43
43
|
"@types/node": "^22.15.29",
|
|
44
44
|
"@types/readline-sync": "^1.4.8",
|
|
45
45
|
"copyfiles": "^2.4.1",
|
|
46
|
-
"eslint": "^
|
|
46
|
+
"eslint": "^10.8.1",
|
|
47
47
|
"husky": "^9.1.7",
|
|
48
|
-
"lint-staged": "^
|
|
48
|
+
"lint-staged": "^17.3.0",
|
|
49
49
|
"only-allow": "^1.2.2",
|
|
50
|
-
"prettier": "^3.
|
|
50
|
+
"prettier": "^3.9.6",
|
|
51
51
|
"typescript": "^5.9.3",
|
|
52
|
-
"typescript-eslint": "^8.
|
|
52
|
+
"typescript-eslint": "^8.67.0"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=14.13.1"
|