@powerlines/plugin-env 0.15.2 → 0.15.4

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 (231) hide show
  1. package/dist/components/docs.cjs +3 -70
  2. package/dist/components/docs.d.cts +1 -8
  3. package/dist/components/docs.d.mts +1 -8
  4. package/dist/components/docs.mjs +2 -68
  5. package/dist/components/env.cjs +4 -574
  6. package/dist/components/env.d.cts +2 -19
  7. package/dist/components/env.d.mts +3 -19
  8. package/dist/components/env.mjs +2 -570
  9. package/dist/components/index.cjs +7 -5
  10. package/dist/components/index.d.cts +4 -2
  11. package/dist/components/index.d.mts +5 -2
  12. package/dist/components/index.mjs +4 -2
  13. package/dist/{plugin-alloy/src/types/components.d.cts → components-8W0Zgj0y.d.mts} +2 -1
  14. package/dist/components-C9bYrQVK.cjs +0 -0
  15. package/dist/components-CNIQFfeK.mjs +1 -0
  16. package/dist/create-reflection-resource-BNYxBgW2.mjs +9846 -0
  17. package/dist/create-reflection-resource-BWYhmX7O.cjs +10085 -0
  18. package/dist/docs-5r844zC1.d.mts +9 -0
  19. package/dist/docs-B66b9li3.mjs +219 -0
  20. package/dist/docs-_MmTNBQX.d.cts +9 -0
  21. package/dist/docs-hBlKCRWK.cjs +224 -0
  22. package/dist/env-BPodCdD1.d.cts +116 -0
  23. package/dist/env-IQvgnabX.mjs +1578 -0
  24. package/dist/env-cO4BUDn1.cjs +1596 -0
  25. package/dist/env-zhzvpUI5.d.mts +98 -0
  26. package/dist/index-BXxhKmeA.d.mts +1 -0
  27. package/dist/index-Cc7fCJU9.d.mts +1 -0
  28. package/dist/index-CqdNToYT.d.cts +1 -0
  29. package/dist/index-DWPDThxu.d.cts +1 -0
  30. package/dist/index.cjs +702 -77
  31. package/dist/index.d.cts +185 -12
  32. package/dist/index.d.mts +190 -17
  33. package/dist/index.mjs +648 -28
  34. package/dist/{deepkit/schemas/reflection.d.mts → plugin-BaInAuAh.d.mts} +326 -59
  35. package/dist/{deepkit/schemas/reflection.d.cts → plugin-BwuEBScL.d.cts} +268 -1
  36. package/dist/plugin-D3B5E_Hg.mjs +1 -0
  37. package/dist/plugin-D5qyQPqC.cjs +0 -0
  38. package/dist/resolved-BZG2cwRG.d.cts +1789 -0
  39. package/dist/resolved-V5COsfDu.d.mts +1791 -0
  40. package/dist/runtime-Bisl_1Ja.cjs +0 -0
  41. package/dist/runtime-Q8Ni8SeN.d.cts +794 -0
  42. package/dist/runtime-azNoeKr-.mjs +1 -0
  43. package/dist/runtime-qZ0Z2kEd.d.mts +794 -0
  44. package/dist/types/index.cjs +3 -0
  45. package/dist/types/index.d.cts +4 -2
  46. package/dist/types/index.d.mts +5 -2
  47. package/dist/types/index.mjs +4 -0
  48. package/dist/types/plugin.cjs +1 -0
  49. package/dist/types/plugin.d.cts +3 -156
  50. package/dist/types/plugin.d.mts +4 -158
  51. package/dist/types/plugin.mjs +2 -0
  52. package/dist/types/runtime.cjs +1 -0
  53. package/dist/types/runtime.d.cts +2 -793
  54. package/dist/types/runtime.d.mts +2 -793
  55. package/dist/types/runtime.mjs +2 -0
  56. package/dist/types-DwElXV6q.mjs +1 -0
  57. package/dist/types-MYBaygjr.cjs +0 -0
  58. package/package.json +7 -7
  59. package/dist/_virtual/rolldown_runtime.cjs +0 -37
  60. package/dist/_virtual/rolldown_runtime.mjs +0 -29
  61. package/dist/babel/index.cjs +0 -1
  62. package/dist/babel/index.d.mts +0 -1
  63. package/dist/babel/index.mjs +0 -3
  64. package/dist/babel/plugin.cjs +0 -121
  65. package/dist/babel/plugin.d.cts +0 -7
  66. package/dist/babel/plugin.d.mts +0 -9
  67. package/dist/babel/plugin.mjs +0 -119
  68. package/dist/deepkit/schemas/reflection.cjs +0 -3940
  69. package/dist/deepkit/schemas/reflection.mjs +0 -3938
  70. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  71. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  72. package/dist/deepkit/src/capnp.cjs +0 -913
  73. package/dist/deepkit/src/capnp.mjs +0 -911
  74. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  75. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  76. package/dist/deepkit/src/reflect-type.cjs +0 -22
  77. package/dist/deepkit/src/reflect-type.mjs +0 -20
  78. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  79. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  80. package/dist/deepkit/src/transformer.cjs +0 -52
  81. package/dist/deepkit/src/transformer.mjs +0 -49
  82. package/dist/deepkit/src/transpile.cjs +0 -29
  83. package/dist/deepkit/src/transpile.mjs +0 -27
  84. package/dist/deepkit/src/types.d.cts +0 -10
  85. package/dist/deepkit/src/types.d.mts +0 -10
  86. package/dist/deepkit/src/utilities.cjs +0 -66
  87. package/dist/deepkit/src/utilities.mjs +0 -65
  88. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
  89. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
  90. package/dist/deepkit/src/vendor/type.cjs +0 -20
  91. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  92. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  93. package/dist/deepkit/src/vendor/type.mjs +0 -11
  94. package/dist/helpers/automd-generator.cjs +0 -22
  95. package/dist/helpers/automd-generator.mjs +0 -21
  96. package/dist/helpers/create-reflection-resource.cjs +0 -55
  97. package/dist/helpers/create-reflection-resource.d.cts +0 -15
  98. package/dist/helpers/create-reflection-resource.d.mts +0 -15
  99. package/dist/helpers/create-reflection-resource.mjs +0 -54
  100. package/dist/helpers/index.cjs +0 -6
  101. package/dist/helpers/index.d.mts +0 -6
  102. package/dist/helpers/index.mjs +0 -8
  103. package/dist/helpers/load.cjs +0 -83
  104. package/dist/helpers/load.d.cts +0 -35
  105. package/dist/helpers/load.d.mts +0 -36
  106. package/dist/helpers/load.mjs +0 -80
  107. package/dist/helpers/persistence.cjs +0 -214
  108. package/dist/helpers/persistence.d.cts +0 -84
  109. package/dist/helpers/persistence.d.mts +0 -84
  110. package/dist/helpers/persistence.mjs +0 -202
  111. package/dist/helpers/reflect.cjs +0 -111
  112. package/dist/helpers/reflect.d.cts +0 -46
  113. package/dist/helpers/reflect.d.mts +0 -46
  114. package/dist/helpers/reflect.mjs +0 -103
  115. package/dist/helpers/source-file-env.cjs +0 -28
  116. package/dist/helpers/source-file-env.d.cts +0 -8
  117. package/dist/helpers/source-file-env.d.mts +0 -8
  118. package/dist/helpers/source-file-env.mjs +0 -26
  119. package/dist/helpers/template-helpers.cjs +0 -42
  120. package/dist/helpers/template-helpers.d.cts +0 -15
  121. package/dist/helpers/template-helpers.d.mts +0 -15
  122. package/dist/helpers/template-helpers.mjs +0 -41
  123. package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
  124. package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
  125. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  126. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  127. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  128. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  129. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  130. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  131. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
  132. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
  133. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  134. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  135. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  136. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  137. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  138. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  139. package/dist/plugin-alloy/src/index.cjs +0 -93
  140. package/dist/plugin-alloy/src/index.mjs +0 -91
  141. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
  142. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
  143. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
  144. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
  145. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -18
  146. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  147. package/dist/plugin-alloy/src/types/components.d.mts +0 -25
  148. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  149. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
  150. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
  151. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
  152. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -25
  153. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  154. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
  155. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
  156. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
  157. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
  158. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -27
  159. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -28
  160. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
  161. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -194
  162. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -14
  163. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -15
  164. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -191
  165. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
  166. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -11
  167. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
  168. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
  169. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  170. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  171. package/dist/plugin-automd/src/index.cjs +0 -101
  172. package/dist/plugin-automd/src/index.mjs +0 -98
  173. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  174. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  175. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  176. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  177. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  178. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  179. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  180. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  181. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  182. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  183. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  184. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  185. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  186. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  187. package/dist/plugin-babel/src/helpers/options.cjs +0 -50
  188. package/dist/plugin-babel/src/helpers/options.mjs +0 -47
  189. package/dist/plugin-babel/src/index.cjs +0 -91
  190. package/dist/plugin-babel/src/index.mjs +0 -89
  191. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  192. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  193. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  194. package/dist/powerlines/schemas/fs.d.mts +0 -1
  195. package/dist/powerlines/src/api.d.mts +0 -7
  196. package/dist/powerlines/src/index.d.mts +0 -12
  197. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
  198. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
  199. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
  200. package/dist/powerlines/src/lib/entry.cjs +0 -12
  201. package/dist/powerlines/src/lib/entry.mjs +0 -14
  202. package/dist/powerlines/src/lib/logger.cjs +0 -41
  203. package/dist/powerlines/src/lib/logger.mjs +0 -39
  204. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
  205. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
  206. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
  207. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
  208. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  209. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  210. package/dist/powerlines/src/types/api.d.mts +0 -5
  211. package/dist/powerlines/src/types/babel.d.cts +0 -23
  212. package/dist/powerlines/src/types/babel.d.mts +0 -23
  213. package/dist/powerlines/src/types/build.d.cts +0 -145
  214. package/dist/powerlines/src/types/build.d.mts +0 -147
  215. package/dist/powerlines/src/types/commands.d.cts +0 -8
  216. package/dist/powerlines/src/types/commands.d.mts +0 -9
  217. package/dist/powerlines/src/types/config.d.cts +0 -380
  218. package/dist/powerlines/src/types/config.d.mts +0 -381
  219. package/dist/powerlines/src/types/context.d.cts +0 -414
  220. package/dist/powerlines/src/types/context.d.mts +0 -416
  221. package/dist/powerlines/src/types/fs.d.cts +0 -486
  222. package/dist/powerlines/src/types/fs.d.mts +0 -486
  223. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  224. package/dist/powerlines/src/types/index.d.mts +0 -12
  225. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  226. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  227. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  228. package/dist/powerlines/src/types/resolved.d.mts +0 -83
  229. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  230. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  231. package/dist/powerlines/src/types/unplugin.d.mts +0 -7
