@alloy-js/csharp 0.17.0 → 0.18.0-dev.11
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/src/components/ClassDeclaration.d.ts +57 -0
- package/dist/src/components/ClassDeclaration.d.ts.map +1 -0
- package/dist/src/components/{Class.js → ClassDeclaration.js} +42 -53
- package/dist/src/components/ClassMethod.d.ts +25 -0
- package/dist/src/components/ClassMethod.d.ts.map +1 -0
- package/dist/src/components/ClassMethod.js +60 -0
- package/dist/src/components/EnumDeclaration.d.ts +34 -0
- package/dist/src/components/EnumDeclaration.d.ts.map +1 -0
- package/dist/src/components/{Enum.js → EnumDeclaration.js} +25 -5
- package/dist/src/components/class/property.d.ts +55 -0
- package/dist/src/components/class/property.d.ts.map +1 -0
- package/dist/src/components/class/property.js +67 -0
- package/dist/src/components/class/property.test.d.ts +2 -0
- package/dist/src/components/class/property.test.d.ts.map +1 -0
- package/dist/src/components/class/property.test.js +201 -0
- package/dist/src/components/doc/comment.d.ts +70 -0
- package/dist/src/components/doc/comment.d.ts.map +1 -0
- package/dist/src/components/doc/comment.js +88 -0
- package/dist/src/components/doc/comment.test.d.ts +2 -0
- package/dist/src/components/doc/comment.test.d.ts.map +1 -0
- package/dist/src/components/doc/comment.test.js +348 -0
- package/dist/src/components/doc/from-markdown.d.ts +6 -0
- package/dist/src/components/doc/from-markdown.d.ts.map +1 -0
- package/dist/src/components/doc/from-markdown.js +58 -0
- package/dist/src/components/doc/from-markdown.test.d.ts +2 -0
- package/dist/src/components/doc/from-markdown.test.d.ts.map +1 -0
- package/dist/src/components/doc/from-markdown.test.js +83 -0
- package/dist/src/components/index.d.ts +9 -2
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +9 -2
- package/dist/src/components/interface/declaration.d.ts +34 -0
- package/dist/src/components/interface/declaration.d.ts.map +1 -0
- package/dist/src/components/interface/declaration.js +90 -0
- package/dist/src/components/interface/declaration.test.d.ts +2 -0
- package/dist/src/components/interface/declaration.test.d.ts.map +1 -0
- package/dist/src/components/interface/declaration.test.js +69 -0
- package/dist/src/components/interface/method.d.ts +18 -0
- package/dist/src/components/interface/method.d.ts.map +1 -0
- package/dist/src/components/interface/method.js +59 -0
- package/dist/src/components/interface/method.test.d.ts +2 -0
- package/dist/src/components/interface/method.test.d.ts.map +1 -0
- package/dist/src/components/interface/method.test.js +131 -0
- package/dist/src/components/interface/property.d.ts +38 -0
- package/dist/src/components/interface/property.d.ts.map +1 -0
- package/dist/src/components/interface/property.js +67 -0
- package/dist/src/components/interface/property.test.d.ts +2 -0
- package/dist/src/components/interface/property.test.d.ts.map +1 -0
- package/dist/src/components/interface/property.test.js +165 -0
- package/dist/src/components/stc/index.d.ts +2 -2
- package/dist/src/components/stc/index.d.ts.map +1 -1
- package/dist/src/components/stc/index.js +2 -2
- package/dist/src/modifiers.d.ts +13 -4
- package/dist/src/modifiers.d.ts.map +1 -1
- package/dist/src/modifiers.js +13 -27
- package/dist/src/name-policy.d.ts +1 -1
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js +1 -0
- package/dist/test/class-declaration.test.d.ts +2 -0
- package/dist/test/class-declaration.test.d.ts.map +1 -0
- package/dist/test/{class.test.js → class-declaration.test.js} +123 -73
- package/dist/test/class-method.test.d.ts +2 -0
- package/dist/test/class-method.test.d.ts.map +1 -0
- package/dist/test/class-method.test.js +161 -0
- package/dist/test/enum.test.js +12 -12
- package/dist/test/namespace.test.js +8 -8
- package/dist/test/project-directory.test.d.ts +2 -0
- package/dist/test/project-directory.test.d.ts.map +1 -0
- package/dist/test/{projectdirectory.test.js → project-directory.test.js} +8 -8
- package/dist/test/sourcefile.test.js +4 -4
- package/dist/test/using.test.js +9 -9
- package/dist/test/utils.d.ts +3 -0
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +15 -0
- package/dist/test/vitest.setup.d.ts +2 -0
- package/dist/test/vitest.setup.d.ts.map +1 -0
- package/dist/test/vitest.setup.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/src/components/{Class.tsx → ClassDeclaration.tsx} +68 -66
- package/src/components/ClassMethod.tsx +94 -0
- package/src/components/{Enum.tsx → EnumDeclaration.tsx} +30 -6
- package/src/components/class/property.test.tsx +180 -0
- package/src/components/class/property.tsx +135 -0
- package/src/components/doc/comment.test.tsx +337 -0
- package/src/components/doc/comment.tsx +152 -0
- package/src/components/doc/from-markdown.test.tsx +103 -0
- package/src/components/doc/from-markdown.tsx +58 -0
- package/src/components/index.ts +9 -2
- package/src/components/interface/declaration.test.tsx +56 -0
- package/src/components/interface/declaration.tsx +109 -0
- package/src/components/interface/method.test.tsx +120 -0
- package/src/components/interface/method.tsx +82 -0
- package/src/components/interface/property.test.tsx +144 -0
- package/src/components/interface/property.tsx +107 -0
- package/src/components/stc/index.ts +2 -2
- package/src/modifiers.ts +32 -37
- package/src/name-policy.ts +2 -0
- package/temp/api.json +4419 -567
- package/test/{class.test.tsx → class-declaration.test.tsx} +103 -99
- package/test/class-method.test.tsx +147 -0
- package/test/enum.test.tsx +11 -11
- package/test/namespace.test.tsx +4 -4
- package/test/{projectdirectory.test.tsx → project-directory.test.tsx} +4 -4
- package/test/sourcefile.test.tsx +2 -2
- package/test/using.test.tsx +9 -9
- package/test/utils.tsx +9 -0
- package/test/vitest.setup.ts +1 -0
- package/tsconfig.json +2 -1
- package/vitest.config.ts +3 -0
- package/dist/src/components/Class.d.ts +0 -36
- package/dist/src/components/Class.d.ts.map +0 -1
- package/dist/src/components/Enum.d.ts +0 -15
- package/dist/src/components/Enum.d.ts.map +0 -1
- package/dist/test/class.test.d.ts +0 -2
- package/dist/test/class.test.d.ts.map +0 -1
- package/dist/test/projectdirectory.test.d.ts +0 -2
- package/dist/test/projectdirectory.test.d.ts.map +0 -1
|
@@ -18,16 +18,16 @@ it("defines a project directory file with multiple source files", () => {
|
|
|
18
18
|
return [_$createComponent(csharp.SourceFile, {
|
|
19
19
|
path: "Test1.cs",
|
|
20
20
|
get children() {
|
|
21
|
-
return _$createComponent(csharp.
|
|
22
|
-
|
|
21
|
+
return _$createComponent(csharp.ClassDeclaration, {
|
|
22
|
+
"public": true,
|
|
23
23
|
name: "TestClass1"
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}), _$createComponent(csharp.SourceFile, {
|
|
27
27
|
path: "Test2.cs",
|
|
28
28
|
get children() {
|
|
29
|
-
return _$createComponent(csharp.
|
|
30
|
-
|
|
29
|
+
return _$createComponent(csharp.ClassDeclaration, {
|
|
30
|
+
"public": true,
|
|
31
31
|
name: "TestClass2"
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -82,16 +82,16 @@ it("defines a project directory file with multiple source files and a custom TFM
|
|
|
82
82
|
return [_$createComponent(csharp.SourceFile, {
|
|
83
83
|
path: "Test1.cs",
|
|
84
84
|
get children() {
|
|
85
|
-
return _$createComponent(csharp.
|
|
86
|
-
|
|
85
|
+
return _$createComponent(csharp.ClassDeclaration, {
|
|
86
|
+
"public": true,
|
|
87
87
|
name: "TestClass1"
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
}), _$createComponent(csharp.SourceFile, {
|
|
91
91
|
path: "Test2.cs",
|
|
92
92
|
get children() {
|
|
93
|
-
return _$createComponent(csharp.
|
|
94
|
-
|
|
93
|
+
return _$createComponent(csharp.ClassDeclaration, {
|
|
94
|
+
"public": true,
|
|
95
95
|
name: "TestClass2"
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -12,16 +12,16 @@ it("defines multiple source files with unique content", () => {
|
|
|
12
12
|
return [_$createComponent(csharp.SourceFile, {
|
|
13
13
|
path: "Test1.cs",
|
|
14
14
|
get children() {
|
|
15
|
-
return _$createComponent(csharp.
|
|
16
|
-
|
|
15
|
+
return _$createComponent(csharp.ClassDeclaration, {
|
|
16
|
+
"public": true,
|
|
17
17
|
name: "TestClass1"
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}), _$createComponent(csharp.SourceFile, {
|
|
21
21
|
path: "Test2.cs",
|
|
22
22
|
get children() {
|
|
23
|
-
return _$createComponent(csharp.
|
|
24
|
-
|
|
23
|
+
return _$createComponent(csharp.ClassDeclaration, {
|
|
24
|
+
"public": true,
|
|
25
25
|
name: "TestClass2"
|
|
26
26
|
});
|
|
27
27
|
}
|
package/dist/test/using.test.js
CHANGED
|
@@ -63,16 +63,16 @@ it("adds using statement across namespaces", () => {
|
|
|
63
63
|
return _$createComponent(csharp.SourceFile, {
|
|
64
64
|
path: "Models.cs",
|
|
65
65
|
get children() {
|
|
66
|
-
return [_$createComponent(csharp.
|
|
67
|
-
|
|
66
|
+
return [_$createComponent(csharp.ClassDeclaration, {
|
|
67
|
+
"public": true,
|
|
68
68
|
name: "Input",
|
|
69
69
|
refkey: inputTypeRefkey
|
|
70
|
-
}), _$createIntrinsic("hbr", {}), _$createComponent(csharp.
|
|
71
|
-
|
|
70
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
|
|
71
|
+
"public": true,
|
|
72
72
|
name: "Output",
|
|
73
73
|
refkey: outputTypeRefkey
|
|
74
|
-
}), _$createIntrinsic("hbr", {}), _$createComponent(csharp.
|
|
75
|
-
|
|
74
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(csharp.EnumDeclaration, {
|
|
75
|
+
"public": true,
|
|
76
76
|
name: "TestEnum",
|
|
77
77
|
get children() {
|
|
78
78
|
return [_$createComponent(csharp.EnumMember, {
|
|
@@ -93,12 +93,12 @@ it("adds using statement across namespaces", () => {
|
|
|
93
93
|
path: "Client.cs",
|
|
94
94
|
using: ["System"],
|
|
95
95
|
get children() {
|
|
96
|
-
return [_$createComponent(csharp.
|
|
97
|
-
|
|
96
|
+
return [_$createComponent(csharp.ClassDeclaration, {
|
|
97
|
+
"public": true,
|
|
98
98
|
name: "Client",
|
|
99
99
|
get children() {
|
|
100
100
|
return _$createComponent(csharp.ClassMethod, {
|
|
101
|
-
|
|
101
|
+
"public": true,
|
|
102
102
|
name: "MethodOne",
|
|
103
103
|
parameters: params,
|
|
104
104
|
returns: outputTypeRefkey
|
package/dist/test/utils.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as core from "@alloy-js/core";
|
|
2
|
+
export declare function TestNamespace(props: {
|
|
3
|
+
children: core.Children;
|
|
4
|
+
}): core.Children;
|
|
2
5
|
export declare function toSourceText(c: core.Children): string;
|
|
3
6
|
export declare function testRender(c: core.Children): core.OutputDirectory;
|
|
4
7
|
export declare function findFile(res: core.OutputDirectory, path: string): core.OutputFile;
|
package/dist/test/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAKvC,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAWrD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAMjE;AAED,wBAAgB,QAAQ,CACtB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,IAAI,EAAE,MAAM,GACX,IAAI,CAAC,UAAU,CA2BjB;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,IAAI,CAKN"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAKvC,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC;CACzB,GAAG,IAAI,CAAC,QAAQ,CAMhB;AACD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAWrD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAMjE;AAED,wBAAgB,QAAQ,CACtB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,IAAI,EAAE,MAAM,GACX,IAAI,CAAC,UAAU,CA2BjB;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,IAAI,CAKN"}
|
package/dist/test/utils.js
CHANGED
|
@@ -3,6 +3,21 @@ import * as core from "@alloy-js/core";
|
|
|
3
3
|
import * as coretest from "@alloy-js/core/testing";
|
|
4
4
|
import { expect } from "vitest";
|
|
5
5
|
import * as csharp from "../src/index.js";
|
|
6
|
+
export function TestNamespace(props) {
|
|
7
|
+
return _$createComponent(core.Output, {
|
|
8
|
+
get namePolicy() {
|
|
9
|
+
return csharp.createCSharpNamePolicy();
|
|
10
|
+
},
|
|
11
|
+
get children() {
|
|
12
|
+
return _$createComponent(csharp.Namespace, {
|
|
13
|
+
name: "TestCode",
|
|
14
|
+
get children() {
|
|
15
|
+
return props.children;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
6
21
|
export function toSourceText(c) {
|
|
7
22
|
const res = core.render(_$createComponent(core.Output, {
|
|
8
23
|
get namePolicy() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.setup.d.ts","sourceRoot":"","sources":["../../test/vitest.setup.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@alloy-js/core/testing";
|