@alloy-js/csharp 0.18.0-dev.7 → 0.18.0-dev.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.
Files changed (46) hide show
  1. package/dist/src/components/ClassDeclaration.d.ts +2 -0
  2. package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
  3. package/dist/src/components/ClassDeclaration.js +6 -1
  4. package/dist/src/components/ClassMethod.d.ts +2 -0
  5. package/dist/src/components/ClassMethod.d.ts.map +1 -1
  6. package/dist/src/components/ClassMethod.js +6 -1
  7. package/dist/src/components/doc/comment.d.ts +69 -0
  8. package/dist/src/components/doc/comment.d.ts.map +1 -0
  9. package/dist/src/components/doc/comment.js +71 -0
  10. package/dist/src/components/doc/comment.test.d.ts +2 -0
  11. package/dist/src/components/doc/comment.test.d.ts.map +1 -0
  12. package/dist/src/components/doc/comment.test.js +338 -0
  13. package/dist/src/components/interface/declaration.d.ts +2 -0
  14. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  15. package/dist/src/components/interface/declaration.js +6 -1
  16. package/dist/src/components/interface/declaration.test.js +13 -0
  17. package/dist/src/components/interface/method.d.ts +2 -0
  18. package/dist/src/components/interface/method.d.ts.map +1 -1
  19. package/dist/src/components/interface/method.js +6 -1
  20. package/dist/src/components/interface/method.test.js +21 -0
  21. package/dist/src/components/interface/property.d.ts +2 -0
  22. package/dist/src/components/interface/property.d.ts.map +1 -1
  23. package/dist/src/components/interface/property.js +7 -2
  24. package/dist/src/components/interface/property.test.js +24 -0
  25. package/dist/test/class-method.test.js +21 -0
  26. package/dist/test/class.test.js +13 -0
  27. package/dist/test/vitest.setup.d.ts +2 -0
  28. package/dist/test/vitest.setup.d.ts.map +1 -0
  29. package/dist/test/vitest.setup.js +1 -0
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +2 -2
  32. package/src/components/ClassDeclaration.tsx +4 -0
  33. package/src/components/ClassMethod.tsx +5 -0
  34. package/src/components/doc/comment.test.tsx +336 -0
  35. package/src/components/doc/comment.tsx +122 -0
  36. package/src/components/interface/declaration.test.tsx +11 -0
  37. package/src/components/interface/declaration.tsx +5 -0
  38. package/src/components/interface/method.test.tsx +16 -0
  39. package/src/components/interface/method.tsx +5 -0
  40. package/src/components/interface/property.test.tsx +22 -0
  41. package/src/components/interface/property.tsx +5 -0
  42. package/temp/api.json +112 -0
  43. package/test/class-method.test.tsx +16 -0
  44. package/test/class.test.tsx +11 -0
  45. package/test/vitest.setup.ts +1 -0
  46. package/vitest.config.ts +3 -0
package/temp/api.json CHANGED
@@ -631,6 +631,34 @@
631
631
  "name": "ClassDeclarationProps",
632
632
  "preserveMemberOrder": false,
633
633
  "members": [
634
+ {
635
+ "kind": "PropertySignature",
636
+ "canonicalReference": "@alloy-js/csharp!ClassDeclarationProps#doc:member",
637
+ "docComment": "/**\n * Doc comment\n */\n",
638
+ "excerptTokens": [
639
+ {
640
+ "kind": "Content",
641
+ "text": "doc?: "
642
+ },
643
+ {
644
+ "kind": "Reference",
645
+ "text": "core.Children",
646
+ "canonicalReference": "@alloy-js/core!Children:type"
647
+ },
648
+ {
649
+ "kind": "Content",
650
+ "text": ";"
651
+ }
652
+ ],
653
+ "isReadonly": false,
654
+ "isOptional": true,
655
+ "releaseTag": "Public",
656
+ "name": "doc",
657
+ "propertyTypeTokenRange": {
658
+ "startIndex": 1,
659
+ "endIndex": 2
660
+ }
661
+ },
634
662
  {
635
663
  "kind": "PropertySignature",
636
664
  "canonicalReference": "@alloy-js/csharp!ClassDeclarationProps#name:member",
@@ -1166,6 +1194,34 @@
1166
1194
  "endIndex": 2
1167
1195
  }
1168
1196
  },
