@powerlines/plugin-env 0.16.121 → 0.16.123
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.cjs +1 -11
- package/dist/babel/plugin.d.cts.map +1 -1
- package/dist/babel/plugin.d.mts.map +1 -1
- package/dist/babel/plugin.mjs +1 -11
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +44 -4
- package/dist/components/docs.mjs +43 -4
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +299 -53
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.mjs +301 -56
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/components/index.cjs +3 -1
- package/dist/components/index.mjs +3 -3
- package/dist/helpers/load.cjs +1 -1
- package/dist/helpers/persistence.cjs +1 -1
- package/dist/index.cjs +77 -32
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +76 -31
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.d.cts +6 -6
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +6 -6
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/plugin.mjs.map +1 -1
- package/dist/types/runtime.cjs +303 -7
- package/dist/types/runtime.mjs +303 -7
- package/dist/types/runtime.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
4
|
const require_helpers_load = require('../helpers/load.cjs');
|
|
4
5
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
6
|
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
@@ -15,18 +16,43 @@ let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powe
|
|
|
15
16
|
let _powerlines_plugin_alloy_typescript_components_interface_declaration = require("@powerlines/plugin-alloy/typescript/components/interface-declaration");
|
|
16
17
|
let _powerlines_plugin_alloy_typescript_components_object_declaration = require("@powerlines/plugin-alloy/typescript/components/object-declaration");
|
|
17
18
|
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
19
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc_reflection = require("@powerlines/plugin-alloy/typescript/components/tsdoc-reflection");
|
|
18
20
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
19
21
|
|
|
20
22
|
//#region src/components/env-builtin.tsx
|
|
23
|
+
const __ΩOmit = [
|
|
24
|
+
"T",
|
|
25
|
+
"K",
|
|
26
|
+
() => __ΩPick,
|
|
27
|
+
() => __ΩExclude,
|
|
28
|
+
"Omit",
|
|
29
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
30
|
+
];
|
|
31
|
+
const __ΩPick = [
|
|
32
|
+
"T",
|
|
33
|
+
"K",
|
|
34
|
+
"Pick",
|
|
35
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
36
|
+
];
|
|
37
|
+
const __ΩExclude = [
|
|
38
|
+
"T",
|
|
39
|
+
"U",
|
|
40
|
+
"Exclude",
|
|
41
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
42
|
+
];
|
|
43
|
+
function __assignType(fn, args) {
|
|
44
|
+
fn.__type = args;
|
|
45
|
+
return fn;
|
|
46
|
+
}
|
|
21
47
|
/**
|
|
22
48
|
* Generates the environment configuration typescript definition for the Powerlines project.
|
|
23
49
|
*/
|
|
24
50
|
function EnvTypeDefinition(props) {
|
|
25
51
|
const [{ defaultValue, reflection }] = (0, _alloy_js_core.splitProps)(props, ["defaultValue", "reflection"]);
|
|
26
|
-
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
52
|
+
const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [[() => require_types_plugin.__ΩEnvPluginContext, "n!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
|
|
27
53
|
return [
|
|
28
54
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
29
|
-
name: "
|
|
55
|
+
name: "UnprefixedEnv",
|
|
30
56
|
defaultValue,
|
|
31
57
|
reflection,
|
|
32
58
|
"export": true
|
|
@@ -35,26 +61,104 @@ function EnvTypeDefinition(props) {
|
|
|
35
61
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
36
62
|
heading: "The environment configuration object with prefixed keys.",
|
|
37
63
|
get children() {
|
|
38
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`
|
|
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.` });
|
|
39
65
|
}
|
|
40
66
|
}),
|
|
41
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.
|
|
67
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
42
68
|
name: "Env",
|
|
43
69
|
"export": true,
|
|
70
|
+
"extends": "UnprefixedEnv",
|
|
44
71
|
get children() {
|
|
45
|
-
return _alloy_js_core.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
},
|
|
80
|
+
doubleHardline: true,
|
|
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
|
+
});
|
|
49
115
|
}
|
|
50
116
|
}),
|
|
51
117
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
52
118
|
];
|
|
53
119
|
}
|
|
120
|
+
EnvTypeDefinition.__type = [
|
|
121
|
+
() => __ΩOmit,
|
|
122
|
+
"name",
|
|
123
|
+
"props",
|
|
124
|
+
"EnvTypeDefinition",
|
|
125
|
+
"Generates the environment configuration typescript definition for the Powerlines project.",
|
|
126
|
+
"P!.\"o!#2#\"/$?%"
|
|
127
|
+
];
|
|
128
|
+
const __ΩConfigPropertyConditionalProps = [
|
|
129
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
130
|
+
"context",
|
|
131
|
+
"name",
|
|
132
|
+
"ConfigPropertyConditionalProps",
|
|
133
|
+
"P!n!4\"&4#Mw$y"
|
|
134
|
+
];
|
|
54
135
|
function ConfigPropertyConditional(props) {
|
|
55
136
|
const [{ context, name }] = (0, _alloy_js_core.splitProps)(props, ["context", "name"]);
|
|
56
|
-
return _alloy_js_core.code`propertyName === "${name}" || propertyName.replace(/^(${(0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix.sort((a, b) => a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)
|
|
137
|
+
return _alloy_js_core.code`propertyName === "${name}" || propertyName.replace(/^(${(0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix.sort(__assignType((a, b) => a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b), [
|
|
138
|
+
"a",
|
|
139
|
+
"b",
|
|
140
|
+
"",
|
|
141
|
+
"P\"2!\"2\"\"/#"
|
|
142
|
+
])).map(__assignType((prefix) => `${prefix.replace(/_$/, "")}_`, [
|
|
143
|
+
"prefix",
|
|
144
|
+
"",
|
|
145
|
+
"P\"2!\"/\""
|
|
146
|
+
]))).join("|")})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${name.toLowerCase().replace(/[\s\-_]+/g, "")}"`;
|
|
57
147
|
}
|
|
148
|
+
ConfigPropertyConditional.__type = [
|
|
149
|
+
() => __ΩConfigPropertyConditionalProps,
|
|
150
|
+
"props",
|
|
151
|
+
"ConfigPropertyConditional",
|
|
152
|
+
"Pn!2\"\"/#"
|
|
153
|
+
];
|
|
154
|
+
const __ΩConfigPropertyProps = [
|
|
155
|
+
"index",
|
|
156
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
157
|
+
"context",
|
|
158
|
+
"property",
|
|
159
|
+
"ConfigPropertyProps",
|
|
160
|
+
"P!'4!n\"4#!4$Mw%y"
|
|
161
|
+
];
|
|
58
162
|
function ConfigPropertyGet(props) {
|
|
59
163
|
const [{ context, property, index }] = (0, _alloy_js_core.splitProps)(props, [
|
|
60
164
|
"context",
|
|
@@ -78,10 +182,16 @@ function ConfigPropertyGet(props) {
|
|
|
78
182
|
return property.getAlias();
|
|
79
183
|
},
|
|
80
184
|
joiner: _alloy_js_core.code` || `,
|
|
81
|
-
children
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
+
}
|
|
85
195
|
})];
|
|
86
196
|
}
|
|
87
197
|
})];
|
|
@@ -106,10 +216,16 @@ function ConfigPropertyGet(props) {
|
|
|
106
216
|
return property.getAlias();
|
|
107
217
|
},
|
|
108
218
|
joiner: _alloy_js_core.code` || `,
|
|
109
|
-
children
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
+
}
|
|
113
229
|
})];
|
|
114
230
|
}
|
|
115
231
|
})];
|
|
@@ -119,6 +235,12 @@ function ConfigPropertyGet(props) {
|
|
|
119
235
|
}
|
|
120
236
|
})];
|
|
121
237
|
}
|
|
238
|
+
ConfigPropertyGet.__type = [
|
|
239
|
+
() => __ΩConfigPropertyProps,
|
|
240
|
+
"props",
|
|
241
|
+
"ConfigPropertyGet",
|
|
242
|
+
"Pn!2\"\"/#"
|
|
243
|
+
];
|
|
122
244
|
function ConfigPropertySet(props) {
|
|
123
245
|
const [{ context, property, index }] = (0, _alloy_js_core.splitProps)(props, [
|
|
124
246
|
"context",
|
|
@@ -142,10 +264,16 @@ function ConfigPropertySet(props) {
|
|
|
142
264
|
return property.getAlias();
|
|
143
265
|
},
|
|
144
266
|
joiner: _alloy_js_core.code` || `,
|
|
145
|
-
children
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
+
}
|
|
149
277
|
})];
|
|
150
278
|
}
|
|
151
279
|
})];
|
|
@@ -173,10 +301,16 @@ function ConfigPropertySet(props) {
|
|
|
173
301
|
return property.getAlias();
|
|
174
302
|
},
|
|
175
303
|
joiner: _alloy_js_core.code` || `,
|
|
176
|
-
children
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
+
}
|
|
180
314
|
})];
|
|
181
315
|
}
|
|
182
316
|
})];
|
|
@@ -189,6 +323,21 @@ function ConfigPropertySet(props) {
|
|
|
189
323
|
}
|
|
190
324
|
})];
|
|
191
325
|
}
|
|
326
|
+
ConfigPropertySet.__type = [
|
|
327
|
+
() => __ΩConfigPropertyProps,
|
|
328
|
+
"props",
|
|
329
|
+
"ConfigPropertySet",
|
|
330
|
+
"Pn!2\"\"/#"
|
|
331
|
+
];
|
|
332
|
+
const __ΩEnvBuiltinProps = [
|
|
333
|
+
() => __ΩOmit,
|
|
334
|
+
"id",
|
|
335
|
+
"Children",
|
|
336
|
+
"defaultConfig",
|
|
337
|
+
"reflection",
|
|
338
|
+
"EnvBuiltinProps",
|
|
339
|
+
"P!.\"o!#\"w#4$8!4%Mw&y"
|
|
340
|
+
];
|
|
192
341
|
const createEnvRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("createEnv");
|
|
193
342
|
const envRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("env");
|
|
194
343
|
const envSerializerRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("EnvSerializer");
|
|
@@ -201,7 +350,7 @@ function EnvBuiltin(props) {
|
|
|
201
350
|
"reflection",
|
|
202
351
|
"children"
|
|
203
352
|
]);
|
|
204
|
-
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
353
|
+
const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [[() => require_types_plugin.__ΩEnvPluginContext, "n!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
|
|
205
354
|
const defaultValue = (0, _alloy_js_core.computed)(() => context && require_helpers_load.loadEnvFromContext(context, process.env));
|
|
206
355
|
const envInstance = (0, _alloy_js_core.computed)(() => {
|
|
207
356
|
const result = new _powerlines_deepkit_vendor_type.ReflectionClass({
|
|
@@ -209,13 +358,39 @@ function EnvBuiltin(props) {
|
|
|
209
358
|
description: `The initial environment configuration state for the ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.name)} project.`,
|
|
210
359
|
types: []
|
|
211
360
|
}, reflection);
|
|
212
|
-
result.getProperties().filter((property) => property.isRuntime() || property.getTags().runtime === true
|
|
361
|
+
result.getProperties().filter(__assignType((property) => property.isRuntime() || property.getTags().runtime === true, [
|
|
362
|
+
"property",
|
|
363
|
+
"",
|
|
364
|
+
"P\"2!\"/\""
|
|
365
|
+
])).forEach(__assignType((property) => {
|
|
213
366
|
result.removeProperty(property.getNameAsString());
|
|
214
|
-
}
|
|
367
|
+
}, [
|
|
368
|
+
"property",
|
|
369
|
+
"",
|
|
370
|
+
"P\"2!\"/\""
|
|
371
|
+
]));
|
|
215
372
|
return result;
|
|
216
373
|
});
|
|
217
|
-
const reflectionGetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter((property) => !property.isIgnored()
|
|
218
|
-
|
|
374
|
+
const reflectionGetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter(__assignType((property) => !property.isIgnored(), [
|
|
375
|
+
"property",
|
|
376
|
+
"",
|
|
377
|
+
"P\"2!\"/\""
|
|
378
|
+
])).sort(__assignType((a, b) => a.getNameAsString().localeCompare(b.getNameAsString()), [
|
|
379
|
+
"a",
|
|
380
|
+
"b",
|
|
381
|
+
"",
|
|
382
|
+
"P\"2!\"2\"\"/#"
|
|
383
|
+
])) ?? []);
|
|
384
|
+
const reflectionSetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter(__assignType((property) => !property.isIgnored() && !property.isReadonly(), [
|
|
385
|
+
"property",
|
|
386
|
+
"",
|
|
387
|
+
"P\"2!\"/\""
|
|
388
|
+
])).sort(__assignType((a, b) => a.getNameAsString().localeCompare(b.getNameAsString()), [
|
|
389
|
+
"a",
|
|
390
|
+
"b",
|
|
391
|
+
"",
|
|
392
|
+
"P\"2!\"2\"\"/#"
|
|
393
|
+
])) ?? []);
|
|
219
394
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
220
395
|
id: "env",
|
|
221
396
|
description: "The environment configuration module provides an interface to define environment configuration parameters."
|
|
@@ -226,6 +401,7 @@ function EnvBuiltin(props) {
|
|
|
226
401
|
"deserializeFunction",
|
|
227
402
|
"ReflectionKind",
|
|
228
403
|
"Serializer",
|
|
404
|
+
"NamingStrategy",
|
|
229
405
|
"TemplateState",
|
|
230
406
|
"Type",
|
|
231
407
|
"TypeProperty",
|
|
@@ -251,7 +427,7 @@ function EnvBuiltin(props) {
|
|
|
251
427
|
}),
|
|
252
428
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_object_declaration.ObjectDeclaration, {
|
|
253
429
|
name: "initialEnv",
|
|
254
|
-
type: "Partial<
|
|
430
|
+
type: "Partial<Env>",
|
|
255
431
|
defaultValue,
|
|
256
432
|
reflection: envInstance,
|
|
257
433
|
"export": true,
|
|
@@ -293,6 +469,32 @@ function EnvBuiltin(props) {
|
|
|
293
469
|
}
|
|
294
470
|
}),
|
|
295
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 {
|
|
478
|
+
constructor() {
|
|
479
|
+
super("env");
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
getPropertyName(type: TypeProperty | TypePropertySignature, forSerializer: string): string | undefined {
|
|
483
|
+
const name = super.getPropertyName(type, forSerializer);
|
|
484
|
+
if (!name) {
|
|
485
|
+
return name;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return name.replace(/^(${(0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_$/, ""), [
|
|
489
|
+
"prefix",
|
|
490
|
+
"",
|
|
491
|
+
"P\"2!\"/\""
|
|
492
|
+
])).join("|")})_/, "");
|
|
493
|
+
}
|
|
494
|
+
}; `;
|
|
495
|
+
}
|
|
496
|
+
}),
|
|
497
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
296
498
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
297
499
|
heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
|
|
298
500
|
get children() {
|
|
@@ -305,7 +507,6 @@ function EnvBuiltin(props) {
|
|
|
305
507
|
}),
|
|
306
508
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
307
509
|
name: "envSerializer",
|
|
308
|
-
"export": false,
|
|
309
510
|
"const": true,
|
|
310
511
|
get initializer() {
|
|
311
512
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.NewExpression, {
|
|
@@ -315,21 +516,42 @@ function EnvBuiltin(props) {
|
|
|
315
516
|
}
|
|
316
517
|
}),
|
|
317
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, {}),
|
|
318
525
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
319
526
|
heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
|
|
320
527
|
get children() {
|
|
321
528
|
return [
|
|
322
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()\`.` }),
|
|
323
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.` }),
|
|
324
537
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
|
|
325
538
|
];
|
|
326
539
|
}
|
|
327
540
|
}),
|
|
328
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.
|
|
541
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
329
542
|
name: "serializeEnv",
|
|
330
543
|
"export": true,
|
|
544
|
+
parameters: [{
|
|
545
|
+
name: "input",
|
|
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",
|
|
331
553
|
"const": true,
|
|
332
|
-
initializer: "
|
|
554
|
+
initializer: "deserializeFunction<Env>(envSerializer, envNamingStrategy)"
|
|
333
555
|
}),
|
|
334
556
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
335
557
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
@@ -342,11 +564,14 @@ function EnvBuiltin(props) {
|
|
|
342
564
|
];
|
|
343
565
|
}
|
|
344
566
|
}),
|
|
345
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.
|
|
567
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
346
568
|
name: "deserializeEnv",
|
|
347
569
|
"export": true,
|
|
348
|
-
|
|
349
|
-
|
|
570
|
+
parameters: [{
|
|
571
|
+
name: "input",
|
|
572
|
+
type: "Env"
|
|
573
|
+
}],
|
|
574
|
+
children: _alloy_js_core.code` return _deserializeEnv(input, { loosely: true }); `
|
|
350
575
|
}),
|
|
351
576
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
352
577
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
@@ -386,32 +611,46 @@ function EnvBuiltin(props) {
|
|
|
386
611
|
deserializeEnv({
|
|
387
612
|
...initialEnv,
|
|
388
613
|
...environmentConfig
|
|
389
|
-
}
|
|
614
|
+
} as Env),
|
|
390
615
|
{
|
|
391
|
-
get: (target:
|
|
616
|
+
get: (target: UnprefixedEnv, propertyName: string) => { `,
|
|
392
617
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
393
618
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
394
619
|
each: reflectionGetProperties,
|
|
395
|
-
children
|
|
396
|
-
index,
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
+
}
|
|
400
632
|
}),
|
|
401
633
|
_alloy_js_core.code`
|
|
402
634
|
return undefined;
|
|
403
635
|
}, `,
|
|
404
636
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
405
|
-
_alloy_js_core.code` set: (target:
|
|
637
|
+
_alloy_js_core.code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `,
|
|
406
638
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
407
639
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
408
640
|
each: reflectionSetProperties,
|
|
409
641
|
ender: _alloy_js_core.code` else `,
|
|
410
|
-
children
|
|
411
|
-
index,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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
|
+
}
|
|
415
654
|
}),
|
|
416
655
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
417
656
|
_alloy_js_core.code`return false;
|
|
@@ -500,8 +739,7 @@ function EnvBuiltin(props) {
|
|
|
500
739
|
env.APPCENTER_BUILD_ID ||
|
|
501
740
|
env.CI_XCODE_PROJECT ||
|
|
502
741
|
env.XCS || false
|
|
503
|
-
);
|
|
504
|
-
`
|
|
742
|
+
); `
|
|
505
743
|
}),
|
|
506
744
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
507
745
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
@@ -563,7 +801,15 @@ function EnvBuiltin(props) {
|
|
|
563
801
|
}
|
|
564
802
|
}));
|
|
565
803
|
}
|
|
804
|
+
EnvBuiltin.__type = [
|
|
805
|
+
() => __ΩEnvBuiltinProps,
|
|
806
|
+
"props",
|
|
807
|
+
"EnvBuiltin",
|
|
808
|
+
"Generates the environment configuration module for the Powerlines project.",
|
|
809
|
+
"Pn!2\"\"/#?$"
|
|
810
|
+
];
|
|
566
811
|
|
|
567
812
|
//#endregion
|
|
568
813
|
exports.EnvBuiltin = EnvBuiltin;
|
|
569
|
-
exports.EnvTypeDefinition = EnvTypeDefinition;
|
|
814
|
+
exports.EnvTypeDefinition = EnvTypeDefinition;
|
|
815
|
+
exports.__ΩEnvBuiltinProps = __ΩEnvBuiltinProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;;;AAwEA;iBAAgB,iBAAA,CACd,KAAA,EAAO,IAAA,CAAK,yBAAA,YAAkC,QAAA;AAAA,UAuM/B,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;EAChB,UAAA,EAAY,eAAA;AAAA;;;;iBAUE,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;;;AAwEA;iBAAgB,iBAAA,CACd,KAAA,EAAO,IAAA,CAAK,yBAAA,YAAkC,QAAA;AAAA,UAuM/B,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;EAChB,UAAA,EAAY,eAAA;AAAA;;;;iBAUE,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
|