@powerlines/plugin-react 0.1.122 → 0.1.123

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.
Files changed (100) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +37 -1
  2. package/dist/_virtual/rolldown_runtime.mjs +29 -1
  3. package/dist/components/index.cjs +3 -1
  4. package/dist/components/index.mjs +3 -1
  5. package/dist/components/react-optimized.cjs +45 -1
  6. package/dist/components/react-optimized.mjs +43 -1
  7. package/dist/deepkit/schemas/reflection.cjs +3940 -1
  8. package/dist/deepkit/schemas/reflection.mjs +3938 -1
  9. package/dist/deepkit/schemas/reflection2.cjs +4112 -1
  10. package/dist/deepkit/schemas/reflection2.mjs +4110 -1
  11. package/dist/deepkit/src/capnp.cjs +913 -1
  12. package/dist/deepkit/src/capnp.mjs +911 -1
  13. package/dist/deepkit/src/esbuild-plugin.cjs +47 -4
  14. package/dist/deepkit/src/esbuild-plugin.mjs +46 -4
  15. package/dist/deepkit/src/reflect-type.cjs +22 -1
  16. package/dist/deepkit/src/reflect-type.mjs +20 -1
  17. package/dist/deepkit/src/resolve-reflections.cjs +16 -1
  18. package/dist/deepkit/src/resolve-reflections.mjs +15 -1
  19. package/dist/deepkit/src/transformer.cjs +52 -1
  20. package/dist/deepkit/src/transformer.mjs +49 -1
  21. package/dist/deepkit/src/transpile.cjs +29 -1
  22. package/dist/deepkit/src/transpile.mjs +27 -1
  23. package/dist/deepkit/src/utilities.cjs +66 -1
  24. package/dist/deepkit/src/utilities.mjs +65 -1
  25. package/dist/deepkit/src/vendor/type-compiler/index.cjs +38 -1
  26. package/dist/deepkit/src/vendor/type-compiler/index.mjs +19 -1
  27. package/dist/deepkit/src/vendor/type.cjs +20 -1
  28. package/dist/deepkit/src/vendor/type.mjs +11 -1
  29. package/dist/index.cjs +104 -1
  30. package/dist/index.mjs +98 -1
  31. package/dist/plugin-alloy/src/core/components/output.cjs +45 -1
  32. package/dist/plugin-alloy/src/core/components/output.mjs +44 -1
  33. package/dist/plugin-alloy/src/core/contexts/context.cjs +11 -1
  34. package/dist/plugin-alloy/src/core/contexts/context.mjs +10 -1
  35. package/dist/plugin-alloy/src/index.cjs +93 -1
  36. package/dist/plugin-alloy/src/index.mjs +91 -1
  37. package/dist/plugin-automd/src/index.cjs +101 -1
  38. package/dist/plugin-automd/src/index.mjs +98 -1
  39. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -1
  40. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -1
  41. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -1
  42. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -1
  43. package/dist/plugin-babel/src/helpers/filters.cjs +23 -1
  44. package/dist/plugin-babel/src/helpers/filters.mjs +21 -1
  45. package/dist/plugin-babel/src/helpers/index.cjs +5 -1
  46. package/dist/plugin-babel/src/helpers/index.mjs +7 -1
  47. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -1
  48. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -1
  49. package/dist/plugin-babel/src/helpers/options.cjs +50 -1
  50. package/dist/plugin-babel/src/helpers/options.mjs +47 -1
  51. package/dist/plugin-babel/src/index.cjs +91 -1
  52. package/dist/plugin-babel/src/index.mjs +89 -1
  53. package/dist/plugin-env/src/babel/index.cjs +1 -1
  54. package/dist/plugin-env/src/babel/index.mjs +3 -1
  55. package/dist/plugin-env/src/babel/plugin.cjs +120 -4
  56. package/dist/plugin-env/src/babel/plugin.mjs +118 -4
  57. package/dist/plugin-env/src/components/docs.cjs +9 -1
  58. package/dist/plugin-env/src/components/docs.mjs +11 -1
  59. package/dist/plugin-env/src/components/env.cjs +432 -11
  60. package/dist/plugin-env/src/components/env.mjs +430 -9
  61. package/dist/plugin-env/src/components/index.cjs +2 -1
  62. package/dist/plugin-env/src/components/index.mjs +4 -1
  63. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -1
  64. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -1
  65. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -1
  66. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -1
  67. package/dist/plugin-env/src/helpers/index.cjs +6 -1
  68. package/dist/plugin-env/src/helpers/index.mjs +8 -1
  69. package/dist/plugin-env/src/helpers/load.cjs +83 -1
  70. package/dist/plugin-env/src/helpers/load.mjs +80 -1
  71. package/dist/plugin-env/src/helpers/persistence.cjs +200 -1
  72. package/dist/plugin-env/src/helpers/persistence.mjs +189 -1
  73. package/dist/plugin-env/src/helpers/reflect.cjs +111 -1
  74. package/dist/plugin-env/src/helpers/reflect.mjs +103 -1
  75. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -1
  76. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -1
  77. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -1
  78. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -1
  79. package/dist/plugin-env/src/index.cjs +170 -5
  80. package/dist/plugin-env/src/index.mjs +168 -5
  81. package/dist/powerlines/src/lib/build/esbuild.cjs +102 -14
  82. package/dist/powerlines/src/lib/build/esbuild.mjs +100 -14
  83. package/dist/powerlines/src/lib/entry.cjs +12 -1
  84. package/dist/powerlines/src/lib/entry.mjs +14 -1
  85. package/dist/powerlines/src/lib/logger.cjs +41 -1
  86. package/dist/powerlines/src/lib/logger.mjs +39 -1
  87. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +38 -1
  88. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +35 -1
  89. package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -1
  90. package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -1
  91. package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -1
  92. package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -1
  93. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -1
  94. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -1
  95. package/dist/powerlines/src/types/context.d.cts +27 -3
  96. package/dist/powerlines/src/types/context.d.mts +27 -3
  97. package/dist/types/index.mjs +1 -1
  98. package/dist/types/plugin.mjs +1 -1
  99. package/dist/types/runtime.mjs +1 -1
  100. package/package.json +10 -10
