@powerlines/plugin-env 0.16.364 → 0.16.365
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 +4 -26
- package/dist/babel/plugin.mjs +4 -26
- package/dist/components/docs.cjs +4 -47
- package/dist/components/docs.mjs +4 -46
- package/dist/components/env-builtin.cjs +70 -250
- package/dist/components/env-builtin.mjs +70 -248
- package/dist/components/index.cjs +1 -4
- package/dist/components/index.mjs +3 -3
- package/dist/helpers/automd-generator.cjs +4 -12
- package/dist/helpers/automd-generator.mjs +4 -12
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +2 -2
- package/dist/helpers/index.d.mts +2 -2
- package/dist/helpers/index.mjs +2 -2
- package/dist/helpers/load.cjs +7 -59
- package/dist/helpers/load.d.cts +2 -2
- package/dist/helpers/load.d.mts +2 -2
- package/dist/helpers/load.mjs +7 -59
- package/dist/helpers/schema.cjs +35 -154
- package/dist/helpers/schema.d.cts +9 -8
- package/dist/helpers/schema.d.cts.map +1 -1
- package/dist/helpers/schema.d.mts +9 -8
- package/dist/helpers/schema.mjs +35 -154
- package/dist/helpers/source-file-env.cjs +4 -34
- package/dist/helpers/source-file-env.mjs +4 -34
- package/dist/index.cjs +20 -47
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +18 -39
- package/dist/schemas/env.cjs +723 -0
- package/dist/schemas/env.d.cts +230 -0
- package/dist/schemas/env.d.cts.map +1 -0
- package/dist/schemas/env.d.mts +230 -0
- package/dist/{types → schemas}/env.d.mts.map +1 -1
- package/dist/schemas/env.mjs +715 -0
- package/dist/schemas/index.cjs +10 -0
- package/dist/schemas/index.d.cts +2 -0
- package/dist/schemas/index.d.mts +2 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/types/index.cjs +0 -12
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +1 -4
- package/dist/types/plugin.cjs +7 -107
- package/dist/types/plugin.d.cts +2 -2
- package/dist/types/plugin.d.mts +2 -2
- package/dist/types/plugin.mjs +7 -100
- package/package.json +40 -25
- package/dist/types/env.cjs +0 -541
- package/dist/types/env.d.cts +0 -938
- package/dist/types/env.d.cts.map +0 -1
- package/dist/types/env.d.mts +0 -938
- package/dist/types/env.mjs +0 -539
- /package/dist/{types → schemas}/env.mjs.map +0 -0
package/dist/babel/plugin.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
2
|
let _power_plant_schema = require("@power-plant/schema");
|
|
4
3
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
5
4
|
let _powerlines_plugin_babel_helpers_create_plugin = require("@powerlines/plugin-babel/helpers/create-plugin");
|
|
@@ -8,11 +7,7 @@ let _stryke_path_replace = require("@stryke/path/replace");
|
|
|
8
7
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
9
8
|
|
|
10
9
|
//#region src/babel/plugin.ts
|
|
11
|
-
|
|
12
|
-
fn.__type = args;
|
|
13
|
-
return fn;
|
|
14
|
-
}
|
|
15
|
-
const envBabelPlugin = (_powerlines_plugin_babel_helpers_create_plugin.createBabelPlugin.Ω = [[() => require_types_plugin.__ΩEnvPluginContext, "n!"]], (0, _powerlines_plugin_babel_helpers_create_plugin.createBabelPlugin)("env", __assignType(({ logger, context }) => {
|
|
10
|
+
const envBabelPlugin = (0, _powerlines_plugin_babel_helpers_create_plugin.createBabelPlugin)("env", ({ logger, context }) => {
|
|
16
11
|
const config = (0, _power_plant_schema.getProperties)(context.env.config);
|
|
17
12
|
function extractEnv(node, pass, isInjectable = false) {
|
|
18
13
|
if (node.name) {
|
|
@@ -38,14 +33,7 @@ const envBabelPlugin = (_powerlines_plugin_babel_helpers_create_plugin.createBab
|
|
|
38
33
|
});
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
|
-
|
|
42
|
-
"node",
|
|
43
|
-
"pass",
|
|
44
|
-
"isInjectable",
|
|
45
|
-
"extractEnv",
|
|
46
|
-
"P!2!!2\"\"2#\"/$"
|
|
47
|
-
];
|
|
48
|
-
return { visitor: { MemberExpression: __assignType(function MemberExpression(path, pass) {
|
|
36
|
+
return { visitor: { MemberExpression(path, pass) {
|
|
49
37
|
if (path.get("object")?.get("property")?.isIdentifier({ name: "env" }) && path.get("object")?.get("object")?.isIdentifier({ name: "process" }) && path.get("property")?.isIdentifier()) {
|
|
50
38
|
const identifier = path.get("property")?.node;
|
|
51
39
|
if (!identifier.name) return;
|
|
@@ -71,18 +59,8 @@ const envBabelPlugin = (_powerlines_plugin_babel_helpers_create_plugin.createBab
|
|
|
71
59
|
if (!identifier.name) return;
|
|
72
60
|
extractEnv(identifier, pass, false);
|
|
73
61
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
"path",
|
|
77
|
-
"pass",
|
|
78
|
-
"MemberExpression",
|
|
79
|
-
"P\"w!2\"!2#\"/$"
|
|
80
|
-
]) } };
|
|
81
|
-
}, [
|
|
82
|
-
"param0",
|
|
83
|
-
"",
|
|
84
|
-
"P\"2!\"/\""
|
|
85
|
-
])));
|
|
62
|
+
} } };
|
|
63
|
+
});
|
|
86
64
|
|
|
87
65
|
//#endregion
|
|
88
66
|
exports.envBabelPlugin = envBabelPlugin;
|
package/dist/babel/plugin.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __ΩEnvPluginContext } from "../types/plugin.mjs";
|
|
2
1
|
import { getProperties } from "@power-plant/schema";
|
|
3
2
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
4
3
|
import { createBabelPlugin } from "@powerlines/plugin-babel/helpers/create-plugin";
|
|
@@ -7,11 +6,7 @@ import { replacePath } from "@stryke/path/replace";
|
|
|
7
6
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
8
7
|
|
|
9
8
|
//#region src/babel/plugin.ts
|
|
10
|
-
|
|
11
|
-
fn.__type = args;
|
|
12
|
-
return fn;
|
|
13
|
-
}
|
|
14
|
-
const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!"]], createBabelPlugin("env", __assignType(({ logger, context }) => {
|
|
9
|
+
const envBabelPlugin = createBabelPlugin("env", ({ logger, context }) => {
|
|
15
10
|
const config = getProperties(context.env.config);
|
|
16
11
|
function extractEnv(node, pass, isInjectable = false) {
|
|
17
12
|
if (node.name) {
|
|
@@ -37,14 +32,7 @@ const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!
|
|
|
37
32
|
});
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
"node",
|
|
42
|
-
"pass",
|
|
43
|
-
"isInjectable",
|
|
44
|
-
"extractEnv",
|
|
45
|
-
"P!2!!2\"\"2#\"/$"
|
|
46
|
-
];
|
|
47
|
-
return { visitor: { MemberExpression: __assignType(function MemberExpression(path, pass) {
|
|
35
|
+
return { visitor: { MemberExpression(path, pass) {
|
|
48
36
|
if (path.get("object")?.get("property")?.isIdentifier({ name: "env" }) && path.get("object")?.get("object")?.isIdentifier({ name: "process" }) && path.get("property")?.isIdentifier()) {
|
|
49
37
|
const identifier = path.get("property")?.node;
|
|
50
38
|
if (!identifier.name) return;
|
|
@@ -70,18 +58,8 @@ const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!
|
|
|
70
58
|
if (!identifier.name) return;
|
|
71
59
|
extractEnv(identifier, pass, false);
|
|
72
60
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
"path",
|
|
76
|
-
"pass",
|
|
77
|
-
"MemberExpression",
|
|
78
|
-
"P\"w!2\"!2#\"/$"
|
|
79
|
-
]) } };
|
|
80
|
-
}, [
|
|
81
|
-
"param0",
|
|
82
|
-
"",
|
|
83
|
-
"P\"2!\"/\""
|
|
84
|
-
])));
|
|
61
|
+
} } };
|
|
62
|
+
});
|
|
85
63
|
|
|
86
64
|
//#endregion
|
|
87
65
|
export { envBabelPlugin };
|
package/dist/components/docs.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
2
|
let _power_plant_schema = require("@power-plant/schema");
|
|
4
3
|
let _stryke_path_join = require("@stryke/path/join");
|
|
5
4
|
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
@@ -13,29 +12,12 @@ let _power_plant_schema_codegen = require("@power-plant/schema/codegen");
|
|
|
13
12
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
14
13
|
|
|
15
14
|
//#region src/components/docs.tsx
|
|
16
|
-
const __ΩPartial = [
|
|
17
|
-
"T",
|
|
18
|
-
"Partial",
|
|
19
|
-
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
20
|
-
];
|
|
21
|
-
function __assignType(fn, args) {
|
|
22
|
-
fn.__type = args;
|
|
23
|
-
return fn;
|
|
24
|
-
}
|
|
25
|
-
const __ΩEnvDocsFileProps = [
|
|
26
|
-
() => __ΩPartial,
|
|
27
|
-
"levelOffset",
|
|
28
|
-
0,
|
|
29
|
-
"The heading level offset to apply to the generated documentation.",
|
|
30
|
-
"EnvDocsFileProps",
|
|
31
|
-
"P!o!\"'4\"8>#?$Mw%y"
|
|
32
|
-
];
|
|
33
15
|
/**
|
|
34
16
|
* Generates the environment configuration markdown documentation for the Powerlines project.
|
|
35
17
|
*/
|
|
36
18
|
function EnvDocsFile(props) {
|
|
37
19
|
const { levelOffset = 0, ...rest } = props;
|
|
38
|
-
const context = (
|
|
20
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
39
21
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_markdown_components_markdown_file.MarkdownFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get path() {
|
|
40
22
|
return (0, _stryke_path_join.joinPaths)((0, powerlines_plugin_utils.getDocsOutputPath)(context.config.root), "env.md");
|
|
41
23
|
} }, rest, { get children() {
|
|
@@ -54,20 +36,7 @@ function EnvDocsFile(props) {
|
|
|
54
36
|
_alloy_js_core.code`The below list of configuration parameters are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text locally.`,
|
|
55
37
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
56
38
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_markdown_components_markdown_table.MarkdownTable, { get data() {
|
|
57
|
-
return (0, _power_plant_schema.getPropertiesList)(context.env.config).filter(
|
|
58
|
-
"p",
|
|
59
|
-
"",
|
|
60
|
-
"P\"2!\"/\""
|
|
61
|
-
])) && !property?.hidden && !property?.ignore && !property?.readOnly && !property?.internal, [
|
|
62
|
-
"property",
|
|
63
|
-
"",
|
|
64
|
-
"P\"2!\"/\""
|
|
65
|
-
])).sort(__assignType((a, b) => !a?.name && !b?.name ? 0 : !a?.name ? 1 : !b?.name ? -1 : a.name.localeCompare(b.name), [
|
|
66
|
-
"a",
|
|
67
|
-
"b",
|
|
68
|
-
"",
|
|
69
|
-
"P\"2!\"2\"\"/#"
|
|
70
|
-
])).map(__assignType((property) => {
|
|
39
|
+
return (0, _power_plant_schema.getPropertiesList)(context.env.config).filter((property) => (0, _power_plant_schema.getPropertiesList)(context.env.config).some((p) => p.name === property.name && context.env.config.active.includes(property.name)) && !property?.hidden && !property?.ignore && !property?.readOnly && !property?.internal).sort((a, b) => !a?.name && !b?.name ? 0 : !a?.name ? 1 : !b?.name ? -1 : a.name.localeCompare(b.name)).map((property) => {
|
|
71
40
|
return {
|
|
72
41
|
name: property.name?.trim(),
|
|
73
42
|
description: (property.description ?? "").trim(),
|
|
@@ -75,23 +44,11 @@ function EnvDocsFile(props) {
|
|
|
75
44
|
defaultValue: property.default ? (0, _power_plant_schema_codegen.stringifyType)(property.default) : "",
|
|
76
45
|
required: property.required ? "" : "✔"
|
|
77
46
|
};
|
|
78
|
-
}
|
|
79
|
-
"property",
|
|
80
|
-
"",
|
|
81
|
-
"P\"2!\"/\""
|
|
82
|
-
])) ?? [];
|
|
47
|
+
}) ?? [];
|
|
83
48
|
} })
|
|
84
49
|
];
|
|
85
50
|
} }));
|
|
86
51
|
}
|
|
87
|
-
EnvDocsFile.__type = [
|
|
88
|
-
() => __ΩEnvDocsFileProps,
|
|
89
|
-
"props",
|
|
90
|
-
"EnvDocsFile",
|
|
91
|
-
"Generates the environment configuration markdown documentation for the Powerlines project.",
|
|
92
|
-
"Pn!2\"\"/#?$"
|
|
93
|
-
];
|
|
94
52
|
|
|
95
53
|
//#endregion
|
|
96
|
-
exports.EnvDocsFile = EnvDocsFile;
|
|
97
|
-
exports.__ΩEnvDocsFileProps = __ΩEnvDocsFileProps;
|
|
54
|
+
exports.EnvDocsFile = EnvDocsFile;
|
package/dist/components/docs.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __ΩEnvPluginContext } from "../types/plugin.mjs";
|
|
2
1
|
import { getPropertiesList } from "@power-plant/schema";
|
|
3
2
|
import { joinPaths } from "@stryke/path/join";
|
|
4
3
|
import { getDocsOutputPath } from "powerlines/plugin-utils";
|
|
@@ -12,29 +11,12 @@ import { stringifyType } from "@power-plant/schema/codegen";
|
|
|
12
11
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
13
12
|
|
|
14
13
|
//#region src/components/docs.tsx
|
|
15
|
-
const __ΩPartial = [
|
|
16
|
-
"T",
|
|
17
|
-
"Partial",
|
|
18
|
-
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
19
|
-
];
|
|
20
|
-
function __assignType(fn, args) {
|
|
21
|
-
fn.__type = args;
|
|
22
|
-
return fn;
|
|
23
|
-
}
|
|
24
|
-
const __ΩEnvDocsFileProps = [
|
|
25
|
-
() => __ΩPartial,
|
|
26
|
-
"levelOffset",
|
|
27
|
-
0,
|
|
28
|
-
"The heading level offset to apply to the generated documentation.",
|
|
29
|
-
"EnvDocsFileProps",
|
|
30
|
-
"P!o!\"'4\"8>#?$Mw%y"
|
|
31
|
-
];
|
|
32
14
|
/**
|
|
33
15
|
* Generates the environment configuration markdown documentation for the Powerlines project.
|
|
34
16
|
*/
|
|
35
17
|
function EnvDocsFile(props) {
|
|
36
18
|
const { levelOffset = 0, ...rest } = props;
|
|
37
|
-
const context =
|
|
19
|
+
const context = usePowerlines();
|
|
38
20
|
return createComponent(MarkdownFile, mergeProps({ get path() {
|
|
39
21
|
return joinPaths(getDocsOutputPath(context.config.root), "env.md");
|
|
40
22
|
} }, rest, { get children() {
|
|
@@ -53,20 +35,7 @@ function EnvDocsFile(props) {
|
|
|
53
35
|
code`The below list of configuration parameters are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text locally.`,
|
|
54
36
|
createComponent(Spacing, {}),
|
|
55
37
|
createComponent(MarkdownTable, { get data() {
|
|
56
|
-
return getPropertiesList(context.env.config).filter(
|
|
57
|
-
"p",
|
|
58
|
-
"",
|
|
59
|
-
"P\"2!\"/\""
|
|
60
|
-
])) && !property?.hidden && !property?.ignore && !property?.readOnly && !property?.internal, [
|
|
61
|
-
"property",
|
|
62
|
-
"",
|
|
63
|
-
"P\"2!\"/\""
|
|
64
|
-
])).sort(__assignType((a, b) => !a?.name && !b?.name ? 0 : !a?.name ? 1 : !b?.name ? -1 : a.name.localeCompare(b.name), [
|
|
65
|
-
"a",
|
|
66
|
-
"b",
|
|
67
|
-
"",
|
|
68
|
-
"P\"2!\"2\"\"/#"
|
|
69
|
-
])).map(__assignType((property) => {
|
|
38
|
+
return getPropertiesList(context.env.config).filter((property) => getPropertiesList(context.env.config).some((p) => p.name === property.name && context.env.config.active.includes(property.name)) && !property?.hidden && !property?.ignore && !property?.readOnly && !property?.internal).sort((a, b) => !a?.name && !b?.name ? 0 : !a?.name ? 1 : !b?.name ? -1 : a.name.localeCompare(b.name)).map((property) => {
|
|
70
39
|
return {
|
|
71
40
|
name: property.name?.trim(),
|
|
72
41
|
description: (property.description ?? "").trim(),
|
|
@@ -74,23 +43,12 @@ function EnvDocsFile(props) {
|
|
|
74
43
|
defaultValue: property.default ? stringifyType(property.default) : "",
|
|
75
44
|
required: property.required ? "" : "✔"
|
|
76
45
|
};
|
|
77
|
-
}
|
|
78
|
-
"property",
|
|
79
|
-
"",
|
|
80
|
-
"P\"2!\"/\""
|
|
81
|
-
])) ?? [];
|
|
46
|
+
}) ?? [];
|
|
82
47
|
} })
|
|
83
48
|
];
|
|
84
49
|
} }));
|
|
85
50
|
}
|
|
86
|
-
EnvDocsFile.__type = [
|
|
87
|
-
() => __ΩEnvDocsFileProps,
|
|
88
|
-
"props",
|
|
89
|
-
"EnvDocsFile",
|
|
90
|
-
"Generates the environment configuration markdown documentation for the Powerlines project.",
|
|
91
|
-
"Pn!2\"\"/#?$"
|
|
92
|
-
];
|
|
93
51
|
|
|
94
52
|
//#endregion
|
|
95
|
-
export { EnvDocsFile
|
|
53
|
+
export { EnvDocsFile };
|
|
96
54
|
//# sourceMappingURL=docs.mjs.map
|