@powerlines/plugin-alloy 0.25.29 → 0.25.31
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/output.cjs +12 -7
- package/dist/core/components/output.mjs +12 -7
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +5 -8
- package/dist/core/components/single-line-comment.mjs +5 -8
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +8 -7
- package/dist/core/components/source-file.mjs +8 -7
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +5 -6
- package/dist/core/components/spacing.mjs +5 -6
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +12 -9
- package/dist/markdown/components/front-matter.mjs +12 -9
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +57 -41
- package/dist/markdown/components/markdown-file.mjs +57 -41
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +31 -20
- package/dist/markdown/components/markdown-table.mjs +31 -20
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +10 -4
- package/dist/render.mjs +10 -4
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +21 -9
- package/dist/typescript/components/builtin-file.mjs +21 -9
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +112 -79
- package/dist/typescript/components/class-declaration.mjs +112 -79
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +6 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +6 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +7 -3
- package/dist/typescript/components/entry-file.mjs +7 -3
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/infrastructure-file.cjs +7 -3
- package/dist/typescript/components/infrastructure-file.mjs +7 -3
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +83 -47
- package/dist/typescript/components/interface-declaration.mjs +83 -47
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +48 -36
- package/dist/typescript/components/object-declaration.mjs +48 -36
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +2 -2
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +112 -54
- package/dist/typescript/components/tsdoc-reflection.mjs +112 -54
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +211 -140
- package/dist/typescript/components/tsdoc.mjs +211 -140
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +17 -9
- package/dist/typescript/components/type-declaration.mjs +17 -9
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +33 -33
- package/dist/typescript/components/type-parameters.mjs +33 -33
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +90 -65
- package/dist/typescript/components/typescript-file.mjs +90 -65
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +5 -1
- package/dist/typescript/contexts/lexical-scope.mjs +5 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +5 -2
- package/dist/typescript/contexts/member-scope.mjs +5 -2
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +58 -48
- package/dist/yaml/components/yaml-file.mjs +58 -48
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-declaration.mjs","names":["Declaration"],"sources":["../../../src/typescript/components/type-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Name, Show } from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TypeParameterDescriptor\n} from \"@alloy-js/typescript\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface TypeDeclarationProps extends CommonDeclarationProps {\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.\n */\nexport const TypeDeclaration = ensureTypeRefContext(function TypeDeclaration(\n props: TypeDeclarationProps\n) {\n const { children, doc, typeParameters, ...rest } = props;\n\n return (\n <>\n <Show when={Boolean(doc)}>\n <TSDoc heading={doc} />\n </Show>\n <Declaration {...rest} kind=\"type\" nameKind=\"type\">\n type <Name />\n {typeParameters && (\n <TypeParameters parameters={typeParameters} />\n )} = {children};\n </Declaration>\n </>\n );\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-declaration.mjs","names":["Declaration"],"sources":["../../../src/typescript/components/type-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Name, Show } from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TypeParameterDescriptor\n} from \"@alloy-js/typescript\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface TypeDeclarationProps extends CommonDeclarationProps {\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.\n */\nexport const TypeDeclaration = ensureTypeRefContext(function TypeDeclaration(\n props: TypeDeclarationProps\n) {\n const { children, doc, typeParameters, ...rest } = props;\n\n return (\n <>\n <Show when={Boolean(doc)}>\n <TSDoc heading={doc} />\n </Show>\n <Declaration {...rest} kind=\"type\" nameKind=\"type\">\n type <Name />\n {typeParameters && (\n <TypeParameters parameters={typeParameters} />\n )} = {children};\n </Declaration>\n </>\n );\n});\n"],"mappings":";;;;;;;;;;AAsCA,MAAa,kBAAkB,qBAAqB,SAAS,gBAC3D,OACA;CACA,MAAM,EAAE,UAAU,KAAK,gBAAgB,GAAG,SAAS;AAEnD,QACE,4CACE,oBAAC,MAAD;EAAM,MAAM,QAAQ,IAAI;YACtB,oBAAC,OAAD,EAAO,SAAS,KAAO;EAClB,GACP,qBAACA,eAAD;EAAa,GAAI;EAAM,MAAK;EAAO,UAAS;YAA5C;GAAmD;GAC5C,oBAAC,MAAD,EAAQ;GACZ,kBACC,oBAAC,gBAAD,EAAgB,YAAY,gBAAkB;GAC9C;GAAI;GAAS;GACH;IACb;EAEL"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
5
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
6
|
|
|
6
7
|
//#region src/typescript/components/type-parameters.tsx
|
|
7
8
|
function typeParameter(param) {
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</group>{" "}
|
|
28
|
-
</_alloy_js_core.Show>;
|
|
9
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
10
|
+
when: typeof param === "object",
|
|
11
|
+
fallback: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: param }),
|
|
12
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)("group", { children: [
|
|
13
|
+
param.name,
|
|
14
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
15
|
+
when: !!param.extends,
|
|
16
|
+
children: [
|
|
17
|
+
" ",
|
|
18
|
+
"extends",
|
|
19
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)("indent", { children: [" ", /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeRefContext, { children: param.extends })] })
|
|
20
|
+
]
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
23
|
+
when: !!param.default,
|
|
24
|
+
children: [" = ", /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeRefContext, { children: param.default })]
|
|
25
|
+
})
|
|
26
|
+
] }), " "]
|
|
27
|
+
});
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Represent type parameters
|
|
@@ -38,18 +37,19 @@ function typeParameter(param) {
|
|
|
38
37
|
function TypeParameters(props) {
|
|
39
38
|
if (props.children) return props.children;
|
|
40
39
|
if (!props.parameters) return;
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
41
|
+
"<",
|
|
42
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("group", { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Indent, {
|
|
43
|
+
softline: true,
|
|
44
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
45
|
+
each: props.parameters,
|
|
46
|
+
comma: true,
|
|
47
|
+
line: true,
|
|
48
|
+
children: (param) => typeParameter(param)
|
|
49
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("ifBreak", { children: "," })]
|
|
50
|
+
}) }),
|
|
51
|
+
">"
|
|
52
|
+
] });
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
//#endregion
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { For, Indent, Show } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { TypeRefContext } from "@alloy-js/typescript";
|
|
3
4
|
|
|
4
5
|
//#region src/typescript/components/type-parameters.tsx
|
|
5
6
|
function typeParameter(param) {
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</group>{" "}
|
|
26
|
-
</Show>;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Show, {
|
|
8
|
+
when: typeof param === "object",
|
|
9
|
+
fallback: /* @__PURE__ */ jsx(Fragment, { children: param }),
|
|
10
|
+
children: [/* @__PURE__ */ jsxs("group", { children: [
|
|
11
|
+
param.name,
|
|
12
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
13
|
+
when: !!param.extends,
|
|
14
|
+
children: [
|
|
15
|
+
" ",
|
|
16
|
+
"extends",
|
|
17
|
+
/* @__PURE__ */ jsxs("indent", { children: [" ", /* @__PURE__ */ jsx(TypeRefContext, { children: param.extends })] })
|
|
18
|
+
]
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
21
|
+
when: !!param.default,
|
|
22
|
+
children: [" = ", /* @__PURE__ */ jsx(TypeRefContext, { children: param.default })]
|
|
23
|
+
})
|
|
24
|
+
] }), " "]
|
|
25
|
+
});
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
28
|
* Represent type parameters
|
|
@@ -36,18 +35,19 @@ function typeParameter(param) {
|
|
|
36
35
|
function TypeParameters(props) {
|
|
37
36
|
if (props.children) return props.children;
|
|
38
37
|
if (!props.parameters) return;
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
"<",
|
|
40
|
+
/* @__PURE__ */ jsx("group", { children: /* @__PURE__ */ jsxs(Indent, {
|
|
41
|
+
softline: true,
|
|
42
|
+
children: [/* @__PURE__ */ jsx(For, {
|
|
43
|
+
each: props.parameters,
|
|
44
|
+
comma: true,
|
|
45
|
+
line: true,
|
|
46
|
+
children: (param) => typeParameter(param)
|
|
47
|
+
}), /* @__PURE__ */ jsx("ifBreak", { children: "," })]
|
|
48
|
+
}) }),
|
|
49
|
+
">"
|
|
50
|
+
] });
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-parameters.mjs","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, For, Indent, Show } from \"@alloy-js/core\";\nimport { TypeParameterDescriptor, TypeRefContext } from \"@alloy-js/typescript\";\n\n/** Props for type parameters */\nexport interface TypeParametersProps {\n /** Parameters */\n parameters?: TypeParameterDescriptor[] | string[];\n /** Jsx Children */\n children?: Children;\n}\n\nfunction typeParameter(param: TypeParameterDescriptor | string) {\n return (\n <Show when={typeof param === \"object\"} fallback={<>{param}</>}>\n <group>\n {(param as TypeParameterDescriptor).name}\n <Show when={!!(param as TypeParameterDescriptor).extends}>\n {\" \"}\n extends\n <indent>\n {\" \"}\n <TypeRefContext>\n {(param as TypeParameterDescriptor).extends}\n </TypeRefContext>\n </indent>\n </Show>\n <Show when={!!(param as TypeParameterDescriptor).default}>\n {\" = \"}\n <TypeRefContext>\n {(param as TypeParameterDescriptor).default}\n </TypeRefContext>\n </Show>\n </group>{\" \"}\n </Show>\n );\n}\n\n/**\n * Represent type parameters\n *\n * @example\n * ```ts\n * <A, B extends string>\n * ```\n */\nexport function TypeParameters(props: TypeParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n if (!props.parameters) {\n return undefined;\n }\n\n return (\n <>\n {\"<\"}\n <group>\n <Indent softline>\n <For each={props.parameters} comma line>\n {param => typeParameter(param)}\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n {\">\"}\n </>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-parameters.mjs","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, For, Indent, Show } from \"@alloy-js/core\";\nimport { TypeParameterDescriptor, TypeRefContext } from \"@alloy-js/typescript\";\n\n/** Props for type parameters */\nexport interface TypeParametersProps {\n /** Parameters */\n parameters?: TypeParameterDescriptor[] | string[];\n /** Jsx Children */\n children?: Children;\n}\n\nfunction typeParameter(param: TypeParameterDescriptor | string) {\n return (\n <Show when={typeof param === \"object\"} fallback={<>{param}</>}>\n <group>\n {(param as TypeParameterDescriptor).name}\n <Show when={!!(param as TypeParameterDescriptor).extends}>\n {\" \"}\n extends\n <indent>\n {\" \"}\n <TypeRefContext>\n {(param as TypeParameterDescriptor).extends}\n </TypeRefContext>\n </indent>\n </Show>\n <Show when={!!(param as TypeParameterDescriptor).default}>\n {\" = \"}\n <TypeRefContext>\n {(param as TypeParameterDescriptor).default}\n </TypeRefContext>\n </Show>\n </group>{\" \"}\n </Show>\n );\n}\n\n/**\n * Represent type parameters\n *\n * @example\n * ```ts\n * <A, B extends string>\n * ```\n */\nexport function TypeParameters(props: TypeParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n if (!props.parameters) {\n return undefined;\n }\n\n return (\n <>\n {\"<\"}\n <group>\n <Indent softline>\n <For each={props.parameters} comma line>\n {param => typeParameter(param)}\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n {\">\"}\n </>\n );\n}\n"],"mappings":";;;;;AA6BA,SAAS,cAAc,OAAyC;AAC9D,QACE,qBAAC,MAAD;EAAM,MAAM,OAAO,UAAU;EAAU,UAAU,0CAAG,OAAS;YAA7D,CACE,qBAAC,SAAD;GACI,MAAkC;GACpC,qBAAC,MAAD;IAAM,MAAM,CAAC,CAAE,MAAkC;cAAjD;KACG;KAAI;KAEL,qBAAC,UAAD,aACG,KACD,oBAAC,gBAAD,YACI,MAAkC,SACrB,EACV;KACJ;;GACP,qBAAC,MAAD;IAAM,MAAM,CAAC,CAAE,MAAkC;cAAjD,CACG,OACD,oBAAC,gBAAD,YACI,MAAkC,SACrB,EACZ;;GACD,KAAC,IACJ;;;;;;;;;;;AAYX,SAAgB,eAAe,OAA4B;AACzD,KAAI,MAAM,SACR,QAAO,MAAM;AAGf,KAAI,CAAC,MAAM,WACT;AAGF,QACE;EACG;EACD,oBAAC,SAAD,YACE,qBAAC,QAAD;GAAQ;aAAR,CACE,oBAAC,KAAD;IAAK,MAAM,MAAM;IAAY;IAAM;eAChC,UAAS,cAAc,MAAM;IAC1B,GACN,oBAAC,WAAD,YAAS,KAAW,EACb;MACH;EACP;EACA"}
|
|
@@ -4,6 +4,7 @@ const require_core_contexts_context = require('../../core/contexts/context.cjs')
|
|
|
4
4
|
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
5
5
|
const require_core_components_source_file = require('../../core/components/source-file.cjs');
|
|
6
6
|
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
8
|
let _stryke_path_append = require("@stryke/path/append");
|
|
8
9
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
9
10
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
@@ -40,15 +41,26 @@ function TypescriptFile(props) {
|
|
|
40
41
|
if (pkg) if ((0, _stryke_type_checks_is_boolean.isBoolean)(props.export)) pkg.scope.addExport(modulePath, scope);
|
|
41
42
|
else pkg.scope.addExport(props.export, scope);
|
|
42
43
|
}
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.SourceFileContext.Provider, {
|
|
45
|
+
value: { scope },
|
|
46
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Scope, {
|
|
47
|
+
value: scope,
|
|
48
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_source_file.SourceFile, {
|
|
49
|
+
...rest,
|
|
50
|
+
path: modulePath,
|
|
51
|
+
header: header ?? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TypescriptFileHeader, {
|
|
52
|
+
hashbang,
|
|
53
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TypescriptFileHeaderImports, {
|
|
54
|
+
imports,
|
|
55
|
+
builtinImports,
|
|
56
|
+
scope
|
|
57
|
+
})
|
|
58
|
+
}),
|
|
59
|
+
filetype: tsx ? "tsx" : "typescript",
|
|
60
|
+
children
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
});
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
66
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -59,46 +71,47 @@ function TypescriptFile(props) {
|
|
|
59
71
|
function TypescriptFileHeader(props) {
|
|
60
72
|
const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
|
|
61
73
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
74
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
76
|
+
when: Boolean(hashbang),
|
|
77
|
+
children: [hashbang === true ? _alloy_js_core.code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
80
|
+
when: Boolean(header),
|
|
81
|
+
children: [header, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
84
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
85
|
+
when: Boolean(disableEslint),
|
|
86
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
87
|
+
variant: "slash-star",
|
|
88
|
+
children: "eslint-disable"
|
|
89
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
92
|
+
when: Boolean(disablePrettier),
|
|
93
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
94
|
+
variant: "slash-star",
|
|
95
|
+
children: "prettier-ignore"
|
|
96
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
99
|
+
when: Boolean(disableBiome),
|
|
100
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: "biome-ignore lint: disable" }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
103
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
104
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
107
|
+
when: Boolean(children),
|
|
108
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}` }),
|
|
111
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
112
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: (0, powerlines_utils.getFileHeaderWarning)(context) }),
|
|
113
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
114
|
+
] });
|
|
102
115
|
}
|
|
103
116
|
/**
|
|
104
117
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -117,22 +130,34 @@ function TypescriptFileHeaderImports(props) {
|
|
|
117
130
|
const builtinImports = (0, _alloy_js_core.computed)(() => {
|
|
118
131
|
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]));
|
|
119
132
|
});
|
|
120
|
-
return
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
134
|
+
when: scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
137
|
+
when: !!imports.value && Object.keys(imports.value).length > 0,
|
|
138
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
139
|
+
each: Object.entries(imports.value ?? {}),
|
|
140
|
+
hardline: true,
|
|
141
|
+
ender: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
142
|
+
children: ([module, importItem]) => _alloy_js_core.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.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.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module}";`
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
146
|
+
when: builtinImports.value && Object.keys(builtinImports.value).length > 0,
|
|
147
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
148
|
+
each: Object.entries(builtinImports.value ?? {}),
|
|
149
|
+
hardline: true,
|
|
150
|
+
ender: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
151
|
+
children: ([module, importItem]) => _alloy_js_core.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.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.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
|
|
152
|
+
})
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
155
|
+
when: scope.importedModules.size > 0,
|
|
156
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ImportStatements, { records: scope.importedModules })
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
159
|
+
]
|
|
160
|
+
});
|
|
136
161
|
}
|
|
137
162
|
|
|
138
163
|
//#endregion
|
|
@@ -2,6 +2,7 @@ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
|
2
2
|
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
3
|
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
4
|
import { For, Scope, Show, SourceDirectoryContext, code, computed, splitProps, useContext, useScope } from "@alloy-js/core";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
5
6
|
import { appendPath } from "@stryke/path/append";
|
|
6
7
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
7
8
|
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
@@ -38,15 +39,26 @@ function TypescriptFile(props) {
|
|
|
38
39
|
if (pkg) if (isBoolean(props.export)) pkg.scope.addExport(modulePath, scope);
|
|
39
40
|
else pkg.scope.addExport(props.export, scope);
|
|
40
41
|
}
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
return /* @__PURE__ */ jsx(SourceFileContext$1.Provider, {
|
|
43
|
+
value: { scope },
|
|
44
|
+
children: /* @__PURE__ */ jsx(Scope, {
|
|
45
|
+
value: scope,
|
|
46
|
+
children: /* @__PURE__ */ jsx(SourceFile, {
|
|
47
|
+
...rest,
|
|
48
|
+
path: modulePath,
|
|
49
|
+
header: header ?? /* @__PURE__ */ jsx(TypescriptFileHeader, {
|
|
50
|
+
hashbang,
|
|
51
|
+
children: /* @__PURE__ */ jsx(TypescriptFileHeaderImports, {
|
|
52
|
+
imports,
|
|
53
|
+
builtinImports,
|
|
54
|
+
scope
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
filetype: tsx ? "tsx" : "typescript",
|
|
58
|
+
children
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
});
|
|
50
62
|
}
|
|
51
63
|
/**
|
|
52
64
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -57,46 +69,47 @@ function TypescriptFile(props) {
|
|
|
57
69
|
function TypescriptFileHeader(props) {
|
|
58
70
|
const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
|
|
59
71
|
const context = usePowerlinesSafe();
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
74
|
+
when: Boolean(hashbang),
|
|
75
|
+
children: [hashbang === true ? code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang, /* @__PURE__ */ jsx("hbr", {})]
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
78
|
+
when: Boolean(header),
|
|
79
|
+
children: [header, /* @__PURE__ */ jsx("hbr", {})]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
82
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
83
|
+
when: Boolean(disableEslint),
|
|
84
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
85
|
+
variant: "slash-star",
|
|
86
|
+
children: "eslint-disable"
|
|
87
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
90
|
+
when: Boolean(disablePrettier),
|
|
91
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
92
|
+
variant: "slash-star",
|
|
93
|
+
children: "prettier-ignore"
|
|
94
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
97
|
+
when: Boolean(disableBiome),
|
|
98
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, { children: "biome-ignore lint: disable" }), /* @__PURE__ */ jsx("hbr", {})]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx(Show, {
|
|
101
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
102
|
+
children: /* @__PURE__ */ jsx("hbr", {})
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ jsx(Show, {
|
|
105
|
+
when: Boolean(children),
|
|
106
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ jsx(SingleLineComment, { children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}` }),
|
|
109
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
110
|
+
/* @__PURE__ */ jsx(SingleLineComment, { children: getFileHeaderWarning(context) }),
|
|
111
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
112
|
+
] });
|
|
100
113
|
}
|
|
101
114
|
/**
|
|
102
115
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -115,22 +128,34 @@ function TypescriptFileHeaderImports(props) {
|
|
|
115
128
|
const builtinImports = computed(() => {
|
|
116
129
|
return Object.fromEntries(Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? getUniqueBy(importItem, (i) => isString(i) ? i : i.alias || i.name) : importItem]));
|
|
117
130
|
});
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
return /* @__PURE__ */ jsxs(Show, {
|
|
132
|
+
when: scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx(Show, {
|
|
135
|
+
when: !!imports.value && Object.keys(imports.value).length > 0,
|
|
136
|
+
children: /* @__PURE__ */ jsx(For, {
|
|
137
|
+
each: Object.entries(imports.value ?? {}),
|
|
138
|
+
hardline: true,
|
|
139
|
+
ender: /* @__PURE__ */ jsx("hbr", {}),
|
|
140
|
+
children: ([module, importItem]) => code`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module}";`
|
|
141
|
+
})
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx(Show, {
|
|
144
|
+
when: builtinImports.value && Object.keys(builtinImports.value).length > 0,
|
|
145
|
+
children: /* @__PURE__ */ jsx(For, {
|
|
146
|
+
each: Object.entries(builtinImports.value ?? {}),
|
|
147
|
+
hardline: true,
|
|
148
|
+
ender: /* @__PURE__ */ jsx("hbr", {}),
|
|
149
|
+
children: ([module, importItem]) => code`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
|
|
150
|
+
})
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ jsx(Show, {
|
|
153
|
+
when: scope.importedModules.size > 0,
|
|
154
|
+
children: /* @__PURE__ */ jsx(ImportStatements, { records: scope.importedModules })
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
157
|
+
]
|
|
158
|
+
});
|
|
134
159
|
}
|
|
135
160
|
|
|
136
161
|
//#endregion
|