@powerlines/plugin-nodejs 0.1.117 → 0.1.119

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 (194) hide show
  1. package/dist/components/env.cjs +14 -14
  2. package/dist/components/env.d.cts +1 -1
  3. package/dist/components/env.d.mts +1 -1
  4. package/dist/components/env.mjs +6 -6
  5. package/dist/index.cjs +8 -6
  6. package/dist/index.d.cts +1 -1
  7. package/dist/index.d.mts +1 -1
  8. package/dist/index.mjs +5 -5
  9. package/dist/types/plugin.d.cts +2 -2
  10. package/dist/types/plugin.d.mts +2 -2
  11. package/package.json +6 -6
  12. package/dist/deepkit/schemas/reflection.cjs +0 -3998
  13. package/dist/deepkit/schemas/reflection.d.cts +0 -1560
  14. package/dist/deepkit/schemas/reflection.d.mts +0 -1560
  15. package/dist/deepkit/schemas/reflection.mjs +0 -3996
  16. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  17. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  18. package/dist/deepkit/src/capnp.cjs +0 -913
  19. package/dist/deepkit/src/capnp.mjs +0 -911
  20. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  21. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  22. package/dist/deepkit/src/reflect-type.cjs +0 -22
  23. package/dist/deepkit/src/reflect-type.mjs +0 -20
  24. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  25. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  26. package/dist/deepkit/src/transformer.cjs +0 -52
  27. package/dist/deepkit/src/transformer.mjs +0 -49
  28. package/dist/deepkit/src/transpile.cjs +0 -29
  29. package/dist/deepkit/src/transpile.mjs +0 -27
  30. package/dist/deepkit/src/types.d.cts +0 -10
  31. package/dist/deepkit/src/types.d.mts +0 -10
  32. package/dist/deepkit/src/utilities.cjs +0 -67
  33. package/dist/deepkit/src/utilities.mjs +0 -66
  34. package/dist/plugin-alloy/src/core/components/output.cjs +0 -43
  35. package/dist/plugin-alloy/src/core/components/output.mjs +0 -42
  36. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  37. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  38. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  39. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  40. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  41. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  42. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -49
  43. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -44
  44. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  45. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  46. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  47. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  48. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  49. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  50. package/dist/plugin-alloy/src/index.cjs +0 -105
  51. package/dist/plugin-alloy/src/index.mjs +0 -103
  52. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
  53. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
  54. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
  55. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
  56. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -18
  57. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  58. package/dist/plugin-alloy/src/types/components.d.cts +0 -20
  59. package/dist/plugin-alloy/src/types/components.d.mts +0 -21
  60. package/dist/plugin-alloy/src/types/index.d.cts +0 -2
  61. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  62. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
  63. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
  64. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -62
  65. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -26
  66. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  67. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -61
  68. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -131
  69. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -129
  70. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -451
  71. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -37
  72. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -37
  73. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -442
  74. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -216
  75. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -16
  76. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -16
  77. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -213
  78. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -72
  79. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -4
  80. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -4
  81. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -71
  82. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  83. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  84. package/dist/plugin-automd/src/index.cjs +0 -101
  85. package/dist/plugin-automd/src/index.mjs +0 -98
  86. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  87. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  88. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  89. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  90. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  91. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  92. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  93. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  94. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  95. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  96. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  97. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  98. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  99. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  100. package/dist/plugin-babel/src/helpers/options.cjs +0 -49
  101. package/dist/plugin-babel/src/helpers/options.mjs +0 -46
  102. package/dist/plugin-babel/src/index.cjs +0 -85
  103. package/dist/plugin-babel/src/index.mjs +0 -83
  104. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  105. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  106. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  107. package/dist/plugin-env/src/babel/index.cjs +0 -1
  108. package/dist/plugin-env/src/babel/index.mjs +0 -3
  109. package/dist/plugin-env/src/babel/plugin.cjs +0 -70
  110. package/dist/plugin-env/src/babel/plugin.mjs +0 -69
  111. package/dist/plugin-env/src/components/docs.cjs +0 -70
  112. package/dist/plugin-env/src/components/docs.mjs +0 -69
  113. package/dist/plugin-env/src/components/env.cjs +0 -589
  114. package/dist/plugin-env/src/components/env.d.cts +0 -11
  115. package/dist/plugin-env/src/components/env.d.mts +0 -11
  116. package/dist/plugin-env/src/components/env.mjs +0 -586
  117. package/dist/plugin-env/src/components/index.cjs +0 -2
  118. package/dist/plugin-env/src/components/index.mjs +0 -4
  119. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  120. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  121. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  122. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  123. package/dist/plugin-env/src/helpers/docs-helper.cjs +0 -16
  124. package/dist/plugin-env/src/helpers/docs-helper.mjs +0 -15
  125. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  126. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  127. package/dist/plugin-env/src/helpers/load.cjs +0 -84
  128. package/dist/plugin-env/src/helpers/load.mjs +0 -81
  129. package/dist/plugin-env/src/helpers/persistence.cjs +0 -201
  130. package/dist/plugin-env/src/helpers/persistence.mjs +0 -190
  131. package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
  132. package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
  133. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  134. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  135. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  136. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  137. package/dist/plugin-env/src/index.cjs +0 -177
  138. package/dist/plugin-env/src/index.mjs +0 -175
  139. package/dist/plugin-env/src/types/plugin.d.cts +0 -149
  140. package/dist/plugin-env/src/types/plugin.d.mts +0 -150
  141. package/dist/plugin-env/src/types/runtime.d.cts +0 -789
  142. package/dist/plugin-env/src/types/runtime.d.mts +0 -789
  143. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  144. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  145. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -93
  146. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -91
  147. package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
  148. package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
  149. package/dist/powerlines/src/lib/entry.cjs +0 -11
  150. package/dist/powerlines/src/lib/entry.mjs +0 -13
  151. package/dist/powerlines/src/lib/logger.cjs +0 -41
  152. package/dist/powerlines/src/lib/logger.mjs +0 -39
  153. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +0 -38
  154. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +0 -35
  155. package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -3
  156. package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -5
  157. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -66
  158. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -65
  159. package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -46
  160. package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -45
  161. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -42
  162. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -40
  163. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -50
  164. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -49
  165. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -5
  166. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -5
  167. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  168. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  169. package/dist/powerlines/src/types/api.d.cts +0 -104
  170. package/dist/powerlines/src/types/api.d.mts +0 -104
  171. package/dist/powerlines/src/types/babel.d.cts +0 -22
  172. package/dist/powerlines/src/types/babel.d.mts +0 -22
  173. package/dist/powerlines/src/types/build.cjs +0 -21
  174. package/dist/powerlines/src/types/build.d.cts +0 -185
  175. package/dist/powerlines/src/types/build.d.mts +0 -185
  176. package/dist/powerlines/src/types/build.mjs +0 -21
  177. package/dist/powerlines/src/types/commands.d.cts +0 -8
  178. package/dist/powerlines/src/types/commands.d.mts +0 -9
  179. package/dist/powerlines/src/types/config.d.cts +0 -435
  180. package/dist/powerlines/src/types/config.d.mts +0 -436
  181. package/dist/powerlines/src/types/context.d.cts +0 -514
  182. package/dist/powerlines/src/types/context.d.mts +0 -514
  183. package/dist/powerlines/src/types/fs.d.cts +0 -486
  184. package/dist/powerlines/src/types/fs.d.mts +0 -486
  185. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  186. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  187. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  188. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  189. package/dist/powerlines/src/types/resolved.d.cts +0 -94
  190. package/dist/powerlines/src/types/resolved.d.mts +0 -94
  191. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  192. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  193. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  194. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
