@powerlines/plugin-crypto 0.10.83 → 0.10.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/deepkit/src/utilities.cjs +1 -1
  2. package/dist/deepkit/src/utilities.mjs +1 -1
  3. package/dist/deepkit/src/vendor/core.cjs +1 -0
  4. package/dist/deepkit/src/vendor/core.mjs +1 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/dist/plugin-alloy/src/core/components/index.cjs +1 -0
  8. package/dist/plugin-alloy/src/core/components/index.mjs +1 -0
  9. package/dist/plugin-alloy/src/core/components/output.cjs +1 -0
  10. package/dist/plugin-alloy/src/core/components/output.mjs +1 -0
  11. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +1 -0
  12. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +1 -0
  13. package/dist/plugin-alloy/src/core/components/source-file.cjs +1 -0
  14. package/dist/plugin-alloy/src/core/components/source-file.mjs +1 -0
  15. package/dist/plugin-alloy/src/core/contexts/context.cjs +1 -0
  16. package/dist/plugin-alloy/src/core/contexts/context.mjs +1 -0
  17. package/dist/plugin-alloy/src/core/contexts/index.cjs +1 -0
  18. package/dist/plugin-alloy/src/core/contexts/index.mjs +1 -0
  19. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +1 -0
  20. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +1 -0
  21. package/dist/plugin-alloy/src/core/index.cjs +1 -0
  22. package/dist/plugin-alloy/src/core/index.mjs +1 -0
  23. package/dist/plugin-alloy/src/helpers/capnp.cjs +1 -0
  24. package/dist/plugin-alloy/src/helpers/capnp.mjs +1 -0
  25. package/dist/plugin-alloy/src/helpers/create-builtin.cjs +1 -0
  26. package/dist/plugin-alloy/src/helpers/create-builtin.mjs +1 -0
  27. package/dist/plugin-alloy/src/helpers/index.cjs +1 -0
  28. package/dist/plugin-alloy/src/helpers/index.mjs +1 -0
  29. package/dist/plugin-alloy/src/helpers/refkey.cjs +1 -0
  30. package/dist/plugin-alloy/src/helpers/refkey.mjs +1 -0
  31. package/dist/plugin-alloy/src/helpers/typescript.cjs +1 -0
  32. package/dist/plugin-alloy/src/helpers/typescript.mjs +1 -0
  33. package/dist/plugin-alloy/src/index.cjs +2 -0
  34. package/dist/plugin-alloy/src/index.mjs +2 -0
  35. package/dist/plugin-alloy/src/markdown/components/index.cjs +1 -0
  36. package/dist/plugin-alloy/src/markdown/components/index.mjs +1 -0
  37. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +1 -0
  38. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +1 -0
  39. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +1 -0
  40. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +1 -0
  41. package/dist/plugin-alloy/src/markdown/contexts/index.cjs +1 -0
  42. package/dist/plugin-alloy/src/markdown/contexts/index.mjs +1 -0
  43. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +1 -0
  44. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +1 -0
  45. package/dist/plugin-alloy/src/markdown/index.cjs +1 -0
  46. package/dist/plugin-alloy/src/markdown/index.mjs +1 -0
  47. package/dist/plugin-alloy/src/types/index.d.mts +1 -1
  48. package/dist/plugin-alloy/src/types/plugin.d.cts +5 -1
  49. package/dist/plugin-alloy/src/types/plugin.d.mts +5 -2
  50. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +1 -0
  51. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +1 -0
  52. package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.cjs +1 -0
  53. package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.mjs +1 -0
  54. package/dist/plugin-alloy/src/typescript/components/entry-file.cjs +1 -0
  55. package/dist/plugin-alloy/src/typescript/components/entry-file.mjs +1 -0
  56. package/dist/plugin-alloy/src/typescript/components/index.cjs +1 -0
  57. package/dist/plugin-alloy/src/typescript/components/index.mjs +1 -0
  58. package/dist/plugin-alloy/src/typescript/components/record-expression.cjs +1 -0
  59. package/dist/plugin-alloy/src/typescript/components/record-expression.mjs +1 -0
  60. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +1 -0
  61. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +1 -0
  62. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +1 -0
  63. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +1 -0
  64. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +1 -0
  65. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +1 -0
  66. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +1 -0
  67. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +1 -0
  68. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +1 -0
  69. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +1 -0
  70. package/dist/plugin-alloy/src/typescript/index.cjs +1 -0
  71. package/dist/plugin-alloy/src/typescript/index.mjs +1 -0
  72. package/dist/plugin-automd/src/index.cjs +1 -1
  73. package/dist/plugin-automd/src/index.mjs +1 -1
  74. package/dist/plugin-babel/src/helpers/filters.cjs +1 -1
  75. package/dist/plugin-babel/src/helpers/filters.mjs +1 -1
  76. package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -1
  77. package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -1
  78. package/dist/plugin-babel/src/index.cjs +1 -1
  79. package/dist/plugin-babel/src/index.mjs +1 -1
  80. package/dist/plugin-env/src/babel/plugin.cjs +4 -4
  81. package/dist/plugin-env/src/babel/plugin.mjs +3 -3
  82. package/dist/plugin-env/src/components/docs.cjs +1 -1
  83. package/dist/plugin-env/src/components/docs.mjs +1 -1
  84. package/dist/plugin-env/src/components/env.cjs +8 -8
  85. package/dist/plugin-env/src/components/env.mjs +7 -7
  86. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +1 -1
  87. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +1 -1
  88. package/dist/plugin-env/src/helpers/load.cjs +1 -1
  89. package/dist/plugin-env/src/helpers/load.mjs +1 -1
  90. package/dist/plugin-env/src/helpers/reflect.cjs +1 -1
  91. package/dist/plugin-env/src/helpers/reflect.mjs +1 -1
  92. package/dist/plugin-env/src/helpers/source-file-env.cjs +1 -1
  93. package/dist/plugin-env/src/helpers/source-file-env.mjs +1 -1
  94. package/dist/plugin-env/src/index.cjs +2 -2
  95. package/dist/plugin-env/src/index.mjs +2 -2
  96. package/dist/plugin-env/src/types/plugin.d.cts +10 -3
  97. package/dist/plugin-env/src/types/plugin.d.mts +10 -3
  98. package/dist/powerlines/src/lib/build/esbuild.cjs +9 -9
  99. package/dist/powerlines/src/lib/build/esbuild.mjs +9 -9
  100. package/dist/powerlines/src/lib/entry.cjs +1 -1
  101. package/dist/powerlines/src/lib/entry.mjs +1 -1
  102. package/dist/powerlines/src/lib/logger.cjs +1 -1
  103. package/dist/powerlines/src/lib/logger.mjs +1 -1
  104. package/dist/powerlines/src/types/config.d.mts +1 -1
  105. package/package.json +5 -5
