@powerlines/plugin-react 0.1.132 → 0.1.133

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 (210) hide show
  1. package/dist/components/index.cjs +3 -2
  2. package/dist/components/index.d.cts +3 -1
  3. package/dist/components/index.d.mts +4 -1
  4. package/dist/components/index.mjs +2 -1
  5. package/dist/components/react-optimized.cjs +2 -48
  6. package/dist/components/react-optimized.d.cts +2 -13
  7. package/dist/components/react-optimized.d.mts +3 -13
  8. package/dist/components/react-optimized.mjs +1 -45
  9. package/dist/components-BWLXb7a2.cjs +0 -0
  10. package/dist/{plugin-alloy/src/types/components.d.cts → components-Bs3-ohmM.d.mts} +2 -1
  11. package/dist/components-D-mbfYAe.mjs +1 -0
  12. package/dist/index-B8OHl-c_.d.mts +1 -0
  13. package/dist/index-CFG0_wK4.d.cts +1 -0
  14. package/dist/index-DNLi60D-.d.mts +1 -0
  15. package/dist/index-_wQ5ClJU.d.cts +1 -0
  16. package/dist/index.cjs +11298 -19
  17. package/dist/index.d.cts +7 -5
  18. package/dist/index.d.mts +8 -6
  19. package/dist/index.mjs +11282 -9
  20. package/dist/{deepkit/schemas/reflection.d.mts → plugin-BaOVS_rV.d.cts} +331 -1
  21. package/dist/{deepkit/schemas/reflection.d.cts → plugin-D7LpFbdk.d.mts} +389 -59
  22. package/dist/plugin-jZ9N9Mz-.mjs +1 -0
  23. package/dist/plugin-pBKbb5K9.cjs +0 -0
  24. package/dist/react-optimized-BpFTLlx0.mjs +937 -0
  25. package/dist/react-optimized-C_OVnrX3.d.cts +105 -0
  26. package/dist/react-optimized-Kv14o38g.cjs +1078 -0
  27. package/dist/react-optimized-oMkTiRKU.d.mts +88 -0
  28. package/dist/resolved-BmaQR2AE.d.mts +1789 -0
  29. package/dist/resolved-DaJ9lL_Z.d.cts +1788 -0
  30. package/dist/runtime-BKY6WvHV.mjs +1 -0
  31. package/dist/{plugin-env/src/types/runtime.d.mts → runtime-BjubXOjV.d.mts} +2 -2
  32. package/dist/runtime-Bp9G0scd.cjs +0 -0
  33. package/dist/{plugin-env/src/types/runtime.d.cts → runtime-CAI6R3zb.d.cts} +2 -2
  34. package/dist/runtime-DWYeFyQG.d.cts +15 -0
  35. package/dist/runtime-YmyzXCJq.d.mts +15 -0
  36. package/dist/types/index.cjs +3 -0
  37. package/dist/types/index.d.cts +5 -2
  38. package/dist/types/index.d.mts +6 -2
  39. package/dist/types/index.mjs +4 -0
  40. package/dist/types/plugin.cjs +1 -0
  41. package/dist/types/plugin.d.cts +3 -72
  42. package/dist/types/plugin.d.mts +4 -72
  43. package/dist/types/plugin.mjs +2 -0
  44. package/dist/types/runtime.cjs +1 -0
  45. package/dist/types/runtime.d.cts +3 -14
  46. package/dist/types/runtime.d.mts +3 -14
  47. package/dist/types/runtime.mjs +2 -0
  48. package/dist/types--fVOUYBq.mjs +1 -0
  49. package/dist/types-a8gm_IaQ.cjs +0 -0
  50. package/package.json +5 -5
  51. package/dist/_virtual/rolldown_runtime.cjs +0 -37
  52. package/dist/_virtual/rolldown_runtime.mjs +0 -29
  53. package/dist/deepkit/schemas/reflection.cjs +0 -3940
  54. package/dist/deepkit/schemas/reflection.mjs +0 -3938
  55. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  56. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  57. package/dist/deepkit/src/capnp.cjs +0 -913
  58. package/dist/deepkit/src/capnp.mjs +0 -911
  59. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  60. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  61. package/dist/deepkit/src/reflect-type.cjs +0 -22
  62. package/dist/deepkit/src/reflect-type.mjs +0 -20
  63. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  64. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  65. package/dist/deepkit/src/transformer.cjs +0 -52
  66. package/dist/deepkit/src/transformer.mjs +0 -49
  67. package/dist/deepkit/src/transpile.cjs +0 -29
  68. package/dist/deepkit/src/transpile.mjs +0 -27
  69. package/dist/deepkit/src/types.d.cts +0 -10
  70. package/dist/deepkit/src/types.d.mts +0 -10
  71. package/dist/deepkit/src/utilities.cjs +0 -66
  72. package/dist/deepkit/src/utilities.mjs +0 -65
  73. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
  74. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
  75. package/dist/deepkit/src/vendor/type.cjs +0 -20
  76. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  77. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  78. package/dist/deepkit/src/vendor/type.mjs +0 -11
  79. package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
  80. package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
  81. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  82. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  83. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  84. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  85. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  86. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  87. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
  88. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
  89. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  90. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  91. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  92. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  93. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  94. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  95. package/dist/plugin-alloy/src/index.cjs +0 -93
  96. package/dist/plugin-alloy/src/index.mjs +0 -91
  97. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -7
  98. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -9
  99. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -5
  100. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -7
  101. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -17
  102. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  103. package/dist/plugin-alloy/src/types/components.d.mts +0 -25
  104. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  105. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
  106. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
  107. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
  108. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -25
  109. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  110. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
  111. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
  112. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
  113. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
  114. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -27
  115. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -28
  116. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
  117. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -194
  118. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -14
  119. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -15
  120. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -191
  121. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
  122. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
  123. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  124. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  125. package/dist/plugin-automd/src/index.cjs +0 -101
  126. package/dist/plugin-automd/src/index.mjs +0 -98
  127. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  128. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  129. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  130. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  131. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  132. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  133. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  134. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  135. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  136. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  137. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  138. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  139. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  140. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  141. package/dist/plugin-babel/src/helpers/options.cjs +0 -50
  142. package/dist/plugin-babel/src/helpers/options.mjs +0 -47
  143. package/dist/plugin-babel/src/index.cjs +0 -91
  144. package/dist/plugin-babel/src/index.mjs +0 -89
  145. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  146. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  147. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  148. package/dist/plugin-env/src/babel/index.cjs +0 -1
  149. package/dist/plugin-env/src/babel/index.mjs +0 -3
  150. package/dist/plugin-env/src/babel/plugin.cjs +0 -121
  151. package/dist/plugin-env/src/babel/plugin.mjs +0 -119
  152. package/dist/plugin-env/src/components/docs.cjs +0 -9
  153. package/dist/plugin-env/src/components/docs.mjs +0 -11
  154. package/dist/plugin-env/src/components/env.cjs +0 -575
  155. package/dist/plugin-env/src/components/env.mjs +0 -572
  156. package/dist/plugin-env/src/components/index.cjs +0 -2
  157. package/dist/plugin-env/src/components/index.mjs +0 -4
  158. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  159. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  160. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  161. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  162. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  163. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  164. package/dist/plugin-env/src/helpers/load.cjs +0 -83
  165. package/dist/plugin-env/src/helpers/load.mjs +0 -80
  166. package/dist/plugin-env/src/helpers/persistence.cjs +0 -200
  167. package/dist/plugin-env/src/helpers/persistence.mjs +0 -189
  168. package/dist/plugin-env/src/helpers/reflect.cjs +0 -111
  169. package/dist/plugin-env/src/helpers/reflect.mjs +0 -103
  170. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  171. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  172. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  173. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  174. package/dist/plugin-env/src/index.cjs +0 -175
  175. package/dist/plugin-env/src/index.mjs +0 -173
  176. package/dist/plugin-env/src/types/plugin.d.cts +0 -151
  177. package/dist/plugin-env/src/types/plugin.d.mts +0 -153
  178. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
  179. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
  180. package/dist/powerlines/src/lib/entry.cjs +0 -12
  181. package/dist/powerlines/src/lib/entry.mjs +0 -14
  182. package/dist/powerlines/src/lib/logger.cjs +0 -41
  183. package/dist/powerlines/src/lib/logger.mjs +0 -39
  184. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +0 -38
  185. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +0 -35
  186. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
  187. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
  188. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
  189. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
  190. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  191. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  192. package/dist/powerlines/src/types/babel.d.cts +0 -22
  193. package/dist/powerlines/src/types/babel.d.mts +0 -22
  194. package/dist/powerlines/src/types/build.d.cts +0 -145
  195. package/dist/powerlines/src/types/build.d.mts +0 -145
  196. package/dist/powerlines/src/types/commands.d.cts +0 -8
  197. package/dist/powerlines/src/types/commands.d.mts +0 -9
  198. package/dist/powerlines/src/types/config.d.cts +0 -380
  199. package/dist/powerlines/src/types/config.d.mts +0 -381
  200. package/dist/powerlines/src/types/context.d.cts +0 -414
  201. package/dist/powerlines/src/types/context.d.mts +0 -416
  202. package/dist/powerlines/src/types/fs.d.cts +0 -486
  203. package/dist/powerlines/src/types/fs.d.mts +0 -486
  204. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  205. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  206. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  207. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  208. package/dist/powerlines/src/types/resolved.d.mts +0 -82
  209. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  210. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
@@ -1,151 +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 { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
5
- import { EnvInterface, SecretsInterface } from "./runtime.cjs";
6
- import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
7
- import { Children } from "@alloy-js/core/jsx-runtime";
8
- import { DotenvParseOutput } from "@stryke/env/types";
9
-
10
- //#region ../plugin-env/src/types/plugin.d.ts
11
- type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
12
- /**
13
- * 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"`.
14
- */
15
- types?: TypeDefinitionParameter;
16
- /**
17
- * 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"`.
18
- */
19
- secrets?: TypeDefinitionParameter;
20
- /**
21
- * An additional prefix (or list of additional prefixes) to apply to the environment variables
22
- *
23
- * @remarks
24
- * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
25
- */
26
- prefix?: string | string[];
27
- /**
28
- * Should the plugin inject the env variables in the source code with their values?
29
- *
30
- * @remarks
31
- * This option is set to `true` when building an application project.
32
- *
33
- * @defaultValue false
34
- */
35
- inject?: boolean;
36
- /**
37
- * The default configuration to use when loading environment variables.
38
- *
39
- * @remarks
40
- * 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.
41
- */
42
- defaultConfig?: Children;
43
- /**
44
- * Babel configuration options to use when injecting environment variables into the source code.
45
- *
46
- * @remarks
47
- * 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.
48
- */
49
- babel?: BabelPluginOptions;
50
- /**
51
- * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
52
- *
53
- * @remarks
54
- * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
55
- */
56
- automd?: AutoMDPluginOptions;
57
- /**
58
- * Alloy configuration options to use when injecting environment variables into the source code.
59
- *
60
- * @remarks
61
- * 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.
62
- */
63
- alloy?: AlloyPluginOptions;
64
- };
65
- type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
66
- env: EnvPluginOptions;
67
- };
68
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
69
- env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
70
- /**
71
- * The type definition for the expected env variable parameters
72
- *
73
- * @remarks
74
- * This value is parsed from the {@link EnvPluginOptions.types} option.
75
- */
76
- types: TypeDefinition;
77
- /**
78
- * The type definition for the expected env secret parameters
79
- *
80
- * @remarks
81
- * This value is parsed from the {@link EnvPluginOptions.secrets} option.
82
- */
83
- secrets: TypeDefinition;
84
- /**
85
- * Should the plugin inject the env variables in the source code with their values?
86
- *
87
- * @remarks
88
- * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
89
- */
90
- inject: EnvPluginOptions["inject"];
91
- /**
92
- * The prefix used for environment variables
93
- *
94
- * @remarks
95
- * This value is used to filter environment variables that are loaded from the .env file and the process environment.
96
- */
97
- prefix: string[];
98
- };
99
- };
100
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
101
- env: {
102
- /**
103
- * The type definitions reflection for the env variables and secrets
104
- *
105
- * @remarks
106
- * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
107
- */
108
- types: {
109
- /**
110
- * The type definitions for the expected env variables
111
- */
112
- env: Reflection;
113
- /**
114
- * The type definitions for the expected env secrets
115
- */
116
- secrets: Reflection;
117
- };
118
- /**
119
- * The current **used** environment variables and secrets reflection
120
- *
121
- * @remarks
122
- * 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.
123
- */
124
- used: {
125
- /**
126
- * The current env variables reflection
127
- */
128
- env: Reflection<EnvInterface>;
129
- /**
130
- * The current env secrets reflection
131
- */
132
- secrets: Reflection<SecretsInterface>;
133
- };
134
- /**
135
- * The parsed .env configuration object
136
- *
137
- * @remarks
138
- * 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}
139
- */
140
- parsed: DotenvParseOutput;
141
- /**
142
- * The injected environment variables and secrets reflection
143
- *
144
- * @remarks
145
- * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
146
- */
147
- injected: Reflection;
148
- };
149
- }
150
- //#endregion
151
- export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig };
@@ -1,153 +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/jsx-runtime";
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
- * @remarks
33
- * This option is set to `true` when building an application project.
34
- *
35
- * @defaultValue false
36
- */
37
- inject?: boolean;
38
- /**
39
- * The default configuration to use when loading environment variables.
40
- *
41
- * @remarks
42
- * 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.
43
- */
44
- defaultConfig?: Children;
45
- /**
46
- * Babel configuration options to use when injecting environment variables into the source code.
47
- *
48
- * @remarks
49
- * 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.
50
- */
51
- babel?: BabelPluginOptions;
52
- /**
53
- * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
54
- *
55
- * @remarks
56
- * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
57
- */
58
- automd?: AutoMDPluginOptions;
59
- /**
60
- * Alloy configuration options to use when injecting environment variables into the source code.
61
- *
62
- * @remarks
63
- * 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.
64
- */
65
- alloy?: AlloyPluginOptions;
66
- };
67
- type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
68
- env: EnvPluginOptions;
69
- };
70
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
71
- env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
72
- /**
73
- * The type definition for the expected env variable parameters
74
- *
75
- * @remarks
76
- * This value is parsed from the {@link EnvPluginOptions.types} option.
77
- */
78
- types: TypeDefinition;
79
- /**
80
- * The type definition for the expected env secret parameters
81
- *
82
- * @remarks
83
- * This value is parsed from the {@link EnvPluginOptions.secrets} option.
84
- */
85
- secrets: TypeDefinition;
86
- /**
87
- * Should the plugin inject the env variables in the source code with their values?
88
- *
89
- * @remarks
90
- * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
91
- */
92
- inject: EnvPluginOptions["inject"];
93
- /**
94
- * The prefix used for environment variables
95
- *
96
- * @remarks
97
- * This value is used to filter environment variables that are loaded from the .env file and the process environment.
98
- */
99
- prefix: string[];
100
- };
101
- };
102
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
103
- env: {
104
- /**
105
- * The type definitions reflection for the env variables and secrets
106
- *
107
- * @remarks
108
- * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
109
- */
110
- types: {
111
- /**
112
- * The type definitions for the expected env variables
113
- */
114
- env: Reflection;
115
- /**
116
- * The type definitions for the expected env secrets
117
- */
118
- secrets: Reflection;
119
- };
120
- /**
121
- * The current **used** environment variables and secrets reflection
122
- *
123
- * @remarks
124
- * 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.
125
- */
126
- used: {
127
- /**
128
- * The current env variables reflection
129
- */
130
- env: Reflection<EnvInterface>;
131
- /**
132
- * The current env secrets reflection
133
- */
134
- secrets: Reflection<SecretsInterface>;
135
- };
136
- /**
137
- * The parsed .env configuration object
138
- *
139
- * @remarks
140
- * 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}
141
- */
142
- parsed: DotenvParseOutput;
143
- /**
144
- * The injected environment variables and secrets reflection
145
- *
146
- * @remarks
147
- * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
148
- */
149
- injected: Reflection;
150
- };
151
- }
152
- //#endregion
153
- export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig };
@@ -1,102 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- require('../entry.cjs');
3
- let defu = require("defu");
4
- defu = require_rolldown_runtime.__toESM(defu);
5
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
6
- let __stryke_path_replace = require("@stryke/path/replace");
7
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
8
- let __stryke_helpers_omit = require("@stryke/helpers/omit");
9
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
10
-
11
- //#region ../powerlines/src/lib/build/esbuild.ts
12
- const DEFAULT_ESBUILD_CONFIG = {
13
- target: "esnext",
14
- platform: "neutral",
15
- format: "esm",
16
- write: true,
17
- minify: true,
18
- sourcemap: false,
19
- bundle: true,
20
- treeShaking: true,
21
- keepNames: true,
22
- splitting: true,
23
- logLevel: "silent"
24
- };
25
- /**
26
- * Resolves the esbuild options.
27
- *
28
- * @param context - The build context.
29
- * @returns The resolved esbuild options.
30
- */
31
- function extractESBuildConfig(context) {
32
- const inject = context.config.build.override.inject ?? context.config.build.inject;
33
- if (inject && Object.keys(inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
34
- if (value) if (Array.isArray(value)) {
35
- if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
36
- if (value.length === 1) return `
37
- import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
38
- export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
39
- else if (value.length > 1) return `
40
- import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
41
- export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
42
- } else if (value.length === 1) return `
43
- import ${key} from "${value[0]}";
44
- export { ${key} };`;
45
- else if (value.length > 1) return `
46
- import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
47
- export { ${key} };`;
48
- } else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
49
- import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
50
- export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
51
- else return `
52
- import ${key} from "${value}";
53
- export { ${key} };`;
54
- return "";
55
- }).join("\n"));
56
- return (0, defu.default)({
57
- alias: context.builtins.reduce((ret, id) => {
58
- if (!ret[id]) {
59
- const path = context.fs.ids[id];
60
- if (path) ret[id] = path;
61
- }
62
- return ret;
63
- }, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
64
- if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
65
- return ret;
66
- }, {}) : context.config.build.alias : {}),
67
- inject: inject && Object.keys(inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
68
- }, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
69
- "alias",
70
- "inject",
71
- "external",
72
- "noExternal",
73
- "skipNodeModulesBundle",
74
- "extensions"
75
- ]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
76
- "alias",
77
- "inject",
78
- "external",
79
- "noExternal",
80
- "skipNodeModulesBundle",
81
- "extensions",
82
- "variant",
83
- "override"
84
- ]) : {}, {
85
- mainFields: context.config.build.mainFields,
86
- conditions: context.config.build.conditions,
87
- define: context.config.build.define,
88
- resolveExtensions: context.config.build.extensions,
89
- packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
90
- format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
91
- platform: context.config.build.platform,
92
- treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
93
- outdir: context.config.output.buildPath,
94
- tsconfig: context.tsconfig.tsconfigFilePath,
95
- minify: context.config.mode !== "development",
96
- metafile: context.config.mode === "development",
97
- sourcemap: context.config.mode === "development"
98
- }, DEFAULT_ESBUILD_CONFIG);
99
- }
100
-
101
- //#endregion
102
- exports.extractESBuildConfig = extractESBuildConfig;
@@ -1,100 +0,0 @@
1
- import "../entry.mjs";
2
- import defu from "defu";
3
- import { isString } from "@stryke/type-checks/is-string";
4
- import { replaceExtension, replacePath } from "@stryke/path/replace";
5
- import { joinPaths } from "@stryke/path/join-paths";
6
- import { omit } from "@stryke/helpers/omit";
7
- import { camelCase } from "@stryke/string-format/camel-case";
8
-
9
- //#region ../powerlines/src/lib/build/esbuild.ts
10
- const DEFAULT_ESBUILD_CONFIG = {
11
- target: "esnext",
12
- platform: "neutral",
13
- format: "esm",
14
- write: true,
15
- minify: true,
16
- sourcemap: false,
17
- bundle: true,
18
- treeShaking: true,
19
- keepNames: true,
20
- splitting: true,
21
- logLevel: "silent"
22
- };
23
- /**
24
- * Resolves the esbuild options.
25
- *
26
- * @param context - The build context.
27
- * @returns The resolved esbuild options.
28
- */
29
- function extractESBuildConfig(context) {
30
- const inject = context.config.build.override.inject ?? context.config.build.inject;
31
- if (inject && Object.keys(inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
32
- if (value) if (Array.isArray(value)) {
33
- if (camelCase(key) !== key) {
34
- if (value.length === 1) return `
35
- import ${camelCase(key)} from "${value[0]}";
36
- export { ${camelCase(key)} as "${key}" }`;
37
- else if (value.length > 1) return `
38
- import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
39
- export { ${camelCase(key)} as "${key}" }`;
40
- } else if (value.length === 1) return `
41
- import ${key} from "${value[0]}";
42
- export { ${key} };`;
43
- else if (value.length > 1) return `
44
- import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
45
- export { ${key} };`;
46
- } else if (camelCase(key) !== key) return `
47
- import ${camelCase(key)} from "${value[0]}";
48
- export { ${camelCase(key)} as "${key}" }`;
49
- else return `
50
- import ${key} from "${value}";
51
- export { ${key} };`;
52
- return "";
53
- }).join("\n"));
54
- return defu({
55
- alias: context.builtins.reduce((ret, id) => {
56
- if (!ret[id]) {
57
- const path = context.fs.ids[id];
58
- if (path) ret[id] = path;
59
- }
60
- return ret;
61
- }, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
62
- if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
63
- return ret;
64
- }, {}) : context.config.build.alias : {}),
65
- inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
66
- }, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
67
- "alias",
68
- "inject",
69
- "external",
70
- "noExternal",
71
- "skipNodeModulesBundle",
72
- "extensions"
73
- ]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
74
- "alias",
75
- "inject",
76
- "external",
77
- "noExternal",
78
- "skipNodeModulesBundle",
79
- "extensions",
80
- "variant",
81
- "override"
82
- ]) : {}, {
83
- mainFields: context.config.build.mainFields,
84
- conditions: context.config.build.conditions,
85
- define: context.config.build.define,
86
- resolveExtensions: context.config.build.extensions,
87
- packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
88
- format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
89
- platform: context.config.build.platform,
90
- treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
91
- outdir: context.config.output.buildPath,
92
- tsconfig: context.tsconfig.tsconfigFilePath,
93
- minify: context.config.mode !== "development",
94
- metafile: context.config.mode === "development",
95
- sourcemap: context.config.mode === "development"
96
- }, DEFAULT_ESBUILD_CONFIG);
97
- }
98
-
99
- //#endregion
100
- export { extractESBuildConfig };
@@ -1,12 +0,0 @@
1
- require('../plugin-utils/paths.cjs');
2
- let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
3
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
4
- let __stryke_path_replace = require("@stryke/path/replace");
5
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
6
- let __stryke_fs_is_file = require("@stryke/fs/is-file");
7
- let __stryke_fs_list_files = require("@stryke/fs/list-files");
8
- let __stryke_path_append = require("@stryke/path/append");
9
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
10
- let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
11
- let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
12
- require("@stryke/hash/murmurhash");
@@ -1,14 +0,0 @@
1
- import "../plugin-utils/paths.mjs";
2
- import { isSetString } from "@stryke/type-checks/is-set-string";
3
- import { isString } from "@stryke/type-checks/is-string";
4
- import { replaceExtension, replacePath } from "@stryke/path/replace";
5
- import { toArray } from "@stryke/convert/to-array";
6
- import "@stryke/fs/is-file";
7
- import { listFiles } from "@stryke/fs/list-files";
8
- import { appendPath } from "@stryke/path/append";
9
- import { joinPaths } from "@stryke/path/join-paths";
10
- import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
11
- import { getUniqueBy } from "@stryke/helpers/get-unique";
12
- import "@stryke/hash/murmurhash";
13
-
14
- export { };
@@ -1,41 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
3
- let chalk = require("chalk");
4
- chalk = require_rolldown_runtime.__toESM(chalk);
5
- require("@storm-software/config-tools/logger");
6
- require("@storm-software/config-tools/utilities/colors");
7
- require("@stryke/helpers/noop");
8
- let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
10
-
11
- //#region ../powerlines/src/lib/logger.ts
12
- const BADGE_COLORS = [
13
- "#00A0DD",
14
- "#6FCE4E",
15
- "#FBBF24",
16
- "#F43F5E",
17
- "#3B82F6",
18
- "#A855F7",
19
- "#469592",
20
- "#288EDF",
21
- "#D8B4FE",
22
- "#10B981",
23
- "#EF4444",
24
- "#F0EC56",
25
- "#F472B6",
26
- "#22D3EE",
27
- "#EAB308",
28
- "#84CC16",
29
- "#F87171",
30
- "#0EA5E9",
31
- "#D946EF",
32
- "#FACC15",
33
- "#34D399",
34
- "#8B5CF6"
35
- ];
36
- const extendLog = (logFn, name) => {
37
- return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
38
- };
39
-
40
- //#endregion
41
- exports.extendLog = extendLog;
@@ -1,39 +0,0 @@
1
- import { LogLevelLabel } from "@storm-software/config-tools/types";
2
- import chalk from "chalk";
3
- import "@storm-software/config-tools/logger";
4
- import "@storm-software/config-tools/utilities/colors";
5
- import "@stryke/helpers/noop";
6
- import { kebabCase } from "@stryke/string-format/kebab-case";
7
- import { titleCase } from "@stryke/string-format/title-case";
8
-
9
- //#region ../powerlines/src/lib/logger.ts
10
- const BADGE_COLORS = [
11
- "#00A0DD",
12
- "#6FCE4E",
13
- "#FBBF24",
14
- "#F43F5E",
15
- "#3B82F6",
16
- "#A855F7",
17
- "#469592",
18
- "#288EDF",
19
- "#D8B4FE",
20
- "#10B981",
21
- "#EF4444",
22
- "#F0EC56",
23
- "#F472B6",
24
- "#22D3EE",
25
- "#EAB308",
26
- "#84CC16",
27
- "#F87171",
28
- "#0EA5E9",
29
- "#D946EF",
30
- "#FACC15",
31
- "#34D399",
32
- "#8B5CF6"
33
- ];
34
- const extendLog = (logFn, name) => {
35
- return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
36
- };
37
-
38
- //#endregion
39
- export { extendLog };
@@ -1,38 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- let defu = require("defu");
3
- defu = require_rolldown_runtime.__toESM(defu);
4
- let __stryke_path_append = require("@stryke/path/append");
5
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
6
- let __stryke_fs_exists = require("@stryke/fs/exists");
7
- let typescript = require("typescript");
8
- typescript = require_rolldown_runtime.__toESM(typescript);
9
- require("@stryke/fs/json");
10
-
11
- //#region ../powerlines/src/lib/typescript/tsconfig.ts
12
- /**
13
- * Check if the TypeScript configuration type matches any of the provided types.
14
- *
15
- * @param tsconfigType - The type from the TypeScript configuration.
16
- * @param types - An array of type names to check against.
17
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
18
- */
19
- function findMatch(tsconfigType, types, extensions = [
20
- ".ts",
21
- ".tsx",
22
- ".d.ts"
23
- ]) {
24
- return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
25
- }
26
- /**
27
- * Check if the TypeScript configuration type matches any of the provided types.
28
- *
29
- * @param tsconfigType - The type from the TypeScript configuration.
30
- * @param types - An array of type names to check against.
31
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
32
- */
33
- function isMatchFound(tsconfigType, types) {
34
- return findMatch(tsconfigType, types) !== void 0;
35
- }
36
-
37
- //#endregion
38
- exports.isMatchFound = isMatchFound;