@powerlines/plugin-alloy 0.26.236 → 0.26.238
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/core/components/index.cjs +1 -9
- package/dist/core/components/index.d.cts +1 -5
- package/dist/core/components/index.d.mts +1 -5
- package/dist/core/components/index.mjs +1 -5
- package/dist/core/components/infrastructure-file.cjs +6 -3
- package/dist/core/components/infrastructure-file.d.cts +1 -1
- package/dist/core/components/infrastructure-file.d.cts.map +1 -1
- package/dist/core/components/infrastructure-file.d.mts +1 -1
- package/dist/core/components/infrastructure-file.mjs +5 -2
- package/dist/core/contexts/index.cjs +1 -11
- package/dist/core/contexts/index.d.cts +1 -3
- package/dist/core/contexts/index.d.mts +1 -3
- package/dist/core/contexts/index.mjs +1 -3
- package/dist/core/index.cjs +2 -23
- package/dist/core/index.d.cts +2 -10
- package/dist/core/index.d.mts +2 -10
- package/dist/core/index.mjs +2 -10
- package/dist/helpers/capnp.cjs +2 -2
- package/dist/helpers/capnp.mjs +2 -2
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +10 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +10 -4
- package/dist/index.mjs +10 -2
- package/dist/render.cjs +67 -48
- package/dist/render.d.cts +33 -2
- package/dist/render.d.cts.map +1 -1
- package/dist/render.d.mts +33 -2
- package/dist/render.mjs +68 -49
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/plugin.d.cts +7 -4
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +7 -4
- package/dist/typescript/components/builtin-file.cjs +6 -6
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/builtin-file.mjs +2 -2
- package/dist/typescript/components/entry-file.cjs +2 -2
- package/dist/typescript/components/entry-file.d.cts +1 -1
- package/dist/typescript/components/entry-file.d.cts.map +1 -1
- package/dist/typescript/components/entry-file.d.mts +1 -1
- package/dist/typescript/components/entry-file.mjs +1 -1
- package/dist/typescript/components/index.cjs +1 -56
- package/dist/typescript/components/index.d.cts +1 -12
- package/dist/typescript/components/index.d.mts +1 -12
- package/dist/typescript/components/index.mjs +1 -12
- package/dist/typescript/index.cjs +1 -64
- package/dist/typescript/index.d.cts +1 -17
- package/dist/typescript/index.d.mts +1 -17
- package/dist/typescript/index.mjs +1 -17
- package/package.json +18 -639
- package/dist/core/components/output.cjs +0 -40
- package/dist/core/components/output.d.cts +0 -22
- package/dist/core/components/output.d.cts.map +0 -1
- package/dist/core/components/output.d.mts +0 -22
- package/dist/core/components/output.d.mts.map +0 -1
- package/dist/core/components/output.mjs +0 -40
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.cjs +0 -22
- package/dist/core/components/single-line-comment.d.cts +0 -19
- package/dist/core/components/single-line-comment.d.cts.map +0 -1
- package/dist/core/components/single-line-comment.d.mts +0 -19
- package/dist/core/components/single-line-comment.d.mts.map +0 -1
- package/dist/core/components/single-line-comment.mjs +0 -22
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.cjs +0 -64
- package/dist/core/components/source-file.d.cts +0 -30
- package/dist/core/components/source-file.d.cts.map +0 -1
- package/dist/core/components/source-file.d.mts +0 -30
- package/dist/core/components/source-file.d.mts.map +0 -1
- package/dist/core/components/source-file.mjs +0 -62
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.cjs +0 -19
- package/dist/core/components/spacing.d.cts +0 -19
- package/dist/core/components/spacing.d.cts.map +0 -1
- package/dist/core/components/spacing.d.mts +0 -19
- package/dist/core/components/spacing.d.mts.map +0 -1
- package/dist/core/components/spacing.mjs +0 -19
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/meta.cjs +0 -40
- package/dist/core/contexts/meta.d.cts +0 -46
- package/dist/core/contexts/meta.d.cts.map +0 -1
- package/dist/core/contexts/meta.d.mts +0 -46
- package/dist/core/contexts/meta.d.mts.map +0 -1
- package/dist/core/contexts/meta.mjs +0 -37
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/schema.cjs +0 -38
- package/dist/core/contexts/schema.d.cts +0 -26
- package/dist/core/contexts/schema.d.cts.map +0 -1
- package/dist/core/contexts/schema.d.mts +0 -26
- package/dist/core/contexts/schema.d.mts.map +0 -1
- package/dist/core/contexts/schema.mjs +0 -35
- package/dist/core/contexts/schema.mjs.map +0 -1
- package/dist/core/helpers/code.cjs +0 -33
- package/dist/core/helpers/code.d.cts +0 -28
- package/dist/core/helpers/code.d.cts.map +0 -1
- package/dist/core/helpers/code.d.mts +0 -28
- package/dist/core/helpers/code.d.mts.map +0 -1
- package/dist/core/helpers/code.mjs +0 -33
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.cjs +0 -4
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/helpers/index.mjs +0 -3
- package/dist/hcl/components/block-declaration.cjs +0 -33
- package/dist/hcl/components/block-declaration.d.cts +0 -19
- package/dist/hcl/components/block-declaration.d.cts.map +0 -1
- package/dist/hcl/components/block-declaration.d.mts +0 -19
- package/dist/hcl/components/block-declaration.d.mts.map +0 -1
- package/dist/hcl/components/block-declaration.mjs +0 -33
- package/dist/hcl/components/block-declaration.mjs.map +0 -1
- package/dist/hcl/components/hcl-file.cjs +0 -82
- package/dist/hcl/components/hcl-file.d.cts +0 -25
- package/dist/hcl/components/hcl-file.d.cts.map +0 -1
- package/dist/hcl/components/hcl-file.d.mts +0 -25
- package/dist/hcl/components/hcl-file.d.mts.map +0 -1
- package/dist/hcl/components/hcl-file.mjs +0 -81
- package/dist/hcl/components/hcl-file.mjs.map +0 -1
- package/dist/hcl/components/index.cjs +0 -11
- package/dist/hcl/components/index.d.cts +0 -5
- package/dist/hcl/components/index.d.mts +0 -5
- package/dist/hcl/components/index.mjs +0 -6
- package/dist/hcl/components/packer-file.cjs +0 -28
- package/dist/hcl/components/packer-file.d.cts +0 -16
- package/dist/hcl/components/packer-file.d.cts.map +0 -1
- package/dist/hcl/components/packer-file.d.mts +0 -16
- package/dist/hcl/components/packer-file.d.mts.map +0 -1
- package/dist/hcl/components/packer-file.mjs +0 -28
- package/dist/hcl/components/packer-file.mjs.map +0 -1
- package/dist/hcl/components/terraform-file.cjs +0 -29
- package/dist/hcl/components/terraform-file.d.cts +0 -17
- package/dist/hcl/components/terraform-file.d.cts.map +0 -1
- package/dist/hcl/components/terraform-file.d.mts +0 -17
- package/dist/hcl/components/terraform-file.d.mts.map +0 -1
- package/dist/hcl/components/terraform-file.mjs +0 -29
- package/dist/hcl/components/terraform-file.mjs.map +0 -1
- package/dist/hcl/index.cjs +0 -12
- package/dist/hcl/index.d.cts +0 -6
- package/dist/hcl/index.d.mts +0 -6
- package/dist/hcl/index.mjs +0 -7
- package/dist/markdown/components/alert.cjs +0 -74
- package/dist/markdown/components/alert.d.cts +0 -52
- package/dist/markdown/components/alert.d.cts.map +0 -1
- package/dist/markdown/components/alert.d.mts +0 -52
- package/dist/markdown/components/alert.d.mts.map +0 -1
- package/dist/markdown/components/alert.mjs +0 -69
- package/dist/markdown/components/alert.mjs.map +0 -1
- package/dist/markdown/components/front-matter.cjs +0 -30
- package/dist/markdown/components/front-matter.d.cts +0 -13
- package/dist/markdown/components/front-matter.d.cts.map +0 -1
- package/dist/markdown/components/front-matter.d.mts +0 -13
- package/dist/markdown/components/front-matter.d.mts.map +0 -1
- package/dist/markdown/components/front-matter.mjs +0 -30
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/heading.cjs +0 -23
- package/dist/markdown/components/heading.d.cts +0 -17
- package/dist/markdown/components/heading.d.cts.map +0 -1
- package/dist/markdown/components/heading.d.mts +0 -17
- package/dist/markdown/components/heading.d.mts.map +0 -1
- package/dist/markdown/components/heading.mjs +0 -23
- package/dist/markdown/components/heading.mjs.map +0 -1
- package/dist/markdown/components/index.cjs +0 -20
- package/dist/markdown/components/index.d.cts +0 -6
- package/dist/markdown/components/index.d.mts +0 -6
- package/dist/markdown/components/index.mjs +0 -7
- package/dist/markdown/components/markdown-file.cjs +0 -146
- package/dist/markdown/components/markdown-file.d.cts +0 -25
- package/dist/markdown/components/markdown-file.d.cts.map +0 -1
- package/dist/markdown/components/markdown-file.d.mts +0 -25
- package/dist/markdown/components/markdown-file.d.mts.map +0 -1
- package/dist/markdown/components/markdown-file.mjs +0 -145
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.cjs +0 -106
- package/dist/markdown/components/markdown-table.d.cts +0 -37
- package/dist/markdown/components/markdown-table.d.cts.map +0 -1
- package/dist/markdown/components/markdown-table.d.mts +0 -37
- package/dist/markdown/components/markdown-table.d.mts.map +0 -1
- package/dist/markdown/components/markdown-table.mjs +0 -104
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.cjs +0 -7
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/index.mjs +0 -3
- package/dist/markdown/contexts/markdown-table.cjs +0 -37
- package/dist/markdown/contexts/markdown-table.d.cts +0 -35
- package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
- package/dist/markdown/contexts/markdown-table.d.mts +0 -35
- package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
- package/dist/markdown/contexts/markdown-table.mjs +0 -34
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.cjs +0 -27
- package/dist/markdown/index.d.cts +0 -9
- package/dist/markdown/index.d.mts +0 -9
- package/dist/markdown/index.mjs +0 -10
- package/dist/types/components.cjs +0 -9
- package/dist/types/components.d.cts +0 -137
- package/dist/types/components.d.cts.map +0 -1
- package/dist/types/components.d.mts +0 -137
- package/dist/types/components.d.mts.map +0 -1
- package/dist/types/components.mjs +0 -10
- package/dist/types/components.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.cjs +0 -305
- package/dist/typescript/components/class-declaration.d.cts +0 -139
- package/dist/typescript/components/class-declaration.d.cts.map +0 -1
- package/dist/typescript/components/class-declaration.d.mts +0 -139
- package/dist/typescript/components/class-declaration.d.mts.map +0 -1
- package/dist/typescript/components/class-declaration.mjs +0 -300
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +0 -25
- package/dist/typescript/components/dynamic-import-statement.d.cts +0 -30
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +0 -30
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +0 -25
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.cjs +0 -257
- package/dist/typescript/components/interface-declaration.d.cts +0 -78
- package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
- package/dist/typescript/components/interface-declaration.d.mts +0 -78
- package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
- package/dist/typescript/components/interface-declaration.mjs +0 -254
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.cjs +0 -131
- package/dist/typescript/components/object-declaration.d.cts +0 -24
- package/dist/typescript/components/object-declaration.d.cts.map +0 -1
- package/dist/typescript/components/object-declaration.d.mts +0 -24
- package/dist/typescript/components/object-declaration.d.mts.map +0 -1
- package/dist/typescript/components/object-declaration.mjs +0 -130
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.cjs +0 -31
- package/dist/typescript/components/property-name.d.cts +0 -21
- package/dist/typescript/components/property-name.d.cts.map +0 -1
- package/dist/typescript/components/property-name.d.mts +0 -21
- package/dist/typescript/components/property-name.d.mts.map +0 -1
- package/dist/typescript/components/property-name.mjs +0 -31
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.cjs +0 -12
- package/dist/typescript/components/record-expression.d.cts +0 -9
- package/dist/typescript/components/record-expression.d.cts.map +0 -1
- package/dist/typescript/components/record-expression.d.mts +0 -9
- package/dist/typescript/components/record-expression.d.mts.map +0 -1
- package/dist/typescript/components/record-expression.mjs +0 -12
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-schema.cjs +0 -166
- package/dist/typescript/components/tsdoc-schema.d.cts +0 -21
- package/dist/typescript/components/tsdoc-schema.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-schema.d.mts +0 -21
- package/dist/typescript/components/tsdoc-schema.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-schema.mjs +0 -165
- package/dist/typescript/components/tsdoc-schema.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.cjs +0 -486
- package/dist/typescript/components/tsdoc.d.cts +0 -163
- package/dist/typescript/components/tsdoc.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc.d.mts +0 -163
- package/dist/typescript/components/tsdoc.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc.mjs +0 -465
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.cjs +0 -38
- package/dist/typescript/components/type-declaration.d.cts +0 -15
- package/dist/typescript/components/type-declaration.d.cts.map +0 -1
- package/dist/typescript/components/type-declaration.d.mts +0 -15
- package/dist/typescript/components/type-declaration.d.mts.map +0 -1
- package/dist/typescript/components/type-declaration.mjs +0 -38
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.cjs +0 -82
- package/dist/typescript/components/type-parameters.d.cts +0 -22
- package/dist/typescript/components/type-parameters.d.cts.map +0 -1
- package/dist/typescript/components/type-parameters.d.mts +0 -22
- package/dist/typescript/components/type-parameters.d.mts.map +0 -1
- package/dist/typescript/components/type-parameters.mjs +0 -82
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.cjs +0 -231
- package/dist/typescript/components/typescript-file.d.cts +0 -46
- package/dist/typescript/components/typescript-file.d.cts.map +0 -1
- package/dist/typescript/components/typescript-file.d.mts +0 -46
- package/dist/typescript/components/typescript-file.d.mts.map +0 -1
- package/dist/typescript/components/typescript-file.mjs +0 -229
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.cjs +0 -4
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/index.mjs +0 -3
- package/dist/typescript/contexts/lexical-scope.cjs +0 -25
- package/dist/typescript/contexts/lexical-scope.d.cts +0 -12
- package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +0 -12
- package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.mjs +0 -25
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.cjs +0 -23
- package/dist/typescript/contexts/member-scope.d.cts +0 -18
- package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/member-scope.d.mts +0 -18
- package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/member-scope.mjs +0 -23
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +0 -25
- package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -13
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -13
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs +0 -25
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.cjs +0 -6
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/index.mjs +0 -4
- package/dist/typescript/helpers/utilities.cjs +0 -15
- package/dist/typescript/helpers/utilities.d.cts +0 -11
- package/dist/typescript/helpers/utilities.d.cts.map +0 -1
- package/dist/typescript/helpers/utilities.d.mts +0 -11
- package/dist/typescript/helpers/utilities.d.mts.map +0 -1
- package/dist/typescript/helpers/utilities.mjs +0 -14
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/yaml/components/index.cjs +0 -5
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/index.mjs +0 -3
- package/dist/yaml/components/yaml-file.cjs +0 -148
- package/dist/yaml/components/yaml-file.d.cts +0 -31
- package/dist/yaml/components/yaml-file.d.cts.map +0 -1
- package/dist/yaml/components/yaml-file.d.mts +0 -31
- package/dist/yaml/components/yaml-file.d.mts.map +0 -1
- package/dist/yaml/components/yaml-file.mjs +0 -147
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.cjs +0 -6
- package/dist/yaml/index.d.cts +0 -3
- package/dist/yaml/index.d.mts +0 -3
- package/dist/yaml/index.mjs +0 -4
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { TSDoc } from "./tsdoc.mjs";
|
|
2
|
-
import { TypeParameters } from "./type-parameters.mjs";
|
|
3
|
-
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
|
-
import { Name, Show } from "@alloy-js/core";
|
|
5
|
-
import { Declaration as Declaration$1, ensureTypeRefContext } from "@alloy-js/typescript";
|
|
6
|
-
|
|
7
|
-
//#region src/typescript/components/type-declaration.tsx
|
|
8
|
-
/**
|
|
9
|
-
* Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.
|
|
10
|
-
*/
|
|
11
|
-
const TypeDeclaration = ensureTypeRefContext(function TypeDeclaration(props) {
|
|
12
|
-
const { children, doc, typeParameters, ...rest } = props;
|
|
13
|
-
return [createComponent(Show, {
|
|
14
|
-
get when() {
|
|
15
|
-
return Boolean(doc);
|
|
16
|
-
},
|
|
17
|
-
get children() {
|
|
18
|
-
return createComponent(TSDoc, { heading: doc });
|
|
19
|
-
}
|
|
20
|
-
}), createComponent(Declaration$1, mergeProps(rest, {
|
|
21
|
-
kind: "type",
|
|
22
|
-
nameKind: "type",
|
|
23
|
-
get children() {
|
|
24
|
-
return [
|
|
25
|
-
"type ",
|
|
26
|
-
createComponent(Name, {}),
|
|
27
|
-
memo(() => typeParameters && createComponent(TypeParameters, { parameters: typeParameters })),
|
|
28
|
-
" = ",
|
|
29
|
-
children,
|
|
30
|
-
";"
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
}))];
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { TypeDeclaration };
|
|
38
|
-
//# sourceMappingURL=type-declaration.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-declaration.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
-
|
|
6
|
-
//#region src/typescript/components/type-parameters.tsx
|
|
7
|
-
/** Props for type parameters */
|
|
8
|
-
function typeParameter(param) {
|
|
9
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
10
|
-
when: typeof param === "object",
|
|
11
|
-
get fallback() {
|
|
12
|
-
return [param];
|
|
13
|
-
},
|
|
14
|
-
get children() {
|
|
15
|
-
return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("group", { get children() {
|
|
16
|
-
return [
|
|
17
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => param.name),
|
|
18
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
19
|
-
get when() {
|
|
20
|
-
return !!param.extends;
|
|
21
|
-
},
|
|
22
|
-
get children() {
|
|
23
|
-
return [
|
|
24
|
-
" ",
|
|
25
|
-
"extends",
|
|
26
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("indent", { get children() {
|
|
27
|
-
return [" ", (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
|
|
28
|
-
return param.extends;
|
|
29
|
-
} })];
|
|
30
|
-
} })
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
}),
|
|
34
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
35
|
-
get when() {
|
|
36
|
-
return !!param.default;
|
|
37
|
-
},
|
|
38
|
-
get children() {
|
|
39
|
-
return [" = ", (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
|
|
40
|
-
return param.default;
|
|
41
|
-
} })];
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
];
|
|
45
|
-
} }), " "];
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Represent type parameters
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* <A, B extends string>
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
function TypeParameters(props) {
|
|
58
|
-
if (props.children) return props.children;
|
|
59
|
-
if (!props.parameters) return;
|
|
60
|
-
return [
|
|
61
|
-
"<",
|
|
62
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("group", { get children() {
|
|
63
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Indent, {
|
|
64
|
-
softline: true,
|
|
65
|
-
get children() {
|
|
66
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
67
|
-
get each() {
|
|
68
|
-
return props.parameters;
|
|
69
|
-
},
|
|
70
|
-
comma: true,
|
|
71
|
-
line: true,
|
|
72
|
-
children: (param) => typeParameter(param)
|
|
73
|
-
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("ifBreak", { children: "," })];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
} }),
|
|
77
|
-
">"
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
//#endregion
|
|
82
|
-
exports.TypeParameters = TypeParameters;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
import { TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
-
//#region src/typescript/components/type-parameters.d.ts
|
|
4
|
-
/** Props for type parameters */
|
|
5
|
-
interface TypeParametersProps {
|
|
6
|
-
/** Parameters */
|
|
7
|
-
parameters?: TypeParameterDescriptor[] | string[];
|
|
8
|
-
/** Jsx Children */
|
|
9
|
-
children?: Children;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Represent type parameters
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* <A, B extends string>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function TypeParameters(props: TypeParametersProps): Children;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { TypeParameters, TypeParametersProps };
|
|
22
|
-
//# sourceMappingURL=type-parameters.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-parameters.d.cts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"mappings":";;;;UAsBiB;;EAEf,aAAa;;EAEb,WAAW;;;;;;;;;;iBAqCG,eAAe,OAAO,sBAAmB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
import { TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
|
-
//#region src/typescript/components/type-parameters.d.ts
|
|
4
|
-
/** Props for type parameters */
|
|
5
|
-
interface TypeParametersProps {
|
|
6
|
-
/** Parameters */
|
|
7
|
-
parameters?: TypeParameterDescriptor[] | string[];
|
|
8
|
-
/** Jsx Children */
|
|
9
|
-
children?: Children;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Represent type parameters
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* <A, B extends string>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function TypeParameters(props: TypeParametersProps): Children;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { TypeParameters, TypeParametersProps };
|
|
22
|
-
//# sourceMappingURL=type-parameters.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-parameters.d.mts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"mappings":""}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { For, Indent, Show } from "@alloy-js/core";
|
|
3
|
-
import { TypeRefContext } from "@alloy-js/typescript";
|
|
4
|
-
|
|
5
|
-
//#region src/typescript/components/type-parameters.tsx
|
|
6
|
-
/** Props for type parameters */
|
|
7
|
-
function typeParameter(param) {
|
|
8
|
-
return createComponent(Show, {
|
|
9
|
-
when: typeof param === "object",
|
|
10
|
-
get fallback() {
|
|
11
|
-
return [param];
|
|
12
|
-
},
|
|
13
|
-
get children() {
|
|
14
|
-
return [createIntrinsic("group", { get children() {
|
|
15
|
-
return [
|
|
16
|
-
memo(() => param.name),
|
|
17
|
-
createComponent(Show, {
|
|
18
|
-
get when() {
|
|
19
|
-
return !!param.extends;
|
|
20
|
-
},
|
|
21
|
-
get children() {
|
|
22
|
-
return [
|
|
23
|
-
" ",
|
|
24
|
-
"extends",
|
|
25
|
-
createIntrinsic("indent", { get children() {
|
|
26
|
-
return [" ", createComponent(TypeRefContext, { get children() {
|
|
27
|
-
return param.extends;
|
|
28
|
-
} })];
|
|
29
|
-
} })
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
}),
|
|
33
|
-
createComponent(Show, {
|
|
34
|
-
get when() {
|
|
35
|
-
return !!param.default;
|
|
36
|
-
},
|
|
37
|
-
get children() {
|
|
38
|
-
return [" = ", createComponent(TypeRefContext, { get children() {
|
|
39
|
-
return param.default;
|
|
40
|
-
} })];
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
];
|
|
44
|
-
} }), " "];
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Represent type parameters
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* <A, B extends string>
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
function TypeParameters(props) {
|
|
57
|
-
if (props.children) return props.children;
|
|
58
|
-
if (!props.parameters) return;
|
|
59
|
-
return [
|
|
60
|
-
"<",
|
|
61
|
-
createIntrinsic("group", { get children() {
|
|
62
|
-
return createComponent(Indent, {
|
|
63
|
-
softline: true,
|
|
64
|
-
get children() {
|
|
65
|
-
return [createComponent(For, {
|
|
66
|
-
get each() {
|
|
67
|
-
return props.parameters;
|
|
68
|
-
},
|
|
69
|
-
comma: true,
|
|
70
|
-
line: true,
|
|
71
|
-
children: (param) => typeParameter(param)
|
|
72
|
-
}), createIntrinsic("ifBreak", { children: "," })];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
} }),
|
|
76
|
-
">"
|
|
77
|
-
];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
export { TypeParameters };
|
|
82
|
-
//# sourceMappingURL=type-parameters.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-parameters.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
3
|
-
const require_core_components_source_file = require('../../core/components/source-file.cjs');
|
|
4
|
-
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
5
|
-
const require_core_helpers_code = require('../../core/helpers/code.cjs');
|
|
6
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
8
|
-
let _stryke_path_append = require("@stryke/path/append");
|
|
9
|
-
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
|
-
let powerlines_utils = require("powerlines/utils");
|
|
11
|
-
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
12
|
-
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
13
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
14
|
-
let _stryke_type_checks_is_boolean = require("@stryke/type-checks/is-boolean");
|
|
15
|
-
|
|
16
|
-
//#region src/typescript/components/typescript-file.tsx
|
|
17
|
-
/**
|
|
18
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
19
|
-
*
|
|
20
|
-
* @param props - The properties for the source file.
|
|
21
|
-
* @returns The rendered source file component.
|
|
22
|
-
*/
|
|
23
|
-
function TypescriptFile(props) {
|
|
24
|
-
const [{ children, path, imports, builtinImports, tsx, header, hashbang }, rest] = (0, _alloy_js_core.splitProps)(props, [
|
|
25
|
-
"children",
|
|
26
|
-
"path",
|
|
27
|
-
"imports",
|
|
28
|
-
"builtinImports",
|
|
29
|
-
"tsx",
|
|
30
|
-
"header",
|
|
31
|
-
"hashbang"
|
|
32
|
-
]);
|
|
33
|
-
const directoryContext = (0, _alloy_js_core.useContext)(_alloy_js_core.SourceDirectoryContext);
|
|
34
|
-
const sdData = (0, _alloy_js_typescript.getSourceDirectoryData)(directoryContext);
|
|
35
|
-
const modulePath = (0, _stryke_path_append.appendPath)(path, directoryContext.path);
|
|
36
|
-
const scope = new _alloy_js_typescript.TSModuleScope(modulePath, (0, _alloy_js_core.useScope)());
|
|
37
|
-
sdData.modules.add(scope);
|
|
38
|
-
const pkg = (0, _alloy_js_core.useContext)(_alloy_js_typescript.PackageContext);
|
|
39
|
-
if (pkg) pkg.scope.addModule(scope);
|
|
40
|
-
if (props.export) {
|
|
41
|
-
if (pkg) if ((0, _stryke_type_checks_is_boolean.isBoolean)(props.export)) pkg.scope.addExport(modulePath, scope);
|
|
42
|
-
else pkg.scope.addExport(props.export, scope);
|
|
43
|
-
}
|
|
44
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.SourceFileContext.Provider, {
|
|
45
|
-
value: { scope },
|
|
46
|
-
get children() {
|
|
47
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Scope, {
|
|
48
|
-
value: scope,
|
|
49
|
-
get children() {
|
|
50
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
51
|
-
path: modulePath,
|
|
52
|
-
get header() {
|
|
53
|
-
return header ?? (0, _alloy_js_core_jsx_runtime.createComponent)(TypescriptFileHeader, {
|
|
54
|
-
hashbang,
|
|
55
|
-
get children() {
|
|
56
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(TypescriptFileHeaderImports, {
|
|
57
|
-
imports,
|
|
58
|
-
builtinImports,
|
|
59
|
-
scope
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
filetype: tsx ? "tsx" : "typescript",
|
|
65
|
-
children
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
74
|
-
*
|
|
75
|
-
* @param props - The properties for the source file header.
|
|
76
|
-
* @returns The rendered source file header.
|
|
77
|
-
*/
|
|
78
|
-
function TypescriptFileHeader(props) {
|
|
79
|
-
const { header, hashbang, disableEslint = true, disableBiome = true, disableOxlint = true, children } = props;
|
|
80
|
-
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
81
|
-
return [
|
|
82
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
83
|
-
get when() {
|
|
84
|
-
return Boolean(hashbang);
|
|
85
|
-
},
|
|
86
|
-
get children() {
|
|
87
|
-
return [(0, _alloy_js_core_jsx_runtime.memo)(() => hashbang === true ? require_core_helpers_code.code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
91
|
-
get when() {
|
|
92
|
-
return Boolean(header);
|
|
93
|
-
},
|
|
94
|
-
get children() {
|
|
95
|
-
return [header, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
96
|
-
}
|
|
97
|
-
}),
|
|
98
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
99
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
100
|
-
get when() {
|
|
101
|
-
return Boolean(disableEslint);
|
|
102
|
-
},
|
|
103
|
-
get children() {
|
|
104
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
105
|
-
variant: "slash-star",
|
|
106
|
-
children: "eslint-disable"
|
|
107
|
-
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
108
|
-
}
|
|
109
|
-
}),
|
|
110
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
111
|
-
get when() {
|
|
112
|
-
return Boolean(disableOxlint);
|
|
113
|
-
},
|
|
114
|
-
get children() {
|
|
115
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
116
|
-
variant: "slash-star",
|
|
117
|
-
children: "oxlint-disable"
|
|
118
|
-
}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
119
|
-
}
|
|
120
|
-
}),
|
|
121
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
122
|
-
get when() {
|
|
123
|
-
return Boolean(disableBiome);
|
|
124
|
-
},
|
|
125
|
-
get children() {
|
|
126
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { children: "biome-ignore lint: disable" }), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
127
|
-
}
|
|
128
|
-
}),
|
|
129
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
130
|
-
get when() {
|
|
131
|
-
return Boolean(disableEslint) || Boolean(disableBiome) || Boolean(disableOxlint);
|
|
132
|
-
},
|
|
133
|
-
get children() {
|
|
134
|
-
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
|
|
135
|
-
}
|
|
136
|
-
}),
|
|
137
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
138
|
-
get when() {
|
|
139
|
-
return Boolean(children);
|
|
140
|
-
},
|
|
141
|
-
get children() {
|
|
142
|
-
return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
143
|
-
}
|
|
144
|
-
}),
|
|
145
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
|
|
146
|
-
return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework?.name) || "Powerlines"}`;
|
|
147
|
-
} }),
|
|
148
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
149
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
|
|
150
|
-
return (0, powerlines_utils.getFileHeaderWarning)(context);
|
|
151
|
-
} }),
|
|
152
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
153
|
-
];
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
157
|
-
*
|
|
158
|
-
* @param props - The properties for the source file header.
|
|
159
|
-
* @returns The rendered source file header.
|
|
160
|
-
*/
|
|
161
|
-
function TypescriptFileHeaderImports(props) {
|
|
162
|
-
const { imports: importProps, builtinImports: builtinImportsProps } = props;
|
|
163
|
-
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
164
|
-
const sourceFile = (0, _alloy_js_typescript.useSourceFile)();
|
|
165
|
-
const scope = props.scope ?? sourceFile.scope;
|
|
166
|
-
const imports = (0, _alloy_js_core.computed)(() => {
|
|
167
|
-
return Object.fromEntries(Object.entries(importProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? (0, _stryke_helpers_get_unique.getUniqueBy)(importItem, (i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : i.alias || i.name) : importItem]));
|
|
168
|
-
});
|
|
169
|
-
const builtinImports = (0, _alloy_js_core.computed)(() => {
|
|
170
|
-
return Object.fromEntries(Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? (0, _stryke_helpers_get_unique.getUniqueBy)(importItem, (i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : i.alias || i.name) : importItem]));
|
|
171
|
-
});
|
|
172
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
173
|
-
get when() {
|
|
174
|
-
return scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0;
|
|
175
|
-
},
|
|
176
|
-
get children() {
|
|
177
|
-
return [
|
|
178
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
179
|
-
get when() {
|
|
180
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!!!imports.value)() && Object.keys(imports.value).length > 0;
|
|
181
|
-
},
|
|
182
|
-
get children() {
|
|
183
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
184
|
-
get each() {
|
|
185
|
-
return Object.entries(imports.value ?? {});
|
|
186
|
-
},
|
|
187
|
-
hardline: true,
|
|
188
|
-
get ender() {
|
|
189
|
-
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
|
|
190
|
-
},
|
|
191
|
-
children: ([module, importItem]) => require_core_helpers_code.code`import ${importItem === null ? "" : (0, _stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).map((i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module}";`
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
}),
|
|
195
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
196
|
-
get when() {
|
|
197
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!builtinImports.value)() && Object.keys(builtinImports.value).length > 0;
|
|
198
|
-
},
|
|
199
|
-
get children() {
|
|
200
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
201
|
-
get each() {
|
|
202
|
-
return Object.entries(builtinImports.value ?? {});
|
|
203
|
-
},
|
|
204
|
-
hardline: true,
|
|
205
|
-
get ender() {
|
|
206
|
-
return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
|
|
207
|
-
},
|
|
208
|
-
children: ([module, importItem]) => require_core_helpers_code.code`import ${importItem === null ? "" : (0, _stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).map((i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework?.name || "powerlines"}:${module}`}";`
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}),
|
|
212
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
213
|
-
get when() {
|
|
214
|
-
return scope.importedModules.size > 0;
|
|
215
|
-
},
|
|
216
|
-
get children() {
|
|
217
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ImportStatements, { get records() {
|
|
218
|
-
return scope.importedModules;
|
|
219
|
-
} });
|
|
220
|
-
}
|
|
221
|
-
}),
|
|
222
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
223
|
-
];
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
//#endregion
|
|
229
|
-
exports.TypescriptFile = TypescriptFile;
|
|
230
|
-
exports.TypescriptFileHeader = TypescriptFileHeader;
|
|
231
|
-
exports.TypescriptFileHeaderImports = TypescriptFileHeaderImports;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, SourceFileHeaderProps, TypescriptFileImports } from "../../types/components.cjs";
|
|
2
|
-
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
|
|
3
|
-
import { Children } from "@alloy-js/core";
|
|
4
|
-
import { TSModuleScope } from "@alloy-js/typescript";
|
|
5
|
-
//#region src/typescript/components/typescript-file.d.ts
|
|
6
|
-
type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
|
|
7
|
-
hashbang?: Children | true;
|
|
8
|
-
header?: Children;
|
|
9
|
-
imports?: TypescriptFileImports;
|
|
10
|
-
builtinImports?: TypescriptFileImports;
|
|
11
|
-
export?: boolean | string;
|
|
12
|
-
tsx?: boolean;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
16
|
-
*
|
|
17
|
-
* @param props - The properties for the source file.
|
|
18
|
-
* @returns The rendered source file component.
|
|
19
|
-
*/
|
|
20
|
-
declare function TypescriptFile(props: TypescriptFileProps): Children;
|
|
21
|
-
interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
22
|
-
header?: Children;
|
|
23
|
-
hashbang?: Children | true;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
27
|
-
*
|
|
28
|
-
* @param props - The properties for the source file header.
|
|
29
|
-
* @returns The rendered source file header.
|
|
30
|
-
*/
|
|
31
|
-
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
32
|
-
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
33
|
-
imports?: TypescriptFileImports;
|
|
34
|
-
builtinImports?: TypescriptFileImports;
|
|
35
|
-
scope?: TSModuleScope;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
39
|
-
*
|
|
40
|
-
* @param props - The properties for the source file header.
|
|
41
|
-
* @returns The rendered source file header.
|
|
42
|
-
*/
|
|
43
|
-
declare function TypescriptFileHeaderImports(props: TypescriptFileHeaderImportsProps): Children;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps };
|
|
46
|
-
//# sourceMappingURL=typescript-file.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-file.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":";;;;;KAsDY,sBAAsB,KAAK,iCACrC;EACE,WAAW;EACX,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB;EACA;;;;;;;;iBASY,eAAe,OAAO,sBAAmB;UAgExC,kCAAkC;EACjD,SAAS;EACT,WAAW;;;;;;;;iBASG,qBAAqB,OAAO,4BAAyB;UAmEpD,yCAAyC;EACxD,UAAU;EACV,iBAAiB;EACjB,QAAQ;;;;;;;;iBASM,4BACd,OAAO,mCAAgC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, SourceFileHeaderProps, TypescriptFileImports } from "../../types/components.mjs";
|
|
2
|
-
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
|
|
3
|
-
import { Children } from "@alloy-js/core";
|
|
4
|
-
import { TSModuleScope } from "@alloy-js/typescript";
|
|
5
|
-
//#region src/typescript/components/typescript-file.d.ts
|
|
6
|
-
type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
|
|
7
|
-
hashbang?: Children | true;
|
|
8
|
-
header?: Children;
|
|
9
|
-
imports?: TypescriptFileImports;
|
|
10
|
-
builtinImports?: TypescriptFileImports;
|
|
11
|
-
export?: boolean | string;
|
|
12
|
-
tsx?: boolean;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* A base component representing a Powerlines generated Typescript source file.
|
|
16
|
-
*
|
|
17
|
-
* @param props - The properties for the source file.
|
|
18
|
-
* @returns The rendered source file component.
|
|
19
|
-
*/
|
|
20
|
-
declare function TypescriptFile(props: TypescriptFileProps): Children;
|
|
21
|
-
interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
22
|
-
header?: Children;
|
|
23
|
-
hashbang?: Children | true;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
27
|
-
*
|
|
28
|
-
* @param props - The properties for the source file header.
|
|
29
|
-
* @returns The rendered source file header.
|
|
30
|
-
*/
|
|
31
|
-
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
32
|
-
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
33
|
-
imports?: TypescriptFileImports;
|
|
34
|
-
builtinImports?: TypescriptFileImports;
|
|
35
|
-
scope?: TSModuleScope;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Renders the header for a Powerlines Typescript source file.
|
|
39
|
-
*
|
|
40
|
-
* @param props - The properties for the source file header.
|
|
41
|
-
* @returns The rendered source file header.
|
|
42
|
-
*/
|
|
43
|
-
declare function TypescriptFileHeaderImports(props: TypescriptFileHeaderImportsProps): Children;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps };
|
|
46
|
-
//# sourceMappingURL=typescript-file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":""}
|