@powerlines/plugin-env 0.16.62 → 0.16.64
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 +11 -83
- package/dist/babel/plugin.mjs +11 -83
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +27 -37
- package/dist/components/docs.mjs +27 -37
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +315 -405
- package/dist/components/env-builtin.mjs +315 -405
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/helpers/automd-generator.cjs +4 -14
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +4 -14
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.cjs +0 -8
- package/dist/helpers/create-reflection-resource.mjs +0 -9
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/docs-helper.cjs +0 -8
- package/dist/helpers/docs-helper.mjs +0 -8
- package/dist/helpers/docs-helper.mjs.map +1 -1
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.mjs +2 -2
- package/dist/helpers/load.cjs +7 -58
- package/dist/helpers/load.mjs +7 -58
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +1 -108
- package/dist/helpers/persistence.mjs +1 -108
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.cjs +16 -156
- package/dist/helpers/reflect.mjs +17 -156
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.cjs +4 -34
- package/dist/helpers/source-file-env.mjs +4 -34
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.cjs +5 -33
- package/dist/helpers/template-helpers.mjs +5 -33
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/index.cjs +3 -6
- package/dist/index.mjs +4 -7
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +0 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +0 -4
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -1
- package/dist/types/index.cjs +0 -11
- package/dist/types/index.mjs +1 -4
- package/dist/types/plugin.cjs +0 -137
- package/dist/types/plugin.d.mts +4 -4
- package/dist/types/plugin.mjs +1 -132
- package/dist/types/runtime.cjs +0 -244
- package/dist/types/runtime.mjs +1 -242
- package/package.json +10 -10
- package/dist/types/plugin.mjs.map +0 -1
- package/dist/types/runtime.mjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_helpers_load = require('../helpers/load.cjs');
|
|
4
|
-
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
5
4
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
|
+
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
6
6
|
let defu = require("defu");
|
|
7
7
|
defu = require_runtime.__toESM(defu);
|
|
8
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
9
8
|
let _alloy_js_core = require("@alloy-js/core");
|
|
10
9
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
11
10
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
11
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
12
12
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
13
13
|
let _powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
|
|
14
14
|
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
@@ -23,32 +23,28 @@ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/
|
|
|
23
23
|
function EnvTypeDefinition(props) {
|
|
24
24
|
const [{ defaultValue, reflection }] = (0, _alloy_js_core.splitProps)(props, ["defaultValue", "reflection"]);
|
|
25
25
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
26
|
-
return [
|
|
27
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
26
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
27
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
28
28
|
name: " EnvBase",
|
|
29
29
|
defaultValue,
|
|
30
30
|
reflection,
|
|
31
|
-
|
|
31
|
+
export: true
|
|
32
32
|
}),
|
|
33
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
34
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
33
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
34
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
35
35
|
heading: "The environment configuration object with prefixed keys.",
|
|
36
|
-
|
|
37
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`EnvBase\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.` });
|
|
38
|
-
}
|
|
36
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`EnvBase\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.` })
|
|
39
37
|
}),
|
|
40
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
38
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeDeclaration, {
|
|
41
39
|
name: "Env",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return _alloy_js_core.code` {
|
|
40
|
+
export: true,
|
|
41
|
+
children: _alloy_js_core.code` {
|
|
45
42
|
[Key in keyof EnvBase as Key ${context.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
|
|
46
43
|
}
|
|
47
|
-
|
|
48
|
-
}
|
|
44
|
+
`
|
|
49
45
|
}),
|
|
50
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
51
|
-
];
|
|
46
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
47
|
+
] });
|
|
52
48
|
}
|
|
53
49
|
function ConfigPropertyConditional(props) {
|
|
54
50
|
const [{ context, name }] = (0, _alloy_js_core.splitProps)(props, ["context", "name"]);
|
|
@@ -60,63 +56,39 @@ function ConfigPropertyGet(props) {
|
|
|
60
56
|
"property",
|
|
61
57
|
"index"
|
|
62
58
|
]);
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
context
|
|
98
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
99
|
-
get when() {
|
|
100
|
-
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
|
|
101
|
-
},
|
|
102
|
-
get children() {
|
|
103
|
-
return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
104
|
-
get each() {
|
|
105
|
-
return property.getAlias();
|
|
106
|
-
},
|
|
107
|
-
joiner: _alloy_js_core.code` || `,
|
|
108
|
-
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
109
|
-
name: alias,
|
|
110
|
-
context
|
|
111
|
-
})
|
|
112
|
-
})];
|
|
113
|
-
}
|
|
114
|
-
})];
|
|
115
|
-
},
|
|
116
|
-
get children() {
|
|
117
|
-
return _alloy_js_core.code`return target["${property.getNameAsString()}"];`;
|
|
118
|
-
}
|
|
119
|
-
})];
|
|
59
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: index === 0 ? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.IfStatement, {
|
|
60
|
+
condition: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
61
|
+
name: property.getNameAsString(),
|
|
62
|
+
context
|
|
63
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
64
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
65
|
+
children: [_alloy_js_core.code` || `, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
66
|
+
each: property.getAlias(),
|
|
67
|
+
joiner: _alloy_js_core.code` || `,
|
|
68
|
+
children: (alias) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
69
|
+
name: alias,
|
|
70
|
+
context
|
|
71
|
+
})
|
|
72
|
+
})]
|
|
73
|
+
})] }),
|
|
74
|
+
children: _alloy_js_core.code`return target["${property.getNameAsString()}"];`
|
|
75
|
+
}) : /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ElseIfClause, {
|
|
76
|
+
condition: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
77
|
+
name: property.getNameAsString(),
|
|
78
|
+
context
|
|
79
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
80
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
81
|
+
children: [_alloy_js_core.code` || `, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
82
|
+
each: property.getAlias(),
|
|
83
|
+
joiner: _alloy_js_core.code` || `,
|
|
84
|
+
children: (alias) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
85
|
+
name: alias,
|
|
86
|
+
context
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
})] }),
|
|
90
|
+
children: _alloy_js_core.code`return target["${property.getNameAsString()}"];`
|
|
91
|
+
}) });
|
|
120
92
|
}
|
|
121
93
|
function ConfigPropertySet(props) {
|
|
122
94
|
const [{ context, property, index }] = (0, _alloy_js_core.splitProps)(props, [
|
|
@@ -124,69 +96,45 @@ function ConfigPropertySet(props) {
|
|
|
124
96
|
"property",
|
|
125
97
|
"index"
|
|
126
98
|
]);
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
joiner: _alloy_js_core.code` || `,
|
|
144
|
-
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
145
|
-
name: alias,
|
|
146
|
-
context
|
|
147
|
-
})
|
|
148
|
-
})];
|
|
149
|
-
}
|
|
150
|
-
})];
|
|
151
|
-
},
|
|
152
|
-
get children() {
|
|
153
|
-
return _alloy_js_core.code`
|
|
99
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: index === 0 ? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.IfStatement, {
|
|
100
|
+
condition: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
101
|
+
name: property.getNameAsString(),
|
|
102
|
+
context
|
|
103
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
104
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
105
|
+
children: [_alloy_js_core.code` || `, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
106
|
+
each: property.getAlias(),
|
|
107
|
+
joiner: _alloy_js_core.code` || `,
|
|
108
|
+
children: (alias) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
109
|
+
name: alias,
|
|
110
|
+
context
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
})] }),
|
|
114
|
+
children: _alloy_js_core.code`
|
|
154
115
|
target["${property.getNameAsString()}"] = newValue;
|
|
155
116
|
return true;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
joiner: _alloy_js_core.code` || `,
|
|
175
|
-
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
176
|
-
name: alias,
|
|
177
|
-
context
|
|
178
|
-
})
|
|
179
|
-
})];
|
|
180
|
-
}
|
|
181
|
-
})];
|
|
182
|
-
},
|
|
183
|
-
get children() {
|
|
184
|
-
return _alloy_js_core.code`
|
|
117
|
+
`
|
|
118
|
+
}) : /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ElseIfClause, {
|
|
119
|
+
condition: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
120
|
+
name: property.getNameAsString(),
|
|
121
|
+
context
|
|
122
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
123
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
124
|
+
children: [_alloy_js_core.code` || `, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
125
|
+
each: property.getAlias(),
|
|
126
|
+
joiner: _alloy_js_core.code` || `,
|
|
127
|
+
children: (alias) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
128
|
+
name: alias,
|
|
129
|
+
context
|
|
130
|
+
})
|
|
131
|
+
})]
|
|
132
|
+
})] }),
|
|
133
|
+
children: _alloy_js_core.code`
|
|
185
134
|
target["${property.getNameAsString()}"] = newValue;
|
|
186
135
|
return true;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})];
|
|
136
|
+
`
|
|
137
|
+
}) });
|
|
190
138
|
}
|
|
191
139
|
const createEnvRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("createEnv");
|
|
192
140
|
const envRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("env");
|
|
@@ -211,74 +159,62 @@ function EnvBuiltin(props) {
|
|
|
211
159
|
});
|
|
212
160
|
const reflectionGetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
213
161
|
const reflectionSetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
214
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
162
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, {
|
|
215
163
|
id: "env",
|
|
216
|
-
description: "The environment configuration module provides an interface to define environment configuration parameters."
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}),
|
|
271
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ClassDeclaration, {
|
|
272
|
-
refkey: envSerializerRefkey,
|
|
273
|
-
name: "EnvSerializer",
|
|
274
|
-
"extends": "Serializer",
|
|
275
|
-
"export": true,
|
|
276
|
-
get children() {
|
|
277
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ClassMethod, {
|
|
278
|
-
name: "constructor",
|
|
279
|
-
"public": true,
|
|
280
|
-
doc: "Initializes a new instance of the `EnvSerializer` class.",
|
|
281
|
-
children: _alloy_js_core.code`super("env");
|
|
164
|
+
description: "The environment configuration module provides an interface to define environment configuration parameters.",
|
|
165
|
+
...rest,
|
|
166
|
+
imports: (0, defu.default)({ "@powerlines/deepkit/vendor/type": [
|
|
167
|
+
"stringify",
|
|
168
|
+
"serializer",
|
|
169
|
+
"serializeFunction",
|
|
170
|
+
"deserializeFunction",
|
|
171
|
+
"ReflectionKind",
|
|
172
|
+
"Serializer",
|
|
173
|
+
"TemplateState",
|
|
174
|
+
"Type",
|
|
175
|
+
"TypeProperty",
|
|
176
|
+
"TypePropertySignature"
|
|
177
|
+
] }, rest.imports ?? {}),
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
180
|
+
when: Boolean(reflection),
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(EnvTypeDefinition, {
|
|
183
|
+
defaultValue: defaultValue.value,
|
|
184
|
+
reflection
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
187
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
188
|
+
]
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_object_declaration.ObjectDeclaration, {
|
|
191
|
+
name: "initialEnv",
|
|
192
|
+
type: "Partial<EnvBase>",
|
|
193
|
+
defaultValue,
|
|
194
|
+
reflection: envInstance,
|
|
195
|
+
export: true,
|
|
196
|
+
const: true,
|
|
197
|
+
doc: "The initial environment configuration object values for the runtime."
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
200
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
201
|
+
heading: "The environment configuration serializer for the Powerlines application.",
|
|
202
|
+
children: [
|
|
203
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
|
|
204
|
+
/* @__PURE__ */ (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` }),
|
|
205
|
+
/* @__PURE__ */ (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.` })
|
|
206
|
+
]
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ClassDeclaration, {
|
|
209
|
+
refkey: envSerializerRefkey,
|
|
210
|
+
name: "EnvSerializer",
|
|
211
|
+
extends: "Serializer",
|
|
212
|
+
export: true,
|
|
213
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ClassMethod, {
|
|
214
|
+
name: "constructor",
|
|
215
|
+
public: true,
|
|
216
|
+
doc: "Initializes a new instance of the `EnvSerializer` class.",
|
|
217
|
+
children: _alloy_js_core.code`super("env");
|
|
282
218
|
|
|
283
219
|
this.deserializeRegistry.register(
|
|
284
220
|
ReflectionKind.boolean,
|
|
@@ -288,99 +224,84 @@ function EnvBuiltin(props) {
|
|
|
288
224
|
);
|
|
289
225
|
}
|
|
290
226
|
); `
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
"
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
370
|
-
refkey: createEnvRefkey,
|
|
371
|
-
async: false,
|
|
372
|
-
"export": true,
|
|
373
|
-
name: "createEnv",
|
|
374
|
-
parameters: [{
|
|
375
|
-
name: "environmentConfig",
|
|
376
|
-
type: `Partial<Env>`,
|
|
377
|
-
optional: false,
|
|
378
|
-
default: "{}"
|
|
379
|
-
}],
|
|
380
|
-
returnType: "Env",
|
|
381
|
-
get children() {
|
|
382
|
-
return [
|
|
383
|
-
_alloy_js_core.code`
|
|
227
|
+
})
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
230
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
231
|
+
heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
|
|
234
|
+
/* @__PURE__ */ (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` }),
|
|
235
|
+
/* @__PURE__ */ (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.` })
|
|
236
|
+
]
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
239
|
+
name: "envSerializer",
|
|
240
|
+
export: false,
|
|
241
|
+
const: true,
|
|
242
|
+
initializer: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.NewExpression, {
|
|
243
|
+
args: [],
|
|
244
|
+
target: "EnvSerializer"
|
|
245
|
+
})
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
248
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
249
|
+
heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ (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()\`.` }),
|
|
252
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const json = serializeEnv(env);` }),
|
|
253
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
|
|
254
|
+
]
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
257
|
+
name: "serializeEnv",
|
|
258
|
+
export: true,
|
|
259
|
+
const: true,
|
|
260
|
+
initializer: "serializeFunction<EnvBase>(envSerializer)"
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
263
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
264
|
+
heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ (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.` }),
|
|
267
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const env = deserializeEnv(json);` }),
|
|
268
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when deserialization fails.` })
|
|
269
|
+
]
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
272
|
+
name: "deserializeEnv",
|
|
273
|
+
export: true,
|
|
274
|
+
const: true,
|
|
275
|
+
initializer: "deserializeFunction<EnvBase>(envSerializer)"
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
278
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
279
|
+
heading: "Initializes the Powerlines environment configuration module.",
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
|
|
282
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
283
|
+
name: "environmentConfig",
|
|
284
|
+
children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The initialized Powerlines configuration object.` })
|
|
287
|
+
]
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
290
|
+
when: Boolean(context?.entryPath),
|
|
291
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_typescript.FunctionDeclaration, {
|
|
292
|
+
refkey: createEnvRefkey,
|
|
293
|
+
async: false,
|
|
294
|
+
export: true,
|
|
295
|
+
name: "createEnv",
|
|
296
|
+
parameters: [{
|
|
297
|
+
name: "environmentConfig",
|
|
298
|
+
type: `Partial<Env>`,
|
|
299
|
+
optional: false,
|
|
300
|
+
default: "{}"
|
|
301
|
+
}],
|
|
302
|
+
returnType: "Env",
|
|
303
|
+
children: [
|
|
304
|
+
_alloy_js_core.code`
|
|
384
305
|
return new Proxy<Env>(
|
|
385
306
|
deserializeEnv({
|
|
386
307
|
...initialEnv,
|
|
@@ -388,66 +309,60 @@ function EnvBuiltin(props) {
|
|
|
388
309
|
}) as Env,
|
|
389
310
|
{
|
|
390
311
|
get: (target: EnvBase, propertyName: string) => { `,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
312
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
313
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
314
|
+
each: reflectionGetProperties,
|
|
315
|
+
children: (property, index) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertyGet, {
|
|
316
|
+
index,
|
|
317
|
+
context,
|
|
318
|
+
property
|
|
319
|
+
})
|
|
320
|
+
}),
|
|
321
|
+
_alloy_js_core.code`
|
|
401
322
|
return undefined;
|
|
402
323
|
}, `,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
324
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
325
|
+
_alloy_js_core.code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,
|
|
326
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
327
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
328
|
+
each: reflectionSetProperties,
|
|
329
|
+
ender: _alloy_js_core.code` else `,
|
|
330
|
+
children: (property, index) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(ConfigPropertySet, {
|
|
331
|
+
index,
|
|
332
|
+
context,
|
|
333
|
+
property
|
|
334
|
+
})
|
|
335
|
+
}),
|
|
336
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
337
|
+
_alloy_js_core.code`return false;
|
|
417
338
|
}
|
|
418
339
|
}
|
|
419
340
|
);
|
|
420
341
|
`
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
446
|
-
"export": true,
|
|
447
|
-
"const": true,
|
|
448
|
-
name: "isCI",
|
|
449
|
-
doc: "Detect if the application is running in a continuous integration (CI) environment.",
|
|
450
|
-
initializer: _alloy_js_core.code`Boolean(
|
|
342
|
+
]
|
|
343
|
+
})
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
346
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
347
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
348
|
+
heading: "The environment configuration object.",
|
|
349
|
+
children: /* @__PURE__ */ (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.` })
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
352
|
+
refkey: envRefkey,
|
|
353
|
+
name: "env",
|
|
354
|
+
type: "Env",
|
|
355
|
+
export: true,
|
|
356
|
+
const: true,
|
|
357
|
+
initializer: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: _alloy_js_core.code`createEnv(${defaultConfig || "{}"} as Partial<Env>);` })
|
|
358
|
+
}),
|
|
359
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
360
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
361
|
+
export: true,
|
|
362
|
+
const: true,
|
|
363
|
+
name: "isCI",
|
|
364
|
+
doc: "Detect if the application is running in a continuous integration (CI) environment.",
|
|
365
|
+
initializer: _alloy_js_core.code`Boolean(
|
|
451
366
|
env.CI ||
|
|
452
367
|
env.RUN_ID ||
|
|
453
368
|
env.AGOLA_GIT_REF ||
|
|
@@ -501,66 +416,61 @@ function EnvBuiltin(props) {
|
|
|
501
416
|
env.XCS || false
|
|
502
417
|
);
|
|
503
418
|
`
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
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:
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
421
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
422
|
+
heading: "Detect the \\`mode\\` of the current runtime environment.",
|
|
423
|
+
children: /* @__PURE__ */ (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:
|
|
510
424
|
- \`production\`
|
|
511
425
|
- \`test\`
|
|
512
426
|
- \`development\`
|
|
513
|
-
` })
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
})
|
|
561
|
-
];
|
|
562
|
-
}
|
|
563
|
-
}));
|
|
427
|
+
` })
|
|
428
|
+
}),
|
|
429
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
430
|
+
export: true,
|
|
431
|
+
const: true,
|
|
432
|
+
name: "mode",
|
|
433
|
+
initializer: _alloy_js_core.code`String(env.MODE) || "production"; `
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
436
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
437
|
+
export: true,
|
|
438
|
+
const: true,
|
|
439
|
+
name: "isProduction",
|
|
440
|
+
doc: "Detect if the application is running in `\"production\"` mode",
|
|
441
|
+
initializer: _alloy_js_core.code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
444
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
445
|
+
export: true,
|
|
446
|
+
const: true,
|
|
447
|
+
name: "isTest",
|
|
448
|
+
doc: "Detect if the application is running in `\"test\"` mode",
|
|
449
|
+
initializer: _alloy_js_core.code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
452
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
453
|
+
export: true,
|
|
454
|
+
const: true,
|
|
455
|
+
name: "isDevelopment",
|
|
456
|
+
doc: "Detect if the application is running in `\"development\"` mode",
|
|
457
|
+
initializer: _alloy_js_core.code`["dev", "development"].includes(mode.toLowerCase()); `
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
460
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
461
|
+
export: true,
|
|
462
|
+
const: true,
|
|
463
|
+
name: "isDebug",
|
|
464
|
+
doc: "Detect if the application is currently being debugged",
|
|
465
|
+
initializer: _alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
468
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
469
|
+
when: Boolean(children),
|
|
470
|
+
children
|
|
471
|
+
})
|
|
472
|
+
]
|
|
473
|
+
});
|
|
564
474
|
}
|
|
565
475
|
|
|
566
476
|
//#endregion
|