@powerlines/plugin-alloy 0.26.84 → 0.26.87

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.
@@ -64,7 +64,7 @@ function HCLFileHeader(props) {
64
64
  (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
65
65
  variant: "hcl",
66
66
  get children() {
67
- return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
67
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework?.name) || "Powerlines"}`;
68
68
  }
69
69
  }),
70
70
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
@@ -62,7 +62,7 @@ function HCLFileHeader(props) {
62
62
  createComponent(SingleLineComment, {
63
63
  variant: "hcl",
64
64
  get children() {
65
- return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
65
+ return `Generated by ${titleCase(context?.config?.framework?.name) || "Powerlines"}`;
66
66
  }
67
67
  }),
68
68
  createIntrinsic("hbr", {}),
@@ -1 +1 @@
1
- {"version":3,"file":"hcl-file.mjs","names":[],"sources":["../../../src/hcl/components/hcl-file.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, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport {\n InfrastructureFile,\n InfrastructureFileProps\n} from \"../../core/components/infrastructure-file\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { usePowerlines } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type HCLFileProps = Omit<\n InfrastructureFileProps,\n \"header\" | \"filetype\"\n> &\n ComponentProps & {\n header?: Children;\n filetype?: \"hcl\" | \"tf\" | `${string}.hcl` | `${string}.tf`;\n };\n\n/**\n * A base component representing a Powerlines generated HCL source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function HCLFile(props: HCLFileProps) {\n const [{ children, storage, header, filetype: _filetype, id }, rest] =\n splitProps(props, [\"children\", \"storage\", \"header\", \"filetype\", \"id\"]);\n\n const filetype = computed(() => _filetype || findFileExtension(id) || \"hcl\");\n\n return (\n <InfrastructureFile\n header={<HCLFileHeader>{header}</HCLFileHeader>}\n {...rest}\n id={id}\n filetype={filetype.value}\n storage={storage || \"fs\"}>\n <Show when={Boolean(children)}>{children}</Show>\n </InfrastructureFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines HCL source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function HCLFileHeader(props: ComponentProps) {\n const [{ children }] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"hcl\">{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"hcl\">\n {getFileHeaderWarning(context)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiCA,SAAE,QAAA,OAAA;CACA,MAAA,CAAA,EACE,UACA,SACD,6BAED,MACG,QAAK,WAAU,OAAA;EAAY;EAAG;EAAoB;EAAK;EAAW;EAAA,CAAA;CACtE,MAAA,WAAA,eAAA,aAAA,kBAAA,GAAA,IAAA,MAAA;AACC,QAAO,gBAAa,oBAAyB,WAAK,EAChD,IAAA,SAAY;AACd,SAAA,gBAAA,eAAA,EACK,UAAS,QACT,CAAC;;EAGA;;AAEN,UAAO,SAAA;;EAEL,SAAS,WAAE;EACX,IAAI,WAAM;AACR,UAAM,gBAAA,MAAA;IACN,IAAA,OAAU;AACV,YAAS,QAAU,SAAM;;IAEzB;IACH,CAAA;;;;;;;;;;;CAYD,MAAM,CAAA,gBAEN,WAAO,OAAA,CAAA,WAAA,CAAA;CACP,MAAG,UAAA,eAAA;AACH,QAAK;EAAA,gBAAmB,MAAQ;GAC9B,IAAI,OAAC;AACH,WAAK,QAAQ,SAAA;;GAEf,IAAI,WAAE;AACJ,WAAM,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAET,CAAC;EAAE,gBAAY,mBAAiB;GAC/B,SAAO;GACP,IAAG,WAAK;AACN,WAAC,gBAAkB,UAAa,SAAA,QAAA,UAAA,IAAA;;GAEnC,CAAC;EAAE,gBAAE,OAAiB,EAAA,CAAA;EAAA,gBAAA,mBAAA;GACrB,SAAQ;GACR,IAAE,WAAA;AACH,WAAA,qBAAA,QAAA"}
1
+ {"version":3,"file":"hcl-file.mjs","names":[],"sources":["../../../src/hcl/components/hcl-file.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, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport {\n InfrastructureFile,\n InfrastructureFileProps\n} from \"../../core/components/infrastructure-file\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { usePowerlines } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type HCLFileProps = Omit<\n InfrastructureFileProps,\n \"header\" | \"filetype\"\n> &\n ComponentProps & {\n header?: Children;\n filetype?: \"hcl\" | \"tf\" | `${string}.hcl` | `${string}.tf`;\n };\n\n/**\n * A base component representing a Powerlines generated HCL source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function HCLFile(props: HCLFileProps) {\n const [{ children, storage, header, filetype: _filetype, id }, rest] =\n splitProps(props, [\"children\", \"storage\", \"header\", \"filetype\", \"id\"]);\n\n const filetype = computed(() => _filetype || findFileExtension(id) || \"hcl\");\n\n return (\n <InfrastructureFile\n header={<HCLFileHeader>{header}</HCLFileHeader>}\n {...rest}\n id={id}\n filetype={filetype.value}\n storage={storage || \"fs\"}>\n <Show when={Boolean(children)}>{children}</Show>\n </InfrastructureFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines HCL source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function HCLFileHeader(props: ComponentProps) {\n const [{ children }] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"hcl\">{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"hcl\">\n {getFileHeaderWarning(context)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiCA,SAAE,QAAA,OAAA;CACA,MAAA,CAAA,EACE,UACA,SACD,6BAED,MACG,QAAK,WAAU,OAAA;EAAY;EAAG;EAAoB;EAAK;EAAW;EAAA,CAAA;CACtE,MAAA,WAAA,eAAA,aAAA,kBAAA,GAAA,IAAA,MAAA;AACC,QAAO,gBAAa,oBAAyB,WAAK,EAChD,IAAA,SAAY;AACd,SAAA,gBAAA,eAAA,EACK,UAAS,QACT,CAAC;;EAGA;;AAEN,UAAO,SAAA;;EAEL,SAAS,WAAE;EACX,IAAI,WAAM;AACR,UAAM,gBAAA,MAAA;IACN,IAAA,OAAU;AACV,YAAS,QAAU,SAAM;;IAEzB;IACH,CAAA;;;;;;;;;;;CAYD,MAAM,CAAA,gBAEN,WAAO,OAAA,CAAA,WAAA,CAAA;CACP,MAAG,UAAA,eAAA;AACH,QAAK;EAAA,gBAAmB,MAAQ;GAC9B,IAAI,OAAC;AACH,WAAK,QAAQ,SAAA;;GAEf,IAAI,WAAE;AACJ,WAAM,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAET,CAAC;EAAE,gBAAY,mBAAiB;GAC/B,SAAO;GACP,IAAG,WAAK;AACN,WAAC,gBAAkB,UAAa,SAAA,QAAA,WAAA,KAAA,IAAA;;GAEnC,CAAC;EAAE,gBAAE,OAAiB,EAAA,CAAA;EAAA,gBAAA,mBAAA;GACrB,SAAQ;GACR,IAAE,WAAA;AACH,WAAA,qBAAA,QAAA"}
@@ -116,7 +116,7 @@ function MarkdownFileHeader(props) {
116
116
  (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
117
117
  variant: "markdown",
118
118
  get children() {
119
- return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
119
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework?.name) || "Powerlines"}`;
120
120
  }
