@powerlines/plugin-env 0.15.2 → 0.15.4

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 (231) hide show
  1. package/dist/components/docs.cjs +3 -70
  2. package/dist/components/docs.d.cts +1 -8
  3. package/dist/components/docs.d.mts +1 -8
  4. package/dist/components/docs.mjs +2 -68
  5. package/dist/components/env.cjs +4 -574
  6. package/dist/components/env.d.cts +2 -19
  7. package/dist/components/env.d.mts +3 -19
  8. package/dist/components/env.mjs +2 -570
  9. package/dist/components/index.cjs +7 -5
  10. package/dist/components/index.d.cts +4 -2
  11. package/dist/components/index.d.mts +5 -2
  12. package/dist/components/index.mjs +4 -2
  13. package/dist/{plugin-alloy/src/types/components.d.cts → components-8W0Zgj0y.d.mts} +2 -1
  14. package/dist/components-C9bYrQVK.cjs +0 -0
  15. package/dist/components-CNIQFfeK.mjs +1 -0
  16. package/dist/create-reflection-resource-BNYxBgW2.mjs +9846 -0
  17. package/dist/create-reflection-resource-BWYhmX7O.cjs +10085 -0
  18. package/dist/docs-5r844zC1.d.mts +9 -0
  19. package/dist/docs-B66b9li3.mjs +219 -0
  20. package/dist/docs-_MmTNBQX.d.cts +9 -0
  21. package/dist/docs-hBlKCRWK.cjs +224 -0
  22. package/dist/env-BPodCdD1.d.cts +116 -0
  23. package/dist/env-IQvgnabX.mjs +1578 -0
  24. package/dist/env-cO4BUDn1.cjs +1596 -0
  25. package/dist/env-zhzvpUI5.d.mts +98 -0
  26. package/dist/index-BXxhKmeA.d.mts +1 -0
  27. package/dist/index-Cc7fCJU9.d.mts +1 -0
  28. package/dist/index-CqdNToYT.d.cts +1 -0
  29. package/dist/index-DWPDThxu.d.cts +1 -0
  30. package/dist/index.cjs +702 -77
  31. package/dist/index.d.cts +185 -12
  32. package/dist/index.d.mts +190 -17
  33. package/dist/index.mjs +648 -28
  34. package/dist/{deepkit/schemas/reflection.d.mts → plugin-BaInAuAh.d.mts} +326 -59
  35. package/dist/{deepkit/schemas/reflection.d.cts → plugin-BwuEBScL.d.cts} +268 -1
  36. package/dist/plugin-D3B5E_Hg.mjs +1 -0
  37. package/dist/plugin-D5qyQPqC.cjs +0 -0
  38. package/dist/resolved-BZG2cwRG.d.cts +1789 -0
  39. package/dist/resolved-V5COsfDu.d.mts +1791 -0
  40. package/dist/runtime-Bisl_1Ja.cjs +0 -0
  41. package/dist/runtime-Q8Ni8SeN.d.cts +794 -0
  42. package/dist/runtime-azNoeKr-.mjs +1 -0
  43. package/dist/runtime-qZ0Z2kEd.d.mts +794 -0
  44. package/dist/types/index.cjs +3 -0
  45. package/dist/types/index.d.cts +4 -2
  46. package/dist/types/index.d.mts +5 -2
  47. package/dist/types/index.mjs +4 -0
  48. package/dist/types/plugin.cjs +1 -0
  49. package/dist/types/plugin.d.cts +3 -156
  50. package/dist/types/plugin.d.mts +4 -158
  51. package/dist/types/plugin.mjs +2 -0
  52. package/dist/types/runtime.cjs +1 -0
  53. package/dist/types/runtime.d.cts +2 -793
  54. package/dist/types/runtime.d.mts +2 -793
  55. package/dist/types/runtime.mjs +2 -0
  56. package/dist/types-DwElXV6q.mjs +1 -0
  57. package/dist/types-MYBaygjr.cjs +0 -0
  58. package/package.json +7 -7
  59. package/dist/_virtual/rolldown_runtime.cjs +0 -37
  60. package/dist/_virtual/rolldown_runtime.mjs +0 -29
  61. package/dist/babel/index.cjs +0 -1
  62. package/dist/babel/index.d.mts +0 -1
  63. package/dist/babel/index.mjs +0 -3
  64. package/dist/babel/plugin.cjs +0 -121
  65. package/dist/babel/plugin.d.cts +0 -7
  66. package/dist/babel/plugin.d.mts +0 -9
  67. package/dist/babel/plugin.mjs +0 -119
  68. package/dist/deepkit/schemas/reflection.cjs +0 -3940
  69. package/dist/deepkit/schemas/reflection.mjs +0 -3938
  70. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  71. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  72. package/dist/deepkit/src/capnp.cjs +0 -913
  73. package/dist/deepkit/src/capnp.mjs +0 -911
  74. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  75. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  76. package/dist/deepkit/src/reflect-type.cjs +0 -22
  77. package/dist/deepkit/src/reflect-type.mjs +0 -20
  78. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  79. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  80. package/dist/deepkit/src/transformer.cjs +0 -52
  81. package/dist/deepkit/src/transformer.mjs +0 -49
  82. package/dist/deepkit/src/transpile.cjs +0 -29
  83. package/dist/deepkit/src/transpile.mjs +0 -27
  84. package/dist/deepkit/src/types.d.cts +0 -10
  85. package/dist/deepkit/src/types.d.mts +0 -10
  86. package/dist/deepkit/src/utilities.cjs +0 -66
  87. package/dist/deepkit/src/utilities.mjs +0 -65
  88. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
  89. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
  90. package/dist/deepkit/src/vendor/type.cjs +0 -20
  91. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  92. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  93. package/dist/deepkit/src/vendor/type.mjs +0 -11
  94. package/dist/helpers/automd-generator.cjs +0 -22
  95. package/dist/helpers/automd-generator.mjs +0 -21
  96. package/dist/helpers/create-reflection-resource.cjs +0 -55
  97. package/dist/helpers/create-reflection-resource.d.cts +0 -15
  98. package/dist/helpers/create-reflection-resource.d.mts +0 -15
  99. package/dist/helpers/create-reflection-resource.mjs +0 -54
  100. package/dist/helpers/index.cjs +0 -6
  101. package/dist/helpers/index.d.mts +0 -6
  102. package/dist/helpers/index.mjs +0 -8
  103. package/dist/helpers/load.cjs +0 -83
  104. package/dist/helpers/load.d.cts +0 -35
  105. package/dist/helpers/load.d.mts +0 -36
  106. package/dist/helpers/load.mjs +0 -80
  107. package/dist/helpers/persistence.cjs +0 -214
  108. package/dist/helpers/persistence.d.cts +0 -84
  109. package/dist/helpers/persistence.d.mts +0 -84
  110. package/dist/helpers/persistence.mjs +0 -202
  111. package/dist/helpers/reflect.cjs +0 -111
  112. package/dist/helpers/reflect.d.cts +0 -46
  113. package/dist/helpers/reflect.d.mts +0 -46
  114. package/dist/helpers/reflect.mjs +0 -103
  115. package/dist/helpers/source-file-env.cjs +0 -28
  116. package/dist/helpers/source-file-env.d.cts +0 -8
  117. package/dist/helpers/source-file-env.d.mts +0 -8
  118. package/dist/helpers/source-file-env.mjs +0 -26
  119. package/dist/helpers/template-helpers.cjs +0 -42
  120. package/dist/helpers/template-helpers.d.cts +0 -15
  121. package/dist/helpers/template-helpers.d.mts +0 -15
  122. package/dist/helpers/template-helpers.mjs +0 -41
  123. package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
  124. package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
  125. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  126. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  127. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  128. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  129. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  130. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  131. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
  132. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
  133. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  134. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  135. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  136. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  137. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  138. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  139. package/dist/plugin-alloy/src/index.cjs +0 -93
  140. package/dist/plugin-alloy/src/index.mjs +0 -91
  141. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
  142. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
  143. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
  144. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
  145. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -18
  146. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  147. package/dist/plugin-alloy/src/types/components.d.mts +0 -25
  148. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  149. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
  150. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
  151. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
  152. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -25
  153. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  154. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
  155. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
  156. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
  157. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
  158. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -27
  159. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -28
  160. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
  161. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -194
  162. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -14
  163. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -15
  164. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -191
  165. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
  166. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -11
  167. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
  168. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
  169. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  170. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  171. package/dist/plugin-automd/src/index.cjs +0 -101
  172. package/dist/plugin-automd/src/index.mjs +0 -98
  173. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  174. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  175. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  176. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  177. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  178. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  179. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  180. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  181. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  182. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  183. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  184. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  185. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  186. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  187. package/dist/plugin-babel/src/helpers/options.cjs +0 -50
  188. package/dist/plugin-babel/src/helpers/options.mjs +0 -47
  189. package/dist/plugin-babel/src/index.cjs +0 -91
  190. package/dist/plugin-babel/src/index.mjs +0 -89
  191. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  192. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  193. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  194. package/dist/powerlines/schemas/fs.d.mts +0 -1
  195. package/dist/powerlines/src/api.d.mts +0 -7
  196. package/dist/powerlines/src/index.d.mts +0 -12
  197. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
  198. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
  199. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
  200. package/dist/powerlines/src/lib/entry.cjs +0 -12
  201. package/dist/powerlines/src/lib/entry.mjs +0 -14
  202. package/dist/powerlines/src/lib/logger.cjs +0 -41
  203. package/dist/powerlines/src/lib/logger.mjs +0 -39
  204. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
  205. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
  206. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
  207. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
  208. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  209. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  210. package/dist/powerlines/src/types/api.d.mts +0 -5
  211. package/dist/powerlines/src/types/babel.d.cts +0 -23
  212. package/dist/powerlines/src/types/babel.d.mts +0 -23
  213. package/dist/powerlines/src/types/build.d.cts +0 -145
  214. package/dist/powerlines/src/types/build.d.mts +0 -147
  215. package/dist/powerlines/src/types/commands.d.cts +0 -8
  216. package/dist/powerlines/src/types/commands.d.mts +0 -9
  217. package/dist/powerlines/src/types/config.d.cts +0 -380
  218. package/dist/powerlines/src/types/config.d.mts +0 -381
  219. package/dist/powerlines/src/types/context.d.cts +0 -414
  220. package/dist/powerlines/src/types/context.d.mts +0 -416
  221. package/dist/powerlines/src/types/fs.d.cts +0 -486
  222. package/dist/powerlines/src/types/fs.d.mts +0 -486
  223. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  224. package/dist/powerlines/src/types/index.d.mts +0 -12
  225. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  226. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  227. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  228. package/dist/powerlines/src/types/resolved.d.mts +0 -83
  229. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  230. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  231. package/dist/powerlines/src/types/unplugin.d.mts +0 -7
