@powerlines/plugin-react 0.1.104 → 0.1.106

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 (218) hide show
  1. package/dist/{_virtual/rolldown_runtime.mjs → chunk-CF6LXmkI.mjs} +1 -1
  2. package/dist/components/index.cjs +1 -1
  3. package/dist/components/index.d.cts +2 -1
  4. package/dist/components/index.d.mts +2 -1
  5. package/dist/components/index.mjs +1 -1
  6. package/dist/components/react-optimized.cjs +1 -1
  7. package/dist/components/react-optimized.d.cts +1 -13
  8. package/dist/components/react-optimized.d.mts +1 -13
  9. package/dist/components/react-optimized.mjs +1 -1
  10. package/dist/components-BWLXb7a2.cjs +0 -0
  11. package/dist/components-MTvNCZDU.mjs +1 -0
  12. package/dist/index-C-svZlpj.d.mts +1 -0
  13. package/dist/index-CtCMUyZA.d.cts +1 -0
  14. package/dist/index-DEHBdV_z.d.mts +1 -0
  15. package/dist/index-_wQ5ClJU.d.cts +1 -0
  16. package/dist/index.cjs +63 -1
  17. package/dist/index.d.cts +7 -6
  18. package/dist/index.d.mts +7 -9
  19. package/dist/index.mjs +60 -1
  20. package/dist/{deepkit/schemas/reflection.d.mts → plugin-DOauJa_m.d.mts} +299 -1
  21. package/dist/plugin-G4qbpIjB.mjs +1 -0
  22. package/dist/plugin-pBKbb5K9.cjs +0 -0
  23. package/dist/{deepkit/schemas/reflection.d.cts → plugin-yYQdItCy.d.cts} +299 -1
  24. package/dist/react-optimized-Btf0j0ZP.cjs +1 -0
  25. package/dist/react-optimized-C8ZBC6OY.mjs +1 -0
  26. package/dist/react-optimized-DmMl-ZEI.d.cts +14 -0
  27. package/dist/react-optimized-Y1x3FeDm.d.mts +14 -0
  28. package/dist/runtime--8U-2SZ9.d.mts +15 -0
  29. package/dist/runtime-BFk0BLpy.d.mts +2497 -0
  30. package/dist/runtime-Bp9G0scd.cjs +0 -0
  31. package/dist/runtime-CEUG_XjE.d.cts +15 -0
  32. package/dist/runtime-cDYyRPa0.mjs +1 -0
  33. package/dist/runtime-eJB4FEow.d.cts +2495 -0
  34. package/dist/types/index.cjs +1 -0
  35. package/dist/types/index.d.cts +4 -2
  36. package/dist/types/index.d.mts +4 -2
  37. package/dist/types/index.mjs +1 -1
  38. package/dist/types/plugin.cjs +1 -0
  39. package/dist/types/plugin.d.cts +2 -72
  40. package/dist/types/plugin.d.mts +2 -72
  41. package/dist/types/plugin.mjs +1 -1
  42. package/dist/types/runtime.cjs +1 -0
  43. package/dist/types/runtime.d.cts +2 -14
  44. package/dist/types/runtime.d.mts +2 -14
  45. package/dist/types/runtime.mjs +1 -1
  46. package/dist/types-C5ggNT4K.mjs +1 -0
  47. package/dist/types-a8gm_IaQ.cjs +0 -0
  48. package/package.json +12 -10
  49. package/dist/_virtual/rolldown_runtime.cjs +0 -1
  50. package/dist/alloy/src/core/components/output.cjs +0 -1
  51. package/dist/alloy/src/core/components/output.mjs +0 -1
  52. package/dist/alloy/src/core/components/single-line-comment.cjs +0 -1
  53. package/dist/alloy/src/core/components/single-line-comment.mjs +0 -1
  54. package/dist/alloy/src/core/components/source-file.cjs +0 -1
  55. package/dist/alloy/src/core/components/source-file.d.cts +0 -22
  56. package/dist/alloy/src/core/components/source-file.d.mts +0 -22
  57. package/dist/alloy/src/core/components/source-file.mjs +0 -1
  58. package/dist/alloy/src/core/contexts/context.cjs +0 -1
  59. package/dist/alloy/src/core/contexts/context.mjs +0 -1
  60. package/dist/alloy/src/core/contexts/reflection.cjs +0 -1
  61. package/dist/alloy/src/core/contexts/reflection.mjs +0 -1
  62. package/dist/alloy/src/create-plugin.cjs +0 -2
  63. package/dist/alloy/src/create-plugin.mjs +0 -2
  64. package/dist/alloy/src/helpers/refkey.cjs +0 -1
  65. package/dist/alloy/src/helpers/refkey.mjs +0 -1
  66. package/dist/alloy/src/markdown/components/markdown-file.cjs +0 -1
  67. package/dist/alloy/src/markdown/components/markdown-file.mjs +0 -1
  68. package/dist/alloy/src/markdown/components/markdown-table.cjs +0 -1
  69. package/dist/alloy/src/markdown/components/markdown-table.mjs +0 -1
  70. package/dist/alloy/src/markdown/contexts/markdown-table.cjs +0 -1
  71. package/dist/alloy/src/markdown/contexts/markdown-table.mjs +0 -1
  72. package/dist/alloy/src/types/components.d.cts +0 -19
  73. package/dist/alloy/src/types/components.d.mts +0 -23
  74. package/dist/alloy/src/types/plugin.d.cts +0 -15
  75. package/dist/alloy/src/types/plugin.d.mts +0 -15
  76. package/dist/alloy/src/typescript/components/builtin-file.cjs +0 -1
  77. package/dist/alloy/src/typescript/components/builtin-file.d.cts +0 -25
  78. package/dist/alloy/src/typescript/components/builtin-file.d.mts +0 -26
  79. package/dist/alloy/src/typescript/components/builtin-file.mjs +0 -1
  80. package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
  81. package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
  82. package/dist/alloy/src/typescript/components/tsdoc.cjs +0 -1
  83. package/dist/alloy/src/typescript/components/tsdoc.d.cts +0 -27
  84. package/dist/alloy/src/typescript/components/tsdoc.d.mts +0 -28
  85. package/dist/alloy/src/typescript/components/tsdoc.mjs +0 -1
  86. package/dist/alloy/src/typescript/components/typescript-file.cjs +0 -1
  87. package/dist/alloy/src/typescript/components/typescript-file.d.cts +0 -14
  88. package/dist/alloy/src/typescript/components/typescript-file.d.mts +0 -15
  89. package/dist/alloy/src/typescript/components/typescript-file.mjs +0 -1
  90. package/dist/alloy/src/typescript/components/typescript-interface.cjs +0 -1
  91. package/dist/alloy/src/typescript/components/typescript-interface.mjs +0 -1
  92. package/dist/alloy/src/typescript/components/typescript-object.cjs +0 -1
  93. package/dist/alloy/src/typescript/components/typescript-object.mjs +0 -1
  94. package/dist/deepkit/schemas/reflection.cjs +0 -1
  95. package/dist/deepkit/schemas/reflection.mjs +0 -1
  96. package/dist/deepkit/schemas/reflection2.cjs +0 -1
  97. package/dist/deepkit/schemas/reflection2.mjs +0 -1
  98. package/dist/deepkit/src/capnp.cjs +0 -1
  99. package/dist/deepkit/src/capnp.mjs +0 -1
  100. package/dist/deepkit/src/esbuild-plugin.cjs +0 -4
  101. package/dist/deepkit/src/esbuild-plugin.mjs +0 -4
  102. package/dist/deepkit/src/reflect-type.cjs +0 -1
  103. package/dist/deepkit/src/reflect-type.mjs +0 -1
  104. package/dist/deepkit/src/resolve-reflections.cjs +0 -1
  105. package/dist/deepkit/src/resolve-reflections.mjs +0 -1
  106. package/dist/deepkit/src/transformer.cjs +0 -1
  107. package/dist/deepkit/src/transformer.mjs +0 -1
  108. package/dist/deepkit/src/transpile.cjs +0 -1
  109. package/dist/deepkit/src/transpile.mjs +0 -1
  110. package/dist/deepkit/src/types.d.cts +0 -10
  111. package/dist/deepkit/src/types.d.mts +0 -10
  112. package/dist/deepkit/src/utilities.cjs +0 -1
  113. package/dist/deepkit/src/utilities.mjs +0 -1
  114. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -1
  115. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -1
  116. package/dist/deepkit/src/vendor/type.cjs +0 -1
  117. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  118. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  119. package/dist/deepkit/src/vendor/type.mjs +0 -1
  120. package/dist/plugin-automd/src/index.cjs +0 -1
  121. package/dist/plugin-automd/src/index.mjs +0 -1
  122. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  123. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  124. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  125. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  126. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -1
  127. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -1
  128. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -1
  129. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -1
  130. package/dist/plugin-babel/src/helpers/filters.cjs +0 -1
  131. package/dist/plugin-babel/src/helpers/filters.mjs +0 -1
  132. package/dist/plugin-babel/src/helpers/index.cjs +0 -1
  133. package/dist/plugin-babel/src/helpers/index.mjs +0 -1
  134. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -1
  135. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -1
  136. package/dist/plugin-babel/src/helpers/options.cjs +0 -1
  137. package/dist/plugin-babel/src/helpers/options.mjs +0 -1
  138. package/dist/plugin-babel/src/index.cjs +0 -1
  139. package/dist/plugin-babel/src/index.mjs +0 -1
  140. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  141. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  142. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  143. package/dist/plugin-env/src/babel/index.cjs +0 -1
  144. package/dist/plugin-env/src/babel/index.mjs +0 -1
  145. package/dist/plugin-env/src/babel/plugin.cjs +0 -5
  146. package/dist/plugin-env/src/babel/plugin.mjs +0 -5
  147. package/dist/plugin-env/src/components/docs.cjs +0 -1
  148. package/dist/plugin-env/src/components/docs.mjs +0 -1
  149. package/dist/plugin-env/src/components/env.cjs +0 -34
  150. package/dist/plugin-env/src/components/env.mjs +0 -31
  151. package/dist/plugin-env/src/components/index.cjs +0 -1
  152. package/dist/plugin-env/src/components/index.mjs +0 -1
  153. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -1
  154. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -1
  155. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -1
  156. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -1
  157. package/dist/plugin-env/src/helpers/index.cjs +0 -1
  158. package/dist/plugin-env/src/helpers/index.mjs +0 -1
  159. package/dist/plugin-env/src/helpers/load.cjs +0 -1
  160. package/dist/plugin-env/src/helpers/load.mjs +0 -1
  161. package/dist/plugin-env/src/helpers/persistence.cjs +0 -1
  162. package/dist/plugin-env/src/helpers/persistence.mjs +0 -1
  163. package/dist/plugin-env/src/helpers/reflect.cjs +0 -1
  164. package/dist/plugin-env/src/helpers/reflect.mjs +0 -1
  165. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -1
  166. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -1
  167. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -1
  168. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -1
  169. package/dist/plugin-env/src/index.cjs +0 -10
  170. package/dist/plugin-env/src/index.mjs +0 -10
  171. package/dist/plugin-env/src/types/plugin.d.cts +0 -143
  172. package/dist/plugin-env/src/types/plugin.d.mts +0 -144
  173. package/dist/plugin-env/src/types/runtime.d.cts +0 -792
  174. package/dist/plugin-env/src/types/runtime.d.mts +0 -792
  175. package/dist/plugin-plugin/src/types/plugin.d.cts +0 -21
  176. package/dist/plugin-plugin/src/types/plugin.d.mts +0 -23
  177. package/dist/powerlines/schemas/fs.d.mts +0 -1
  178. package/dist/powerlines/src/api.d.mts +0 -7
  179. package/dist/powerlines/src/index.d.mts +0 -12
  180. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
  181. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -14
  182. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -14
  183. package/dist/powerlines/src/lib/entry.cjs +0 -1
  184. package/dist/powerlines/src/lib/entry.mjs +0 -1
  185. package/dist/powerlines/src/lib/logger.cjs +0 -1
  186. package/dist/powerlines/src/lib/logger.mjs +0 -1
  187. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +0 -1
  188. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +0 -1
  189. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -1
  190. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -1
  191. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -1
  192. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -1
  193. package/dist/powerlines/src/plugin-utils/helpers.cjs +0 -1
  194. package/dist/powerlines/src/plugin-utils/helpers.mjs +0 -1
  195. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  196. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -1
  197. package/dist/powerlines/src/types/api.d.mts +0 -5
  198. package/dist/powerlines/src/types/babel.d.cts +0 -22
  199. package/dist/powerlines/src/types/babel.d.mts +0 -22
  200. package/dist/powerlines/src/types/build.d.cts +0 -145
  201. package/dist/powerlines/src/types/build.d.mts +0 -145
  202. package/dist/powerlines/src/types/commands.d.cts +0 -8
  203. package/dist/powerlines/src/types/commands.d.mts +0 -9
  204. package/dist/powerlines/src/types/config.d.cts +0 -368
  205. package/dist/powerlines/src/types/config.d.mts +0 -369
  206. package/dist/powerlines/src/types/context.d.cts +0 -373
  207. package/dist/powerlines/src/types/context.d.mts +0 -375
  208. package/dist/powerlines/src/types/fs.d.cts +0 -458
  209. package/dist/powerlines/src/types/fs.d.mts +0 -458
  210. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  211. package/dist/powerlines/src/types/index.d.mts +0 -12
  212. package/dist/powerlines/src/types/plugin.d.cts +0 -232
  213. package/dist/powerlines/src/types/plugin.d.mts +0 -232
  214. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  215. package/dist/powerlines/src/types/resolved.d.mts +0 -82
  216. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  217. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  218. package/dist/powerlines/src/types/unplugin.d.mts +0 -6
