@powerlines/plugin-alloy 0.25.27 → 0.25.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/core/components/output.cjs +7 -19
  2. package/dist/core/components/output.mjs +7 -19
  3. package/dist/core/components/output.mjs.map +1 -1
  4. package/dist/core/components/single-line-comment.cjs +8 -7
  5. package/dist/core/components/single-line-comment.mjs +8 -7
  6. package/dist/core/components/single-line-comment.mjs.map +1 -1
  7. package/dist/core/components/source-file.cjs +7 -12
  8. package/dist/core/components/source-file.mjs +7 -12
  9. package/dist/core/components/source-file.mjs.map +1 -1
  10. package/dist/core/components/spacing.cjs +6 -7
  11. package/dist/core/components/spacing.mjs +6 -7
  12. package/dist/core/components/spacing.mjs.map +1 -1
  13. package/dist/core/contexts/context.mjs.map +1 -1
  14. package/dist/core/contexts/meta.mjs.map +1 -1
  15. package/dist/core/contexts/reflection.mjs.map +1 -1
  16. package/dist/core/helpers/code.mjs.map +1 -1
  17. package/dist/helpers/capnp.mjs.map +1 -1
  18. package/dist/helpers/create-builtin.mjs.map +1 -1
  19. package/dist/helpers/refkey.mjs.map +1 -1
  20. package/dist/helpers/typescript.mjs.map +1 -1
  21. package/dist/index.cjs +6 -3
  22. package/dist/index.d.cts.map +1 -1
  23. package/dist/index.d.mts.map +1 -1
  24. package/dist/index.mjs +6 -3
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/markdown/components/front-matter.cjs +9 -14
  27. package/dist/markdown/components/front-matter.mjs +9 -14
  28. package/dist/markdown/components/front-matter.mjs.map +1 -1
  29. package/dist/markdown/components/markdown-file.cjs +41 -89
  30. package/dist/markdown/components/markdown-file.mjs +41 -89
  31. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  32. package/dist/markdown/components/markdown-table.cjs +20 -52
  33. package/dist/markdown/components/markdown-table.mjs +20 -52
  34. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  35. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  36. package/dist/render.cjs +4 -10
  37. package/dist/render.mjs +4 -10
  38. package/dist/render.mjs.map +1 -1
  39. package/dist/typescript/components/builtin-file.cjs +9 -31
  40. package/dist/typescript/components/builtin-file.mjs +9 -31
  41. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  42. package/dist/typescript/components/class-declaration.cjs +80 -193
  43. package/dist/typescript/components/class-declaration.mjs +80 -193
  44. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  45. package/dist/typescript/components/dynamic-import-statement.cjs +1 -2
  46. package/dist/typescript/components/dynamic-import-statement.mjs +1 -2
  47. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  48. package/dist/typescript/components/entry-file.cjs +3 -10
  49. package/dist/typescript/components/entry-file.mjs +3 -10
  50. package/dist/typescript/components/entry-file.mjs.map +1 -1
  51. package/dist/typescript/components/infrastructure-file.cjs +3 -10
  52. package/dist/typescript/components/infrastructure-file.mjs +3 -10
  53. package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
  54. package/dist/typescript/components/interface-declaration.cjs +47 -134
  55. package/dist/typescript/components/interface-declaration.mjs +47 -134
  56. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  57. package/dist/typescript/components/object-declaration.cjs +35 -79
  58. package/dist/typescript/components/object-declaration.mjs +35 -79
  59. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  60. package/dist/typescript/components/property-name.cjs +3 -3
  61. package/dist/typescript/components/property-name.mjs +3 -3
  62. package/dist/typescript/components/property-name.mjs.map +1 -1
  63. package/dist/typescript/components/record-expression.mjs.map +1 -1
  64. package/dist/typescript/components/tsdoc-reflection.cjs +53 -232
  65. package/dist/typescript/components/tsdoc-reflection.mjs +53 -232
  66. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  67. package/dist/typescript/components/tsdoc.cjs +140 -306
  68. package/dist/typescript/components/tsdoc.mjs +140 -306
  69. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  70. package/dist/typescript/components/type-declaration.cjs +9 -22
  71. package/dist/typescript/components/type-declaration.mjs +9 -22
  72. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  73. package/dist/typescript/components/type-parameters.cjs +33 -60
  74. package/dist/typescript/components/type-parameters.mjs +33 -60
  75. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  76. package/dist/typescript/components/typescript-file.cjs +65 -155
  77. package/dist/typescript/components/typescript-file.mjs +65 -155
  78. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  79. package/dist/typescript/contexts/lexical-scope.cjs +1 -7
  80. package/dist/typescript/contexts/lexical-scope.mjs +1 -7
  81. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  82. package/dist/typescript/contexts/member-scope.cjs +2 -7
  83. package/dist/typescript/contexts/member-scope.mjs +2 -7
  84. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  85. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  86. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  87. package/dist/yaml/components/yaml-file.cjs +48 -103
  88. package/dist/yaml/components/yaml-file.mjs +48 -103
  89. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  90. package/package.json +7 -7
  91. package/dist/_virtual/_rolldown/runtime.mjs +0 -3
