@powerlines/plugin-env 0.15.1 → 0.15.2
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/components/env.cjs
CHANGED
|
@@ -193,7 +193,7 @@ const envSerializerRefkey = require_refkey.refkey("EnvSerializer");
|
|
|
193
193
|
* Generates the environment configuration module for the Powerlines project.
|
|
194
194
|
*/
|
|
195
195
|
function EnvBuiltin(props) {
|
|
196
|
-
const [{ defaultConfig }, rest] = (0, __alloy_js_core.splitProps)(props, ["defaultConfig"]);
|
|
196
|
+
const [{ defaultConfig, children }, rest] = (0, __alloy_js_core.splitProps)(props, ["defaultConfig", "children"]);
|
|
197
197
|
const context = require_context.usePowerlines();
|
|
198
198
|
const defaultValue = (0, __alloy_js_core.computed)(() => context && require_load.loadEnvFromContext(context, process.env));
|
|
199
199
|
const reflection = require_create_reflection_resource.createReflectionResource(context);
|
|
@@ -206,9 +206,10 @@ function EnvBuiltin(props) {
|
|
|
206
206
|
});
|
|
207
207
|
const reflectionGetProperties = (0, __alloy_js_core.computed)(() => reflection.data?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
208
208
|
const reflectionSetProperties = (0, __alloy_js_core.computed)(() => reflection.data?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
209
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(
|
|
209
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)({
|
|
210
210
|
id: "env",
|
|
211
|
-
description: "The Powerlines environment configuration module provides an interface to define environment configuration parameters."
|
|
211
|
+
description: "The Powerlines environment configuration module provides an interface to define environment configuration parameters."
|
|
212
|
+
}, rest, {
|
|
212
213
|
get imports() {
|
|
213
214
|
return (0, defu.default)({
|
|
214
215
|
"@powerlines/deepkit/vendor/type": [
|
|
@@ -557,7 +558,13 @@ function EnvBuiltin(props) {
|
|
|
557
558
|
initializer: __alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
|
|
558
559
|
}),
|
|
559
560
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
560
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
561
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
562
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
563
|
+
get when() {
|
|
564
|
+
return Boolean(children);
|
|
565
|
+
},
|
|
566
|
+
children
|
|
567
|
+
})
|
|
561
568
|
];
|
|
562
569
|
}
|
|
563
570
|
}));
|
package/dist/components/env.mjs
CHANGED
|
@@ -191,7 +191,7 @@ const envSerializerRefkey = refkey$1("EnvSerializer");
|
|
|
191
191
|
* Generates the environment configuration module for the Powerlines project.
|
|
192
192
|
*/
|
|
193
193
|
function EnvBuiltin(props) {
|
|
194
|
-
const [{ defaultConfig }, rest] = splitProps(props, ["defaultConfig"]);
|
|
194
|
+
const [{ defaultConfig, children }, rest] = splitProps(props, ["defaultConfig", "children"]);
|
|
195
195
|
const context = usePowerlines();
|
|
196
196
|
const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
|
|
197
197
|
const reflection = createReflectionResource(context);
|
|
@@ -204,9 +204,10 @@ function EnvBuiltin(props) {
|
|
|
204
204
|
});
|
|
205
205
|
const reflectionGetProperties = computed(() => reflection.data?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
206
206
|
const reflectionSetProperties = computed(() => reflection.data?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
207
|
-
return createComponent(BuiltinFile, mergeProps(
|
|
207
|
+
return createComponent(BuiltinFile, mergeProps({
|
|
208
208
|
id: "env",
|
|
209
|
-
description: "The Powerlines environment configuration module provides an interface to define environment configuration parameters."
|
|
209
|
+
description: "The Powerlines environment configuration module provides an interface to define environment configuration parameters."
|
|
210
|
+
}, rest, {
|
|
210
211
|
get imports() {
|
|
211
212
|
return defu({
|
|
212
213
|
"@powerlines/deepkit/vendor/type": [
|
|
@@ -555,7 +556,13 @@ function EnvBuiltin(props) {
|
|
|
555
556
|
initializer: code`Boolean(isDevelopment && env.DEBUG); `
|
|
556
557
|
}),
|
|
557
558
|
createIntrinsic("hbr", {}),
|
|
558
|
-
createIntrinsic("hbr", {})
|
|
559
|
+
createIntrinsic("hbr", {}),
|
|
560
|
+
createComponent(Show, {
|
|
561
|
+
get when() {
|
|
562
|
+
return Boolean(children);
|
|
563
|
+
},
|
|
564
|
+
children
|
|
565
|
+
})
|
|
559
566
|
];
|
|
560
567
|
}
|
|
561
568
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
|
|
2
2
|
import { EnvPluginContext } from "../types/plugin.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core3 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/create-reflection-resource.d.ts
|
|
6
6
|
|
|
@@ -10,6 +10,6 @@ import * as _alloy_js_core4 from "@alloy-js/core";
|
|
|
10
10
|
* @param context - The environment plugin context.
|
|
11
11
|
* @returns A resource that provides the reflection of the environment configuration.
|
|
12
12
|
*/
|
|
13
|
-
declare function createReflectionResource(context?: EnvPluginContext):
|
|
13
|
+
declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core3.Resource<type_d_exports.ReflectionClass<Record<string, any>>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { createReflectionResource };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -211,5 +211,5 @@
|
|
|
211
211
|
},
|
|
212
212
|
"devDependencies": { "@types/node": "^24.10.4", "vite": "8.0.0-beta.2" },
|
|
213
213
|
"publishConfig": { "access": "public" },
|
|
214
|
-
"gitHead": "
|
|
214
|
+
"gitHead": "936b3cc1d4bba49e2ddfa38662e37868d0a30fd6"
|
|
215
215
|
}
|