@powerlines/plugin-env 0.16.133 → 0.16.134
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.
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +49 -39
- package/dist/components/docs.d.cts +1 -2
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +1 -2
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +50 -40
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +513 -397
- package/dist/components/env-builtin.d.cts +2 -2
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts +2 -2
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.mjs +514 -398
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/docs-helper.mjs.map +1 -1
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/index.cjs +6 -3
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/runtime.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -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
|
|
54
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
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.
|
|
61
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
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
|
|
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.
|
|
67
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
66
68
|
name: "Env",
|
|
67
|
-
export: true,
|
|
68
|
-
extends: "UnprefixedEnv",
|
|
69
|
-
children
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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.
|
|
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
|
|
151
|
-
condition
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
|
205
|
-
condition
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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.
|
|
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
|
-
|
|
324
|
-
imports
|
|
325
|
-
"
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
reflection
|
|
342
|
-
}
|
|
343
|
-
(
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
489
|
+
"prefix",
|
|
490
|
+
"",
|
|
491
|
+
"P\"2!\"/\""
|
|
492
|
+
])).join("|")})_/, "");
|
|
407
493
|
}
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
(
|
|
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
|
-
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
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: "
|
|
502
|
-
type:
|
|
503
|
-
optional: false,
|
|
504
|
-
default: "{}"
|
|
571
|
+
name: "input",
|
|
572
|
+
type: "Env"
|
|
505
573
|
}],
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
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
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
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
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
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
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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,
|