1197
+ {
1198
+ "kind": "PropertySignature",
1199
+ "canonicalReference": "@alloy-js/csharp!ClassMethodProps#doc:member",
1200
+ "docComment": "/**\n * Doc comment\n */\n",
1201
+ "excerptTokens": [
1202
+ {
1203
+ "kind": "Content",
1204
+ "text": "doc?: "
1205
+ },
1206
+ {
1207
+ "kind": "Reference",
1208
+ "text": "Children",
1209
+ "canonicalReference": "@alloy-js/core!Children:type"
1210
+ },
1211
+ {
1212
+ "kind": "Content",
1213
+ "text": ";"
1214
+ }
1215
+ ],
1216
+ "isReadonly": false,
1217
+ "isOptional": true,
1218
+ "releaseTag": "Public",
1219
+ "name": "doc",
1220
+ "propertyTypeTokenRange": {
1221
+ "startIndex": 1,
1222
+ "endIndex": 2
1223
+ }
1224
+ },
1169
1225
  {
1170
1226
  "kind": "PropertySignature",
1171
1227
  "canonicalReference": "@alloy-js/csharp!ClassMethodProps#name:member",
@@ -2534,6 +2590,34 @@
2534
2590
  "name": "InterfaceDeclarationProps",
2535
2591
  "preserveMemberOrder": false,
2536
2592
  "members": [
2593
+ {
2594
+ "kind": "PropertySignature",
2595
+ "canonicalReference": "@alloy-js/csharp!InterfaceDeclarationProps#doc:member",
2596
+ "docComment": "/**\n * Doc comment\n */\n",
2597
+ "excerptTokens": [
2598
+ {
2599
+ "kind": "Content",
2600
+ "text": "doc?: "
2601
+ },
2602
+ {
2603
+ "kind": "Reference",
2604
+ "text": "core.Children",
2605
+ "canonicalReference": "@alloy-js/core!Children:type"
2606
+ },
2607
+ {
2608
+ "kind": "Content",
2609
+ "text": ";"
2610
+ }
2611
+ ],
2612
+ "isReadonly": false,
2613
+ "isOptional": true,
2614
+ "releaseTag": "Public",
2615
+ "name": "doc",
2616
+ "propertyTypeTokenRange": {
2617
+ "startIndex": 1,
2618
+ "endIndex": 2
2619
+ }
2620
+ },
2537
2621
  {
2538
2622
  "kind": "PropertySignature",
2539
2623
  "canonicalReference": "@alloy-js/csharp!InterfaceDeclarationProps#name:member",
@@ -2799,6 +2883,34 @@
2799
2883
  "endIndex": 2
2800
2884
  }
2801
2885
  },
2886
+ {
2887
+ "kind": "PropertySignature",
2888
+ "canonicalReference": "@alloy-js/csharp!InterfaceMethodProps#doc:member",
2889
+ "docComment": "/**\n * Doc comment\n */\n",
2890
+ "excerptTokens": [
2891
+ {
2892
+ "kind": "Content",
2893
+ "text": "doc?: "
2894
+ },
2895
+ {
2896
+ "kind": "Reference",
2897
+ "text": "Children",
2898
+ "canonicalReference": "@alloy-js/core!Children:type"
2899
+ },
2900
+ {
2901
+ "kind": "Content",
2902
+ "text": ";"
2903
+ }
2904
+ ],
2905
+ "isReadonly": false,
2906
+ "isOptional": true,
2907
+ "releaseTag": "Public",
2908
+ "name": "doc",
2909
+ "propertyTypeTokenRange": {
2910
+ "startIndex": 1,
2911
+ "endIndex": 2
2912
+ }
2913
+ },
2802
2914
  {
2803
2915
  "kind": "PropertySignature",
2804
2916
  "canonicalReference": "@alloy-js/csharp!InterfaceMethodProps#name:member",
@@ -129,3 +129,19 @@ it("defines params and return type", () => {
129
129
  }
130
130
  `);
131
131
  });
132
+
133
+ it("specify doc comment", () => {
134
+ expect(
135
+ <TestNamespace>
136
+ <ClassDeclaration name="Test">
137
+ <ClassMethod name="Method" doc="This is a test" />
138
+ </ClassDeclaration>
139
+ </TestNamespace>,
140
+ ).toRenderTo(`
141
+ class Test
142
+ {
143
+ /// This is a test
144
+ void Method() {}
145
+ }
146
+ `);
147
+ });
@@ -299,3 +299,14 @@ it("declares class with constructor params and assigns values to fields", () =>
299
299
  }
300
300
  `);
301
301
  });
302
+
303
+ it("specify doc comment", () => {
304
+ expect(
305
+ <utils.TestNamespace>
306
+ <ClassDeclaration name="Test" doc="This is a test" />
307
+ </utils.TestNamespace>,
308
+ ).toRenderTo(`
309
+ /// This is a test
310
+ class Test;
311
+ `);
312
+ });
@@ -0,0 +1 @@
1
+ import "@alloy-js/core/testing";
package/vitest.config.ts CHANGED
@@ -6,5 +6,8 @@ export default defineConfig({
6
6
  jsx: "preserve",
7
7
  sourcemap: "both",
8
8
  },
9
+ test: {
10
+ setupFiles: ["./test/vitest.setup.ts"],
11
+ },
9
12
  plugins: [alloyPlugin()],
10
13
  });