@powerlines/plugin-env 0.16.57 → 0.16.58

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 (185) hide show
  1. package/dist/babel/index.d.cts +2 -0
  2. package/dist/babel/index.d.mts +2 -0
  3. package/dist/babel/plugin.d.cts +9 -0
  4. package/dist/babel/plugin.d.cts.map +1 -0
  5. package/dist/babel/plugin.d.mts +9 -0
  6. package/dist/babel/plugin.d.mts.map +1 -0
  7. package/dist/babel/plugin.mjs +2 -1
  8. package/dist/babel/plugin.mjs.map +1 -0
  9. package/dist/components/docs.d.cts +25 -0
  10. package/dist/components/docs.d.cts.map +1 -0
  11. package/dist/components/docs.d.mts +25 -0
  12. package/dist/components/docs.d.mts.map +1 -0
  13. package/dist/components/docs.mjs +2 -1
  14. package/dist/components/docs.mjs.map +1 -0
  15. package/dist/components/env-builtin.d.cts +23 -0
  16. package/dist/components/env-builtin.d.cts.map +1 -0
  17. package/dist/components/env-builtin.d.mts +23 -0
  18. package/dist/components/env-builtin.d.mts.map +1 -0
  19. package/dist/components/env-builtin.mjs +2 -1
  20. package/dist/components/env-builtin.mjs.map +1 -0
  21. package/dist/components/index.d.cts +3 -0
  22. package/dist/components/index.d.mts +3 -0
  23. package/dist/helpers/automd-generator.d.cts +15 -0
  24. package/dist/helpers/automd-generator.d.cts.map +1 -0
  25. package/dist/helpers/automd-generator.d.mts +15 -0
  26. package/dist/helpers/automd-generator.d.mts.map +1 -0
  27. package/dist/helpers/automd-generator.mjs +2 -1
  28. package/dist/helpers/automd-generator.mjs.map +1 -0
  29. package/dist/helpers/create-reflection-resource.d.cts +14 -0
  30. package/dist/helpers/create-reflection-resource.d.cts.map +1 -0
  31. package/dist/helpers/create-reflection-resource.d.mts +14 -0
  32. package/dist/helpers/create-reflection-resource.d.mts.map +1 -0
  33. package/dist/helpers/create-reflection-resource.mjs +2 -1
  34. package/dist/helpers/create-reflection-resource.mjs.map +1 -0
  35. package/dist/helpers/docs-helper.d.cts +14 -0
  36. package/dist/helpers/docs-helper.d.cts.map +1 -0
  37. package/dist/helpers/docs-helper.d.mts +14 -0
  38. package/dist/helpers/docs-helper.d.mts.map +1 -0
  39. package/dist/helpers/docs-helper.mjs +2 -1
  40. package/dist/helpers/docs-helper.mjs.map +1 -0
  41. package/dist/helpers/index.d.cts +7 -0
  42. package/dist/helpers/index.d.mts +7 -0
  43. package/dist/helpers/load.d.cts +36 -0
  44. package/dist/helpers/load.d.cts.map +1 -0
  45. package/dist/helpers/load.d.mts +36 -0
  46. package/dist/helpers/load.d.mts.map +1 -0
  47. package/dist/helpers/load.mjs +2 -1
  48. package/dist/helpers/load.mjs.map +1 -0
  49. package/dist/helpers/persistence.d.cts +85 -0
  50. package/dist/helpers/persistence.d.cts.map +1 -0
  51. package/dist/helpers/persistence.d.mts +85 -0
  52. package/dist/helpers/persistence.d.mts.map +1 -0
  53. package/dist/helpers/persistence.mjs +2 -1
  54. package/dist/helpers/persistence.mjs.map +1 -0
  55. package/dist/helpers/reflect.d.cts +69 -0
  56. package/dist/helpers/reflect.d.cts.map +1 -0
  57. package/dist/helpers/reflect.d.mts +69 -0
  58. package/dist/helpers/reflect.d.mts.map +1 -0
  59. package/dist/helpers/reflect.mjs +2 -1
  60. package/dist/helpers/reflect.mjs.map +1 -0
  61. package/dist/helpers/source-file-env.d.cts +9 -0
  62. package/dist/helpers/source-file-env.d.cts.map +1 -0
  63. package/dist/helpers/source-file-env.d.mts +9 -0
  64. package/dist/helpers/source-file-env.d.mts.map +1 -0
  65. package/dist/helpers/source-file-env.mjs +2 -1
  66. package/dist/helpers/source-file-env.mjs.map +1 -0
  67. package/dist/helpers/template-helpers.d.cts +16 -0
  68. package/dist/helpers/template-helpers.d.cts.map +1 -0
  69. package/dist/helpers/template-helpers.d.mts +16 -0
  70. package/dist/helpers/template-helpers.d.mts.map +1 -0
  71. package/dist/helpers/template-helpers.mjs +2 -1
  72. package/dist/helpers/template-helpers.mjs.map +1 -0
  73. package/dist/index.d.cts +18 -0
  74. package/dist/index.d.cts.map +1 -0
  75. package/dist/index.d.mts +18 -0
  76. package/dist/index.d.mts.map +1 -0
  77. package/dist/index.mjs +2 -1
  78. package/dist/index.mjs.map +1 -0
  79. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs +2 -1
  80. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs.map +1 -0
  81. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs +2 -1
  82. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs.map +1 -0
  83. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +2 -1
  84. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs.map +1 -0
  85. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +2 -1
  86. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs.map +1 -0
  87. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +2 -1
  88. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs.map +1 -0
  89. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +2 -1
  90. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs.map +1 -0
  91. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +2 -1
  92. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs.map +1 -0
  93. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +2 -1
  94. package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs.map +1 -0
  95. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs +2 -1
  96. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs.map +1 -0
  97. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs +2 -1
  98. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs.map +1 -0
  99. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs +2 -1
  100. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs.map +1 -0
  101. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs +2 -1
  102. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs.map +1 -0
  103. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs +2 -1
  104. package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs.map +1 -0
  105. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs +2 -1
  106. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map +1 -0
  107. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +2 -1
  108. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +1 -0
  109. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +2 -1
  110. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +1 -0
  111. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs +2 -1
  112. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs.map +1 -0
  113. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs +2 -1
  114. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs.map +1 -0
  115. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +2 -1
  116. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +1 -0
  117. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs +2 -1
  118. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs.map +1 -0
  119. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +2 -1
  120. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +1 -0
  121. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs +2 -1
  122. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs.map +1 -0
  123. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +2 -1
  124. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +1 -0
  125. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.mjs +2 -1
  126. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.mjs.map +1 -0
  127. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs +2 -1
  128. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs.map +1 -0
  129. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +2 -1
  130. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs.map +1 -0
  131. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +2 -1
  132. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +1 -0
  133. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs +2 -1
  134. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs.map +1 -0
  135. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs +2 -1
  136. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs.map +1 -0
  137. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +2 -1
  138. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -0
  139. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +2 -1
  140. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs.map +1 -0
  141. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +2 -1
  142. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -0
  143. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +2 -1
  144. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +1 -0
  145. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +2 -1
  146. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs.map +1 -0
  147. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -1
  148. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -0
  149. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +2 -1
  150. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +1 -0
  151. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +2 -1
  152. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -0
  153. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +2 -1
  154. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +1 -0
  155. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +2 -1
  156. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs.map +1 -0
  157. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +2 -1
  158. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs.map +1 -0
  159. package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs +2 -1
  160. package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs.map +1 -0
  161. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs +2 -1
  162. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs.map +1 -0
  163. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +2 -1
  164. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +1 -0
  165. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +2 -1
  166. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -0
  167. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +2 -1
  168. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +1 -0
  169. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +2 -1
  170. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +1 -0
  171. package/dist/types/index.d.cts +3 -0
  172. package/dist/types/index.d.mts +3 -0
  173. package/dist/types/plugin.d.cts +168 -0
  174. package/dist/types/plugin.d.cts.map +1 -0
  175. package/dist/types/plugin.d.mts +168 -0
  176. package/dist/types/plugin.d.mts.map +1 -0
  177. package/dist/types/plugin.mjs +2 -1
  178. package/dist/types/plugin.mjs.map +1 -0
  179. package/dist/types/runtime.d.cts +792 -0
  180. package/dist/types/runtime.d.cts.map +1 -0
  181. package/dist/types/runtime.d.mts +792 -0
  182. package/dist/types/runtime.d.mts.map +1 -0
  183. package/dist/types/runtime.mjs +2 -1
  184. package/dist/types/runtime.mjs.map +1 -0
  185. package/package.json +8 -8
