@powerlines/plugin-env 0.16.133 → 0.16.135

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.
@@ -50,54 +50,72 @@ function __assignType(fn, args) {
50
50
  function EnvTypeDefinition(props) {
51
51
  const [{ defaultValue, reflection }] = (0, _alloy_js_core.splitProps)(props, ["defaultValue", "reflection"]);
52
52
  const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [[() => require_types_plugin.__ΩEnvPluginContext, "n!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
53
- return (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
54
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
53
+ return [
54
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
55
55
  name: "UnprefixedEnv",
56
56
  defaultValue,
57
57
  reflection,
58
- export: true
58
+ "export": true
59
59
  }),
60
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
61
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
60
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
61
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
62
62
  heading: "The environment configuration object with prefixed keys.",
63
- children: (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`UnprefixedEnv\` 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.` })
63
+ get children() {
64
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`UnprefixedEnv\` 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.` });
65
+ }
64
66
  }),
65
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.InterfaceDeclaration, {
67
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
66
68
  name: "Env",
67
- export: true,
68
- extends: "UnprefixedEnv",
69
- children: (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
70
- each: (0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_$/, ""), [
71
- "prefix",
72
- "",
73
- "P\"2!\"/\""
74
- ])),
75
- doubleHardline: true,
76
- children: __assignType((prefix) => (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
77
- each: reflection?.getProperties().filter(__assignType((property) => !property.isIgnored(), [
78
- "property",
79
- "",
80
- "P\"2!\"/\""
81
- ])) ?? [],
69
+ "export": true,
70
+ "extends": "UnprefixedEnv",
71
+ get children() {
72
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
73
+ get each() {
74
+ return (0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_$/, ""), [
75
+ "prefix",
76
+ "",
77
+ "P\"2!\"/\""
78
+ ]));
79
+ },
82
80
  doubleHardline: true,
83
- children: __assignType((property) => (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [(0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc_reflection.TSDocReflectionProperty, { reflection: property }), (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.InterfaceMember, {
84
- name: `${prefix}_${property.getNameAsString()}`,
85
- type: `UnprefixedEnv["${property.getNameAsString()}"]`,
86
- readonly: property.isReadonly()
87
- })] }), [
88
- "property",
89
- "",
90
- "P\"2!\"/\""
91
- ])
92
- }), [
93
- "prefix",
94
- "",
95
- "P\"2!\"/\""
96
- ])
97
- })
81
+ get children() {
82
+ return __assignType((prefix) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
83
+ get each() {
84
+ return reflection?.getProperties().filter(__assignType((property) => !property.isIgnored(), [
85
+ "property",
86
+ "",
87
+ "P\"2!\"/\""
88
+ ])) ?? [];
89
+ },
90
+ doubleHardline: true,
91
+ get children() {
92
+ return __assignType((property) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc_reflection.TSDocReflectionProperty, { reflection: property }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
93
+ get name() {
94
+ return `${prefix}_${property.getNameAsString()}`;
95
+ },
96
+ get type() {
97
+ return `UnprefixedEnv["${property.getNameAsString()}"]`;
98
+ },
99
+ get readonly() {
100
+ return property.isReadonly();
101
+ }
102
+ })], [
103
+ "property",
104
+ "",
105
+ "P\"2!\"/\""
106
+ ]);
107
+ }
108
+ }), [
109
+ "prefix",
110
+ "",
111
+ "P\"2!\"/\""
112
+ ]);
113
+ }
114
+ });
115
+ }
98
116
  }),
99
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
100
- ] });
117
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
118
+ ];
101
119
  }
102
120
  EnvTypeDefinition.__type = [
103
121
  () => __ΩOmit,
@@ -147,47 +165,75 @@ function ConfigPropertyGet(props) {
147
165
  "property",
148
166
  "index"
149
167
  ]);