@@ -1,13 +1,13 @@
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` {
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(`@alloy-js/core`),a=require(`react/jsx-runtime`),o=require(`defu`);o=e.__toESM(o);let s=require(`@stryke/type-checks/is-null`),c=require(`@stryke/string-format/title-case`),l=require(`@alloy-js/typescript`),u=require(`@powerlines/alloy/core/contexts/context`),d=require(`@powerlines/alloy/helpers/refkey`),f=require(`@powerlines/alloy/typescript/components/builtin-file`),p=require(`@powerlines/alloy/typescript/components/tsdoc`),m=require(`@powerlines/alloy/typescript/components/typescript-interface`),h=require(`@powerlines/alloy/typescript/components/typescript-object`);function g(e){let[{defaultValue:t,reflection:n}]=(0,i.splitProps)(e,[`defaultValue`,`reflection`]),r=(0,u.usePowerlines)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.TypeScriptInterface,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(l.TypeDeclaration,{name:`Env`,export:!0,children:i.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
- `})]})}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`
4
+ `})]})}function _(e){let[{context:t,name:n}]=(0,i.splitProps)(e,[`context`,`name`]);return t?i.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,i.splitProps)(e,[`context`,`property`,`index`]);return t?(0,a.jsx)(a.Fragment,{children:r===0?(0,a.jsx)(l.IfStatement,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`return target["${n.getNameAsString()}"];`}):(0,a.jsx)(l.ElseIfClause,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`return target["${n.getNameAsString()}"];`})}):null}function y(e){let[{context:t,property:n,index:r}]=(0,i.splitProps)(e,[`context`,`property`,`index`]);return t?(0,a.jsx)(a.Fragment,{children:r===0?(0,a.jsx)(l.IfStatement,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`
5
5
  target["${n.getNameAsString()}"] = newValue;
6
6
  return true;
7
- `}):(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`
7
+ `}):(0,a.jsx)(l.ElseIfClause,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`
8
8
  target["${n.getNameAsString()}"] = newValue;
9
9
  return true;
10
- `})}):null}const b=(0,u.refkey)(`createEnv`),x=(0,u.refkey)(`env`),S=(0,u.refkey)(`EnvSerializer`);function C(e){let[{defaultConfig:u},p]=(0,s.splitProps)(e,[`defaultConfig`]),_=(0,l.usePowerlines)(),C=(0,s.computed)(()=>_&&n.loadEnvFromContext(_,process.env)),w=r.createReflectionResource(_),T=(0,s.computed)(()=>new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${(0,a.titleCase)(_?.config?.name)} project.`,types:[]},w.data??void 0)),E=(0,s.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),D=(0,s.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return(0,h.jsxs)(d.BuiltinFile,{...p,id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,imports:(0,i.default)({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},p.imports??{}),children:[(0,h.jsxs)(s.Show,{when:!(0,o.isNull)(w.data),children:[(0,h.jsx)(g,{defaultValue:C.value,reflection:w.data}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{})]}),(0,h.jsx)(m.TypescriptObject,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:C,reflection:T,export:!0,const:!0}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsxs)(f.TSDoc,{heading:`The environment configuration serializer for the Powerlines application.`,children:[(0,h.jsx)(f.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,h.jsx)(f.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,h.jsx)(f.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),(0,h.jsx)(c.ClassDeclaration,{refkey:S,name:`EnvSerializer`,extends:`Serializer`,export:!0,children:(0,h.jsx)(c.ClassMethod,{name:`constructor`,public:!0,children:s.code`
10
+ `})}):null}const b=(0,d.refkey)(`createEnv`),x=(0,d.refkey)(`env`),S=(0,d.refkey)(`EnvSerializer`);function C(e){let[{defaultConfig:d},m]=(0,i.splitProps)(e,[`defaultConfig`]),_=(0,u.usePowerlines)(),C=(0,i.computed)(()=>_&&n.loadEnvFromContext(_,process.env)),w=r.createReflectionResource(_),T=(0,i.computed)(()=>new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${(0,c.titleCase)(_?.config?.name)} project.`,types:[]},w.data??void 0)),E=(0,i.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),D=(0,i.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return(0,a.jsxs)(f.BuiltinFile,{...m,id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,imports:(0,o.default)({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},m.imports??{}),children:[(0,a.jsxs)(i.Show,{when:!(0,s.isNull)(w.data),children:[(0,a.jsx)(g,{defaultValue:C.value,reflection:w.data}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{})]}),(0,a.jsx)(h.TypescriptObject,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:C,reflection:T,export:!0,const:!0}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsxs)(p.TSDoc,{heading:`The environment configuration serializer for the Powerlines application.`,children:[(0,a.jsx)(p.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,a.jsx)(p.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,a.jsx)(p.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),(0,a.jsx)(l.ClassDeclaration,{refkey:S,name:`EnvSerializer`,extends:`Serializer`,export:!0,children:(0,a.jsx)(l.ClassMethod,{name:`constructor`,public:!0,children:i.code`
11
11
  super("env");
12
12
 
13
13
  this.deserializeRegistry.register(
@@ -18,17 +18,17 @@ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../de
18
18
  );
19
19
  }
20
20
  );
21
- `})}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsxs)(f.TSDoc,{heading:`A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.`,children:[(0,h.jsx)(f.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,h.jsx)(f.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,h.jsx)(f.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),(0,h.jsx)(c.VarDeclaration,{name:`envSerializer`,export:!1,const:!0,initializer:(0,h.jsx)(c.NewExpression,{args:[],target:`EnvSerializer`})}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsxs)(f.TSDoc,{heading:`Serialize a environment configuration object to JSON data objects (not a JSON string).`,children:[(0,h.jsx)(f.TSDocRemarks,{children:`The resulting JSON object can be stringified using JSON.stringify().`}),(0,h.jsx)(f.TSDocExample,{children:`const json = serializeEnv(env);`}),(0,h.jsx)(f.TSDocThrows,{children:`ValidationError when serialization or validation fails.`})]}),(0,h.jsx)(c.VarDeclaration,{name:`serializeEnv`,export:!0,const:!0,initializer:`serializeFunction<EnvBase>(envSerializer)`}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsxs)(f.TSDoc,{heading:`Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.`,children:[(0,h.jsx)(f.TSDocRemarks,{children:`Types that are already correct will be used as-is.`}),(0,h.jsx)(f.TSDocExample,{children:`const env = deserializeEnv(json);`}),(0,h.jsx)(f.TSDocThrows,{children:`ValidationError when deserialization fails.`})]}),(0,h.jsx)(c.VarDeclaration,{name:`deserializeEnv`,export:!0,const:!0,initializer:`deserializeFunction<EnvBase>(envSerializer)`}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsxs)(f.TSDoc,{heading:`Initializes the Powerlines environment configuration module.`,children:[(0,h.jsx)(f.TSDocRemarks,{children:`This function initializes the Powerlines environment configuration object.`}),(0,h.jsx)(f.TSDocParam,{name:`environmentConfig`,children:`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}),(0,h.jsx)(f.TSDocReturns,{children:`The initialized Powerlines configuration object.`})]}),(0,h.jsx)(s.Show,{when:!!_?.entryPath,children:(0,h.jsxs)(c.FunctionDeclaration,{refkey:b,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,children:[s.code`
21
+ `})}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsxs)(p.TSDoc,{heading:`A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.`,children:[(0,a.jsx)(p.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,a.jsx)(p.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,a.jsx)(p.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),(0,a.jsx)(l.VarDeclaration,{name:`envSerializer`,export:!1,const:!0,initializer:(0,a.jsx)(l.NewExpression,{args:[],target:`EnvSerializer`})}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsxs)(p.TSDoc,{heading:`Serialize a environment configuration object to JSON data objects (not a JSON string).`,children:[(0,a.jsx)(p.TSDocRemarks,{children:`The resulting JSON object can be stringified using JSON.stringify().`}),(0,a.jsx)(p.TSDocExample,{children:`const json = serializeEnv(env);`}),(0,a.jsx)(p.TSDocThrows,{children:`ValidationError when serialization or validation fails.`})]}),(0,a.jsx)(l.VarDeclaration,{name:`serializeEnv`,export:!0,const:!0,initializer:`serializeFunction<EnvBase>(envSerializer)`}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsxs)(p.TSDoc,{heading:`Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.`,children:[(0,a.jsx)(p.TSDocRemarks,{children:`Types that are already correct will be used as-is.`}),(0,a.jsx)(p.TSDocExample,{children:`const env = deserializeEnv(json);`}),(0,a.jsx)(p.TSDocThrows,{children:`ValidationError when deserialization fails.`})]}),(0,a.jsx)(l.VarDeclaration,{name:`deserializeEnv`,export:!0,const:!0,initializer:`deserializeFunction<EnvBase>(envSerializer)`}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsxs)(p.TSDoc,{heading:`Initializes the Powerlines environment configuration module.`,children:[(0,a.jsx)(p.TSDocRemarks,{children:`This function initializes the Powerlines environment configuration object.`}),(0,a.jsx)(p.TSDocParam,{name:`environmentConfig`,children:`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}),(0,a.jsx)(p.TSDocReturns,{children:`The initialized Powerlines configuration object.`})]}),(0,a.jsx)(i.Show,{when:!!_?.entryPath,children:(0,a.jsxs)(l.FunctionDeclaration,{refkey:b,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,children:[i.code`
22
22
  return new Proxy<Env>(
23
23
  deserializeEnv({
24
24
  ...initialEnv,
25
25
  ...environmentConfig
26
26
  }) as Env,
27
27
  {
28
- get: (target: EnvBase, propertyName: string) => { `,(0,h.jsx)(`hbr`,{}),(0,h.jsx)(s.For,{each:E,children:(e,t)=>(0,h.jsx)(v,{index:t,context:_,property:e})}),s.code`
28
+ get: (target: EnvBase, propertyName: string) => { `,(0,a.jsx)(`hbr`,{}),(0,a.jsx)(i.For,{each:E,children:(e,t)=>(0,a.jsx)(v,{index:t,context:_,property:e})}),i.code`
29
29
  return undefined;
30
- }, `,(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),s.code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,(0,h.jsx)(`hbr`,{}),(0,h.jsx)(s.For,{each:D,ender:s.code` else `,children:(e,t)=>(0,h.jsx)(y,{index:t,context:_,property:e})}),(0,h.jsx)(`hbr`,{}),s.code`return false;
30
+ }, `,(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),i.code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,(0,a.jsx)(`hbr`,{}),(0,a.jsx)(i.For,{each:D,ender:i.code` else `,children:(e,t)=>(0,a.jsx)(y,{index:t,context:_,property:e})}),(0,a.jsx)(`hbr`,{}),i.code`return false;
31
31
  }
32
32
  }
33
33
  );
34
- `]})}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(c.VarDeclaration,{refkey:x,name:`env`,type:`Env`,export:!0,const:!0,initializer:(0,h.jsxs)(h.Fragment,{children:[s.code`createEnv(`,u||`{}`,s.code` as Partial<Env>)`]})})]})}exports.EnvBuiltin=C,exports.EnvTypeDefinition=g;
34
+ `]})}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(l.VarDeclaration,{refkey:x,name:`env`,type:`Env`,export:!0,const:!0,initializer:(0,a.jsxs)(a.Fragment,{children:[i.code`createEnv(`,d||`{}`,i.code` as Partial<Env>)`]})})]})}exports.EnvBuiltin=C,exports.EnvTypeDefinition=g;
@@ -1,10 +1,10 @@
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` {
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{For as r,Show as i,code as a,computed as o,splitProps as s}from"@alloy-js/core";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import d from"defu";import{isNull as f}from"@stryke/type-checks/is-null";import{titleCase as p}from"@stryke/string-format/title-case";import{ClassDeclaration as m,ClassMethod as h,ElseIfClause as g,FunctionDeclaration as _,IfStatement as v,NewExpression as y,TypeDeclaration as b,VarDeclaration as x}from"@alloy-js/typescript";import{usePowerlines as S}from"@powerlines/alloy/core/contexts/context";import{refkey as C}from"@powerlines/alloy/helpers/refkey";import{BuiltinFile as w}from"@powerlines/alloy/typescript/components/builtin-file";import{TSDoc as T,TSDocExample as E,TSDocLink as D,TSDocParam as O,TSDocRemarks as k,TSDocReturns as A,TSDocThrows as j}from"@powerlines/alloy/typescript/components/tsdoc";import{TypeScriptInterface as M}from"@powerlines/alloy/typescript/components/typescript-interface";import{TypescriptObject as N}from"@powerlines/alloy/typescript/components/typescript-object";function P(e){let[{defaultValue:t,reflection:n}]=s(e,[`defaultValue`,`reflection`]),r=S();return u(c,{children:[l(M,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),l(`hbr`,{}),l(`hbr`,{}),l(b,{name:`Env`,export:!0,children:a` {
2
2
  [Key in keyof EnvBase as Key ${r?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
3
3
  }
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`
4
+ `})]})}function F(e){let[{context:t,name:n}]=s(e,[`context`,`name`]);return t?a`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:o}]=s(e,[`context`,`property`,`index`]);return t?l(c,{children:l(o===0?v:g,{condition:u(c,{children:[l(F,{name:n.getNameAsString(),context:t}),u(i,{when:n.getAlias()&&n.getAlias().length>0,children:[a` || `,l(r,{each:n.getAlias(),joiner:a` || `,children:e=>l(F,{name:e,context:t})})]})]}),children:a`return target["${n.getNameAsString()}"];`})}):null}function L(e){let[{context:t,property:n,index:o}]=s(e,[`context`,`property`,`index`]);return t?l(c,{children:l(o===0?v:g,{condition:u(c,{children:[l(F,{name:n.getNameAsString(),context:t}),u(i,{when:n.getAlias()&&n.getAlias().length>0,children:[a` || `,l(r,{each:n.getAlias(),joiner:a` || `,children:e=>l(F,{name:e,context:t})})]})]}),children:a`
5
5
  target["${n.getNameAsString()}"] = newValue;
6
6
  return true;
7
- `})}):null}const R=b(`createEnv`),z=b(`env`),B=b(`EnvSerializer`);function V(p){let[{defaultConfig:h},_]=u(p,[`defaultConfig`]),b=y(),k=l(()=>b&&t(b,process.env)),F=n(b),V=l(()=>new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${i(b?.config?.name)} project.`,types:[]},F.data??void 0)),H=l(()=>F.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),U=l(()=>F.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return N(x,{..._,id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,imports:r({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},_.imports??{}),children:[N(s,{when:!a(F.data),children:[M(P,{defaultValue:k.value,reflection:F.data}),M(`hbr`,{}),M(`hbr`,{})]}),M(A,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:k,reflection:V,export:!0,const:!0}),M(`hbr`,{}),M(`hbr`,{}),N(S,{heading:`The environment configuration serializer for the Powerlines application.`,children:[M(w,{children:`https://deepkit.io/docs/serialization/serializers`}),M(w,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),M(E,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),M(d,{refkey:B,name:`EnvSerializer`,extends:`Serializer`,export:!0,children:M(f,{name:`constructor`,public:!0,children:c`
7
+ `})}):null}const R=C(`createEnv`),z=C(`env`),B=C(`EnvSerializer`);function V(g){let[{defaultConfig:v},b]=s(g,[`defaultConfig`]),C=S(),M=o(()=>C&&t(C,process.env)),F=n(C),V=o(()=>new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${p(C?.config?.name)} project.`,types:[]},F.data??void 0)),H=o(()=>F.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),U=o(()=>F.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return u(w,{...b,id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,imports:d({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},b.imports??{}),children:[u(i,{when:!f(F.data),children:[l(P,{defaultValue:M.value,reflection:F.data}),l(`hbr`,{}),l(`hbr`,{})]}),l(N,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:M,reflection:V,export:!0,const:!0}),l(`hbr`,{}),l(`hbr`,{}),u(T,{heading:`The environment configuration serializer for the Powerlines application.`,children:[l(D,{children:`https://deepkit.io/docs/serialization/serializers`}),l(D,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),l(k,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),l(m,{refkey:B,name:`EnvSerializer`,extends:`Serializer`,export:!0,children:l(h,{name:`constructor`,public:!0,children:a`
8
8
  super("env");
9
9
 
10
10
  this.deserializeRegistry.register(
@@ -15,17 +15,17 @@ import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{loadE
15
15
  );
16
16
  }
17
17
  );
18
- `})}),M(`hbr`,{}),M(`hbr`,{}),N(S,{heading:`A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.`,children:[M(w,{children:`https://deepkit.io/docs/serialization/serializers`}),M(w,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),M(E,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),M(v,{name:`envSerializer`,export:!1,const:!0,initializer:M(g,{args:[],target:`EnvSerializer`})}),M(`hbr`,{}),M(`hbr`,{}),N(S,{heading:`Serialize a environment configuration object to JSON data objects (not a JSON string).`,children:[M(E,{children:`The resulting JSON object can be stringified using JSON.stringify().`}),M(C,{children:`const json = serializeEnv(env);`}),M(O,{children:`ValidationError when serialization or validation fails.`})]}),M(v,{name:`serializeEnv`,export:!0,const:!0,initializer:`serializeFunction<EnvBase>(envSerializer)`}),M(`hbr`,{}),M(`hbr`,{}),N(S,{heading:`Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.`,children:[M(E,{children:`Types that are already correct will be used as-is.`}),M(C,{children:`const env = deserializeEnv(json);`}),M(O,{children:`ValidationError when deserialization fails.`})]}),M(v,{name:`deserializeEnv`,export:!0,const:!0,initializer:`deserializeFunction<EnvBase>(envSerializer)`}),M(`hbr`,{}),M(`hbr`,{}),N(S,{heading:`Initializes the Powerlines environment configuration module.`,children:[M(E,{children:`This function initializes the Powerlines environment configuration object.`}),M(T,{name:`environmentConfig`,children:`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}),M(D,{children:`The initialized Powerlines configuration object.`})]}),M(s,{when:!!b?.entryPath,children:N(m,{refkey:R,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,children:[c`
18
+ `})}),l(`hbr`,{}),l(`hbr`,{}),u(T,{heading:`A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.`,children:[l(D,{children:`https://deepkit.io/docs/serialization/serializers`}),l(D,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),l(k,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),l(x,{name:`envSerializer`,export:!1,const:!0,initializer:l(y,{args:[],target:`EnvSerializer`})}),l(`hbr`,{}),l(`hbr`,{}),u(T,{heading:`Serialize a environment configuration object to JSON data objects (not a JSON string).`,children:[l(k,{children:`The resulting JSON object can be stringified using JSON.stringify().`}),l(E,{children:`const json = serializeEnv(env);`}),l(j,{children:`ValidationError when serialization or validation fails.`})]}),l(x,{name:`serializeEnv`,export:!0,const:!0,initializer:`serializeFunction<EnvBase>(envSerializer)`}),l(`hbr`,{}),l(`hbr`,{}),u(T,{heading:`Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.`,children:[l(k,{children:`Types that are already correct will be used as-is.`}),l(E,{children:`const env = deserializeEnv(json);`}),l(j,{children:`ValidationError when deserialization fails.`})]}),l(x,{name:`deserializeEnv`,export:!0,const:!0,initializer:`deserializeFunction<EnvBase>(envSerializer)`}),l(`hbr`,{}),l(`hbr`,{}),u(T,{heading:`Initializes the Powerlines environment configuration module.`,children:[l(k,{children:`This function initializes the Powerlines environment configuration object.`}),l(O,{name:`environmentConfig`,children:`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}),l(A,{children:`The initialized Powerlines configuration object.`})]}),l(i,{when:!!C?.entryPath,children:u(_,{refkey:R,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,children:[a`
19
19
  return new Proxy<Env>(
20
20
  deserializeEnv({
21
21
  ...initialEnv,
22
22
  ...environmentConfig
23
23
  }) as Env,
24
24
  {
25
- get: (target: EnvBase, propertyName: string) => { `,M(`hbr`,{}),M(o,{each:H,children:(e,t)=>M(I,{index:t,context:b,property:e})}),c`
25
+ get: (target: EnvBase, propertyName: string) => { `,l(`hbr`,{}),l(r,{each:H,children:(e,t)=>l(I,{index:t,context:C,property:e})}),a`
26
26
  return undefined;
27
- }, `,M(`hbr`,{}),M(`hbr`,{}),c` set: (target: EnvBase, propertyName: string, newValue: any) => { `,M(`hbr`,{}),M(o,{each:U,ender:c` else `,children:(e,t)=>M(L,{index:t,context:b,property:e})}),M(`hbr`,{}),c`return false;
27
+ }, `,l(`hbr`,{}),l(`hbr`,{}),a` set: (target: EnvBase, propertyName: string, newValue: any) => { `,l(`hbr`,{}),l(r,{each:U,ender:a` else `,children:(e,t)=>l(L,{index:t,context:C,property:e})}),l(`hbr`,{}),a`return false;
28
28
  }
29
29
  }
30
30
  );
31
- `]})}),M(`hbr`,{}),M(`hbr`,{}),M(`hbr`,{}),M(v,{refkey:z,name:`env`,type:`Env`,export:!0,const:!0,initializer:N(j,{children:[c`createEnv(`,h||`{}`,c` as Partial<Env>)`]})})]})}export{V as EnvBuiltin,P as EnvTypeDefinition};
31
+ `]})}),l(`hbr`,{}),l(`hbr`,{}),l(`hbr`,{}),l(x,{refkey:z,name:`env`,type:`Env`,export:!0,const:!0,initializer:u(c,{children:[a`createEnv(`,v||`{}`,a` as Partial<Env>)`]})})]})}export{V as EnvBuiltin,P as EnvTypeDefinition};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`./persistence.cjs`),r=require(`./load.cjs`);let i=require(`@stryke/string-format/title-case`),a=require(`@alloy-js/core`);function o(e){let o=(0,a.computed)(()=>e&&r.loadEnvFromContext(e,process.env));return(0,a.createResource)(async()=>{if(!e)return new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the Powerlines project.`,types:[]});let r=await n.readEnvTypeReflection(e,`env`);return r.getProperties().forEach(e=>{e.getAlias().filter(Boolean).forEach(t=>{r.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()||(0,i.titleCase)(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),r.getProperties().forEach(e=>{e.setDefaultValue(o.value?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>e??o.value?.[t],void 0)??e.getDefaultValue())}),r})}exports.createReflectionResource=o;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`./persistence.cjs`),r=require(`./load.cjs`);let i=require(`@alloy-js/core`),a=require(`@stryke/string-format/title-case`);function o(e){let o=(0,i.computed)(()=>e&&r.loadEnvFromContext(e,process.env));return(0,i.createResource)(async()=>{if(!e)return new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the Powerlines project.`,types:[]});let r=await n.readEnvTypeReflection(e,`env`);return r.getProperties().forEach(e=>{e.getAlias().filter(Boolean).forEach(t=>{r.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()||(0,a.titleCase)(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),r.getProperties().forEach(e=>{e.setDefaultValue(o.value?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>e??o.value?.[t],void 0)??e.getDefaultValue())}),r})}exports.createReflectionResource=o;
@@ -1 +1 @@
1
- import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{readEnvTypeReflection as t}from"./persistence.mjs";import{loadEnvFromContext as n}from"./load.mjs";import{titleCase as r}from"@stryke/string-format/title-case";import{computed as i,createResource as a}from"@alloy-js/core";function o(o){let s=i(()=>o&&n(o,process.env));return a(async()=>{if(!o)return new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the Powerlines project.`,types:[]});let n=await t(o,`env`);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()||r(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),n.getProperties().forEach(e=>{e.setDefaultValue(s.value?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>e??s.value?.[t],void 0)??e.getDefaultValue())}),n})}export{o as createReflectionResource};
1
+ import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{readEnvTypeReflection as t}from"./persistence.mjs";import{loadEnvFromContext as n}from"./load.mjs";import{computed as r,createResource as i}from"@alloy-js/core";import{titleCase as a}from"@stryke/string-format/title-case";function o(o){let s=r(()=>o&&n(o,process.env));return i(async()=>{if(!o)return new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the Powerlines project.`,types:[]});let n=await t(o,`env`);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()||a(e.name),readonly:e.isReadonly(),permission:e.getPermission(),domain:e.getDomain()}})})}),n.getProperties().forEach(e=>{e.setDefaultValue(s.value?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>e??s.value?.[t],void 0)??e.getDefaultValue())}),n})}export{o as createReflectionResource};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/path/join-paths`),r=require(`c12`),i=require(`defu`);i=e.__toESM(i);let a=require(`@stryke/type-checks/is-set-object`),o=require(`@stryke/type-checks/is-set-string`),s=require(`@stryke/string-format/kebab-case`),c=require(`@stryke/env/load-env`);async function l(e,n,r){let a=await(0,c.loadEnv)(r,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,c.loadEnvFile)(e,r)));for(let e of t)a=(0,i.default)(e,a)}return t.removeEnvPrefix(a)}async function u(e,t,a,o,s,c){let[u,d]=await Promise.all([l(e,a,t),(0,r.loadConfig)({cwd:t,name:`storm`,envName:a,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:a,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,n.joinPaths)(o,`jiti`),moduleCache:!0}})]);return(0,i.default)(u,d.config,c)}function d(e,t){return(0,i.default)({APP_NAME:(0,s.kebabCase)(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${(0,s.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:(0,o.isSetString)(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},(0,a.isSetObject)(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,r,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return(0,i.default)(d(e,process.env),n,r,a)}exports.loadEnv=f,exports.loadEnvFromContext=d;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/type-checks/is-set-string`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/path/join-paths`),a=require(`c12`),o=require(`@stryke/type-checks/is-set-object`),s=require(`@stryke/string-format/kebab-case`),c=require(`@stryke/env/load-env`);async function l(e,n,i){let a=await(0,c.loadEnv)(i,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,c.loadEnvFile)(e,i)));for(let e of t)a=(0,r.default)(e,a)}return t.removeEnvPrefix(a)}async function u(e,t,n,o,s,c){let[u,d]=await Promise.all([l(e,n,t),(0,a.loadConfig)({cwd:t,name:`storm`,envName:n,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:n,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,i.joinPaths)(o,`jiti`),moduleCache:!0}})]);return(0,r.default)(u,d.config,c)}function d(e,t){return(0,r.default)({APP_NAME:(0,s.kebabCase)(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${(0,s.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:(0,n.isSetString)(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},(0,o.isSetObject)(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return(0,r.default)(d(e,process.env),n,i,a)}exports.loadEnv=f,exports.loadEnvFromContext=d;
@@ -1 +1 @@
1
- import{removeEnvPrefix as e}from"./source-file-env.mjs";import{joinPaths as t}from"@stryke/path/join-paths";import{loadConfig as n}from"c12";import r from"defu";import{isSetObject as i}from"@stryke/type-checks/is-set-object";import{isSetString as a}from"@stryke/type-checks/is-set-string";import{kebabCase as o}from"@stryke/string-format/kebab-case";import{loadEnv as s,loadEnvFile as c}from"@stryke/env/load-env";async function l(t,n,i){let a=await s(i,n);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>c(e,i)));for(let t of e)a=r(t,a)}return e(a)}async function u(e,i,a,o,s,c){let[u,d]=await Promise.all([l(e,a,i),n({cwd:i,name:`storm`,envName:a,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:a,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:t(o,`jiti`),moduleCache:!0}})]);return r(u,d.config,c)}function d(e,t){return r({APP_NAME:o(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${o(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:a(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},i(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return r(d(e,process.env),n,i,a)}export{f as loadEnv,d as loadEnvFromContext};
1
+ import{removeEnvPrefix as e}from"./source-file-env.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import n from"defu";import{joinPaths as r}from"@stryke/path/join-paths";import{loadConfig as i}from"c12";import{isSetObject as a}from"@stryke/type-checks/is-set-object";import{kebabCase as o}from"@stryke/string-format/kebab-case";import{loadEnv as s,loadEnvFile as c}from"@stryke/env/load-env";async function l(t,r,i){let a=await s(i,r);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>c(e,i)));for(let t of e)a=n(t,a)}return e(a)}async function u(e,t,a,o,s,c){let[u,d]=await Promise.all([l(e,a,t),i({cwd:t,name:`storm`,envName:a,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:a,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:r(o,`jiti`),moduleCache:!0}})]);return n(u,d.config,c)}function d(e,r){return n({APP_NAME:o(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${o(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:t(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},a(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,t)=>(e[t.name]=r[t.name]??t.getDefaultValue(),e),{}):{})}async function f(e,t){let[r,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return n(d(e,process.env),r,i,a)}export{f as loadEnv,d as loadEnvFromContext};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../deepkit/src/reflect-type.cjs`),r=require(`./persistence.cjs`);let i=require(`@stryke/path/join-paths`),a=require(`@stryke/path/is-parent-path`),o=require(`@stryke/string-format/title-case`);function s(e,n){return d(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}function c(e,n){return f(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}var l=class{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},u=class{ENCRYPTION_KEY};function d(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base environment configuration definition for the ${(0,o.titleCase)(e.config.name)} project.`,classType:l,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${(0,o.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${(0,o.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function f(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base secrets configuration definition for the ${(0,o.titleCase)(e.config.name)} project.`,classType:u,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${(0,o.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${(0,o.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function p(e,o,c){let l;o&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,a.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,i.joinPaths)(e.workspaceConfig.workspaceRoot,o),name:c},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getEnvDefaultTypeDefinition(e));return s(e,[await r.readEnvTypeReflection(e,`env`),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}async function m(e,o,s){let l;o&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,a.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,i.joinPaths)(e.workspaceConfig.workspaceRoot,o),name:s},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getSecretsDefaultTypeDefinition(e));return c(e,[await r.readSecretsReflection(e),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}exports.BaseEnv=l,exports.BaseSecrets=u,exports.createEnvReflection=d,exports.createSecretsReflection=f,exports.mergeEnvReflections=s,exports.mergeSecretsReflections=c,exports.reflectEnv=p,exports.reflectSecrets=m;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../deepkit/src/reflect-type.cjs`),r=require(`./persistence.cjs`);let i=require(`@stryke/path/is-parent-path`),a=require(`@stryke/string-format/title-case`),o=require(`@stryke/path/join-paths`);function s(e,n){return d(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}function c(e,n){return f(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}var l=class{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},u=class{ENCRYPTION_KEY};function d(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base environment configuration definition for the ${(0,a.titleCase)(e.config.name)} project.`,classType:l,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${(0,a.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${(0,a.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function f(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base secrets configuration definition for the ${(0,a.titleCase)(e.config.name)} project.`,classType:u,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${(0,a.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${(0,a.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function p(e,a,c){let l;a&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,i.isParentPath)(a,e.workspaceConfig.workspaceRoot)?a:(0,o.joinPaths)(e.workspaceConfig.workspaceRoot,a),name:c},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getEnvDefaultTypeDefinition(e));return s(e,[await r.readEnvTypeReflection(e,`env`),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}async function m(e,a,s){let l;a&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,i.isParentPath)(a,e.workspaceConfig.workspaceRoot)?a:(0,o.joinPaths)(e.workspaceConfig.workspaceRoot,a),name:s},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getSecretsDefaultTypeDefinition(e));return c(e,[await r.readSecretsReflection(e),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}exports.BaseEnv=l,exports.BaseSecrets=u,exports.createEnvReflection=d,exports.createSecretsReflection=f,exports.mergeEnvReflections=s,exports.mergeSecretsReflections=c,exports.reflectEnv=p,exports.reflectSecrets=m;
@@ -1 +1 @@
1
- import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{reflectType as t}from"../../../deepkit/src/reflect-type.mjs";import{getEnvDefaultTypeDefinition as n,getSecretsDefaultTypeDefinition as r,readEnvTypeReflection as i,readSecretsReflection as a}from"./persistence.mjs";import{joinPaths as o}from"@stryke/path/join-paths";import{isParentPath as s}from"@stryke/path/is-parent-path";import{titleCase as c}from"@stryke/string-format/title-case";function l(t,n){return p(t,{type:(0,e.merge)(n.map(e=>e.type))})}function u(t,n){return m(t,{type:(0,e.merge)(n.map(e=>e.type))})}var d=class{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},f=class{ENCRYPTION_KEY};function p(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base environment configuration definition for the ${c(t.config.name)} project.`,classType:d,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${c(t.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${t.config.name?`${c(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function m(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base secrets configuration definition for the ${c(t.config.name)} project.`,classType:f,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${c(t.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${t.config.name?`${c(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function h(r,a,c){let u;a&&(u=(0,e.resolveClassType)(await t(r,{file:s(a,r.workspaceConfig.workspaceRoot)?a:o(r.workspaceConfig.workspaceRoot,a),name:c},{skipNodeModulesBundle:!0})));let d=await t(r,await n(r));return l(r,[await i(r,`env`),u,(0,e.resolveClassType)(d)].filter(Boolean))}async function g(n,i,c){let l;i&&(l=(0,e.resolveClassType)(await t(n,{file:s(i,n.workspaceConfig.workspaceRoot)?i:o(n.workspaceConfig.workspaceRoot,i),name:c},{skipNodeModulesBundle:!0})));let d=await t(n,await r(n));return u(n,[await a(n),l,(0,e.resolveClassType)(d)].filter(Boolean))}export{d as BaseEnv,f as BaseSecrets,p as createEnvReflection,m as createSecretsReflection,l as mergeEnvReflections,u as mergeSecretsReflections,h as reflectEnv,g as reflectSecrets};
1
+ import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{reflectType as t}from"../../../deepkit/src/reflect-type.mjs";import{getEnvDefaultTypeDefinition as n,getSecretsDefaultTypeDefinition as r,readEnvTypeReflection as i,readSecretsReflection as a}from"./persistence.mjs";import{isParentPath as o}from"@stryke/path/is-parent-path";import{titleCase as s}from"@stryke/string-format/title-case";import{joinPaths as c}from"@stryke/path/join-paths";function l(t,n){return p(t,{type:(0,e.merge)(n.map(e=>e.type))})}function u(t,n){return m(t,{type:(0,e.merge)(n.map(e=>e.type))})}var d=class{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},f=class{ENCRYPTION_KEY};function p(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base environment configuration definition for the ${s(t.config.name)} project.`,classType:d,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${s(t.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${t.config.name?`${s(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function m(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base secrets configuration definition for the ${s(t.config.name)} project.`,classType:f,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${s(t.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${t.config.name?`${s(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function h(r,a,s){let u;a&&(u=(0,e.resolveClassType)(await t(r,{file:o(a,r.workspaceConfig.workspaceRoot)?a:c(r.workspaceConfig.workspaceRoot,a),name:s},{skipNodeModulesBundle:!0})));let d=await t(r,await n(r));return l(r,[await i(r,`env`),u,(0,e.resolveClassType)(d)].filter(Boolean))}async function g(n,i,s){let l;i&&(l=(0,e.resolveClassType)(await t(n,{file:o(i,n.workspaceConfig.workspaceRoot)?i:c(n.workspaceConfig.workspaceRoot,i),name:s},{skipNodeModulesBundle:!0})));let d=await t(n,await r(n));return u(n,[await a(n),l,(0,e.resolveClassType)(d)].filter(Boolean))}export{d as BaseEnv,f as BaseSecrets,p as createEnvReflection,m as createSecretsReflection,l as mergeEnvReflections,u as mergeSecretsReflections,h as reflectEnv,g as reflectSecrets};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/env/types`),r=require(`@stryke/string-format/camel-case`);function i(e){if((0,t.isString)(e)){let t=n.ENV_PREFIXES.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let r=i(n);return r&&(t[r]=e[n]),t},{})}exports.removeEnvPrefix=i;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/string-format/camel-case`),r=require(`@stryke/env/types`);function i(e){if((0,t.isString)(e)){let t=r.ENV_PREFIXES.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let r=i(n);return r&&(t[r]=e[n]),t},{})}exports.removeEnvPrefix=i;
@@ -1 +1 @@
1
- import{isString as e}from"@stryke/type-checks/is-string";import{ENV_PREFIXES as t}from"@stryke/env/types";import{camelCase as n}from"@stryke/string-format/camel-case";function r(n){if(e(n)){let e=t.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),n.toUpperCase());for(;e.startsWith(`_`);)e=e.slice(1);return e}return Object.keys(n).reduce((e,t)=>{let i=r(t);return i&&(e[i]=n[t]),e},{})}export{r as removeEnvPrefix};
1
+ import{isString as e}from"@stryke/type-checks/is-string";import{camelCase as t}from"@stryke/string-format/camel-case";import{ENV_PREFIXES as n}from"@stryke/env/types";function r(t){if(e(t)){let e=n.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),t.toUpperCase());for(;e.startsWith(`_`);)e=e.slice(1);return e}return Object.keys(t).reduce((e,n)=>{let i=r(n);return i&&(e[i]=t[n]),e},{})}export{r as removeEnvPrefix};
@@ -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(`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`} -->
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-alloy/src/index.cjs`),r=require(`../../plugin-automd/src/index.cjs`),i=require(`../../plugin-babel/src/index.cjs`),a=require(`./helpers/reflect.cjs`),o=require(`./helpers/persistence.cjs`),s=require(`./babel/plugin.cjs`),c=require(`./helpers/source-file-env.cjs`),l=require(`./helpers/load.cjs`),u=require(`./helpers/create-reflection-resource.cjs`),d=require(`./components/env.cjs`),f=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let p=require(`@storm-software/config-tools/types`),m=require(`@stryke/path/is-parent-path`),h=require(`react/jsx-runtime`),g=require(`defu`);g=e.__toESM(g);let _=require(`@stryke/convert/to-array`),v=require(`@stryke/path/join`),y=require(`@stryke/string-format/title-case`),b=require(`@stryke/convert/parse-type-definition`),x=require(`@stryke/env/types`),S=require(`@stryke/fs/exists`),C=require(`@stryke/fs/helpers`),w=require(`@stryke/string-format/constant-case`);const T=(e={})=>[n.default(e.alloy),i.default(e.babel),{name:`env`,async config(){this.log(p.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,g.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[s.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,b.parseTypeDefinition)(t.env.types);else{this.log(p.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await o.getEnvDefaultTypeDefinition(this);t.env.types=(0,b.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,b.parseTypeDefinition)(t.env.secrets);else{let e=await o.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,b.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,_.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,w.constantCase)(t);return e.includes(n)||e.push(n),e},[...x.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(p.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,g.default)({parsed:await l.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,S.existsSync)(o.getEnvTypeReflectionsPath(this,`env`)))this.log(p.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await o.readEnvTypeReflection(this,`env`),(0,S.existsSync)(o.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await o.readEnvReflection(this)),(0,S.existsSync)(o.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await o.readEnvTypeReflection(this,`secrets`)),(0,S.existsSync)(o.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await o.readSecretsReflection(this));else{if(this.env.types.env=await a.reflectEnv(this,this.config.env.types?.file?(0,m.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,v.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 o.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await a.reflectSecrets(this,this.config.env.secrets?.file?(0,m.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,v.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 o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(p.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 l.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 o.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await o.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 o.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(p.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,h.jsx)(d.EnvBuiltin,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(p.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,v.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,S.existsSync)(e)||await(0,C.createDirectory)(e);let n=await o.readEnvTypeReflection(this,`env`),r=(0,v.joinPaths)(e,`env.md`);this.log(p.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,y.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
 
@@ -7,4 +7,4 @@ Below is a list of environment variables used by the [${this.packageJson.name}](
7
7
  ${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(`
8
8
  `,``)??``).trim()} | ${(0,t.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
9
9
  `)}
10
- `)},async buildEnd(){let e=a.getEnvReflectionsPath(this,`env`);this.log(m.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await a.writeEnvReflection(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:(0,p.default)(e.automd??{},{generators:{env:d.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},n.default(e.automd)];var T=w;exports.default=T;
10
+ `)},async buildEnd(){let e=o.getEnvReflectionsPath(this,`env`);this.log(p.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await o.writeEnvReflection(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:(0,g.default)(e.automd??{},{generators:{env:f.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},r.default(e.automd)];var E=T;exports.default=E;
@@ -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"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`} -->
1
+ import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-alloy/src/index.mjs";import n from"../../plugin-automd/src/index.mjs";import r from"../../plugin-babel/src/index.mjs";import{BaseEnv as i,BaseSecrets as a,createEnvReflection as o,createSecretsReflection as s,mergeEnvReflections as c,mergeSecretsReflections as l,reflectEnv as u,reflectSecrets as d}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as f,getEnvReflectionsPath as p,getEnvTypeReflectionsPath as m,getSecretsDefaultTypeDefinition as h,readEnvReflection as g,readEnvTypeReflection as _,readSecretsReflection as v,resolveRuntimeTypeFile as y,writeEnvReflection as b,writeEnvTypeReflection as x}from"./helpers/persistence.mjs";import{envBabelPlugin as S}from"./babel/plugin.mjs";import{removeEnvPrefix as C}from"./helpers/source-file-env.mjs";import{loadEnv as w,loadEnvFromContext as T}from"./helpers/load.mjs";import{createReflectionResource as E}from"./helpers/create-reflection-resource.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import{env as k}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{LogLevelLabel as A}from"@storm-software/config-tools/types";import{isParentPath as j}from"@stryke/path/is-parent-path";import{jsx as M}from"react/jsx-runtime";import N from"defu";import{toArray as P}from"@stryke/convert/to-array";import{joinPaths as F}from"@stryke/path/join";import{titleCase as I}from"@stryke/string-format/title-case";import{parseTypeDefinition as L}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as R}from"@stryke/env/types";import{existsSync as z}from"@stryke/fs/exists";import{createDirectory as B}from"@stryke/fs/helpers";import{constantCase as V}from"@stryke/string-format/constant-case";var H=(i={})=>[t(i.alloy),r(i.babel),{name:`env`,async config(){this.log(A.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:N(i,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(e.env.types)e.env.types=L(e.env.types);else{this.log(A.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await f(this);e.env.types=L(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=L(e.env.secrets);else{let t=await h(this);e.env.secrets=L(`${t.file}#${t.name}`)}return e.env.prefix=P(e.env.prefix??[]).reduce((e,t)=>{let n=V(t);return e.includes(n)||e.push(n),e},[...R,`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(A.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=N({parsed:await w(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&z(m(this,`env`)))this.log(A.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await _(this,`env`),z(p(this,`env`))&&(this.env.used.env=await g(this)),z(m(this,`secrets`))&&(this.env.types.secrets=await _(this,`secrets`)),z(p(this,`secrets`))&&(this.env.used.secrets=await v(this));else{if(this.env.types.env=await u(this,this.config.env.types?.file?j(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:F(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await x(this,this.env.types.env,`env`),this.env.types.secrets=await d(this,this.config.env.secrets?.file?j(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:F(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await x(this,this.env.types.secrets,`secrets`),this.log(A.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await w(this,this.config.env)).forEach(([e,n])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=t.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await b(this,this.env.used.env,`env`),this.env.types.secrets&&(await x(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await b(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(A.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(M(D,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(A.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=F(this.config.projectRoot,`docs`,`generated`);z(t)||await B(t);let n=await _(this,`env`),r=F(t,`env.md`);this.log(A.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${I(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
 
@@ -7,4 +7,4 @@ Below is a list of environment variables used by the [${this.packageJson.name}](
7
7
  ${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
8
8
  `,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
9
9
  `)}
10
- `)},async buildEnd(){let e=f(this,`env`);this.log(j.TRACE,`Writing env reflection types to ${e}.`),await y(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:A(r.automd??{},{generators:{env:O(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},t(r.automd)];export{V as default};
10
+ `)},async buildEnd(){let e=p(this,`env`);this.log(A.TRACE,`Writing env reflection types to ${e}.`),await b(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:N(i.automd??{},{generators:{env:k(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},n(i.automd)];export{H as default};
@@ -1,5 +1,5 @@
1
1
  import { Reflection } from "../../../deepkit/src/types.cjs";
2
- import { AlloyPluginContext } from "../../../plugin-alloy/src/types/plugin.cjs";
2
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "../../../plugin-alloy/src/types/plugin.cjs";
3
3
  import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
4
4
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.cjs";
5
5
  import { EnvInterface, SecretsInterface } from "./runtime.cjs";
@@ -54,11 +54,18 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
54
54
  * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
55
55
  */
56
56
  automd?: AutoMDPluginOptions;
57
+ /**
58
+ * Alloy configuration options to use when injecting environment variables into the source code.
59
+ *
60
+ * @remarks
61
+ * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
62
+ */
63
+ alloy?: AlloyPluginOptions;
57
64
  };
58
- type EnvPluginUserConfig = BabelPluginUserConfig & {
65
+ type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
59
66
  env: EnvPluginOptions;
60
67
  };
61
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
68
+ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
62
69
  env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
63
70
  /**
64
71
  * The type definition for the expected env variable parameters
@@ -1,5 +1,5 @@
1
1
  import { Reflection } from "../../../deepkit/src/types.mjs";
2
- import { AlloyPluginContext } from "../../../plugin-alloy/src/types/plugin.mjs";
2
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "../../../plugin-alloy/src/types/plugin.mjs";
3
3
  import "../../../plugin-alloy/src/types/index.mjs";
4
4
  import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.mjs";
5
5
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.mjs";
@@ -56,11 +56,18 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
56
56
  * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
57
57
  */
58
58
  automd?: AutoMDPluginOptions;
59
+ /**
60
+ * Alloy configuration options to use when injecting environment variables into the source code.
61
+ *
62
+ * @remarks
63
+ * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
64
+ */
65
+ alloy?: AlloyPluginOptions;
59
66
  };
60
- type EnvPluginUserConfig = BabelPluginUserConfig & {
67
+ type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
61
68
  env: EnvPluginOptions;
62
69
  };
63
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
70
+ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
64
71
  env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
65
72
  /**
66
73
  * The type definition for the expected env variable parameters
@@ -1,14 +1,14 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`@stryke/path/replace`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/helpers/omit`),o=require(`@stryke/string-format/camel-case`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync((0,t.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,o.camelCase)(e)!==e){if(t.length===1)return`
2
- import ${(0,o.camelCase)(e)} from "${t[0]}";
3
- export { ${(0,o.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
4
- import ${t[1]===`*`?`* as ${(0,o.camelCase)(e)}`:`{ ${t[1]} as ${(0,o.camelCase)(e)} }`} from "${t[0]}";
5
- export { ${(0,o.camelCase)(e)} as "${e}" }`}else if(t.length===1)return`
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/replace`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/string-format/camel-case`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/helpers/omit`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let t=e.config.build.override.inject??e.config.build.inject;return t&&Object.keys(t).length>0&&e.fs.writeSync((0,a.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(t).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,i.camelCase)(e)!==e){if(t.length===1)return`
2
+ import ${(0,i.camelCase)(e)} from "${t[0]}";
3
+ export { ${(0,i.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
4
+ import ${t[1]===`*`?`* as ${(0,i.camelCase)(e)}`:`{ ${t[1]} as ${(0,i.camelCase)(e)} }`} from "${t[0]}";
5
+ export { ${(0,i.camelCase)(e)} as "${e}" }`}else if(t.length===1)return`
6
6
  import ${e} from "${t[0]}";
7
7
  export { ${e} };`;else if(t.length>1)return`
8
8
  import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
9
- export { ${e} };`}else if((0,o.camelCase)(e)!==e)return`
10
- import ${(0,o.camelCase)(e)} from "${t[0]}";
11
- export { ${(0,o.camelCase)(e)} as "${e}" }`;else return`
9
+ export { ${e} };`}else if((0,i.camelCase)(e)!==e)return`
10
+ import ${(0,i.camelCase)(e)} from "${t[0]}";
11
+ export { ${(0,i.camelCase)(e)} as "${e}" }`;else return`
12
12
  import ${e} from "${t}";
13
13
  export { ${e} };`;return``}).join(`
14
- `)),(0,r.default)({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[(0,t.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?(0,a.omit)(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?(0,a.omit)(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},s)}exports.extractESBuildConfig=c;
14
+ `)),(0,n.default)({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:t&&Object.keys(t).length>0?[(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?(0,o.omit)(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?(0,o.omit)(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},s)}exports.extractESBuildConfig=c;
@@ -1,14 +1,14 @@
1
- import"../entry.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import{replacePath as t}from"@stryke/path/replace";import n from"defu";import{isString as r}from"@stryke/type-checks/is-string";import{omit as i}from"@stryke/helpers/omit";import{camelCase as a}from"@stryke/string-format/camel-case";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(t){let r=t.config.build.override.inject??t.config.build.inject;return r&&Object.keys(r).length>0&&t.fs.writeSync(e(t.workspaceConfig.workspaceRoot,t.config.projectRoot,t.artifactsPath,`inject-shim.js`),Object.entries(r).map(([e,t])=>{if(t)if(Array.isArray(t)){if(a(e)!==e){if(t.length===1)return`
2
- import ${a(e)} from "${t[0]}";
3
- export { ${a(e)} as "${e}" }`;if(t.length>1)return`
4
- import ${t[1]===`*`?`* as ${a(e)}`:`{ ${t[1]} as ${a(e)} }`} from "${t[0]}";
5
- export { ${a(e)} as "${e}" }`}else if(t.length===1)return`
1
+ import"../entry.mjs";import{replacePath as e}from"@stryke/path/replace";import t from"defu";import{isString as n}from"@stryke/type-checks/is-string";import{camelCase as r}from"@stryke/string-format/camel-case";import{joinPaths as i}from"@stryke/path/join-paths";import{omit as a}from"@stryke/helpers/omit";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(e){let n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync(i(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if(r(e)!==e){if(t.length===1)return`
2
+ import ${r(e)} from "${t[0]}";
3
+ export { ${r(e)} as "${e}" }`;if(t.length>1)return`
4
+ import ${t[1]===`*`?`* as ${r(e)}`:`{ ${t[1]} as ${r(e)} }`} from "${t[0]}";
5
+ export { ${r(e)} as "${e}" }`}else if(t.length===1)return`
6
6
  import ${e} from "${t[0]}";
7
7
  export { ${e} };`;else if(t.length>1)return`
8
8
  import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
9
- export { ${e} };`}else if(a(e)!==e)return`
10
- import ${a(e)} from "${t[0]}";
11
- export { ${a(e)} as "${e}" }`;else return`
9
+ export { ${e} };`}else if(r(e)!==e)return`
10
+ import ${r(e)} from "${t[0]}";
11
+ export { ${r(e)} as "${e}" }`;else return`
12
12
  import ${e} from "${t}";
13
13
  export { ${e} };`;return``}).join(`
14
- `)),n({alias:t.builtins.reduce((e,n)=>{if(!e[n]){let r=t.fs.ids[n];r&&(e[n]=r)}return e},t.config.build.alias?Array.isArray(t.config.build.alias)?t.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):t.config.build.alias:{}),inject:r&&Object.keys(r).length>0?[e(t.workspaceConfig.workspaceRoot,t.config.projectRoot,t.artifactsPath,`inject-shim.js`)]:void 0},t.config.build.variant===`esbuild`?i(t.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},t.config.build.variant===`esbuild`?i(t.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:t.config.build.mainFields,conditions:t.config.build.conditions,define:t.config.build.define,resolveExtensions:t.config.build.extensions,packages:t.config.build.skipNodeModulesBundle?`external`:t.config.build.variant===`esbuild`?t.config.build.packages:void 0,format:Array.isArray(t.config.output.format)?t.config.output.format[0]:t.config.output.format,platform:t.config.build.platform,treeShaking:!!t.config.build?.treeshake||t.config.build?.treeShaking,outdir:t.config.output.buildPath,tsconfig:t.tsconfig.tsconfigFilePath,minify:t.config.mode!==`development`,metafile:t.config.mode===`development`,sourcemap:t.config.mode===`development`},o)}export{s as extractESBuildConfig};
14
+ `)),t({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[i(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?a(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?a(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},o)}export{s as extractESBuildConfig};
@@ -1 +1 @@
1
- require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/convert/to-array`),t=require(`@stryke/fs/is-file`),n=require(`@stryke/fs/list-files`),r=require(`@stryke/path/append`),i=require(`@stryke/path/join-paths`),a=require(`@stryke/path/replace`),o=require(`@stryke/type-checks/is-set-string`),s=require(`@stryke/type-checks/is-string`),c=require(`@stryke/convert/parse-type-definition`),l=require(`@stryke/helpers/get-unique`);require(`@stryke/hash/murmurhash`);
1
+ require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/path/append`),r=require(`@stryke/helpers/get-unique`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`),o=require(`@stryke/path/join-paths`),s=require(`@stryke/fs/is-file`),c=require(`@stryke/fs/list-files`),l=require(`@stryke/convert/parse-type-definition`);require(`@stryke/hash/murmurhash`);
@@ -1 +1 @@
1
- import"../plugin-utils/paths.mjs";import{toArray as e}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as t}from"@stryke/fs/list-files";import{appendPath as n}from"@stryke/path/append";import{joinPaths as r}from"@stryke/path/join-paths";import{replacePath as i}from"@stryke/path/replace";import{isSetString as a}from"@stryke/type-checks/is-set-string";import{isString as o}from"@stryke/type-checks/is-string";import{parseTypeDefinition as s}from"@stryke/convert/parse-type-definition";import{getUniqueBy as c}from"@stryke/helpers/get-unique";import"@stryke/hash/murmurhash";export{};
1
+ import"../plugin-utils/paths.mjs";import{replacePath as e}from"@stryke/path/replace";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{appendPath as n}from"@stryke/path/append";import{getUniqueBy as r}from"@stryke/helpers/get-unique";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import{joinPaths as o}from"@stryke/path/join-paths";import"@stryke/fs/is-file";import{listFiles as s}from"@stryke/fs/list-files";import{parseTypeDefinition as c}from"@stryke/convert/parse-type-definition";import"@stryke/hash/murmurhash";export{};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@storm-software/config-tools/types`),n=require(`chalk`);n=e.__toESM(n),require(`@storm-software/config-tools/logger`),require(`@storm-software/config-tools/utilities/colors`),require(`@stryke/helpers/noop`);let r=require(`@stryke/string-format/kebab-case`),i=require(`@stryke/string-format/title-case`);const a=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],o=(e,t)=>(r,...o)=>e(r,` ${n.default.inverse.hex(a[t.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%a.length]||a[0])(` ${(0,i.titleCase)(t)} `)} ${o.join(` `)} `);exports.extendLog=o;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@storm-software/config-tools/types`),n=require(`@stryke/string-format/title-case`),r=require(`chalk`);r=e.__toESM(r),require(`@storm-software/config-tools/logger`),require(`@storm-software/config-tools/utilities/colors`),require(`@stryke/helpers/noop`);let i=require(`@stryke/string-format/kebab-case`);const a=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],o=(e,t)=>(i,...o)=>e(i,` ${r.default.inverse.hex(a[t.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%a.length]||a[0])(` ${(0,n.titleCase)(t)} `)} ${o.join(` `)} `);exports.extendLog=o;
@@ -1 +1 @@
1
- import{LogLevelLabel as e}from"@storm-software/config-tools/types";import t from"chalk";import"@storm-software/config-tools/logger";import"@storm-software/config-tools/utilities/colors";import"@stryke/helpers/noop";import{kebabCase as n}from"@stryke/string-format/kebab-case";import{titleCase as r}from"@stryke/string-format/title-case";const i=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],a=(e,n)=>(a,...o)=>e(a,` ${t.inverse.hex(i[n.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%i.length]||i[0])(` ${r(n)} `)} ${o.join(` `)} `);export{a as extendLog};
1
+ import{LogLevelLabel as e}from"@storm-software/config-tools/types";import{titleCase as t}from"@stryke/string-format/title-case";import n from"chalk";import"@storm-software/config-tools/logger";import"@storm-software/config-tools/utilities/colors";import"@stryke/helpers/noop";import{kebabCase as r}from"@stryke/string-format/kebab-case";const i=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],a=(e,r)=>(a,...o)=>e(a,` ${n.inverse.hex(i[r.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%i.length]||i[0])(` ${t(r)} `)} ${o.join(` `)} `);export{a as extendLog};
@@ -4,9 +4,9 @@ import { StoragePort, StoragePreset } from "./fs.mjs";
4
4
  import { TSConfig } from "./tsconfig.mjs";
5
5
  import { PluginContext } from "./context.mjs";
6
6
  import { Plugin } from "./plugin.mjs";
7
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
7
8
  import "c12";
8
9
  import { transformAsync } from "@babel/core";
9
- import { LogLevelLabel } from "@storm-software/config-tools/types";
10
10
  import { MaybePromise } from "@stryke/types/base";
11
11
  import { PreviewOptions } from "vite";
12
12
  import { Format } from "@storm-software/build-tools/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-crypto",
3
- "version": "0.10.83",
3
+ "version": "0.10.85",
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.8",
131
+ "@powerlines/plugin-env": "^0.14.10",
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.10",
135
+ "powerlines": "^0.36.12",
136
136
  "@noble/ciphers": "^2.1.1"
137
137
  },
138
138
  "devDependencies": {
139
- "@powerlines/nx": "^0.11.36",
139
+ "@powerlines/nx": "^0.11.38",
140
140
  "@types/node": "^24.10.4"
141
141
  },
142
142
  "publishConfig": { "access": "public" },
143
- "gitHead": "ab50afb5bed1d2d55072e7375c6425980e3d03ad"
143
+ "gitHead": "d3ac72b97e62a0bff2a45b99d6e5ca5d32f95f3c"
144
144
  }