@alloy-js/go 0.3.1-dev.0 → 0.3.1

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 (57) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/dev/src/components/doc/comment.test.js +39 -40
  3. package/dist/dev/src/components/doc/comment.test.js.map +1 -1
  4. package/dist/dev/src/components/interface/declaration.js +16 -16
  5. package/dist/dev/src/components/interface/declaration.js.map +1 -1
  6. package/dist/dev/src/components/interface/interface.test.js +27 -28
  7. package/dist/dev/src/components/interface/interface.test.js.map +1 -1
  8. package/dist/dev/src/components/struct/declaration.js +13 -13
  9. package/dist/dev/src/components/struct/declaration.js.map +1 -1
  10. package/dist/dev/src/components/struct/struct.test.js +49 -51
  11. package/dist/dev/src/components/struct/struct.test.js.map +1 -1
  12. package/dist/dev/src/components/var/var-declaration.test.js +72 -67
  13. package/dist/dev/src/components/var/var-declaration.test.js.map +1 -1
  14. package/dist/dev/src/create-module.js.map +1 -1
  15. package/dist/dev/test/utils.js +5 -55
  16. package/dist/dev/test/utils.js.map +1 -1
  17. package/dist/src/components/doc/comment.test.d.ts +1 -1
  18. package/dist/src/components/doc/comment.test.d.ts.map +1 -1
  19. package/dist/src/components/doc/comment.test.js +0 -1
  20. package/dist/src/components/doc/comment.test.js.map +1 -1
  21. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  22. package/dist/src/components/interface/declaration.js.map +1 -1
  23. package/dist/src/components/interface/interface.test.js +4 -5
  24. package/dist/src/components/interface/interface.test.js.map +1 -1
  25. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  26. package/dist/src/components/struct/declaration.js.map +1 -1
  27. package/dist/src/components/struct/struct.test.js +6 -8
  28. package/dist/src/components/struct/struct.test.js.map +1 -1
  29. package/dist/src/components/var/var-declaration.test.d.ts +1 -1
  30. package/dist/src/components/var/var-declaration.test.d.ts.map +1 -1
  31. package/dist/src/components/var/var-declaration.test.js +16 -11
  32. package/dist/src/components/var/var-declaration.test.js.map +1 -1
  33. package/dist/src/create-module.d.ts.map +1 -1
  34. package/dist/src/create-module.js.map +1 -1
  35. package/dist/test/utils.d.ts +1 -4
  36. package/dist/test/utils.d.ts.map +1 -1
  37. package/dist/test/utils.js +1 -43
  38. package/dist/test/utils.js.map +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/docs/api/components/index.md +0 -1
  41. package/docs/api/index.md +2 -2
  42. package/docs/api/types/ReferenceProps.md +7 -0
  43. package/docs/api/types/index.md +1 -0
  44. package/package.json +11 -10
  45. package/src/components/doc/comment.test.tsx +0 -1
  46. package/src/components/interface/declaration.tsx +1 -2
  47. package/src/components/interface/interface.test.tsx +4 -6
  48. package/src/components/struct/declaration.tsx +1 -2
  49. package/src/components/struct/struct.test.tsx +6 -10
  50. package/src/components/var/var-declaration.test.tsx +15 -13
  51. package/src/create-module.ts +12 -8
  52. package/temp/api.json +38 -14
  53. package/test/utils.tsx +1 -64
  54. package/tsconfig.json +1 -1
  55. package/tsdoc-metadata.json +1 -1
  56. package/vitest.config.ts +1 -0
  57. package/docs/api/components/Reference.md +0 -25
@@ -1,7 +1,4 @@
1
- import { Children, ContentOutputFile, OutputDirectory, PrintTreeOptions } from "@alloy-js/core";
2
- export declare function toSourceText(c: Children, options?: PrintTreeOptions): string;
3
- export declare function findFile(res: OutputDirectory, path: string): ContentOutputFile;
4
- export declare function assertFileContents(res: OutputDirectory, expectedFiles: Record<string, string>): void;
1
+ import { Children } from "@alloy-js/core";
5
2
  export declare function TestPackage(props: {
6
3
  children: Children;
7
4
  }): Children;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,iBAAiB,EAEjB,eAAe,EAEf,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAKxB,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAS5E;AAED,wBAAgB,QAAQ,CACtB,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,GACX,iBAAiB,CA2BnB;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,eAAe,EACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAMtC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,GAAG,QAAQ,CAUnE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,gBAAgB,CAAC;AAGlD,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,GAAG,QAAQ,CAUnE"}
@@ -1,48 +1,6 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { Output, render } from "@alloy-js/core";
3
- import { dedent } from "@alloy-js/core/testing";
4
- import { expect } from "vitest";
2
+ import { Output } from "@alloy-js/core";
5
3
  import * as go from "../src/index.js";