150
- return (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: index === 0 ? (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.IfStatement, {
151
- condition: (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [(0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
152
- name: property.getNameAsString(),
153
- context
154
- }), (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
155
- when: property.getAlias() && property.getAlias().length > 0,
156
- children: [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
157
- each: property.getAlias(),
158
- joiner: _alloy_js_core.code` || `,
159
- children: __assignType((alias) => (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
160
- name: alias,
161
- context
162
- }), [
163
- "alias",
164
- "",
165
- "P\"2!\"/\""
166
- ])
167
- })]
168
- })] }),
169
- children: _alloy_js_core.code`return target["${property.getNameAsString()}"];`
170
- }) : (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ElseIfClause, {
171
- condition: (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [(0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
172
- name: property.getNameAsString(),
173
- context
174
- }), (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
175
- when: property.getAlias() && property.getAlias().length > 0,
176
- children: [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
177
- each: property.getAlias(),
178
- joiner: _alloy_js_core.code` || `,
179
- children: __assignType((alias) => (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
180
- name: alias,
181
- context
182
- }), [
183
- "alias",
184
- "",
185
- "P\"2!\"/\""
186
- ])
187
- })]
188
- })] }),
189
- children: _alloy_js_core.code`return target["${property.getNameAsString()}"];`
190
- }) });
168
+ return [index === 0 ? (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
169
+ get condition() {
170
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
171
+ get name() {
172
+ return property.getNameAsString();
173
+ },
174
+ context
175
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
176
+ get when() {
177
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
178
+ },
179
+ get children() {
180
+ return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
181
+ get each() {
182
+ return property.getAlias();
183
+ },
184
+ joiner: _alloy_js_core.code` || `,
185
+ get children() {
186
+ return __assignType((alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
187
+ name: alias,
188
+ context
189
+ }), [
190
+ "alias",
191
+ "",
192
+ "P\"2!\"/\""
193
+ ]);
194
+ }
195
+ })];
196
+ }
197
+ })];
198
+ },
199
+ get children() {
200
+ return _alloy_js_core.code`return target["${property.getNameAsString()}"];`;
201
+ }
202
+ }) : (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
203
+ get condition() {
204
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
205
+ get name() {
206
+ return property.getNameAsString();
207
+ },
208
+ context
209
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
210
+ get when() {
211
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
212
+ },
213
+ get children() {
214
+ return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
215
+ get each() {
216
+ return property.getAlias();
217
+ },
218
+ joiner: _alloy_js_core.code` || `,
219
+ get children() {
220
+ return __assignType((alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
221
+ name: alias,
222
+ context
223
+ }), [
224
+ "alias",
225
+ "",
226
+ "P\"2!\"/\""
227
+ ]);
228
+ }
229
+ })];
230
+ }
231
+ })];
232
+ },
233
+ get children() {
234
+ return _alloy_js_core.code`return target["${property.getNameAsString()}"];`;
235
+ }
236
+ })];
191
237
  }
192
238
  ConfigPropertyGet.__type = [
193
239
  () => __ΩConfigPropertyProps,
@@ -201,53 +247,81 @@ function ConfigPropertySet(props) {
201
247
  "property",
202
248
  "index"
203
249
  ]);
204
- return (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: index === 0 ? (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.IfStatement, {
205
- condition: (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [(0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
206
- name: property.getNameAsString(),
207
- context
208
- }), (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
209
- when: property.getAlias() && property.getAlias().length > 0,
210
- children: [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
211
- each: property.getAlias(),
212
- joiner: _alloy_js_core.code` || `,
213
- children: __assignType((alias) => (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
214
- name: alias,
215
- context
216
- }), [
217
- "alias",
218
- "",
219
- "P\"2!\"/\""
220
- ])
221
- })]
222
- })] }),
223
- children: _alloy_js_core.code`
250
+ return [index === 0 ? (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
251
+ get condition() {
252
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
253
+ get name() {
254
+ return property.getNameAsString();
255
+ },
256
+ context
257
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
258
+ get when() {
259
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
260
+ },
261
+ get children() {
262
+ return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
263
+ get each() {
264
+ return property.getAlias();
265
+ },
266
+ joiner: _alloy_js_core.code` || `,
267
+ get children() {
268
+ return __assignType((alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
269
+ name: alias,
270
+ context
271
+ }), [
272
+ "alias",
273
+ "",
274
+ "P\"2!\"/\""
275
+ ]);
276
+ }
277
+ })];
278
+ }
279
+ })];
280
+ },
281
+ get children() {
282
+ return _alloy_js_core.code`
224
283
  target["${property.getNameAsString()}"] = newValue;
