@powerlines/plugin-react 0.1.132 → 0.1.133

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 (210) hide show
  1. package/dist/components/index.cjs +3 -2
  2. package/dist/components/index.d.cts +3 -1
  3. package/dist/components/index.d.mts +4 -1
  4. package/dist/components/index.mjs +2 -1
  5. package/dist/components/react-optimized.cjs +2 -48
  6. package/dist/components/react-optimized.d.cts +2 -13
  7. package/dist/components/react-optimized.d.mts +3 -13
  8. package/dist/components/react-optimized.mjs +1 -45
  9. package/dist/components-BWLXb7a2.cjs +0 -0
  10. package/dist/{plugin-alloy/src/types/components.d.cts → components-Bs3-ohmM.d.mts} +2 -1
  11. package/dist/components-D-mbfYAe.mjs +1 -0
  12. package/dist/index-B8OHl-c_.d.mts +1 -0
  13. package/dist/index-CFG0_wK4.d.cts +1 -0
  14. package/dist/index-DNLi60D-.d.mts +1 -0
  15. package/dist/index-_wQ5ClJU.d.cts +1 -0
  16. package/dist/index.cjs +11298 -19
  17. package/dist/index.d.cts +7 -5
  18. package/dist/index.d.mts +8 -6
  19. package/dist/index.mjs +11282 -9
  20. package/dist/{deepkit/schemas/reflection.d.mts → plugin-BaOVS_rV.d.cts} +331 -1
  21. package/dist/{deepkit/schemas/reflection.d.cts → plugin-D7LpFbdk.d.mts} +389 -59
  22. package/dist/plugin-jZ9N9Mz-.mjs +1 -0
  23. package/dist/plugin-pBKbb5K9.cjs +0 -0
  24. package/dist/react-optimized-BpFTLlx0.mjs +937 -0
  25. package/dist/react-optimized-C_OVnrX3.d.cts +105 -0
  26. package/dist/react-optimized-Kv14o38g.cjs +1078 -0
  27. package/dist/react-optimized-oMkTiRKU.d.mts +88 -0
  28. package/dist/resolved-BmaQR2AE.d.mts +1789 -0
  29. package/dist/resolved-DaJ9lL_Z.d.cts +1788 -0
  30. package/dist/runtime-BKY6WvHV.mjs +1 -0
  31. package/dist/{plugin-env/src/types/runtime.d.mts → runtime-BjubXOjV.d.mts} +2 -2
  32. package/dist/runtime-Bp9G0scd.cjs +0 -0
  33. package/dist/{plugin-env/src/types/runtime.d.cts → runtime-CAI6R3zb.d.cts} +2 -2
  34. package/dist/runtime-DWYeFyQG.d.cts +15 -0
  35. package/dist/runtime-YmyzXCJq.d.mts +15 -0
  36. package/dist/types/index.cjs +3 -0
  37. package/dist/types/index.d.cts +5 -2
  38. package/dist/types/index.d.mts +6 -2
  39. package/dist/types/index.mjs +4 -0
  40. package/dist/types/plugin.cjs +1 -0
  41. package/dist/types/plugin.d.cts +3 -72
  42. package/dist/types/plugin.d.mts +4 -72
  43. package/dist/types/plugin.mjs +2 -0
  44. package/dist/types/runtime.cjs +1 -0
  45. package/dist/types/runtime.d.cts +3 -14
  46. package/dist/types/runtime.d.mts +3 -14
  47. package/dist/types/runtime.mjs +2 -0
  48. package/dist/types--fVOUYBq.mjs +1 -0
  49. package/dist/types-a8gm_IaQ.cjs +0 -0
  50. package/package.json +5 -5
  51. package/dist/_virtual/rolldown_runtime.cjs +0 -37
  52. package/dist/_virtual/rolldown_runtime.mjs +0 -29
  53. package/dist/deepkit/schemas/reflection.cjs +0 -3940
  54. package/dist/deepkit/schemas/reflection.mjs +0 -3938
  55. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  56. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  57. package/dist/deepkit/src/capnp.cjs +0 -913
  58. package/dist/deepkit/src/capnp.mjs +0 -911
  59. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  60. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  61. package/dist/deepkit/src/reflect-type.cjs +0 -22
  62. package/dist/deepkit/src/reflect-type.mjs +0 -20
  63. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  64. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  65. package/dist/deepkit/src/transformer.cjs +0 -52
  66. package/dist/deepkit/src/transformer.mjs +0 -49
  67. package/dist/deepkit/src/transpile.cjs +0 -29
  68. package/dist/deepkit/src/transpile.mjs +0 -27
  69. package/dist/deepkit/src/types.d.cts +0 -10
  70. package/dist/deepkit/src/types.d.mts +0 -10
  71. package/dist/deepkit/src/utilities.cjs +0 -66
  72. package/dist/deepkit/src/utilities.mjs +0 -65
  73. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
  74. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
  75. package/dist/deepkit/src/vendor/type.cjs +0 -20
  76. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  77. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  78. package/dist/deepkit/src/vendor/type.mjs +0 -11
  79. package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
  80. package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
  81. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  82. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  83. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  84. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  85. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  86. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  87. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
  88. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
  89. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  90. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  91. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  92. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  93. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  94. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  95. package/dist/plugin-alloy/src/index.cjs +0 -93
  96. package/dist/plugin-alloy/src/index.mjs +0 -91
  97. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -7
  98. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -9
  99. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -5
  100. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -7
  101. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -17
  102. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  103. package/dist/plugin-alloy/src/types/components.d.mts +0 -25
  104. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  105. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
  106. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
  107. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
  108. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -25
  109. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  110. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
  111. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
  112. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
  113. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
  114. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -27
  115. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -28
  116. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
  117. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -194
  118. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -14
  119. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -15
  120. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -191
  121. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
  122. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
  123. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  124. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  125. package/dist/plugin-automd/src/index.cjs +0 -101
  126. package/dist/plugin-automd/src/index.mjs +0 -98
  127. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  128. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  129. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  130. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  131. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  132. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  133. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  134. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  135. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  136. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  137. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  138. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  139. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  140. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  141. package/dist/plugin-babel/src/helpers/options.cjs +0 -50
  142. package/dist/plugin-babel/src/helpers/options.mjs +0 -47
  143. package/dist/plugin-babel/src/index.cjs +0 -91
  144. package/dist/plugin-babel/src/index.mjs +0 -89
  145. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  146. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  147. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  148. package/dist/plugin-env/src/babel/index.cjs +0 -1
  149. package/dist/plugin-env/src/babel/index.mjs +0 -3
  150. package/dist/plugin-env/src/babel/plugin.cjs +0 -121
  151. package/dist/plugin-env/src/babel/plugin.mjs +0 -119
  152. package/dist/plugin-env/src/components/docs.cjs +0 -9
  153. package/dist/plugin-env/src/components/docs.mjs +0 -11
  154. package/dist/plugin-env/src/components/env.cjs +0 -575
  155. package/dist/plugin-env/src/components/env.mjs +0 -572
  156. package/dist/plugin-env/src/components/index.cjs +0 -2
  157. package/dist/plugin-env/src/components/index.mjs +0 -4
  158. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  159. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  160. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  161. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  162. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  163. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  164. package/dist/plugin-env/src/helpers/load.cjs +0 -83
  165. package/dist/plugin-env/src/helpers/load.mjs +0 -80
  166. package/dist/plugin-env/src/helpers/persistence.cjs +0 -200
  167. package/dist/plugin-env/src/helpers/persistence.mjs +0 -189
  168. package/dist/plugin-env/src/helpers/reflect.cjs +0 -111
  169. package/dist/plugin-env/src/helpers/reflect.mjs +0 -103
  170. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  171. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  172. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  173. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  174. package/dist/plugin-env/src/index.cjs +0 -175
  175. package/dist/plugin-env/src/index.mjs +0 -173
  176. package/dist/plugin-env/src/types/plugin.d.cts +0 -151
  177. package/dist/plugin-env/src/types/plugin.d.mts +0 -153
  178. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
  179. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
  180. package/dist/powerlines/src/lib/entry.cjs +0 -12
  181. package/dist/powerlines/src/lib/entry.mjs +0 -14
  182. package/dist/powerlines/src/lib/logger.cjs +0 -41
  183. package/dist/powerlines/src/lib/logger.mjs +0 -39
  184. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +0 -38
  185. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +0 -35
  186. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
  187. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
  188. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
  189. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
  190. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  191. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  192. package/dist/powerlines/src/types/babel.d.cts +0 -22
  193. package/dist/powerlines/src/types/babel.d.mts +0 -22
  194. package/dist/powerlines/src/types/build.d.cts +0 -145
  195. package/dist/powerlines/src/types/build.d.mts +0 -145
  196. package/dist/powerlines/src/types/commands.d.cts +0 -8
  197. package/dist/powerlines/src/types/commands.d.mts +0 -9
  198. package/dist/powerlines/src/types/config.d.cts +0 -380
  199. package/dist/powerlines/src/types/config.d.mts +0 -381
  200. package/dist/powerlines/src/types/context.d.cts +0 -414
  201. package/dist/powerlines/src/types/context.d.mts +0 -416
  202. package/dist/powerlines/src/types/fs.d.cts +0 -486
  203. package/dist/powerlines/src/types/fs.d.mts +0 -486
  204. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  205. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  206. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  207. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  208. package/dist/powerlines/src/types/resolved.d.mts +0 -82
  209. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  210. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
