@powerlines/plugin-env 0.15.140 → 0.15.142

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 (209) hide show
  1. package/dist/automd-generator-BNg74tyV.cjs +37 -0
  2. package/dist/automd-generator-DoKLIMuw.mjs +32 -0
  3. package/dist/automd-generator-DoKLIMuw.mjs.map +1 -0
  4. package/dist/babel/index.cjs +5 -2
  5. package/dist/babel/index.d.cts +14 -1
  6. package/dist/babel/index.d.mts +14 -1
  7. package/dist/babel/index.mjs +4 -1
  8. package/dist/babel/plugin.cjs +4 -140
  9. package/dist/babel/plugin.d.cts +14 -7
  10. package/dist/babel/plugin.d.mts +14 -7
  11. package/dist/babel/plugin.mjs +3 -138
  12. package/dist/babel-BZqmdVF4.cjs +0 -0
  13. package/dist/babel-DgietUY3.mjs +1 -0
  14. package/dist/chunk-CNVrAnJR.cjs +48 -0
  15. package/dist/{_virtual/rolldown_runtime.cjs → chunk-CsF2CmBJ.mjs} +6 -2
  16. package/dist/components/docs.cjs +13 -69
  17. package/dist/components/docs.d.cts +1 -21
  18. package/dist/components/docs.d.mts +1 -21
  19. package/dist/components/docs.mjs +12 -67
  20. package/dist/components/env.cjs +13 -588
  21. package/dist/components/env.d.cts +1 -19
  22. package/dist/components/env.d.mts +1 -19
  23. package/dist/components/env.mjs +11 -584
  24. package/dist/components/index.cjs +17 -5
  25. package/dist/components/index.d.cts +3 -2
  26. package/dist/components/index.d.mts +3 -2
  27. package/dist/components/index.mjs +14 -2
  28. package/dist/components-BUo6Koax.cjs +0 -0
  29. package/dist/components-DDFmImcI.mjs +1 -0
  30. package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs +23 -0
  31. package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs.map +1 -0
  32. package/dist/confbox.DA7CpUDY-r6FXRsI6.cjs +28 -0
  33. package/dist/confbox.DnMsyigM-C13n3X-S.cjs +415 -0
  34. package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs +405 -0
  35. package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs.map +1 -0
  36. package/dist/create-reflection-resource-B3friIs9.mjs +98 -0
  37. package/dist/create-reflection-resource-B3friIs9.mjs.map +1 -0
  38. package/dist/create-reflection-resource-BJj83ii4.cjs +103 -0
  39. package/dist/create-reflection-resource-DSLbLsX2.d.cts +16 -0
  40. package/dist/create-reflection-resource-DSLbLsX2.d.cts.map +1 -0
  41. package/dist/create-reflection-resource-DwWJAo-G.d.mts +16 -0
  42. package/dist/create-reflection-resource-DwWJAo-G.d.mts.map +1 -0
  43. package/dist/defu-CrqNIh1A.cjs +227 -0
  44. package/dist/defu-DV5Grr85.mjs +180 -0
  45. package/dist/defu-DV5Grr85.mjs.map +1 -0
  46. package/dist/dist-BQc8ZRwl.cjs +13 -0
  47. package/dist/dist-C_a6goTt.cjs +15282 -0
  48. package/dist/dist-CjWvISyq.mjs +15271 -0
  49. package/dist/dist-CjWvISyq.mjs.map +1 -0
  50. package/dist/dist-mV5Swt78.mjs +13 -0
  51. package/dist/dist-mV5Swt78.mjs.map +1 -0
  52. package/dist/docs-B-SDRHeg.cjs +75 -0
  53. package/dist/docs-B0d8pdIg.d.mts +23 -0
  54. package/dist/docs-B0d8pdIg.d.mts.map +1 -0
  55. package/dist/docs-DMfzQuvP.d.cts +23 -0
  56. package/dist/docs-DMfzQuvP.d.cts.map +1 -0
  57. package/dist/docs-DbRoWmL_.mjs +70 -0
  58. package/dist/docs-DbRoWmL_.mjs.map +1 -0
  59. package/dist/docs-helper-2fe7M3Th.mjs +24 -0
  60. package/dist/docs-helper-2fe7M3Th.mjs.map +1 -0
  61. package/dist/docs-helper-4MoQ5-R3.cjs +28 -0
  62. package/dist/env-BIyd8CTA.d.cts +21 -0
  63. package/dist/env-BIyd8CTA.d.cts.map +1 -0
  64. package/dist/env-BKmI7DyR.d.mts +21 -0
  65. package/dist/env-BKmI7DyR.d.mts.map +1 -0
  66. package/dist/env-D9oCn-AS.mjs +587 -0
  67. package/dist/env-D9oCn-AS.mjs.map +1 -0
  68. package/dist/env-R63eR4RP.cjs +598 -0
  69. package/dist/helpers/automd-generator.cjs +3 -31
  70. package/dist/helpers/automd-generator.d.cts +2 -1
  71. package/dist/helpers/automd-generator.d.cts.map +1 -0
  72. package/dist/helpers/automd-generator.d.mts +2 -1
  73. package/dist/helpers/automd-generator.d.mts.map +1 -0
  74. package/dist/helpers/automd-generator.mjs +2 -29
  75. package/dist/helpers/create-reflection-resource.cjs +11 -97
  76. package/dist/helpers/create-reflection-resource.d.cts +3 -14
  77. package/dist/helpers/create-reflection-resource.d.mts +3 -14
  78. package/dist/helpers/create-reflection-resource.mjs +10 -95
  79. package/dist/helpers/docs-helper.cjs +5 -23
  80. package/dist/helpers/docs-helper.d.cts +4 -2
  81. package/dist/helpers/docs-helper.d.cts.map +1 -0
  82. package/dist/helpers/docs-helper.d.mts +4 -2
  83. package/dist/helpers/docs-helper.d.mts.map +1 -0
  84. package/dist/helpers/docs-helper.mjs +4 -21
  85. package/dist/helpers/index.cjs +38 -32
  86. package/dist/helpers/index.d.cts +9 -6
  87. package/dist/helpers/index.d.mts +9 -6
  88. package/dist/helpers/index.mjs +12 -6
  89. package/dist/helpers/load.cjs +10 -134
  90. package/dist/helpers/load.d.cts +3 -34
  91. package/dist/helpers/load.d.mts +3 -34
  92. package/dist/helpers/load.mjs +8 -130
  93. package/dist/helpers/persistence.cjs +15 -321
  94. package/dist/helpers/persistence.d.cts +3 -83
  95. package/dist/helpers/persistence.d.mts +3 -83
  96. package/dist/helpers/persistence.mjs +4 -308
  97. package/dist/helpers/reflect.cjs +13 -262
  98. package/dist/helpers/reflect.d.cts +3 -45
  99. package/dist/helpers/reflect.d.mts +3 -45
  100. package/dist/helpers/reflect.mjs +4 -252
  101. package/dist/helpers/source-file-env.cjs +3 -57
  102. package/dist/helpers/source-file-env.d.cts +1 -7
  103. package/dist/helpers/source-file-env.d.mts +1 -7
  104. package/dist/helpers/source-file-env.mjs +1 -54
  105. package/dist/helpers/template-helpers.cjs +6 -69
  106. package/dist/helpers/template-helpers.d.cts +3 -14
  107. package/dist/helpers/template-helpers.d.mts +3 -14
  108. package/dist/helpers/template-helpers.mjs +5 -67
  109. package/dist/helpers-45e1bvAO.mjs +1 -0
  110. package/dist/helpers-DgYP3uej.cjs +0 -0
  111. package/dist/index-BNRXMhlr.d.mts +1 -0
  112. package/dist/index-Bdi8CvaN.d.cts +16 -0
  113. package/dist/index-Bdi8CvaN.d.cts.map +1 -0
  114. package/dist/index-CEDY7cmG.d.cts +1 -0
  115. package/dist/index-CREkvfw9.d.mts +1 -0
  116. package/dist/index-DSiHnMH2.d.cts +1 -0
  117. package/dist/index-Drhzdkqe.d.mts +16 -0
  118. package/dist/index-Drhzdkqe.d.mts.map +1 -0
  119. package/dist/index-dhjtMp5F.d.mts +1 -0
  120. package/dist/index-uTS5iDq_.d.cts +1 -0
  121. package/dist/index.cjs +257 -98
  122. package/dist/index.d.cts +14 -23
  123. package/dist/index.d.mts +14 -23
  124. package/dist/index.mjs +184 -23
  125. package/dist/index.mjs.map +1 -0
  126. package/dist/join-paths-BMg51Ddi.mjs +148 -0
  127. package/dist/join-paths-BMg51Ddi.mjs.map +1 -0
  128. package/dist/join-paths-Bc4rM2TX.cjs +159 -0
  129. package/dist/json5-DEV_07Nb.cjs +786 -0
  130. package/dist/json5-jq90mF9X.mjs +787 -0
  131. package/dist/json5-jq90mF9X.mjs.map +1 -0
  132. package/dist/jsonc-CBh70baJ.cjs +4 -0
  133. package/dist/jsonc-CDLU6bgi.mjs +4 -0
  134. package/dist/load-DPB0maqs.cjs +6594 -0
  135. package/dist/load-Dr5ybfL7.mjs +6579 -0
  136. package/dist/load-Dr5ybfL7.mjs.map +1 -0
  137. package/dist/load-GpP6cojj.d.mts +36 -0
  138. package/dist/load-GpP6cojj.d.mts.map +1 -0
  139. package/dist/load-PHGmxX_X.d.cts +36 -0
  140. package/dist/load-PHGmxX_X.d.cts.map +1 -0
  141. package/dist/multipart-parser-D65rtMfY.mjs +176 -0
  142. package/dist/multipart-parser-D65rtMfY.mjs.map +1 -0
  143. package/dist/multipart-parser-aEF5a4Xf.cjs +178 -0
  144. package/dist/node-Co8KdzkZ.cjs +3985 -0
  145. package/dist/node-D9MigVDD.mjs +3975 -0
  146. package/dist/node-D9MigVDD.mjs.map +1 -0
  147. package/dist/persistence-BR4cUaN6.d.cts +85 -0
  148. package/dist/persistence-BR4cUaN6.d.cts.map +1 -0
  149. package/dist/persistence-BsBxs9wt.mjs +586 -0
  150. package/dist/persistence-BsBxs9wt.mjs.map +1 -0
  151. package/dist/persistence-D_clXRxP.cjs +712 -0
  152. package/dist/persistence-DrKQZNCv.d.mts +85 -0
  153. package/dist/persistence-DrKQZNCv.d.mts.map +1 -0
  154. package/dist/plugin-CM1TSv1B.cjs +159 -0
  155. package/dist/plugin-CSVnrdpE.cjs +146 -0
  156. package/dist/plugin-CSe5f2cD.d.cts +155 -0
  157. package/dist/plugin-CSe5f2cD.d.cts.map +1 -0
  158. package/dist/plugin-DMbVjdcQ.d.mts +155 -0
  159. package/dist/plugin-DMbVjdcQ.d.mts.map +1 -0
  160. package/dist/plugin-Vyvy9w9Z.mjs +141 -0
  161. package/dist/plugin-Vyvy9w9Z.mjs.map +1 -0
  162. package/dist/plugin-eBjQJP6x.mjs +130 -0
  163. package/dist/plugin-eBjQJP6x.mjs.map +1 -0
  164. package/dist/reflect-Dm8a3c29.d.cts +47 -0
  165. package/dist/reflect-Dm8a3c29.d.cts.map +1 -0
  166. package/dist/reflect-Dpz8ifa0.d.mts +47 -0
  167. package/dist/reflect-Dpz8ifa0.d.mts.map +1 -0
  168. package/dist/runtime-BDzzR4wH.d.cts +792 -0
  169. package/dist/runtime-BDzzR4wH.d.cts.map +1 -0
  170. package/dist/runtime-C5ukCv3P.mjs +242 -0
  171. package/dist/runtime-C5ukCv3P.mjs.map +1 -0
  172. package/dist/runtime-g0TEIoZK.cjs +253 -0
  173. package/dist/runtime-lYSIZdMn.d.mts +792 -0
  174. package/dist/runtime-lYSIZdMn.d.mts.map +1 -0
  175. package/dist/source-file-env-4Vdtzc5-.cjs +68 -0
  176. package/dist/source-file-env-Brfopjyr.d.cts +9 -0
  177. package/dist/source-file-env-Brfopjyr.d.cts.map +1 -0
  178. package/dist/source-file-env-DWejSP2U.d.mts +9 -0
  179. package/dist/source-file-env-DWejSP2U.d.mts.map +1 -0
  180. package/dist/source-file-env-Tj-6qobx.mjs +57 -0
  181. package/dist/source-file-env-Tj-6qobx.mjs.map +1 -0
  182. package/dist/template-helpers-1SKodHKt.d.mts +16 -0
  183. package/dist/template-helpers-1SKodHKt.d.mts.map +1 -0
  184. package/dist/template-helpers-CCEjhw1B.mjs +70 -0
  185. package/dist/template-helpers-CCEjhw1B.mjs.map +1 -0
  186. package/dist/template-helpers-YVcwxmoF.cjs +75 -0
  187. package/dist/template-helpers-zyitPfMz.d.cts +16 -0
  188. package/dist/template-helpers-zyitPfMz.d.cts.map +1 -0
  189. package/dist/toml-DvrxV201.cjs +657 -0
  190. package/dist/toml-uuOYvEAO.mjs +658 -0
  191. package/dist/toml-uuOYvEAO.mjs.map +1 -0
  192. package/dist/types/index.cjs +10 -9
  193. package/dist/types/index.d.cts +3 -2
  194. package/dist/types/index.d.mts +3 -2
  195. package/dist/types/index.mjs +3 -2
  196. package/dist/types/plugin.cjs +7 -133
  197. package/dist/types/plugin.d.cts +2 -153
  198. package/dist/types/plugin.d.mts +2 -153
  199. package/dist/types/plugin.mjs +2 -127
  200. package/dist/types/runtime.cjs +3 -242
  201. package/dist/types/runtime.d.cts +1 -790
  202. package/dist/types/runtime.d.mts +1 -790
  203. package/dist/types/runtime.mjs +1 -239
  204. package/dist/types-DyPQho_C.mjs +1 -0
  205. package/dist/types-o3zWarRp.cjs +0 -0
  206. package/dist/yaml-CIn2Gddw.mjs +1055 -0
  207. package/dist/yaml-CIn2Gddw.mjs.map +1 -0
  208. package/dist/yaml-CQSFMRMS.cjs +1054 -0
  209. package/package.json +9 -9
@@ -1,586 +1,13 @@
1
- import { loadEnvFromContext } from "../helpers/load.mjs";
2
- import { createReflectionResource } from "../helpers/create-reflection-resource.mjs";
3
- import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
4
- import { titleCase } from "@stryke/string-format/title-case";
5
- import defu from "defu";
6
- import { For, Show, code, computed, splitProps } from "@alloy-js/core";
7
- import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
8
- import { usePowerlinesSafe } from "@powerlines/plugin-alloy/core/contexts/context";
9
- import { ClassDeclaration, ClassMethod, ElseIfClause, FunctionDeclaration, IfStatement, NewExpression, TypeDeclaration, VarDeclaration } from "@alloy-js/typescript";
10
- import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
11
- import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
12
- import { TSDoc, TSDocExample, TSDocLink, TSDocParam, TSDocRemarks, TSDocReturns, TSDocThrows } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
13
- import { TypeScriptInterface } from "@powerlines/plugin-alloy/typescript/components/typescript-interface";
14
- import { TypescriptObject } from "@powerlines/plugin-alloy/typescript/components/typescript-object";
15
- import { isNull } from "@stryke/type-checks/is-null";
1
+ import "../runtime-C5ukCv3P.mjs";
2
+ import "../plugin-eBjQJP6x.mjs";
3
+ import "../join-paths-BMg51Ddi.mjs";
4
+ import "../persistence-BsBxs9wt.mjs";
5
+ import "../source-file-env-Tj-6qobx.mjs";
6
+ import "../defu-DV5Grr85.mjs";
7
+ import "../load-Dr5ybfL7.mjs";
8
+ import "../confbox.DA7CpUDY-DShUZ_rW.mjs";
9
+ import "../confbox.DnMsyigM-V6Wj0LPC.mjs";
10
+ import "../create-reflection-resource-B3friIs9.mjs";
11
+ import { n as EnvTypeDefinition, t as EnvBuiltin } from "../env-D9oCn-AS.mjs";
16
12
 
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 = usePowerlinesSafe();
24
- if (!context) return null;
25
- return [
26
- createComponent(TypeScriptInterface, {
27
- name: " EnvBase",
28
- defaultValue,
29
- reflection,
30
- "export": true
31
- }),
32
- createIntrinsic("hbr", {}),
33
- createIntrinsic("hbr", {}),
34
- createComponent(TSDoc, {
35
- heading: "The environment configuration object with prefixed keys.",
36
- get children() {
37
- return createComponent(TSDocRemarks, { children: `The \`Env\` type extends the \`EnvBase\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.` });
38
- }
39
- }),
40
- createComponent(TypeDeclaration, {
41
- name: "Env",
42
- "export": true,
43
- get children() {
44
- return code` {
45
- [Key in keyof EnvBase as Key ${context.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
46
- }
47
- `;
48
- }
49
- }),
50
- createIntrinsic("hbr", {}),
51
- createIntrinsic("hbr", {})
52
- ];
53
- }
54
- function ConfigPropertyConditional(props) {
55
- const [{ context, name }] = splitProps(props, ["context", "name"]);
56
- if (!context) return null;
57
- 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, "")}"`;
58
- }
59
- function ConfigPropertyGet(props) {
60
- const [{ context, property, index }] = splitProps(props, [
61
- "context",
62
- "property",
63
- "index"
64
- ]);
65
- if (!context) return null;
66
- return [index === 0 ? createComponent(IfStatement, {
67
- get condition() {
68
- return [createComponent(ConfigPropertyConditional, {
69
- get name() {
70
- return property.getNameAsString();
71
- },
72
- context
73
- }), createComponent(Show, {
74
- get when() {
75
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
76
- },
77
- get children() {
78
- return [code` || `, createComponent(For, {
79
- get each() {
80
- return property.getAlias();
81
- },
82
- joiner: code` || `,
83
- children: (alias) => createComponent(ConfigPropertyConditional, {
84
- name: alias,
85
- context
86
- })
87
- })];
88
- }
89
- })];
90
- },
91
- get children() {
92
- return code`return target["${property.getNameAsString()}"];`;
93
- }
94
- }) : createComponent(ElseIfClause, {
95
- get condition() {
96
- return [createComponent(ConfigPropertyConditional, {
97
- get name() {
98
- return property.getNameAsString();
99
- },
100
- context
101
- }), createComponent(Show, {
102
- get when() {
103
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
104
- },
105
- get children() {
106
- return [code` || `, createComponent(For, {
107
- get each() {
108
- return property.getAlias();
109
- },
110
- joiner: code` || `,
111
- children: (alias) => createComponent(ConfigPropertyConditional, {
112
- name: alias,
113
- context
114
- })
115
- })];
116
- }
117
- })];
118
- },
119
- get children() {
120
- return code`return target["${property.getNameAsString()}"];`;
121
- }
122
- })];
123
- }
124
- function ConfigPropertySet(props) {
125
- const [{ context, property, index }] = splitProps(props, [
126
- "context",
127
- "property",
128
- "index"
129
- ]);
130
- if (!context) return null;
131
- return [index === 0 ? createComponent(IfStatement, {
132
- get condition() {
133
- return [createComponent(ConfigPropertyConditional, {
134
- get name() {
135
- return property.getNameAsString();
136
- },
137
- context
138
- }), createComponent(Show, {
139
- get when() {
140
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
141
- },
142
- get children() {
143
- return [code` || `, createComponent(For, {
144
- get each() {
145
- return property.getAlias();
146
- },
147
- joiner: code` || `,
148
- children: (alias) => createComponent(ConfigPropertyConditional, {
149
- name: alias,
150
- context
151
- })
152
- })];
153
- }
154
- })];
155
- },
156
- get children() {
157
- return code`
158
- target["${property.getNameAsString()}"] = newValue;
159
- return true;
160
- `;
161
- }
162
- }) : createComponent(ElseIfClause, {
163
- get condition() {
164
- return [createComponent(ConfigPropertyConditional, {
165
- get name() {
166
- return property.getNameAsString();
167
- },
168
- context
169
- }), createComponent(Show, {
170
- get when() {
171
- return memo(() => !!property.getAlias())() && property.getAlias().length > 0;
172
- },
173
- get children() {
174
- return [code` || `, createComponent(For, {
175
- get each() {
176
- return property.getAlias();
177
- },
178
- joiner: code` || `,
179
- children: (alias) => createComponent(ConfigPropertyConditional, {
180
- name: alias,
181
- context
182
- })
183
- })];
184
- }
185
- })];
186
- },
187
- get children() {
188
- return code`
189
- target["${property.getNameAsString()}"] = newValue;
190
- return true;
191
- `;
192
- }
193
- })];
194
- }
195
- const createEnvRefkey = refkey("createEnv");
196
- const envRefkey = refkey("env");
197
- const envSerializerRefkey = refkey("EnvSerializer");
198
- /**
199
- * Generates the environment configuration module for the Powerlines project.
200
- */
201
- function EnvBuiltin(props) {
202
- const [{ defaultConfig, children }, rest] = splitProps(props, ["defaultConfig", "children"]);
203
- const context = usePowerlinesSafe();
204
- const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
205
- const reflection = createReflectionResource(context);
206
- const envInstance = computed(() => {
207
- return new ReflectionClass({
208
- kind: ReflectionKind.objectLiteral,
209
- description: `The initial environment configuration state for the ${titleCase(context?.config?.name)} project.`,
210
- types: []
211
- }, reflection.data ?? void 0);
212
- });
213
- const reflectionGetProperties = computed(() => reflection.data?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
214
- const reflectionSetProperties = computed(() => reflection.data?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
215
- return createComponent(BuiltinFile, mergeProps({
216
- id: "env",
217
- description: "The environment configuration module provides an interface to define environment configuration parameters."
218
- }, rest, {
219
- get imports() {
220
- return defu({ "@powerlines/deepkit/vendor/type": [
221
- "stringify",
222
- "serializer",
223
- "serializeFunction",
224
- "deserializeFunction",
225
- "ReflectionKind",
226
- "Serializer",
227
- "TemplateState",
228
- "Type",
229
- "TypeProperty",
230
- "TypePropertySignature"
231
- ] }, rest.imports ?? {});
232
- },
233
- get children() {
234
- return [
235
- createComponent(Show, {
236
- get when() {
237
- return !isNull(reflection.data);
238
- },
239
- get children() {
240
- return [
241
- createComponent(EnvTypeDefinition, {
242
- get defaultValue() {
243
- return defaultValue.value;
244
- },
245
- get reflection() {
246
- return reflection.data;
247
- }
248
- }),
249
- createIntrinsic("hbr", {}),
250
- createIntrinsic("hbr", {})
251
- ];
252
- }
253
- }),
254
- createComponent(TypescriptObject, {
255
- name: "initialEnv",
256
- type: "Partial<EnvBase>",
257
- defaultValue,
258
- reflection: envInstance,
259
- "export": true,
260
- "const": true,
261
- doc: "The initial environment configuration object values for the runtime."
262
- }),
263
- createIntrinsic("hbr", {}),
264
- createIntrinsic("hbr", {}),
265
- createComponent(TSDoc, {
266
- heading: "The environment configuration serializer for the Powerlines application.",
267
- get children() {
268
- return [
269
- createComponent(TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
270
- createComponent(TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
271
- createComponent(TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
272
- ];
273
- }
274
- }),
275
- createComponent(ClassDeclaration, {
276
- refkey: envSerializerRefkey,
277
- name: "EnvSerializer",
278
- "extends": "Serializer",
279
- "export": true,
280
- get children() {
281
- return createComponent(ClassMethod, {
282
- name: "constructor",
283
- "public": true,
284
- doc: "Initializes a new instance of the `EnvSerializer` class.",
285
- children: code`
286
- super("env");
287
-
288
- this.deserializeRegistry.register(
289
- ReflectionKind.boolean,
290
- (type: Type, state: TemplateState) => {
291
- state.addSetter(
292
- \`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()}\`
293
- );
294
- }
295
- );
296
- `
297
- });
298
- }
299
- }),
300
- createIntrinsic("hbr", {}),
301
- createIntrinsic("hbr", {}),
302
- createComponent(TSDoc, {
303
- heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
304
- get children() {
305
- return [
306
- createComponent(TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
307
- createComponent(TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
308
- createComponent(TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
309
- ];
310
- }
311
- }),
312
- createComponent(VarDeclaration, {
313
- name: "envSerializer",
314
- "export": false,
315
- "const": true,
316
- get initializer() {
317
- return createComponent(NewExpression, {
318
- args: [],
319
- target: "EnvSerializer"
320
- });
321
- }
322
- }),
323
- createIntrinsic("hbr", {}),
324
- createIntrinsic("hbr", {}),
325
- createComponent(TSDoc, {
326
- heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
327
- get children() {
328
- return [
329
- createComponent(TSDocRemarks, { children: `The resulting JSON object can be stringified using \`JSON.stringify()\`.` }),
330
- createComponent(TSDocExample, { children: `const json = serializeEnv(env);` }),
331
- createComponent(TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
332
- ];
333
- }
334
- }),
335
- createComponent(VarDeclaration, {
336
- name: "serializeEnv",
337
- "export": true,
338
- "const": true,
339
- initializer: "serializeFunction<EnvBase>(envSerializer)"
340
- }),
341
- createIntrinsic("hbr", {}),
342
- createIntrinsic("hbr", {}),
343
- createComponent(TSDoc, {
344
- heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
345
- get children() {
346
- return [
347
- createComponent(TSDocRemarks, { children: `Types that are already correct will be used as-is.` }),
348
- createComponent(TSDocExample, { children: `const env = deserializeEnv(json);` }),
349
- createComponent(TSDocThrows, { children: `ValidationError when deserialization fails.` })
350
- ];
351
- }
352
- }),
353
- createComponent(VarDeclaration, {
354
- name: "deserializeEnv",
355
- "export": true,
356
- "const": true,
357
- initializer: "deserializeFunction<EnvBase>(envSerializer)"
358
- }),
359
- createIntrinsic("hbr", {}),
360
- createIntrinsic("hbr", {}),
361
- createComponent(TSDoc, {
362
- heading: "Initializes the Powerlines environment configuration module.",
363
- get children() {
364
- return [
365
- createComponent(TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
366
- createComponent(TSDocParam, {
367
- name: "environmentConfig",
368
- children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
369
- }),
370
- createComponent(TSDocReturns, { children: `The initialized Powerlines configuration object.` })
371
- ];
372
- }
373
- }),
374
- createComponent(Show, {
375
- get when() {
376
- return Boolean(context?.entryPath);
377
- },
378
- get children() {
379
- return createComponent(FunctionDeclaration, {
380
- refkey: createEnvRefkey,
381
- async: false,
382
- "export": true,
383
- name: "createEnv",
384
- parameters: [{
385
- name: "environmentConfig",
386
- type: `Partial<Env>`,
387
- optional: false,
388
- default: "{}"
389
- }],
390
- returnType: "Env",
391
- get children() {
392
- return [
393
- code`
394
- return new Proxy<Env>(
395
- deserializeEnv({
396
- ...initialEnv,
397
- ...environmentConfig
398
- }) as Env,
399
- {
400
- get: (target: EnvBase, propertyName: string) => { `,
401
- createIntrinsic("hbr", {}),
402
- createComponent(For, {
403
- each: reflectionGetProperties,
404
- children: (property, index) => createComponent(ConfigPropertyGet, {
405
- index,
406
- context,
407
- property
408
- })
409
- }),
410
- code`
411
- return undefined;
412
- }, `,
413
- createIntrinsic("hbr", {}),
414
- createIntrinsic("hbr", {}),
415
- code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,
416
- createIntrinsic("hbr", {}),
417
- createComponent(For, {
418
- each: reflectionSetProperties,
419
- ender: code` else `,
420
- children: (property, index) => createComponent(ConfigPropertySet, {
421
- index,
422
- context,
423
- property
424
- })
425
- }),
426
- createIntrinsic("hbr", {}),
427
- code`return false;
428
- }
429
- }
430
- );
431
- `
432
- ];
433
- }
434
- });
435
- }
436
- }),
437
- createIntrinsic("hbr", {}),
438
- createIntrinsic("hbr", {}),
439
- createIntrinsic("hbr", {}),
440
- createComponent(TSDoc, {
441
- heading: "The environment configuration object.",
442
- get children() {
443
- return createComponent(TSDocRemarks, { children: `This object provides access to the environment configuration parameters in the application runtime.` });
444
- }
445
- }),
446
- createComponent(VarDeclaration, {
447
- refkey: envRefkey,
448
- name: "env",
449
- type: "Env",
450
- "export": true,
451
- "const": true,
452
- get initializer() {
453
- return [code`createEnv(${defaultConfig || "{}"} as Partial<Env>);`];
454
- }
455
- }),
456
- createIntrinsic("hbr", {}),
457
- createIntrinsic("hbr", {}),
458
- createComponent(VarDeclaration, {
459
- "export": true,
460
- "const": true,
461
- name: "isCI",
462
- doc: "Detect if the application is running in a continuous integration (CI) environment.",
463
- initializer: code`Boolean(
464
- env.CI ||
465
- env.RUN_ID ||
466
- env.AGOLA_GIT_REF ||
467
- env.AC_APPCIRCLE ||
468
- env.APPVEYOR ||
469
- env.CODEBUILD ||
470
- env.TF_BUILD ||
471
- env.bamboo_planKey ||
472
- env.BITBUCKET_COMMIT ||
473
- env.BITRISE_IO ||
474
- env.BUDDY_WORKSPACE_ID ||
475
- env.BUILDKITE ||
476
- env.CIRCLECI ||
477
- env.CIRRUS_CI ||
478
- env.CF_BUILD_ID ||
479
- env.CM_BUILD_ID ||
480
- env.CI_NAME ||
481
- env.DRONE ||
482
- env.DSARI ||
483
- env.EARTHLY_CI ||
484
- env.EAS_BUILD ||
485
- env.GERRIT_PROJECT ||
486
- env.GITEA_ACTIONS ||
487
- env.GITHUB_ACTIONS ||
488
- env.GITLAB_CI ||
489
- env.GOCD ||
490
- env.BUILDER_OUTPUT ||
491
- env.HARNESS_BUILD_ID ||
492
- env.JENKINS_URL ||
493
- env.LAYERCI ||
494
- env.MAGNUM ||
495
- env.NETLIFY ||
496
- env.NEVERCODE ||
497
- env.PROW_JOB_ID ||
498
- env.RELEASE_BUILD_ID ||
499
- env.RENDER ||
500
- env.SAILCI ||
501
- env.HUDSON ||
502
- env.SCREWDRIVER ||
503
- env.SEMAPHORE ||
504
- env.SOURCEHUT ||
505
- env.STRIDER ||
506
- env.TASK_ID ||
507
- env.RUN_ID ||
508
- env.TEAMCITY_VERSION ||
509
- env.TRAVIS ||
510
- env.VELA ||
511
- env.NOW_BUILDER ||
512
- env.APPCENTER_BUILD_ID ||
513
- env.CI_XCODE_PROJECT ||
514
- env.XCS || false
515
- );
516
- `
517
- }),
518
- createIntrinsic("hbr", {}),
519
- createIntrinsic("hbr", {}),
520
- createComponent(TSDoc, {
521
- heading: "Detect the \\`mode\\` of the current runtime environment.",
522
- get children() {
523
- 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, it is generally recommended to only allow a value in the following list:
524
- - \`production\`
525
- - \`test\`
526
- - \`development\`
527
- ` });
528
- }
529
- }),
530
- createComponent(VarDeclaration, {
531
- "export": true,
532
- "const": true,
533
- name: "mode",
534
- initializer: code`String(env.MODE) || "production"; `
535
- }),
536
- createIntrinsic("hbr", {}),
537
- createIntrinsic("hbr", {}),
538
- createComponent(VarDeclaration, {
539
- "export": true,
540
- "const": true,
541
- name: "isProduction",
542
- doc: "Detect if the application is running in `\"production\"` mode",
543
- initializer: code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
544
- }),
545
- createIntrinsic("hbr", {}),
546
- createIntrinsic("hbr", {}),
547
- createComponent(VarDeclaration, {
548
- "export": true,
549
- "const": true,
550
- name: "isTest",
551
- doc: "Detect if the application is running in `\"test\"` mode",
552
- initializer: code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
553
- }),
554
- createIntrinsic("hbr", {}),
555
- createIntrinsic("hbr", {}),
556
- createComponent(VarDeclaration, {
557
- "export": true,
558
- "const": true,
559
- name: "isDevelopment",
560
- doc: "Detect if the application is running in `\"development\"` mode",
561
- initializer: code`["dev", "development"].includes(mode.toLowerCase()); `
562
- }),
563
- createIntrinsic("hbr", {}),
564
- createIntrinsic("hbr", {}),
565
- createComponent(VarDeclaration, {
566
- "export": true,
567
- "const": true,
568
- name: "isDebug",
569
- doc: "Detect if the application is currently being debugged",
570
- initializer: code`Boolean(isDevelopment && env.DEBUG); `
571
- }),
572
- createIntrinsic("hbr", {}),
573
- createIntrinsic("hbr", {}),
574
- createComponent(Show, {
575
- get when() {
576
- return Boolean(children);
577
- },
578
- children
579
- })
580
- ];
581
- }
582
- }));
583
- }
584
-
585
- //#endregion
586
13
  export { EnvBuiltin, EnvTypeDefinition };
@@ -1,6 +1,18 @@
1
- const require_components_docs = require('./docs.cjs');
2
- const require_components_env = require('./env.cjs');
1
+ require('../runtime-g0TEIoZK.cjs');
2
+ require('../plugin-CM1TSv1B.cjs');
3
+ require('../join-paths-Bc4rM2TX.cjs');
4
+ require('../persistence-D_clXRxP.cjs');
5
+ require('../source-file-env-4Vdtzc5-.cjs');
6
+ require('../defu-CrqNIh1A.cjs');
7
+ require('../load-DPB0maqs.cjs');
8
+ require('../confbox.DA7CpUDY-r6FXRsI6.cjs');
9
+ require('../confbox.DnMsyigM-C13n3X-S.cjs');
10
+ require('../create-reflection-resource-BJj83ii4.cjs');
11
+ require('../docs-helper-4MoQ5-R3.cjs');
12
+ const require_docs = require('../docs-B-SDRHeg.cjs');
13
+ const require_env = require('../env-R63eR4RP.cjs');
14
+ require('../components-BUo6Koax.cjs');
3
15
 
4
- exports.EnvBuiltin = require_components_env.EnvBuiltin;
5
- exports.EnvDocsFile = require_components_docs.EnvDocsFile;
6
- exports.EnvTypeDefinition = require_components_env.EnvTypeDefinition;
16
+ exports.EnvBuiltin = require_env.EnvBuiltin;
17
+ exports.EnvDocsFile = require_docs.EnvDocsFile;
18
+ exports.EnvTypeDefinition = require_env.EnvTypeDefinition;
@@ -1,3 +1,4 @@
1
- import { EnvDocsFile, EnvDocsFileProps, __ΩEnvDocsFileProps } from "./docs.cjs";
2
- import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./env.cjs";
1
+ import { n as EnvDocsFileProps, r as __ΩEnvDocsFileProps, t as EnvDocsFile } from "../docs-DMfzQuvP.cjs";
2
+ import { i as __ΩEnvBuiltinProps, n as EnvBuiltinProps, r as EnvTypeDefinition, t as EnvBuiltin } from "../env-BIyd8CTA.cjs";
3
+ import "../index-uTS5iDq_.cjs";
3
4
  export { EnvBuiltin, EnvBuiltinProps, EnvDocsFile, EnvDocsFileProps, EnvTypeDefinition, __ΩEnvBuiltinProps, __ΩEnvDocsFileProps };
@@ -1,3 +1,4 @@
1
- import { EnvDocsFile, EnvDocsFileProps, __ΩEnvDocsFileProps } from "./docs.mjs";
2
- import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./env.mjs";
1
+ import { n as EnvDocsFileProps, r as __ΩEnvDocsFileProps, t as EnvDocsFile } from "../docs-B0d8pdIg.mjs";
2
+ import { i as __ΩEnvBuiltinProps, n as EnvBuiltinProps, r as EnvTypeDefinition, t as EnvBuiltin } from "../env-BKmI7DyR.mjs";
3
+ import "../index-BNRXMhlr.mjs";
3
4
  export { EnvBuiltin, EnvBuiltinProps, EnvDocsFile, EnvDocsFileProps, EnvTypeDefinition, __ΩEnvBuiltinProps, __ΩEnvDocsFileProps };
@@ -1,4 +1,16 @@
1
- import { EnvDocsFile } from "./docs.mjs";
2
- import { EnvBuiltin, EnvTypeDefinition } from "./env.mjs";
1
+ import "../runtime-C5ukCv3P.mjs";
2
+ import "../plugin-eBjQJP6x.mjs";
3
+ import "../join-paths-BMg51Ddi.mjs";
4
+ import "../persistence-BsBxs9wt.mjs";
5
+ import "../source-file-env-Tj-6qobx.mjs";
6
+ import "../defu-DV5Grr85.mjs";
7
+ import "../load-Dr5ybfL7.mjs";
8
+ import "../confbox.DA7CpUDY-DShUZ_rW.mjs";
9
+ import "../confbox.DnMsyigM-V6Wj0LPC.mjs";
10
+ import "../create-reflection-resource-B3friIs9.mjs";
11
+ import "../docs-helper-2fe7M3Th.mjs";
12
+ import { t as EnvDocsFile } from "../docs-DbRoWmL_.mjs";
13
+ import { n as EnvTypeDefinition, t as EnvBuiltin } from "../env-D9oCn-AS.mjs";
14
+ import "../components-DDFmImcI.mjs";
3
15
 
4
16
  export { EnvBuiltin, EnvDocsFile, EnvTypeDefinition };
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,23 @@
1
+ //#region ../../node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs
2
+ const m = Symbol.for("__confbox_fmt__"), k = /^(\s+)/, v = /(\s+)$/;
3
+ function x(e, t = {}) {
4
+ return {
5
+ sample: t.indent === void 0 && t.preserveIndentation !== !1 && e.slice(0, t?.sampleSize || 1024),
6
+ whiteSpace: t.preserveWhitespace === !1 ? void 0 : {
7
+ start: k.exec(e)?.[0] || "",
8
+ end: v.exec(e)?.[0] || ""
9
+ }
10
+ };
11
+ }
12
+ function N(e, t, n) {
13
+ !t || typeof t != "object" || Object.defineProperty(t, m, {
14
+ enumerable: !1,
15
+ configurable: !0,
16
+ writable: !0,
17
+ value: x(e, n)
18
+ });
19
+ }
20
+
21
+ //#endregion
22
+ export { N as t };
23
+ //# sourceMappingURL=confbox.DA7CpUDY-DShUZ_rW.mjs.map