225
284
  return true;
226
- `
227
- }) : (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ElseIfClause, {
228
- condition: (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [(0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
229
- name: property.getNameAsString(),
230
- context
231
- }), (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
232
- when: property.getAlias() && property.getAlias().length > 0,
233
- children: [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
234
- each: property.getAlias(),
235
- joiner: _alloy_js_core.code` || `,
236
- children: __assignType((alias) => (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
237
- name: alias,
238
- context
239
- }), [
240
- "alias",
241
- "",
242
- "P\"2!\"/\""
243
- ])
244
- })]
245
- })] }),
246
- children: _alloy_js_core.code`
285
+ `;
286
+ }
287
+ }) : (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
288
+ get condition() {
289
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
290
+ get name() {
291
+ return property.getNameAsString();
292
+ },
293
+ context
294
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
295
+ get when() {
296
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
297
+ },
298
+ get children() {
299
+ return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
300
+ get each() {
301
+ return property.getAlias();
302
+ },
303
+ joiner: _alloy_js_core.code` || `,
304
+ get children() {
305
+ return __assignType((alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
306
+ name: alias,
307
+ context
308
+ }), [
309
+ "alias",
310
+ "",
311
+ "P\"2!\"/\""
312
+ ]);
313
+ }
314
+ })];
315
+ }
316
+ })];
317
+ },
318
+ get children() {
319
+ return _alloy_js_core.code`
247
320
  target["${property.getNameAsString()}"] = newValue;
248
321
  return true;
249
- `
250
- }) });
322
+ `;
323
+ }
324
+ })];
251
325
  }
252
326
  ConfigPropertySet.__type = [
253
327
  () => __ΩConfigPropertyProps,
@@ -317,61 +391,71 @@ function EnvBuiltin(props) {
317
391
  "",
318
392
  "P\"2!\"2\"\"/#"
319
393
  ])) ?? []);