@@ -1,149 +0,0 @@
1
- import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.cjs";
2
- import { Reflection } from "../../../deepkit/src/types.cjs";
3
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "../../../plugin-alloy/src/types/plugin.cjs";
4
- import "../../../plugin-alloy/src/types/index.cjs";
5
- import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
6
- import { EnvInterface, SecretsInterface } from "./runtime.cjs";
7
- import { Children } from "@alloy-js/core";
8
- import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
9
- import { DotenvParseOutput } from "@stryke/env/types";
10
-
11
- //#region ../plugin-env/src/types/plugin.d.ts
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
- * The default configuration to use when loading environment variables.
36
- *
37
- * @remarks
38
- * 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.
39
- */
40
- defaultConfig?: Children;
41
- /**
42
- * Babel configuration options to use when injecting environment variables into the source code.
43
- *
44
- * @remarks
45
- * 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.
46
- */
47
- babel?: BabelPluginOptions;
48
- /**
49
- * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
50
- *
51
- * @remarks
52
- * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
53
- */
54
- automd?: AutoMDPluginOptions;
55
- /**
56
- * Alloy configuration options to use when injecting environment variables into the source code.
57
- *
58
- * @remarks
59
- * 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.
60
- */
61
- alloy?: AlloyPluginOptions;
62
- };
63
- type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
64
- env: EnvPluginOptions;
65
- };
66
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
67
- env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
68
- /**
69
- * The type definition for the expected env variable parameters
70
- *
71
- * @remarks
72
- * This value is parsed from the {@link EnvPluginOptions.types} option.
73
- */
74
- types: TypeDefinition;
75
- /**
76
- * The type definition for the expected env secret parameters
77
- *
78
- * @remarks
79
- * This value is parsed from the {@link EnvPluginOptions.secrets} option.
80
- */
81
- secrets: TypeDefinition;
82
- /**
83
- * Should the plugin inject the env variables in the source code with their values?
84
- *
85
- * @remarks
86
- * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
87
- */
88
- inject: EnvPluginOptions["inject"];
89
- /**
90
- * The prefix used for environment variables
91
- *
92
- * @remarks
93
- * This value is used to filter environment variables that are loaded from the .env file and the process environment.
94
- */
95
- prefix: string[];
96
- };
97
- };
98
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
99
- env: {
100
- /**
101
- * The type definitions reflection for the env variables and secrets
102
- *
103
- * @remarks
104
- * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
105
- */
106
- types: {
107
- /**
108
- * The type definitions for the expected env variables
109
- */
110
- env: Reflection;
111
- /**
112
- * The type definitions for the expected env secrets
113
- */
114
- secrets: Reflection;
115
- };
116
- /**
117
- * The current **used** environment variables and secrets reflection
118
- *
119
- * @remarks
120
- * 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.
121
- */
122
- used: {
123
- /**
124
- * The current env variables reflection
125
- */
126
- env: Reflection<EnvInterface>;
127
- /**
128
- * The current env secrets reflection
129
- */
130
- secrets: Reflection<SecretsInterface>;
131
- };
132
- /**
133
- * The parsed .env configuration object
134
- *
135
- * @remarks
136
- * 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}
137
- */
138
- parsed: DotenvParseOutput;
139
- /**
140
- * The injected environment variables and secrets reflection
141
- *
142
- * @remarks
143
- * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
144
- */
145
- injected: Reflection;
146
- };
147
- }
148
- //#endregion
149
- export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig };
@@ -1,150 +0,0 @@
1
- import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.mjs";
2
- import { Reflection } from "../../../deepkit/src/types.mjs";
3
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "../../../plugin-alloy/src/types/plugin.mjs";
4
- import "../../../plugin-alloy/src/types/index.mjs";
5
- import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.mjs";
6
- import "../../../plugin-babel/src/types/index.mjs";
7
- import { EnvInterface, SecretsInterface } from "./runtime.mjs";
8
- import { Children } from "@alloy-js/core";
9
- import { DotenvParseOutput } from "@stryke/env/types";
10
- import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
11
-
12
- //#region ../plugin-env/src/types/plugin.d.ts
13
- type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
14
- /**
15
- * 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"`.
16
- */
17
- types?: TypeDefinitionParameter;
18
- /**
19
- * 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"`.
20
- */
21
- secrets?: TypeDefinitionParameter;
22
- /**
23
- * An additional prefix (or list of additional prefixes) to apply to the environment variables
24
- *
25
- * @remarks
26
- * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
27
- */
28
- prefix?: string | string[];
29
- /**
30
- * Should the plugin inject the env variables in the source code with their values?
31
- *
32
- * @defaultValue false
33
- */
34
- inject?: boolean;
35
- /**
36
- * The default configuration to use when loading environment variables.
37
- *
38
- * @remarks
39
- * 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.
40
- */
41
- defaultConfig?: Children;
42
- /**
43
- * Babel configuration options to use when injecting environment variables into the source code.
44
- *
45
- * @remarks
46
- * 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.
47
- */
48
- babel?: BabelPluginOptions;
49
- /**
50
- * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
51
- *
52
- * @remarks
53
- * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
54
- */
55
- automd?: AutoMDPluginOptions;
56
- /**
57
- * Alloy configuration options to use when injecting environment variables into the source code.
58
- *
59
- * @remarks
60
- * 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.
61
- */
62
- alloy?: AlloyPluginOptions;
63
- };
64
- type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
65
- env: EnvPluginOptions;
66
- };
67
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
68
- env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
69
- /**
70
- * The type definition for the expected env variable parameters
71
- *
72
- * @remarks
73
- * This value is parsed from the {@link EnvPluginOptions.types} option.
74
- */
75
- types: TypeDefinition;
76
- /**
77
- * The type definition for the expected env secret parameters
78
- *
79
- * @remarks
80
- * This value is parsed from the {@link EnvPluginOptions.secrets} option.
81
- */
82
- secrets: TypeDefinition;
83
- /**
84
- * Should the plugin inject the env variables in the source code with their values?
85
- *
86
- * @remarks
87
- * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
88
- */
89
- inject: EnvPluginOptions["inject"];
90
- /**
91
- * The prefix used for environment variables
92
- *
93
- * @remarks
94
- * This value is used to filter environment variables that are loaded from the .env file and the process environment.
95
- */
96
- prefix: string[];
97
- };
98
- };
99
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
100
- env: {
101
- /**
102
- * The type definitions reflection for the env variables and secrets
103
- *
104
- * @remarks
105
- * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
106
- */
107
- types: {
108
- /**
109
- * The type definitions for the expected env variables
110
- */
111
- env: Reflection;
112
- /**
113
- * The type definitions for the expected env secrets
114
- */
115
- secrets: Reflection;
116
- };
117
- /**
118
- * The current **used** environment variables and secrets reflection
119
- *
120
- * @remarks
121
- * 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.
122
- */
123
- used: {
124
- /**
125
- * The current env variables reflection
126
- */
127
- env: Reflection<EnvInterface>;
128
- /**
129
- * The current env secrets reflection
130
- */
131
- secrets: Reflection<SecretsInterface>;
132
- };
133
- /**
134
- * The parsed .env configuration object
135
- *
136
- * @remarks
137
- * 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}
138
- */
139
- parsed: DotenvParseOutput;
140
- /**
141
- * The injected environment variables and secrets reflection
142
- *
143
- * @remarks
144
- * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
145
- */
146
- injected: Reflection;
147
- };
148
- }
149
- //#endregion
150
- export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig };