@powerlines/plugin-crypto 0.10.81 → 0.10.83
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/plugin-env/src/components/docs.cjs +1 -1
- package/dist/plugin-env/src/components/docs.mjs +1 -1
- package/dist/plugin-env/src/components/env.cjs +1 -1
- package/dist/plugin-env/src/components/env.mjs +1 -1
- package/dist/plugin-env/src/index.cjs +1 -1
- package/dist/plugin-env/src/index.mjs +1 -1
- package/dist/plugin-env/src/types/plugin.d.mts +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../deepkit/src/vendor/type.cjs`),require(`../helpers/create-reflection-resource.cjs`);let e=require(`@stryke/path/join`),t=require(`@alloy-js/core`),n=require(`@powerlines/alloy/core/contexts/context`),r=require(
|
|
1
|
+
require(`../../../deepkit/src/vendor/type.cjs`),require(`../helpers/create-reflection-resource.cjs`);let e=require(`@stryke/path/join`),t=require(`@alloy-js/core`),n=require(`@powerlines/alloy/core/contexts/context`),r=require(`react/jsx-runtime`);require(`@alloy-js/markdown`),require(`@powerlines/alloy/markdown/components/markdown-file`),require(`@powerlines/alloy/markdown/components/markdown-table`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../deepkit/src/vendor/type.mjs";import"../helpers/create-reflection-resource.mjs";import{joinPaths as e}from"@stryke/path/join";import{Show as t,code as n}from"@alloy-js/core";import{usePowerlines as r}from"@powerlines/alloy/core/contexts/context";import{jsx as i,jsxs as a}from"
|
|
1
|
+
import"../../../deepkit/src/vendor/type.mjs";import"../helpers/create-reflection-resource.mjs";import{joinPaths as e}from"@stryke/path/join";import{Show as t,code as n}from"@alloy-js/core";import{usePowerlines as r}from"@powerlines/alloy/core/contexts/context";import{jsx as i,jsxs as a}from"react/jsx-runtime";import"@alloy-js/markdown";import"@powerlines/alloy/markdown/components/markdown-file";import"@powerlines/alloy/markdown/components/markdown-table";export{};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../helpers/load.cjs`),r=require(`../helpers/create-reflection-resource.cjs`);let i=require(`defu`);i=e.__toESM(i);let a=require(`@stryke/string-format/title-case`),o=require(`@stryke/type-checks/is-null`),s=require(`@alloy-js/core`),c=require(`@alloy-js/typescript`),l=require(`@powerlines/alloy/core/contexts/context`),u=require(`@powerlines/alloy/helpers/refkey`),d=require(`@powerlines/alloy/typescript/components/builtin-file`),f=require(`@powerlines/alloy/typescript/components/tsdoc`),p=require(`@powerlines/alloy/typescript/components/typescript-interface`),m=require(`@powerlines/alloy/typescript/components/typescript-object`),h=require(
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../helpers/load.cjs`),r=require(`../helpers/create-reflection-resource.cjs`);let i=require(`defu`);i=e.__toESM(i);let a=require(`@stryke/string-format/title-case`),o=require(`@stryke/type-checks/is-null`),s=require(`@alloy-js/core`),c=require(`@alloy-js/typescript`),l=require(`@powerlines/alloy/core/contexts/context`),u=require(`@powerlines/alloy/helpers/refkey`),d=require(`@powerlines/alloy/typescript/components/builtin-file`),f=require(`@powerlines/alloy/typescript/components/tsdoc`),p=require(`@powerlines/alloy/typescript/components/typescript-interface`),m=require(`@powerlines/alloy/typescript/components/typescript-object`),h=require(`react/jsx-runtime`);function g(e){let[{defaultValue:t,reflection:n}]=(0,s.splitProps)(e,[`defaultValue`,`reflection`]),r=(0,l.usePowerlines)();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p.TypeScriptInterface,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(c.TypeDeclaration,{name:`Env`,export:!0,children:s.code` {
|
|
2
2
|
[Key in keyof EnvBase as Key ${r?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
|
|
3
3
|
}
|
|
4
4
|
`})]})}function _(e){let[{context:t,name:n}]=(0,s.splitProps)(e,[`context`,`name`]);return t?s.code`propertyName === "${n}" || propertyName.replace(/^(${t.config.env.prefix.sort((e,t)=>e.startsWith(t)?-1:t.startsWith(e)?1:e.localeCompare(t)).map(e=>`${e.replace(/_$/,``)}_`).join(`|`)})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${n.toLowerCase().replace(/[\s\-_]+/g,``)}"`:null}function v(e){let[{context:t,property:n,index:r}]=(0,s.splitProps)(e,[`context`,`property`,`index`]);return t?(0,h.jsx)(h.Fragment,{children:r===0?(0,h.jsx)(c.IfStatement,{condition:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_,{name:n.getNameAsString(),context:t}),(0,h.jsxs)(s.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[s.code` || `,(0,h.jsx)(s.For,{each:n.getAlias(),joiner:s.code` || `,children:e=>(0,h.jsx)(_,{name:e,context:t})})]})]}),children:s.code`return target["${n.getNameAsString()}"];`}):(0,h.jsx)(c.ElseIfClause,{condition:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_,{name:n.getNameAsString(),context:t}),(0,h.jsxs)(s.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[s.code` || `,(0,h.jsx)(s.For,{each:n.getAlias(),joiner:s.code` || `,children:e=>(0,h.jsx)(_,{name:e,context:t})})]})]}),children:s.code`return target["${n.getNameAsString()}"];`})}):null}function y(e){let[{context:t,property:n,index:r}]=(0,s.splitProps)(e,[`context`,`property`,`index`]);return t?(0,h.jsx)(h.Fragment,{children:r===0?(0,h.jsx)(c.IfStatement,{condition:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_,{name:n.getNameAsString(),context:t}),(0,h.jsxs)(s.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[s.code` || `,(0,h.jsx)(s.For,{each:n.getAlias(),joiner:s.code` || `,children:e=>(0,h.jsx)(_,{name:e,context:t})})]})]}),children:s.code`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{loadEnvFromContext as t}from"../helpers/load.mjs";import{createReflectionResource as n}from"../helpers/create-reflection-resource.mjs";import r from"defu";import{titleCase as i}from"@stryke/string-format/title-case";import{isNull as a}from"@stryke/type-checks/is-null";import{For as o,Show as s,code as c,computed as l,splitProps as u}from"@alloy-js/core";import{ClassDeclaration as d,ClassMethod as f,ElseIfClause as p,FunctionDeclaration as m,IfStatement as h,NewExpression as g,TypeDeclaration as _,VarDeclaration as v}from"@alloy-js/typescript";import{usePowerlines as y}from"@powerlines/alloy/core/contexts/context";import{refkey as b}from"@powerlines/alloy/helpers/refkey";import{BuiltinFile as x}from"@powerlines/alloy/typescript/components/builtin-file";import{TSDoc as S,TSDocExample as C,TSDocLink as w,TSDocParam as T,TSDocRemarks as E,TSDocReturns as D,TSDocThrows as O}from"@powerlines/alloy/typescript/components/tsdoc";import{TypeScriptInterface as k}from"@powerlines/alloy/typescript/components/typescript-interface";import{TypescriptObject as A}from"@powerlines/alloy/typescript/components/typescript-object";import{Fragment as j,jsx as M,jsxs as N}from"
|
|
1
|
+
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{loadEnvFromContext as t}from"../helpers/load.mjs";import{createReflectionResource as n}from"../helpers/create-reflection-resource.mjs";import r from"defu";import{titleCase as i}from"@stryke/string-format/title-case";import{isNull as a}from"@stryke/type-checks/is-null";import{For as o,Show as s,code as c,computed as l,splitProps as u}from"@alloy-js/core";import{ClassDeclaration as d,ClassMethod as f,ElseIfClause as p,FunctionDeclaration as m,IfStatement as h,NewExpression as g,TypeDeclaration as _,VarDeclaration as v}from"@alloy-js/typescript";import{usePowerlines as y}from"@powerlines/alloy/core/contexts/context";import{refkey as b}from"@powerlines/alloy/helpers/refkey";import{BuiltinFile as x}from"@powerlines/alloy/typescript/components/builtin-file";import{TSDoc as S,TSDocExample as C,TSDocLink as w,TSDocParam as T,TSDocRemarks as E,TSDocReturns as D,TSDocThrows as O}from"@powerlines/alloy/typescript/components/tsdoc";import{TypeScriptInterface as k}from"@powerlines/alloy/typescript/components/typescript-interface";import{TypescriptObject as A}from"@powerlines/alloy/typescript/components/typescript-object";import{Fragment as j,jsx as M,jsxs as N}from"react/jsx-runtime";function P(e){let[{defaultValue:t,reflection:n}]=u(e,[`defaultValue`,`reflection`]),r=y();return N(j,{children:[M(k,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),M(`hbr`,{}),M(`hbr`,{}),M(_,{name:`Env`,export:!0,children:c` {
|
|
2
2
|
[Key in keyof EnvBase as Key ${r?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
|
|
3
3
|
}
|
|
4
4
|
`})]})}function F(e){let[{context:t,name:n}]=u(e,[`context`,`name`]);return t?c`propertyName === "${n}" || propertyName.replace(/^(${t.config.env.prefix.sort((e,t)=>e.startsWith(t)?-1:t.startsWith(e)?1:e.localeCompare(t)).map(e=>`${e.replace(/_$/,``)}_`).join(`|`)})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${n.toLowerCase().replace(/[\s\-_]+/g,``)}"`:null}function I(e){let[{context:t,property:n,index:r}]=u(e,[`context`,`property`,`index`]);return t?M(j,{children:M(r===0?h:p,{condition:N(j,{children:[M(F,{name:n.getNameAsString(),context:t}),N(s,{when:n.getAlias()&&n.getAlias().length>0,children:[c` || `,M(o,{each:n.getAlias(),joiner:c` || `,children:e=>M(F,{name:e,context:t})})]})]}),children:c`return target["${n.getNameAsString()}"];`})}):null}function L(e){let[{context:t,property:n,index:r}]=u(e,[`context`,`property`,`index`]);return t?M(j,{children:M(r===0?h:p,{condition:N(j,{children:[M(F,{name:n.getNameAsString(),context:t}),N(s,{when:n.getAlias()&&n.getAlias().length>0,children:[c` || `,M(o,{each:n.getAlias(),joiner:c` || `,children:e=>M(F,{name:e,context:t})})]})]}),children:c`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-automd/src/index.cjs`),r=require(`../../plugin-babel/src/index.cjs`),i=require(`./helpers/reflect.cjs`),a=require(`./helpers/persistence.cjs`),o=require(`./babel/plugin.cjs`),s=require(`./helpers/source-file-env.cjs`),c=require(`./helpers/load.cjs`),l=require(`./helpers/create-reflection-resource.cjs`),u=require(`./components/env.cjs`),d=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let f=require(`@stryke/convert/to-array`),p=require(`defu`);p=e.__toESM(p);let m=require(`@storm-software/config-tools/types`),h=require(`@stryke/path/is-parent-path`),g=require(`@stryke/string-format/title-case`),_=require(`@stryke/convert/parse-type-definition`),v=require(`@stryke/env/types`),y=require(`@stryke/fs/exists`),b=require(`@stryke/fs/helpers`),x=require(`@stryke/path/join`),S=require(`@stryke/string-format/constant-case`),C=require(
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-automd/src/index.cjs`),r=require(`../../plugin-babel/src/index.cjs`),i=require(`./helpers/reflect.cjs`),a=require(`./helpers/persistence.cjs`),o=require(`./babel/plugin.cjs`),s=require(`./helpers/source-file-env.cjs`),c=require(`./helpers/load.cjs`),l=require(`./helpers/create-reflection-resource.cjs`),u=require(`./components/env.cjs`),d=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let f=require(`@stryke/convert/to-array`),p=require(`defu`);p=e.__toESM(p);let m=require(`@storm-software/config-tools/types`),h=require(`@stryke/path/is-parent-path`),g=require(`@stryke/string-format/title-case`),_=require(`@stryke/convert/parse-type-definition`),v=require(`@stryke/env/types`),y=require(`@stryke/fs/exists`),b=require(`@stryke/fs/helpers`),x=require(`@stryke/path/join`),S=require(`@stryke/string-format/constant-case`),C=require(`react/jsx-runtime`);const w=(e={})=>[r.default(e.babel),{name:`env`,async config(){this.log(m.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,p.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[o.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,_.parseTypeDefinition)(t.env.types);else{this.log(m.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await a.getEnvDefaultTypeDefinition(this);t.env.types=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,_.parseTypeDefinition)(t.env.secrets);else{let e=await a.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,f.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,S.constantCase)(t);return e.includes(n)||e.push(n),e},[...v.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(m.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,p.default)({parsed:await c.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,y.existsSync)(a.getEnvTypeReflectionsPath(this,`env`)))this.log(m.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await a.readEnvTypeReflection(this,`env`),(0,y.existsSync)(a.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await a.readEnvReflection(this)),(0,y.existsSync)(a.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await a.readEnvTypeReflection(this,`secrets`)),(0,y.existsSync)(a.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await a.readSecretsReflection(this));else{if(this.env.types.env=await i.reflectEnv(this,this.config.env.types?.file?(0,h.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,x.joinPaths)(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 a.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await i.reflectSecrets(this,this.config.env.secrets?.file?(0,h.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,x.joinPaths)(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 a.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(m.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await c.loadEnv(this,this.config.env)).forEach(([t,n])=>{let r=this.config.env.prefix.reduce((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,t),i=e.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 t.type_exports.ReflectionClass({kind:t.type_exports.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 a.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await a.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.type_exports.ReflectionClass({kind:t.type_exports.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 a.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(m.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,C.jsx)(u.EnvBuiltin,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(m.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,x.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,y.existsSync)(e)||await(0,b.createDirectory)(e);let n=await a.readEnvTypeReflection(this,`env`),r=(0,x.joinPaths)(e,`env.md`);this.log(m.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,g.titleCase)(this.config.framework)||`Powerlines`} -->
|
|
2
2
|
|
|
3
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
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-automd/src/index.mjs";import n from"../../plugin-babel/src/index.mjs";import{BaseEnv as r,BaseSecrets as i,createEnvReflection as a,createSecretsReflection as o,mergeEnvReflections as s,mergeSecretsReflections as c,reflectEnv as l,reflectSecrets as u}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as d,getEnvReflectionsPath as f,getEnvTypeReflectionsPath as p,getSecretsDefaultTypeDefinition as m,readEnvReflection as h,readEnvTypeReflection as g,readSecretsReflection as _,resolveRuntimeTypeFile as v,writeEnvReflection as y,writeEnvTypeReflection as b}from"./helpers/persistence.mjs";import{envBabelPlugin as x}from"./babel/plugin.mjs";import{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{EnvBuiltin as E,EnvTypeDefinition as D}from"./components/env.mjs";import{env as O}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{toArray as k}from"@stryke/convert/to-array";import A from"defu";import{LogLevelLabel as j}from"@storm-software/config-tools/types";import{isParentPath as M}from"@stryke/path/is-parent-path";import{titleCase as N}from"@stryke/string-format/title-case";import{parseTypeDefinition as P}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as F}from"@stryke/env/types";import{existsSync as I}from"@stryke/fs/exists";import{createDirectory as L}from"@stryke/fs/helpers";import{joinPaths as R}from"@stryke/path/join";import{constantCase as z}from"@stryke/string-format/constant-case";import{jsx as B}from"
|
|
1
|
+
import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-automd/src/index.mjs";import n from"../../plugin-babel/src/index.mjs";import{BaseEnv as r,BaseSecrets as i,createEnvReflection as a,createSecretsReflection as o,mergeEnvReflections as s,mergeSecretsReflections as c,reflectEnv as l,reflectSecrets as u}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as d,getEnvReflectionsPath as f,getEnvTypeReflectionsPath as p,getSecretsDefaultTypeDefinition as m,readEnvReflection as h,readEnvTypeReflection as g,readSecretsReflection as _,resolveRuntimeTypeFile as v,writeEnvReflection as y,writeEnvTypeReflection as b}from"./helpers/persistence.mjs";import{envBabelPlugin as x}from"./babel/plugin.mjs";import{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{EnvBuiltin as E,EnvTypeDefinition as D}from"./components/env.mjs";import{env as O}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{toArray as k}from"@stryke/convert/to-array";import A from"defu";import{LogLevelLabel as j}from"@storm-software/config-tools/types";import{isParentPath as M}from"@stryke/path/is-parent-path";import{titleCase as N}from"@stryke/string-format/title-case";import{parseTypeDefinition as P}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as F}from"@stryke/env/types";import{existsSync as I}from"@stryke/fs/exists";import{createDirectory as L}from"@stryke/fs/helpers";import{joinPaths as R}from"@stryke/path/join";import{constantCase as z}from"@stryke/string-format/constant-case";import{jsx as B}from"react/jsx-runtime";var V=(r={})=>[n(r.babel),{name:`env`,async config(){this.log(j.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:A(r,{types:{},prefix:[]}),transform:{babel:{plugins:[x]}}};if(e.env.types)e.env.types=P(e.env.types);else{this.log(j.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await d(this);e.env.types=P(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=P(e.env.secrets);else{let t=await m(this);e.env.secrets=P(`${t.file}#${t.name}`)}return e.env.prefix=k(e.env.prefix??[]).reduce((e,t)=>{let n=z(t);return e.includes(n)||e.push(n),e},[...F,`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(j.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=A({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&&I(p(this,`env`)))this.log(j.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await g(this,`env`),I(f(this,`env`))&&(this.env.used.env=await h(this)),I(p(this,`secrets`))&&(this.env.types.secrets=await g(this,`secrets`)),I(f(this,`secrets`))&&(this.env.used.secrets=await _(this));else{if(this.env.types.env=await l(this,this.config.env.types?.file?M(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:R(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 b(this,this.env.types.env,`env`),this.env.types.secrets=await u(this,this.config.env.secrets?.file?M(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:R(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 b(this,this.env.types.secrets,`secrets`),this.log(j.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 y(this,this.env.used.env,`env`),this.env.types.secrets&&(await b(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 y(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(j.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(B(E,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(j.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=R(this.config.projectRoot,`docs`,`generated`);I(t)||await L(t);let n=await g(this,`env`),r=R(t,`env.md`);this.log(j.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${N(this.config.framework)||`Powerlines`} -->
|
|
2
2
|
|
|
3
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
4
|
|
|
@@ -6,8 +6,8 @@ import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, Babe
|
|
|
6
6
|
import "../../../plugin-babel/src/types/index.mjs";
|
|
7
7
|
import { EnvInterface, SecretsInterface } from "./runtime.mjs";
|
|
8
8
|
import { DotenvParseOutput } from "@stryke/env/types";
|
|
9
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
10
9
|
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
10
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region ../plugin-env/src/types/plugin.d.ts
|
|
13
13
|
type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-crypto",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.83",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin that provides unique identifier generation capabilities at runtime by adding the `id` builtin module.",
|
|
6
6
|
"repository": {
|
|
@@ -128,17 +128,17 @@
|
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@powerlines/plugin-env": "^0.14.
|
|
131
|
+
"@powerlines/plugin-env": "^0.14.8",
|
|
132
132
|
"@storm-software/config-tools": "^1.188.74",
|
|
133
133
|
"@stryke/path": "^0.24.0",
|
|
134
134
|
"defu": "^6.1.4",
|
|
135
|
-
"powerlines": "^0.36.
|
|
135
|
+
"powerlines": "^0.36.10",
|
|
136
136
|
"@noble/ciphers": "^2.1.1"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@powerlines/nx": "^0.11.
|
|
139
|
+
"@powerlines/nx": "^0.11.36",
|
|
140
140
|
"@types/node": "^24.10.4"
|
|
141
141
|
},
|
|
142
142
|
"publishConfig": { "access": "public" },
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "ab50afb5bed1d2d55072e7375c6425980e3d03ad"
|
|
144
144
|
}
|