320
- return (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, {
394
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
321
395
  id: "env",
322
- description: "The environment configuration module provides an interface to define environment configuration parameters.",
323
- ...rest,
324
- imports: (0, defu.default)({ "@powerlines/deepkit/vendor/type": [
325
- "serializeFunction",
326
- "deserializeFunction",
327
- "ReflectionKind",
328
- "Serializer",
329
- "NamingStrategy",
330
- "TemplateState",
331
- "Type",
332
- "TypeProperty",
333
- "TypePropertySignature"
334
- ] }, rest.imports ?? {}),
335
- children: [
336
- (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
337
- when: Boolean(reflection),
338
- children: [
339
- (0, _alloy_js_core_jsx_runtime.jsx)(EnvTypeDefinition, {
340
- defaultValue,
341
- reflection
342
- }),
343
- (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
344
- (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
345
- ]
346
- }),
347
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_object_declaration.ObjectDeclaration, {
348
- name: "initialEnv",
349
- type: "Partial<Env>",
350
- defaultValue,
351
- reflection: envInstance,
352
- export: true,
353
- const: true,
354
- doc: "The initial environment configuration object values for the runtime."
355
- }),
356
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
357
- (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
358
- heading: "The environment configuration serializer for the Powerlines application.",
359
- children: [
360
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
361
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
362
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
363
- ]
364
- }),
365
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ClassDeclaration, {
366
- refkey: envSerializerRefkey,
367
- name: "EnvSerializer",
368
- extends: "Serializer",
369
- export: true,
370
- children: (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ClassMethod, {
371
- name: "constructor",
372
- public: true,
373
- doc: "Initializes a new instance of the `EnvSerializer` class.",
374
- children: _alloy_js_core.code`super("env");
396
+ description: "The environment configuration module provides an interface to define environment configuration parameters."
397
+ }, rest, {
398
+ get imports() {
399
+ return (0, defu.default)({ "@powerlines/deepkit/vendor/type": [
400
+ "serializeFunction",
401
+ "deserializeFunction",
402
+ "ReflectionKind",
403
+ "Serializer",
404
+ "NamingStrategy",
405
+ "TemplateState",
406
+ "Type",
407
+ "TypeProperty",
408
+ "TypePropertySignature"
409
+ ] }, rest.imports ?? {});
410
+ },
411
+ get children() {
412
+ return [
413
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
414
+ get when() {
415
+ return Boolean(reflection);
416
+ },
417
+ get children() {
418
+ return [
419
+ (0, _alloy_js_core_jsx_runtime.createComponent)(EnvTypeDefinition, {
420
+ defaultValue,
421
+ reflection
422
+ }),
423
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
424
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
425
+ ];
426
+ }
427
+ }),
428
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_object_declaration.ObjectDeclaration, {
429
+ name: "initialEnv",
430
+ type: "Partial<Env>",
431
+ defaultValue,
432
+ reflection: envInstance,
433
+ "export": true,
434
+ "const": true,
435
+ doc: "The initial environment configuration object values for the runtime."
436
+ }),
437
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
438
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
439
+ heading: "The environment configuration serializer for the Powerlines application.",
440
+ get children() {
441
+ return [
442
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
443
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
444
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
445
+ ];
446
+ }
447
+ }),
448
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ClassDeclaration, {
449
+ refkey: envSerializerRefkey,
450
+ name: "EnvSerializer",
451
+ "extends": "Serializer",
452
+ "export": true,
453
+ get children() {
454
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ClassMethod, {
455
+ name: "constructor",
456
+ "public": true,
457
+ doc: "Initializes a new instance of the `EnvSerializer` class.",
458
+ children: _alloy_js_core.code`super("env");
375
459
 
376
460
  this.deserializeRegistry.register(
377
461
  ReflectionKind.boolean,
@@ -381,14 +465,16 @@ function EnvBuiltin(props) {
381
465
  );
382
466
  }
383
467
  ); `
384
- })
385
- }),
386
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
387
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
388
- name: "envNamingStrategy",
389
- const: true,
390
- doc: "The environment naming strategy for the runtime.",
391
- initializer: _alloy_js_core.code`new class extends NamingStrategy {
468
+ });
469
+ }
470
+ }),
471
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
472
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
473
+ name: "envNamingStrategy",
474
+ "const": true,
475
+ doc: "The environment naming strategy for the runtime.",
476
+ get initializer() {
477
+ return _alloy_js_core.code`new class extends NamingStrategy {
392
478
  constructor() {
393
479
  super("env");
394
480
  }
@@ -400,112 +486,127 @@ function EnvBuiltin(props) {
400
486
  }
401
487
 
402
488
  return name.replace(/^(${(0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_$/, ""), [
403
- "prefix",
404
- "",
405
- "P\"2!\"/\""
406
- ])).join("|")})_/, "");
489
+ "prefix",
490
+ "",
491
+ "P\"2!\"/\""
492
+ ])).join("|")})_/, "");
407
493
  }
408
- }; `
409
- }),
410
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
411
- (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
412
- heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
413
- children: [
414
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
415
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
416
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
417
- ]
418
- }),
419
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
420
- name: "envSerializer",
421
- const: true,
422
- initializer: (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.NewExpression, {
423
- args: [],
424
- target: "EnvSerializer"
425
- })
426
- }),
427
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
428
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
429
- name: "_serializeEnv",
430
- const: true,
431
- initializer: "serializeFunction<Env>(envSerializer, envNamingStrategy)"
432
- }),
433
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
434
- (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
435
- heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
436
- children: [
437
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The resulting JSON object can be stringified using \`JSON.stringify()\`.` }),
438
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const json = serializeEnv(env);` }),
439
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
440
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
494
+ }; `;
495
+ }
496
+ }),
497
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
498
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
499
+ heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
500
+ get children() {
501
+ return [
502
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
503
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
504
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
505
+ ];
506
+ }
507
+ }),
508
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
509
+ name: "envSerializer",
510
+ "const": true,
511
+ get initializer() {
512
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.NewExpression, {
513
+ args: [],
514
+ target: "EnvSerializer"
515
+ });
516
+ }
517
+ }),
518
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
519
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
520
+ name: "_serializeEnv",
521
+ "const": true,
522
+ initializer: "serializeFunction<Env>(envSerializer, envNamingStrategy)"
523
+ }),
524
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
525
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
526
+ heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
527
+ get children() {
528
+ return [
529
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The resulting JSON object can be stringified using \`JSON.stringify()\`.` }),
530
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const json = serializeEnv(env);` }),
531
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
532
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
533
+ name: "input",
534
+ children: `The environment configuration object to serialize.`
535
+ }),
536
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The serialized environment configuration as JSON data objects.` }),
537
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
538
+ ];
539
+ }
540
+ }),
541
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
542
+ name: "serializeEnv",
543
+ "export": true,
544
+ parameters: [{
441
545
  name: "input",
442
- children: `The environment configuration object to serialize.`
443
- }),
444
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The serialized environment configuration as JSON data objects.` }),
445
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
446
- ]
447
- }),
448
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.FunctionDeclaration, {
449
- name: "serializeEnv",
450
- export: true,
451
- parameters: [{
452
- name: "input",
453
- type: "Env"
454
- }],
455
- children: _alloy_js_core.code` return _serializeEnv(input, { loosely: true }); `
456
- }),
457
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
458
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
459
- name: "_deserializeEnv",
460
- const: true,
461
- initializer: "deserializeFunction<Env>(envSerializer, envNamingStrategy)"
462
- }),
463
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
464
- (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
465
- heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
466
- children: [
467
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `Types that are already correct will be used as-is.` }),
468
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const env = deserializeEnv(json);` }),
469
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when deserialization fails.` })
470
- ]
471
- }),
472
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.FunctionDeclaration, {
473
- name: "deserializeEnv",
474
- export: true,
475
- parameters: [{
476
- name: "input",
477
- type: "Env"
478
- }],
479
- children: _alloy_js_core.code` return _deserializeEnv(input, { loosely: true }); `
480
- }),
481
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
482
- (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
483
- heading: "Initializes the Powerlines environment configuration module.",
484
- children: [
485
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
486
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
487
- name: "environmentConfig",
488
- children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
489
- }),
490
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The initialized Powerlines configuration object.` })
491
- ]
492
- }),
493
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
494
- when: Boolean(context?.entryPath),
495
- children: (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_typescript.FunctionDeclaration, {
496
- refkey: createEnvRefkey,
497
- async: false,
498
- export: true,
499
- name: "createEnv",
546
+ type: "Env"
547
+ }],
548
+ children: _alloy_js_core.code` return _serializeEnv(input, { loosely: true }); `
549
+ }),
550
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
551
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
552
+ name: "_deserializeEnv",
553
+ "const": true,
554
+ initializer: "deserializeFunction<Env>(envSerializer, envNamingStrategy)"
555
+ }),
556
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
557
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
558
+ heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
559
+ get children() {
560
+ return [
561
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `Types that are already correct will be used as-is.` }),
562
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const env = deserializeEnv(json);` }),
563
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when deserialization fails.` })
564
+ ];
565
+ }
566
+ }),
567
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
568
+ name: "deserializeEnv",
569
+ "export": true,
500
570
  parameters: [{
501
- name: "environmentConfig",
502
- type: `Partial<Env>`,
503
- optional: false,
504
- default: "{}"
571
+ name: "input",
572
+ type: "Env"
505
573
  }],
