@powerlines/plugin-env 0.14.3 → 0.14.5
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.
- package/dist/{_virtual/rolldown_runtime.mjs → chunk-D1UamjDs.mjs} +1 -1
- package/dist/components/docs.cjs +1 -1
- package/dist/components/docs.d.cts +1 -8
- package/dist/components/docs.d.mts +1 -8
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env.cjs +1 -34
- package/dist/components/env.d.cts +1 -19
- package/dist/components/env.d.mts +1 -19
- package/dist/components/env.mjs +1 -31
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +3 -2
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.mjs +1 -1
- package/dist/components-ByVHjWXF.mjs +1 -0
- package/dist/components-C9bYrQVK.cjs +0 -0
- package/dist/create-reflection-resource-D6mTRo2f.mjs +17 -0
- package/dist/create-reflection-resource-I684bqD1.cjs +17 -0
- package/dist/docs-BEsuuE9f.mjs +1 -0
- package/dist/docs-CKCRAUnO.d.mts +9 -0
- package/dist/docs-CdtUw4WA.d.cts +9 -0
- package/dist/docs-qvDyetF0.cjs +1 -0
- package/dist/env-CHnpBV7X.mjs +31 -0
- package/dist/env-COWzTupf.d.cts +20 -0
- package/dist/env-CgSzbXBL.cjs +34 -0
- package/dist/env-DqPOEUEu.d.mts +20 -0
- package/dist/index-B_e8BwCm.d.cts +1 -0
- package/dist/index-CW2WHUXP.d.mts +1 -0
- package/dist/index-DCQ5Y2ED.d.mts +1 -0
- package/dist/index-DWPDThxu.d.cts +1 -0
- package/dist/index.cjs +8 -4
- package/dist/index.d.cts +185 -12
- package/dist/index.d.mts +185 -17
- package/dist/index.mjs +8 -4
- package/dist/{deepkit/schemas/reflection.d.cts → plugin-CPy0CKXL.d.cts} +237 -1
- package/dist/plugin-CyRU_Pln.mjs +1 -0
- package/dist/{deepkit/schemas/reflection.d.mts → plugin-Cz3MZ6FL.d.mts} +239 -1
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/runtime-B7kcxFAf.d.mts +2499 -0
- package/dist/runtime-Bisl_1Ja.cjs +0 -0
- package/dist/runtime-Bo02eIQ-.d.cts +2497 -0
- package/dist/runtime-g_eXGBBi.mjs +1 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +2 -148
- package/dist/types/plugin.d.mts +2 -149
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts +1 -793
- package/dist/types/runtime.d.mts +1 -793
- package/dist/types/runtime.mjs +1 -1
- package/dist/types-DMh7K7VC.mjs +1 -0
- package/dist/types-MYBaygjr.cjs +0 -0
- package/package.json +11 -9
- package/dist/_virtual/rolldown_runtime.cjs +0 -1
- package/dist/alloy/src/core/components/output.cjs +0 -1
- package/dist/alloy/src/core/components/output.mjs +0 -1
- package/dist/alloy/src/core/components/single-line-comment.cjs +0 -1
- package/dist/alloy/src/core/components/single-line-comment.mjs +0 -1
- package/dist/alloy/src/core/components/source-file.cjs +0 -1
- package/dist/alloy/src/core/components/source-file.d.cts +0 -22
- package/dist/alloy/src/core/components/source-file.d.mts +0 -22
- package/dist/alloy/src/core/components/source-file.mjs +0 -1
- package/dist/alloy/src/core/contexts/context.cjs +0 -1
- package/dist/alloy/src/core/contexts/context.mjs +0 -1
- package/dist/alloy/src/core/contexts/reflection.cjs +0 -1
- package/dist/alloy/src/core/contexts/reflection.mjs +0 -1
- package/dist/alloy/src/create-plugin.cjs +0 -2
- package/dist/alloy/src/create-plugin.mjs +0 -2
- package/dist/alloy/src/helpers/refkey.cjs +0 -1
- package/dist/alloy/src/helpers/refkey.mjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-file.cjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-file.mjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-table.cjs +0 -1
- package/dist/alloy/src/markdown/components/markdown-table.mjs +0 -1
- package/dist/alloy/src/markdown/contexts/markdown-table.cjs +0 -1
- package/dist/alloy/src/markdown/contexts/markdown-table.mjs +0 -1
- package/dist/alloy/src/types/components.d.cts +0 -19
- package/dist/alloy/src/types/components.d.mts +0 -23
- package/dist/alloy/src/typescript/components/builtin-file.cjs +0 -1
- package/dist/alloy/src/typescript/components/builtin-file.d.cts +0 -25
- package/dist/alloy/src/typescript/components/builtin-file.d.mts +0 -26
- package/dist/alloy/src/typescript/components/builtin-file.mjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc.cjs +0 -1
- package/dist/alloy/src/typescript/components/tsdoc.d.cts +0 -27
- package/dist/alloy/src/typescript/components/tsdoc.d.mts +0 -28
- package/dist/alloy/src/typescript/components/tsdoc.mjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-file.cjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-file.d.cts +0 -14
- package/dist/alloy/src/typescript/components/typescript-file.d.mts +0 -15
- package/dist/alloy/src/typescript/components/typescript-file.mjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-interface.cjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-interface.d.cts +0 -11
- package/dist/alloy/src/typescript/components/typescript-interface.d.mts +0 -12
- package/dist/alloy/src/typescript/components/typescript-interface.mjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-object.cjs +0 -1
- package/dist/alloy/src/typescript/components/typescript-object.mjs +0 -1
- package/dist/babel/index.cjs +0 -1
- package/dist/babel/index.d.cts +0 -2
- package/dist/babel/index.d.mts +0 -2
- package/dist/babel/index.mjs +0 -1
- package/dist/babel/plugin.cjs +0 -5
- package/dist/babel/plugin.d.cts +0 -7
- package/dist/babel/plugin.d.mts +0 -9
- package/dist/babel/plugin.mjs +0 -5
- package/dist/deepkit/schemas/reflection.cjs +0 -1
- package/dist/deepkit/schemas/reflection.mjs +0 -1
- package/dist/deepkit/schemas/reflection2.cjs +0 -1
- package/dist/deepkit/schemas/reflection2.mjs +0 -1
- package/dist/deepkit/src/capnp.cjs +0 -1
- package/dist/deepkit/src/capnp.mjs +0 -1
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -4
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -4
- package/dist/deepkit/src/reflect-type.cjs +0 -1
- package/dist/deepkit/src/reflect-type.mjs +0 -1
- package/dist/deepkit/src/resolve-reflections.cjs +0 -1
- package/dist/deepkit/src/resolve-reflections.mjs +0 -1
- package/dist/deepkit/src/transformer.cjs +0 -1
- package/dist/deepkit/src/transformer.mjs +0 -1
- package/dist/deepkit/src/transpile.cjs +0 -1
- package/dist/deepkit/src/transpile.mjs +0 -1
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/deepkit/src/types.d.mts +0 -10
- package/dist/deepkit/src/utilities.cjs +0 -1
- package/dist/deepkit/src/utilities.mjs +0 -1
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -1
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -1
- package/dist/deepkit/src/vendor/type.cjs +0 -1
- package/dist/deepkit/src/vendor/type.d.cts +0 -7
- package/dist/deepkit/src/vendor/type.d.mts +0 -7
- package/dist/deepkit/src/vendor/type.mjs +0 -1
- package/dist/helpers/automd-generator.cjs +0 -1
- package/dist/helpers/automd-generator.d.cts +0 -14
- package/dist/helpers/automd-generator.d.mts +0 -14
- package/dist/helpers/automd-generator.mjs +0 -1
- package/dist/helpers/create-reflection-resource.cjs +0 -1
- package/dist/helpers/create-reflection-resource.d.cts +0 -15
- package/dist/helpers/create-reflection-resource.d.mts +0 -15
- package/dist/helpers/create-reflection-resource.mjs +0 -1
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.d.cts +0 -7
- package/dist/helpers/index.d.mts +0 -7
- package/dist/helpers/index.mjs +0 -1
- package/dist/helpers/load.cjs +0 -1
- package/dist/helpers/load.d.cts +0 -35
- package/dist/helpers/load.d.mts +0 -36
- package/dist/helpers/load.mjs +0 -1
- package/dist/helpers/persistence.cjs +0 -1
- package/dist/helpers/persistence.d.cts +0 -84
- package/dist/helpers/persistence.d.mts +0 -84
- package/dist/helpers/persistence.mjs +0 -1
- package/dist/helpers/reflect.cjs +0 -1
- package/dist/helpers/reflect.d.cts +0 -46
- package/dist/helpers/reflect.d.mts +0 -46
- package/dist/helpers/reflect.mjs +0 -1
- package/dist/helpers/source-file-env.cjs +0 -1
- package/dist/helpers/source-file-env.d.cts +0 -8
- package/dist/helpers/source-file-env.d.mts +0 -8
- package/dist/helpers/source-file-env.mjs +0 -1
- package/dist/helpers/template-helpers.cjs +0 -1
- package/dist/helpers/template-helpers.d.cts +0 -15
- package/dist/helpers/template-helpers.d.mts +0 -15
- package/dist/helpers/template-helpers.mjs +0 -1
- package/dist/plugin-automd/src/index.cjs +0 -1
- package/dist/plugin-automd/src/index.mjs +0 -1
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -1
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -1
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -1
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -1
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -1
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -1
- package/dist/plugin-babel/src/helpers/index.cjs +0 -1
- package/dist/plugin-babel/src/helpers/index.mjs +0 -1
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -1
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -1
- package/dist/plugin-babel/src/helpers/options.cjs +0 -1
- package/dist/plugin-babel/src/helpers/options.mjs +0 -1
- package/dist/plugin-babel/src/index.cjs +0 -1
- package/dist/plugin-babel/src/index.mjs +0 -1
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/powerlines/schemas/fs.d.mts +0 -1
- package/dist/powerlines/src/api.d.mts +0 -7
- package/dist/powerlines/src/index.d.mts +0 -12
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -14
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -14
- package/dist/powerlines/src/lib/entry.cjs +0 -1
- package/dist/powerlines/src/lib/entry.mjs +0 -1
- package/dist/powerlines/src/lib/logger.cjs +0 -1
- package/dist/powerlines/src/lib/logger.mjs +0 -1
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -1
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -1
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -1
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -1
- package/dist/powerlines/src/plugin-utils/helpers.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/helpers.mjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -1
- package/dist/powerlines/src/types/api.d.mts +0 -5
- package/dist/powerlines/src/types/babel.d.cts +0 -23
- package/dist/powerlines/src/types/babel.d.mts +0 -23
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -147
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -368
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -373
- package/dist/powerlines/src/types/context.d.mts +0 -375
- package/dist/powerlines/src/types/fs.d.cts +0 -458
- package/dist/powerlines/src/types/fs.d.mts +0 -458
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/index.d.mts +0 -12
- package/dist/powerlines/src/types/plugin.d.cts +0 -232
- package/dist/powerlines/src/types/plugin.d.mts +0 -232
- package/dist/powerlines/src/types/resolved.d.cts +0 -82
- package/dist/powerlines/src/types/resolved.d.mts +0 -83
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.d.mts +0 -7
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import{type_exports as e}from"./deepkit/src/vendor/type.mjs";import{BaseEnv as t,BaseSecrets as n,createEnvReflection as r,createSecretsReflection as i,mergeEnvReflections as a,mergeSecretsReflections as o,reflectEnv as s,reflectSecrets as c}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as l,getEnvReflectionsPath as u,getEnvTypeReflectionsPath as d,getSecretsDefaultTypeDefinition as f,readEnvReflection as p,readEnvTypeReflection as m,readSecretsReflection as h,resolveRuntimeTypeFile as g,writeEnvReflection as _,writeEnvReflectionSync as v,writeEnvTypeReflection as y}from"./helpers/persistence.mjs";import{createTemplateReflection as b}from"./helpers/template-helpers.mjs";import{formatEnvField as x,removeEnvPrefix as S}from"./helpers/source-file-env.mjs";import{loadEnv as C,loadEnvFromContext as w}from"./helpers/load.mjs";import{createReflectionResource as T}from"./helpers/create-reflection-resource.mjs";import"./helpers/index.mjs";import{env as E}from"./helpers/automd-generator.mjs";import{EnvDocs as D}from"./components/docs.mjs";import{EnvBuiltin as O,EnvTypeDefinition as k}from"./components/env.mjs";import"./components/index.mjs";import{envBabelPlugin as A}from"./babel/plugin.mjs";import"./babel/index.mjs";import{createAlloyPlugin as j}from"./alloy/src/create-plugin.mjs";import M from"./plugin-automd/src/index.mjs";import N from"./plugin-babel/src/index.mjs";import{titleCase as P}from"@stryke/string-format/title-case";import F from"defu";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{LogLevelLabel as L}from"@storm-software/config-tools/types";import{toArray as R}from"@stryke/convert/to-array";import{isParentPath as z}from"@stryke/path/is-parent-path";import{ENV_PREFIXES as B}from"@stryke/env/types";import{createComponent as V}from"@alloy-js/core/jsx-runtime";import{joinPaths as H}from"@stryke/path/join";import{existsSync as U}from"@stryke/fs/exists";import{createDirectory as W}from"@stryke/fs/helpers";import{constantCase as G}from"@stryke/string-format/constant-case";const K=j((t={})=>({name:`env`,async config(){this.log(L.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:F(t,{types:{},prefix:[]}),transform:{babel:{plugins:[A]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(L.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await l(this);e.env.types=I(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=I(e.env.secrets);else{let t=await f(this);e.env.secrets=I(`${t.file}#${t.name}`)}return e.env.prefix=R(e.env.prefix??[]).reduce((e,t)=>{let n=G(t);return e.includes(n)||e.push(n),e},[...B,`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(L.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=F({parsed:await C(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&U(d(this,`env`)))this.log(L.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await m(this,`env`),U(u(this,`env`))&&(this.env.used.env=await p(this)),U(d(this,`secrets`))&&(this.env.types.secrets=await m(this,`secrets`)),U(u(this,`secrets`))&&(this.env.used.secrets=await h(this));else{if(this.env.types.env=await s(this,this.config.env.types?.file?z(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:H(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 y(this,this.env.types.env,`env`),this.env.types.secrets=await c(this,this.config.env.secrets?.file?z(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:H(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 y(this,this.env.types.secrets,`secrets`),this.log(L.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 C(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 _(this,this.env.used.env,`env`),this.env.types.secrets&&(await y(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 _(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(L.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),V(O,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(L.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=H(this.config.projectRoot,`docs`,`generated`);U(t)||await W(t);let n=await m(this,`env`),r=H(t,`env.md`);this.log(L.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${P(this.config.framework)||`Powerlines`} -->
|
|
1
|
+
import{C as e,D as t,E as n,S as r,T as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as ee,l as p,m,n as h,o as g,p as te,r as ne,s as _,t as re,u as v,v as ie,w as y,x as ae,y as oe}from"./create-reflection-resource-D6mTRo2f.mjs";import{n as se,t as b}from"./env-CHnpBV7X.mjs";import{t as x}from"./docs-BEsuuE9f.mjs";import"./components-ByVHjWXF.mjs";import"./plugin-CyRU_Pln.mjs";import"./runtime-g_eXGBBi.mjs";import"./types-DMh7K7VC.mjs";import{toArray as S}from"@stryke/convert/to-array";import{isDirectory as ce}from"@stryke/fs/is-file";import{listFiles as le}from"@stryke/fs/list-files";import{appendPath as C}from"@stryke/path/append";import{isAbsolutePath as w}from"@stryke/path/is-type";import{joinPaths as T}from"@stryke/path/join-paths";import{replacePath as ue}from"@stryke/path/replace";import{defineGenerator as de,loadConfig as fe,resolveConfig as pe,transform as me}from"automd";import{loadConfig as he}from"c12";import E from"defu";import ge from"markdown-toc";import{transformAsync as _e}from"@babel/core";import{LogLevelLabel as D}from"@storm-software/config-tools/types";import{findFileExtension as ve,findFileExtensionSafe as ye}from"@stryke/path/file-path-fns";import{isParentPath as O}from"@stryke/path/is-parent-path";import{isSetObject as be}from"@stryke/type-checks/is-set-object";import{isFunction as k}from"@stryke/type-checks/is-function";import"@stryke/type-checks/is-object";import{isSetString as A}from"@stryke/type-checks/is-set-string";import j from"chalk";import M from"@babel/generator";import"@babel/parser";import{declare as N}from"@babel/helper-plugin-utils";import"@storm-software/config-tools/logger";import"@storm-software/config-tools/utilities/colors";import"@stryke/helpers/noop";import{titleCase as P}from"@stryke/string-format/title-case";import*as F from"@babel/types";import{isString as I}from"@stryke/type-checks/is-string";import{parseTypeDefinition as L}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as xe}from"@stryke/env/types";import{existsSync as R}from"@stryke/fs/exists";import{createDirectory as Se}from"@stryke/fs/helpers";import{joinPaths as z}from"@stryke/path/join";import{constantCase as B}from"@stryke/string-format/constant-case";import*as Ce from"@stryke/capnp";import{getUniqueBy as V}from"@stryke/helpers/get-unique";import{StormJSON as H}from"@stryke/json/storm-json";import{isNull as we}from"@stryke/type-checks/is-null";import{isUndefined as Te}from"@stryke/type-checks/is-undefined";import{readFileBufferSync as Ee}from"@stryke/fs/buffer";import{existsSync as De}from"node:fs";import{jsx as Oe}from"@alloy-js/core/jsx-runtime";var ke=(e={})=>({name:`automd`,async config(){let t=await fe(T(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=S(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:E(t??{},{configFile:e.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!S(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=S(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await he({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=pe(E(this.config.automd,{...e,prefix:S(e.prefix??[])}))}this.config.automd.input=(await Promise.all(S(this.config.automd.input).map(async e=>e.includes(`*`)?le(w(e)?e:C(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):w(e)?e:C(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!w(this.config.automd.output)&&(this.config.automd.output=C(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:ge(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all(S(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let n=await me(t,this.config.automd);if(n.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);n.hasChanged&&await this.fs.write(C(this.config.automd.output?ce(this.config.automd.output)?ue(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),n.contents)}}))}});function U(e){return A(e)?e:Array.isArray(e)&&e.length>0?U(e[0]):e.$$name||e.name?e.$$name||e.name:void 0}function W(e,t){return!!(U(t)&&e.some(e=>Array.isArray(e)&&U(e[0])===U(t)))}function G(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?k(t[0])?t[0](e):t[0]:k(t)?t(e):t}catch{return t[0]}}function K(e,t,n,r){if(Array.isArray(r)&&r.length>0&&r[0]){if(r.length>2&&r[2]&&k(r[2])&&!r[2](t,n)){e.log(D.TRACE,`Skipping filtered Babel plugin ${j.bold.cyanBright(U(r)||`unnamed`)} for ${n}`);return}return r.length>2?[G(e,r),r[1],r[2]]:[G(e,r),r[1],null]}return[G(e,r),{},null]}let q=M;`default`in q&&(q=q.default);const J=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`],Ae=(e,t)=>(n,...r)=>e(n,` ${j.inverse.hex(J[t.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%J.length]||J[0])(` ${P(t)} `)} ${r.join(` `)} `);function je(e,t){let n=n=>N((r,i,a)=>{r.cache.using(()=>n.meta.checksum),r.assertVersion(`^7.0.0-0`);let o=Ae(n.log,e);o(D.TRACE,`Initializing the ${j.bold.cyanBright(e)} Babel plugin`);let s=t({log:o,name:e,api:r,options:i,context:n,dirname:a});return s.name=e,o(D.TRACE,`Completed initialization of the ${j.bold.cyanBright(e)} Babel plugin`),s});return n.$$name=e,n}function Y(e,t){Pe(e.scope.getProgramParent().path,t)}function Me(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function Ne(e){let t=new Map;return e.traverse({ImportDeclaration(e){Me(e)&&t.set(e.node.source.value,e)}}),t}function Pe(e,t){Ne(e).get(t.module)||e.unshiftContainer(`body`,F.importDeclaration([F.importSpecifier(F.identifier(t.name||t.imported),F.identifier(t.imported))],F.stringLiteral(t.module)))}var Fe=(e={})=>({name:`babel`,config(){if(be(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=E(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(t,n){if(O(n,this.powerlinesPath)||t.includes(`/* @storm-ignore */`)||t.includes(`/* @storm-disable */`))return this.log(D.TRACE,`Skipping Babel transformation for: ${n}`),{code:t,id:n};this.log(D.TRACE,`Babel transforming file: ${n}`);let r=this.config.transform.babel.plugins.map(e=>K(this,t,n,e)).filter((e,t,n)=>e&&!W(n,e)),i=this.config.transform.babel.presets.map(e=>K(this,t,n,e)).filter((e,t,n)=>e&&!W(n,e));if(Array.isArray(r)&&r.length===0&&Array.isArray(i)&&i.length===0)return{code:t,id:n};[`ts`,`cts`,`mts`,`tsx`].includes(ye(n))&&!W(r,`@babel/plugin-syntax-typescript`)&&!W(i,`@babel/preset-typescript`)&&r.unshift([`@babel/plugin-syntax-typescript`,{isTSX:ve(n)===`.tsx`}]);let a=await _e(t,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:n,plugins:r.map(t=>Array.isArray(t)&&t.length>=2?[t[0],E(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:i.map(t=>Array.isArray(t)&&t.length>=2?[t[0],E(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!a?.code)throw Error(`Powerlines - Babel plugin failed to compile ${n}`);return{code:a.code,id:n}}});function Ie(e,t){return Z(e.type,t??e.getDefaultValue())}function X(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function Z(e,n){return Te(n)?`undefined`:we(n)?`null`:e.kind===t.ReflectionKind.boolean?String(n).trim().toLowerCase()===`true`?`true`:`false`:e.kind===t.ReflectionKind.string||e.kind===t.ReflectionKind.literal&&I(e.literal)?X(n):e.kind===t.ReflectionKind.enum?Le(e).kind===t.ReflectionKind.string?X(n):`${String(n)}`:e.kind===t.ReflectionKind.union?ze(e)?X(n):`${String(n)}`:e.kind===t.ReflectionKind.array?X(H.stringify(n)):e.kind===t.ReflectionKind.object||e.kind===t.ReflectionKind.objectLiteral?H.stringify(n):e.kind===t.ReflectionKind.property||e.kind===t.ReflectionKind.parameter?Z(e.type,n):String(n)}function Le(e){if(e.kind!==t.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let n=V(e.values.filter(e=>e!=null),e=>I(e)?{kind:t.ReflectionKind.string}:{kind:t.ReflectionKind.number});if(n.length===0)throw Error(`No valid enum members could be found.`);return n[0]&&I(n[0])?{kind:t.ReflectionKind.string}:{kind:t.ReflectionKind.number}}function Re(e){if(e.kind===t.ReflectionKind.union&&e.types.length>0)return V(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function ze(e){return Re(e).some(e=>e.kind===t.ReflectionKind.string||e.kind===t.ReflectionKind.literal&&I(e.literal))}const Q=je(`env`,({log:e,context:r})=>{function a(t,n,i=!1){let a=r.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(t.name){let o=r.config.env.prefix.find(e=>t.name&&t.name.startsWith(e)&&(r.env.types.env?.hasProperty(t.name.replace(`${e}_`,``))||a.some(n=>n.getAlias().includes(t.name.replace(`${e}_`,``))))),s=t.name;if(o&&(s=t.name.replace(`${o}_`,``)),e(D.TRACE,`Environment variable ${s} found in ${n.filename||`unknown file`}.`),r.env.types.env?.hasProperty(s)||a.some(e=>e.getAlias().includes(s))){let e=r.env.types.env.hasProperty(s)?r.env.types.env.getProperty(s):a.find(e=>e.getAlias().includes(s));if(!e||e.isIgnored())return;if(r.env.used.env.hasProperty(s)||r.env.used.env.addProperty(e.property),r.config.env.inject&&i){let t=r.env.parsed?.[s];if(t===void 0){let e=r.config.env.prefix.find(e=>r.env.parsed[`${e.replace(/_$/g,``)}_${s}`]);e&&(t=r.env.parsed[`${e.replace(/_$/g,``)}_${s}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${s}\` is not defined in the .env configuration files`);return Ie(e,t)}}else throw Error(`The "${s}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${n.filename?n.filename:`unknown`}.
|
|
2
|
+
|
|
3
|
+
The following environment configuration names are defined in the \`env\` type definition: \n${r.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
|
|
4
|
+
`)} \n\nUsing the following env prefix: \n${r.config.env.prefix.map(e=>` - ${e}`).join(`
|
|
5
|
+
`)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;a(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),Y(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;a(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),Y(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;a(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),Y(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;a(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),Y(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){e(D.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let a=t.ReflectionClass.from({kind:t.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),o=_(r,`env`);o&&De(o)&&(e(D.TRACE,`Environment reflection file found at ${o}, reading existing reflection.`),a=(0,t.resolveClassType)((0,t.deserializeType)(n(new Ce.Message(Ee(o),!1).getRoot(i).types)))),e(D.TRACE,`Adding new variables to env reflection at ${o}.`),a.getProperties().filter(e=>e.getNameAsString()&&!r.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{r.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}}),Be=e=>de({name:`env`,async generate(){let t=T(e.config.projectRoot,`docs`,`generated`,`env.md`);return e.fs.existsSync(t)?{contents:await e.fs.read(t)||``}:{contents:``}}});async function Ve(e,t){let n=await l(e,t);return n.getProperties().forEach(e=>{e.getAlias().filter(Boolean).forEach(t=>{n.addProperty({name:t,optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,description:e.getDescription(),visibility:e.getVisibility(),type:e.getType(),default:e.getDefaultValue(),tags:{hidden:e.isHidden(),ignore:e.isIgnored(),internal:e.isInternal(),alias:e.getAlias().filter(e=>e!==t).concat(e.name),title:e.getTitle()||P(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),n}const $=(n={})=>[Fe(n.babel),{name:`env`,async config(){this.log(D.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:E(n,{types:{},prefix:[]}),transform:{babel:{plugins:[Q]}}};if(e.env.types)e.env.types=L(e.env.types);else{this.log(D.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await g(this);e.env.types=L(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=L(e.env.secrets);else{let t=await p(this);e.env.secrets=L(`${t.file}#${t.name}`)}return e.env.prefix=S(e.env.prefix??[]).reduce((e,t)=>{let n=B(t);return e.includes(n)||e.push(n),e},[...xe,`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(D.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=E({parsed:await h(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&R(c(this,`env`)))this.log(D.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await l(this,`env`),R(_(this,`env`))&&(this.env.used.env=await v(this)),R(c(this,`secrets`))&&(this.env.types.secrets=await l(this,`secrets`)),R(_(this,`secrets`))&&(this.env.used.secrets=await u(this));else{if(this.env.types.env=await e(this,this.config.env.types?.file?O(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:z(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 d(this,this.env.types.env,`env`),this.env.types.secrets=await y(this,this.config.env.secrets?.file?O(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:z(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 d(this,this.env.types.secrets,`secrets`),this.log(D.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let n=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await h(this,this.config.env)).forEach(([e,t])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=n.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(t)}),this.env.used.env=new t.ReflectionClass({kind:t.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 m(this,this.env.used.env,`env`),this.env.types.secrets&&(await d(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.ReflectionClass({kind:t.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 m(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(D.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(Oe(b,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(D.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=z(this.config.projectRoot,`docs`,`generated`);R(e)||await Se(e);let n=await l(this,`env`),r=z(e,`env.md`);this.log(D.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${P(this.config.framework)||`Powerlines`} -->
|
|
2
6
|
|
|
3
7
|
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
8
|
|
|
5
9
|
| Name | Description | Type | Default Value | Required |
|
|
6
10
|
| ---- | ----------- | ---- | ------------- | :------: |
|
|
7
|
-
${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(
|
|
8
|
-
`,``)??``).trim()} | ${(0,
|
|
11
|
+
${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
12
|
+
`,``)??``).trim()} | ${(0,t.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
|
|
9
13
|
`)}
|
|
10
|
-
`)},async buildEnd(){let e=
|
|
14
|
+
`)},async buildEnd(){let e=_(this,`env`);this.log(D.TRACE,`Writing env reflection types to ${e}.`),await m(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:E(n.automd??{},{generators:{env:Be(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},ke(n.automd)];var He=$;export{a as BaseEnv,ie as BaseSecrets,b as EnvBuiltin,x as EnvDocs,se as EnvTypeDefinition,oe as createEnvReflection,re as createReflectionResource,s as createSecretsReflection,Ve as createTemplateReflection,He as default,Q as envBabelPlugin,ee as formatEnvField,g as getEnvDefaultTypeDefinition,_ as getEnvReflectionsPath,c as getEnvTypeReflectionsPath,p as getSecretsDefaultTypeDefinition,h as loadEnv,ne as loadEnvFromContext,ae as mergeEnvReflections,r as mergeSecretsReflections,$ as plugin,v as readEnvReflection,l as readEnvTypeReflection,u as readSecretsReflection,e as reflectEnv,y as reflectSecrets,o as removeEnvPrefix,te as resolveRuntimeTypeFile,m as writeEnvReflection,f as writeEnvReflectionSync,d as writeEnvTypeReflection};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { a as BabelResolvedConfig, c as UserConfig, n as SecretsInterface, o as ResolvedConfig, s as BabelUserConfig, t as EnvInterface, u as PluginContext } from "./runtime-Bo02eIQ-.cjs";
|
|
2
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
1
3
|
import * as $ from "@stryke/capnp";
|
|
4
|
+
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
5
|
+
import { Config } from "automd";
|
|
6
|
+
import { DotenvParseOutput } from "@stryke/env/types";
|
|
2
7
|
|
|
8
|
+
//#region rolldown:runtime
|
|
9
|
+
|
|
10
|
+
import * as import___deepkit_type from "@deepkit/type";
|
|
11
|
+
//#endregion
|
|
3
12
|
//#region ../deepkit/schemas/reflection.d.ts
|
|
4
13
|
declare const ReflectionKind: {
|
|
5
14
|
readonly NEVER: 0;
|
|
@@ -1557,4 +1566,231 @@ declare class SerializedTypes extends $.Struct {
|
|
|
1557
1566
|
toString(): string;
|
|
1558
1567
|
}
|
|
1559
1568
|
//#endregion
|
|
1560
|
-
|
|
1569
|
+
//#region ../deepkit/src/types.d.ts
|
|
1570
|
+
type Reflection<T extends Record<string, any> = Record<string, any>> = type_d_exports.ReflectionClass<T> & {
|
|
1571
|
+
dataBuffer?: ArrayBuffer;
|
|
1572
|
+
messageRoot?: SerializedTypes;
|
|
1573
|
+
};
|
|
1574
|
+
//#endregion
|
|
1575
|
+
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
1576
|
+
type AlloyPluginResolvedConfig = ResolvedConfig;
|
|
1577
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
1578
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
1579
|
+
};
|
|
1580
|
+
//#endregion
|
|
1581
|
+
//#region ../plugin-automd/src/types/toc.d.ts
|
|
1582
|
+
interface TOCOptions {
|
|
1583
|
+
/**
|
|
1584
|
+
* A slugify function to generate slugs for the headings.
|
|
1585
|
+
*/
|
|
1586
|
+
slugify?: (str: string) => string;
|
|
1587
|
+
/**
|
|
1588
|
+
* The maximum depth of headings to include in the TOC.
|
|
1589
|
+
*
|
|
1590
|
+
* @defaultValue 6
|
|
1591
|
+
*/
|
|
1592
|
+
maxDepth?: number;
|
|
1593
|
+
/**
|
|
1594
|
+
* Whether to include the first H1 heading in the TOC.
|
|
1595
|
+
*/
|
|
1596
|
+
firstH1?: boolean;
|
|
1597
|
+
/**
|
|
1598
|
+
* The bullet character to use for list items in the TOC.
|
|
1599
|
+
*
|
|
1600
|
+
* @defaultValue "-"
|
|
1601
|
+
*/
|
|
1602
|
+
bullets?: string;
|
|
1603
|
+
/**
|
|
1604
|
+
* A prefix to add to each heading in the TOC.
|
|
1605
|
+
*/
|
|
1606
|
+
prefix?: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* A filter function to determine which headings to include in the TOC.
|
|
1609
|
+
*/
|
|
1610
|
+
filter?: (str: string, level: number) => boolean;
|
|
1611
|
+
}
|
|
1612
|
+
//#endregion
|
|
1613
|
+
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
1614
|
+
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
1615
|
+
/**
|
|
1616
|
+
* Path to the AutoMD configuration file.
|
|
1617
|
+
*
|
|
1618
|
+
* @remarks
|
|
1619
|
+
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
1620
|
+
*/
|
|
1621
|
+
configFile?: string;
|
|
1622
|
+
/**
|
|
1623
|
+
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
1624
|
+
*
|
|
1625
|
+
* @defaultValue true
|
|
1626
|
+
*/
|
|
1627
|
+
allowIssues?: boolean;
|
|
1628
|
+
/**
|
|
1629
|
+
* Alternate prefix strings to use for finding generators
|
|
1630
|
+
*
|
|
1631
|
+
* @remarks
|
|
1632
|
+
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
1633
|
+
*
|
|
1634
|
+
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
1635
|
+
*/
|
|
1636
|
+
prefix?: string | string[];
|
|
1637
|
+
/**
|
|
1638
|
+
* Table of Contents generator options
|
|
1639
|
+
*
|
|
1640
|
+
* @remarks
|
|
1641
|
+
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
1642
|
+
*/
|
|
1643
|
+
toc?: false | TOCOptions;
|
|
1644
|
+
};
|
|
1645
|
+
//#endregion
|
|
1646
|
+
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
1647
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
1648
|
+
type BabelPluginUserConfig = UserConfig;
|
|
1649
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
1650
|
+
transform: {
|
|
1651
|
+
babel: BabelResolvedConfig;
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
1655
|
+
//#endregion
|
|
1656
|
+
//#region src/types/plugin.d.ts
|
|
1657
|
+
type EnvType = "env" | "secrets";
|
|
1658
|
+
type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
1659
|
+
/**
|
|
1660
|
+
* 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"`.
|
|
1661
|
+
*/
|
|
1662
|
+
types?: TypeDefinitionParameter;
|
|
1663
|
+
/**
|
|
1664
|
+
* 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"`.
|
|
1665
|
+
*/
|
|
1666
|
+
secrets?: TypeDefinitionParameter;
|
|
1667
|
+
/**
|
|
1668
|
+
* An additional prefix (or list of additional prefixes) to apply to the environment variables
|
|
1669
|
+
*
|
|
1670
|
+
* @remarks
|
|
1671
|
+
* By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
|
|
1672
|
+
*/
|
|
1673
|
+
prefix?: string | string[];
|
|
1674
|
+
/**
|
|
1675
|
+
* Should the plugin inject the env variables in the source code with their values?
|
|
1676
|
+
*
|
|
1677
|
+
* @remarks
|
|
1678
|
+
* This option is set to `true` when building an application project.
|
|
1679
|
+
*
|
|
1680
|
+
* @defaultValue false
|
|
1681
|
+
*/
|
|
1682
|
+
inject?: boolean;
|
|
1683
|
+
/**
|
|
1684
|
+
* The default configuration to use when loading environment variables.
|
|
1685
|
+
*
|
|
1686
|
+
* @remarks
|
|
1687
|
+
* 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.
|
|
1688
|
+
*/
|
|
1689
|
+
defaultConfig?: Children;
|
|
1690
|
+
/**
|
|
1691
|
+
* Babel configuration options to use when injecting environment variables into the source code.
|
|
1692
|
+
*
|
|
1693
|
+
* @remarks
|
|
1694
|
+
* 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.
|
|
1695
|
+
*/
|
|
1696
|
+
babel?: BabelPluginOptions;
|
|
1697
|
+
/**
|
|
1698
|
+
* AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
|
|
1699
|
+
*
|
|
1700
|
+
* @remarks
|
|
1701
|
+
* The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
|
|
1702
|
+
*/
|
|
1703
|
+
automd?: AutoMDPluginOptions;
|
|
1704
|
+
};
|
|
1705
|
+
type EnvPluginUserConfig = BabelPluginUserConfig & {
|
|
1706
|
+
env: EnvPluginOptions;
|
|
1707
|
+
};
|
|
1708
|
+
type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
1709
|
+
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
|
|
1710
|
+
/**
|
|
1711
|
+
* The type definition for the expected env variable parameters
|
|
1712
|
+
*
|
|
1713
|
+
* @remarks
|
|
1714
|
+
* This value is parsed from the {@link EnvPluginOptions.types} option.
|
|
1715
|
+
*/
|
|
1716
|
+
types: TypeDefinition;
|
|
1717
|
+
/**
|
|
1718
|
+
* The type definition for the expected env secret parameters
|
|
1719
|
+
*
|
|
1720
|
+
* @remarks
|
|
1721
|
+
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
1722
|
+
*/
|
|
1723
|
+
secrets: TypeDefinition;
|
|
1724
|
+
/**
|
|
1725
|
+
* Should the plugin inject the env variables in the source code with their values?
|
|
1726
|
+
*
|
|
1727
|
+
* @remarks
|
|
1728
|
+
* This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
|
|
1729
|
+
*/
|
|
1730
|
+
inject: EnvPluginOptions["inject"];
|
|
1731
|
+
/**
|
|
1732
|
+
* The prefix used for environment variables
|
|
1733
|
+
*
|
|
1734
|
+
* @remarks
|
|
1735
|
+
* This value is used to filter environment variables that are loaded from the .env file and the process environment.
|
|
1736
|
+
*/
|
|
1737
|
+
prefix: string[];
|
|
1738
|
+
};
|
|
1739
|
+
};
|
|
1740
|
+
interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
|
|
1741
|
+
env: {
|
|
1742
|
+
/**
|
|
1743
|
+
* The type definitions reflection for the env variables and secrets
|
|
1744
|
+
*
|
|
1745
|
+
* @remarks
|
|
1746
|
+
* These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
|
|
1747
|
+
*/
|
|
1748
|
+
types: {
|
|
1749
|
+
/**
|
|
1750
|
+
* The type definitions for the expected env variables
|
|
1751
|
+
*/
|
|
1752
|
+
env: Reflection;
|
|
1753
|
+
/**
|
|
1754
|
+
* The type definitions for the expected env secrets
|
|
1755
|
+
*/
|
|
1756
|
+
secrets: Reflection;
|
|
1757
|
+
};
|
|
1758
|
+
/**
|
|
1759
|
+
* The current **used** environment variables and secrets reflection
|
|
1760
|
+
*
|
|
1761
|
+
* @remarks
|
|
1762
|
+
* 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.
|
|
1763
|
+
*/
|
|
1764
|
+
used: {
|
|
1765
|
+
/**
|
|
1766
|
+
* The current env variables reflection
|
|
1767
|
+
*/
|
|
1768
|
+
env: Reflection<EnvInterface>;
|
|
1769
|
+
/**
|
|
1770
|
+
* The current env secrets reflection
|
|
1771
|
+
*/
|
|
1772
|
+
secrets: Reflection<SecretsInterface>;
|
|
1773
|
+
};
|
|
1774
|
+
/**
|
|
1775
|
+
* The parsed .env configuration object
|
|
1776
|
+
*
|
|
1777
|
+
* @remarks
|
|
1778
|
+
* 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}
|
|
1779
|
+
*/
|
|
1780
|
+
parsed: DotenvParseOutput;
|
|
1781
|
+
/**
|
|
1782
|
+
* The injected environment variables and secrets reflection
|
|
1783
|
+
*
|
|
1784
|
+
* @remarks
|
|
1785
|
+
* This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
|
|
1786
|
+
*/
|
|
1787
|
+
injected: Reflection;
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
declare type __ΩEnvType = any[];
|
|
1791
|
+
declare type __ΩEnvPluginOptions = any[];
|
|
1792
|
+
declare type __ΩEnvPluginUserConfig = any[];
|
|
1793
|
+
declare type __ΩEnvPluginResolvedConfig = any[];
|
|
1794
|
+
declare type __ΩEnvPluginContext = any[];
|
|
1795
|
+
//#endregion
|
|
1796
|
+
export { EnvType as a, __ΩEnvPluginResolvedConfig as c, type_d_exports as d, EnvPluginUserConfig as i, __ΩEnvPluginUserConfig as l, EnvPluginOptions as n, __ΩEnvPluginContext as o, EnvPluginResolvedConfig as r, __ΩEnvPluginOptions as s, EnvPluginContext as t, __ΩEnvType as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { a as BabelResolvedConfig, c as UserConfig, n as SecretsInterface, o as ResolvedConfig, s as BabelUserConfig, t as EnvInterface, u as PluginContext } from "./runtime-B7kcxFAf.mjs";
|
|
2
|
+
import { Config } from "automd";
|
|
3
|
+
import { DotenvParseOutput } from "@stryke/env/types";
|
|
1
4
|
import * as $ from "@stryke/capnp";
|
|
5
|
+
import "@alloy-js/core";
|
|
6
|
+
import "@alloy-js/typescript";
|
|
7
|
+
import { Children as Children$1 } from "@alloy-js/core/jsx-runtime";
|
|
8
|
+
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
2
9
|
|
|
10
|
+
//#region ../deepkit/src/vendor/type.d.ts
|
|
11
|
+
|
|
12
|
+
import * as import___deepkit_type from "@deepkit/type";
|
|
13
|
+
//#endregion
|
|
3
14
|
//#region ../deepkit/schemas/reflection.d.ts
|
|
4
15
|
declare const ReflectionKind: {
|
|
5
16
|
readonly NEVER: 0;
|
|
@@ -1557,4 +1568,231 @@ declare class SerializedTypes extends $.Struct {
|
|
|
1557
1568
|
toString(): string;
|
|
1558
1569
|
}
|
|
1559
1570
|
//#endregion
|
|
1560
|
-
|
|
1571
|
+
//#region ../deepkit/src/types.d.ts
|
|
1572
|
+
type Reflection<T extends Record<string, any> = Record<string, any>> = type_d_exports.ReflectionClass<T> & {
|
|
1573
|
+
dataBuffer?: ArrayBuffer;
|
|
1574
|
+
messageRoot?: SerializedTypes;
|
|
1575
|
+
};
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
1578
|
+
type AlloyPluginResolvedConfig = ResolvedConfig;
|
|
1579
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
1580
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children$1) => Promise<void>;
|
|
1581
|
+
};
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region ../plugin-automd/src/types/toc.d.ts
|
|
1584
|
+
interface TOCOptions {
|
|
1585
|
+
/**
|
|
1586
|
+
* A slugify function to generate slugs for the headings.
|
|
1587
|
+
*/
|
|
1588
|
+
slugify?: (str: string) => string;
|
|
1589
|
+
/**
|
|
1590
|
+
* The maximum depth of headings to include in the TOC.
|
|
1591
|
+
*
|
|
1592
|
+
* @defaultValue 6
|
|
1593
|
+
*/
|
|
1594
|
+
maxDepth?: number;
|
|
1595
|
+
/**
|
|
1596
|
+
* Whether to include the first H1 heading in the TOC.
|
|
1597
|
+
*/
|
|
1598
|
+
firstH1?: boolean;
|
|
1599
|
+
/**
|
|
1600
|
+
* The bullet character to use for list items in the TOC.
|
|
1601
|
+
*
|
|
1602
|
+
* @defaultValue "-"
|
|
1603
|
+
*/
|
|
1604
|
+
bullets?: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* A prefix to add to each heading in the TOC.
|
|
1607
|
+
*/
|
|
1608
|
+
prefix?: string;
|
|
1609
|
+
/**
|
|
1610
|
+
* A filter function to determine which headings to include in the TOC.
|
|
1611
|
+
*/
|
|
1612
|
+
filter?: (str: string, level: number) => boolean;
|
|
1613
|
+
}
|
|
1614
|
+
//#endregion
|
|
1615
|
+
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
1616
|
+
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
1617
|
+
/**
|
|
1618
|
+
* Path to the AutoMD configuration file.
|
|
1619
|
+
*
|
|
1620
|
+
* @remarks
|
|
1621
|
+
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
1622
|
+
*/
|
|
1623
|
+
configFile?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
1626
|
+
*
|
|
1627
|
+
* @defaultValue true
|
|
1628
|
+
*/
|
|
1629
|
+
allowIssues?: boolean;
|
|
1630
|
+
/**
|
|
1631
|
+
* Alternate prefix strings to use for finding generators
|
|
1632
|
+
*
|
|
1633
|
+
* @remarks
|
|
1634
|
+
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
1635
|
+
*
|
|
1636
|
+
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
1637
|
+
*/
|
|
1638
|
+
prefix?: string | string[];
|
|
1639
|
+
/**
|
|
1640
|
+
* Table of Contents generator options
|
|
1641
|
+
*
|
|
1642
|
+
* @remarks
|
|
1643
|
+
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
1644
|
+
*/
|
|
1645
|
+
toc?: false | TOCOptions;
|
|
1646
|
+
};
|
|
1647
|
+
//#endregion
|
|
1648
|
+
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
1649
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
1650
|
+
type BabelPluginUserConfig = UserConfig;
|
|
1651
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
1652
|
+
transform: {
|
|
1653
|
+
babel: BabelResolvedConfig;
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region src/types/plugin.d.ts
|
|
1659
|
+
type EnvType = "env" | "secrets";
|
|
1660
|
+
type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
|
1661
|
+
/**
|
|
1662
|
+
* 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"`.
|
|
1663
|
+
*/
|
|
1664
|
+
types?: TypeDefinitionParameter;
|
|
1665
|
+
/**
|
|
1666
|
+
* 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"`.
|
|
1667
|
+
*/
|
|
1668
|
+
secrets?: TypeDefinitionParameter;
|
|
1669
|
+
/**
|
|
1670
|
+
* An additional prefix (or list of additional prefixes) to apply to the environment variables
|
|
1671
|
+
*
|
|
1672
|
+
* @remarks
|
|
1673
|
+
* By default, the plugin will use the `POWERLINES_` prefix. This option is useful for avoiding conflicts with other environment variables.
|
|
1674
|
+
*/
|
|
1675
|
+
prefix?: string | string[];
|
|
1676
|
+
/**
|
|
1677
|
+
* Should the plugin inject the env variables in the source code with their values?
|
|
1678
|
+
*
|
|
1679
|
+
* @remarks
|
|
1680
|
+
* This option is set to `true` when building an application project.
|
|
1681
|
+
*
|
|
1682
|
+
* @defaultValue false
|
|
1683
|
+
*/
|
|
1684
|
+
inject?: boolean;
|
|
1685
|
+
/**
|
|
1686
|
+
* The default configuration to use when loading environment variables.
|
|
1687
|
+
*
|
|
1688
|
+
* @remarks
|
|
1689
|
+
* 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.
|
|
1690
|
+
*/
|
|
1691
|
+
defaultConfig?: Children$1;
|
|
1692
|
+
/**
|
|
1693
|
+
* Babel configuration options to use when injecting environment variables into the source code.
|
|
1694
|
+
*
|
|
1695
|
+
* @remarks
|
|
1696
|
+
* 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.
|
|
1697
|
+
*/
|
|
1698
|
+
babel?: BabelPluginOptions;
|
|
1699
|
+
/**
|
|
1700
|
+
* AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
|
|
1701
|
+
*
|
|
1702
|
+
* @remarks
|
|
1703
|
+
* The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
|
|
1704
|
+
*/
|
|
1705
|
+
automd?: AutoMDPluginOptions;
|
|
1706
|
+
};
|
|
1707
|
+
type EnvPluginUserConfig = BabelPluginUserConfig & {
|
|
1708
|
+
env: EnvPluginOptions;
|
|
1709
|
+
};
|
|
1710
|
+
type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
1711
|
+
env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
|
|
1712
|
+
/**
|
|
1713
|
+
* The type definition for the expected env variable parameters
|
|
1714
|
+
*
|
|
1715
|
+
* @remarks
|
|
1716
|
+
* This value is parsed from the {@link EnvPluginOptions.types} option.
|
|
1717
|
+
*/
|
|
1718
|
+
types: TypeDefinition;
|
|
1719
|
+
/**
|
|
1720
|
+
* The type definition for the expected env secret parameters
|
|
1721
|
+
*
|
|
1722
|
+
* @remarks
|
|
1723
|
+
* This value is parsed from the {@link EnvPluginOptions.secrets} option.
|
|
1724
|
+
*/
|
|
1725
|
+
secrets: TypeDefinition;
|
|
1726
|
+
/**
|
|
1727
|
+
* Should the plugin inject the env variables in the source code with their values?
|
|
1728
|
+
*
|
|
1729
|
+
* @remarks
|
|
1730
|
+
* This value is the result of reflecting the {@link EnvPluginOptions.inject} option.
|
|
1731
|
+
*/
|
|
1732
|
+
inject: EnvPluginOptions["inject"];
|
|
1733
|
+
/**
|
|
1734
|
+
* The prefix used for environment variables
|
|
1735
|
+
*
|
|
1736
|
+
* @remarks
|
|
1737
|
+
* This value is used to filter environment variables that are loaded from the .env file and the process environment.
|
|
1738
|
+
*/
|
|
1739
|
+
prefix: string[];
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
|
|
1743
|
+
env: {
|
|
1744
|
+
/**
|
|
1745
|
+
* The type definitions reflection for the env variables and secrets
|
|
1746
|
+
*
|
|
1747
|
+
* @remarks
|
|
1748
|
+
* These reflections contains the structure of the expected environment variables and secrets as defined by the type definitions provided in the plugin configuration.
|
|
1749
|
+
*/
|
|
1750
|
+
types: {
|
|
1751
|
+
/**
|
|
1752
|
+
* The type definitions for the expected env variables
|
|
1753
|
+
*/
|
|
1754
|
+
env: Reflection;
|
|
1755
|
+
/**
|
|
1756
|
+
* The type definitions for the expected env secrets
|
|
1757
|
+
*/
|
|
1758
|
+
secrets: Reflection;
|
|
1759
|
+
};
|
|
1760
|
+
/**
|
|
1761
|
+
* The current **used** environment variables and secrets reflection
|
|
1762
|
+
*
|
|
1763
|
+
* @remarks
|
|
1764
|
+
* 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.
|
|
1765
|
+
*/
|
|
1766
|
+
used: {
|
|
1767
|
+
/**
|
|
1768
|
+
* The current env variables reflection
|
|
1769
|
+
*/
|
|
1770
|
+
env: Reflection<EnvInterface>;
|
|
1771
|
+
/**
|
|
1772
|
+
* The current env secrets reflection
|
|
1773
|
+
*/
|
|
1774
|
+
secrets: Reflection<SecretsInterface>;
|
|
1775
|
+
};
|
|
1776
|
+
/**
|
|
1777
|
+
* The parsed .env configuration object
|
|
1778
|
+
*
|
|
1779
|
+
* @remarks
|
|
1780
|
+
* 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}
|
|
1781
|
+
*/
|
|
1782
|
+
parsed: DotenvParseOutput;
|
|
1783
|
+
/**
|
|
1784
|
+
* The injected environment variables and secrets reflection
|
|
1785
|
+
*
|
|
1786
|
+
* @remarks
|
|
1787
|
+
* This reflection contains the structure of the injected environment variables and secrets that were injected into the source code during the build process.
|
|
1788
|
+
*/
|
|
1789
|
+
injected: Reflection;
|
|
1790
|
+
};
|
|
1791
|
+
}
|
|
1792
|
+
declare type __ΩEnvType = any[];
|
|
1793
|
+
declare type __ΩEnvPluginOptions = any[];
|
|
1794
|
+
declare type __ΩEnvPluginUserConfig = any[];
|
|
1795
|
+
declare type __ΩEnvPluginResolvedConfig = any[];
|
|
1796
|
+
declare type __ΩEnvPluginContext = any[];
|
|
1797
|
+
//#endregion
|
|
1798
|
+
export { EnvType as a, __ΩEnvPluginResolvedConfig as c, type_d_exports as d, EnvPluginUserConfig as i, __ΩEnvPluginUserConfig as l, EnvPluginOptions as n, __ΩEnvPluginContext as o, EnvPluginResolvedConfig as r, __ΩEnvPluginOptions as s, EnvPluginContext as t, __ΩEnvType as u };
|
|
File without changes
|