package/dist/index.d.cts CHANGED
@@ -1,16 +1,189 @@
1
- import { EnvDocs } from "./components/docs.cjs";
2
- import { Plugin } from "./powerlines/src/types/plugin.cjs";
3
- import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./components/env.cjs";
4
- import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.cjs";
5
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.cjs";
6
- import { envBabelPlugin } from "./babel/plugin.cjs";
7
- import { createReflectionResource } from "./helpers/create-reflection-resource.cjs";
8
- import { loadEnv, loadEnvFromContext } from "./helpers/load.cjs";
9
- import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./helpers/persistence.cjs";
10
- import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./helpers/reflect.cjs";
11
- import { formatEnvField, removeEnvPrefix } from "./helpers/source-file-env.cjs";
12
- import { createTemplateReflection } from "./helpers/template-helpers.cjs";
1
+ import { t as EnvDocs } from "./docs-_MmTNBQX.cjs";
2
+ import { d as Plugin, n as EnvironmentResolvedConfig, o as DeclareBabelTransformPluginReturn, s as Context, u as UnresolvedContext } from "./resolved-BZG2cwRG.cjs";
3
+ import { i as __ΩEnvBuiltinProps, n as EnvBuiltinProps, r as EnvTypeDefinition, t as EnvBuiltin } from "./env-BPodCdD1.cjs";
4
+ import "./index-DWPDThxu.cjs";
5
+ import { a as EnvType, c as __ΩEnvPluginResolvedConfig, i as EnvPluginUserConfig, l as __ΩEnvPluginUserConfig, n as EnvPluginOptions, o as __ΩEnvPluginContext, r as EnvPluginResolvedConfig, s as __ΩEnvPluginOptions, t as EnvPluginContext, u as __ΩEnvType } from "./plugin-BwuEBScL.cjs";
6
+ import { i as __ΩSecretsInterface, n as SecretsInterface, r as __ΩEnvInterface, t as EnvInterface } from "./runtime-Q8Ni8SeN.cjs";
7
+ import "./index-CqdNToYT.cjs";
8
+ import * as _alloy_js_core3 from "@alloy-js/core";
9
+ import { TypeDefinition } from "@stryke/types/configuration";
10
+ import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
11
+ import { DotenvParseOutput } from "@stryke/env/types";
13
12
 
13
+ //#region src/babel/plugin.d.ts
14
+ declare const envBabelPlugin: DeclareBabelTransformPluginReturn<EnvPluginContext<EnvPluginResolvedConfig>, Record<string, any>>;
15
+ //#endregion
16
+ //#region src/helpers/create-reflection-resource.d.ts
17
+ /**
18
+ * Creates a reflection resource for the environment configuration.
19
+ *
20
+ * @param context - The environment plugin context.
21
+ * @returns A resource that provides the reflection of the environment configuration.
22
+ */
23
+ declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core3.Resource<ReflectionClass<Record<string, any>>>;
24
+ //#endregion
25
+ //#region src/helpers/load.d.ts
26
+ /**
27
+ * Retrieves various dotenv configuration parameters from the context.
28
+ *
29
+ * @param context - The context to retrieve the dotenv configuration from.
30
+ * @param parsed - The parsed dotenv configuration.
31
+ * @returns An object containing the dotenv configuration.
32
+ */
33
+ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
34
+ APP_NAME: string | undefined;
35
+ APP_VERSION: string | undefined;
36
+ BUILD_ID: string;
37
+ BUILD_TIMESTAMP: string;
38
+ BUILD_CHECKSUM: string;
39
+ RELEASE_ID: string;
40
+ RELEASE_TAG: string;
41
+ DEFAULT_LOCALE: string | undefined;
42
+ DEFAULT_TIMEZONE: string | undefined;
43
+ LOG_LEVEL: "error" | "warn" | "info" | "debug" | "trace" | null;
44
+ ERROR_URL: string | undefined;
45
+ ORGANIZATION: string | undefined;
46
+ PLATFORM: "node" | "browser" | "neutral" | undefined;
47
+ MODE: "test" | "development" | "production" | undefined;
48
+ DEBUG: boolean;
49
+ STACKTRACE: boolean;
50
+ ENVIRONMENT: EnvironmentResolvedConfig;
51
+ };
52
+ declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
53
+ //#endregion
54
+ //#region src/helpers/persistence.d.ts
55
+ /**
56
+ * Resolves the runtime type definition file for the environment variables.
57
+ *
58
+ * @param context - The plugin context.
59
+ * @returns The runtime type definition file for the environment variables.
60
+ */
61
+ declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
62
+ /**
63
+ * Gets the default type definition for the environment variables.
64
+ *
65
+ * @param context - The plugin context.
66
+ * @returns The default type definition for the environment variables.
67
+ */
68
+ declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
69
+ /** Gets the default type definition for the environment secrets.
70
+ *
71
+ * @param context - The plugin context.
72
+ * @returns The default type definition for the environment secrets.
73
+ */
74
+ declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
75
+ /**
76
+ * Gets the path to the environment type reflections.
77
+ *
78
+ * @param context - The plugin context.
79
+ * @param name - The name of the type reflections.
80
+ * @returns The path to the environment type reflections.
81
+ */
82
+ declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
83
+ /**
84
+ * Reads the environment type reflection from the file system.
85
+ *
86
+ * @param context - The plugin context.
87
+ * @param name - The name of the type reflections.
88
+ * @returns The environment type reflection.
89
+ */
90
+ declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
91
+ /**
92
+ * Writes the environment type reflection to the file system.
93
+ *
94
+ * @param context - The plugin context.
95
+ * @param reflection - The environment type reflection to write.
96
+ * @param name - The name of the type reflections.
97
+ */
98
+ declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
99
+ declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
100
+ /**
101
+ * Reads the environment reflection data from the file system.
102
+ *
103
+ * @param context - The plugin context.
104
+ * @returns The environment reflection data.
105
+ */
106
+ declare function readEnvReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
107
+ /**
108
+ * Reads the secret environment reflection data from the file system.
109
+ *
110
+ * @param context - The plugin context.
111
+ * @returns The environment reflection data.
112
+ */
113
+ declare function readSecretsReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
114
+ /**
115
+ * Writes the environment reflection data to the file system.
116
+ *
117
+ * @param context - The plugin context.
118
+ * @param reflection - The reflection data to write.
119
+ * @param name - The name of the reflection (either "env" or "secrets").
120
+ */
121
+ declare function writeEnvReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
122
+ /**
123
+ * Writes the environment reflection data to the file system.
124
+ *
125
+ * @param context - The plugin context.
126
+ * @param reflection - The reflection data to write.
127
+ * @param name - The name of the reflection (either "env" or "secrets").
128
+ */
129
+ declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): void;
130
+ //#endregion
131
+ //#region src/helpers/reflect.d.ts
132
+ declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
133
+ declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
134
+ interface CreateEnvReflectionOptions {
135
+ type?: TypeObjectLiteral | TypeClass;
136
+ superReflection?: ReflectionClass<any>;
137
+ }
138
+ declare class BaseEnv implements EnvInterface {
139
+ APP_NAME: string;
140
+ APP_VERSION: string;
141
+ BUILD_ID: string;
142
+ BUILD_TIMESTAMP: string;
143
+ BUILD_CHECKSUM: string;
144
+ RELEASE_ID: string;
145
+ RELEASE_TAG: string;
146
+ ORGANIZATION: string;
147
+ PLATFORM: "node" | "browser" | "neutral";
148
+ MODE: "development" | "test" | "production";
149
+ ENVIRONMENT: string;
150
+ DEBUG: boolean;
151
+ TEST: boolean;
152
+ MINIMAL: boolean;
153
+ NO_COLOR: boolean;
154
+ FORCE_COLOR: number | boolean;
155
+ FORCE_HYPERLINK: number | boolean;
156
+ STACKTRACE: boolean;
157
+ INCLUDE_ERROR_DATA: boolean;
158
+ ERROR_URL: string;
159
+ DEFAULT_TIMEZONE: string;
160
+ DEFAULT_LOCALE: string;
161
+ CI: boolean;
162
+ }
163
+ declare class BaseSecrets implements SecretsInterface {
164
+ ENCRYPTION_KEY: string;
165
+ }
166
+ declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
167
+ declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
168
+ declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
169
+ declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
170
+ declare type __ΩCreateEnvReflectionOptions = any[];
171
+ //#endregion
172
+ //#region src/helpers/source-file-env.d.ts
173
+ type TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;
174
+ declare function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(env: TEnv): TReturned<TEnv>;
175
+ declare function formatEnvField(key: string): string;
176
+ //#endregion
177
+ //#region src/helpers/template-helpers.d.ts
178
+ /**
179
+ * Creates the reflection data used when generating runtime template files.
180
+ *
181
+ * @param context - The context for the configuration plugin.
182
+ * @param name - The name of the configuration template.
183
+ * @returns The reflection for the specified configuration template.
184
+ */
185
+ declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
186
+ //#endregion
14
187
  //#region src/index.d.ts