@@ -1,572 +1,4 @@
1
- import { type_exports } from "../deepkit/src/vendor/type.mjs";
2
- import { usePowerlines } from "../plugin-alloy/src/core/contexts/context.mjs";
3
- import { refkey as refkey$1 } from "../plugin-alloy/src/helpers/refkey.mjs";
4
- import { TSDoc, TSDocExample, TSDocLink, TSDocParam, TSDocRemarks, TSDocReturns, TSDocThrows } from "../plugin-alloy/src/typescript/components/tsdoc.mjs";
5
- import { BuiltinFile } from "../plugin-alloy/src/typescript/components/builtin-file.mjs";
6
- import { TypeScriptInterface } from "../plugin-alloy/src/typescript/components/typescript-interface.mjs";
7
- import { TypescriptObject } from "../plugin-alloy/src/typescript/components/typescript-object.mjs";
8
- import { loadEnvFromContext } from "../helpers/load.mjs";
9
- import { createReflectionResource } from "../helpers/create-reflection-resource.mjs";
10
- import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
11
- import { For, Show, code, computed, splitProps } from "@alloy-js/core";
12
- import defu from "defu";
13
- import { titleCase } from "@stryke/string-format/title-case";
14
- import { isNull } from "@stryke/type-checks/is-null";
15
- import { ClassDeclaration, ClassMethod, ElseIfClause, FunctionDeclaration, IfStatement, NewExpression, TypeDeclaration, VarDeclaration } from "@alloy-js/typescript";
1
+ import "../create-reflection-resource-BNYxBgW2.mjs";
2
+ import { n as EnvTypeDefinition, t as EnvBuiltin } from "../env-IQvgnabX.mjs";
16
3
 
