@powerlines/plugin-env 0.16.68 → 0.16.70
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/README.md +1 -1
- package/dist/components/docs.cjs +37 -27
- package/dist/components/docs.mjs +37 -27
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +404 -314
- package/dist/components/env-builtin.mjs +404 -314
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/index.cjs +6 -3
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/powerlines) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
package/dist/components/docs.cjs
CHANGED
|
@@ -3,13 +3,13 @@ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
const require_helpers_docs_helper = require('../helpers/docs-helper.cjs');
|
|
4
4
|
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
5
5
|
let _stryke_path_join = require("@stryke/path/join");
|
|
6
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
7
|
let _alloy_js_core = require("@alloy-js/core");
|
|
7
8
|
let _alloy_js_markdown = require("@alloy-js/markdown");
|
|
8
9
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
9
10
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
10
11
|
let _powerlines_plugin_alloy_markdown_components_markdown_file = require("@powerlines/plugin-alloy/markdown/components/markdown-file");
|
|
11
12
|
let _powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
|
|
12
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
13
13
|
|
|
14
14
|
//#region src/components/docs.tsx
|
|
15
15
|
/**
|
|
@@ -18,42 +18,52 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
|
18
18
|
function EnvDocsFile(props) {
|
|
19
19
|
const { levelOffset = 0, reflection, ...rest } = props;
|
|
20
20
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_markdown_components_markdown_file.MarkdownFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get path() {
|
|
22
|
+
return (0, _stryke_path_join.joinPaths)(require_helpers_docs_helper.getDocsOutputPath(context), "env.md");
|
|
23
|
+
} }, rest, { get children() {
|
|
24
|
+
return [
|
|
25
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
26
26
|
level: 1 + levelOffset,
|
|
27
27
|
children: "Environment Configuration"
|
|
28
28
|
}),
|
|
29
29
|
_alloy_js_core.code`Below is a list of environment variables used by the`,
|
|
30
|
-
|
|
31
|
-
when
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
31
|
+
get when() {
|
|
32
|
+
return !!context.packageJson.name;
|
|
33
|
+
},
|
|
34
|
+
get children() {
|
|
35
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Link, {
|
|
36
|
+
get href() {
|
|
37
|
+
return `https://www.npmjs.com/package/${context.packageJson.name}`;
|
|
38
|
+
},
|
|
39
|
+
get title() {
|
|
40
|
+
return context.packageJson.name;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
36
44
|
}),
|
|
37
45
|
_alloy_js_core.code`package. These values can be updated in the \`.env\` file in the root of the project.`,
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
47
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
40
48
|
level: 2 + levelOffset,
|
|
41
49
|
children: "Environment Variables"
|
|
42
50
|
}),
|
|
43
|
-
|
|
51
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
44
52
|
_alloy_js_core.code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.`,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
54
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
|
|
55
|
+
return reflection?.getProperties().filter((property) => property.getNameAsString() !== "__POWERLINES_INJECTED__").sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())).map((reflectionProperty) => {
|
|
56
|
+
return {
|
|
57
|
+
name: reflectionProperty.getNameAsString().trim(),
|
|
58
|
+
description: (reflectionProperty.getDescription() ?? "").trim(),
|
|
59
|
+
type: (0, _powerlines_deepkit_vendor_type.stringifyType)(reflectionProperty.getType()).trim().replaceAll(" | ", ", or "),
|
|
60
|
+
defaultValue: reflectionProperty.hasDefault() ? String(reflectionProperty.getDefaultValue())?.includes("\"") ? reflectionProperty.getDefaultValue() : `\`${reflectionProperty.getDefaultValue()}\`` : "",
|
|
61
|
+
required: reflectionProperty.isValueRequired() ? "" : "✔"
|
|
62
|
+
};
|
|
63
|
+
}) ?? [];
|
|
64
|
+
} })
|
|
65
|
+
];
|
|
66
|
+
} }));
|
|
57
67
|
}
|
|
58
68
|
|
|
59
69
|
//#endregion
|
package/dist/components/docs.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getDocsOutputPath } from "../helpers/docs-helper.mjs";
|
|
2
2
|
import { stringifyType } from "@powerlines/deepkit/vendor/type";
|
|
3
3
|
import { joinPaths } from "@stryke/path/join";
|
|
4
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
5
|
import { Show, code } from "@alloy-js/core";
|
|
5
6
|
import { Heading, Link } from "@alloy-js/markdown";
|
|
6
7
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
7
8
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
8
9
|
import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
9
10
|
import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
|
|
10
|
-
import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/components/docs.tsx
|
|
13
13
|
/**
|
|
@@ -16,42 +16,52 @@ import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
|
16
16
|
function EnvDocsFile(props) {
|
|
17
17
|
const { levelOffset = 0, reflection, ...rest } = props;
|
|
18
18
|
const context = usePowerlines();
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
return createComponent(MarkdownFile, mergeProps({ get path() {
|
|
20
|
+
return joinPaths(getDocsOutputPath(context), "env.md");
|
|
21
|
+
} }, rest, { get children() {
|
|
22
|
+
return [
|
|
23
|
+
createComponent(Heading, {
|
|
24
24
|
level: 1 + levelOffset,
|
|
25
25
|
children: "Environment Configuration"
|
|
26
26
|
}),
|
|
27
27
|
code`Below is a list of environment variables used by the`,
|
|
28
|
-
|
|
29
|
-
when
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
createComponent(Show, {
|
|
29
|
+
get when() {
|
|
30
|
+
return !!context.packageJson.name;
|
|
31
|
+
},
|
|
32
|
+
get children() {
|
|
33
|
+
return createComponent(Link, {
|
|
34
|
+
get href() {
|
|
35
|
+
return `https://www.npmjs.com/package/${context.packageJson.name}`;
|
|
36
|
+
},
|
|
37
|
+
get title() {
|
|
38
|
+
return context.packageJson.name;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
34
42
|
}),
|
|
35
43
|
code`package. These values can be updated in the \`.env\` file in the root of the project.`,
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
createComponent(Spacing, {}),
|
|
45
|
+
createComponent(Heading, {
|
|
38
46
|
level: 2 + levelOffset,
|
|
39
47
|
children: "Environment Variables"
|
|
40
48
|
}),
|
|
41
|
-
|
|
49
|
+
createComponent(Spacing, {}),
|
|
42
50
|
code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.`,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
createComponent(Spacing, {}),
|
|
52
|
+
createComponent(MarkdownTable, { get data() {
|
|
53
|
+
return reflection?.getProperties().filter((property) => property.getNameAsString() !== "__POWERLINES_INJECTED__").sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())).map((reflectionProperty) => {
|
|
54
|
+
return {
|
|
55
|
+
name: reflectionProperty.getNameAsString().trim(),
|
|
56
|
+
description: (reflectionProperty.getDescription() ?? "").trim(),
|
|
57
|
+
type: stringifyType(reflectionProperty.getType()).trim().replaceAll(" | ", ", or "),
|
|
58
|
+
defaultValue: reflectionProperty.hasDefault() ? String(reflectionProperty.getDefaultValue())?.includes("\"") ? reflectionProperty.getDefaultValue() : `\`${reflectionProperty.getDefaultValue()}\`` : "",
|
|
59
|
+
required: reflectionProperty.isValueRequired() ? "" : "✔"
|
|
60
|
+
};
|
|
61
|
+
}) ?? [];
|
|
62
|
+
} })
|
|
63
|
+
];
|
|
64
|
+
} }));
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.mjs","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show } from \"@alloy-js/core\";\nimport { Heading, Link } from \"@alloy-js/markdown\";\nimport {\n ReflectionClass,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { getDocsOutputPath } from \"../helpers/docs-helper\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n reflection: ReflectionClass<any>;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, reflection, ...rest } = props;\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment Configuration</Heading>\n {code`Below is a list of environment variables used by the`}\n <Show when={!!context.packageJson.name}>\n <Link\n href={`https://www.npmjs.com/package/${context.packageJson.name}`}\n title={context.packageJson.name!}\n />\n </Show>\n {code`package. These values can be updated in the \\`.env\\` file in the root of the project.`}\n <Spacing />\n <Heading level={2 + levelOffset}>Environment Variables</Heading>\n <Spacing />\n {code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.`}\n <Spacing />\n <MarkdownTable\n data={\n reflection\n ?.getProperties()\n .filter(\n property =>\n property.getNameAsString() !== \"__POWERLINES_INJECTED__\"\n )\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n )\n .map(reflectionProperty => {\n return {\n name: reflectionProperty.getNameAsString().trim(),\n description: (reflectionProperty.getDescription() ?? \"\").trim(),\n type: stringifyType(reflectionProperty.getType())\n .trim()\n .replaceAll(\" | \", \", or \"),\n defaultValue: reflectionProperty.hasDefault()\n ? String(reflectionProperty.getDefaultValue())?.includes('\"')\n ? reflectionProperty.getDefaultValue()\n : `\\`${reflectionProperty.getDefaultValue()}\\``\n : \"\",\n required: reflectionProperty.isValueRequired() ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.mjs","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show } from \"@alloy-js/core\";\nimport { Heading, Link } from \"@alloy-js/markdown\";\nimport {\n ReflectionClass,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { getDocsOutputPath } from \"../helpers/docs-helper\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n reflection: ReflectionClass<any>;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, reflection, ...rest } = props;\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment Configuration</Heading>\n {code`Below is a list of environment variables used by the`}\n <Show when={!!context.packageJson.name}>\n <Link\n href={`https://www.npmjs.com/package/${context.packageJson.name}`}\n title={context.packageJson.name!}\n />\n </Show>\n {code`package. These values can be updated in the \\`.env\\` file in the root of the project.`}\n <Spacing />\n <Heading level={2 + levelOffset}>Environment Variables</Heading>\n <Spacing />\n {code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.`}\n <Spacing />\n <MarkdownTable\n data={\n reflection\n ?.getProperties()\n .filter(\n property =>\n property.getNameAsString() !== \"__POWERLINES_INJECTED__\"\n )\n .sort((a, b) =>\n a.getNameAsString().localeCompare(b.getNameAsString())\n )\n .map(reflectionProperty => {\n return {\n name: reflectionProperty.getNameAsString().trim(),\n description: (reflectionProperty.getDescription() ?? \"\").trim(),\n type: stringifyType(reflectionProperty.getType())\n .trim()\n .replaceAll(\" | \", \", or \"),\n defaultValue: reflectionProperty.hasDefault()\n ? String(reflectionProperty.getDefaultValue())?.includes('\"')\n ? reflectionProperty.getDefaultValue()\n : `\\`${reflectionProperty.getDefaultValue()}\\``\n : \"\",\n required: reflectionProperty.isValueRequired() ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;CA8CE,MAAA,EACF,cAAA,eAEE,GAAA,SACC;CACD,MAAA,UAAA,eAAA;AACF,QAAO,gBAAoB,cAAQ,WAAkB,EACnD,IAAM,OAAE;;cAIR,IAAM,WAAC;AACJ,SAAA;GAAA,gBAAA,SAAA;IACC,OAAM,IAAA;IACJ,UAAO;IACR,CAAA;GAAA,IAAO;GAAoD,gBAAO,MAAA;IAClE,IAAK,OAAM;AACX,YAAU,CAAC,CAAC,QAAQ,YAAY;;IAE/B,IAAE,WAAa;AACb,YAAO,gBAAQ,MAAgB;MAChC,IAAA,OAAA;AACG,cAAA,iCAAA,QAAA,YAAA;;MAEL,IAAS,QAAA;AACF,cAAO,QAAK,YAAa;;MAE5B,CAAC;;IAEL,CAAA;GAAA,IAAA;GAAA,gBAAA,SAAA,EAAA,CAAA;GAAA,gBAAA,SAAA;IACC,OAAK,IAAA;IACL,UAAE;IACH,CAAC;GAAE,gBAAkB,SAAA,EAAA,CAAA;GAAA,IAAA;GAAA,gBAAA,SAAA,EAAA,CAAA;GAAA,gBAAA,eAAA,EACpB,IAAI,OAAO;AACT,WAAI,YAAU,eAAA,CAAA,QAAA,aAAA,SAAA,iBAAA,KAAA,0BAAA,CAAA,MAAA,GAAA,MAAA,EAAA,iBAAA,CAAA,cAAA,EAAA,iBAAA,CAAA,CAAA,CAAA,KAAA,uBAAA;AACZ,YAAI;MACJ,MAAA,mBAAA,iBAAA,CAAA,MAAA;MACC,cAAa,mBAAA,gBAAA,IAAA,IAAA,MAAA;MACZ,MAAE,cAAkB,mBAAgB,SAAA,CAAA,CAAA,MAAiB,CAAA,WAAA,OAAA,QAAA;MACvD,cAAA,mBAAA,YAAA,GAAA,OAAA,mBAAA,iBAAA,CAAA,EAAA,SAAA,KAAA,GAAA,mBAAA,iBAAA,GAAA,KAAA,mBAAA,iBAAA,CAAA,MAAA;MACC,UAAI,mBAAsB,iBAAA,GAAA,KAAA;MAC1B;MACD,IAAI,EAAA;MAET,CAAC;GAAC;IAEN,CAAC,CAAC"}
|