506
- returnType: "Env",
507
- children: [
508
- _alloy_js_core.code`
574
+ children: _alloy_js_core.code` return _deserializeEnv(input, { loosely: true }); `
575
+ }),
576
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
577
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
578
+ heading: "Initializes the Powerlines environment configuration module.",
579
+ get children() {
580
+ return [
581
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
582
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
583
+ name: "environmentConfig",
584
+ children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
585
+ }),
586
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The initialized Powerlines configuration object.` })
587
+ ];
588
+ }
589
+ }),
590
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
591
+ get when() {
592
+ return Boolean(context?.entryPath);
593
+ },
594
+ get children() {
595
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
596
+ refkey: createEnvRefkey,
597
+ async: false,
598
+ "export": true,
599
+ name: "createEnv",
600
+ parameters: [{
601
+ name: "environmentConfig",
602
+ type: `Partial<Env>`,
603
+ optional: false,
604
+ default: "{}"
605
+ }],
606
+ returnType: "Env",
607
+ get children() {
608
+ return [
609
+ _alloy_js_core.code`
509
610
  return new Proxy<Env>(
510
611
  deserializeEnv({
511
612
  ...initialEnv,
@@ -513,70 +614,80 @@ function EnvBuiltin(props) {
513
614
  } as Env),
514
615
  {
515
616
  get: (target: UnprefixedEnv, propertyName: string) => { `,
516
- (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
517
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
518
- each: reflectionGetProperties,
519
- children: __assignType((property, index) => (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyGet, {
520
- index,
521
- context,
522
- property
523
- }), [
524
- "property",
525
- "index",
526
- "",
527
- "P!2!'2\"\"/#"
528
- ])
529
- }),
530
- _alloy_js_core.code`
617
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
618
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
619
+ each: reflectionGetProperties,
620
+ get children() {
621
+ return __assignType((property, index) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyGet, {
622
+ index,
623
+ context,
624
+ property
625
+ }), [
626
+ "property",
627
+ "index",
628
+ "",
629
+ "P!2!'2\"\"/#"
630
+ ]);
631
+ }
632
+ }),
633
+ _alloy_js_core.code`
531
634
  return undefined;
532
635
  }, `,
533
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
534
- _alloy_js_core.code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `,
535
- (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
536
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
537
- each: reflectionSetProperties,
538
- ender: _alloy_js_core.code` else `,
539
- children: __assignType((property, index) => (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertySet, {
540
- index,
541
- context,
542
- property
543
- }), [
544
- "property",
545
- "index",
546
- "",
547
- "P!2!'2\"\"/#"
548
- ])
549
- }),
550
- (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
551
- _alloy_js_core.code`return false;
636
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
637
+ _alloy_js_core.code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `,
638
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
639
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
640
+ each: reflectionSetProperties,
641
+ ender: _alloy_js_core.code` else `,
642
+ get children() {
643
+ return __assignType((property, index) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertySet, {
644
+ index,
645
+ context,
646
+ property
647
+ }), [
648
+ "property",
649
+ "index",
650
+ "",
651
+ "P!2!'2\"\"/#"
652
+ ]);
653
+ }
654
+ }),
655
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
656
+ _alloy_js_core.code`return false;
552
657
  }
553
658
  }
554
659
  );
555
660
  `