17
- //#region src/components/env.tsx
18
- /**
19
- * Generates the environment configuration typescript definition for the Powerlines project.
20
- */
21
- function EnvTypeDefinition(props) {
22
- const [{ defaultValue, reflection }] = splitProps(props, ["defaultValue", "reflection"]);
23
- const context = usePowerlines();
24
- return [
25
- createComponent(TypeScriptInterface, {
26
- name: " EnvBase",
27
- "extends": ["EnvInterface"],
28
- defaultValue,
29
- reflection,
30
- "export": true
31
- }),
32
- createIntrinsic("hbr", {}),
33
- createIntrinsic("hbr", {}),
34
- createComponent(TypeDeclaration, {
35
- name: "Env",
36
- "export": true,
37
- get children() {
38
- return code` {
39
- [Key in keyof EnvBase as Key ${context?.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
40
- }
41
- `;
42
- }
43
- })
44
- ];
45
- }
46
- function ConfigPropertyConditional(props) {
47
- const [{ context, name }] = splitProps(props, ["context", "name"]);
48
- if (!context) return null;
49
- return code`propertyName === "${name}" || propertyName.replace(/^(${context.config.env.prefix.sort((a, b) => a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)).map((prefix) => `${prefix.replace(/_$/, "")}_`).join("|")})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${name.toLowerCase().replace(/[\s\-_]+/g, "")}"`;
50
- }
51
- function ConfigPropertyGet(props) {
52
- const [{ context, property, index }] = splitProps(props, [
53
- "context",
54
- "property",
55
- "index"
56
- ]);
57
- if (!context) return null;
58
- return [index === 0 ? createComponent(IfStatement, {
59
- get condition() {
60
- return [createComponent(ConfigPropertyConditional, {
61
- get name() {
62
- return property.getNameAsString();
63
- },
64
- context
65
- }), createComponent(Show, {
66
- get when() {
67
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
68
- },
69
- get children() {
70
- return [code` || `, createComponent(For, {
71
- get each() {
72
- return property.getAlias();
73
- },
74
- joiner: code` || `,
75
- children: (alias) => createComponent(ConfigPropertyConditional, {
76
- name: alias,
77
- context
78
- })
79
- })];
80
- }
81
- })];
82
- },
83
- get children() {
84
- return code`return target["${property.getNameAsString()}"];`;
85
- }
86
- }) : createComponent(ElseIfClause, {
87
- get condition() {
88
- return [createComponent(ConfigPropertyConditional, {
89
- get name() {
90
- return property.getNameAsString();
91
- },
92
- context
93
- }), createComponent(Show, {
94
- get when() {
95
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
96
- },
97
- get children() {
98
- return [code` || `, createComponent(For, {
99
- get each() {
100
- return property.getAlias();
101
- },
102
- joiner: code` || `,
103
- children: (alias) => createComponent(ConfigPropertyConditional, {
104
- name: alias,
105
- context
106
- })
107
- })];
108
- }
109
- })];
110
- },
111
- get children() {
112
- return code`return target["${property.getNameAsString()}"];`;
113
- }
114
- })];
115
- }
116
- function ConfigPropertySet(props) {
117
- const [{ context, property, index }] = splitProps(props, [
118
- "context",
119
- "property",
120
- "index"
121
- ]);
122
- if (!context) return null;
123
- return [index === 0 ? createComponent(IfStatement, {
124
- get condition() {
125
- return [createComponent(ConfigPropertyConditional, {
126
- get name() {
127
- return property.getNameAsString();
128
- },
129
- context
130
- }), createComponent(Show, {
131
- get when() {
132
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
133
- },
134
- get children() {
135
- return [code` || `, createComponent(For, {
136
- get each() {
137
- return property.getAlias();
138
- },
139
- joiner: code` || `,
140
- children: (alias) => createComponent(ConfigPropertyConditional, {
141
- name: alias,
142
- context
143
- })
144
- })];
145
- }
146
- })];
147
- },
148
- get children() {
149
- return code`
150
- target["${property.getNameAsString()}"] = newValue;
151
- return true;
152
- `;
153
- }
154
- }) : createComponent(ElseIfClause, {
155
- get condition() {
156
- return [createComponent(ConfigPropertyConditional, {
157
- get name() {
158
- return property.getNameAsString();
159
- },
160
- context
161
- }), createComponent(Show, {
162
- get when() {
163
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
164
- },
165
- get children() {
166
- return [code` || `, createComponent(For, {
167
- get each() {
168
- return property.getAlias();
169
- },
170
- joiner: code` || `,
171
- children: (alias) => createComponent(ConfigPropertyConditional, {
172
- name: alias,
173
- context
174
- })
175
- })];
176
- }
177
- })];
178
- },
179
- get children() {
180
- return code`
181
- target["${property.getNameAsString()}"] = newValue;
182
- return true;
183
- `;
184
- }
185
- })];
186
- }
187
- const createEnvRefkey = refkey$1("createEnv");
188
- const envRefkey = refkey$1("env");
189
- const envSerializerRefkey = refkey$1("EnvSerializer");
190
- /**
191
- * Generates the environment configuration module for the Powerlines project.
192
- */
193
- function EnvBuiltin(props) {
194
- const [{ defaultConfig, children }, rest] = splitProps(props, ["defaultConfig", "children"]);
195
- const context = usePowerlines();
196
- const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
197
- const reflection = createReflectionResource(context);
198
- const envInstance = computed(() => {
199
- return new type_exports.ReflectionClass({
200
- kind: type_exports.ReflectionKind.objectLiteral,
201
- description: `The initial environment configuration state for the ${titleCase(context?.config?.name)} project.`,
202
- types: []
203
- }, reflection.data ?? void 0);
204
- });
205
- const reflectionGetProperties = computed(() => reflection.data?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
206
- const reflectionSetProperties = computed(() => reflection.data?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
207
- return createComponent(BuiltinFile, mergeProps({
208
- id: "env",
209
- description: "The Powerlines environment configuration module provides an interface to define environment configuration parameters."
210
- }, rest, {
211
- get imports() {
212
- return defu({
213
- "@powerlines/deepkit/vendor/type": [
214
- "Type",
215
- "stringify",
216
- "serializer",
217
- "serializeFunction",
218
- "deserializeFunction",
219
- "ReflectionKind",
220
- "TemplateState",
221
- "Serializer",
222
- "TypeProperty",
223
- "TypePropertySignature"
224
- ],
225
- "@powerlines/plugin-env/types/runtime": [{ name: "EnvInterface" }]
226
- }, rest.imports ?? {});
227
- },
228
- get children() {
229
- return [
230
- createComponent(Show, {
231
- get when() {
232
- return !isNull(reflection.data);
233
- },
234
- get children() {
235
- return [
236
- createComponent(EnvTypeDefinition, {
237
- get defaultValue() {
238
- return defaultValue.value;
239
- },
240
- get reflection() {
241
- return reflection.data;
242
- }
243
- }),
244
- createIntrinsic("hbr", {}),
245
- createIntrinsic("hbr", {})
246
- ];
247
- }
248
- }),
249
- createComponent(TypescriptObject, {
250
- name: "initialEnv",
251
- type: "Partial<EnvBase>",
252
- defaultValue,
253
- reflection: envInstance,
254
- "export": true,
255
- "const": true
256
- }),
257
- createIntrinsic("hbr", {}),
258
- createIntrinsic("hbr", {}),
259
- createComponent(TSDoc, {
260
- heading: "The environment configuration serializer for the Powerlines application.",
261
- get children() {
262
- return [
263
- createComponent(TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
264
- createComponent(TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
265
- createComponent(TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
266
- ];
267
- }
268
- }),
269
- createComponent(ClassDeclaration, {
270
- refkey: envSerializerRefkey,
271
- name: "EnvSerializer",
272
- "extends": "Serializer",
273
- "export": true,
274
- get children() {
275
- return createComponent(ClassMethod, {
276
- name: "constructor",
277
- "public": true,
278
- children: code`
279
- super("env");
280
-
281
- this.deserializeRegistry.register(
282
- ReflectionKind.boolean,
283
- (type: Type, state: TemplateState) => {
284
- state.addSetter(
285
- \`typeof \${state.accessor.toString()} !== "boolean" ? \${state.accessor.toString()} === 1 || \${state.accessor.toString()} === "1" || \${state.accessor.toString()}.toLowerCase() === "t" || \${state.accessor.toString()}.toLowerCase() === "true" || \${state.accessor.toString()}.toLowerCase() === "y" || \${state.accessor.toString()}.toLowerCase() === "yes" : \${state.accessor.toString()}\`
286
- );
287
- }
288
- );
289
- `
290
- });
291
- }
292
- }),
293
- createIntrinsic("hbr", {}),
294
- createIntrinsic("hbr", {}),
295
- createComponent(TSDoc, {
296
- heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
297
- get children() {
298
- return [
299
- createComponent(TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
300
- createComponent(TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
301
- createComponent(TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
302
- ];
303
- }
304
- }),
305
- createComponent(VarDeclaration, {
306
- name: "envSerializer",
307
- "export": false,
308
- "const": true,
309
- get initializer() {
310
- return createComponent(NewExpression, {
311
- args: [],
312
- target: "EnvSerializer"
313
- });
314
- }
315
- }),
316
- createIntrinsic("hbr", {}),
317
- createIntrinsic("hbr", {}),
318
- createComponent(TSDoc, {
319
- heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
320
- get children() {
321
- return [
322
- createComponent(TSDocRemarks, { children: `The resulting JSON object can be stringified using JSON.stringify().` }),
323
- createComponent(TSDocExample, { children: `const json = serializeEnv(env);` }),
324
- createComponent(TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
325
- ];
326
- }
327
- }),
328
- createComponent(VarDeclaration, {
329
- name: "serializeEnv",
330
- "export": true,
331
- "const": true,
332
- initializer: "serializeFunction<EnvBase>(envSerializer)"
333
- }),
334
- createIntrinsic("hbr", {}),
335
- createIntrinsic("hbr", {}),
336
- createComponent(TSDoc, {
337
- heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
338
- get children() {
339
- return [
340
- createComponent(TSDocRemarks, { children: `Types that are already correct will be used as-is.` }),
341
- createComponent(TSDocExample, { children: `const env = deserializeEnv(json);` }),
342
- createComponent(TSDocThrows, { children: `ValidationError when deserialization fails.` })
343
- ];
344
- }
345
- }),
346
- createComponent(VarDeclaration, {
347
- name: "deserializeEnv",
348
- "export": true,
349
- "const": true,
350
- initializer: "deserializeFunction<EnvBase>(envSerializer)"
351
- }),
352
- createIntrinsic("hbr", {}),
353
- createIntrinsic("hbr", {}),
354
- createComponent(TSDoc, {
355
- heading: "Initializes the Powerlines environment configuration module.",
356
- get children() {
357
- return [
358
- createComponent(TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
359
- createComponent(TSDocParam, {
360
- name: "environmentConfig",
361
- children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
362
- }),
363
- createComponent(TSDocReturns, { children: `The initialized Powerlines configuration object.` })
364
- ];
365
- }
366
- }),
367
- createComponent(Show, {
368
- get when() {
369
- return Boolean(context?.entryPath);
370
- },
371
- get children() {
372
- return createComponent(FunctionDeclaration, {
373
- refkey: createEnvRefkey,
374
- async: false,
375
- "export": true,
376
- name: "createEnv",
377
- parameters: [{
378
- name: "environmentConfig",
379
- type: `Partial<Env>`,
380
- optional: false,
381
- default: "{}"
382
- }],
383
- returnType: "Env",
384
- get children() {
385
- return [
386
- code`
387
- return new Proxy<Env>(
388
- deserializeEnv({
389
- ...initialEnv,
390
- ...environmentConfig
391
- }) as Env,
392
- {
393
- get: (target: EnvBase, propertyName: string) => { `,
394
- createIntrinsic("hbr", {}),
395
- createComponent(For, {
396
- each: reflectionGetProperties,
397
- children: (property, index) => createComponent(ConfigPropertyGet, {
398
- index,
399
- context,
400
- property
401
- })
402
- }),
403
- code`
404
- return undefined;
405
- }, `,
406
- createIntrinsic("hbr", {}),
407
- createIntrinsic("hbr", {}),
408
- code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,
409
- createIntrinsic("hbr", {}),
410
- createComponent(For, {
411
- each: reflectionSetProperties,
412
- ender: code` else `,
413
- children: (property, index) => createComponent(ConfigPropertySet, {
414
- index,
415
- context,
416
- property
417
- })
418
- }),
419
- createIntrinsic("hbr", {}),
420
- code`return false;
421
- }
422
- }
423
- );
424
- `
425
- ];
426
- }
427
- });
428
- }
429
- }),
430
- createIntrinsic("hbr", {}),
431
- createIntrinsic("hbr", {}),
432
- createIntrinsic("hbr", {}),
433
- createComponent(VarDeclaration, {
434
- refkey: envRefkey,
435
- name: "env",
436
- type: "Env",
437
- "export": true,
438
- "const": true,
439
- get initializer() {
440
- return [code`createEnv(${defaultConfig || "{}"} as Partial<Env>);`];
441
- }
442
- }),
443
- createIntrinsic("hbr", {}),
444
- createIntrinsic("hbr", {}),
445
- createComponent(VarDeclaration, {
446
- "export": true,
447
- "const": true,
448
- name: "isCI",
449
- doc: "Detect if the application is running in a CI environment.",
450
- initializer: code`Boolean(
451
- env.CI ||
452
- env.RUN_ID ||
453
- env.AGOLA_GIT_REF ||
454
- env.AC_APPCIRCLE ||
455
- env.APPVEYOR ||
456
- env.CODEBUILD ||
457
- env.TF_BUILD ||
458
- env.bamboo_planKey ||
459
- env.BITBUCKET_COMMIT ||
460
- env.BITRISE_IO ||
461
- env.BUDDY_WORKSPACE_ID ||
462
- env.BUILDKITE ||
463
- env.CIRCLECI ||
464
- env.CIRRUS_CI ||
465
- env.CF_BUILD_ID ||
466
- env.CM_BUILD_ID ||
467
- env.CI_NAME ||
468
- env.DRONE ||
469
- env.DSARI ||
470
- env.EARTHLY_CI ||
471
- env.EAS_BUILD ||
472
- env.GERRIT_PROJECT ||
473
- env.GITEA_ACTIONS ||
474
- env.GITHUB_ACTIONS ||
475
- env.GITLAB_CI ||
476
- env.GOCD ||
477
- env.BUILDER_OUTPUT ||
478
- env.HARNESS_BUILD_ID ||
479
- env.JENKINS_URL ||
480
- env.LAYERCI ||
481
- env.MAGNUM ||
482
- env.NETLIFY ||
483
- env.NEVERCODE ||
484
- env.PROW_JOB_ID ||
485
- env.RELEASE_BUILD_ID ||
486
- env.RENDER ||
487
- env.SAILCI ||
488
- env.HUDSON ||
489
- env.SCREWDRIVER ||
490
- env.SEMAPHORE ||
491
- env.SOURCEHUT ||
492
- env.STRIDER ||
493
- env.TASK_ID ||
494
- env.RUN_ID ||
495
- env.TEAMCITY_VERSION ||
496
- env.TRAVIS ||
497
- env.VELA ||
498
- env.NOW_BUILDER ||
499
- env.APPCENTER_BUILD_ID ||
500
- env.CI_XCODE_PROJECT ||
501
- env.XCS || false
502
- );
503
- `
504
- }),
505
- createIntrinsic("hbr", {}),
506
- createIntrinsic("hbr", {}),
507
- createComponent(TSDoc, {
508
- heading: "Detect the \\`mode\\` of the current runtime environment.",
509
- get children() {
510
- return createComponent(TSDocRemarks, { children: code`The \`mode\` is determined by the \`MODE\` environment variable, or falls back to the \`NEXT_PUBLIC_VERCEL_ENV\`, \`NODE_ENV\`, or defaults to \`production\`. While the value can potentially be any string, Storm Software generally only allows a value in the following list:
511
- - \`production\`
512
- - \`test\`
513
- - \`development\`` });
514
- }
515
- }),
516
- createComponent(VarDeclaration, {
517
- "export": true,
518
- "const": true,
519
- name: "mode",
520
- initializer: code`String(env.MODE) || "production"; `
521
- }),
522
- createIntrinsic("hbr", {}),
523
- createIntrinsic("hbr", {}),
524
- createComponent(VarDeclaration, {
525
- "export": true,
526
- "const": true,
527
- name: "isProduction",
528
- doc: "Detect if the application is running in \\\"production\\\\\" mode",
529
- initializer: code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
530
- }),
531
- createIntrinsic("hbr", {}),
532
- createIntrinsic("hbr", {}),
533
- createComponent(VarDeclaration, {
534
- "export": true,
535
- "const": true,
536
- name: "isTest",
537
- doc: "Detect if the application is running in \"test\" mode",
538
- initializer: code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
539
- }),
540
- createIntrinsic("hbr", {}),
541
- createIntrinsic("hbr", {}),
542
- createComponent(VarDeclaration, {
543
- "export": true,
544
- "const": true,
545
- name: "isDevelopment",
546
- doc: "Detect if the application is running in \"development\" mode",
547
- initializer: code`["dev", "development"].includes(mode.toLowerCase()); `
548
- }),
549
- createIntrinsic("hbr", {}),
550
- createIntrinsic("hbr", {}),
551
- createComponent(VarDeclaration, {
552
- "export": true,
553
- "const": true,
554
- name: "isDebug",
555
- doc: "Detect if the application is running in \"debug\" mode",
556
- initializer: code`Boolean(isDevelopment && env.DEBUG); `
557
- }),
558
- createIntrinsic("hbr", {}),
559
- createIntrinsic("hbr", {}),
560
- createComponent(Show, {
561
- get when() {
562
- return Boolean(children);
563
- },
564
- children
565
- })
566
- ];
567
- }
568
- }));
569
- }
570
-
571
- //#endregion
572
4
  export { EnvBuiltin, EnvTypeDefinition };
@@ -1,6 +1,8 @@
1
- const require_components_env = require('./env.cjs');
2
- const require_components_docs = require('./docs.cjs');
1
+ require('../create-reflection-resource-BWYhmX7O.cjs');
2
+ const require_env = require('../env-cO4BUDn1.cjs');
3
+ const require_docs = require('../docs-hBlKCRWK.cjs');
4
+ require('../components-C9bYrQVK.cjs');
3
5
 
4
- exports.EnvBuiltin = require_components_env.EnvBuiltin;
5
- exports.EnvDocs = require_components_docs.EnvDocs;
6
- exports.EnvTypeDefinition = require_components_env.EnvTypeDefinition;
6
+ exports.EnvBuiltin = require_env.EnvBuiltin;
7
+ exports.EnvDocs = require_docs.EnvDocs;
8
+ exports.EnvTypeDefinition = require_env.EnvTypeDefinition;
@@ -1,3 +1,5 @@
1
- import { EnvDocs } from "./docs.cjs";
2
- import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./env.cjs";
1
+ import { t as EnvDocs } from "../docs-_MmTNBQX.cjs";
2
+ import "../resolved-BZG2cwRG.cjs";
3
+ import { i as __ΩEnvBuiltinProps, n as EnvBuiltinProps, r as EnvTypeDefinition, t as EnvBuiltin } from "../env-BPodCdD1.cjs";
4
+ import "../index-DWPDThxu.cjs";
3
5
  export { EnvBuiltin, EnvBuiltinProps, EnvDocs, EnvTypeDefinition, __ΩEnvBuiltinProps };
@@ -1,3 +1,6 @@
1
- import { EnvDocs } from "./docs.mjs";
2
- import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./env.mjs";
1
+ import { t as EnvDocs } from "../docs-5r844zC1.mjs";
2
+ import "../resolved-V5COsfDu.mjs";
3
+ import "../components-8W0Zgj0y.mjs";
4
+ import { i as __ΩEnvBuiltinProps, n as EnvBuiltinProps, r as EnvTypeDefinition, t as EnvBuiltin } from "../env-zhzvpUI5.mjs";
5
+ import "../index-Cc7fCJU9.mjs";
3
6
  export { EnvBuiltin, EnvBuiltinProps, EnvDocs, EnvTypeDefinition, __ΩEnvBuiltinProps };
@@ -1,4 +1,6 @@
1
- import { EnvBuiltin, EnvTypeDefinition } from "./env.mjs";
2
- import { EnvDocs } from "./docs.mjs";
1
+ import "../create-reflection-resource-BNYxBgW2.mjs";
2
+ import { n as EnvTypeDefinition, t as EnvBuiltin } from "../env-IQvgnabX.mjs";
3
+ import { t as EnvDocs } from "../docs-B66b9li3.mjs";
4
+ import "../components-CNIQFfeK.mjs";
3
5
 
4
6
  export { EnvBuiltin, EnvDocs, EnvTypeDefinition };
@@ -1,4 +1,5 @@
1
1
  import { Children } from "@alloy-js/core";
2
+ import { SourceFileContext as SourceFileContext$1 } from "@alloy-js/typescript";
2
3
 
3
4
  //#region ../plugin-alloy/src/types/components.d.ts
4
5
 
@@ -19,4 +20,4 @@ type TypescriptFileImports = TypescriptFileImportList & {
19
20
  $builtins?: TypescriptFileImportList;
20
21
  };
21
22
  //#endregion
22
- export { ComponentProps, TypescriptFileImports };
23
+ export { TypescriptFileImports as n, ComponentProps as t };
File without changes
@@ -0,0 +1 @@
1
+ export { };