@powerlines/plugin-env 0.15.24 → 0.15.26

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.
@@ -14,7 +14,7 @@ let __powerlines_plugin_alloy_markdown_components_markdown_table = require("@pow
14
14
  * Generates the environment configuration markdown documentation for the Powerlines project.
15
15
  */
16
16
  function EnvDocs() {
17
- const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
17
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlinesSafe)();
18
18
  if (!context) return null;
19
19
  const reflection = require_helpers_create_reflection_resource.createReflectionResource(context);
20
20
  return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_markdown_components_markdown_file.MarkdownFile, {
@@ -4,7 +4,7 @@ import { stringifyType } from "@powerlines/deepkit/vendor/type";
4
4
  import { Show, code } from "@alloy-js/core";
5
5
  import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
6
6
  import { Heading, Link } from "@alloy-js/markdown";
7
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
+ import { usePowerlinesSafe } from "@powerlines/plugin-alloy/core/contexts/context";
8
8
  import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
9
9
  import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
10
10
 
@@ -13,7 +13,7 @@ import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/mark
13
13
  * Generates the environment configuration markdown documentation for the Powerlines project.
14
14
  */
15
15
  function EnvDocs() {
16
- const context = usePowerlines();
16
+ const context = usePowerlinesSafe();
17
17
  if (!context) return null;
18
18
  const reflection = createReflectionResource(context);
19
19
  return createComponent(MarkdownFile, {
@@ -21,7 +21,8 @@ let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
21
21
  */
22
22
  function EnvTypeDefinition(props) {
23
23
  const [{ defaultValue, reflection }] = (0, __alloy_js_core.splitProps)(props, ["defaultValue", "reflection"]);
24
- const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
24
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlinesSafe)();
25
+ if (!context) return null;
25
26
  return [
26
27
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_typescript_interface.TypeScriptInterface, {
27
28
  name: " EnvBase",
@@ -37,7 +38,7 @@ function EnvTypeDefinition(props) {
37
38
  "export": true,
38
39
  get children() {
39
40
  return __alloy_js_core.code` {
40
- [Key in keyof EnvBase as Key ${context?.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
41
+ [Key in keyof EnvBase as Key ${context.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
41
42
  }
42
43
  `;
43
44
  }
@@ -193,7 +194,7 @@ const envSerializerRefkey = (0, __powerlines_plugin_alloy_helpers_refkey.refkey)
193
194
  */
194
195
  function EnvBuiltin(props) {
195
196
  const [{ defaultConfig, children }, rest] = (0, __alloy_js_core.splitProps)(props, ["defaultConfig", "children"]);
196
- const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
197
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlinesSafe)();
197
198
  const defaultValue = (0, __alloy_js_core.computed)(() => context && require_helpers_load.loadEnvFromContext(context, process.env));
198
199
  const reflection = require_helpers_create_reflection_resource.createReflectionResource(context);
199
200
  const envInstance = (0, __alloy_js_core.computed)(() => {
@@ -5,7 +5,7 @@ import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type
5
5
  import { titleCase } from "@stryke/string-format/title-case";
6
6
  import { For, Show, code, computed, splitProps } from "@alloy-js/core";
7
7
  import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
8
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
+ import { usePowerlinesSafe } from "@powerlines/plugin-alloy/core/contexts/context";
9
9
  import { ClassDeclaration, ClassMethod, ElseIfClause, FunctionDeclaration, IfStatement, NewExpression, TypeDeclaration, VarDeclaration } from "@alloy-js/typescript";
10
10
  import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
11
11
  import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
@@ -20,7 +20,8 @@ import { isNull } from "@stryke/type-checks/is-null";
20
20
  */
21
21
  function EnvTypeDefinition(props) {
22
22
  const [{ defaultValue, reflection }] = splitProps(props, ["defaultValue", "reflection"]);
23
- const context = usePowerlines();
23
+ const context = usePowerlinesSafe();
24
+ if (!context) return null;
24
25
  return [
25
26
  createComponent(TypeScriptInterface, {
26
27
  name: " EnvBase",
@@ -36,7 +37,7 @@ function EnvTypeDefinition(props) {
36
37
  "export": true,
37
38
  get children() {
38
39
  return code` {
39
- [Key in keyof EnvBase as Key ${context?.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
40
+ [Key in keyof EnvBase as Key ${context.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
40
41
  }
41
42
  `;
42
43
  }
@@ -192,7 +193,7 @@ const envSerializerRefkey = refkey("EnvSerializer");
192
193
  */
193
194
  function EnvBuiltin(props) {
194
195
  const [{ defaultConfig, children }, rest] = splitProps(props, ["defaultConfig", "children"]);
195
- const context = usePowerlines();
196
+ const context = usePowerlinesSafe();
196
197
  const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
197
198
  const reflection = createReflectionResource(context);
198
199
  const envInstance = computed(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-env",
3
- "version": "0.15.24",
3
+ "version": "0.15.26",
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": {
@@ -193,10 +193,10 @@
193
193
  "@alloy-js/typescript": "^0.22.0",
194
194
  "@babel/core": "^7.28.5",
195
195
  "@babel/types": "^7.28.5",
196
- "@powerlines/plugin-alloy": "^0.18.21",
197
- "@powerlines/plugin-automd": "^0.1.138",
198
- "@powerlines/plugin-babel": "^0.12.147",
199
- "@powerlines/plugin-plugin": "^0.12.90",
196
+ "@powerlines/plugin-alloy": "^0.18.23",
197
+ "@powerlines/plugin-automd": "^0.1.140",
198
+ "@powerlines/plugin-babel": "^0.12.149",
199
+ "@powerlines/plugin-plugin": "^0.12.92",
200
200
  "@storm-software/config-tools": "^1.188.75",
201
201
  "@stryke/capnp": "^0.12.52",
202
202
  "@stryke/env": "^0.20.44",
@@ -206,14 +206,14 @@
206
206
  "@stryke/type-checks": "^0.5.15",
207
207
  "@stryke/types": "^0.10.29",
208
208
  "automd": "^0.4.2",
209
- "powerlines": "^0.37.12"
209
+ "powerlines": "^0.37.14"
210
210
  },
211
211
  "devDependencies": {
212
- "@powerlines/deepkit": "^0.5.54",
213
- "@powerlines/plugin-deepkit": "^0.11.15",
212
+ "@powerlines/deepkit": "^0.5.56",
213
+ "@powerlines/plugin-deepkit": "^0.11.17",
214
214
  "@types/node": "^24.10.4",
215
215
  "vite": "8.0.0-beta.2"
216
216
  },
217
217
  "publishConfig": { "access": "public" },
218
- "gitHead": "818edcf68d107e24b0b00b8b1a549efa7b2ac7d7"
218
+ "gitHead": "a5b26ecf44d379c7026038b385f674f8118e22b0"
219
219
  }