556
- ]
557
- })
558
- }),
559
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
560
- (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
561
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
562
- heading: "The environment configuration object.",
563
- children: (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This object provides access to the environment configuration parameters in the application runtime.` })
564
- }),
565
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
566
- refkey: envRefkey,
567
- name: "env",
568
- type: "Env",
569
- export: true,
570
- const: true,
571
- initializer: (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: _alloy_js_core.code`createEnv(${defaultConfig || "{}"} as Partial<Env>);` })
572
- }),
573
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
574
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
575
- export: true,
576
- const: true,
577
- name: "isCI",
578
- doc: "Detect if the application is running in a continuous integration (CI) environment.",
579
- initializer: _alloy_js_core.code`Boolean(
661
+ ];
662
+ }
663
+ });
664
+ }
665
+ }),
666
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
667
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
668
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
669
+ heading: "The environment configuration object.",
670
+ get children() {
671
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This object provides access to the environment configuration parameters in the application runtime.` });
672
+ }
673
+ }),
674
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
675
+ refkey: envRefkey,
676
+ name: "env",
677
+ type: "Env",
678
+ "export": true,
679
+ "const": true,
680
+ get initializer() {
681
+ return [_alloy_js_core.code`createEnv(${defaultConfig || "{}"} as Partial<Env>);`];
682
+ }
683
+ }),
684
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
685
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
686
+ "export": true,
687
+ "const": true,
688
+ name: "isCI",
689
+ doc: "Detect if the application is running in a continuous integration (CI) environment.",
690
+ initializer: _alloy_js_core.code`Boolean(
580
691
  env.CI ||
581
692
  env.RUN_ID ||
582
693
  env.AGOLA_GIT_REF ||
@@ -629,61 +740,66 @@ function EnvBuiltin(props) {
629
740
  env.CI_XCODE_PROJECT ||
630
741
  env.XCS || false
631
742
  ); `
632
- }),
633
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
634
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
635
- heading: "Detect the \\`mode\\` of the current runtime environment.",
636
- children: (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.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:
743
+ }),
744
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
745
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
746
+ heading: "Detect the \\`mode\\` of the current runtime environment.",
747
+ get children() {
748
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.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:
637
749
  - \`production\`
638
750
  - \`test\`
639
751
  - \`development\`
640
- ` })
641
- }),
642
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
643
- export: true,
644
- const: true,
645
- name: "mode",
646
- initializer: _alloy_js_core.code`String(env.MODE) || "production"; `
647
- }),
648
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
649
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
650
- export: true,
651
- const: true,
652
- name: "isProduction",
653
- doc: "Detect if the application is running in `\"production\"` mode",
654
- initializer: _alloy_js_core.code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
655
- }),
656
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
657
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
658
- export: true,
659
- const: true,
660
- name: "isTest",
661
- doc: "Detect if the application is running in `\"test\"` mode",
662
- initializer: _alloy_js_core.code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
663
- }),
664
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
665
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
666
- export: true,
667
- const: true,
668
- name: "isDevelopment",
669
- doc: "Detect if the application is running in `\"development\"` mode",
670
- initializer: _alloy_js_core.code`["dev", "development"].includes(mode.toLowerCase()); `
671
- }),
672
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
673
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
674
- export: true,
675
- const: true,
676
- name: "isDebug",
677
- doc: "Detect if the application is currently being debugged",
678
- initializer: _alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
679
- }),
680
- (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
681
- (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
682
- when: Boolean(children),
683
- children
684
- })
685
- ]
686
- });
752
+ ` });
753
+ }
754
+ }),
755
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
756
+ "export": true,
757
+ "const": true,
758
+ name: "mode",
759
+ initializer: _alloy_js_core.code`String(env.MODE) || "production"; `
760
+ }),
761
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
762
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
763
+ "export": true,
764
+ "const": true,
765
+ name: "isProduction",
766
+ doc: "Detect if the application is running in `\"production\"` mode",
767
+ initializer: _alloy_js_core.code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
768
+ }),
769
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
770
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
771
+ "export": true,
772
+ "const": true,
773
+ name: "isTest",
774
+ doc: "Detect if the application is running in `\"test\"` mode",
775
+ initializer: _alloy_js_core.code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
776
+ }),
777
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
778
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
779
+ "export": true,
780
+ "const": true,
781
+ name: "isDevelopment",
782
+ doc: "Detect if the application is running in `\"development\"` mode",
783
+ initializer: _alloy_js_core.code`["dev", "development"].includes(mode.toLowerCase()); `
784
+ }),
785
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
786
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
787
+ "export": true,
788
+ "const": true,
789
+ name: "isDebug",
790
+ doc: "Detect if the application is currently being debugged",
791
+ initializer: _alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
792
+ }),
793
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
794
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
795
+ get when() {
796
+ return Boolean(children);
797
+ },
798
+ children
799
+ })
800
+ ];
801
+ }
802
+ }));
687
803
  }
688
804
  EnvBuiltin.__type = [
689
805
  () => __ΩEnvBuiltinProps,