121
121
  }),
122
122
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
@@ -114,7 +114,7 @@ function MarkdownFileHeader(props) {
114
114
  createComponent(SingleLineComment, {
115
115
  variant: "markdown",
116
116
  get children() {
117
- return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
117
+ return `Generated by ${titleCase(context?.config?.framework?.name) || "Powerlines"}`;
118
118
  }
119
119
  }),
120
120
  createIntrinsic("hbr", {}),
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-file.mjs","names":[],"sources":["../../../src/markdown/components/markdown-file.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 { Show, splitProps } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\nimport { FrontMatter, FrontMatterProps } from \"./front-matter\";\n\nexport type MarkdownFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps &\n MarkdownFileHeaderProps;\n\n/**\n * A base component representing a Powerlines generated markdown source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function MarkdownFile(props: MarkdownFileProps) {\n const [{ children, storage, frontMatter }, rest] = splitProps(props, [\n \"children\",\n \"storage\",\n \"frontMatter\"\n ]);\n\n return (\n <SourceFile\n header={<MarkdownFileHeader frontMatter={frontMatter} />}\n {...rest}\n filetype=\"md\"\n reference={Link}\n storage={storage}>\n <Show when={Boolean(children)}>{children}</Show>\n </SourceFile>\n );\n}\n\nexport type MarkdownFileHeaderProps = SourceFileHeaderProps & {\n frontMatter?: FrontMatterProps[\"data\"];\n};\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function MarkdownFileHeader(props: MarkdownFileHeaderProps) {\n const [\n {\n children,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n frontMatter\n }\n ] = splitProps(props, [\n \"children\",\n \"disableEslint\",\n \"disableBiome\",\n \"disablePrettier\",\n \"frontMatter\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show\n when={isSetObject(frontMatter) && Object.keys(frontMatter).length > 0}>\n <FrontMatter data={frontMatter!} />\n </Show>\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"markdown\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"markdown\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment variant=\"markdown\">\n {\"biome-ignore lint: disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"markdown\">{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"markdown\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,SAAC,aAAA,OAAA;CACC,MAAE,CAAK,EACL,UACF,SACF,eACE,QAAS,WAAU,OAAS;EAAA;EAAc;EAAS;EAAgB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AAC;EAAE,gBAAY,MAAY;GAC1B,IAAI,OAAC;AACH,WAAO,QAAC,cAAA,IAAA,QAAA,gBAAA,IAAA,QAAA,aAAA;;GAEV,IAAG,WAAW;AACZ,WAAG,gBAAA,OAAA,EAAA,CAAA;;GAEN,CAAC;EAAE,gBAAU,MAAA;GACZ,IAAI,OAAE;AACJ,WAAM,QAAA,SAAA;;GAER,IAAI,WAAU;AACZ,WAAK,CAAA,UAAA,gBAAiB,OAAA,EAAA,CAAA,CAAA;;GAEzB,CAAC;EAAE,gBAAkB,mBAAmB;GACvC,SAAK;GACL,IAAI,WAAA;AACF,WAAM,gBAAA,UAAA,SAAA,QAAA,UAAA,IAAA;;GAET,CAAA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA,gBAAA,mBAAA;GACH,SAAA"}
1
+ {"version":3,"file":"markdown-file.mjs","names":[],"sources":["../../../src/markdown/components/markdown-file.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 { Show, splitProps } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\nimport { FrontMatter, FrontMatterProps } from \"./front-matter\";\n\nexport type MarkdownFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps &\n MarkdownFileHeaderProps;\n\n/**\n * A base component representing a Powerlines generated markdown source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function MarkdownFile(props: MarkdownFileProps) {\n const [{ children, storage, frontMatter }, rest] = splitProps(props, [\n \"children\",\n \"storage\",\n \"frontMatter\"\n ]);\n\n return (\n <SourceFile\n header={<MarkdownFileHeader frontMatter={frontMatter} />}\n {...rest}\n filetype=\"md\"\n reference={Link}\n storage={storage}>\n <Show when={Boolean(children)}>{children}</Show>\n </SourceFile>\n );\n}\n\nexport type MarkdownFileHeaderProps = SourceFileHeaderProps & {\n frontMatter?: FrontMatterProps[\"data\"];\n};\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function MarkdownFileHeader(props: MarkdownFileHeaderProps) {\n const [\n {\n children,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n frontMatter\n }\n ] = splitProps(props, [\n \"children\",\n \"disableEslint\",\n \"disableBiome\",\n \"disablePrettier\",\n \"frontMatter\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show\n when={isSetObject(frontMatter) && Object.keys(frontMatter).length > 0}>\n <FrontMatter data={frontMatter!} />\n </Show>\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"markdown\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"markdown\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment variant=\"markdown\">\n {\"biome-ignore lint: disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"markdown\">{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"markdown\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,SAAC,aAAA,OAAA;CACC,MAAE,CAAK,EACL,UACF,SACF,eACE,QAAS,WAAU,OAAS;EAAA;EAAc;EAAS;EAAgB,CAAC;AACpE,QAAG,gBAAS,YAAA,WAAA,EACV,IAAC,SAAQ;AACR,SAAA,gBAAW,oBAAA,EACZ;IAGD,EAAE,MAAA;EACD,UAAU;EACV,WAAU;EACR;EACF,IAAE,WAAW;AACX,UAAO,gBAAU,MAAA;IAChB,IAAK,OAAM;AACZ,YAAU,QAAA,SAAA;;IAEhB;;;EAGE,CAAA,CAAA;;;;;;;;AAQF,SAAE,mBAAA,OAAA;CACF,MAAO,CAAA,EACL,UACE,gBAAA,MACA,eAAU,MACV,kBAAkB,OAClB,iBACE,WAAA,OAAkB;EAAA;EAAK;EAAA;EAAA;EAAA;EAAA,CAAA;CAC3B,MAAI,UAAA,mBAAA;AACJ,QAAE;EAAA,gBAAA,MAAA;GACA,IAAE,OAAA;AACD,WAAQ,WAAC,CAAA,CAAA,YAAA,YAAA,CAAA,EAAA,IAAA,OAAA,KAAA,YAAA,CAAA,SAAA;;GAEV,IAAC,WAAa;AACb,WAAA,gBAAgB,aAAA,EAChB,MAAA,aACD,CAAA;;GAEF,CAAA;EAAA,gBAAgB,MAAA;;AAEhB,WAAO,QAAA,cAAA;;GAEL,IAAG,WAAA;AACD,WAAO,CAAC,gBAAY,mBAAuB;KACzC,SAAC;KACD,UAAI;KACL,CAAA,EAAA,gBAAmB,OAAA,EAAA,CAAA,CAAa;;GAEpC,CAAC;EAAE,gBAAa,MAAQ;GACvB,IAAI,OAAE;AACJ,WAAO,QAAC,gBAAA;;GAEV,IAAG,WAAW;AACZ,WAAG,CAAA,gBAAkB,mBAAkB;KACrC,SAAI;KACJ,UAAE;KACH,CAAC,EAAC,gBAAK,OAAA,EAAA,CAAA,CAAA;;GAEX,CAAC;EAAE,gBAAY,MAAQ;GACtB,IAAI,OAAC;AACH,WAAM,QAAM,aAAa;;GAE3B,IAAI,WAAM;AACR,WAAM,CAAA,gBAAA,mBAAA;KACL,SAAA;KACC,UAAK;KACN,CAAC,EAAE,gBAAQ,OAAgB,EAAA,CAAA,CAAA;;GAE/B,CAAC;EAAE,gBAAY,MAAY;GAC1B,IAAI,OAAC;AACH,WAAO,QAAC,cAAA,IAAA,QAAA,gBAAA,IAAA,QAAA,aAAA;;GAEV,IAAG,WAAW;AACZ,WAAG,gBAAA,OAAA,EAAA,CAAA;;GAEN,CAAC;EAAE,gBAAU,MAAA;GACZ,IAAI,OAAE;AACJ,WAAM,QAAA,SAAA;;GAER,IAAI,WAAU;AACZ,WAAK,CAAA,UAAA,gBAAiB,OAAA,EAAA,CAAA,CAAA;;GAEzB,CAAC;EAAE,gBAAkB,mBAAmB;GACvC,SAAK;GACL,IAAI,WAAA;AACF,WAAM,gBAAA,UAAA,SAAA,QAAA,WAAA,KAAA,IAAA;;GAET,CAAA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA,gBAAA,mBAAA;GACH,SAAA"}
@@ -462,7 +462,7 @@ function TSDocModule(props) {
462
462
  }
463
463
  }),
464
464
  "@module ",
465
- (0, _alloy_js_core_jsx_runtime.memo)(() => prefix || context?.config?.framework || "powerlines"),
465
+ (0, _alloy_js_core_jsx_runtime.memo)(() => prefix || context?.config?.framework?.name || "powerlines"),
466
466
  ":",
467
467
  name
468
468
  ];