@@ -0,0 +1,168 @@
1
+ import { EnvInterface, SecretsInterface } from "./runtime.mjs";
2
+ import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
3
+ import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
4
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
5
+ import { Reflection } from "@powerlines/deepkit/types";
6
+ import { DotenvParseOutput } from "@stryke/env/types";
7
+ import { Children } from "@alloy-js/core";
8
+ import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
9
+
10
+ //#region src/types/plugin.d.ts
11
+ type EnvType = "env" | "secrets";
12
+ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
13
+ /**
14
+ * A path to the type definition for the expected env configuration parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `":"` or `"#"` character. For example: `"./src/types/env.ts#ConfigConfiguration"`.
15
+ */
16
+ types?: TypeDefinitionParameter;
17
+ /**
18
+ * A path to the type definition for the expected env secret parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `":"` or `"#"` character. For example: `"./src/types/env.ts#ConfigSecrets"`.
19
+ */
20
+ secrets?: TypeDefinitionParameter;
21
+ /**
22
+ * An additional prefix (or list of additional prefixes) to apply to the environment variables
23
+ *
24
+ * @remarks
25
+ * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
26
+ */
27
+ prefix?: string | string[];
28
+ /**
29
+ * Should the plugin inject the env variables in the source code with their values?
30
+ *
31
+ * @defaultValue false
32
+ */
33
+ inject?: boolean;
34
+ /**
35
+ * Should the plugin validate the loaded environment variables against the provided type definitions?
36
+ *
37
+ * @defaultValue false
38
+ */
39
+ validate?: boolean;
40
+ /**
41
+ * The default configuration to use when loading environment variables.
42
+ *
43
+ * @remarks
44
+ * This configuration is used as the base configuration when loading environment variables, and will be overridden by any values found in the `.env` file or the process environment.
45
+ */
46
+ defaultConfig?: Children;
47
+ /**
48
+ * Babel configuration options to use when injecting environment variables into the source code.
49
+ *
50
+ * @remarks
51
+ * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.
52
+ */
53
+ babel?: BabelPluginOptions;
54
+ /**
55
+ * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
56
+ *
57
+ * @remarks
58
+ * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
59
+ */
60
+ automd?: AutoMDPluginOptions;
61
+ /**
62
+ * Alloy configuration options to use when injecting environment variables into the source code.
63
+ *
64
+ * @remarks
65
+ * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
66
+ */
67
+ alloy?: AlloyPluginOptions;
68
+ };
69
+ type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
70
+ env: EnvPluginOptions;
71
+ };
72
+ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
73
+ env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
74
+ /**
75
+ * The type definition for the expected env variable parameters
76
+ *
77
+ * @remarks
78
+ * This value is parsed from the {@link EnvPluginOptions.types} option.
79
+ */
80
+ types: TypeDefinition;
81
+ /**
82
+ * The type definition for the expected env secret parameters
83
+ *
84
+ * @remarks
85
+ * This value is parsed from the {@link EnvPluginOptions.secrets} option.
86
+ */
87
+ secrets: TypeDefinition;
88
+ /**
89
+ * Should the plugin inject the env variables in the source code with their values?
90
+ *
91
+ * @remarks
92
+ * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
93
+ */
94
+ inject: boolean;
95
+ /**
96
+ * Should the plugin validate the loaded environment variables against the provided type definitions?
97
+ *
98
+ * @remarks
99
+ * This value is the result of reflecting the {@link EnvPluginOptions.validate} option.
100
+ */
101
+ validate: boolean;
102
+ /**
103
+ * The prefix used for environment variables
104
+ *
105
+ * @remarks
106
+ * This value is used to filter environment variables that are loaded from the .env file and the process environment.
107
+ */
108
+ prefix: string[];
109
+ };
110
+ };
111
+ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
112
+ env: {
113
+ /**
114
+ * The type definitions reflection for the env variables and secrets
115
+ *
116
+ * @remarks
117
+ * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
118
+ */
119
+ types: {
120
+ /**
121
+ * The type definitions for the expected env variables
122
+ */
123
+ env: Reflection;
124
+ /**
125
+ * The type definitions for the expected env secrets
126
+ */
127
+ secrets: Reflection;
128
+ };
129
+ /**
130
+ * The current **used** environment variables and secrets reflection
131
+ *
132
+ * @remarks
133
+ * This reflection contains the structure of the current environment variables and secrets as defined during the plugin initialization by extracting the values from the source code.
134
+ */
135
+ used: {
136
+ /**
137
+ * The current env variables reflection
138
+ */
139
+ env: Reflection<EnvInterface>;
140
+ /**
141
+ * The current env secrets reflection
142
+ */
143
+ secrets: Reflection<SecretsInterface>;
144
+ };
145
+ /**
146
+ * The parsed .env configuration object
147
+ *
148
+ * @remarks
149
+ * This value is the result of loading the .env configuration file found in the project root directory and merging it with the values provided at {@link EnvPluginOptions.values}
150
+ */
151
+ parsed: DotenvParseOutput;
152
+ /**
153
+ * The injected environment variables and secrets reflection
154
+ *
155
+ * @remarks
156
+ * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
157
+ */
158
+ injected: Reflection;
159
+ };
160
+ }
161
+ declare type __ΩEnvType = any[];
162
+ declare type __ΩEnvPluginOptions = any[];
163
+ declare type __ΩEnvPluginUserConfig = any[];
164
+ declare type __ΩEnvPluginResolvedConfig = any[];
165
+ declare type __ΩEnvPluginContext = any[];
166
+ //#endregion
167
+ export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType };
168
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAyCY,OAAA;KAEA,gBAAA,GAAmB,KAAK;EAFxB;AAEZ;;EAA+B,KAAA,CAAA,EAIrB,uBAJqB;EAIrB;;;EA2CA,OAAA,CAAA,EAtCE,uBAsCF;EAQC;;;AAWX;;;EAES,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA;EAAgB;AAGzB;;;;EAEkB,MAAA,CAAA,EAAA,OAAA;EAAT;;;;;EAgBQ,QAAA,CAAA,EAAA,OAAA;EAAc;AA4B/B;;;;;EAiBW,aAAA,CAAA,EA/FO,QA+FP;EAKI;;;;;;EAmCD,KAAA,CAAA,EA/HJ,kBA+HI;EArDV;;;;;;WAlEO;;;;;;;UAQD;;KAGE,mBAAA,GAAsB,wBAChC;OACO;;KAGG,uBAAA,GAA0B,4BACpC;OACO,SAAS,KAAK,2CACjB,SAAS,KAAK;;;;;;;WAOL;;;;;;;aAQE;;;;;;;;;;;;;;;;;;;;;;;;UA4BA,yCACS,0BAA0B,iCAGhD,mBAAmB,kBACnB,mBAAmB;;;;;;;;;;;;WAYZ;;;;eAKI;;;;;;;;;;;;WAaJ,WAAW;;;;eAKP,WAAW;;;;;;;;YASd;;;;;;;cAQE"}
@@ -128,4 +128,5 @@ const __ΩEnvPluginContext = [
128
128
  ];