@@ -1 +1,111 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../deepkit/src/reflect-type.cjs`),r=require(`./persistence.cjs`);let i=require(`@stryke/path/is-parent-path`),a=require(`@stryke/string-format/title-case`),o=require(`@stryke/path/join-paths`);function s(e,n){return d(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}function c(e,n){return f(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}var l=class{PLATFORM=`neutral`;MODE=`production`;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;CI=!1},u=class{};function d(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base environment configuration definition for the ${(0,a.titleCase)(e.config.name)} project.`,classType:l,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${(0,a.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${(0,a.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function f(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base secrets configuration definition for the ${(0,a.titleCase)(e.config.name)} project.`,classType:u,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${(0,a.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${(0,a.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function p(e,a,c){let l;a&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,i.isParentPath)(a,e.workspaceConfig.workspaceRoot)?a:(0,o.joinPaths)(e.workspaceConfig.workspaceRoot,a),name:c},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getEnvDefaultTypeDefinition(e));return s(e,[await r.readEnvTypeReflection(e,`env`),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}async function m(e,a,s){let l;a&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,i.isParentPath)(a,e.workspaceConfig.workspaceRoot)?a:(0,o.joinPaths)(e.workspaceConfig.workspaceRoot,a),name:s},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getSecretsDefaultTypeDefinition(e));return c(e,[await r.readSecretsReflection(e),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}exports.BaseEnv=l,exports.BaseSecrets=u,exports.createEnvReflection=d,exports.createSecretsReflection=f,exports.mergeEnvReflections=s,exports.mergeSecretsReflections=c,exports.reflectEnv=p,exports.reflectSecrets=m;
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
+ const require_type = require('../../../deepkit/src/vendor/type.cjs');
3
+ const require_reflect_type = require('../../../deepkit/src/reflect-type.cjs');
4
+ const require_persistence = require('./persistence.cjs');
5
+ let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
6
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
7
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
8
+
9
+ //#region ../plugin-env/src/helpers/reflect.ts
10
+ function mergeEnvReflections(context, reflections) {
11
+ return createEnvReflection(context, { type: (0, require_type.type_exports.merge)(reflections.map((reflection) => reflection.type)) });
12
+ }
13
+ function mergeSecretsReflections(context, reflections) {
14
+ return createSecretsReflection(context, { type: (0, require_type.type_exports.merge)(reflections.map((reflection) => reflection.type)) });
15
+ }
16
+ var BaseEnv = class {
17
+ PLATFORM = "neutral";
18
+ MODE = "production";
19
+ DEBUG = false;
20
+ TEST = false;
21
+ MINIMAL = false;
22
+ NO_COLOR = false;
23
+ FORCE_COLOR = false;
24
+ FORCE_HYPERLINK = false;
25
+ STACKTRACE = false;
26
+ INCLUDE_ERROR_DATA = false;
27
+ CI = false;
28
+ };
29
+ var BaseSecrets = class {};
30
+ function createEnvReflection(context, options = {}) {
31
+ const parent = options.superReflection ?? new require_type.type_exports.ReflectionClass({
32
+ kind: require_type.type_exports.ReflectionKind.class,
33
+ description: `The base environment configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
34
+ classType: BaseEnv,
35
+ types: [],
36
+ implements: [{
37
+ kind: require_type.type_exports.ReflectionKind.objectLiteral,
38
+ typeName: "EnvInterface",
39
+ description: `The environment configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
40
+ types: []
41
+ }]
42
+ });
43
+ parent.name = "Env";
44
+ const result = new require_type.type_exports.ReflectionClass(options.type ?? {
45
+ kind: require_type.type_exports.ReflectionKind.objectLiteral,
46
+ typeName: "Env",
47
+ description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
48
+ types: []
49
+ }, parent);
50
+ result.name = "Env";
51
+ return result;
52
+ }
53
+ function createSecretsReflection(context, options = {}) {
54
+ const parent = options.superReflection ?? new require_type.type_exports.ReflectionClass({
55
+ kind: require_type.type_exports.ReflectionKind.class,
56
+ description: `The base secrets configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
57
+ classType: BaseSecrets,
58
+ types: [],
59
+ implements: [{
60
+ kind: require_type.type_exports.ReflectionKind.objectLiteral,
61
+ typeName: "SecretsInterface",
62
+ description: `The secrets configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
63
+ types: []
64
+ }]
65
+ });
66
+ parent.name = "Secrets";
67
+ const result = new require_type.type_exports.ReflectionClass(options.type ?? {
68
+ kind: require_type.type_exports.ReflectionKind.objectLiteral,
69
+ typeName: "Secrets",
70
+ description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
71
+ types: []
72
+ }, parent);
73
+ result.name = "Secrets";
74
+ return result;
75
+ }
76
+ async function reflectEnv(context, file, name) {
77
+ let config;
78
+ if (file) config = (0, require_type.type_exports.resolveClassType)(await require_reflect_type.reflectType(context, {
79
+ file: !(0, __stryke_path_is_parent_path.isParentPath)(file, context.workspaceConfig.workspaceRoot) ? (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, file) : file,
80
+ name
81
+ }, { skipNodeModulesBundle: true }));
82
+ const defaultConfigType = await require_reflect_type.reflectType(context, await require_persistence.getEnvDefaultTypeDefinition(context));
83
+ return mergeEnvReflections(context, [
84
+ await require_persistence.readEnvTypeReflection(context, "env"),
85
+ config,
86
+ (0, require_type.type_exports.resolveClassType)(defaultConfigType)
87
+ ].filter(Boolean));
88
+ }
89
+ async function reflectSecrets(context, file, name) {
90
+ let config;
91
+ if (file) config = (0, require_type.type_exports.resolveClassType)(await require_reflect_type.reflectType(context, {
92
+ file: !(0, __stryke_path_is_parent_path.isParentPath)(file, context.workspaceConfig.workspaceRoot) ? (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, file) : file,
93
+ name
94
+ }, { skipNodeModulesBundle: true }));
95
+ const defaultSecretsType = await require_reflect_type.reflectType(context, await require_persistence.getSecretsDefaultTypeDefinition(context));
96
+ return mergeSecretsReflections(context, [
97
+ await require_persistence.readSecretsReflection(context),
98
+ config,
99
+ (0, require_type.type_exports.resolveClassType)(defaultSecretsType)
100
+ ].filter(Boolean));
101
+ }
102
+
103
+ //#endregion
104
+ exports.BaseEnv = BaseEnv;
105
+ exports.BaseSecrets = BaseSecrets;
106
+ exports.createEnvReflection = createEnvReflection;
107
+ exports.createSecretsReflection = createSecretsReflection;
108
+ exports.mergeEnvReflections = mergeEnvReflections;
109
+ exports.mergeSecretsReflections = mergeSecretsReflections;
110
+ exports.reflectEnv = reflectEnv;
111
+ exports.reflectSecrets = reflectSecrets;
@@ -1 +1,103 @@
1
- import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{reflectType as t}from"../../../deepkit/src/reflect-type.mjs";import{getEnvDefaultTypeDefinition as n,getSecretsDefaultTypeDefinition as r,readEnvTypeReflection as i,readSecretsReflection as a}from"./persistence.mjs";import{isParentPath as o}from"@stryke/path/is-parent-path";import{titleCase as s}from"@stryke/string-format/title-case";import{joinPaths as c}from"@stryke/path/join-paths";function l(t,n){return p(t,{type:(0,e.merge)(n.map(e=>e.type))})}function u(t,n){return m(t,{type:(0,e.merge)(n.map(e=>e.type))})}var d=class{PLATFORM=`neutral`;MODE=`production`;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;CI=!1},f=class{};function p(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base environment configuration definition for the ${s(t.config.name)} project.`,classType:d,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${s(t.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${t.config.name?`${s(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function m(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base secrets configuration definition for the ${s(t.config.name)} project.`,classType:f,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${s(t.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${t.config.name?`${s(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function h(r,a,s){let u;a&&(u=(0,e.resolveClassType)(await t(r,{file:o(a,r.workspaceConfig.workspaceRoot)?a:c(r.workspaceConfig.workspaceRoot,a),name:s},{skipNodeModulesBundle:!0})));let d=await t(r,await n(r));return l(r,[await i(r,`env`),u,(0,e.resolveClassType)(d)].filter(Boolean))}async function g(n,i,s){let l;i&&(l=(0,e.resolveClassType)(await t(n,{file:o(i,n.workspaceConfig.workspaceRoot)?i:c(n.workspaceConfig.workspaceRoot,i),name:s},{skipNodeModulesBundle:!0})));let d=await t(n,await r(n));return u(n,[await a(n),l,(0,e.resolveClassType)(d)].filter(Boolean))}export{d as BaseEnv,f as BaseSecrets,p as createEnvReflection,m as createSecretsReflection,l as mergeEnvReflections,u as mergeSecretsReflections,h as reflectEnv,g as reflectSecrets};
1
+ import { type_exports } from "../../../deepkit/src/vendor/type.mjs";
2
+ import { reflectType } from "../../../deepkit/src/reflect-type.mjs";
3
+ import { getEnvDefaultTypeDefinition, getSecretsDefaultTypeDefinition, readEnvTypeReflection, readSecretsReflection } from "./persistence.mjs";
4
+ import { isParentPath } from "@stryke/path/is-parent-path";
5
+ import { titleCase } from "@stryke/string-format/title-case";
6
+ import { joinPaths } from "@stryke/path/join-paths";
7
+
8
+ //#region ../plugin-env/src/helpers/reflect.ts
9
+ function mergeEnvReflections(context, reflections) {
10
+ return createEnvReflection(context, { type: (0, type_exports.merge)(reflections.map((reflection) => reflection.type)) });
11
+ }
12
+ function mergeSecretsReflections(context, reflections) {
13
+ return createSecretsReflection(context, { type: (0, type_exports.merge)(reflections.map((reflection) => reflection.type)) });
14
+ }
15
+ var BaseEnv = class {
16
+ PLATFORM = "neutral";
17
+ MODE = "production";
18
+ DEBUG = false;
19
+ TEST = false;
20
+ MINIMAL = false;
21
+ NO_COLOR = false;
22
+ FORCE_COLOR = false;
23
+ FORCE_HYPERLINK = false;
24
+ STACKTRACE = false;
25
+ INCLUDE_ERROR_DATA = false;
26
+ CI = false;
27
+ };
28
+ var BaseSecrets = class {};
29
+ function createEnvReflection(context, options = {}) {
30
+ const parent = options.superReflection ?? new type_exports.ReflectionClass({
31
+ kind: type_exports.ReflectionKind.class,
32
+ description: `The base environment configuration definition for the ${titleCase(context.config.name)} project.`,
33
+ classType: BaseEnv,
34
+ types: [],
35
+ implements: [{
36
+ kind: type_exports.ReflectionKind.objectLiteral,
37
+ typeName: "EnvInterface",
38
+ description: `The environment configuration interface definition for the ${titleCase(context.config.name)} project.`,
39
+ types: []
40
+ }]
41
+ });
42
+ parent.name = "Env";
43
+ const result = new type_exports.ReflectionClass(options.type ?? {
44
+ kind: type_exports.ReflectionKind.objectLiteral,
45
+ typeName: "Env",
46
+ description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${titleCase(context.config.name)} application` : "application"}.`,
47
+ types: []
48
+ }, parent);
49
+ result.name = "Env";
50
+ return result;
51
+ }
52
+ function createSecretsReflection(context, options = {}) {
53
+ const parent = options.superReflection ?? new type_exports.ReflectionClass({
54
+ kind: type_exports.ReflectionKind.class,
55
+ description: `The base secrets configuration definition for the ${titleCase(context.config.name)} project.`,
56
+ classType: BaseSecrets,
57
+ types: [],
58
+ implements: [{
59
+ kind: type_exports.ReflectionKind.objectLiteral,
60
+ typeName: "SecretsInterface",
61
+ description: `The secrets configuration interface definition for the ${titleCase(context.config.name)} project.`,
62
+ types: []
63
+ }]
64
+ });
65
+ parent.name = "Secrets";
66
+ const result = new type_exports.ReflectionClass(options.type ?? {
67
+ kind: type_exports.ReflectionKind.objectLiteral,
68
+ typeName: "Secrets",
69
+ description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${titleCase(context.config.name)} application` : "application"}.`,
70
+ types: []
71
+ }, parent);
72
+ result.name = "Secrets";
73
+ return result;
74
+ }
75
+ async function reflectEnv(context, file, name) {
76
+ let config;
77
+ if (file) config = (0, type_exports.resolveClassType)(await reflectType(context, {
78
+ file: !isParentPath(file, context.workspaceConfig.workspaceRoot) ? joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
79
+ name
80
+ }, { skipNodeModulesBundle: true }));
81
+ const defaultConfigType = await reflectType(context, await getEnvDefaultTypeDefinition(context));
82
+ return mergeEnvReflections(context, [
83
+ await readEnvTypeReflection(context, "env"),
84
+ config,
85
+ (0, type_exports.resolveClassType)(defaultConfigType)
86
+ ].filter(Boolean));
87
+ }
88
+ async function reflectSecrets(context, file, name) {
89
+ let config;
90
+ if (file) config = (0, type_exports.resolveClassType)(await reflectType(context, {
91
+ file: !isParentPath(file, context.workspaceConfig.workspaceRoot) ? joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
92
+ name
93
+ }, { skipNodeModulesBundle: true }));
94
+ const defaultSecretsType = await reflectType(context, await getSecretsDefaultTypeDefinition(context));
95
+ return mergeSecretsReflections(context, [
96
+ await readSecretsReflection(context),
97
+ config,
98
+ (0, type_exports.resolveClassType)(defaultSecretsType)
99
+ ].filter(Boolean));
100
+ }
101
+
102
+ //#endregion
103
+ export { BaseEnv, BaseSecrets, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
@@ -1 +1,24 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/env/types`),r=require(`@stryke/string-format/camel-case`);function i(e){if((0,t.isString)(e)){let t=n.ENV_PREFIXES.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let r=i(n);return r&&(t[r]=e[n]),t},{})}exports.removeEnvPrefix=i;
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
3
+ let __stryke_env_types = require("@stryke/env/types");
4
+ let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
5
+
6
+ //#region ../plugin-env/src/helpers/source-file-env.ts
7
+ function removeEnvPrefix(env) {
8
+ if ((0, __stryke_type_checks_is_string.isString)(env)) {
9
+ let name = __stryke_env_types.ENV_PREFIXES.reduce((ret, prefix) => {
10
+ if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
11
+ return ret;
12
+ }, env.toUpperCase());
13
+ while (name.startsWith("_")) name = name.slice(1);
14
+ return name;
15
+ }
16
+ return Object.keys(env).reduce((ret, key) => {
17
+ const name = removeEnvPrefix(key);
18
+ if (name) ret[name] = env[key];
19
+ return ret;
20
+ }, {});
21
+ }
22
+
23
+ //#endregion
24
+ exports.removeEnvPrefix = removeEnvPrefix;
@@ -1 +1,23 @@
1
- import{isString as e}from"@stryke/type-checks/is-string";import{ENV_PREFIXES as t}from"@stryke/env/types";import{camelCase as n}from"@stryke/string-format/camel-case";function r(n){if(e(n)){let e=t.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),n.toUpperCase());for(;e.startsWith(`_`);)e=e.slice(1);return e}return Object.keys(n).reduce((e,t)=>{let i=r(t);return i&&(e[i]=n[t]),e},{})}export{r as removeEnvPrefix};
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 ../plugin-env/src/helpers/source-file-env.ts
6
+ function removeEnvPrefix(env) {
7
+ if (isString(env)) {
8
+ let name = ENV_PREFIXES.reduce((ret, prefix) => {
9
+ if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
10
+ return ret;
11
+ }, env.toUpperCase());
12
+ while (name.startsWith("_")) name = name.slice(1);
13
+ return name;
14
+ }
15
+ return Object.keys(env).reduce((ret, key) => {
16
+ const name = removeEnvPrefix(key);
17
+ if (name) ret[name] = env[key];
18
+ return ret;
19
+ }, {});
20
+ }
21
+
22
+ //#endregion
23
+ export { removeEnvPrefix };
@@ -1 +1,2 @@
1
- require(`./persistence.cjs`);let e=require(`@stryke/string-format/title-case`);
1
+ require('./persistence.cjs');
2
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
@@ -1 +1,4 @@
1
- import"./persistence.mjs";import{titleCase as e}from"@stryke/string-format/title-case";export{};
1
+ import "./persistence.mjs";
2
+ import { titleCase } from "@stryke/string-format/title-case";
3
+
4
+ export { };
@@ -1,10 +1,175 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-babel/src/index.cjs`),r=require(`../../plugin-alloy/src/index.cjs`),i=require(`../../plugin-automd/src/index.cjs`),a=require(`./helpers/reflect.cjs`),o=require(`./helpers/persistence.cjs`),s=require(`./babel/plugin.cjs`),c=require(`./helpers/source-file-env.cjs`),l=require(`./helpers/load.cjs`),u=require(`./helpers/create-reflection-resource.cjs`),d=require(`./components/env.cjs`),f=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let p=require(`@alloy-js/core/jsx-runtime`),m=require(`@storm-software/config-tools/types`),h=require(`@stryke/path/is-parent-path`),g=require(`defu`);g=e.__toESM(g);let _=require(`@stryke/string-format/title-case`),v=require(`@stryke/convert/to-array`),y=require(`@stryke/convert/parse-type-definition`),b=require(`@stryke/env/types`),x=require(`@stryke/fs/exists`),S=require(`@stryke/fs/helpers`),C=require(`@stryke/path/join`),w=require(`@stryke/string-format/constant-case`);const T=(e={})=>[r.default(e.alloy),n.default(e.babel),{name:`env`,async config(){this.log(m.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,g.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[s.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,y.parseTypeDefinition)(t.env.types);else{this.log(m.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await o.getEnvDefaultTypeDefinition(this);t.env.types=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,y.parseTypeDefinition)(t.env.secrets);else{let e=await o.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,v.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,w.constantCase)(t);return e.includes(n)||e.push(n),e},[...b.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(m.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,g.default)({parsed:await l.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,x.existsSync)(o.getEnvTypeReflectionsPath(this,`env`)))this.log(m.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await o.readEnvTypeReflection(this,`env`),(0,x.existsSync)(o.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await o.readEnvReflection(this)),(0,x.existsSync)(o.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await o.readEnvTypeReflection(this,`secrets`)),(0,x.existsSync)(o.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await o.readSecretsReflection(this));else{if(this.env.types.env=await a.reflectEnv(this,this.config.env.types?.file?(0,h.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await o.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await a.reflectSecrets(this,this.config.env.secrets?.file?(0,h.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(m.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await l.loadEnv(this,this.config.env)).forEach(([t,n])=>{let r=this.config.env.prefix.reduce((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,t),i=e.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await o.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await o.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){let e=this;return this.log(m.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,p.createComponent)(d.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}}))},async docs(){this.log(m.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,C.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,x.existsSync)(e)||await(0,S.createDirectory)(e);let n=await o.readEnvTypeReflection(this,`env`),r=(0,C.joinPaths)(e,`env.md`);this.log(m.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,_.titleCase)(this.config.framework)||`Powerlines`} -->
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_type = require('../../deepkit/src/vendor/type.cjs');
3
+ const require_index = require('../../plugin-babel/src/index.cjs');
4
+ const require_index$1 = require('../../plugin-alloy/src/index.cjs');
5
+ const require_index$2 = require('../../plugin-automd/src/index.cjs');
6
+ const require_reflect = require('./helpers/reflect.cjs');
7
+ const require_persistence = require('./helpers/persistence.cjs');
8
+ const require_plugin = require('./babel/plugin.cjs');
9
+ const require_source_file_env = require('./helpers/source-file-env.cjs');
10
+ const require_load = require('./helpers/load.cjs');
11
+ const require_create_reflection_resource = require('./helpers/create-reflection-resource.cjs');
12
+ const require_env = require('./components/env.cjs');
13
+ const require_automd_generator = require('./helpers/automd-generator.cjs');
14
+ require('./babel/index.cjs');
15
+ require('./components/index.cjs');
16
+ require('./helpers/index.cjs');
17
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
18
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
19
+ let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
20
+ let defu = require("defu");
21
+ defu = require_rolldown_runtime.__toESM(defu);
22
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
23
+ let __stryke_convert_to_array = require("@stryke/convert/to-array");
24
+ let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
25
+ let __stryke_env_types = require("@stryke/env/types");
26
+ let __stryke_fs_exists = require("@stryke/fs/exists");
27
+ let __stryke_fs_helpers = require("@stryke/fs/helpers");
28
+ let __stryke_path_join = require("@stryke/path/join");
29
+ let __stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
30
+
31
+ //#region ../plugin-env/src/index.tsx
32
+ /**
33
+ * A Powerlines plugin to inject environment variables into the source code.
34
+ */
35
+ const plugin = (options = {}) => {
36
+ return [
37
+ require_index$1.default(options.alloy),
38
+ require_index.default(options.babel),
39
+ {
40
+ name: "env",
41
+ async config() {
42
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `env` build plugin.");
43
+ const config = {
44
+ env: (0, defu.default)(options, {
45
+ types: {},
46
+ prefix: []
47
+ }),
48
+ transform: { babel: { plugins: [require_plugin.envBabelPlugin] } }
49
+ };
50
+ if (config.env.types) config.env.types = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(config.env.types);
51
+ else {
52
+ this.log(__storm_software_config_tools_types.LogLevelLabel.WARN, "The `env.types` configuration parameter was not provided. Please ensure this is expected.");
53
+ const envDefaultTypeDefinition = await require_persistence.getEnvDefaultTypeDefinition(this);
54
+ config.env.types = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(`${envDefaultTypeDefinition.file}#${envDefaultTypeDefinition.name}`);
55
+ }
56
+ if (config.env.secrets) config.env.secrets = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(config.env.secrets);
57
+ else {
58
+ const secretsDefaultTypeDefinition = await require_persistence.getSecretsDefaultTypeDefinition(this);
59
+ config.env.secrets = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(`${secretsDefaultTypeDefinition.file}#${secretsDefaultTypeDefinition.name}`);
60
+ }
61
+ config.env.prefix = (0, __stryke_convert_to_array.toArray)(config.env.prefix ?? []).reduce((ret, prefix) => {
62
+ const formattedPrefix = (0, __stryke_string_format_constant_case.constantCase)(prefix);
63
+ if (!ret.includes(formattedPrefix)) ret.push(formattedPrefix);
64
+ return ret;
65
+ }, [...__stryke_env_types.ENV_PREFIXES, "POWERLINES_"]);
66
+ config.env.prefix = config.env.prefix.reduce((ret, prefix) => {
67
+ if (!ret.includes(prefix.replace(/_$/g, ""))) ret.push(prefix.replace(/_$/g, ""));
68
+ return ret;
69
+ }, []);
70
+ return config;
71
+ },
72
+ async configResolved() {
73
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Environment plugin configuration has been resolved for the Powerlines project.`);
74
+ this.config.env.inject ??= this.config.projectType === "application";
75
+ this.env = (0, defu.default)({ parsed: await require_load.loadEnv(this, this.config.env) }, this.env ?? {}, {
76
+ types: { env: {} },
77
+ used: {
78
+ env: {},
79
+ secrets: {}
80
+ },
81
+ parsed: {},
82
+ injected: {}
83
+ });
84
+ if (this.config.command !== "prepare" && this.persistedMeta?.checksum === this.meta.checksum && (0, __stryke_fs_exists.existsSync)(require_persistence.getEnvTypeReflectionsPath(this, "env"))) {
85
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Skipping reflection initialization as the meta checksum has not changed.`);
86
+ this.env.types.env = await require_persistence.readEnvTypeReflection(this, "env");
87
+ if ((0, __stryke_fs_exists.existsSync)(require_persistence.getEnvReflectionsPath(this, "env"))) this.env.used.env = await require_persistence.readEnvReflection(this);
88
+ if ((0, __stryke_fs_exists.existsSync)(require_persistence.getEnvTypeReflectionsPath(this, "secrets"))) this.env.types.secrets = await require_persistence.readEnvTypeReflection(this, "secrets");
89
+ if ((0, __stryke_fs_exists.existsSync)(require_persistence.getEnvReflectionsPath(this, "secrets"))) this.env.used.secrets = await require_persistence.readSecretsReflection(this);
90
+ } else {
91
+ this.env.types.env = await require_reflect.reflectEnv(this, this.config.env.types?.file ? (0, __stryke_path_is_parent_path.isParentPath)(this.config.env.types?.file, this.workspaceConfig.workspaceRoot) ? this.config.env.types?.file : (0, __stryke_path_join.joinPaths)(this.config.projectRoot, this.config.env.types?.file) : void 0, this.config.env.types?.name);
92
+ if (!this.env.types.env) throw new Error("Failed to find the environment configuration type reflection in the context.");
93
+ await require_persistence.writeEnvTypeReflection(this, this.env.types.env, "env");
94
+ this.env.types.secrets = await require_reflect.reflectSecrets(this, this.config.env.secrets?.file ? (0, __stryke_path_is_parent_path.isParentPath)(this.config.env.secrets?.file, this.workspaceConfig.workspaceRoot) ? this.config.env.secrets?.file : (0, __stryke_path_join.joinPaths)(this.config.projectRoot, this.config.env.secrets?.file) : void 0, this.config.env.secrets?.name);
95
+ if (!this.env.types.secrets) throw new Error("Failed to find the secrets configuration type reflection in the context.");
96
+ await require_persistence.writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
97
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Resolved ${this.env.types.env.getProperties().length ?? 0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length ?? 0} secret configuration parameters`);
98
+ const envWithAlias = this.env.types.env.getProperties().filter((prop) => prop.getAlias().length > 0);
99
+ Object.entries(await require_load.loadEnv(this, this.config.env)).forEach(([key, value]) => {
100
+ const unprefixedKey = this.config.env.prefix.reduce((ret, prefix) => {
101
+ if (key.replace(/_$/g, "").startsWith(prefix)) return key.replace(/_$/g, "").slice(prefix.length);
102
+ return ret;
103
+ }, key);
104
+ const aliasKey = envWithAlias.find((prop) => prop?.getAlias().reverse().includes(unprefixedKey));
105
+ if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) this.env.types.env.getProperty(unprefixedKey).setDefaultValue(value);
106
+ });
107
+ this.env.used.env = new require_type.type_exports.ReflectionClass({
108
+ kind: require_type.type_exports.ReflectionKind.objectLiteral,
109
+ typeName: "Env",
110
+ description: `An object containing the environment configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
111
+ types: []
112
+ }, this.env.types.env);
113
+ await require_persistence.writeEnvReflection(this, this.env.used.env, "env");
114
+ if (this.env.types.secrets) {
115
+ await require_persistence.writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
116
+ this.env.used.secrets = new require_type.type_exports.ReflectionClass({
117
+ kind: require_type.type_exports.ReflectionKind.objectLiteral,
118
+ typeName: "Secrets",
119
+ description: `An object containing the secret configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
120
+ types: []
121
+ }, this.env.types.secrets);
122
+ await require_persistence.writeEnvReflection(this, this.env.used.secrets, "secrets");
123
+ }
124
+ }
125
+ },
126
+ async prepare() {
127
+ const _self$ = this;
128
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Preparing the Environment runtime artifacts for the Powerlines project.`);
129
+ return this.render((0, __alloy_js_core_jsx_runtime.createComponent)(require_env.EnvBuiltin, { get defaultConfig() {
130
+ return _self$.config.env.defaultConfig;
131
+ } }));
132
+ },
133
+ async docs() {
134
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Writing Environment documentation for the Powerlines project artifacts.");
135
+ const outputPath = (0, __stryke_path_join.joinPaths)(this.config.projectRoot, "docs", "generated");
136
+ if (!(0, __stryke_fs_exists.existsSync)(outputPath)) await (0, __stryke_fs_helpers.createDirectory)(outputPath);
137
+ const reflection = await require_persistence.readEnvTypeReflection(this, "env");
138
+ const envDocFile = (0, __stryke_path_join.joinPaths)(outputPath, "env.md");
139
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Documenting environment variables configuration in "${envDocFile}"`);
140
+ await this.fs.write(envDocFile, `<!-- Generated by ${(0, __stryke_string_format_title_case.titleCase)(this.config.framework) || "Powerlines"} -->
2
141
 
3
142
  Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below 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.
4
143
 
5
144
  | Name | Description | Type | Default Value | Required |
6
145
  | ---- | ----------- | ---- | ------------- | :------: |
7
- ${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
8
- `,``)??``).trim()} | ${(0,t.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
9
- `)}
10
- `)},async buildEnd(){let e=o.getEnvReflectionsPath(this,`env`);this.log(m.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await o.writeEnvReflection(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:(0,g.default)(e.automd??{},{generators:{env:f.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},i.default(e.automd)];var E=T;exports.default=E;
146
+ ${reflection.getProperties().filter((property) => property.getNameAsString() !== "__POWERLINES_INJECTED__").sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())).map((reflectionProperty) => {
147
+ return `| ${reflectionProperty.getNameAsString().trim()} | ${(reflectionProperty.getDescription()?.replaceAll("\r", "")?.replaceAll("\n", "") ?? "").trim()} | ${(0, require_type.type_exports.stringifyType)(reflectionProperty.getType()).trim().replaceAll(" | ", ", or ")} | ${reflectionProperty.hasDefault() ? String(reflectionProperty.getDefaultValue())?.includes("\"") ? reflectionProperty.getDefaultValue() : `\`${reflectionProperty.getDefaultValue()}\`` : ""} | ${reflectionProperty.isValueRequired() ? "" : "✔"} |`;
148
+ }).join("\n")}
149
+ `);
150
+ },
151
+ async buildEnd() {
152
+ const reflectionPath = require_persistence.getEnvReflectionsPath(this, "env");
153
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Writing env reflection types to ${reflectionPath}.`);
154
+ await require_persistence.writeEnvReflection(this, this.env.used.env, "env");
155
+ }
156
+ },
157
+ {
158
+ name: "env:automd-generator",
159
+ config() {
160
+ return { automd: (0, defu.default)(options.automd ?? {}, { generators: { "env": require_automd_generator.env(this) } }) };
161
+ }
162
+ },
163
+ {
164
+ name: "env:vite",
165
+ vite: { configResolved() {
166
+ return { envPrefix: this.config?.env?.prefix };
167
+ } }
168
+ },
169
+ require_index$2.default(options.automd)
170
+ ];
171
+ };
172
+ var src_default$3 = plugin;
173
+
174
+ //#endregion
175
+ exports.default = src_default$3;