@@ -0,0 +1,937 @@
1
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
2
+ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
3
+ import { hasFileExtension } from "@stryke/path/file-path-fns";
4
+ import defu from "defu";
5
+ import { isSetString } from "@stryke/type-checks/is-set-string";
6
+ import { titleCase } from "@stryke/string-format/title-case";
7
+ import { isString } from "@stryke/type-checks/is-string";
8
+ import { For, List, Prose, Scope, Show, SourceDirectoryContext, SourceFileContext, childrenArray, code, computed, createContext, createNamedContext, getContext, refkey, splitProps, useContext, useFormatOptions, useScope } from "@alloy-js/core";
9
+ import { StormJSON } from "@stryke/json/storm-json";
10
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
11
+ import { appendPath } from "@stryke/path/append";
12
+ import { getUniqueBy } from "@stryke/helpers/get-unique";
13
+ import { isNull } from "@stryke/type-checks/is-null";
14
+ import { isUndefined } from "@stryke/type-checks/is-undefined";
15
+ import { FunctionDeclaration, ImportStatements, PackageContext, SourceFileContext as SourceFileContext$1, TSModuleScope, getSourceDirectoryData, useSourceFile } from "@alloy-js/typescript";
16
+ import { isSet } from "@stryke/type-checks/is-set";
17
+ import { isBoolean } from "@stryke/type-checks/is-boolean";
18
+
19
+ //#region ../plugin-alloy/src/core/contexts/context.ts
20
+ /**
21
+ * The Powerlines context used in template rendering.
22
+ */
23
+ const PowerlinesContext = createNamedContext("powerlines");
24
+ /**
25
+ * Hook to access the Powerlines Context.
26
+ *
27
+ * @returns The Context.
28
+ */
29
+ function usePowerlinesContext() {
30
+ return useContext(PowerlinesContext);
31
+ }
32
+ /**
33
+ * Hook to safely access the {@link PluginContext | Powerlines context}.
34
+ *
35
+ * @returns The Powerlines context or undefined if not set.
36
+ */
37
+ function usePowerlinesSafe() {
38
+ return usePowerlinesContext()?.ref?.value;
39
+ }
40
+ /**
41
+ * Hook to access the {@link PluginContext | Powerlines context}.
42
+ *
43
+ * @returns The Powerlines context.
44
+ */
45
+ function usePowerlines() {
46
+ const powerlines = usePowerlinesSafe();
47
+ if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
48
+ return powerlines;
49
+ }
50
+ /**
51
+ * Hook to safely access the render context's metadata.
52
+ *
53
+ * @returns The Powerlines context or undefined if not set.
54
+ */
55
+ function useMetaSafe() {
56
+ return usePowerlinesContext()?.meta?.value;
57
+ }
58
+ /**
59
+ * Hook to access the render context's metadata.
60
+ *
61
+ * @returns The Powerlines context.
62
+ */
63
+ function useMeta() {
64
+ const meta = useMetaSafe();
65
+ if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
66
+ return meta;
67
+ }
68
+
69
+ //#endregion
70
+ //#region ../deepkit/src/utilities.ts
71
+ /**
72
+ * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
73
+ *
74
+ * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
75
+ * @param value - The value to stringify.
76
+ * @returns A string representation of the value.
77
+ */
78
+ function stringifyDefaultValue(property, value) {
79
+ return stringifyValue(property.type, value ?? property.getDefaultValue());
80
+ }
81
+ /**
82
+ * Stringifies a value as a string.
83
+ *
84
+ * @param value - The value to stringify.
85
+ * @returns A string representation of the value.
86
+ */
87
+ function stringifyStringValue(value) {
88
+ return `"${String(value).replaceAll("\"", "\\\"")}"`;
89
+ }
90
+ /**
91
+ * Converts any {@link Type}'s actual value to string representation.
92
+ *
93
+ * @param type - The {@link Type} of the value to stringify.
94
+ * @param value - The value to stringify.
95
+ * @returns A string representation of the value.
96
+ */
97
+ function stringifyValue(type, value) {
98
+ return isUndefined(value) ? "undefined" : isNull(value) ? "null" : type.kind === ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type.kind === ReflectionKind.string || type.kind === ReflectionKind.literal && isString(type.literal) ? stringifyStringValue(value) : type.kind === ReflectionKind.enum ? getEnumReflectionType(type).kind === ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type.kind === ReflectionKind.union ? isStringUnion(type) ? stringifyStringValue(value) : `${String(value)}` : type.kind === ReflectionKind.array ? stringifyStringValue(StormJSON.stringify(value)) : type.kind === ReflectionKind.object || type.kind === ReflectionKind.objectLiteral ? StormJSON.stringify(value) : type.kind === ReflectionKind.property || type.kind === ReflectionKind.parameter ? stringifyValue(type.type, value) : String(value);
99
+ }
100
+ /**
101
+ * Converts a {@link TypeEnum} to its underlying primitive type representation.
102
+ *
103
+ * @param type - The {@link TypeEnum} to evaluate.
104
+ * @returns A string representation of the primitive type.
105
+ */
106
+ function getEnumReflectionType(type) {
107
+ if (type.kind !== ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
108
+ const unique = getUniqueBy(type.values.filter((value) => value !== void 0 && value !== null), (enumMember) => isString(enumMember) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number });
109
+ if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
110
+ return unique[0] && isString(unique[0]) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number };
111
+ }
112
+ /**
113
+ * Converts a {@link TypeUnion} to its underlying primitive type representation.
114
+ *
115
+ * @param type - The {@link TypeUnion} to evaluate.
116
+ * @returns A string representation of the primitive type.
117
+ */
118
+ function getUnionTypes(type) {
119
+ if (type.kind === ReflectionKind.union && type.types.length > 0) return getUniqueBy(type.types, (member) => member.kind);
120
+ throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
121
+ }
122
+ function isStringUnion(type) {
123
+ return getUnionTypes(type).some((member) => member.kind === ReflectionKind.string || member.kind === ReflectionKind.literal && isString(member.literal));
124
+ }
125
+
126
+ //#endregion
127
+ //#region ../plugin-alloy/src/helpers/refkey.ts
128
+ /**
129
+ * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.
130
+ *
131
+ * @remarks
132
+ * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`
133
+ */
134
+ function refkey$1(...args) {
135
+ return refkey("powerlines", ...args);
136
+ }
137
+
138
+ //#endregion
139
+ //#region ../plugin-alloy/src/typescript/components/tsdoc.tsx
140
+ /**
141
+ * Generates a TypeScript interface for the given reflection class.
142
+ */
143
+ function TSDoc(props) {
144
+ const [{ children, heading }] = splitProps(props, ["children", "heading"]);
145
+ return [
146
+ "/**",
147
+ createIntrinsic("align", {
148
+ string: " * ",
149
+ get children() {
150
+ return [
151
+ createIntrinsic("hbr", {}),
152
+ createComponent(Show, {
153
+ get when() {
154
+ return !isUndefined(heading);
155
+ },
156
+ get children() {
157
+ return [
158
+ heading,
159
+ createIntrinsic("hbr", {}),
160
+ createComponent(Show, {
161
+ get when() {
162
+ return memo(() => !!!isUndefined(children))() && childrenArray(() => children).length > 0;
163
+ },
164
+ get children() {
165
+ return createIntrinsic("hbr", {});
166
+ }
167
+ })
168
+ ];
169
+ }
170
+ }),
171
+ createComponent(Show, {
172
+ get when() {
173
+ return memo(() => !!!isUndefined(children))() && childrenArray(() => children).length > 0;
174
+ },
175
+ get children() {
176
+ return createComponent(List, { get children() {
177
+ return childrenArray(() => children);
178
+ } });
179
+ }
180
+ })
181
+ ];
182
+ }
183
+ }),
184
+ createIntrinsic("hbr", {}),
185
+ ` */`,
186
+ createIntrinsic("hbr", {})
187
+ ];
188
+ }
189
+ /**
190
+ * Create a TSDoc `@<props.tag>` tag.
191
+ */
192
+ function TSDocTag(props) {
193
+ const [{ children, tag }] = splitProps(props, ["children", "tag"]);
194
+ return [
195
+ `@${tag} `,
196
+ createComponent(Show, {
197
+ get when() {
198
+ return Boolean(children);
199
+ },
200
+ get children() {
201
+ return createIntrinsic("align", {
202
+ width: 2,
203
+ get children() {
204
+ return createComponent(Prose, { children });
205
+ }
206
+ });
207
+ }
208
+ }),
209
+ createIntrinsic("hbr", {})
210
+ ];
211
+ }
212
+ /**
213
+ * Create a TSDoc `@title` tag.
214
+ */
215
+ function TSDocTitle(props) {
216
+ const [{ children }, rest] = splitProps(props, ["children"]);
217
+ return createComponent(TSDocTag, mergeProps(rest, {
218
+ tag: "title",
219
+ children
220
+ }));
221
+ }
222
+ /**
223
+ * Create a TSDoc `@domain` tag.
224
+ */
225
+ function TSDocDomain(props) {
226
+ const [{ children }, rest] = splitProps(props, ["children"]);
227
+ return createComponent(TSDocTag, mergeProps(rest, {
228
+ tag: "domain",
229
+ children
230
+ }));
231
+ }
232
+ /**
233
+ * Create a TSDoc `@alias` tag.
234
+ */
235
+ function TSDocAlias(props) {
236
+ const [{ children }, rest] = splitProps(props, ["children"]);
237
+ return createComponent(TSDocTag, mergeProps(rest, {
238
+ tag: "alias",
239
+ children
240
+ }));
241
+ }
242
+ /**
243
+ * Create a TSDoc `@permission` tag.
244
+ */
245
+ function TSDocPermission(props) {
246
+ const [{ children }, rest] = splitProps(props, ["children"]);
247
+ return createComponent(TSDocTag, mergeProps(rest, {
248
+ tag: "permission",
249
+ children
250
+ }));
251
+ }
252
+ /**
253
+ * Create a TSDoc `@defaultValue` tag.
254
+ */
255
+ function TSDocDefaultValue(props) {
256
+ return [
257
+ "@defaultValue ",
258
+ createComponent(Show, {
259
+ get when() {
260
+ return !isUndefined(props.value);
261
+ },
262
+ get children() {
263
+ return createIntrinsic("align", {
264
+ width: 2,
265
+ get children() {
266
+ return createComponent(Prose, { get children() {
267
+ return stringifyDefaultValue(props.value);
268
+ } });
269
+ }
270
+ });
271
+ }
272
+ }),
273
+ createIntrinsic("hbr", {})
274
+ ];
275
+ }
276
+ /**
277
+ * Create a TSDoc `@remarks` tag.
278
+ */
279
+ function TSDocRemarks(props) {
280
+ return [
281
+ "@remarks ",
282
+ createIntrinsic("hbr", {}),
283
+ createComponent(List, {
284
+ hardline: true,
285
+ get children() {
286
+ return childrenArray(() => props.children);
287
+ }
288
+ })
289
+ ];
290
+ }
291
+ /**
292
+ * Create a TSDoc `@see` tag.
293
+ */
294
+ function TSDocLink(props) {
295
+ return createComponent(TSDocTag, mergeProps(props, { tag: "see" }));
296
+ }
297
+ /**
298
+ * Create a TSDoc `@example` tag.
299
+ */
300
+ function TSDocExample(props) {
301
+ const [{ tsx, fenced = true, language, children }] = splitProps(props, [
302
+ "tsx",
303
+ "fenced",
304
+ "language",
305
+ "children"
306
+ ]);
307
+ return [
308
+ "@example ",
309
+ createIntrinsic("hbr", {}),
310
+ createComponent(Show, {
311
+ when: fenced,
312
+ get children() {
313
+ return [
314
+ "```",
315
+ language || (tsx ? "tsx" : "ts"),
316
+ createIntrinsic("hbr", {})
317
+ ];
318
+ }
319
+ }),
320
+ children,
321
+ createComponent(Show, {
322
+ when: fenced,
323
+ get children() {
324
+ return [createIntrinsic("hbr", {}), "```"];
325
+ }
326
+ })
327
+ ];
328
+ }
329
+ /**
330
+ * Create a TSDoc `@readonly` tag.
331
+ */
332
+ function TSDocReadonly() {
333
+ return createComponent(TSDocTag, { tag: "readonly" });
334
+ }
335
+ /**
336
+ * Create a TSDoc `@internal` tag.
337
+ */
338
+ function TSDocInternal() {
339
+ return createComponent(TSDocTag, { tag: "internal" });
340
+ }
341
+ /**
342
+ * Create a TSDoc `@ignore` tag.
343
+ */
344
+ function TSDocIgnore() {
345
+ return createComponent(TSDocTag, { tag: "ignore" });
346
+ }
347
+ /**
348
+ * Create a TSDoc `@hidden` tag.
349
+ */
350
+ function TSDocHidden() {
351
+ return createComponent(TSDocTag, { tag: "hidden" });
352
+ }
353
+ /**
354
+ * Generates a TypeScript interface property for the given reflection class.
355
+ */
356
+ function TSDocAttributesTags(props) {
357
+ const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
358
+ "title",
359
+ "alias",
360
+ "permission",
361
+ "domain",
362
+ "readonly",
363
+ "internal",
364
+ "ignore",
365
+ "hidden",
366
+ "defaultValue"
367
+ ]);
368
+ return [
369
+ createComponent(Show, {
370
+ get when() {
371
+ return isSetString(title);
372
+ },
373
+ get children() {
374
+ return createComponent(TSDocTitle, { children: title });
375
+ }
376
+ }),
377
+ createComponent(Show, {
378
+ get when() {
379
+ return !isUndefined(alias) && alias.length > 0;
380
+ },
381
+ get children() {
382
+ return createComponent(For, {
383
+ each: alias ?? [],
384
+ children: (alias$1) => createComponent(TSDocAlias, { children: alias$1 })
385
+ });
386
+ }
387
+ }),
388
+ createComponent(Show, {
389
+ get when() {
390
+ return isSetString(domain);
391
+ },
392
+ get children() {
393
+ return createComponent(TSDocDomain, { children: domain });
394
+ }
395
+ }),
396
+ createComponent(Show, {
397
+ get when() {
398
+ return !isUndefined(permission) && permission.length > 0;
399
+ },
400
+ get children() {
401
+ return createComponent(For, {
402
+ each: permission ?? [],
403
+ children: (permission$1) => createComponent(TSDocPermission, { children: permission$1 })
404
+ });
405
+ }
406
+ }),
407
+ createComponent(Show, {
408
+ when: readonly === true,
409
+ get children() {
410
+ return createComponent(TSDocReadonly, {});
411
+ }
412
+ }),
413
+ createComponent(Show, {
414
+ when: internal === true,
415
+ get children() {
416
+ return createComponent(TSDocInternal, {});
417
+ }
418
+ }),
419
+ createComponent(Show, {
420
+ when: ignore === true,
421
+ get children() {
422
+ return createComponent(TSDocIgnore, {});
423
+ }
424
+ }),
425
+ createComponent(Show, {
426
+ when: hidden === true,
427
+ get children() {
428
+ return createComponent(TSDocHidden, {});
429
+ }
430
+ }),
431
+ createComponent(Show, {
432
+ get when() {
433
+ return !isUndefined(defaultValue);
434
+ },
435
+ get children() {
436
+ return createComponent(TSDocDefaultValue, { value: defaultValue });
437
+ }
438
+ })
439
+ ];
440
+ }
441
+ /**
442
+ * Create a TSDoc parameter set off with `@param`.
443
+ */
444
+ function TSDocParam(props) {
445
+ return [
446
+ "@param ",
447
+ createComponent(TSDocParamName, {
448
+ get name() {
449
+ return props.name;
450
+ },
451
+ get optional() {
452
+ return props.optional;
453
+ },
454
+ get defaultValue() {
455
+ return props.defaultValue;
456
+ }
457
+ }),
458
+ createComponent(TSDocParamDescription, { get children() {
459
+ return props.children;
460
+ } })
461
+ ];
462
+ }
463
+ function TSDocParamName(props) {
464
+ return [
465
+ createComponent(Show, {
466
+ get when() {
467
+ return props.optional;
468
+ },
469
+ children: "["
470
+ }),
471
+ memo(() => props.name),
472
+ createComponent(Show, {
473
+ get when() {
474
+ return Boolean(props.defaultValue);
475
+ },
476
+ get children() {
477
+ return ["=", memo(() => props.defaultValue)];
478
+ }
479
+ }),
480
+ createComponent(Show, {
481
+ get when() {
482
+ return props.optional;
483
+ },
484
+ children: "]"
485
+ })
486
+ ];
487
+ }
488
+ function TSDocParamDescription(props) {
489
+ return createComponent(Show, {
490
+ get when() {
491
+ return Boolean(props.children);
492
+ },
493
+ get children() {
494
+ return [" - ", createIntrinsic("align", {
495
+ width: 2,
496
+ get children() {
497
+ return createComponent(Prose, { get children() {
498
+ return props.children;
499
+ } });
500
+ }
501
+ })];
502
+ }
503
+ });
504
+ }
505
+ /**
506
+ * Create a TSDoc `@returns` tag.
507
+ */
508
+ function TSDocReturns(props) {
509
+ return createComponent(TSDocTag, mergeProps(props, { tag: "returns" }));
510
+ }
511
+ /**
512
+ * Create a TSDoc `@throws` tag.
513
+ */
514
+ function TSDocThrows(props) {
515
+ return createComponent(TSDocTag, mergeProps(props, { tag: "throws" }));
516
+ }
517
+ /**
518
+ * Generates a TSDoc `@module` tag for the given module name.
519
+ */
520
+ function TSDocModule(props) {
521
+ const [{ children, name, prefix }] = splitProps(props, [
522
+ "children",
523
+ "name",
524
+ "prefix"
525
+ ]);
526
+ const context = usePowerlines();
527
+ return [
528
+ "/**",
529
+ createIntrinsic("align", {
530
+ string: " * ",
531
+ get children() {
532
+ return [
533
+ createIntrinsic("hbr", {}),
534
+ createComponent(Show, {
535
+ get when() {
536
+ return Boolean(children);
537
+ },
538
+ get children() {
539
+ return [
540
+ createComponent(List, {
541
+ hardline: true,
542
+ get children() {
543
+ return childrenArray(() => children);
544
+ }
545
+ }),
546
+ createIntrinsic("hbr", {}),
547
+ createIntrinsic("hbr", {})
548
+ ];
549
+ }
550
+ }),
551
+ "@module ",
552
+ memo(() => prefix || context?.config.output.builtinPrefix),
553
+ ":",
554
+ name
555
+ ];
556
+ }
557
+ }),
558
+ createIntrinsic("hbr", {}),
559
+ ` */`
560
+ ];
561
+ }
562
+
563
+ //#endregion
564
+ //#region ../plugin-alloy/src/core/components/single-line-comment.tsx
565
+ /**
566
+ * A single line comment block. The children are rendered as a prose element, which means that they
567
+ * are broken into multiple lines
568
+ */
569
+ function SingleLineComment(props) {
570
+ const { variant = "double-slash", children } = props;
571
+ const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : "// ";
572
+ return [commentStart, createIntrinsic("align", {
573
+ string: commentStart,
574
+ get children() {
575
+ return [createComponent(Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""];
576
+ }
577
+ })];
578
+ }
579
+
580
+ //#endregion
581
+ //#region ../plugin-alloy/src/core/contexts/reflection.ts
582
+ /**
583
+ * The reflection class context used in template rendering.
584
+ */
585
+ const ReflectionClassContext = createContext();
586
+ /**
587
+ * Hook to access the Reflection context.
588
+ *
589
+ * @returns A reactive version of the current reflection.
590
+ */
591
+ function useReflectionClass() {
592
+ const context = useContext(ReflectionClassContext);
593
+ if (!context) throw new Error("Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
594
+ return context;
595
+ }
596
+ /**
597
+ * The reflection property context used in template rendering.
598
+ */
599
+ const ReflectionPropertyContext = createNamedContext("reflection-property");
600
+ /**
601
+ * Hook to access the Reflection Property context.
602
+ *
603
+ * @returns A reactive version of the current reflection.
604
+ */
605
+ function useReflectionProperty() {
606
+ const context = useContext(ReflectionPropertyContext);
607
+ if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
608
+ return context;
609
+ }
610
+ /**
611
+ * The reflection method context used in template rendering.
612
+ */
613
+ const ReflectionMethodContext = createNamedContext("reflection-method");
614
+ /**
615
+ * The reflection parameter context used in template rendering.
616
+ */
617
+ const ReflectionParameterContext = createNamedContext("reflection-parameter");
618
+
619
+ //#endregion
620
+ //#region ../plugin-alloy/src/core/components/source-file.tsx
621
+ /**
622
+ * A base component representing a Powerlines generated source file.
623
+ *
624
+ * @param props - The properties for the source file.
625
+ * @returns The rendered source file component.
626
+ */
627
+ function SourceFile(props) {
628
+ const [{ children, meta, path, header, storage, filetype, reference }] = splitProps(props, [
629
+ "children",
630
+ "meta",
631
+ "path",
632
+ "header",
633
+ "storage",
634
+ "filetype",
635
+ "reference"
636
+ ]);
637
+ const metadata = useMeta();
638
+ const parentDirectory = useContext(SourceDirectoryContext);
639
+ const sourceFile = {
640
+ path: appendPath(path, parentDirectory.path),
641
+ filetype,
642
+ reference
643
+ };
644
+ parentDirectory?.addContent(sourceFile);
645
+ const printOptions = useFormatOptions({
646
+ printWidth: props.printWidth,
647
+ tabWidth: props.tabWidth,
648
+ useTabs: props.useTabs,
649
+ insertFinalNewLine: props.insertFinalNewLine
650
+ });
651
+ const nodeContext = getContext();
652
+ nodeContext.meta = defu({
653
+ sourceFile,
654
+ printOptions
655
+ }, meta ?? {});
656
+ metadata[sourceFile.path] = {
657
+ storage,
658
+ ...meta ?? {}
659
+ };
660
+ return createComponent(SourceFileContext.Provider, {
661
+ value: sourceFile,
662
+ get children() {
663
+ return [createComponent(Show, {
664
+ when: header !== void 0,
665
+ get children() {
666
+ return [header, createIntrinsic("hbr", {})];
667
+ }
668
+ }), children];
669
+ }
670
+ });
671
+ }
672
+
673
+ //#endregion
674
+ //#region ../plugin-alloy/src/typescript/components/typescript-file.tsx
675
+ /**
676
+ * A base component representing a Powerlines generated Typescript source file.
677
+ *
678
+ * @param props - The properties for the source file.
679
+ * @returns The rendered source file component.
680
+ */
681
+ function TypescriptFile(props) {
682
+ const [{ children, path, imports, tsx, header, hashbang }, rest] = splitProps(props, [
683
+ "children",
684
+ "path",
685
+ "imports",
686
+ "tsx",
687
+ "header",
688
+ "hashbang"
689
+ ]);
690
+ const directoryContext = useContext(SourceDirectoryContext);
691
+ const sdData = getSourceDirectoryData(directoryContext);
692
+ const modulePath = appendPath(path, directoryContext.path);
693
+ const scope = new TSModuleScope(modulePath, useScope());
694
+ sdData.modules.add(scope);
695
+ const pkg = useContext(PackageContext);
696
+ if (pkg) pkg.scope.addModule(scope);
697
+ if (props.export) {
698
+ if (pkg) if (isBoolean(props.export)) pkg.scope.addExport(modulePath, scope);
699
+ else pkg.scope.addExport(props.export, scope);
700
+ }
701
+ return createComponent(SourceFileContext$1.Provider, {
702
+ value: { scope },
703
+ get children() {
704
+ return createComponent(Scope, {
705
+ value: scope,
706
+ get children() {
707
+ return createComponent(SourceFile, mergeProps(rest, {
708
+ path: modulePath,
709
+ get header() {
710
+ return header ?? createComponent(TypescriptFileHeader, {
711
+ hashbang,
712
+ get children() {
713
+ return createComponent(TypescriptFileHeaderImports, {
714
+ imports,
715
+ scope
716
+ });
717
+ }
718
+ });
719
+ },
720
+ filetype: tsx ? "tsx" : "typescript",
721
+ children
722
+ }));
723
+ }
724
+ });
725
+ }
726
+ });
727
+ }
728
+ /**
729
+ * Renders the header for a Powerlines Typescript source file.
730
+ *
731
+ * @param props - The properties for the source file header.
732
+ * @returns The rendered source file header.
733
+ */
734
+ function TypescriptFileHeader(props) {
735
+ const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
736
+ const context = usePowerlines();
737
+ return [
738
+ createComponent(Show, {
739
+ get when() {
740
+ return Boolean(hashbang);
741
+ },
742
+ get children() {
743
+ return [memo(() => hashbang === true ? code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang), createIntrinsic("hbr", {})];
744
+ }
745
+ }),
746
+ createComponent(Show, {
747
+ get when() {
748
+ return Boolean(header);
749
+ },
750
+ get children() {
751
+ return [header, createIntrinsic("hbr", {})];
752
+ }
753
+ }),
754
+ createIntrinsic("hbr", {}),
755
+ createComponent(Show, {
756
+ get when() {
757
+ return Boolean(disableEslint);
758
+ },
759
+ get children() {
760
+ return [createComponent(SingleLineComment, {
761
+ variant: "slash-star",
762
+ children: "eslint-disable"
763
+ }), createIntrinsic("hbr", {})];
764
+ }
765
+ }),
766
+ createComponent(Show, {
767
+ get when() {
768
+ return Boolean(disablePrettier);
769
+ },
770
+ get children() {
771
+ return [createComponent(SingleLineComment, {
772
+ variant: "slash-star",
773
+ children: "prettier-ignore"
774
+ }), createIntrinsic("hbr", {})];
775
+ }
776
+ }),
777
+ createComponent(Show, {
778
+ get when() {
779
+ return Boolean(disableBiome);
780
+ },
781
+ get children() {
782
+ return [createComponent(SingleLineComment, { children: "biome-ignore lint: disable" }), createIntrinsic("hbr", {})];
783
+ }
784
+ }),
785
+ createComponent(Show, {
786
+ get when() {
787
+ return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
788
+ },
789
+ get children() {
790
+ return createIntrinsic("hbr", {});
791
+ }
792
+ }),
793
+ createComponent(Show, {
794
+ get when() {
795
+ return Boolean(children);
796
+ },
797
+ get children() {
798
+ return [children, createIntrinsic("hbr", {})];
799
+ }
800
+ }),
801
+ createComponent(SingleLineComment, { get children() {
802
+ return code`Generated by ${titleCase(context?.config.framework) || "Powerlines"}`;
803
+ } }),
804
+ createIntrinsic("hbr", {}),
805
+ createComponent(SingleLineComment, { children: code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command` }),
806
+ createIntrinsic("hbr", {})
807
+ ];
808
+ }
809
+ /**
810
+ * Renders the header for a Powerlines Typescript source file.
811
+ *
812
+ * @param props - The properties for the source file header.
813
+ * @returns The rendered source file header.
814
+ */
815
+ function TypescriptFileHeaderImports(props) {
816
+ const { imports } = props;
817
+ const context = usePowerlines();
818
+ const sourceFile = useSourceFile();
819
+ const scope = props.scope ?? sourceFile.scope;
820
+ return createComponent(Show, {
821
+ get when() {
822
+ return scope.importedModules.size > 0 || !!imports && Object.keys(imports).length > 0;
823
+ },
824
+ get children() {
825
+ return [
826
+ createComponent(Show, {
827
+ get when() {
828
+ return !!imports && Object.keys(imports).length > 0;
829
+ },
830
+ get children() {
831
+ return Object.entries(imports ?? {}).filter(([key]) => key !== "$builtins").concat(imports && imports.$builtins ? Object.entries(imports.$builtins).map(([key, entry]) => [key.includes(":") ? key : `${context.config.output.builtinPrefix}:${key}`, entry]) : []).map(([module, imported]) => {
832
+ return code`import ${imported === null ? "" : imported.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (imported.filter((i) => !isString(i) && i.default).length > 0 && imported.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (imported.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${imported.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} from "${module}";`;
833
+ });
834
+ }
835
+ }),
836
+ createComponent(Show, {
837
+ get when() {
838
+ return scope.importedModules.size > 0;
839
+ },
840
+ get children() {
841
+ return createComponent(ImportStatements, { get records() {
842
+ return scope.importedModules;
843
+ } });
844
+ }
845
+ }),
846
+ createIntrinsic("hbr", {})
847
+ ];
848
+ }
849
+ });
850
+ }
851
+
852
+ //#endregion
853
+ //#region ../plugin-alloy/src/typescript/components/builtin-file.tsx
854
+ /**
855
+ * A base component representing a Powerlines generated Typescript source file.
856
+ *
857
+ * @param props - The properties for the source file.
858
+ * @returns The rendered source file component.
859
+ */
860
+ function BuiltinFile(props) {
861
+ const [{ children, imports, id, description, tsx }, rest] = splitProps(props, [
862
+ "children",
863
+ "imports",
864
+ "id",
865
+ "description",
866
+ "tsx"
867
+ ]);
868
+ const context = usePowerlines();
869
+ const path = computed(() => replacePath(`${!isSet(tsx) ? id : replaceExtension(id)}${hasFileExtension(id) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context.builtinsPath));
870
+ return createComponent(TypescriptFile, mergeProps({
871
+ get header() {
872
+ return createComponent(TypescriptFileHeader, {
873
+ get header() {
874
+ return createComponent(TSDocModule, {
875
+ name: id,
876
+ children: description
877
+ });
878
+ },
879
+ get children() {
880
+ return createComponent(TypescriptFileHeaderImports, { imports });
881
+ }
882
+ });
883
+ },
884
+ get meta() {
885
+ return {
886
+ kind: "builtin",
887
+ id: replaceExtension(id)
888
+ };
889
+ }
890
+ }, rest, {
891
+ get path() {
892
+ return path.value;
893
+ },
894
+ children
895
+ }));
896
+ }
897
+
898
+ //#endregion
899
+ //#region src/components/react-optimized.tsx
900
+ const isOptimizationEnabledRefkey = refkey$1("isOptimizationEnabled");
901
+ /**
902
+ * Generates the `react/optimized` builtin module for the Powerlines project.
903
+ */
904
+ function ReactOptimizedBuiltin(props) {
905
+ const [{ override }, rest] = splitProps(props, ["override"]);
906
+ return createComponent(BuiltinFile, mergeProps(rest, {
907
+ id: "react/optimized",
908
+ description: "A built-in module to provide access to environment configuration to determine React optimizations.",
909
+ get imports() {
910
+ return defu({ $builtins: { env: ["env", "isDevelopment"] } }, rest.imports ?? {});
911
+ },
912
+ get children() {
913
+ return [createComponent(TSDoc, {
914
+ heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
915
+ get children() {
916
+ return [createComponent(TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), createComponent(TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
917
+ }
918
+ }), createComponent(FunctionDeclaration, {
919
+ refkey: isOptimizationEnabledRefkey,
920
+ async: false,
921
+ "export": true,
922
+ name: "isOptimizationEnabled",
923
+ returnType: "boolean",
924
+ get children() {
925
+ return [createComponent(Show, {
926
+ when: override !== void 0,
927
+ fallback: code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
928
+ children: code`return ${override};`
929
+ }), createIntrinsic("hbr", {})];
930
+ }
931
+ })];
932
+ }
933
+ }));
934
+ }
935
+
936
+ //#endregion
937
+ export { PowerlinesContext as _, useReflectionClass as a, TSDocAttributesTags as c, TSDocParam as d, TSDocRemarks as f, stringifyDefaultValue as g, refkey$1 as h, ReflectionPropertyContext as i, TSDocExample as l, TSDocThrows as m, BuiltinFile as n, useReflectionProperty as o, TSDocReturns as p, ReflectionClassContext as r, TSDoc as s, ReactOptimizedBuiltin as t, TSDocLink as u, usePowerlines as v };