129
129
 
130
130
  //#endregion
131
- export { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType };
131
+ export { __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType };
132
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children } from \"@alloy-js/core\";\nimport { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n AlloyPluginContext,\n AlloyPluginOptions,\n AlloyPluginResolvedConfig,\n AlloyPluginUserConfig\n} from \"@powerlines/plugin-alloy/types\";\nimport { AutoMDPluginOptions } from \"@powerlines/plugin-automd/types/plugin\";\nimport {\n BabelPluginContext,\n BabelPluginOptions,\n BabelPluginResolvedConfig,\n BabelPluginUserConfig\n} from \"@powerlines/plugin-babel/types\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport {\n DotenvConfiguration,\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { EnvInterface, SecretsInterface } from \"./runtime\";\n\nexport type EnvType = \"env\" | \"secrets\";\n\nexport type EnvPluginOptions = Omit<DotenvConfiguration, \"types\"> & {\n /**\n * A path to the type definition for the expected env configuration parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `\":\"` or `\"#\"` character. For example: `\"./src/types/env.ts#ConfigConfiguration\"`.\n */\n types?: TypeDefinitionParameter;\n\n /**\n * A path to the type definition for the expected env secret parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `\":\"` or `\"#\"` character. For example: `\"./src/types/env.ts#ConfigSecrets\"`.\n */\n secrets?: TypeDefinitionParameter;\n\n /**\n * An additional prefix (or list of additional prefixes) to apply to the environment variables\n *\n * @remarks\n * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.\n */\n prefix?: string | string[];\n\n /**\n * Should the plugin inject the env variables in the source code with their values?\n *\n * @defaultValue false\n */\n inject?: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @defaultValue false\n */\n validate?: boolean;\n\n /**\n * The default configuration to use when loading environment variables.\n *\n * @remarks\n * This configuration is used as the base configuration when loading environment variables, and will be overridden by any values found in the `.env` file or the process environment.\n */\n defaultConfig?: Children;\n\n /**\n * Babel configuration options to use when injecting environment variables into the source code.\n *\n * @remarks\n * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.\n */\n babel?: BabelPluginOptions;\n\n /**\n * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.\n *\n * @remarks\n * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.\n */\n automd?: AutoMDPluginOptions;\n\n /**\n * Alloy configuration options to use when injecting environment variables into the source code.\n *\n * @remarks\n * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.\n */\n alloy?: AlloyPluginOptions;\n};\n\nexport type EnvPluginUserConfig = BabelPluginUserConfig &\n AlloyPluginUserConfig & {\n env: EnvPluginOptions;\n };\n\nexport type EnvPluginResolvedConfig = BabelPluginResolvedConfig &\n AlloyPluginResolvedConfig & {\n env: Required<Pick<DotenvConfiguration, \"additionalFiles\">> &\n Required<Pick<EnvPluginOptions, \"defaultConfig\">> & {\n /**\n * The type definition for the expected env variable parameters\n *\n * @remarks\n * This value is parsed from the {@link EnvPluginOptions.types} option.\n */\n types: TypeDefinition;\n\n /**\n * The type definition for the expected env secret parameters\n *\n * @remarks\n * This value is parsed from the {@link EnvPluginOptions.secrets} option.\n */\n secrets: TypeDefinition;\n\n /**\n * Should the plugin inject the env variables in the source code with their values?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.\n */\n inject: boolean;\n\n /**\n * Should the plugin validate the loaded environment variables against the provided type definitions?\n *\n * @remarks\n * This value is the result of reflecting the {@link EnvPluginOptions.validate} option.\n */\n validate: boolean;\n\n /**\n * The prefix used for environment variables\n *\n * @remarks\n * This value is used to filter environment variables that are loaded from the .env file and the process environment.\n */\n prefix: string[];\n };\n };\n\nexport interface EnvPluginContext<\n TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig\n>\n extends\n BabelPluginContext<TResolvedConfig>,\n AlloyPluginContext<TResolvedConfig> {\n env: {\n /**\n * The type definitions reflection for the env variables and secrets\n *\n * @remarks\n * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.\n */\n types: {\n /**\n * The type definitions for the expected env variables\n */\n env: Reflection;\n\n /**\n * The type definitions for the expected env secrets\n */\n secrets: Reflection;\n };\n\n /**\n * The current **used** environment variables and secrets reflection\n *\n * @remarks\n * This reflection contains the structure of the current environment variables and secrets as defined during the plugin initialization by extracting the values from the source code.\n */\n used: {\n /**\n * The current env variables reflection\n */\n env: Reflection<EnvInterface>;\n\n /**\n * The current env secrets reflection\n */\n secrets: Reflection<SecretsInterface>;\n };\n\n /**\n * The parsed .env configuration object\n *\n * @remarks\n * This value is the result of loading the .env configuration file found in the project root directory and merging it with the values provided at {@link EnvPluginOptions.values}\n */\n parsed: DotenvParseOutput;\n\n /**\n * The injected environment variables and secrets reflection\n *\n * @remarks\n * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.\n */\n injected: Reflection;\n };\n}\n"],"mappings":";;;;;;;AAAA,MAAM,UAAU;CAAC;CAAK;OAAW;OAAe;CAAY;CAAQ;CAAC;;;;;;AAErE,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAAY;;;;;;;AA0B/C,MAAM,aAAa;CAAC;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,sBAAqB;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE3B,MAAM,yBAAyB;OAAO;OAAC;OAAA;CAAA;CAAA;CAAA;CAAA;AAEvC,MAAM,6BAAC;OAAA;OAAA;OAAA;OAAA;CAAA;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEP,MAAM,sBAAU;OAAA;CAAA;OAAA;OAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}