@@ -3,7 +3,6 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  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
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
6
  let _alloy_js_core = require("@alloy-js/core");
8
7
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
9
8
  let powerlines_utils = require("powerlines/utils");
@@ -11,65 +10,31 @@ let _stryke_type_checks = require("@stryke/type-checks");
11
10
 
12
11
  //#region src/yaml/components/yaml-file.tsx
13
12
  function YamlFileDataItem({ key, value }) {
14
- return [
15
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
16
- get when() {
17
- return Boolean(key);
18
- },
19
- children: _alloy_js_core.code`${key}:`
20
- }),
21
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
22
- when: typeof value === "string" || typeof value === "number" || typeof value === "boolean",
23
- get children() {
24
- return _alloy_js_core.code` ${String(value)}`;
25
- }
26
- }),
27
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
28
- get when() {
29
- return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(0, _stryke_type_checks.isSetObject)(value))() && !Array.isArray(value);
30
- },
31
- get children() {
32
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
33
- get each() {
34
- return Object.entries(value);
35
- },
36
- children: ([nestedKey, nestedValue]) => (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileDataItem, {
37
- key: nestedKey,
38
- value: nestedValue
39
- })
40
- });
41
- }
42
- }),
43
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
44
- get when() {
45
- return Array.isArray(value);
46
- },
47
- get children() {
48
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
49
- each: value,
50
- children: (item) => (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileDataItem, { value: item })
51
- });
52
- }
53
- })
54
- ];
13
+ return <>
14
+ <_alloy_js_core.Show when={Boolean(key)}>{_alloy_js_core.code`${key}:`}</_alloy_js_core.Show>
15
+ <_alloy_js_core.Show when={typeof value === "string" || typeof value === "number" || typeof value === "boolean"}>
16
+ {_alloy_js_core.code` ${String(value)}`}
17
+ </_alloy_js_core.Show>
18
+ <_alloy_js_core.Show when={(0, _stryke_type_checks.isSetObject)(value) && !Array.isArray(value)}>
19
+ <_alloy_js_core.For each={Object.entries(value)}>
20
+ {([nestedKey, nestedValue]) => <YamlFileDataItem key={nestedKey} value={nestedValue} />}
21
+ </_alloy_js_core.For>
22
+ </_alloy_js_core.Show>
23
+ <_alloy_js_core.Show when={Array.isArray(value)}>
24
+ <_alloy_js_core.For each={value}>
25
+ {(item) => <YamlFileDataItem value={item} />}
26
+ </_alloy_js_core.For>
27
+ </_alloy_js_core.Show>
28
+ </>;
55
29
  }
56
30
  function YamlFileData({ data }) {
57
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
58
- get when() {
59
- return Boolean(data);
60
- },
61
- get children() {
62
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
63
- get each() {
64
- return Object.entries(data ?? {});
65
- },
66
- children: ([key, value]) => (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileDataItem, {
67
- key,
68
- value
69
- })
70
- });
71
- }
72
- })];
31
+ return <>
32
+ <_alloy_js_core.Show when={Boolean(data)}>
33
+ <_alloy_js_core.For each={Object.entries(data ?? {})}>
34
+ {([key, value]) => <YamlFileDataItem key={key} value={value} />}
35
+ </_alloy_js_core.For>
36
+ </_alloy_js_core.Show>
37
+ </>;
73
38
  }
