@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.
- package/CHANGELOG.md +4 -0
- package/dist/dev/src/components/doc/comment.test.js +39 -40
- package/dist/dev/src/components/doc/comment.test.js.map +1 -1
- package/dist/dev/src/components/interface/declaration.js +16 -16
- package/dist/dev/src/components/interface/declaration.js.map +1 -1
- package/dist/dev/src/components/interface/interface.test.js +27 -28
- package/dist/dev/src/components/interface/interface.test.js.map +1 -1
- package/dist/dev/src/components/struct/declaration.js +13 -13
- package/dist/dev/src/components/struct/declaration.js.map +1 -1
- package/dist/dev/src/components/struct/struct.test.js +49 -51
- package/dist/dev/src/components/struct/struct.test.js.map +1 -1
- package/dist/dev/src/components/var/var-declaration.test.js +72 -67
- package/dist/dev/src/components/var/var-declaration.test.js.map +1 -1
- package/dist/dev/src/create-module.js.map +1 -1
- package/dist/dev/test/utils.js +5 -55
- package/dist/dev/test/utils.js.map +1 -1
- package/dist/src/components/doc/comment.test.d.ts +1 -1
- package/dist/src/components/doc/comment.test.d.ts.map +1 -1
- package/dist/src/components/doc/comment.test.js +0 -1
- package/dist/src/components/doc/comment.test.js.map +1 -1
- package/dist/src/components/interface/declaration.d.ts.map +1 -1
- package/dist/src/components/interface/declaration.js.map +1 -1
- package/dist/src/components/interface/interface.test.js +4 -5
- package/dist/src/components/interface/interface.test.js.map +1 -1
- package/dist/src/components/struct/declaration.d.ts.map +1 -1
- package/dist/src/components/struct/declaration.js.map +1 -1
- package/dist/src/components/struct/struct.test.js +6 -8
- package/dist/src/components/struct/struct.test.js.map +1 -1
- package/dist/src/components/var/var-declaration.test.d.ts +1 -1
- package/dist/src/components/var/var-declaration.test.d.ts.map +1 -1
- package/dist/src/components/var/var-declaration.test.js +16 -11
- package/dist/src/components/var/var-declaration.test.js.map +1 -1
- package/dist/src/create-module.d.ts.map +1 -1
- package/dist/src/create-module.js.map +1 -1
- package/dist/test/utils.d.ts +1 -4
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +1 -43
- package/dist/test/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/index.md +0 -1
- package/docs/api/index.md +2 -2
- package/docs/api/types/ReferenceProps.md +7 -0
- package/docs/api/types/index.md +1 -0
- package/package.json +11 -10
- package/src/components/doc/comment.test.tsx +0 -1
- package/src/components/interface/declaration.tsx +1 -2
- package/src/components/interface/interface.test.tsx +4 -6
- package/src/components/struct/declaration.tsx +1 -2
- package/src/components/struct/struct.test.tsx +6 -10
- package/src/components/var/var-declaration.test.tsx +15 -13
- package/src/create-module.ts +12 -8
- package/temp/api.json +38 -14
- package/test/utils.tsx +1 -64
- package/tsconfig.json +1 -1
- package/tsdoc-metadata.json +1 -1
- package/vitest.config.ts +1 -0
- package/docs/api/components/Reference.md +0 -25
package/dist/test/utils.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Children
|
|
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;
|
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,
|
|
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"}
|
package/dist/test/utils.js
CHANGED
|
@@ -1,48 +1,6 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Output
|
|
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() {
|
package/dist/test/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Output","
|
|
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":[]}
|