@@ -460,7 +460,7 @@ function TSDocModule(props) {
460
460
  }
461
461
  }),
462
462
  "@module ",
463
- memo(() => prefix || context?.config?.framework || "powerlines"),
463
+ memo(() => prefix || context?.config?.framework?.name || "powerlines"),
464
464
  ":",
465
465
  name
466
466
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"tsdoc.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc.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 {\n Children,\n childrenArray,\n computed,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport {\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type: ReflectionKind | ReflectionProperty | ReflectionParameter;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyDefaultValue(type, defaultValue)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={false} softline={true}>\n {childrenArray(() => props.children)}\n </List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\n/**\n * Create a TSDoc `@runtime` tag.\n */\nexport function TSDocRuntime() {\n return <TSDocTag tag=\"runtime\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: ReflectionKind | ReflectionProperty | ReflectionParameter;\n title?: string;\n alias?: string[];\n permission?: string[];\n domain?: string;\n readonly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n runtime?: boolean;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n alias,\n permission,\n readonly,\n internal,\n ignore,\n hidden,\n runtime,\n defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"alias\",\n \"permission\",\n \"readonly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"runtime\",\n \"defaultValue\"\n ]);\n\n const title = computed(() => props.title?.trim() || \"\");\n const domain = computed(() => props.domain?.trim() || \"\");\n\n return (\n <>\n <Show when={isSetString(title.value)}>\n <TSDocTitle>{title.value}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show when={isSetString(domain.value)}>\n <TSDocDomain>{domain.value}</TSDocDomain>\n </Show>\n <Show\n when={\n !isUndefined(permission) &&\n permission.length > 0 &&\n permission.some(p => isSetString(p?.trim()))\n }>\n <For each={permission?.filter(p => isSetString(p?.trim())) ?? []}>\n {permission => <TSDocPermission>{permission}</TSDocPermission>}\n </For>\n </Show>\n <Show when={readonly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={runtime === true}>\n <TSDocRuntime />\n </Show>\n <Show\n when={\n runtime !== true && !isUndefined(type) && !isUndefined(defaultValue)\n }>\n <TSDocDefaultValue\n type={\n type as ReflectionKind | ReflectionProperty | ReflectionParameter\n }\n defaultValue={defaultValue}\n />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n defaultValue={props.defaultValue}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.defaultValue)}>={props.defaultValue}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA+BA,SAAgB,MAAA,OAAA;CACd,MAAA,CAAA,EACA,UACA,aACK,WAAE,OAAc,CAAA,YAAc,UAAW,CAAC;AACjD,QAAS;EAAA;EAAA,gBAAqB,SAAY;GAC1C,QAAS;GACT,IAAQ,WAAC;AACH,WAAG;KAAA,gBAAuB,OAAM,EAAA,CAAA;KAAM,gBAAW,MAAA;;AAEhD,cAAU,CAAA,YAAW,QAAQ;;MAEpC,UAAA;;;MAEE,IAAA,OAAA;AACC,cAAY,WAAW,CAAA,CAAA,CAAA,YAAkB,SAAM,CAAA,EAAA,IAAW,oBAAK,SAAA,CAAA,OAAA,QAAA,CAAA,SAAA;;MAE3D,IAAA,WAAe;AACZ,cAAC,CAAA,gBAAuB,MAAA;;AAEzB,gBAAA,CAAA,YAAA,QAAA;;QAED,IAAA,WAAA;AACK,gBAAQ,gBAAI,SAAA,EAAA,CAAA;;QAEhB,CAAA,EAAK,gBAAkB,MAAC;QACxB,UAAA;QACC,UAAK;QACH,IAAC,WAAY;AACb,gBAAA,oBAA6B,SAAQ;;QAEtC,CAAA,CAAA;;MAEJ,CAAC;KAAC;;GAE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;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;EAAA"}
1
+ {"version":3,"file":"tsdoc.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc.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 {\n Children,\n childrenArray,\n computed,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport {\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type: ReflectionKind | ReflectionProperty | ReflectionParameter;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyDefaultValue(type, defaultValue)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={false} softline={true}>\n {childrenArray(() => props.children)}\n </List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\n/**\n * Create a TSDoc `@runtime` tag.\n */\nexport function TSDocRuntime() {\n return <TSDocTag tag=\"runtime\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: ReflectionKind | ReflectionProperty | ReflectionParameter;\n title?: string;\n alias?: string[];\n permission?: string[];\n domain?: string;\n readonly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n runtime?: boolean;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n alias,\n permission,\n readonly,\n internal,\n ignore,\n hidden,\n runtime,\n defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"alias\",\n \"permission\",\n \"readonly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"runtime\",\n \"defaultValue\"\n ]);\n\n const title = computed(() => props.title?.trim() || \"\");\n const domain = computed(() => props.domain?.trim() || \"\");\n\n return (\n <>\n <Show when={isSetString(title.value)}>\n <TSDocTitle>{title.value}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show when={isSetString(domain.value)}>\n <TSDocDomain>{domain.value}</TSDocDomain>\n </Show>\n <Show\n when={\n !isUndefined(permission) &&\n permission.length > 0 &&\n permission.some(p => isSetString(p?.trim()))\n }>\n <For each={permission?.filter(p => isSetString(p?.trim())) ?? []}>\n {permission => <TSDocPermission>{permission}</TSDocPermission>}\n </For>\n </Show>\n <Show when={readonly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={runtime === true}>\n <TSDocRuntime />\n </Show>\n <Show\n when={\n runtime !== true && !isUndefined(type) && !isUndefined(defaultValue)\n }>\n <TSDocDefaultValue\n type={\n type as ReflectionKind | ReflectionProperty | ReflectionParameter\n }\n defaultValue={defaultValue}\n />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n defaultValue={props.defaultValue}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.defaultValue)}>={props.defaultValue}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework?.name || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA+BA,SAAgB,MAAA,OAAA;CACd,MAAA,CAAA,EACA,UACA,aACK,WAAE,OAAc,CAAA,YAAc,UAAW,CAAC;AACjD,QAAS;EAAA;EAAA,gBAAqB,SAAY;GAC1C,QAAS;GACT,IAAQ,WAAC;AACH,WAAG;KAAA,gBAAuB,OAAM,EAAA,CAAA;KAAM,gBAAW,MAAA;;AAEhD,cAAU,CAAA,YAAW,QAAQ;;MAEpC,UAAA;;;MAEE,IAAA,OAAA;AACC,cAAY,WAAW,CAAA,CAAA,CAAA,YAAkB,SAAM,CAAA,EAAA,IAAW,oBAAK,SAAA,CAAA,OAAA,QAAA,CAAA,SAAA;;MAE3D,IAAA,WAAe;AACZ,cAAC,CAAA,gBAAuB,MAAA;;AAEzB,gBAAA,CAAA,YAAA,QAAA;;QAED,IAAA,WAAA;AACK,gBAAQ,gBAAI,SAAA,EAAA,CAAA;;QAEhB,CAAA,EAAK,gBAAkB,MAAC;QACxB,UAAA;QACC,UAAK;QACH,IAAC,WAAY;AACb,gBAAA,oBAA6B,SAAQ;;QAEtC,CAAA,CAAA;;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KAAA;KAAA;KAAA;;GAEH,CAAA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;EAAA"}
@@ -133,7 +133,7 @@ function TypescriptFileHeader(props) {
133
133
  }