74
39
  /**
75
40
  * A base component representing a Powerlines generated YAML source file.
@@ -87,30 +52,17 @@ function YamlFile(props) {
87
52
  "data",
88
53
  "header"
89
54
  ]);
90
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
91
- path,
92
- get header() {
93
- return (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileHeader, { children: header });
94
- },
95
- filetype: "yaml",
96
- get children() {
97
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
98
- get when() {
99
- return Boolean(data);
100
- },
101
- get children() {
102
- return (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileData, { data });
103
- }
104
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
105
- get when() {
106
- return Boolean(children);
107
- },
108
- get children() {
109
- return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
110
- }
111
- })];
112
- }
113
- }));
55
+ return <require_core_components_source_file.SourceFile {...rest} path={path} header={<YamlFileHeader>{header}</YamlFileHeader>} filetype="yaml">
56
+ <_alloy_js_core.Show when={Boolean(data)}>
57
+ <YamlFileData data={data} />
58
+ </_alloy_js_core.Show>
59
+ <_alloy_js_core.Show when={Boolean(children)}>
60
+ <>
61
+ {children}
62
+ <hbr />
63
+ </>
64
+ </_alloy_js_core.Show>
65
+ </require_core_components_source_file.SourceFile>;
114
66
  }
115
67
  /**
116
68
  * Renders the header for a Powerlines YAML source file.
@@ -121,27 +73,20 @@ function YamlFile(props) {
121
73
  function YamlFileHeader(props) {
122
74
  const { children } = props;
123
75
  const context = require_core_contexts_context.usePowerlinesSafe();
124
- return [
125
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
126
- get when() {
127
- return Boolean(children);
128
- },
129
- get children() {
130
- return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
131
- }
132
- }),
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"}`;
135
- } }),
136
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
137
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
138
- variant: "yaml",
139
- get children() {
140
- return (0, powerlines_utils.getFileHeaderWarning)(context);
141
- }
142
- }),
143
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
144
- ];
76
+ return <>
77
+ <_alloy_js_core.Show when={Boolean(children)}>
78
+ <>
79
+ {children}
80
+ <hbr />
81
+ </>
82
+ </_alloy_js_core.Show>
83
+ <require_core_components_single_line_comment.SingleLineComment>{`Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`}</require_core_components_single_line_comment.SingleLineComment>
84
+ <hbr />
85
+ <require_core_components_single_line_comment.SingleLineComment variant="yaml">
86
+ {(0, powerlines_utils.getFileHeaderWarning)(context)}
87
+ </require_core_components_single_line_comment.SingleLineComment>
88
+ <hbr />
89
+ </>;
145
90
  }
146
91
 
147
92
  //#endregion
@@ -1,7 +1,6 @@
1
1
  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
- import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
5
4
  import { For, Show, code, splitProps } from "@alloy-js/core";
6
5
  import { titleCase } from "@stryke/string-format/title-case";
7
6
  import { getFileHeaderWarning } from "powerlines/utils";
@@ -9,65 +8,31 @@ import { isSetObject } from "@stryke/type-checks";
9
8
 
10
9
  //#region src/yaml/components/yaml-file.tsx
11
10
  function YamlFileDataItem({ key, value }) {
12
- return [
13
- createComponent(Show, {
14
- get when() {
15
- return Boolean(key);
16
- },
17
- children: code`${key}:`
18
- }),
19
- createComponent(Show, {
20
- when: typeof value === "string" || typeof value === "number" || typeof value === "boolean",
21
- get children() {
22
- return code` ${String(value)}`;
23
- }
24
- }),
25
- createComponent(Show, {
26
- get when() {
27
- return memo(() => !!isSetObject(value))() && !Array.isArray(value);
28
- },
29
- get children() {
30
- return createComponent(For, {
31
- get each() {
32
- return Object.entries(value);
33
- },
34
- children: ([nestedKey, nestedValue]) => createComponent(YamlFileDataItem, {
35
- key: nestedKey,
36
- value: nestedValue
37
- })
38
- });
39
- }
40
- }),
41
- createComponent(Show, {
42
- get when() {
43
- return Array.isArray(value);
44
- },
45
- get children() {
46
- return createComponent(For, {
47
- each: value,
48
- children: (item) => createComponent(YamlFileDataItem, { value: item })
49
- });
50
- }
51
- })
52
- ];
11
+ return <>
12
+ <Show when={Boolean(key)}>{code`${key}:`}</Show>
13
+ <Show when={typeof value === "string" || typeof value === "number" || typeof value === "boolean"}>
14
+ {code` ${String(value)}`}
15
+ </Show>
16
+ <Show when={isSetObject(value) && !Array.isArray(value)}>
17
+ <For each={Object.entries(value)}>
18
+ {([nestedKey, nestedValue]) => <YamlFileDataItem key={nestedKey} value={nestedValue} />}
19
+ </For>
20
+ </Show>
21
+ <Show when={Array.isArray(value)}>
22
+ <For each={value}>
23
+ {(item) => <YamlFileDataItem value={item} />}
24
+ </For>
25
+ </Show>
26
+ </>;
53
27
  }
54
28
  function YamlFileData({ data }) {
55
- return [createComponent(Show, {
56
- get when() {
57
- return Boolean(data);
58
- },
59
- get children() {
60
- return createComponent(For, {
61
- get each() {
62
- return Object.entries(data ?? {});
63
- },
64
- children: ([key, value]) => createComponent(YamlFileDataItem, {
65
- key,
66
- value
67
- })
68
- });
69
- }
70
- })];
29
+ return <>
30
+ <Show when={Boolean(data)}>
31
+ <For each={Object.entries(data ?? {})}>
32
+ {([key, value]) => <YamlFileDataItem key={key} value={value} />}
33
+ </For>
34
+ </Show>
35
+ </>;
71
36
  }
72
37
  /**
73
38
  * A base component representing a Powerlines generated YAML source file.
@@ -85,30 +50,17 @@ function YamlFile(props) {
85
50
  "data",
86
51
  "header"
87
52
  ]);
88
- return createComponent(SourceFile, mergeProps(rest, {
89
- path,
90
- get header() {
91
- return createComponent(YamlFileHeader, { children: header });
92
- },
93
- filetype: "yaml",
94
- get children() {
95
- return [createComponent(Show, {
96
- get when() {
97
- return Boolean(data);
98
- },
99
- get children() {
100
- return createComponent(YamlFileData, { data });
101
- }
102
- }), createComponent(Show, {
103
- get when() {
104
- return Boolean(children);
105
- },
106
- get children() {
107
- return [children, createIntrinsic("hbr", {})];
108
- }
109
- })];
110
- }
111
- }));
53
+ return <SourceFile {...rest} path={path} header={<YamlFileHeader>{header}</YamlFileHeader>} filetype="yaml">
54
+ <Show when={Boolean(data)}>
55
+ <YamlFileData data={data} />
56
+ </Show>
57
+ <Show when={Boolean(children)}>
58
+ <>
59
+ {children}
60
+ <hbr />
61
+ </>
62
+ </Show>
63
+ </SourceFile>;
112
64
  }
113
65
  /**
114
66
  * Renders the header for a Powerlines YAML source file.
@@ -119,27 +71,20 @@ function YamlFile(props) {
119
71
  function YamlFileHeader(props) {
120
72
  const { children } = props;
121
73
  const context = usePowerlinesSafe();
122
- return [
123
- createComponent(Show, {
124
- get when() {
125
- return Boolean(children);
126
- },
127
- get children() {
128
- return [children, createIntrinsic("hbr", {})];
129
- }
130
- }),
131
- createComponent(SingleLineComment, { get children() {
132
- return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
133
- } }),
134
- createIntrinsic("hbr", {}),
135
- createComponent(SingleLineComment, {
136
- variant: "yaml",
137
- get children() {
138
- return getFileHeaderWarning(context);
139
- }
140
- }),
141
- createIntrinsic("hbr", {})
142
- ];
74
+ return <>
75
+ <Show when={Boolean(children)}>
76
+ <>
77
+ {children}
78
+ <hbr />
79
+ </>
80
+ </Show>
81
+ <SingleLineComment>{`Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`}</SingleLineComment>
82
+ <hbr />
83
+ <SingleLineComment variant="yaml">
84
+ {getFileHeaderWarning(context)}
85
+ </SingleLineComment>
86
+ <hbr />
87
+ </>;
143
88
  }
144
89
 
145
90
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-file.mjs","names":["code","For","Show","splitProps","titleCase","isSetObject","getFileHeaderWarning","SingleLineComment","SourceFile","usePowerlinesSafe","YamlFileDataItem","key","value","_$createComponent","when","Boolean","children","String","_$memo","Array","isArray","each","Object","entries","nestedKey","nestedValue","item","YamlFileData","data","YamlFile","props","path","header","rest","_$mergeProps","YamlFileHeader","filetype","_$createIntrinsic","context","config","framework","variant"],"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 variant=\"yaml\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;SAoDgE,iBAAA,EAAA,KAAA,SAAA;;kBAAA,MAAA;GAAA,IAAA,OAAA;AAAA,WAAA,YAAA;;GAAA,UAAA,IAAA,GAAA,IAAA;GAAA,CAAA;EAAA,gBAAA,MAAA;GAAA,MAAA,OAAA,UAAA,YAAA,OAAA,UAAA,YAAA,OAAA,UAAA;GAAA,IAAA,WAAA;AAAA,eAAA,KAAA,OAAA,MAAA;;GAAA,CAAA;EAAA,sBAAA;GAAA,IAAA,OAAA;AAAA,WAAA,WAAA,CAAA,CAAA,YAAA,MAAA,CAAA,EAAA,IAAA,CAAA,MAAA,QAAA,MAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,qBAAA;KAAA,IAAA,OAAA;AAAA,aAAA,OAAA,QAAA,MAAA;;KAAA,WAAA,CAAA,WAAA,iBAAA,gBAAA,kBAAA;MAAA,KAAA;MAAA,OAAA;MAAA,CAAA;KACrD,CAAA;;GAAA,CAAA;EAAA,gBAGK,MAAA;GAAA,IAAA,OAAA;AAAA,WAAA,MAAA,QAAA,MAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,gBAAA,KAAA;KAAA,MAAA;KAAA,WAAA,SAAA,gBAAA,kBAAA,EAAA,OAAA,MAAA,CAAA;KAAA,CAAA;;GAAA,CAAA;EAAA;;AAahB,SAAS2B,aAAa,EAAA,QAAA;AAAA,QAAA,CAAA,gBAAA,MAAA;EAAA,IAAA,OAAA;AAAA,UAAA,QAAA,KAAA;;EAAA,IAAA,WAAA;AAAA,UAAA,gBAAA,KAAA;IAAA,IAAA,OAAA;AAAA,YAAA,OAAA,QAAA,QAAA,EAAA,CAAA;;IAAA,WAAA,CAAA,KAAA,WAAA,gBAAA,kBAAA;KAAA;KAAA;KAAA,CAAA;IAAA,CAAA;;EAAA,CAAA,CAAA;;;;;;;;;;;AAUtB,SAAA,SAAA,OAAA;CAQA,MAAA,CAAA,EAAA,UAAA,MAAA,MAAA,UAAA,QAAA,WAAA,OAAA;EACA;EACA;EAAA;EAAA;GAAA;AAAA,QAAA,gBAEA,YAAA,WAiBY,MAAA;EAAA;EAAA,IAAA,SAAA;AAAA,UAAA,gBAAA,gBAAA,EAAA,UAAA,QAAA,CAAA;;YAAA;EAAA,IAAA,WAAA;AAAA,UAAA,CAAA,gBAAA,MAAA;IAAA,IAAA,OAAA;AAAA,YAAA,QAAA,KAAA;;IAAA,IAAA,WAAA;AAAA,YAAA,gBAAA,cAAA,EAAA,MAAA,CAAA;;IAAA,CAAA,EAAA,gBAAA,MAAA;IAAA,IAAA,OAAA;AAAA,YAAA,QAAA,SAAA;;IAAA,IAAA,WAAA;AAAA,YAAA,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;IAAA,CAAA,CAAA;;EAAA,CAAA,CAAA;;;;;;;;SAAAd,eAAAA,OAAAA;OAAAA,EAAAA,aAAAA;CAAAA,MAAAA,UAAAA,mBAAAA;;;;;;;;;;qCAAGsB,EAAAA,IAAAA,WAAAA;AAAAA,UAAAA,gBAAAA,UAAAA,SAAAA,QAAAA,UAAAA,IAAAA;KAAAA,CAAAA;EAAAA,gBAAAA,OAAAA,EAAAA,CAAAA;EAAAA"}
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 variant=\"yaml\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAqCA,SAAS,iBAAiB,EAAE,KAAK,SAAgC;AAC/D,QACE,EAAE;MACA,CAAC,KAAK,MAAM,QAAQ,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,KAAK;MAChD,CAAC,KACC,MACE,OAAO,UAAU,YACjB,OAAO,UAAU,YACjB,OAAO,UAAU,WACjB;SACD,IAAI,KAAK,OAAO,MAAM,GAAG;MAC5B,EAAE,KAAK;MACP,CAAC,KAAK,MAAM,YAAY,MAAM,IAAI,CAAC,MAAM,QAAQ,MAAM,EAAE;QACvD,CAAC,IAAI,MAAM,OAAO,QAAQ,MAAkB,EAAE;YAC1C,CAAC,WAAW,iBACZ,CAAC,iBAAiB,KAAK,WAAW,OAAO,gBACzC;QACJ,EAAE,IAAI;MACR,EAAE,KAAK;MACP,CAAC,KAAK,MAAM,MAAM,QAAQ,MAAM,EAAE;QAChC,CAAC,IAAI,MAAM,OAAqB;YAC7B,SAAQ,CAAC,iBAAiB,OAAO,SAAS;QAC7C,EAAE,IAAI;MACR,EAAE,KAAK;IACT;;AAQJ,SAAS,aAAa,EAAE,QAA2B;AACjD,QACE,EAAE;MACA,CAAC,KAAK,MAAM,QAAQ,KAAK,EAAE;QACzB,CAAC,IAAI,MAAM,OAAO,QAAQ,QAAQ,EAAE,CAAC,EAAE;YACnC,CAAC,KAAK,WAAW,CAAC,iBAAiB,KAAK,KAAK,OAAO,UAAU;QAClE,EAAE,IAAI;MACR,EAAE,KAAK;IACT;;;;;;;;;;;AAmBJ,SAAgB,SAAS,OAAsB;CAC7C,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,UAAU,QAAQ,WAAW,OAAO;EACjE;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,CAAC,eACK,MACJ,MAAM,MACN,QAAQ,CAAC,gBAAgB,OAAO,EAAE,iBAClC,gBAAgB;MAChB,CAAC,KAAK,MAAM,QAAQ,KAAK,EAAE;QACzB,CAAC,aAAa,MAAM,QAAQ;MAC9B,EAAE,KAAK;MACP,CAAC,KAAK,MAAM,QAAQ,SAAS,EAAE;QAC7B,EAAE;WACC,SAAS;UACV,CAAC,MAAM;QACT,GAAG;MACL,EAAE,KAAK;IACT,EAAE;;;;;;;;AAUN,SAAgB,eAAe,OAA8B;CAC3D,MAAM,EAAE,aAAa;CAErB,MAAM,UAAU,mBAAmB;AAEnC,QACE,EAAE;MACA,CAAC,KAAK,MAAM,QAAQ,SAAS,EAAE;QAC7B,EAAE;WACC,SAAS;UACV,CAAC,MAAM;QACT,GAAG;MACL,EAAE,KAAK;MACP,CAAC,mBAAmB,gBAClB,UAAU,SAAS,QAAQ,UAAU,IAAI,eACxC,EAAE,kBAAkB;MACvB,CAAC,MAAM;MACP,CAAC,kBAAkB,eAAe;SAC/B,qBAAqB,QAAS,CAAC;MAClC,EAAE,kBAAkB;MACpB,CAAC,MAAM;IACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.25.27",
3
+ "version": "0.25.29",
4
4
  "type": "module",
5
5
  "description": "A package containing various Alloy framework components and helper utilities.",
6
6
  "repository": {
@@ -810,8 +810,8 @@
810
810
  "@alloy-js/markdown": "0.23.0-dev.1",
811
811
  "@alloy-js/rollup-plugin": "^0.1.0",
812
812
  "@alloy-js/typescript": "0.23.0-dev.4",
813
- "@powerlines/deepkit": "^0.6.122",
814
- "@powerlines/plugin-babel": "^0.12.346",
813
+ "@powerlines/deepkit": "^0.6.124",
814
+ "@powerlines/plugin-babel": "^0.12.348",
815
815
  "@storm-software/config-tools": "1.189.28",
816
816
  "@stryke/capnp": "^0.12.83",
817
817
  "@stryke/convert": "^0.6.53",
@@ -824,14 +824,14 @@
824
824
  "@stryke/types": "^0.10.52",
825
825
  "@stryke/unique-id": "^0.3.68",
826
826
  "defu": "^6.1.4",
827
- "powerlines": "^0.41.8",
827
+ "powerlines": "^0.41.10",
828
828
  "prettier": "^3.8.1",
829
829
  "unctx": "^2.5.0"
830
830
  },
831
831
  "devDependencies": {
832
- "@powerlines/plugin-plugin": "^0.12.294",
833
- "@types/node": "^25.4.0"
832
+ "@powerlines/plugin-plugin": "^0.12.296",
833
+ "@types/node": "^25.5.0"
834
834
  },
835
835
  "publishConfig": { "access": "public" },
836
- "gitHead": "40d1f94407720be23c3801f9145fdad1fe27dfb2"
836
+ "gitHead": "8ab1d6e9a7ab44ee184b19c58d6de2c4c101ec01"
837
837
  }
@@ -1,3 +0,0 @@
1
- import "node:module";
2
-
3
- export { };