@powerlines/plugin-env 0.15.4 → 0.15.6
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/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/babel/index.cjs +1 -0
- package/dist/babel/index.d.cts +1 -0
- package/dist/babel/index.d.mts +1 -0
- package/dist/babel/index.mjs +3 -0
- package/dist/babel/plugin.cjs +200 -0
- package/dist/babel/plugin.d.cts +8 -0
- package/dist/babel/plugin.d.mts +9 -0
- package/dist/babel/plugin.mjs +198 -0
- package/dist/components/docs.cjs +70 -3
- package/dist/components/docs.d.cts +8 -1
- package/dist/components/docs.d.mts +8 -1
- package/dist/components/docs.mjs +68 -2
- package/dist/components/env.cjs +574 -4
- package/dist/components/env.d.cts +19 -2
- package/dist/components/env.d.mts +19 -3
- package/dist/components/env.mjs +570 -2
- package/dist/components/index.cjs +5 -7
- package/dist/components/index.d.cts +2 -4
- package/dist/components/index.d.mts +2 -5
- package/dist/components/index.mjs +2 -4
- package/dist/deepkit/schemas/reflection.cjs +5368 -0
- package/dist/{plugin-BwuEBScL.d.cts → deepkit/schemas/reflection.d.cts} +1 -268
- package/dist/{plugin-BaInAuAh.d.mts → deepkit/schemas/reflection.d.mts} +59 -326
- package/dist/deepkit/schemas/reflection.mjs +5365 -0
- package/dist/deepkit/schemas/reflection2.cjs +4112 -0
- package/dist/deepkit/schemas/reflection2.mjs +4110 -0
- package/dist/deepkit/src/capnp.cjs +1692 -0
- package/dist/deepkit/src/capnp.mjs +1690 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +99 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +98 -0
- package/dist/deepkit/src/reflect-type.cjs +40 -0
- package/dist/deepkit/src/reflect-type.mjs +38 -0
- package/dist/deepkit/src/resolve-reflections.cjs +23 -0
- package/dist/deepkit/src/resolve-reflections.mjs +22 -0
- package/dist/deepkit/src/transformer.cjs +92 -0
- package/dist/deepkit/src/transformer.mjs +89 -0
- package/dist/deepkit/src/transpile.cjs +39 -0
- package/dist/deepkit/src/transpile.mjs +37 -0
- package/dist/deepkit/src/types.cjs +22 -0
- package/dist/deepkit/src/types.d.cts +10 -0
- package/dist/deepkit/src/types.d.mts +10 -0
- package/dist/deepkit/src/types.mjs +21 -0
- package/dist/deepkit/src/utilities.cjs +182 -0
- package/dist/deepkit/src/utilities.mjs +181 -0
- package/dist/helpers/automd-generator.cjs +32 -0
- package/dist/helpers/automd-generator.mjs +31 -0
- package/dist/helpers/create-reflection-resource.cjs +98 -0
- package/dist/helpers/create-reflection-resource.d.cts +15 -0
- package/dist/helpers/create-reflection-resource.d.mts +15 -0
- package/dist/helpers/create-reflection-resource.mjs +97 -0
- package/dist/helpers/index.cjs +6 -0
- package/dist/helpers/index.d.cts +6 -0
- package/dist/helpers/index.d.mts +6 -0
- package/dist/helpers/index.mjs +8 -0
- package/dist/helpers/load.cjs +134 -0
- package/dist/helpers/load.d.cts +35 -0
- package/dist/helpers/load.d.mts +36 -0
- package/dist/helpers/load.mjs +131 -0
- package/dist/helpers/persistence.cjs +320 -0
- package/dist/helpers/persistence.d.cts +84 -0
- package/dist/helpers/persistence.d.mts +84 -0
- package/dist/helpers/persistence.mjs +308 -0
- package/dist/helpers/reflect.cjs +263 -0
- package/dist/helpers/reflect.d.cts +46 -0
- package/dist/helpers/reflect.d.mts +46 -0
- package/dist/helpers/reflect.mjs +254 -0
- package/dist/helpers/source-file-env.cjs +58 -0
- package/dist/helpers/source-file-env.d.cts +8 -0
- package/dist/helpers/source-file-env.d.mts +8 -0
- package/dist/helpers/source-file-env.mjs +56 -0
- package/dist/helpers/template-helpers.cjs +70 -0
- package/dist/helpers/template-helpers.d.cts +15 -0
- package/dist/helpers/template-helpers.d.mts +15 -0
- package/dist/helpers/template-helpers.mjs +69 -0
- package/dist/index.cjs +82 -696
- package/dist/index.d.cts +16 -185
- package/dist/index.d.mts +17 -190
- package/dist/index.mjs +31 -648
- package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
- package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +136 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +128 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +110 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +101 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +23 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +22 -0
- package/dist/plugin-alloy/src/index.cjs +93 -0
- package/dist/plugin-alloy/src/index.mjs +91 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +115 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +114 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +39 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +38 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +72 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +71 -0
- package/dist/plugin-alloy/src/types/components.cjs +22 -0
- package/dist/plugin-alloy/src/types/components.d.cts +22 -0
- package/dist/{components-8W0Zgj0y.d.mts → plugin-alloy/src/types/components.d.mts} +2 -1
- package/dist/plugin-alloy/src/types/components.mjs +21 -0
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/types/plugin.cjs +55 -0
- package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
- package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
- package/dist/plugin-alloy/src/types/plugin.mjs +52 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +11 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +12 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
- package/dist/plugin-automd/src/index.cjs +127 -0
- package/dist/plugin-automd/src/index.mjs +124 -0
- package/dist/plugin-automd/src/types/plugin.cjs +47 -0
- package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
- package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
- package/dist/plugin-automd/src/types/plugin.mjs +47 -0
- package/dist/plugin-automd/src/types/toc.cjs +26 -0
- package/dist/plugin-automd/src/types/toc.d.cts +33 -0
- package/dist/plugin-automd/src/types/toc.d.mts +33 -0
- package/dist/plugin-automd/src/types/toc.mjs +25 -0
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +74 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +70 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +71 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +69 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +158 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +154 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +200 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +192 -0
- package/dist/plugin-babel/src/helpers/options.cjs +74 -0
- package/dist/plugin-babel/src/helpers/options.mjs +71 -0
- package/dist/plugin-babel/src/index.cjs +134 -0
- package/dist/plugin-babel/src/index.mjs +132 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-babel/src/types/plugin.cjs +42 -0
- package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
- package/dist/plugin-babel/src/types/plugin.mjs +39 -0
- package/dist/powerlines/schemas/fs.d.mts +1 -0
- package/dist/powerlines/src/api.d.mts +7 -0
- package/dist/powerlines/src/index.d.mts +12 -0
- package/dist/powerlines/src/internal/helpers/hooks.cjs +119 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +5 -0
- package/dist/powerlines/src/internal/helpers/hooks.mjs +118 -0
- package/dist/powerlines/src/lib/build/esbuild.cjs +161 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +159 -0
- package/dist/powerlines/src/lib/entry.cjs +203 -0
- package/dist/powerlines/src/lib/entry.mjs +201 -0
- package/dist/powerlines/src/lib/logger.cjs +108 -0
- package/dist/powerlines/src/lib/logger.mjs +106 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +67 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +66 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +49 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +48 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +46 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +45 -0
- package/dist/powerlines/src/types/api.cjs +1 -0
- package/dist/powerlines/src/types/api.d.mts +5 -0
- package/dist/powerlines/src/types/api.mjs +3 -0
- package/dist/powerlines/src/types/babel.cjs +156 -0
- package/dist/powerlines/src/types/babel.d.cts +23 -0
- package/dist/powerlines/src/types/babel.d.mts +23 -0
- package/dist/powerlines/src/types/babel.mjs +147 -0
- package/dist/powerlines/src/types/build.cjs +105 -0
- package/dist/powerlines/src/types/build.d.cts +145 -0
- package/dist/powerlines/src/types/build.d.mts +147 -0
- package/dist/powerlines/src/types/build.mjs +101 -0
- package/dist/powerlines/src/types/commands.cjs +16 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/commands.mjs +15 -0
- package/dist/powerlines/src/types/config.cjs +306 -0
- package/dist/powerlines/src/types/config.d.cts +387 -0
- package/dist/powerlines/src/types/config.d.mts +388 -0
- package/dist/powerlines/src/types/config.mjs +293 -0
- package/dist/powerlines/src/types/context.cjs +324 -0
- package/dist/powerlines/src/types/context.d.cts +414 -0
- package/dist/powerlines/src/types/context.d.mts +416 -0
- package/dist/powerlines/src/types/context.mjs +311 -0
- package/dist/powerlines/src/types/fs.cjs +78 -0
- package/dist/powerlines/src/types/fs.d.cts +486 -0
- package/dist/powerlines/src/types/fs.d.mts +486 -0
- package/dist/powerlines/src/types/fs.mjs +75 -0
- package/dist/powerlines/src/types/hooks.cjs +52 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/hooks.mjs +48 -0
- package/dist/powerlines/src/types/index.cjs +11 -0
- package/dist/powerlines/src/types/index.d.mts +12 -0
- package/dist/powerlines/src/types/index.mjs +13 -0
- package/dist/powerlines/src/types/plugin.cjs +249 -0
- package/dist/powerlines/src/types/plugin.d.cts +231 -0
- package/dist/powerlines/src/types/plugin.d.mts +231 -0
- package/dist/powerlines/src/types/plugin.mjs +240 -0
- package/dist/powerlines/src/types/resolved.cjs +153 -0
- package/dist/powerlines/src/types/resolved.d.cts +82 -0
- package/dist/powerlines/src/types/resolved.d.mts +83 -0
- package/dist/powerlines/src/types/resolved.mjs +148 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/powerlines/src/types/unplugin.cjs +1 -0
- package/dist/powerlines/src/types/unplugin.d.mts +7 -0
- package/dist/powerlines/src/types/unplugin.mjs +3 -0
- package/dist/types/index.cjs +10 -3
- package/dist/types/index.d.cts +2 -4
- package/dist/types/index.d.mts +2 -5
- package/dist/types/index.mjs +3 -4
- package/dist/types/plugin.cjs +133 -1
- package/dist/types/plugin.d.cts +156 -3
- package/dist/types/plugin.d.mts +158 -4
- package/dist/types/plugin.mjs +128 -2
- package/dist/types/runtime.cjs +242 -1
- package/dist/types/runtime.d.cts +793 -2
- package/dist/types/runtime.d.mts +793 -2
- package/dist/types/runtime.mjs +240 -2
- package/package.json +13 -9
- package/dist/components-C9bYrQVK.cjs +0 -0
- package/dist/components-CNIQFfeK.mjs +0 -1
- package/dist/create-reflection-resource-BNYxBgW2.mjs +0 -9846
- package/dist/create-reflection-resource-BWYhmX7O.cjs +0 -10085
- package/dist/docs-5r844zC1.d.mts +0 -9
- package/dist/docs-B66b9li3.mjs +0 -219
- package/dist/docs-_MmTNBQX.d.cts +0 -9
- package/dist/docs-hBlKCRWK.cjs +0 -224
- package/dist/env-BPodCdD1.d.cts +0 -116
- package/dist/env-IQvgnabX.mjs +0 -1578
- package/dist/env-cO4BUDn1.cjs +0 -1596
- package/dist/env-zhzvpUI5.d.mts +0 -98
- package/dist/index-BXxhKmeA.d.mts +0 -1
- package/dist/index-Cc7fCJU9.d.mts +0 -1
- package/dist/index-CqdNToYT.d.cts +0 -1
- package/dist/index-DWPDThxu.d.cts +0 -1
- package/dist/plugin-D3B5E_Hg.mjs +0 -1
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/resolved-BZG2cwRG.d.cts +0 -1789
- package/dist/resolved-V5COsfDu.d.mts +0 -1791
- package/dist/runtime-Bisl_1Ja.cjs +0 -0
- package/dist/runtime-Q8Ni8SeN.d.cts +0 -794
- package/dist/runtime-azNoeKr-.mjs +0 -1
- package/dist/runtime-qZ0Z2kEd.d.mts +0 -794
- package/dist/types-DwElXV6q.mjs +0 -1
- package/dist/types-MYBaygjr.cjs +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
2
|
+
import { ENV_PREFIXES } from "@stryke/env/types";
|
|
3
|
+
import { camelCase } from "@stryke/string-format/camel-case";
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/source-file-env.ts
|
|
6
|
+
function __assignType(fn, args) {
|
|
7
|
+
fn.__type = args;
|
|
8
|
+
return fn;
|
|
9
|
+
}
|
|
10
|
+
const __ΩTReturned = [
|
|
11
|
+
"TEnv",
|
|
12
|
+
"TReturned",
|
|
13
|
+
"l2&R!RPe#!&qk#%QRb!Pde\"!p'w\"y"
|
|
14
|
+
];
|
|
15
|
+
function removeEnvPrefix(env) {
|
|
16
|
+
if (isString(env)) {
|
|
17
|
+
let name = ENV_PREFIXES.reduce(__assignType((ret, prefix) => {
|
|
18
|
+
if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
|
|
19
|
+
return ret;
|
|
20
|
+
}, [
|
|
21
|
+
"ret",
|
|
22
|
+
"prefix",
|
|
23
|
+
"",
|
|
24
|
+
"P\"2!\"2\"\"/#"
|
|
25
|
+
]), env.toUpperCase());
|
|
26
|
+
while (name.startsWith("_")) name = name.slice(1);
|
|
27
|
+
return name;
|
|
28
|
+
}
|
|
29
|
+
return Object.keys(env).reduce(__assignType((ret, key) => {
|
|
30
|
+
const name = removeEnvPrefix(key);
|
|
31
|
+
if (name) ret[name] = env[key];
|
|
32
|
+
return ret;
|
|
33
|
+
}, [
|
|
34
|
+
"ret",
|
|
35
|
+
"key",
|
|
36
|
+
"",
|
|
37
|
+
"P\"2!\"2\"\"/#"
|
|
38
|
+
]), {});
|
|
39
|
+
}
|
|
40
|
+
removeEnvPrefix.__type = [
|
|
41
|
+
"env",
|
|
42
|
+
() => __ΩTReturned,
|
|
43
|
+
"removeEnvPrefix",
|
|
44
|
+
"P\"2!\"o\"\"/#"
|
|
45
|
+
];
|
|
46
|
+
function formatEnvField(key) {
|
|
47
|
+
return camelCase(removeEnvPrefix(key));
|
|
48
|
+
}
|
|
49
|
+
formatEnvField.__type = [
|
|
50
|
+
"key",
|
|
51
|
+
"formatEnvField",
|
|
52
|
+
"P&2!&/\""
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { formatEnvField, removeEnvPrefix };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
|
+
const require_persistence = require('./persistence.cjs');
|
|
4
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
5
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
6
|
+
|
|
7
|
+
//#region src/helpers/template-helpers.ts
|
|
8
|
+
function __assignType(fn, args) {
|
|
9
|
+
fn.__type = args;
|
|
10
|
+
return fn;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates the reflection data used when generating runtime template files.
|
|
14
|
+
*
|
|
15
|
+
* @param context - The context for the configuration plugin.
|
|
16
|
+
* @param name - The name of the configuration template.
|
|
17
|
+
* @returns The reflection for the specified configuration template.
|
|
18
|
+
*/
|
|
19
|
+
async function createTemplateReflection(context, name) {
|
|
20
|
+
const reflection = await require_persistence.readEnvTypeReflection(context, name);
|
|
21
|
+
reflection.getProperties().forEach(__assignType((prop) => {
|
|
22
|
+
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
23
|
+
reflection.addProperty({
|
|
24
|
+
name: alias,
|
|
25
|
+
optional: prop.isOptional() ? true : void 0,
|
|
26
|
+
readonly: prop.isReadonly() ? true : void 0,
|
|
27
|
+
description: prop.getDescription(),
|
|
28
|
+
visibility: prop.getVisibility(),
|
|
29
|
+
type: prop.getType(),
|
|
30
|
+
default: prop.getDefaultValue(),
|
|
31
|
+
tags: {
|
|
32
|
+
hidden: prop.isHidden(),
|
|
33
|
+
ignore: prop.isIgnored(),
|
|
34
|
+
internal: prop.isInternal(),
|
|
35
|
+
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
36
|
+
"a",
|
|
37
|
+
"",
|
|
38
|
+
"P\"2!\"/\""
|
|
39
|
+
])).concat(prop.name),
|
|
40
|
+
title: prop.getTitle() || (0, __stryke_string_format_title_case.titleCase)(prop.name),
|
|
41
|
+
readonly: prop.isReadonly(),
|
|
42
|
+
permission: prop.getPermission(),
|
|
43
|
+
domain: prop.getDomain()
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}, [
|
|
47
|
+
"alias",
|
|
48
|
+
"",
|
|
49
|
+
"P\"2!\"/\""
|
|
50
|
+
]));
|
|
51
|
+
}, [
|
|
52
|
+
"prop",
|
|
53
|
+
"",
|
|
54
|
+
"P\"2!\"/\""
|
|
55
|
+
]));
|
|
56
|
+
return reflection;
|
|
57
|
+
}
|
|
58
|
+
createTemplateReflection.__type = [
|
|
59
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
60
|
+
"context",
|
|
61
|
+
() => require_types_plugin.__ΩEnvType,
|
|
62
|
+
"name",
|
|
63
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
64
|
+
"createTemplateReflection",
|
|
65
|
+
"Creates the reflection data used when generating runtime template files.",
|
|
66
|
+
"Pn!2\"n#2$8P\"7%`/&?'"
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.createTemplateReflection = createTemplateReflection;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EnvPluginContext, EnvType } from "../types/plugin.cjs";
|
|
2
|
+
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/template-helpers.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates the reflection data used when generating runtime template files.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The context for the configuration plugin.
|
|
10
|
+
* @param name - The name of the configuration template.
|
|
11
|
+
* @returns The reflection for the specified configuration template.
|
|
12
|
+
*/
|
|
13
|
+
declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { createTemplateReflection };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EnvPluginContext, EnvType } from "../types/plugin.mjs";
|
|
2
|
+
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/template-helpers.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates the reflection data used when generating runtime template files.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The context for the configuration plugin.
|
|
10
|
+
* @param name - The name of the configuration template.
|
|
11
|
+
* @returns The reflection for the specified configuration template.
|
|
12
|
+
*/
|
|
13
|
+
declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { createTemplateReflection };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __ΩEnvPluginContext, __ΩEnvType } from "../types/plugin.mjs";
|
|
2
|
+
import { readEnvTypeReflection } from "./persistence.mjs";
|
|
3
|
+
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
5
|
+
|
|
6
|
+
//#region src/helpers/template-helpers.ts
|
|
7
|
+
function __assignType(fn, args) {
|
|
8
|
+
fn.__type = args;
|
|
9
|
+
return fn;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates the reflection data used when generating runtime template files.
|
|
13
|
+
*
|
|
14
|
+
* @param context - The context for the configuration plugin.
|
|
15
|
+
* @param name - The name of the configuration template.
|
|
16
|
+
* @returns The reflection for the specified configuration template.
|
|
17
|
+
*/
|
|
18
|
+
async function createTemplateReflection(context, name) {
|
|
19
|
+
const reflection = await readEnvTypeReflection(context, name);
|
|
20
|
+
reflection.getProperties().forEach(__assignType((prop) => {
|
|
21
|
+
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
22
|
+
reflection.addProperty({
|
|
23
|
+
name: alias,
|
|
24
|
+
optional: prop.isOptional() ? true : void 0,
|
|
25
|
+
readonly: prop.isReadonly() ? true : void 0,
|
|
26
|
+
description: prop.getDescription(),
|
|
27
|
+
visibility: prop.getVisibility(),
|
|
28
|
+
type: prop.getType(),
|
|
29
|
+
default: prop.getDefaultValue(),
|
|
30
|
+
tags: {
|
|
31
|
+
hidden: prop.isHidden(),
|
|
32
|
+
ignore: prop.isIgnored(),
|
|
33
|
+
internal: prop.isInternal(),
|
|
34
|
+
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
35
|
+
"a",
|
|
36
|
+
"",
|
|
37
|
+
"P\"2!\"/\""
|
|
38
|
+
])).concat(prop.name),
|
|
39
|
+
title: prop.getTitle() || titleCase(prop.name),
|
|
40
|
+
readonly: prop.isReadonly(),
|
|
41
|
+
permission: prop.getPermission(),
|
|
42
|
+
domain: prop.getDomain()
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}, [
|
|
46
|
+
"alias",
|
|
47
|
+
"",
|
|
48
|
+
"P\"2!\"/\""
|
|
49
|
+
]));
|
|
50
|
+
}, [
|
|
51
|
+
"prop",
|
|
52
|
+
"",
|
|
53
|
+
"P\"2!\"/\""
|
|
54
|
+
]));
|
|
55
|
+
return reflection;
|
|
56
|
+
}
|
|
57
|
+
createTemplateReflection.__type = [
|
|
58
|
+
() => __ΩEnvPluginContext,
|
|
59
|
+
"context",
|
|
60
|
+
() => __ΩEnvType,
|
|
61
|
+
"name",
|
|
62
|
+
() => ReflectionClass,
|
|
63
|
+
"createTemplateReflection",
|
|
64
|
+
"Creates the reflection data used when generating runtime template files.",
|
|
65
|
+
"Pn!2\"n#2$8P\"7%`/&?'"
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { createTemplateReflection };
|