@powerlines/plugin-env 0.16.328 → 0.16.330
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-builtin.cjs +27 -7
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.mjs +27 -7
- package/dist/helpers/load.cjs +10 -1
- package/dist/helpers/load.d.cts.map +1 -1
- package/dist/helpers/load.mjs +10 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +9 -9
|
@@ -10,6 +10,7 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
|
10
10
|
let _powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
|
|
11
11
|
let _powerlines_plugin_alloy_typescript_components = require("@powerlines/plugin-alloy/typescript/components");
|
|
12
12
|
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
13
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
13
14
|
let _stryke_helpers_deep_clone = require("@stryke/helpers/deep-clone");
|
|
14
15
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
15
16
|
|
|
@@ -69,7 +70,7 @@ function EnvTypeDefinition(props) {
|
|
|
69
70
|
get children() {
|
|
70
71
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
71
72
|
get each() {
|
|
72
|
-
return (0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_
|
|
73
|
+
return (0, _stryke_helpers_get_unique.getUnique)(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_*$/, ""), [
|
|
73
74
|
"prefix",
|
|
74
75
|
"",
|
|
75
76
|
"P\"2!\"/\""
|
|
@@ -88,7 +89,16 @@ function EnvTypeDefinition(props) {
|
|
|
88
89
|
doubleHardline: true,
|
|
89
90
|
get children() {
|
|
90
91
|
return __assignType((property) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components.TSDocSchemaProperty, {
|
|
91
|
-
schema
|
|
92
|
+
get schema() {
|
|
93
|
+
return {
|
|
94
|
+
...property,
|
|
95
|
+
alias: [property.name, ...(0, _stryke_convert_to_array.toArray)(property.alias).filter(__assignType((alias) => alias !== `${prefix}_${property.name}`, [
|
|
96
|
+
"alias",
|
|
97
|
+
"",
|
|
98
|
+
"P\"2!\"/\""
|
|
99
|
+
]))]
|
|
100
|
+
};
|
|
101
|
+
},
|
|
92
102
|
get defaultValue() {
|
|
93
103
|
return property?.default;
|
|
94
104
|
}
|
|
@@ -410,15 +420,21 @@ function EnvBuiltin(props) {
|
|
|
410
420
|
},
|
|
411
421
|
get children() {
|
|
412
422
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
413
|
-
heading
|
|
423
|
+
get heading() {
|
|
424
|
+
return `Initializes the ${context?.config?.framework?.name || "Powerlines"} environment configuration module.`;
|
|
425
|
+
},
|
|
414
426
|
get children() {
|
|
415
427
|
return [
|
|
416
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children
|
|
428
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
|
|
429
|
+
return `This function initializes the ${context?.config?.framework?.name || "Powerlines"} environment configuration object.`;
|
|
430
|
+
} }),
|
|
417
431
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
418
432
|
name: "environmentConfig",
|
|
419
433
|
children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
|
|
420
434
|
}),
|
|
421
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children
|
|
435
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { get children() {
|
|
436
|
+
return `The initialized ${context?.config?.framework?.name || "Powerlines"} configuration object.`;
|
|
437
|
+
} })
|
|
422
438
|
];
|
|
423
439
|
}
|
|
424
440
|
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
@@ -504,9 +520,13 @@ function EnvBuiltin(props) {
|
|
|
504
520
|
}),
|
|
505
521
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
506
522
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
507
|
-
heading
|
|
523
|
+
get heading() {
|
|
524
|
+
return `The ${context?.config?.framework?.name || "Powerlines"} environment configuration object.`;
|
|
525
|
+
},
|
|
508
526
|
get children() {
|
|
509
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children
|
|
527
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
|
|
528
|
+
return `This object provides access to the ${context?.config?.framework?.name || "Powerlines"} environment configuration parameters in the application runtime.`;
|
|
529
|
+
} });
|
|
510
530
|
}
|
|
511
531
|
}),
|
|
512
532
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
@@ -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":";;;;;;UAiEiB,sBAAA,SAA+B,cAAc;EAC5D,MAAA,EAAQ,gBAAA;AAAA;;;;iBAMM,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,QAAA;AAAA,UA6L9C,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;AAAA;AApMQ;AAM1B;;AAN0B,iBA6MV,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
|
|
@@ -9,6 +9,7 @@ import { ElseIfClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, V
|
|
|
9
9
|
import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
|
|
10
10
|
import { BuiltinFile, InterfaceDeclaration as InterfaceDeclaration$1, InterfaceMember, ObjectDeclaration, TSDocSchemaProperty } from "@powerlines/plugin-alloy/typescript/components";
|
|
11
11
|
import { TSDoc, TSDocParam, TSDocRemarks, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
12
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
12
13
|
import { deepClone } from "@stryke/helpers/deep-clone";
|
|
13
14
|
import { getUnique } from "@stryke/helpers/get-unique";
|
|
14
15
|
|
|
@@ -68,7 +69,7 @@ function EnvTypeDefinition(props) {
|
|
|
68
69
|
get children() {
|
|
69
70
|
return createComponent(For, {
|
|
70
71
|
get each() {
|
|
71
|
-
return getUnique(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_
|
|
72
|
+
return getUnique(context.config.env.prefix).map(__assignType((prefix) => prefix.replace(/_*$/, ""), [
|
|
72
73
|
"prefix",
|
|
73
74
|
"",
|
|
74
75
|
"P\"2!\"/\""
|
|
@@ -87,7 +88,16 @@ function EnvTypeDefinition(props) {
|
|
|
87
88
|
doubleHardline: true,
|
|
88
89
|
get children() {
|
|
89
90
|
return __assignType((property) => [createComponent(TSDocSchemaProperty, {
|
|
90
|
-
schema
|
|
91
|
+
get schema() {
|
|
92
|
+
return {
|
|
93
|
+
...property,
|
|
94
|
+
alias: [property.name, ...toArray(property.alias).filter(__assignType((alias) => alias !== `${prefix}_${property.name}`, [
|
|
95
|
+
"alias",
|
|
96
|
+
"",
|
|
97
|
+
"P\"2!\"/\""
|
|
98
|
+
]))]
|
|
99
|
+
};
|
|
100
|
+
},
|
|
91
101
|
get defaultValue() {
|
|
92
102
|
return property?.default;
|
|
93
103
|
}
|
|
@@ -409,15 +419,21 @@ function EnvBuiltin(props) {
|
|
|
409
419
|
},
|
|
410
420
|
get children() {
|
|
411
421
|
return [createComponent(TSDoc, {
|
|
412
|
-
heading
|
|
422
|
+
get heading() {
|
|
423
|
+
return `Initializes the ${context?.config?.framework?.name || "Powerlines"} environment configuration module.`;
|
|
424
|
+
},
|
|
413
425
|
get children() {
|
|
414
426
|
return [
|
|
415
|
-
createComponent(TSDocRemarks, { children
|
|
427
|
+
createComponent(TSDocRemarks, { get children() {
|
|
428
|
+
return `This function initializes the ${context?.config?.framework?.name || "Powerlines"} environment configuration object.`;
|
|
429
|
+
} }),
|
|
416
430
|
createComponent(TSDocParam, {
|
|
417
431
|
name: "environmentConfig",
|
|
418
432
|
children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
|
|
419
433
|
}),
|
|
420
|
-
createComponent(TSDocReturns, { children
|
|
434
|
+
createComponent(TSDocReturns, { get children() {
|
|
435
|
+
return `The initialized ${context?.config?.framework?.name || "Powerlines"} configuration object.`;
|
|
436
|
+
} })
|
|
421
437
|
];
|
|
422
438
|
}
|
|
423
439
|
}), createComponent(FunctionDeclaration, {
|
|
@@ -503,9 +519,13 @@ function EnvBuiltin(props) {
|
|
|
503
519
|
}),
|
|
504
520
|
createComponent(Spacing, {}),
|
|
505
521
|
createComponent(TSDoc, {
|
|
506
|
-
heading
|
|
522
|
+
get heading() {
|
|
523
|
+
return `The ${context?.config?.framework?.name || "Powerlines"} environment configuration object.`;
|
|
524
|
+
},
|
|
507
525
|
get children() {
|
|
508
|
-
return createComponent(TSDocRemarks, { children
|
|
526
|
+
return createComponent(TSDocRemarks, { get children() {
|
|
527
|
+
return `This object provides access to the ${context?.config?.framework?.name || "Powerlines"} environment configuration parameters in the application runtime.`;
|
|
528
|
+
} });
|
|
509
529
|
}
|
|
510
530
|
}),
|
|
511
531
|
createComponent(VarDeclaration, {
|
package/dist/helpers/load.cjs
CHANGED
|
@@ -74,7 +74,7 @@ loadEnvDirectory.__type = [
|
|
|
74
74
|
* @returns An object containing the dotenv configuration.
|
|
75
75
|
*/
|
|
76
76
|
function loadEnvFromContext(context, parsed, workspaceConfig) {
|
|
77
|
-
|
|
77
|
+
const result = (0, defu.default)({
|
|
78
78
|
APP_NAME: (0, _stryke_string_format_kebab_case.kebabCase)(context.config.name),
|
|
79
79
|
APP_VERSION: context.packageJson.version,
|
|
80
80
|
BUILD_ID: context.meta.buildId,
|
|
@@ -103,6 +103,15 @@ function loadEnvFromContext(context, parsed, workspaceConfig) {
|
|
|
103
103
|
"",
|
|
104
104
|
"P\"2!\"2\"\"/#"
|
|
105
105
|
]), {}) : {});
|
|
106
|
+
if (![
|
|
107
|
+
"error",
|
|
108
|
+
"warn",
|
|
109
|
+
"info",
|
|
110
|
+
"debug"
|
|
111
|
+
].includes(result.LOG_LEVEL)) if (!result.LOG_LEVEL || String(result.LOG_LEVEL) === "silent") result.LOG_LEVEL = "error";
|
|
112
|
+
else if (String(result.LOG_LEVEL) === "trace") result.LOG_LEVEL = "debug";
|
|
113
|
+
else result.LOG_LEVEL = context.config.mode === "production" ? "info" : "debug";
|
|
114
|
+
return result;
|
|
106
115
|
}
|
|
107
116
|
loadEnvFromContext.__type = [
|
|
108
117
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.cts","names":[],"sources":["../../src/helpers/load.ts"],"mappings":";;;;;;;AAiGA;;;;;iBAAgB,kBAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,iBAAA,EACR,eAAA,GAAkB,eAAA;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"load.d.cts","names":[],"sources":["../../src/helpers/load.ts"],"mappings":";;;;;;;AAiGA;;;;;iBAAgB,kBAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,iBAAA,EACR,eAAA,GAAkB,eAAA;;;;;;;;;;;;;;;;;;;;;iBA4DE,OAAA,cACP,iBAAA,GAAoB,iBAAA,EAEjC,OAAA,EAAS,gBAAA,EACT,OAAA,GAAS,gBAAA,GACR,OAAA,CAAQ,IAAA"}
|
package/dist/helpers/load.mjs
CHANGED
|
@@ -71,7 +71,7 @@ loadEnvDirectory.__type = [
|
|
|
71
71
|
* @returns An object containing the dotenv configuration.
|
|
72
72
|
*/
|
|
73
73
|
function loadEnvFromContext(context, parsed, workspaceConfig) {
|
|
74
|
-
|
|
74
|
+
const result = defu({
|
|
75
75
|
APP_NAME: kebabCase(context.config.name),
|
|
76
76
|
APP_VERSION: context.packageJson.version,
|
|
77
77
|
BUILD_ID: context.meta.buildId,
|
|
@@ -100,6 +100,15 @@ function loadEnvFromContext(context, parsed, workspaceConfig) {
|
|
|
100
100
|
"",
|
|
101
101
|
"P\"2!\"2\"\"/#"
|
|
102
102
|
]), {}) : {});
|
|
103
|
+
if (![
|
|
104
|
+
"error",
|
|
105
|
+
"warn",
|
|
106
|
+
"info",
|
|
107
|
+
"debug"
|
|
108
|
+
].includes(result.LOG_LEVEL)) if (!result.LOG_LEVEL || String(result.LOG_LEVEL) === "silent") result.LOG_LEVEL = "error";
|
|
109
|
+
else if (String(result.LOG_LEVEL) === "trace") result.LOG_LEVEL = "debug";
|
|
110
|
+
else result.LOG_LEVEL = context.config.mode === "production" ? "info" : "debug";
|
|
111
|
+
return result;
|
|
103
112
|
}
|
|
104
113
|
loadEnvFromContext.__type = [
|
|
105
114
|
() => __ΩEnvPluginContext,
|
package/dist/index.cjs
CHANGED
|
@@ -12,13 +12,13 @@ let defu = require("defu");
|
|
|
12
12
|
defu = require_runtime.__toESM(defu);
|
|
13
13
|
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
14
14
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
15
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
15
16
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
16
17
|
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
17
18
|
let _powerlines_plugin_automd = require("@powerlines/plugin-automd");
|
|
18
19
|
_powerlines_plugin_automd = require_runtime.__toESM(_powerlines_plugin_automd);
|
|
19
20
|
let _powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
20
21
|
_powerlines_plugin_babel = require_runtime.__toESM(_powerlines_plugin_babel);
|
|
21
|
-
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
22
22
|
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
23
23
|
|
|
24
24
|
//#region src/index.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import { joinPaths } from "@stryke/path/join";
|
|
|
9
9
|
import defu from "defu";
|
|
10
10
|
import { getDocsOutputPath } from "powerlines/plugin-utils";
|
|
11
11
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
12
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
12
13
|
import { getUnique } from "@stryke/helpers/get-unique";
|
|
13
14
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
14
15
|
import automd from "@powerlines/plugin-automd";
|
|
15
16
|
import babel from "@powerlines/plugin-babel";
|
|
16
|
-
import { toArray } from "@stryke/convert/to-array";
|
|
17
17
|
import { constantCase } from "@stryke/string-format/constant-case";
|
|
18
18
|
|
|
19
19
|
//#region src/index.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.330",
|
|
4
4
|
"private": false,
|
|
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
|
"keywords": ["dotenv", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -250,12 +250,12 @@
|
|
|
250
250
|
"@alloy-js/typescript": "^0.23.0",
|
|
251
251
|
"@babel/core": "8.0.0-rc.6",
|
|
252
252
|
"@babel/types": "8.0.0-rc.6",
|
|
253
|
-
"@powerlines/core": "0.48.
|
|
254
|
-
"@powerlines/plugin-alloy": "0.26.
|
|
255
|
-
"@powerlines/plugin-automd": "0.1.
|
|
256
|
-
"@powerlines/plugin-babel": "0.13.
|
|
257
|
-
"@powerlines/plugin-plugin": "0.12.
|
|
258
|
-
"@powerlines/schema": "0.11.
|
|
253
|
+
"@powerlines/core": "0.48.48",
|
|
254
|
+
"@powerlines/plugin-alloy": "0.26.219",
|
|
255
|
+
"@powerlines/plugin-automd": "0.1.587",
|
|
256
|
+
"@powerlines/plugin-babel": "0.13.122",
|
|
257
|
+
"@powerlines/plugin-plugin": "0.12.538",
|
|
258
|
+
"@powerlines/schema": "0.11.108",
|
|
259
259
|
"@storm-software/config-tools": "^1.190.40",
|
|
260
260
|
"@stryke/capnp": "^0.12.111",
|
|
261
261
|
"@stryke/convert": "^0.7.15",
|
|
@@ -270,9 +270,9 @@
|
|
|
270
270
|
"automd": "^0.4.3",
|
|
271
271
|
"c12": "^3.3.4",
|
|
272
272
|
"defu": "^6.1.7",
|
|
273
|
-
"powerlines": "0.47.
|
|
273
|
+
"powerlines": "0.47.126"
|
|
274
274
|
},
|
|
275
275
|
"devDependencies": { "@types/node": "^25.9.1", "vite": "^8.0.16" },
|
|
276
276
|
"publishConfig": { "access": "public" },
|
|
277
|
-
"gitHead": "
|
|
277
|
+
"gitHead": "3d69d66bdb43fcddc6181fc9dc979645c2f1cf1e"
|
|
278
278
|
}
|