@@ -1,10 +0,0 @@
1
- import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import{createAlloyPlugin as t}from"../../alloy/src/create-plugin.mjs";import n from"../../plugin-babel/src/index.mjs";import r from"../../plugin-automd/src/index.mjs";import{BaseEnv as i,BaseSecrets as a,createEnvReflection as o,createSecretsReflection as s,mergeEnvReflections as c,mergeSecretsReflections as l,reflectEnv as u,reflectSecrets as d}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as f,getEnvReflectionsPath as p,getEnvTypeReflectionsPath as m,getSecretsDefaultTypeDefinition as h,readEnvReflection as g,readEnvTypeReflection as _,readSecretsReflection as v,resolveRuntimeTypeFile as y,writeEnvReflection as b,writeEnvTypeReflection as x}from"./helpers/persistence.mjs";import{envBabelPlugin as S}from"./babel/plugin.mjs";import{removeEnvPrefix as C}from"./helpers/source-file-env.mjs";import{loadEnv as w,loadEnvFromContext as T}from"./helpers/load.mjs";import{createReflectionResource as E}from"./helpers/create-reflection-resource.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import{env as k}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{createComponent as A}from"@alloy-js/core/jsx-runtime";import{titleCase as j}from"@stryke/string-format/title-case";import M from"defu";import{LogLevelLabel as N}from"@storm-software/config-tools/types";import{isParentPath as P}from"@stryke/path/is-parent-path";import{toArray as F}from"@stryke/convert/to-array";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as L}from"@stryke/env/types";import{existsSync as R}from"@stryke/fs/exists";import{createDirectory as z}from"@stryke/fs/helpers";import{joinPaths as B}from"@stryke/path/join";import{constantCase as V}from"@stryke/string-format/constant-case";const H=t((t={})=>({name:`env`,async config(){this.log(N.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:M(t,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(N.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await f(this);e.env.types=I(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=I(e.env.secrets);else{let t=await h(this);e.env.secrets=I(`${t.file}#${t.name}`)}return e.env.prefix=F(e.env.prefix??[]).reduce((e,t)=>{let n=V(t);return e.includes(n)||e.push(n),e},[...L,`POWERLINES_`]),e.env.prefix=e.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),e},async configResolved(){if(this.log(N.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=M({parsed:await w(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&R(m(this,`env`)))this.log(N.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await _(this,`env`),R(p(this,`env`))&&(this.env.used.env=await g(this)),R(m(this,`secrets`))&&(this.env.types.secrets=await _(this,`secrets`)),R(p(this,`secrets`))&&(this.env.used.secrets=await v(this));else{if(this.env.types.env=await u(this,this.config.env.types?.file?P(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:B(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await x(this,this.env.types.env,`env`),this.env.types.secrets=await d(this,this.config.env.secrets?.file?P(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:B(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await x(this,this.env.types.secrets,`secrets`),this.log(N.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await w(this,this.config.env)).forEach(([e,n])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=t.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await b(this,this.env.used.env,`env`),this.env.types.secrets&&(await x(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await b(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(N.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),A(D,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(N.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=B(this.config.projectRoot,`docs`,`generated`);R(t)||await z(t);let n=await _(this,`env`),r=B(t,`env.md`);this.log(N.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${j(this.config.framework)||`Powerlines`} -->
2
-
3
- Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
-
5
- | Name | Description | Type | Default Value | Required |
6
- | ---- | ----------- | ---- | ------------- | :------: |
7
- ${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
8
- `,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
9
- `)}
10
- `)},async buildEnd(){let e=p(this,`env`);this.log(N.TRACE,`Writing env reflection types to ${e}.`),await b(this,this.env.used.env,`env`)}}));var U=(e={})=>[n(e.babel),H(e),{name:`env:automd-generator`,config(){return{automd:M(e.automd??{},{generators:{env:k(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},r(e.automd)];export{U as default};
@@ -1,143 +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 { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
4
- import { EnvInterface, SecretsInterface } from "./runtime.cjs";
5
- import { Children } from "@alloy-js/core/jsx-runtime";
6
- import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
7
- import { DotenvParseOutput } from "@stryke/env/types";
8
-
9
- //#region ../plugin-env/src/types/plugin.d.ts
10
- type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
11
- /**
12
- * 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"`.
13
- */
14
- types?: TypeDefinitionParameter;
15
- /**
16
- * 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"`.
17
- */
18
- secrets?: TypeDefinitionParameter;
19
- /**
20
- * An additional prefix (or list of additional prefixes) to apply to the environment variables
21
- *
22
- * @remarks
23
- * By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
24
- */
25
- prefix?: string | string[];
26
- /**
27
- * Should the plugin inject the env variables in the source code with their values?
28
- *
29
- * @remarks
30
- * This option is set to `true` when building an application project.
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
- type EnvPluginUserConfig = BabelPluginUserConfig & {
58
- env: EnvPluginOptions;
59
- };
60
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
61
- env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
62
- /**
63
- * The type definition for the expected env variable parameters
64
- *
65
- * @remarks
66
- * This value is parsed from the {@link EnvPluginOptions.types} option.
67
- */
68
- types: TypeDefinition;
69
- /**
70
- * The type definition for the expected env secret parameters
71
- *
72
- * @remarks
73
- * This value is parsed from the {@link EnvPluginOptions.secrets} option.
74
- */
75
- secrets: TypeDefinition;
76
- /**
77
- * Should the plugin inject the env variables in the source code with their values?
78
- *
79
- * @remarks
80
- * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
81
- */
82
- inject: EnvPluginOptions["inject"];
83
- /**
84
- * The prefix used for environment variables
85
- *
86
- * @remarks
87
- * This value is used to filter environment variables that are loaded from the .env file and the process environment.
88
- */
89
- prefix: string[];
90
- };
91
- };
92
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig> {
93
- env: {
94
- /**
95
- * The type definitions reflection for the env variables and secrets
96
- *
97
- * @remarks
98
- * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
99
- */
100
- types: {
101
- /**
102
- * The type definitions for the expected env variables
103
- */
104
- env: Reflection;
105
- /**
106
- * The type definitions for the expected env secrets
107
- */
108
- secrets: Reflection;
109
- };
110
- /**
111
- * The current **used** environment variables and secrets reflection
112
- *
113
- * @remarks
114
- * 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.
115
- */
116
- used: {
117
- /**
118
- * The current env variables reflection
119
- */
120
- env: Reflection<EnvInterface>;
121
- /**
122
- * The current env secrets reflection
123
- */
124
- secrets: Reflection<SecretsInterface>;
125
- };
126
- /**
127
- * The parsed .env configuration object
128
- *
129
- * @remarks
130
- * 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}
131
- */
132
- parsed: DotenvParseOutput;
133
- /**
134
- * The injected environment variables and secrets reflection
135
- *
136
- * @remarks
137
- * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
138
- */
139
- injected: Reflection;
140
- };
141
- }
142
- //#endregion
143
- export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig };
@@ -1,144 +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 { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.mjs";
4
- import "../../../plugin-babel/src/types/index.mjs";
5
- import { EnvInterface, SecretsInterface } from "./runtime.mjs";
6
- import { Children } from "@alloy-js/core/jsx-runtime";
7
- import { DotenvParseOutput } from "@stryke/env/types";
8
- import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
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
- type EnvPluginUserConfig = BabelPluginUserConfig & {
59
- env: EnvPluginOptions;
60
- };
61
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
62
- env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
63
- /**
64
- * The type definition for the expected env variable parameters
65
- *
66
- * @remarks
67
- * This value is parsed from the {@link EnvPluginOptions.types} option.
68
- */
69
- types: TypeDefinition;
70
- /**
71
- * The type definition for the expected env secret parameters
72
- *
73
- * @remarks
74
- * This value is parsed from the {@link EnvPluginOptions.secrets} option.
75
- */
76
- secrets: TypeDefinition;
77
- /**
78
- * Should the plugin inject the env variables in the source code with their values?
79
- *
80
- * @remarks
81
- * This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
82
- */
83
- inject: EnvPluginOptions["inject"];
84
- /**
85
- * The prefix used for environment variables
86
- *
87
- * @remarks
88
- * This value is used to filter environment variables that are loaded from the .env file and the process environment.
89
- */
90
- prefix: string[];
91
- };
92
- };
93
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig> {
94
- env: {
95
- /**
96
- * The type definitions reflection for the env variables and secrets
97
- *
98
- * @remarks
99
- * These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
100
- */
101
- types: {
102
- /**
103
- * The type definitions for the expected env variables
104
- */
105
- env: Reflection;
106
- /**
107
- * The type definitions for the expected env secrets
108
- */
109
- secrets: Reflection;
110
- };
111
- /**
112
- * The current **used** environment variables and secrets reflection
113
- *
114
- * @remarks
115
- * 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.
116
- */
117
- used: {
118
- /**
119
- * The current env variables reflection
120
- */
121
- env: Reflection<EnvInterface>;
122
- /**
123
- * The current env secrets reflection
124
- */
125
- secrets: Reflection<SecretsInterface>;
126
- };
127
- /**
128
- * The parsed .env configuration object
129
- *
130
- * @remarks
131
- * 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}
132
- */
133
- parsed: DotenvParseOutput;
134
- /**
135
- * The injected environment variables and secrets reflection
136
- *
137
- * @remarks
138
- * This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
139
- */
140
- injected: Reflection;
141
- };
142
- }
143
- //#endregion
144
- export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig };