@powerlines/plugin-env 0.15.4 → 0.15.6

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 (264) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/babel/index.cjs +1 -0
  3. package/dist/babel/index.d.cts +1 -0
  4. package/dist/babel/index.d.mts +1 -0
  5. package/dist/babel/index.mjs +3 -0
  6. package/dist/babel/plugin.cjs +200 -0
  7. package/dist/babel/plugin.d.cts +8 -0
  8. package/dist/babel/plugin.d.mts +9 -0
  9. package/dist/babel/plugin.mjs +198 -0
  10. package/dist/components/docs.cjs +70 -3
  11. package/dist/components/docs.d.cts +8 -1
  12. package/dist/components/docs.d.mts +8 -1
  13. package/dist/components/docs.mjs +68 -2
  14. package/dist/components/env.cjs +574 -4
  15. package/dist/components/env.d.cts +19 -2
  16. package/dist/components/env.d.mts +19 -3
  17. package/dist/components/env.mjs +570 -2
  18. package/dist/components/index.cjs +5 -7
  19. package/dist/components/index.d.cts +2 -4
  20. package/dist/components/index.d.mts +2 -5
  21. package/dist/components/index.mjs +2 -4
  22. package/dist/deepkit/schemas/reflection.cjs +5368 -0
  23. package/dist/{plugin-BwuEBScL.d.cts → deepkit/schemas/reflection.d.cts} +1 -268
  24. package/dist/{plugin-BaInAuAh.d.mts → deepkit/schemas/reflection.d.mts} +59 -326
  25. package/dist/deepkit/schemas/reflection.mjs +5365 -0
  26. package/dist/deepkit/schemas/reflection2.cjs +4112 -0
  27. package/dist/deepkit/schemas/reflection2.mjs +4110 -0
  28. package/dist/deepkit/src/capnp.cjs +1692 -0
  29. package/dist/deepkit/src/capnp.mjs +1690 -0
  30. package/dist/deepkit/src/esbuild-plugin.cjs +99 -0
  31. package/dist/deepkit/src/esbuild-plugin.mjs +98 -0
  32. package/dist/deepkit/src/reflect-type.cjs +40 -0
  33. package/dist/deepkit/src/reflect-type.mjs +38 -0
  34. package/dist/deepkit/src/resolve-reflections.cjs +23 -0
  35. package/dist/deepkit/src/resolve-reflections.mjs +22 -0
  36. package/dist/deepkit/src/transformer.cjs +92 -0
  37. package/dist/deepkit/src/transformer.mjs +89 -0
  38. package/dist/deepkit/src/transpile.cjs +39 -0
  39. package/dist/deepkit/src/transpile.mjs +37 -0
  40. package/dist/deepkit/src/types.cjs +22 -0
  41. package/dist/deepkit/src/types.d.cts +10 -0
  42. package/dist/deepkit/src/types.d.mts +10 -0
  43. package/dist/deepkit/src/types.mjs +21 -0
  44. package/dist/deepkit/src/utilities.cjs +182 -0
  45. package/dist/deepkit/src/utilities.mjs +181 -0
  46. package/dist/helpers/automd-generator.cjs +32 -0
  47. package/dist/helpers/automd-generator.mjs +31 -0
  48. package/dist/helpers/create-reflection-resource.cjs +98 -0
  49. package/dist/helpers/create-reflection-resource.d.cts +15 -0
  50. package/dist/helpers/create-reflection-resource.d.mts +15 -0
  51. package/dist/helpers/create-reflection-resource.mjs +97 -0
  52. package/dist/helpers/index.cjs +6 -0
  53. package/dist/helpers/index.d.cts +6 -0
  54. package/dist/helpers/index.d.mts +6 -0
  55. package/dist/helpers/index.mjs +8 -0
  56. package/dist/helpers/load.cjs +134 -0
  57. package/dist/helpers/load.d.cts +35 -0
  58. package/dist/helpers/load.d.mts +36 -0
  59. package/dist/helpers/load.mjs +131 -0
  60. package/dist/helpers/persistence.cjs +320 -0
  61. package/dist/helpers/persistence.d.cts +84 -0
  62. package/dist/helpers/persistence.d.mts +84 -0
  63. package/dist/helpers/persistence.mjs +308 -0
  64. package/dist/helpers/reflect.cjs +263 -0
  65. package/dist/helpers/reflect.d.cts +46 -0
  66. package/dist/helpers/reflect.d.mts +46 -0
  67. package/dist/helpers/reflect.mjs +254 -0
  68. package/dist/helpers/source-file-env.cjs +58 -0
  69. package/dist/helpers/source-file-env.d.cts +8 -0
  70. package/dist/helpers/source-file-env.d.mts +8 -0
  71. package/dist/helpers/source-file-env.mjs +56 -0
  72. package/dist/helpers/template-helpers.cjs +70 -0
  73. package/dist/helpers/template-helpers.d.cts +15 -0
  74. package/dist/helpers/template-helpers.d.mts +15 -0
  75. package/dist/helpers/template-helpers.mjs +69 -0
  76. package/dist/index.cjs +82 -696
  77. package/dist/index.d.cts +16 -185
  78. package/dist/index.d.mts +17 -190
  79. package/dist/index.mjs +31 -648
  80. package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
  81. package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
  82. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
  83. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
  84. package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
  85. package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
  86. package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
  87. package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
  88. package/dist/plugin-alloy/src/core/contexts/context.cjs +136 -0
  89. package/dist/plugin-alloy/src/core/contexts/context.mjs +128 -0
  90. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  91. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  92. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +110 -0
  93. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +101 -0
  94. package/dist/plugin-alloy/src/helpers/refkey.cjs +23 -0
  95. package/dist/plugin-alloy/src/helpers/refkey.mjs +22 -0
  96. package/dist/plugin-alloy/src/index.cjs +93 -0
  97. package/dist/plugin-alloy/src/index.mjs +91 -0
  98. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +115 -0
  99. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +114 -0
  100. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +39 -0
  101. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +38 -0
  102. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +72 -0
  103. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +71 -0
  104. package/dist/plugin-alloy/src/types/components.cjs +22 -0
  105. package/dist/plugin-alloy/src/types/components.d.cts +22 -0
  106. package/dist/{components-8W0Zgj0y.d.mts → plugin-alloy/src/types/components.d.mts} +2 -1
  107. package/dist/plugin-alloy/src/types/components.mjs +21 -0
  108. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  109. package/dist/plugin-alloy/src/types/plugin.cjs +55 -0
  110. package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
  111. package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
  112. package/dist/plugin-alloy/src/types/plugin.mjs +52 -0
  113. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
  114. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
  115. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
  116. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
  117. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
  118. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
  119. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
  120. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
  121. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
  122. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
  123. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
  124. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
  125. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
  126. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
  127. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
  128. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +11 -0
  129. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +12 -0
  130. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
  131. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
  132. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
  133. package/dist/plugin-automd/src/index.cjs +127 -0
  134. package/dist/plugin-automd/src/index.mjs +124 -0
  135. package/dist/plugin-automd/src/types/plugin.cjs +47 -0
  136. package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
  137. package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
  138. package/dist/plugin-automd/src/types/plugin.mjs +47 -0
  139. package/dist/plugin-automd/src/types/toc.cjs +26 -0
  140. package/dist/plugin-automd/src/types/toc.d.cts +33 -0
  141. package/dist/plugin-automd/src/types/toc.d.mts +33 -0
  142. package/dist/plugin-automd/src/types/toc.mjs +25 -0
  143. package/dist/plugin-babel/src/helpers/ast-utils.cjs +74 -0
  144. package/dist/plugin-babel/src/helpers/ast-utils.mjs +70 -0
  145. package/dist/plugin-babel/src/helpers/create-plugin.cjs +71 -0
  146. package/dist/plugin-babel/src/helpers/create-plugin.mjs +69 -0
  147. package/dist/plugin-babel/src/helpers/filters.cjs +158 -0
  148. package/dist/plugin-babel/src/helpers/filters.mjs +154 -0
  149. package/dist/plugin-babel/src/helpers/index.cjs +5 -0
  150. package/dist/plugin-babel/src/helpers/index.mjs +7 -0
  151. package/dist/plugin-babel/src/helpers/module-helpers.cjs +200 -0
  152. package/dist/plugin-babel/src/helpers/module-helpers.mjs +192 -0
  153. package/dist/plugin-babel/src/helpers/options.cjs +74 -0
  154. package/dist/plugin-babel/src/helpers/options.mjs +71 -0
  155. package/dist/plugin-babel/src/index.cjs +134 -0
  156. package/dist/plugin-babel/src/index.mjs +132 -0
  157. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  158. package/dist/plugin-babel/src/types/plugin.cjs +42 -0
  159. package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
  160. package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
  161. package/dist/plugin-babel/src/types/plugin.mjs +39 -0
  162. package/dist/powerlines/schemas/fs.d.mts +1 -0
  163. package/dist/powerlines/src/api.d.mts +7 -0
  164. package/dist/powerlines/src/index.d.mts +12 -0
  165. package/dist/powerlines/src/internal/helpers/hooks.cjs +119 -0
  166. package/dist/powerlines/src/internal/helpers/hooks.d.mts +5 -0
  167. package/dist/powerlines/src/internal/helpers/hooks.mjs +118 -0
  168. package/dist/powerlines/src/lib/build/esbuild.cjs +161 -0
  169. package/dist/powerlines/src/lib/build/esbuild.mjs +159 -0
  170. package/dist/powerlines/src/lib/entry.cjs +203 -0
  171. package/dist/powerlines/src/lib/entry.mjs +201 -0
  172. package/dist/powerlines/src/lib/logger.cjs +108 -0
  173. package/dist/powerlines/src/lib/logger.mjs +106 -0
  174. package/dist/powerlines/src/lib/utilities/bundle.cjs +67 -0
  175. package/dist/powerlines/src/lib/utilities/bundle.mjs +66 -0
  176. package/dist/powerlines/src/lib/utilities/resolve.cjs +49 -0
  177. package/dist/powerlines/src/lib/utilities/resolve.mjs +48 -0
  178. package/dist/powerlines/src/plugin-utils/paths.cjs +46 -0
  179. package/dist/powerlines/src/plugin-utils/paths.mjs +45 -0
  180. package/dist/powerlines/src/types/api.cjs +1 -0
  181. package/dist/powerlines/src/types/api.d.mts +5 -0
  182. package/dist/powerlines/src/types/api.mjs +3 -0
  183. package/dist/powerlines/src/types/babel.cjs +156 -0
  184. package/dist/powerlines/src/types/babel.d.cts +23 -0
  185. package/dist/powerlines/src/types/babel.d.mts +23 -0
  186. package/dist/powerlines/src/types/babel.mjs +147 -0
  187. package/dist/powerlines/src/types/build.cjs +105 -0
  188. package/dist/powerlines/src/types/build.d.cts +145 -0
  189. package/dist/powerlines/src/types/build.d.mts +147 -0
  190. package/dist/powerlines/src/types/build.mjs +101 -0
  191. package/dist/powerlines/src/types/commands.cjs +16 -0
  192. package/dist/powerlines/src/types/commands.d.cts +8 -0
  193. package/dist/powerlines/src/types/commands.d.mts +9 -0
  194. package/dist/powerlines/src/types/commands.mjs +15 -0
  195. package/dist/powerlines/src/types/config.cjs +306 -0
  196. package/dist/powerlines/src/types/config.d.cts +387 -0
  197. package/dist/powerlines/src/types/config.d.mts +388 -0
  198. package/dist/powerlines/src/types/config.mjs +293 -0
  199. package/dist/powerlines/src/types/context.cjs +324 -0
  200. package/dist/powerlines/src/types/context.d.cts +414 -0
  201. package/dist/powerlines/src/types/context.d.mts +416 -0
  202. package/dist/powerlines/src/types/context.mjs +311 -0
  203. package/dist/powerlines/src/types/fs.cjs +78 -0
  204. package/dist/powerlines/src/types/fs.d.cts +486 -0
  205. package/dist/powerlines/src/types/fs.d.mts +486 -0
  206. package/dist/powerlines/src/types/fs.mjs +75 -0
  207. package/dist/powerlines/src/types/hooks.cjs +52 -0
  208. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  209. package/dist/powerlines/src/types/hooks.mjs +48 -0
  210. package/dist/powerlines/src/types/index.cjs +11 -0
  211. package/dist/powerlines/src/types/index.d.mts +12 -0
  212. package/dist/powerlines/src/types/index.mjs +13 -0
  213. package/dist/powerlines/src/types/plugin.cjs +249 -0
  214. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  215. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  216. package/dist/powerlines/src/types/plugin.mjs +240 -0
  217. package/dist/powerlines/src/types/resolved.cjs +153 -0
  218. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  219. package/dist/powerlines/src/types/resolved.d.mts +83 -0
  220. package/dist/powerlines/src/types/resolved.mjs +148 -0
  221. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  222. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  223. package/dist/powerlines/src/types/unplugin.cjs +1 -0
  224. package/dist/powerlines/src/types/unplugin.d.mts +7 -0
  225. package/dist/powerlines/src/types/unplugin.mjs +3 -0
  226. package/dist/types/index.cjs +10 -3
  227. package/dist/types/index.d.cts +2 -4
  228. package/dist/types/index.d.mts +2 -5
  229. package/dist/types/index.mjs +3 -4
  230. package/dist/types/plugin.cjs +133 -1
  231. package/dist/types/plugin.d.cts +156 -3
  232. package/dist/types/plugin.d.mts +158 -4
  233. package/dist/types/plugin.mjs +128 -2
  234. package/dist/types/runtime.cjs +242 -1
  235. package/dist/types/runtime.d.cts +793 -2
  236. package/dist/types/runtime.d.mts +793 -2
  237. package/dist/types/runtime.mjs +240 -2
  238. package/package.json +13 -9
  239. package/dist/components-C9bYrQVK.cjs +0 -0
  240. package/dist/components-CNIQFfeK.mjs +0 -1
  241. package/dist/create-reflection-resource-BNYxBgW2.mjs +0 -9846
  242. package/dist/create-reflection-resource-BWYhmX7O.cjs +0 -10085
  243. package/dist/docs-5r844zC1.d.mts +0 -9
  244. package/dist/docs-B66b9li3.mjs +0 -219
  245. package/dist/docs-_MmTNBQX.d.cts +0 -9
  246. package/dist/docs-hBlKCRWK.cjs +0 -224
  247. package/dist/env-BPodCdD1.d.cts +0 -116
  248. package/dist/env-IQvgnabX.mjs +0 -1578
  249. package/dist/env-cO4BUDn1.cjs +0 -1596
  250. package/dist/env-zhzvpUI5.d.mts +0 -98
  251. package/dist/index-BXxhKmeA.d.mts +0 -1
  252. package/dist/index-Cc7fCJU9.d.mts +0 -1
  253. package/dist/index-CqdNToYT.d.cts +0 -1
  254. package/dist/index-DWPDThxu.d.cts +0 -1
  255. package/dist/plugin-D3B5E_Hg.mjs +0 -1
  256. package/dist/plugin-D5qyQPqC.cjs +0 -0
  257. package/dist/resolved-BZG2cwRG.d.cts +0 -1789
  258. package/dist/resolved-V5COsfDu.d.mts +0 -1791
  259. package/dist/runtime-Bisl_1Ja.cjs +0 -0
  260. package/dist/runtime-Q8Ni8SeN.d.cts +0 -794
  261. package/dist/runtime-azNoeKr-.mjs +0 -1
  262. package/dist/runtime-qZ0Z2kEd.d.mts +0 -794
  263. package/dist/types-DwElXV6q.mjs +0 -1
  264. package/dist/types-MYBaygjr.cjs +0 -0
@@ -0,0 +1,182 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
3
+ let __stryke_json_storm_json = require("@stryke/json/storm-json");
4
+ let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
5
+ let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
6
+ let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
7
+ let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
8
+
9
+ //#region ../deepkit/src/utilities.ts
10
+ function __assignType(fn, args) {
11
+ fn.__type = args;
12
+ return fn;
13
+ }
14
+ /**
15
+ * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
16
+ *
17
+ * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
18
+ * @param value - The value to stringify.
19
+ * @returns A string representation of the value.
20
+ */
21
+ function stringifyDefaultValue(property, value) {
22
+ return stringifyValue(property.type, value ?? property.getDefaultValue());
23
+ }
24
+ stringifyDefaultValue.__type = [
25
+ () => __powerlines_deepkit_vendor_type.ReflectionProperty,
26
+ () => __powerlines_deepkit_vendor_type.ReflectionParameter,
27
+ "property",
28
+ "value",
29
+ "stringifyDefaultValue",
30
+ "Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.",
31
+ "PPP7!P7\"J2#\"2$8&/%?&"
32
+ ];
33
+ /**
34
+ * Stringifies a value as a string.
35
+ *
36
+ * @param value - The value to stringify.
37
+ * @returns A string representation of the value.
38
+ */
39
+ function stringifyStringValue(value) {
40
+ return `"${String(value).replaceAll("\"", "\\\"")}"`;
41
+ }
42
+ stringifyStringValue.__type = [
43
+ "value",
44
+ "stringifyStringValue",
45
+ "Stringifies a value as a string.",
46
+ "P\"2!8&/\"?#"
47
+ ];
48
+ /**
49
+ * Converts any {@link Type}'s actual value to string representation.
50
+ *
51
+ * @param type - The {@link Type} of the value to stringify.
52
+ * @param value - The value to stringify.
53
+ * @returns A string representation of the value.
54
+ */
55
+ function stringifyValue(type, value) {
56
+ return (0, __stryke_type_checks_is_undefined.isUndefined)(value) ? "undefined" : (0, __stryke_type_checks_is_null.isNull)(value) ? "null" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && (0, __stryke_type_checks_is_string.isString)(type.literal) ? stringifyStringValue(value) : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum ? getEnumReflectionType(type).kind === __powerlines_deepkit_vendor_type.ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union ? isStringUnion(type) ? stringifyStringValue(value) : `${String(value)}` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array ? stringifyStringValue(__stryke_json_storm_json.StormJSON.stringify(value)) : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.object || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral ? __stryke_json_storm_json.StormJSON.stringify(value) : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.property || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.parameter ? stringifyValue(type.type, value) : String(value);
57
+ }
58
+ stringifyValue.__type = [
59
+ "Type",
60
+ "type",
61
+ "value",
62
+ "stringifyValue",
63
+ "Converts any {@link Type}'s actual value to string representation.",
64
+ "P\"w!2\"\"2#&/$?%"
65
+ ];
66
+ /**
67
+ * Converts a {@link TypeEnum} to its underlying primitive type representation.
68
+ *
69
+ * @param type - The {@link TypeEnum} to evaluate.
70
+ * @returns A string representation of the primitive type.
71
+ */
72
+ function getEnumReflectionType(type) {
73
+ if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
74
+ const unique = (0, __stryke_helpers_get_unique.getUniqueBy)(type.values.filter(__assignType((value) => value !== void 0 && value !== null, [
75
+ "value",
76
+ "",
77
+ "P\"2!\"/\""
78
+ ])), __assignType((enumMember) => (0, __stryke_type_checks_is_string.isString)(enumMember) ? { kind: __powerlines_deepkit_vendor_type.ReflectionKind.string } : { kind: __powerlines_deepkit_vendor_type.ReflectionKind.number }, [
79
+ "enumMember",
80
+ "",
81
+ "P\"2!\"/\""
82
+ ]));
83
+ if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
84
+ return unique[0] && (0, __stryke_type_checks_is_string.isString)(unique[0]) ? { kind: __powerlines_deepkit_vendor_type.ReflectionKind.string } : { kind: __powerlines_deepkit_vendor_type.ReflectionKind.number };
85
+ }
86
+ getEnumReflectionType.__type = [
87
+ "Type",
88
+ "type",
89
+ () => __powerlines_deepkit_vendor_type.__ΩTypeString,
90
+ () => __powerlines_deepkit_vendor_type.__ΩTypeNumber,
91
+ "getEnumReflectionType",
92
+ "Converts a {@link TypeEnum} to its underlying primitive type representation.",
93
+ "P\"w!2\"Pn#n$J/%?&"
94
+ ];
95
+ /**
96
+ * Converts a {@link TypeUnion} to its underlying primitive type representation.
97
+ *
98
+ * @param type - The {@link TypeUnion} to evaluate.
99
+ * @returns A string representation of the primitive type.
100
+ */
101
+ function getUnionTypes(type) {
102
+ if (type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union && type.types.length > 0) return (0, __stryke_helpers_get_unique.getUniqueBy)(type.types, __assignType((member) => member.kind, [
103
+ "member",
104
+ "",
105
+ "P\"2!\"/\""
106
+ ]));
107
+ throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
108
+ }
109
+ getUnionTypes.__type = [
110
+ "Type",
111
+ "type",
112
+ "getUnionTypes",
113
+ "Converts a {@link TypeUnion} to its underlying primitive type representation.",
114
+ "P\"w!2\"\"w!F/#?$"
115
+ ];
116
+ function isStringUnion(type) {
117
+ return getUnionTypes(type).some(__assignType((member) => member.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || member.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && (0, __stryke_type_checks_is_string.isString)(member.literal), [
118
+ "member",
119
+ "",
120
+ "P\"2!\"/\""
121
+ ]));
122
+ }
123
+ isStringUnion.__type = [
124
+ "Type",
125
+ "type",
126
+ "isStringUnion",
127
+ "P\"w!2\")/#"
128
+ ];
129
+ /**
130
+ * Converts a ReflectionKind to its string representation.
131
+ *
132
+ * @param kind - The {@link ReflectionKind} to convert.
133
+ * @returns A string representation of the kind.
134
+ */
135
+ function kindToName(kind) {
136
+ if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.void) return "void";
137
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.never) return "never";
138
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.null) return "null";
139
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.undefined) return "undefined";
140
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.symbol) return "symbol";
141
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.bigint) return "bigint";
142
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) return "number";
143
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.string) return "string";
144
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean) return "boolean";
145
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal) return "literal";
146
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.class) return "class";
147
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.array) return "array";
148
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.object) return "object";
149
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral) return "objectLiteral";
150
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.union) return "union";
151
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum) return "enum";
152
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.regexp) return "regexp";
153
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.templateLiteral) return "templateLiteral";
154
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.property) return "property";
155
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.method) return "method";
156
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.function) return "function";
157
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.parameter) return "parameter";
158
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.promise) return "promise";
159
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.typeParameter) return "typeParameter";
160
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.tuple) return "tuple";
161
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.tupleMember) return "tupleMember";
162
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.enumMember) return "enumMember";
163
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.rest) return "rest";
164
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.indexSignature) return "indexSignature";
165
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.propertySignature) return "propertySignature";
166
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.methodSignature) return "methodSignature";
167
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.infer) return "infer";
168
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.callSignature) return "callSignature";
169
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.any) return "any";
170
+ else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.intersection) return "intersection";
171
+ return "unknown";
172
+ }
173
+ kindToName.__type = [
174
+ () => __powerlines_deepkit_vendor_type.__ΩReflectionKind,
175
+ "kind",
176
+ "kindToName",
177
+ "Converts a ReflectionKind to its string representation.",
178
+ "Pn!2\"&/#?$"
179
+ ];
180
+
181
+ //#endregion
182
+ exports.stringifyDefaultValue = stringifyDefaultValue;
@@ -0,0 +1,181 @@
1
+ import { ReflectionKind, ReflectionParameter, ReflectionProperty, __ΩReflectionKind, __ΩTypeNumber, __ΩTypeString } from "@powerlines/deepkit/vendor/type";
2
+ import { StormJSON } from "@stryke/json/storm-json";
3
+ import { isString } from "@stryke/type-checks/is-string";
4
+ import { getUniqueBy } from "@stryke/helpers/get-unique";
5
+ import { isNull } from "@stryke/type-checks/is-null";
6
+ import { isUndefined } from "@stryke/type-checks/is-undefined";
7
+
8
+ //#region ../deepkit/src/utilities.ts
9
+ function __assignType(fn, args) {
10
+ fn.__type = args;
11
+ return fn;
12
+ }
13
+ /**
14
+ * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
15
+ *
16
+ * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
17
+ * @param value - The value to stringify.
18
+ * @returns A string representation of the value.
19
+ */
20
+ function stringifyDefaultValue(property, value) {
21
+ return stringifyValue(property.type, value ?? property.getDefaultValue());
22
+ }
23
+ stringifyDefaultValue.__type = [
24
+ () => ReflectionProperty,
25
+ () => ReflectionParameter,
26
+ "property",
27
+ "value",
28
+ "stringifyDefaultValue",
29
+ "Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.",
30
+ "PPP7!P7\"J2#\"2$8&/%?&"
31
+ ];
32
+ /**
33
+ * Stringifies a value as a string.
34
+ *
35
+ * @param value - The value to stringify.
36
+ * @returns A string representation of the value.
37
+ */
38
+ function stringifyStringValue(value) {
39
+ return `"${String(value).replaceAll("\"", "\\\"")}"`;
40
+ }
41
+ stringifyStringValue.__type = [
42
+ "value",
43
+ "stringifyStringValue",
44
+ "Stringifies a value as a string.",
45
+ "P\"2!8&/\"?#"
46
+ ];
47
+ /**
48
+ * Converts any {@link Type}'s actual value to string representation.
49
+ *
50
+ * @param type - The {@link Type} of the value to stringify.
51
+ * @param value - The value to stringify.
52
+ * @returns A string representation of the value.
53
+ */
54
+ function stringifyValue(type, value) {
55
+ 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);
56
+ }
57
+ stringifyValue.__type = [
58
+ "Type",
59
+ "type",
60
+ "value",
61
+ "stringifyValue",
62
+ "Converts any {@link Type}'s actual value to string representation.",
63
+ "P\"w!2\"\"2#&/$?%"
64
+ ];
65
+ /**
66
+ * Converts a {@link TypeEnum} to its underlying primitive type representation.
67
+ *
68
+ * @param type - The {@link TypeEnum} to evaluate.
69
+ * @returns A string representation of the primitive type.
70
+ */
71
+ function getEnumReflectionType(type) {
72
+ if (type.kind !== ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
73
+ const unique = getUniqueBy(type.values.filter(__assignType((value) => value !== void 0 && value !== null, [
74
+ "value",
75
+ "",
76
+ "P\"2!\"/\""
77
+ ])), __assignType((enumMember) => isString(enumMember) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number }, [
78
+ "enumMember",
79
+ "",
80
+ "P\"2!\"/\""
81
+ ]));
82
+ if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
83
+ return unique[0] && isString(unique[0]) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number };
84
+ }
85
+ getEnumReflectionType.__type = [
86
+ "Type",
87
+ "type",
88
+ () => __ΩTypeString,
89
+ () => __ΩTypeNumber,
90
+ "getEnumReflectionType",
91
+ "Converts a {@link TypeEnum} to its underlying primitive type representation.",
92
+ "P\"w!2\"Pn#n$J/%?&"
93
+ ];
94
+ /**
95
+ * Converts a {@link TypeUnion} to its underlying primitive type representation.
96
+ *
97
+ * @param type - The {@link TypeUnion} to evaluate.
98
+ * @returns A string representation of the primitive type.
99
+ */
100
+ function getUnionTypes(type) {
101
+ if (type.kind === ReflectionKind.union && type.types.length > 0) return getUniqueBy(type.types, __assignType((member) => member.kind, [
102
+ "member",
103
+ "",
104
+ "P\"2!\"/\""
105
+ ]));
106
+ throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
107
+ }
108
+ getUnionTypes.__type = [
109
+ "Type",
110
+ "type",
111
+ "getUnionTypes",
112
+ "Converts a {@link TypeUnion} to its underlying primitive type representation.",
113
+ "P\"w!2\"\"w!F/#?$"
114
+ ];
115
+ function isStringUnion(type) {
116
+ return getUnionTypes(type).some(__assignType((member) => member.kind === ReflectionKind.string || member.kind === ReflectionKind.literal && isString(member.literal), [
117
+ "member",
118
+ "",
119
+ "P\"2!\"/\""
120
+ ]));
121
+ }
122
+ isStringUnion.__type = [
123
+ "Type",
124
+ "type",
125
+ "isStringUnion",
126
+ "P\"w!2\")/#"
127
+ ];
128
+ /**
129
+ * Converts a ReflectionKind to its string representation.
130
+ *
131
+ * @param kind - The {@link ReflectionKind} to convert.
132
+ * @returns A string representation of the kind.
133
+ */
134
+ function kindToName(kind) {
135
+ if (kind === ReflectionKind.void) return "void";
136
+ else if (kind === ReflectionKind.never) return "never";
137
+ else if (kind === ReflectionKind.null) return "null";
138
+ else if (kind === ReflectionKind.undefined) return "undefined";
139
+ else if (kind === ReflectionKind.symbol) return "symbol";
140
+ else if (kind === ReflectionKind.bigint) return "bigint";
141
+ else if (kind === ReflectionKind.number) return "number";
142
+ else if (kind === ReflectionKind.string) return "string";
143
+ else if (kind === ReflectionKind.boolean) return "boolean";
144
+ else if (kind === ReflectionKind.literal) return "literal";
145
+ else if (kind === ReflectionKind.class) return "class";
146
+ else if (kind === ReflectionKind.array) return "array";
147
+ else if (kind === ReflectionKind.object) return "object";
148
+ else if (kind === ReflectionKind.objectLiteral) return "objectLiteral";
149
+ else if (kind === ReflectionKind.union) return "union";
150
+ else if (kind === ReflectionKind.enum) return "enum";
151
+ else if (kind === ReflectionKind.regexp) return "regexp";
152
+ else if (kind === ReflectionKind.templateLiteral) return "templateLiteral";
153
+ else if (kind === ReflectionKind.property) return "property";
154
+ else if (kind === ReflectionKind.method) return "method";
155
+ else if (kind === ReflectionKind.function) return "function";
156
+ else if (kind === ReflectionKind.parameter) return "parameter";
157
+ else if (kind === ReflectionKind.promise) return "promise";
158
+ else if (kind === ReflectionKind.typeParameter) return "typeParameter";
159
+ else if (kind === ReflectionKind.tuple) return "tuple";
160
+ else if (kind === ReflectionKind.tupleMember) return "tupleMember";
161
+ else if (kind === ReflectionKind.enumMember) return "enumMember";
162
+ else if (kind === ReflectionKind.rest) return "rest";
163
+ else if (kind === ReflectionKind.indexSignature) return "indexSignature";
164
+ else if (kind === ReflectionKind.propertySignature) return "propertySignature";
165
+ else if (kind === ReflectionKind.methodSignature) return "methodSignature";
166
+ else if (kind === ReflectionKind.infer) return "infer";
167
+ else if (kind === ReflectionKind.callSignature) return "callSignature";
168
+ else if (kind === ReflectionKind.any) return "any";
169
+ else if (kind === ReflectionKind.intersection) return "intersection";
170
+ return "unknown";
171
+ }
172
+ kindToName.__type = [
173
+ () => __ΩReflectionKind,
174
+ "kind",
175
+ "kindToName",
176
+ "Converts a ReflectionKind to its string representation.",
177
+ "Pn!2\"&/#?$"
178
+ ];
179
+
180
+ //#endregion
181
+ export { stringifyDefaultValue };
@@ -0,0 +1,32 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_context = require('../powerlines/src/types/context.cjs');
3
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
4
+ let automd = require("automd");
5
+
6
+ //#region src/helpers/automd-generator.ts
7
+ function __assignType(fn, args) {
8
+ fn.__type = args;
9
+ return fn;
10
+ }
11
+ /**
12
+ * AutoMD generator to generate environment variable documentation
13
+ *
14
+ * @param context - The generator context.
15
+ * @returns The generated documentation content.
16
+ */
17
+ const env = __assignType((context) => (0, automd.defineGenerator)({
18
+ name: "env",
19
+ generate: __assignType(async function generate() {
20
+ const envDocFile = (0, __stryke_path_join_paths.joinPaths)(context.config.projectRoot, "docs", "generated", "env.md");
21
+ if (!context.fs.existsSync(envDocFile)) return { contents: "" };
22
+ return { contents: await context.fs.read(envDocFile) || "" };
23
+ }, ["generate", "P\"/!"])
24
+ }), [
25
+ () => require_context.__ΩUnresolvedContext,
26
+ "context",
27
+ "",
28
+ "Pn!2\"\"/#"
29
+ ]);
30
+
31
+ //#endregion
32
+ exports.env = env;
@@ -0,0 +1,31 @@
1
+ import { __ΩUnresolvedContext } from "../powerlines/src/types/context.mjs";
2
+ import { joinPaths } from "@stryke/path/join-paths";
3
+ import { defineGenerator } from "automd";
4
+
5
+ //#region src/helpers/automd-generator.ts
6
+ function __assignType(fn, args) {
7
+ fn.__type = args;
8
+ return fn;
9
+ }
10
+ /**
11
+ * AutoMD generator to generate environment variable documentation
12
+ *
13
+ * @param context - The generator context.
14
+ * @returns The generated documentation content.
15
+ */
16
+ const env = __assignType((context) => defineGenerator({
17
+ name: "env",
18
+ generate: __assignType(async function generate() {
19
+ const envDocFile = joinPaths(context.config.projectRoot, "docs", "generated", "env.md");
20
+ if (!context.fs.existsSync(envDocFile)) return { contents: "" };
21
+ return { contents: await context.fs.read(envDocFile) || "" };
22
+ }, ["generate", "P\"/!"])
23
+ }), [
24
+ () => __ΩUnresolvedContext,
25
+ "context",
26
+ "",
27
+ "Pn!2\"\"/#"
28
+ ]);
29
+
30
+ //#endregion
31
+ export { env };
@@ -0,0 +1,98 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_types_plugin = require('../types/plugin.cjs');
3
+ const require_persistence = require('./persistence.cjs');
4
+ const require_load = require('./load.cjs');
5
+ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
6
+ let __alloy_js_core = require("@alloy-js/core");
7
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
8
+
9
+ //#region src/helpers/create-reflection-resource.ts
10
+ const __ΩRecord = [
11
+ "K",
12
+ "T",
13
+ "Record",
14
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
15
+ ];
16
+ function __assignType(fn, args) {
17
+ fn.__type = args;
18
+ return fn;
19
+ }
20
+ /**
21
+ * Creates a reflection resource for the environment configuration.
22
+ *
23
+ * @param context - The environment plugin context.
24
+ * @returns A resource that provides the reflection of the environment configuration.
25
+ */
26
+ function createReflectionResource(context) {
27
+ const defaultValue = (0, __alloy_js_core.computed)(() => context && require_load.loadEnvFromContext(context, process.env));
28
+ return __alloy_js_core.createResource.Ω = [[
29
+ () => __ΩRecord,
30
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
31
+ "P&\"o!#7\""
32
+ ]], (0, __alloy_js_core.createResource)(async () => {
33
+ if (!context) return new __powerlines_deepkit_vendor_type.ReflectionClass({
34
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
35
+ description: `The initial environment configuration state for the Powerlines project.`,
36
+ types: []
37
+ });
38
+ const result = await require_persistence.readEnvTypeReflection(context, "env");
39
+ result.getProperties().forEach(__assignType((prop) => {
40
+ prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
41
+ result.addProperty({
42
+ name: alias,
43
+ optional: prop.isOptional() ? true : void 0,
44
+ readonly: prop.isReadonly() ? true : void 0,
45
+ description: prop.getDescription(),
46
+ visibility: prop.getVisibility(),
47
+ type: prop.getType(),
48
+ default: prop.getDefaultValue(),
49
+ tags: {
50
+ hidden: prop.isHidden(),
51
+ ignore: prop.isIgnored(),
52
+ internal: prop.isInternal(),
53
+ alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
54
+ "a",
55
+ "",
56
+ "P\"2!\"/\""
57
+ ])).concat(prop.name),
58
+ title: prop.getTitle() || (0, __stryke_string_format_title_case.titleCase)(prop.name),
59
+ readonly: prop.isReadonly(),
60
+ permission: prop.getPermission(),
61
+ domain: prop.getDomain()
62
+ }
63
+ });
64
+ }, [
65
+ "alias",
66
+ "",
67
+ "P\"2!\"/\""
68
+ ]));
69
+ }, [
70
+ "prop",
71
+ "",
72
+ "P\"2!\"/\""
73
+ ]));
74
+ result.getProperties().forEach(__assignType((prop) => {
75
+ prop.setDefaultValue(defaultValue.value?.[prop.getNameAsString()] ?? prop.getAlias().reduce(__assignType((ret, alias) => ret ?? defaultValue.value?.[alias], [
76
+ "ret",
77
+ "alias",
78
+ "",
79
+ "P\"2!\"2\"\"/#"
80
+ ]), void 0) ?? prop.getDefaultValue());
81
+ }, [
82
+ "prop",
83
+ "",
84
+ "P\"2!\"/\""
85
+ ]));
86
+ return result;
87
+ });
88
+ }
89
+ createReflectionResource.__type = [
90
+ () => require_types_plugin.__ΩEnvPluginContext,
91
+ "context",
92
+ "createReflectionResource",
93
+ "Creates a reflection resource for the environment configuration.",
94
+ "Pn!2\"8\"/#?$"
95
+ ];
96
+
97
+ //#endregion
98
+ exports.createReflectionResource = createReflectionResource;
@@ -0,0 +1,15 @@
1
+ import { EnvPluginContext } from "../types/plugin.cjs";
2
+ import * as _alloy_js_core3 from "@alloy-js/core";
3
+ import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
4
+
5
+ //#region src/helpers/create-reflection-resource.d.ts
6
+
7
+ /**
8
+ * Creates a reflection resource for the environment configuration.
9
+ *
10
+ * @param context - The environment plugin context.
11
+ * @returns A resource that provides the reflection of the environment configuration.
12
+ */
13
+ declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core3.Resource<ReflectionClass<Record<string, any>>>;
14
+ //#endregion
15
+ export { createReflectionResource };
@@ -0,0 +1,15 @@
1
+ import { EnvPluginContext } from "../types/plugin.mjs";
2
+ import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
3
+ import * as _alloy_js_core4 from "@alloy-js/core";
4
+
5
+ //#region src/helpers/create-reflection-resource.d.ts
6
+
7
+ /**
8
+ * Creates a reflection resource for the environment configuration.
9
+ *
10
+ * @param context - The environment plugin context.
11
+ * @returns A resource that provides the reflection of the environment configuration.
12
+ */
13
+ declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core4.Resource<ReflectionClass<Record<string, any>>>;
14
+ //#endregion
15
+ export { createReflectionResource };
@@ -0,0 +1,97 @@
1
+ import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
+ import { readEnvTypeReflection } from "./persistence.mjs";
3
+ import { loadEnvFromContext } from "./load.mjs";
4
+ import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
5
+ import { computed, createResource } from "@alloy-js/core";
6
+ import { titleCase } from "@stryke/string-format/title-case";
7
+
8
+ //#region src/helpers/create-reflection-resource.ts
9
+ const __ΩRecord = [
10
+ "K",
11
+ "T",
12
+ "Record",
13
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
14
+ ];
15
+ function __assignType(fn, args) {
16
+ fn.__type = args;
17
+ return fn;
18
+ }
19
+ /**
20
+ * Creates a reflection resource for the environment configuration.
21
+ *
22
+ * @param context - The environment plugin context.
23
+ * @returns A resource that provides the reflection of the environment configuration.
24
+ */
25
+ function createReflectionResource(context) {
26
+ const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
27
+ return createResource.Ω = [[
28
+ () => __ΩRecord,
29
+ () => ReflectionClass,
30
+ "P&\"o!#7\""
31
+ ]], createResource(async () => {
32
+ if (!context) return new ReflectionClass({
33
+ kind: ReflectionKind.objectLiteral,
34
+ description: `The initial environment configuration state for the Powerlines project.`,
35
+ types: []
36
+ });
37
+ const result = await readEnvTypeReflection(context, "env");
38
+ result.getProperties().forEach(__assignType((prop) => {
39
+ prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
40
+ result.addProperty({
41
+ name: alias,
42
+ optional: prop.isOptional() ? true : void 0,
43
+ readonly: prop.isReadonly() ? true : void 0,
44
+ description: prop.getDescription(),
45
+ visibility: prop.getVisibility(),
46
+ type: prop.getType(),
47
+ default: prop.getDefaultValue(),
48
+ tags: {
49
+ hidden: prop.isHidden(),
50
+ ignore: prop.isIgnored(),
51
+ internal: prop.isInternal(),
52
+ alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
53
+ "a",
54
+ "",
55
+ "P\"2!\"/\""
56
+ ])).concat(prop.name),
57
+ title: prop.getTitle() || titleCase(prop.name),
58
+ readonly: prop.isReadonly(),
59
+ permission: prop.getPermission(),
60
+ domain: prop.getDomain()
61
+ }
62
+ });
63
+ }, [
64
+ "alias",
65
+ "",
66
+ "P\"2!\"/\""
67
+ ]));
68
+ }, [
69
+ "prop",
70
+ "",
71
+ "P\"2!\"/\""
72
+ ]));
73
+ result.getProperties().forEach(__assignType((prop) => {
74
+ prop.setDefaultValue(defaultValue.value?.[prop.getNameAsString()] ?? prop.getAlias().reduce(__assignType((ret, alias) => ret ?? defaultValue.value?.[alias], [
75
+ "ret",
76
+ "alias",
77
+ "",
78
+ "P\"2!\"2\"\"/#"
79
+ ]), void 0) ?? prop.getDefaultValue());
80
+ }, [
81
+ "prop",
82
+ "",
83
+ "P\"2!\"/\""
84
+ ]));
85
+ return result;
86
+ });
87
+ }
88
+ createReflectionResource.__type = [
89
+ () => __ΩEnvPluginContext,
90
+ "context",
91
+ "createReflectionResource",
92
+ "Creates a reflection resource for the environment configuration.",
93
+ "Pn!2\"8\"/#?$"
94
+ ];
95
+
96
+ //#endregion
97
+ export { createReflectionResource };
@@ -0,0 +1,6 @@
1
+ const require_reflect = require('./reflect.cjs');
2
+ const require_persistence = require('./persistence.cjs');
3
+ const require_source_file_env = require('./source-file-env.cjs');
4
+ const require_load = require('./load.cjs');
5
+ const require_create_reflection_resource = require('./create-reflection-resource.cjs');
6
+ const require_template_helpers = require('./template-helpers.cjs');
@@ -0,0 +1,6 @@
1
+ import { createReflectionResource } from "./create-reflection-resource.cjs";
2
+ import { loadEnv, loadEnvFromContext } from "./load.cjs";
3
+ import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.cjs";
4
+ import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.cjs";
5
+ import { formatEnvField, removeEnvPrefix } from "./source-file-env.cjs";
6
+ import { createTemplateReflection } from "./template-helpers.cjs";