134
134
  }),
135
135
  (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
136
- return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
136
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework?.name) || "Powerlines"}`;
137
137
  } }),
138
138
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
139
139
  (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
@@ -195,7 +195,7 @@ function TypescriptFileHeaderImports(props) {
195
195
  get ender() {
196
196
  return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
197
197
  },
198
- 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 || "powerlines"}:${module}`}";`
198
+ 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}`}";`
199
199
  });
200
200
  }
201
201
  }),
@@ -131,7 +131,7 @@ function TypescriptFileHeader(props) {
131
131
  }
132
132
  }),
133
133
  createComponent(SingleLineComment, { get children() {
134
- return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
134
+ return `Generated by ${titleCase(context?.config?.framework?.name) || "Powerlines"}`;
135
135
  } }),
136
136
  createIntrinsic("hbr", {}),
137
137
  createComponent(SingleLineComment, { get children() {
@@ -193,7 +193,7 @@ function TypescriptFileHeaderImports(props) {
193
193
  get ender() {
194
194
  return createIntrinsic("hbr", {});
195
195
  },
196
- children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${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.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
196
+ children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${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.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework?.name || "powerlines"}:${module}`}";`
197
197
  });
198
198
  }
199
199
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-file.mjs","names":[],"sources":["../../../src/typescript/components/typescript-file.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 type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,eAAoB,OAAO;CACpC,MAAQ,CAAC,EACT,UACA,MACA,SACA,gBACA,KACA,QACA,YACA,QAAO,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACL,MAAA,mBAAc,WAAA,uBAAA;CACd,MAAA,SAAA,uBAAqB,iBAAA;CACrB,MAAA,aAAA,WAAwB,MAAA,iBAAA,KAAA;CACxB,MAAA,QAAA,IAAA,cAAA,YAAA,UAAA,CAAA;AACA,QAAO,QAAK,IAAM,MAAA;;AAEpB,KAAM,IACJ,KAAA,MAAA,UAAiB,MAAA;AAEjB,KAAE,MAAQ,QACR;MAAA,IACA,KAAA,UAAgB,MAAC,OAAA,CACjB,KAAQ,MAAC,UAAU,YAAM,MAAA;MAE1B,KAAA,MAAA,UAAA,MAAA,QAAA,MAAA;;AAIF,QAAA,gBAAA,oBAAA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AC"}
1
+ {"version":3,"file":"typescript-file.mjs","names":[],"sources":["../../../src/typescript/components/typescript-file.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 type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework?.name || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,eAAoB,OAAO;CACpC,MAAQ,CAAC,EACT,UACA,MACA,SACA,gBACA,KACA,QACA,YACA,QAAO,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACL,MAAA,mBAAc,WAAA,uBAAA;CACd,MAAA,SAAA,uBAAqB,iBAAA;CACrB,MAAA,aAAA,WAAwB,MAAA,iBAAA,KAAA;CACxB,MAAA,QAAA,IAAA,cAAA,YAAA,UAAA,CAAA;AACA,QAAO,QAAK,IAAM,MAAA;;AAEpB,KAAM,IACJ,KAAA,MAAA,UAAiB,MAAA;AAEjB,KAAE,MAAQ,QACR;MAAA,IACA,KAAA,UAAgB,MAAC,OAAA,CACjB,KAAQ,MAAC,UAAU,YAAM,MAAA;MAE1B,KAAA,MAAA,UAAA,MAAA,QAAA,MAAA;;AAIF,QAAA,gBAAA,oBAAA,UAAA;EACG,OAAM,EACN,OACF;EACF,IAAO,WAAS;AACd,UAAM,gBAAA,OAAA;IACF,OAAS;IACX,IAAA,WAAA;AACE,YAAW,gBAAO,YAAA,WAAA,MAAA;MACnB,MAAS;MACJ,IAAA,SAAA;AACG,cAAA,UAAA,gBAAA,sBAAA;QACO;QACX,IAAA,WAAA;AACG,gBAAA,gBAAA,6BAAA;UACC;UACT;;UAEI,CAAA;;;;MAIA,UAAY,MAAA,QAAc;MACb;;;IAGf,CAAA;;EAEJ,CAAA;;;;;;;;AAQF,SAAM,qBAAA,OAAA;CACJ,MAAE,EACF,kBAEA,gBAAO,MACL,eAAC,MACD,aACE;CACJ,MAAM,UAAA,mBAAA;AACN,QAAK;EAAA,gBAAmB,MAAA;GACtB,IAAI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AA,EAAA,IAAA,EAAA,QAAA,CAAA,SAAA,KAAA,WAAA,QAAA,MAAA,SAAA,EAAA,IAAA,CAAA,EAAA,QAAA,CAAA,SAAA,IAAA,OAAA,OAAA,WAAA,QAAA,MAAA,SAAA,EAAA,IAAA,CAAA,EAAA,QAAA,CAAA,SAAA,IAAA,KAAA,WAAA,QAAA,MAAA,SAAA,EAAA,IAAA,CAAA,EAAA,QAAA,CAAA,KAAA,MAAA,SAAA,EAAA,GAAA,IAAA,GAAA,EAAA,OAAA,UAAA,KAAA,EAAA,QAAA,GAAA,EAAA,KAAA,MAAA,EAAA,UAAA,EAAA,OAAA,CAAA,KAAA,KAAA,CAAA,MAAA,MAAA,SAAA,OAAA,SAAA,IAAA,GAAA,SAAA,GAAA,SAAA,QAAA,WAAA,QAAA,aAAA,GAAA,SAAA;OACtB,CAAA;;KAEJ,CAAC;IAAA,gBAAM,MAAA;KACN,IAAA,OAAM;AACJ,aAAE,MAAW,gBAAgB,OAAG;;KAEnC,IAAA,WAAA;AACF,aAAA,gBAAA,kBAAA,EACD,IAAA,UAAA;AACI,cAAA,MAAiB;SAEnB,CAAM;;KAEL,CAAC;IAAA,gBAAc,OAAU,EAAA,CAAA;IAAA;;EAE7B,CAAC"}
@@ -131,7 +131,7 @@ function YamlFileHeader(props) {
131
131
  }
132
132
  }),
133
133
  (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
134
- return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
134
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework?.name) || "Powerlines"}`;
135
135
  } }),
136
136
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
137
137
  (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
@@ -129,7 +129,7 @@ function YamlFileHeader(props) {
129
129
  }
130
130
  }),
131
131
  createComponent(SingleLineComment, { get children() {
132
- return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
132
+ return `Generated by ${titleCase(context?.config?.framework?.name) || "Powerlines"}`;
133
133
  } }),
134
134
  createIntrinsic("hbr", {}),
135
135
  createComponent(SingleLineComment, {
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-file.mjs","names":[],"sources":["../../../src/yaml/components/yaml-file.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 type { Children } from \"@alloy-js/core\";\nimport { code, For, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\n\nexport interface YamlData {\n [key: string]: string | number | boolean | YamlData | YamlData[];\n}\n\ninterface YamlFileDataItemProps {\n value: string | number | boolean | YamlData | YamlData[];\n key?: string;\n}\n\nfunction YamlFileDataItem({ key, value }: YamlFileDataItemProps) {\n return (\n <>\n <Show when={Boolean(key)}>{code`${key}:`}</Show>\n <Show\n when={\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n }>\n {code` ${String(value)}`}\n </Show>\n <Show when={isSetObject(value) && !Array.isArray(value)}>\n <For each={Object.entries(value as YamlData)}>\n {([nestedKey, nestedValue]) => (\n <YamlFileDataItem key={nestedKey} value={nestedValue} />\n )}\n </For>\n </Show>\n <Show when={Array.isArray(value)}>\n <For each={value as YamlData[]}>\n {item => <YamlFileDataItem value={item} />}\n </For>\n </Show>\n </>\n );\n}\n\ninterface YamlFileDataProps {\n data?: YamlData;\n}\n\nfunction YamlFileData({ data }: YamlFileDataProps) {\n return (\n <>\n <Show when={Boolean(data)}>\n <For each={Object.entries(data ?? {})}>\n {([key, value]) => <YamlFileDataItem key={key} value={value} />}\n </For>\n </Show>\n </>\n );\n}\n\nexport type YamlFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n header?: Children;\n data?: YamlData;\n };\n\n/**\n * A base component representing a Powerlines generated YAML source file.\n *\n * @remarks\n * The file content can be provided either through the `data` prop, which accepts a nested object representing the YAML structure, or through the `children` prop, which allows for custom YAML content to be rendered. The `header` prop can be used to provide custom header content for the YAML file, which is rendered above the generated file header warning and generation comment.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function YamlFile(props: YamlFileProps) {\n const [{ children, path, data, header }, rest] = splitProps(props, [\n \"children\",\n \"path\",\n \"data\",\n \"header\"\n ]);\n\n return (\n <SourceFile\n {...rest}\n path={path}\n header={<YamlFileHeader>{header}</YamlFileHeader>}\n filetype=\"yaml\">\n <Show when={Boolean(data)}>\n <YamlFileData data={data} />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n </SourceFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines YAML source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function YamlFileHeader(props: SourceFileHeaderProps) {\n const { children } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment vari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EACJ;EACN,IAAE,SAAS;AACT,UAAA,gBAAe,gBAAA,EACd,UAAW,QACX,CAAC;;EAEJ,UAAQ;EACR,IAAI,WAAC;AACH,UAAK,CAAA,gBAAQ,MAAA;IACX,IAAG,OAAK;AACN,YAAA,QAAA,KAAA;;IAEJ,IAAA,WAAU;AACb,YAAA,gBAAA,cAAA,EACH;;IAGG,CAAA,EAAO,gBAAkB,MAAA;IAC3B,IAAA,OAAA;AACS,YAAO,QAAK,SAAW;;IAE/B,IAAA,WAAA;AACK,YAAS,CAAA,UAAA,gBAAsB,OAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;AAatC,SAAO,eAAoB,OAAU;CACnC,MAAM,EACJ,aACE;CACJ,MAAK,UAAA,mBAA2B;AAChC,QAAO;EAAA,gBAAA,MAAqB;GAC1B,IAAI,OAAA;AACF,WAAM,QAAA,SAAA;;GAET,IAAA,WAAA;AACH,WAAA,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"yaml-file.mjs","names":[],"sources":["../../../src/yaml/components/yaml-file.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 type { Children } from \"@alloy-js/core\";\nimport { code, For, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\n\nexport interface YamlData {\n [key: string]: string | number | boolean | YamlData | YamlData[];\n}\n\ninterface YamlFileDataItemProps {\n value: string | number | boolean | YamlData | YamlData[];\n key?: string;\n}\n\nfunction YamlFileDataItem({ key, value }: YamlFileDataItemProps) {\n return (\n <>\n <Show when={Boolean(key)}>{code`${key}:`}</Show>\n <Show\n when={\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n }>\n {code` ${String(value)}`}\n </Show>\n <Show when={isSetObject(value) && !Array.isArray(value)}>\n <For each={Object.entries(value as YamlData)}>\n {([nestedKey, nestedValue]) => (\n <YamlFileDataItem key={nestedKey} value={nestedValue} />\n )}\n </For>\n </Show>\n <Show when={Array.isArray(value)}>\n <For each={value as YamlData[]}>\n {item => <YamlFileDataItem value={item} />}\n </For>\n </Show>\n </>\n );\n}\n\ninterface YamlFileDataProps {\n data?: YamlData;\n}\n\nfunction YamlFileData({ data }: YamlFileDataProps) {\n return (\n <>\n <Show when={Boolean(data)}>\n <For each={Object.entries(data ?? {})}>\n {([key, value]) => <YamlFileDataItem key={key} value={value} />}\n </For>\n </Show>\n </>\n );\n}\n\nexport type YamlFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n header?: Children;\n data?: YamlData;\n };\n\n/**\n * A base component representing a Powerlines generated YAML source file.\n *\n * @remarks\n * The file content can be provided either through the `data` prop, which accepts a nested object representing the YAML structure, or through the `children` prop, which allows for custom YAML content to be rendered. The `header` prop can be used to provide custom header content for the YAML file, which is rendered above the generated file header warning and generation comment.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function YamlFile(props: YamlFileProps) {\n const [{ children, path, data, header }, rest] = splitProps(props, [\n \"children\",\n \"path\",\n \"data\",\n \"header\"\n ]);\n\n return (\n <SourceFile\n {...rest}\n path={path}\n header={<YamlFileHeader>{header}</YamlFileHeader>}\n filetype=\"yaml\">\n <Show when={Boolean(data)}>\n <YamlFileData data={data} />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n </SourceFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines YAML source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function YamlFileHeader(props: SourceFileHeaderProps) {\n const { children } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"yaml\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;4BA4BA,KACE,SACF;;;GAEA,IAAA,OAAU;AACR,WAAO,QAAS,IAAO;;GAEzB,UAAA,IAAA,GAAA,IAAA;;;GAEA,MAAS,OAAA,UAAkB,YAAY,OAAG,UAAA,YAAuB,OAAA,UAAA;GAC/D,IAAM,WAAC;AACJ,WAAA,IAAA,KAAA,OAAA,MAAA;;GAEF,CAAC;EAAE,gBAAC,MAAA;GACH,IAAI,OAAK;AACP,WAAI,WAAgB,CAAC,CAAC,YAAS,MAAA,CAAA,EAAA,IAAA,CAAA,MAAA,QAAA,MAAA;;GAEjC,IAAI,WAAS;AACX,WAAG,gBAAA,KAAA;KACD,IAAC,OAAS;AACV,aAAI,OAAA,QAAA,MAAA;;KAEJ,WAAW,CAAA,WAAO,iBAAiB,gBAAU,kBAAA;MAC3C,KAAG;MACH,OAAG;MACJ,CAAC;KACH,CAAC;;GAEL,CAAC;EAAE,gBAAkB,MAAA;GACpB,IAAI,OAAK;AACP,WAAK,MAAQ,QAAC,MAAA;;GAEhB,IAAI,WAAI;AACN,WAAA,gBAAA,KAAA;KACH,MAAA;KACH,WAAA,SAAA,gBAAA,kBAAA,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