15
188
  /**
16
189
  * A Powerlines plugin to inject environment variables into the source code.
package/dist/index.d.mts CHANGED
@@ -1,21 +1,194 @@
1
- import { EnvDocs } from "./components/docs.mjs";
2
- import { Plugin } from "./powerlines/src/types/plugin.mjs";
3
- import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./components/env.mjs";
4
- import "./components/index.mjs";
5
- import "./powerlines/src/index.mjs";
6
- import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.mjs";
7
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.mjs";
8
- import { envBabelPlugin } from "./babel/plugin.mjs";
9
- import "./babel/index.mjs";
10
- import { createReflectionResource } from "./helpers/create-reflection-resource.mjs";
11
- import { loadEnv, loadEnvFromContext } from "./helpers/load.mjs";
12
- import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./helpers/persistence.mjs";
13
- import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./helpers/reflect.mjs";
14
- import { formatEnvField, removeEnvPrefix } from "./helpers/source-file-env.mjs";
15
- import { createTemplateReflection } from "./helpers/template-helpers.mjs";
16
- import "./helpers/index.mjs";
17
- import "./types/index.mjs";
1
+ import { t as EnvDocs } from "./docs-5r844zC1.mjs";
2
+ import { d as Plugin, n as EnvironmentResolvedConfig, o as DeclareBabelTransformPluginReturn, s as Context, u as UnresolvedContext } from "./resolved-V5COsfDu.mjs";
3
+ import "./components-8W0Zgj0y.mjs";
4
+ import { i as __ΩEnvBuiltinProps, n as EnvBuiltinProps, r as EnvTypeDefinition, t as EnvBuiltin } from "./env-zhzvpUI5.mjs";
5
+ import "./index-Cc7fCJU9.mjs";
6
+ import { a as EnvType, c as __ΩEnvPluginResolvedConfig, i as EnvPluginUserConfig, l as __ΩEnvPluginUserConfig, n as EnvPluginOptions, o as __ΩEnvPluginContext, r as EnvPluginResolvedConfig, s as __ΩEnvPluginOptions, t as EnvPluginContext, u as __ΩEnvType } from "./plugin-BaInAuAh.mjs";
7
+ import { i as __ΩSecretsInterface, n as SecretsInterface, r as __ΩEnvInterface, t as EnvInterface } from "./runtime-qZ0Z2kEd.mjs";
8
+ import "./index-BXxhKmeA.mjs";
9
+ import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
10
+ import * as _alloy_js_core4 from "@alloy-js/core";
11
+ import { DotenvParseOutput } from "@stryke/env/types";
12
+ import "@stryke/capnp";
13
+ import { MaybePromise } from "@stryke/types/base";
14
+ import { TypeDefinition } from "@stryke/types/configuration";
15
+ import { UnpluginOptions } from "unplugin";
16
+ import { ArrayValues } from "@stryke/types/array";
18
17
 
18
+ //#region src/babel/plugin.d.ts
19
+ declare const envBabelPlugin: DeclareBabelTransformPluginReturn<EnvPluginContext<EnvPluginResolvedConfig>, Record<string, any>>;
20
+ //#endregion
21
+ //#region src/helpers/create-reflection-resource.d.ts
22
+ /**
23
+ * Creates a reflection resource for the environment configuration.
24
+ *
25
+ * @param context - The environment plugin context.
26
+ * @returns A resource that provides the reflection of the environment configuration.
27
+ */
28
+ declare function createReflectionResource(context?: EnvPluginContext): _alloy_js_core4.Resource<ReflectionClass<Record<string, any>>>;
29
+ //#endregion
30
+ //#region src/helpers/load.d.ts
31
+ /**
32
+ * Retrieves various dotenv configuration parameters from the context.
33
+ *
34
+ * @param context - The context to retrieve the dotenv configuration from.
35
+ * @param parsed - The parsed dotenv configuration.
36
+ * @returns An object containing the dotenv configuration.
37
+ */
38
+ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
39
+ APP_NAME: string | undefined;
40
+ APP_VERSION: string | undefined;
41
+ BUILD_ID: string;
42
+ BUILD_TIMESTAMP: string;
43
+ BUILD_CHECKSUM: string;
44
+ RELEASE_ID: string;
45
+ RELEASE_TAG: string;
46
+ DEFAULT_LOCALE: string | undefined;
47
+ DEFAULT_TIMEZONE: string | undefined;
48
+ LOG_LEVEL: "error" | "warn" | "info" | "debug" | "trace" | null;
49
+ ERROR_URL: string | undefined;
50
+ ORGANIZATION: string | undefined;
51
+ PLATFORM: "node" | "browser" | "neutral" | undefined;
52
+ MODE: "test" | "development" | "production" | undefined;
53
+ DEBUG: boolean;
54
+ STACKTRACE: boolean;
55
+ ENVIRONMENT: EnvironmentResolvedConfig;
56
+ };
57
+ declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
58
+ //#endregion
59
+ //#region src/helpers/persistence.d.ts
60
+ /**
61
+ * Resolves the runtime type definition file for the environment variables.
62
+ *
63
+ * @param context - The plugin context.
64
+ * @returns The runtime type definition file for the environment variables.
65
+ */
66
+ declare function resolveRuntimeTypeFile(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<string>;
67
+ /**
68
+ * Gets the default type definition for the environment variables.
69
+ *
70
+ * @param context - The plugin context.
71
+ * @returns The default type definition for the environment variables.
72
+ */
73
+ declare function getEnvDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
74
+ /** Gets the default type definition for the environment secrets.
75
+ *
76
+ * @param context - The plugin context.
77
+ * @returns The default type definition for the environment secrets.
78
+ */
79
+ declare function getSecretsDefaultTypeDefinition(context: UnresolvedContext<EnvPluginResolvedConfig>): Promise<TypeDefinition>;
80
+ /**
81
+ * Gets the path to the environment type reflections.
82
+ *
83
+ * @param context - The plugin context.
84
+ * @param name - The name of the type reflections.
85
+ * @returns The path to the environment type reflections.
86
+ */
87
+ declare function getEnvTypeReflectionsPath(context: Context<EnvPluginResolvedConfig>, name?: EnvType): string;
88
+ /**
89
+ * Reads the environment type reflection from the file system.
90
+ *
91
+ * @param context - The plugin context.
92
+ * @param name - The name of the type reflections.
93
+ * @returns The environment type reflection.
94
+ */
95
+ declare function readEnvTypeReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
96
+ /**
97
+ * Writes the environment type reflection to the file system.
98
+ *
99
+ * @param context - The plugin context.
100
+ * @param reflection - The environment type reflection to write.
101
+ * @param name - The name of the type reflections.
102
+ */
103
+ declare function writeEnvTypeReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
104
+ declare function getEnvReflectionsPath(context: EnvPluginContext, name: EnvType): string;
105
+ /**
106
+ * Reads the environment reflection data from the file system.
107
+ *
108
+ * @param context - The plugin context.
109
+ * @returns The environment reflection data.
110
+ */
111
+ declare function readEnvReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
112
+ /**
113
+ * Reads the secret environment reflection data from the file system.
114
+ *
115
+ * @param context - The plugin context.
116
+ * @returns The environment reflection data.
117
+ */
118
+ declare function readSecretsReflection(context: EnvPluginContext): Promise<ReflectionClass<any>>;
119
+ /**
120
+ * Writes the environment reflection data to the file system.
121
+ *
122
+ * @param context - The plugin context.
123
+ * @param reflection - The reflection data to write.
124
+ * @param name - The name of the reflection (either "env" or "secrets").
125
+ */
126
+ declare function writeEnvReflection(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): Promise<void>;
127
+ /**
128
+ * Writes the environment reflection data to the file system.
129
+ *
130
+ * @param context - The plugin context.
131
+ * @param reflection - The reflection data to write.
132
+ * @param name - The name of the reflection (either "env" or "secrets").
133
+ */
134
+ declare function writeEnvReflectionSync(context: EnvPluginContext, reflection: ReflectionClass<any>, name?: EnvType): void;
135
+ //#endregion
136
+ //#region src/helpers/reflect.d.ts
137
+ declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
138
+ declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
139
+ interface CreateEnvReflectionOptions {
140
+ type?: TypeObjectLiteral | TypeClass;
141
+ superReflection?: ReflectionClass<any>;
142
+ }
143
+ declare class BaseEnv implements EnvInterface {
144
+ APP_NAME: string;
145
+ APP_VERSION: string;
146
+ BUILD_ID: string;
147
+ BUILD_TIMESTAMP: string;
148
+ BUILD_CHECKSUM: string;
149
+ RELEASE_ID: string;
150
+ RELEASE_TAG: string;
151
+ ORGANIZATION: string;
152
+ PLATFORM: "node" | "browser" | "neutral";
153
+ MODE: "development" | "test" | "production";
154
+ ENVIRONMENT: string;
155
+ DEBUG: boolean;
156
+ TEST: boolean;
157
+ MINIMAL: boolean;
158
+ NO_COLOR: boolean;
159
+ FORCE_COLOR: number | boolean;
160
+ FORCE_HYPERLINK: number | boolean;
161
+ STACKTRACE: boolean;
162
+ INCLUDE_ERROR_DATA: boolean;
163
+ ERROR_URL: string;
164
+ DEFAULT_TIMEZONE: string;
165
+ DEFAULT_LOCALE: string;
166
+ CI: boolean;
167
+ }
168
+ declare class BaseSecrets implements SecretsInterface {
169
+ ENCRYPTION_KEY: string;
170
+ }
171
+ declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
172
+ declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
173
+ declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
174
+ declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
175
+ declare type __ΩCreateEnvReflectionOptions = any[];
176
+ //#endregion
177
+ //#region src/helpers/source-file-env.d.ts
178
+ type TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;
179
+ declare function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(env: TEnv): TReturned<TEnv>;
180
+ declare function formatEnvField(key: string): string;
181
+ //#endregion
182
+ //#region src/helpers/template-helpers.d.ts
183
+ /**
184
+ * Creates the reflection data used when generating runtime template files.
185
+ *
186
+ * @param context - The context for the configuration plugin.
187
+ * @param name - The name of the configuration template.
188
+ * @returns The reflection for the specified configuration template.
189
+ */
190
+ declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
191
+ //#endregion
19
192
  //#region src/index.d.ts
20
193
  /**
21
194
  * A Powerlines plugin to inject environment variables into the source code.