6
- export function toSourceText(c, options) {
7
- const res = render(_$createComponent(Output, {
8
- get children() {
9
- return _$createComponent(go.SourceFile, {
10
- path: "test.go",
11
- children: c
12
- });
13
- }
14
- }), options);
15
- return findFile(res, "test.go").contents;
16
- }
17
- export function findFile(res, path) {
18
- const result = findFileWorker(res, path);
19
- if (!result) {
20
- throw new Error("Expected to find file " + path);
21
- }
22
- return result;
23
- function findFileWorker(res, path) {
24
- for (const item of res.contents) {
25
- if (item.kind === "file") {
26
- if (item.path === path) {
27
- return item;
28
- }
29
- continue;
30
- } else {
31
- const found = findFileWorker(item, path);
32
- if (found) {
33
- return found;
34
- }
35
- }
36
- }
37
- return null;
38
- }
39
- }
40
- export function assertFileContents(res, expectedFiles) {
41
- for (const [path, contents] of Object.entries(expectedFiles)) {
42
- const file = findFile(res, path);
43
- expect(file.contents.trim()).toBe(dedent(contents).trim());
44
- }
45
- }
46
4
  export function TestPackage(props) {
47
5
  return _$createComponent(Output, {
48
6
  get children() {
@@ -1 +1 @@
1
- {"version":3,"names":["Output","render","dedent","expect","go","toSourceText","c","options","res","_$createComponent","children","SourceFile","path","findFile","contents","result","findFileWorker","Error","item","kind","found","assertFileContents","expectedFiles","Object","entries","file","trim","toBe","TestPackage","props","ModuleDirectory","name","SourceDirectory"],"sources":["../../test/utils.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAGEA,MAAM,EAINC,MAAM,QACD,gBAAgB;AACvB,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,MAAM,QAAQ,QAAQ;AAC/B,OAAO,KAAKC,EAAE,MAAM,iBAAiB;AAErC,OAAO,SAASC,YAAYA,CAACC,CAAW,EAAEC,OAA0B,EAAU;EAC5E,MAAMC,GAAG,GAAGP,MAAM,CAAAQ,iBAAA,CACfT,MAAM;IAAA,IAAAU,SAAA;MAAA,OAAAD,iBAAA,CACJL,EAAE,CAACO,UAAU;QAACC,IAAI;QAAAF,QAAA,EAAYJ;MAAC;IAAA;EAAA,IAElCC,OACF,CAAC;EAED,OAAOM,QAAQ,CAACL,GAAG,EAAE,SAAS,CAAC,CAACM,QAAQ;AAC1C;AAEA,OAAO,SAASD,QAAQA,CACtBL,GAAoB,EACpBI,IAAY,EACO;EACnB,MAAMG,MAAM,GAAGC,cAAc,CAACR,GAAG,EAAEI,IAAI,CAAC;EAExC,IAAI,CAACG,MAAM,EAAE;IACX,MAAM,IAAIE,KAAK,CAAC,wBAAwB,GAAGL,IAAI,CAAC;EAClD;EACA,OAAOG,MAAM;EAEb,SAASC,cAAcA,CACrBR,GAAoB,EACpBI,IAAY,EACO;IACnB,KAAK,MAAMM,IAAI,IAAIV,GAAG,CAACM,QAAQ,EAAE;MAC/B,IAAII,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;QACxB,IAAID,IAAI,CAACN,IAAI,KAAKA,IAAI,EAAE;UACtB,OAAOM,IAAI;QACb;QACA;MACF,CAAC,MAAM;QACL,MAAME,KAAK,GAAGJ,cAAc,CAACE,IAAI,EAAEN,IAAI,CAAC;QACxC,IAAIQ,KAAK,EAAE;UACT,OAAOA,KAAK;QACd;MACF;IACF;IACA,OAAO,IAAI;EACb;AACF;AAEA,OAAO,SAASC,kBAAkBA,CAChCb,GAAoB,EACpBc,aAAqC,EACrC;EACA,KAAK,MAAM,CAACV,IAAI,EAAEE,QAAQ,CAAC,IAAIS,MAAM,CAACC,OAAO,CAACF,aAAa,CAAC,EAAE;IAC5D,MAAMG,IAAI,GAAGZ,QAAQ,CAACL,GAAG,EAAEI,IAAI,CAAC;IAChCT,MAAM,CAACsB,IAAI,CAACX,QAAQ,CAACY,IAAI,CAAC,CAAC,CAAC,CAACC,IAAI,CAACzB,MAAM,CAACY,QAAQ,CAAC,CAACY,IAAI,CAAC,CAAC,CAAC;EAC5D;AACF;AAEA,OAAO,SAASE,WAAWA,CAACC,KAA6B,EAAY;EACnE,OAAApB,iBAAA,CACGT,MAAM;IAAA,IAAAU,SAAA;MAAA,OAAAD,iBAAA,CACJL,EAAE,CAAC0B,eAAe;QAACC,IAAI;QAAA,IAAArB,SAAA;UAAA,OAAAD,iBAAA,CACrBL,EAAE,CAAC4B,eAAe;YAACpB,IAAI;YAAA,IAAAF,SAAA;cAAA,OAAAD,iBAAA,CACrBL,EAAE,CAACO,UAAU;gBAACC,IAAI;gBAAA,IAAAF,SAAA;kBAAA,OAAYmB,KAAK,CAACnB,QAAQ;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAKvD","ignoreList":[]}
1
+ {"version":3,"names":["Output","go","TestPackage","props","_$createComponent","children","ModuleDirectory","name","SourceDirectory","path","SourceFile"],"sources":["../../test/utils.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAmBA,MAAM,QAAQ,gBAAgB;AACjD,OAAO,KAAKC,EAAE,MAAM,iBAAiB;AAErC,OAAO,SAASC,WAAWA,CAACC,KAA6B,EAAY;EACnE,OAAAC,iBAAA,CACGJ,MAAM;IAAA,IAAAK,SAAA;MAAA,OAAAD,iBAAA,CACJH,EAAE,CAACK,eAAe;QAACC,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAAD,iBAAA,CACrBH,EAAE,CAACO,eAAe;YAACC,IAAI;YAAA,IAAAJ,SAAA;cAAA,OAAAD,iBAAA,CACrBH,EAAE,CAACS,UAAU;gBAACD,IAAI;gBAAA,IAAAJ,SAAA;kBAAA,OAAYF,KAAK,CAACE,QAAQ;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAKvD","ignoreList":[]}