@powerlines/plugin-crypto 0.10.78 → 0.10.80

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 (77) hide show
  1. package/dist/deepkit/schemas/reflection.cjs +1 -1
  2. package/dist/deepkit/schemas/reflection.mjs +1 -1
  3. package/dist/deepkit/src/utilities.cjs +1 -1
  4. package/dist/deepkit/src/utilities.mjs +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/dist/index.d.mts +1 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/plugin-alloy/src/types/components.d.mts +5 -0
  10. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  11. package/dist/plugin-alloy/src/types/plugin.d.cts +12 -0
  12. package/dist/plugin-alloy/src/types/plugin.d.mts +13 -0
  13. package/dist/plugin-automd/src/index.cjs +1 -1
  14. package/dist/plugin-automd/src/index.mjs +1 -1
  15. package/dist/plugin-babel/src/helpers/filters.cjs +1 -1
  16. package/dist/plugin-babel/src/helpers/filters.mjs +1 -1
  17. package/dist/plugin-babel/src/index.cjs +1 -1
  18. package/dist/plugin-babel/src/index.mjs +1 -1
  19. package/dist/plugin-env/src/components/docs.cjs +1 -1
  20. package/dist/plugin-env/src/components/docs.mjs +1 -1
  21. package/dist/plugin-env/src/components/env.cjs +9 -9
  22. package/dist/plugin-env/src/components/env.mjs +8 -8
  23. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +1 -1
  24. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +1 -1
  25. package/dist/plugin-env/src/helpers/load.cjs +1 -1
  26. package/dist/plugin-env/src/helpers/load.mjs +1 -1
  27. package/dist/plugin-env/src/helpers/reflect.cjs +1 -1
  28. package/dist/plugin-env/src/helpers/reflect.mjs +1 -1
  29. package/dist/plugin-env/src/index.cjs +4 -4
  30. package/dist/plugin-env/src/index.mjs +4 -4
  31. package/dist/plugin-env/src/types/plugin.d.cts +2 -1
  32. package/dist/plugin-env/src/types/plugin.d.mts +4 -2
  33. package/dist/plugin-plugin/src/types/plugin.d.mts +6 -0
  34. package/dist/powerlines/src/lib/build/esbuild.cjs +2 -2
  35. package/dist/powerlines/src/lib/build/esbuild.mjs +2 -2
  36. package/dist/powerlines/src/lib/entry.cjs +1 -1
  37. package/dist/powerlines/src/lib/entry.mjs +1 -1
  38. package/dist/powerlines/src/types/build.d.mts +2 -0
  39. package/dist/powerlines/src/types/config.d.mts +1 -1
  40. package/dist/powerlines/src/types/plugin.d.cts +2 -3
  41. package/dist/powerlines/src/types/plugin.d.mts +2 -3
  42. package/dist/powerlines/src/types/resolved.d.mts +1 -0
  43. package/package.json +6 -6
  44. package/dist/alloy/src/core/components/output.cjs +0 -1
  45. package/dist/alloy/src/core/components/output.mjs +0 -1
  46. package/dist/alloy/src/core/components/single-line-comment.cjs +0 -1
  47. package/dist/alloy/src/core/components/single-line-comment.mjs +0 -1
  48. package/dist/alloy/src/core/components/source-file.cjs +0 -1
  49. package/dist/alloy/src/core/components/source-file.mjs +0 -1
  50. package/dist/alloy/src/core/contexts/context.cjs +0 -1
  51. package/dist/alloy/src/core/contexts/context.mjs +0 -1
  52. package/dist/alloy/src/core/contexts/reflection.cjs +0 -1
  53. package/dist/alloy/src/core/contexts/reflection.mjs +0 -1
  54. package/dist/alloy/src/create-plugin.cjs +0 -2
  55. package/dist/alloy/src/create-plugin.mjs +0 -2
  56. package/dist/alloy/src/helpers/refkey.cjs +0 -1
  57. package/dist/alloy/src/helpers/refkey.mjs +0 -1
  58. package/dist/alloy/src/markdown/components/markdown-file.cjs +0 -1
  59. package/dist/alloy/src/markdown/components/markdown-file.mjs +0 -1
  60. package/dist/alloy/src/markdown/components/markdown-table.cjs +0 -1
  61. package/dist/alloy/src/markdown/components/markdown-table.mjs +0 -1
  62. package/dist/alloy/src/markdown/contexts/markdown-table.cjs +0 -1
  63. package/dist/alloy/src/markdown/contexts/markdown-table.mjs +0 -1
  64. package/dist/alloy/src/typescript/components/builtin-file.cjs +0 -1
  65. package/dist/alloy/src/typescript/components/builtin-file.mjs +0 -1
  66. package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
  67. package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
  68. package/dist/alloy/src/typescript/components/tsdoc.cjs +0 -1
  69. package/dist/alloy/src/typescript/components/tsdoc.mjs +0 -1
  70. package/dist/alloy/src/typescript/components/typescript-file.cjs +0 -1
  71. package/dist/alloy/src/typescript/components/typescript-file.mjs +0 -1
  72. package/dist/alloy/src/typescript/components/typescript-interface.cjs +0 -1
  73. package/dist/alloy/src/typescript/components/typescript-interface.mjs +0 -1
  74. package/dist/alloy/src/typescript/components/typescript-object.cjs +0 -1
  75. package/dist/alloy/src/typescript/components/typescript-object.mjs +0 -1
  76. package/dist/powerlines/src/plugin-utils/helpers.cjs +0 -1
  77. package/dist/powerlines/src/plugin-utils/helpers.mjs +0 -1
@@ -1,13 +1,13 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../alloy/src/core/contexts/context.cjs`),n=require(`../../../deepkit/src/vendor/type.cjs`),r=require(`../../../alloy/src/helpers/refkey.cjs`),i=require(`../../../alloy/src/typescript/components/tsdoc.cjs`),a=require(`../../../alloy/src/typescript/components/builtin-file.cjs`),o=require(`../../../alloy/src/typescript/components/typescript-interface.cjs`),s=require(`../../../alloy/src/typescript/components/typescript-object.cjs`),c=require(`../helpers/load.cjs`),l=require(`../helpers/create-reflection-resource.cjs`);let u=require(`@alloy-js/core/jsx-runtime`),d=require(`@alloy-js/core`),f=require(`defu`);f=e.__toESM(f);let p=require(`@stryke/string-format/title-case`),m=require(`@stryke/type-checks/is-null`),h=require(`@alloy-js/typescript`);function g(e){let[{defaultValue:n,reflection:r}]=(0,d.splitProps)(e,[`defaultValue`,`reflection`]),i=t.usePowerlines();return[(0,u.createComponent)(o.TypeScriptInterface,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:n,reflection:r,export:!0}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(h.TypeDeclaration,{name:`Env`,export:!0,get children(){return d.code` {
2
- [Key in keyof EnvBase as Key ${i?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
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(`@alloy-js/core/jsx-runtime`);function g(e){let[{defaultValue:t,reflection:n}]=(0,s.splitProps)(e,[`defaultValue`,`reflection`]),r=(0,l.usePowerlines)();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p.TypeScriptInterface,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(`hbr`,{}),(0,h.jsx)(c.TypeDeclaration,{name:`Env`,export:!0,children:s.code` {
2
+ [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,d.splitProps)(e,[`context`,`name`]);return t?d.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,d.splitProps)(e,[`context`,`property`,`index`]);return t?[r===0?(0,u.createComponent)(h.IfStatement,{get condition(){return[(0,u.createComponent)(_,{get name(){return n.getNameAsString()},context:t}),(0,u.createComponent)(d.Show,{get when(){return(0,u.memo)(()=>!!n.getAlias())()&&n.getAlias().length>0},get children(){return[d.code` || `,(0,u.createComponent)(d.For,{get each(){return n.getAlias()},joiner:d.code` || `,children:e=>(0,u.createComponent)(_,{name:e,context:t})})]}})]},get children(){return d.code`return target["${n.getNameAsString()}"];`}}):(0,u.createComponent)(h.ElseIfClause,{get condition(){return[(0,u.createComponent)(_,{get name(){return n.getNameAsString()},context:t}),(0,u.createComponent)(d.Show,{get when(){return(0,u.memo)(()=>!!n.getAlias())()&&n.getAlias().length>0},get children(){return[d.code` || `,(0,u.createComponent)(d.For,{get each(){return n.getAlias()},joiner:d.code` || `,children:e=>(0,u.createComponent)(_,{name:e,context:t})})]}})]},get children(){return d.code`return target["${n.getNameAsString()}"];`}})]:null}function y(e){let[{context:t,property:n,index:r}]=(0,d.splitProps)(e,[`context`,`property`,`index`]);return t?[r===0?(0,u.createComponent)(h.IfStatement,{get condition(){return[(0,u.createComponent)(_,{get name(){return n.getNameAsString()},context:t}),(0,u.createComponent)(d.Show,{get when(){return(0,u.memo)(()=>!!n.getAlias())()&&n.getAlias().length>0},get children(){return[d.code` || `,(0,u.createComponent)(d.For,{get each(){return n.getAlias()},joiner:d.code` || `,children:e=>(0,u.createComponent)(_,{name:e,context:t})})]}})]},get children(){return d.code`
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`
5
5
  target["${n.getNameAsString()}"] = newValue;
6
6
  return true;
7
- `}}):(0,u.createComponent)(h.ElseIfClause,{get condition(){return[(0,u.createComponent)(_,{get name(){return n.getNameAsString()},context:t}),(0,u.createComponent)(d.Show,{get when(){return(0,u.memo)(()=>!!n.getAlias())()&&n.getAlias().length>0},get children(){return[d.code` || `,(0,u.createComponent)(d.For,{get each(){return n.getAlias()},joiner:d.code` || `,children:e=>(0,u.createComponent)(_,{name:e,context:t})})]}})]},get children(){return d.code`
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`
8
8
  target["${n.getNameAsString()}"] = newValue;
9
9
  return true;
10
- `}})]:null}const b=r.refkey(`createEnv`),x=r.refkey(`env`),S=r.refkey(`EnvSerializer`);function C(e){let[{defaultConfig:r},o]=(0,d.splitProps)(e,[`defaultConfig`]),_=t.usePowerlines(),C=(0,d.computed)(()=>_&&c.loadEnvFromContext(_,process.env)),w=l.createReflectionResource(_),T=(0,d.computed)(()=>new n.type_exports.ReflectionClass({kind:n.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${(0,p.titleCase)(_?.config?.name)} project.`,types:[]},w.data??void 0)),E=(0,d.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),D=(0,d.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return(0,u.createComponent)(a.BuiltinFile,(0,u.mergeProps)(o,{id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,get imports(){return(0,f.default)({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},o.imports??{})},get children(){return[(0,u.createComponent)(d.Show,{get when(){return!(0,m.isNull)(w.data)},get children(){return[(0,u.createComponent)(g,{get defaultValue(){return C.value},get reflection(){return w.data}}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{})]}}),(0,u.createComponent)(s.TypescriptObject,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:C,reflection:T,export:!0,const:!0}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(i.TSDoc,{heading:`The environment configuration serializer for the Powerlines application.`,get children(){return[(0,u.createComponent)(i.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,u.createComponent)(i.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,u.createComponent)(i.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}}),(0,u.createComponent)(h.ClassDeclaration,{refkey:S,name:`EnvSerializer`,extends:`Serializer`,export:!0,get children(){return(0,u.createComponent)(h.ClassMethod,{name:`constructor`,public:!0,children:d.code`
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`
11
11
  super("env");
12
12
 
13
13
  this.deserializeRegistry.register(
@@ -18,17 +18,17 @@ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../al
18
18
  );
19
19
  }
20
20
  );
21
- `})}}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(i.TSDoc,{heading:`A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.`,get children(){return[(0,u.createComponent)(i.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,u.createComponent)(i.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,u.createComponent)(i.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}}),(0,u.createComponent)(h.VarDeclaration,{name:`envSerializer`,export:!1,const:!0,get initializer(){return(0,u.createComponent)(h.NewExpression,{args:[],target:`EnvSerializer`})}}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(i.TSDoc,{heading:`Serialize a environment configuration object to JSON data objects (not a JSON string).`,get children(){return[(0,u.createComponent)(i.TSDocRemarks,{children:`The resulting JSON object can be stringified using JSON.stringify().`}),(0,u.createComponent)(i.TSDocExample,{children:`const json = serializeEnv(env);`}),(0,u.createComponent)(i.TSDocThrows,{children:`ValidationError when serialization or validation fails.`})]}}),(0,u.createComponent)(h.VarDeclaration,{name:`serializeEnv`,export:!0,const:!0,initializer:`serializeFunction<EnvBase>(envSerializer)`}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(i.TSDoc,{heading:`Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.`,get children(){return[(0,u.createComponent)(i.TSDocRemarks,{children:`Types that are already correct will be used as-is.`}),(0,u.createComponent)(i.TSDocExample,{children:`const env = deserializeEnv(json);`}),(0,u.createComponent)(i.TSDocThrows,{children:`ValidationError when deserialization fails.`})]}}),(0,u.createComponent)(h.VarDeclaration,{name:`deserializeEnv`,export:!0,const:!0,initializer:`deserializeFunction<EnvBase>(envSerializer)`}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(i.TSDoc,{heading:`Initializes the Powerlines environment configuration module.`,get children(){return[(0,u.createComponent)(i.TSDocRemarks,{children:`This function initializes the Powerlines environment configuration object.`}),(0,u.createComponent)(i.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,u.createComponent)(i.TSDocReturns,{children:`The initialized Powerlines configuration object.`})]}}),(0,u.createComponent)(d.Show,{get when(){return!!_?.entryPath},get children(){return(0,u.createComponent)(h.FunctionDeclaration,{refkey:b,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,get children(){return[d.code`
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`
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,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(d.For,{each:E,children:(e,t)=>(0,u.createComponent)(v,{index:t,context:_,property:e})}),d.code`
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`
29
29
  return undefined;
30
- }, `,(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),d.code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(d.For,{each:D,ender:d.code` else `,children:(e,t)=>(0,u.createComponent)(y,{index:t,context:_,property:e})}),(0,u.createIntrinsic)(`hbr`,{}),d.code`return false;
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;
31
31
  }
32
32
  }
33
33
  );
34
- `]}})}}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(h.VarDeclaration,{refkey:x,name:`env`,type:`Env`,export:!0,const:!0,get initializer(){return[d.code`createEnv(`,r||`{}`,d.code` as Partial<Env>)`]}})]}}))}exports.EnvBuiltin=C,exports.EnvTypeDefinition=g;
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;
@@ -1,10 +1,10 @@
1
- import{usePowerlines as e}from"../../../alloy/src/core/contexts/context.mjs";import{type_exports as t}from"../../../deepkit/src/vendor/type.mjs";import{refkey as n}from"../../../alloy/src/helpers/refkey.mjs";import{TSDoc as r,TSDocExample as i,TSDocLink as a,TSDocParam as o,TSDocRemarks as s,TSDocReturns as c,TSDocThrows as l}from"../../../alloy/src/typescript/components/tsdoc.mjs";import{BuiltinFile as u}from"../../../alloy/src/typescript/components/builtin-file.mjs";import{TypeScriptInterface as d}from"../../../alloy/src/typescript/components/typescript-interface.mjs";import{TypescriptObject as f}from"../../../alloy/src/typescript/components/typescript-object.mjs";import{loadEnvFromContext as p}from"../helpers/load.mjs";import{createReflectionResource as m}from"../helpers/create-reflection-resource.mjs";import{createComponent as h,createIntrinsic as g,memo as _,mergeProps as v}from"@alloy-js/core/jsx-runtime";import{For as y,Show as b,code as x,computed as S,splitProps as C}from"@alloy-js/core";import w from"defu";import{titleCase as T}from"@stryke/string-format/title-case";import{isNull as E}from"@stryke/type-checks/is-null";import{ClassDeclaration as D,ClassMethod as O,ElseIfClause as k,FunctionDeclaration as A,IfStatement as j,NewExpression as M,TypeDeclaration as N,VarDeclaration as P}from"@alloy-js/typescript";function F(t){let[{defaultValue:n,reflection:r}]=C(t,[`defaultValue`,`reflection`]),i=e();return[h(d,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:n,reflection:r,export:!0}),g(`hbr`,{}),g(`hbr`,{}),h(N,{name:`Env`,export:!0,get children(){return x` {
2
- [Key in keyof EnvBase as Key ${i?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
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"@alloy-js/core/jsx-runtime";function P(e){let[{defaultValue:t,reflection:n}]=u(e,[`defaultValue`,`reflection`]),r=y();return N(j,{children:[M(k,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),M(`hbr`,{}),M(`hbr`,{}),M(_,{name:`Env`,export:!0,children:c` {
2
+ [Key in keyof EnvBase as Key ${r?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
3
3
  }
4
- `}})]}function I(e){let[{context:t,name:n}]=C(e,[`context`,`name`]);return t?x`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 L(e){let[{context:t,property:n,index:r}]=C(e,[`context`,`property`,`index`]);return t?[h(r===0?j:k,{get condition(){return[h(I,{get name(){return n.getNameAsString()},context:t}),h(b,{get when(){return _(()=>!!n.getAlias())()&&n.getAlias().length>0},get children(){return[x` || `,h(y,{get each(){return n.getAlias()},joiner:x` || `,children:e=>h(I,{name:e,context:t})})]}})]},get children(){return x`return target["${n.getNameAsString()}"];`}})]:null}function R(e){let[{context:t,property:n,index:r}]=C(e,[`context`,`property`,`index`]);return t?[h(r===0?j:k,{get condition(){return[h(I,{get name(){return n.getNameAsString()},context:t}),h(b,{get when(){return _(()=>!!n.getAlias())()&&n.getAlias().length>0},get children(){return[x` || `,h(y,{get each(){return n.getAlias()},joiner:x` || `,children:e=>h(I,{name:e,context:t})})]}})]},get children(){return x`
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`
5
5
  target["${n.getNameAsString()}"] = newValue;
6
6
  return true;
7
- `}})]:null}const z=n(`createEnv`),B=n(`env`),V=n(`EnvSerializer`);function H(n){let[{defaultConfig:d},_]=C(n,[`defaultConfig`]),k=e(),j=S(()=>k&&p(k,process.env)),N=m(k),I=S(()=>new t.ReflectionClass({kind:t.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${T(k?.config?.name)} project.`,types:[]},N.data??void 0)),H=S(()=>N.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),U=S(()=>N.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return h(u,v(_,{id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,get imports(){return w({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},_.imports??{})},get children(){return[h(b,{get when(){return!E(N.data)},get children(){return[h(F,{get defaultValue(){return j.value},get reflection(){return N.data}}),g(`hbr`,{}),g(`hbr`,{})]}}),h(f,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:j,reflection:I,export:!0,const:!0}),g(`hbr`,{}),g(`hbr`,{}),h(r,{heading:`The environment configuration serializer for the Powerlines application.`,get children(){return[h(a,{children:`https://deepkit.io/docs/serialization/serializers`}),h(a,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),h(s,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}}),h(D,{refkey:V,name:`EnvSerializer`,extends:`Serializer`,export:!0,get children(){return h(O,{name:`constructor`,public:!0,children:x`
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`
8
8
  super("env");
9
9
 
10
10
  this.deserializeRegistry.register(
@@ -15,17 +15,17 @@ import{usePowerlines as e}from"../../../alloy/src/core/contexts/context.mjs";imp
15
15
  );
16
16
  }
17
17
  );
18
- `})}}),g(`hbr`,{}),g(`hbr`,{}),h(r,{heading:`A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.`,get children(){return[h(a,{children:`https://deepkit.io/docs/serialization/serializers`}),h(a,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),h(s,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}}),h(P,{name:`envSerializer`,export:!1,const:!0,get initializer(){return h(M,{args:[],target:`EnvSerializer`})}}),g(`hbr`,{}),g(`hbr`,{}),h(r,{heading:`Serialize a environment configuration object to JSON data objects (not a JSON string).`,get children(){return[h(s,{children:`The resulting JSON object can be stringified using JSON.stringify().`}),h(i,{children:`const json = serializeEnv(env);`}),h(l,{children:`ValidationError when serialization or validation fails.`})]}}),h(P,{name:`serializeEnv`,export:!0,const:!0,initializer:`serializeFunction<EnvBase>(envSerializer)`}),g(`hbr`,{}),g(`hbr`,{}),h(r,{heading:`Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.`,get children(){return[h(s,{children:`Types that are already correct will be used as-is.`}),h(i,{children:`const env = deserializeEnv(json);`}),h(l,{children:`ValidationError when deserialization fails.`})]}}),h(P,{name:`deserializeEnv`,export:!0,const:!0,initializer:`deserializeFunction<EnvBase>(envSerializer)`}),g(`hbr`,{}),g(`hbr`,{}),h(r,{heading:`Initializes the Powerlines environment configuration module.`,get children(){return[h(s,{children:`This function initializes the Powerlines environment configuration object.`}),h(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.`}),h(c,{children:`The initialized Powerlines configuration object.`})]}}),h(b,{get when(){return!!k?.entryPath},get children(){return h(A,{refkey:z,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,get children(){return[x`
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`
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) => { `,g(`hbr`,{}),h(y,{each:H,children:(e,t)=>h(L,{index:t,context:k,property:e})}),x`
25
+ get: (target: EnvBase, propertyName: string) => { `,M(`hbr`,{}),M(o,{each:H,children:(e,t)=>M(I,{index:t,context:b,property:e})}),c`
26
26
  return undefined;
27
- }, `,g(`hbr`,{}),g(`hbr`,{}),x` set: (target: EnvBase, propertyName: string, newValue: any) => { `,g(`hbr`,{}),h(y,{each:U,ender:x` else `,children:(e,t)=>h(R,{index:t,context:k,property:e})}),g(`hbr`,{}),x`return false;
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;
28
28
  }
29
29
  }
30
30
  );
31
- `]}})}}),g(`hbr`,{}),g(`hbr`,{}),g(`hbr`,{}),h(P,{refkey:B,name:`env`,type:`Env`,export:!0,const:!0,get initializer(){return[x`createEnv(`,d||`{}`,x` as Partial<Env>)`]}})]}}))}export{H as EnvBuiltin,F as EnvTypeDefinition};
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};
@@ -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(`@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
+ 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 +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{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
+ 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 +1 @@
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(`@stryke/type-checks/is-set-object`),i=require(`@stryke/path/join-paths`),a=require(`c12`),o=require(`defu`);o=e.__toESM(o);let s=require(`@stryke/env/load-env`),c=require(`@stryke/string-format/kebab-case`);async function l(e,n,r){let i=await(0,s.loadEnv)(r,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,s.loadEnvFile)(e,r)));for(let e of t)i=(0,o.default)(e,i)}return t.removeEnvPrefix(i)}async function u(e,t,n,r,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)(r,`jiti`),moduleCache:!0}})]);return(0,o.default)(u,d.config,c)}function d(e,t){return(0,o.default)({APP_NAME:(0,c.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,c.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,r.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,i]=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,o.default)(d(e,process.env),n,r,i)}exports.loadEnv=f,exports.loadEnvFromContext=d;
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/env/load-env`),c=require(`@stryke/string-format/kebab-case`);async function l(e,n,r){let a=await(0,s.loadEnv)(r,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,s.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,c.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,c.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 +1 @@
1
- import{removeEnvPrefix as e}from"./source-file-env.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{isSetObject as n}from"@stryke/type-checks/is-set-object";import{joinPaths as r}from"@stryke/path/join-paths";import{loadConfig as i}from"c12";import a from"defu";import{loadEnv as o,loadEnvFile as s}from"@stryke/env/load-env";import{kebabCase as c}from"@stryke/string-format/kebab-case";async function l(t,n,r){let i=await o(r,n);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>s(e,r)));for(let t of e)i=a(t,i)}return e(i)}async function u(e,t,n,o,s,c){let[u,d]=await Promise.all([l(e,n,t),i({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:r(o,`jiti`),moduleCache:!0}})]);return a(u,d.config,c)}function d(e,r){return a({APP_NAME:c(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:`${c(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},n(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[n,r,i]=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 a(d(e,process.env),n,r,i)}export{f as loadEnv,d as loadEnvFromContext};
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{loadEnv as o,loadEnvFile as s}from"@stryke/env/load-env";import{kebabCase as c}from"@stryke/string-format/kebab-case";async function l(t,n,i){let a=await o(i,n);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>s(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:c(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:`${c(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 +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/is-parent-path`),a=require(`@stryke/path/join-paths`),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{PLATFORM=`neutral`;MODE=`production`;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;CI=!1},u=class{};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,i.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,a.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,i.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,a.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/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 +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{isParentPath as o}from"@stryke/path/is-parent-path";import{joinPaths as s}from"@stryke/path/join-paths";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{PLATFORM=`neutral`;MODE=`production`;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;CI=!1},f=class{};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:o(a,r.workspaceConfig.workspaceRoot)?a:s(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:o(i,n.workspaceConfig.workspaceRoot)?i:s(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{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,10 +1,10 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../alloy/src/create-plugin.cjs`),n=require(`../../deepkit/src/vendor/type.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(`@alloy-js/core/jsx-runtime`),m=require(`@storm-software/config-tools/types`),h=require(`@stryke/path/is-parent-path`),g=require(`@stryke/convert/to-array`),_=require(`defu`);_=e.__toESM(_);let v=require(`@stryke/string-format/title-case`),y=require(`@stryke/convert/parse-type-definition`),b=require(`@stryke/env/types`),x=require(`@stryke/fs/exists`),S=require(`@stryke/fs/helpers`),C=require(`@stryke/path/join`),w=require(`@stryke/string-format/constant-case`);const T=t.createAlloyPlugin((e={})=>({name:`env`,async config(){this.log(m.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,_.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[s.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,y.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 o.getEnvDefaultTypeDefinition(this);t.env.types=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,y.parseTypeDefinition)(t.env.secrets);else{let e=await o.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,g.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,w.constantCase)(t);return e.includes(n)||e.push(n),e},[...b.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,_.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,x.existsSync)(o.getEnvTypeReflectionsPath(this,`env`)))this.log(m.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await o.readEnvTypeReflection(this,`env`),(0,x.existsSync)(o.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await o.readEnvReflection(this)),(0,x.existsSync)(o.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await o.readEnvTypeReflection(this,`secrets`)),(0,x.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,h.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,C.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,h.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,C.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(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 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 n.type_exports.ReflectionClass({kind:n.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 n.type_exports.ReflectionClass({kind:n.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`))}},render(){let e=this;return this.log(m.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),(0,p.createComponent)(d.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(m.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,C.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,x.existsSync)(e)||await(0,S.createDirectory)(e);let t=await o.readEnvTypeReflection(this,`env`),r=(0,C.joinPaths)(e,`env.md`);this.log(m.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,v.titleCase)(this.config.framework)||`Powerlines`} -->
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(`@alloy-js/core/jsx-runtime`);const w=(e={})=>[r.default(e.babel),{name:`env`,async config(){this.log(m.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,p.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[o.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,_.parseTypeDefinition)(t.env.types);else{this.log(m.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await a.getEnvDefaultTypeDefinition(this);t.env.types=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,_.parseTypeDefinition)(t.env.secrets);else{let e=await a.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,f.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,S.constantCase)(t);return e.includes(n)||e.push(n),e},[...v.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(m.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,p.default)({parsed:await c.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,y.existsSync)(a.getEnvTypeReflectionsPath(this,`env`)))this.log(m.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await a.readEnvTypeReflection(this,`env`),(0,y.existsSync)(a.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await a.readEnvReflection(this)),(0,y.existsSync)(a.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await a.readEnvTypeReflection(this,`secrets`)),(0,y.existsSync)(a.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await a.readSecretsReflection(this));else{if(this.env.types.env=await i.reflectEnv(this,this.config.env.types?.file?(0,h.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,x.joinPaths)(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await a.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await i.reflectSecrets(this,this.config.env.secrets?.file?(0,h.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,x.joinPaths)(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await a.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(m.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await c.loadEnv(this,this.config.env)).forEach(([t,n])=>{let r=this.config.env.prefix.reduce((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,t),i=e.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await a.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await a.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await a.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(m.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,C.jsx)(u.EnvBuiltin,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(m.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,x.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,y.existsSync)(e)||await(0,b.createDirectory)(e);let n=await a.readEnvTypeReflection(this,`env`),r=(0,x.joinPaths)(e,`env.md`);this.log(m.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,g.titleCase)(this.config.framework)||`Powerlines`} -->
2
2
 
3
3
  Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
4
 
5
5
  | Name | Description | Type | Default Value | Required |
6
6
  | ---- | ----------- | ---- | ------------- | :------: |
7
- ${t.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
- `,``)??``).trim()} | ${(0,n.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
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
+ `,``)??``).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=o.getEnvReflectionsPath(this,`env`);this.log(m.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await o.writeEnvReflection(this,this.env.used.env,`env`)}})),E=(e={})=>[i.default(e.babel),T(e),{name:`env:automd-generator`,config(){return{automd:(0,_.default)(e.automd??{},{generators:{env:f.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},r.default(e.automd)];var D=E;exports.default=D;
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;
@@ -1,10 +1,10 @@
1
- import{createAlloyPlugin as e}from"../../alloy/src/create-plugin.mjs";import{type_exports as t}from"../../deepkit/src/vendor/type.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{createComponent as A}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as j}from"@storm-software/config-tools/types";import{isParentPath as M}from"@stryke/path/is-parent-path";import{toArray as N}from"@stryke/convert/to-array";import P from"defu";import{titleCase as F}from"@stryke/string-format/title-case";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as L}from"@stryke/env/types";import{existsSync as R}from"@stryke/fs/exists";import{createDirectory as z}from"@stryke/fs/helpers";import{joinPaths as B}from"@stryke/path/join";import{constantCase as V}from"@stryke/string-format/constant-case";const H=e((e={})=>({name:`env`,async config(){this.log(j.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:P(e,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(t.env.types)t.env.types=I(t.env.types);else{this.log(j.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await f(this);t.env.types=I(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=I(t.env.secrets);else{let e=await h(this);t.env.secrets=I(`${e.file}#${e.name}`)}return t.env.prefix=N(t.env.prefix??[]).reduce((e,t)=>{let n=V(t);return e.includes(n)||e.push(n),e},[...L,`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(j.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=P({parsed:await w(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&R(m(this,`env`)))this.log(j.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await _(this,`env`),R(p(this,`env`))&&(this.env.used.env=await g(this)),R(m(this,`secrets`))&&(this.env.types.secrets=await _(this,`secrets`)),R(p(this,`secrets`))&&(this.env.used.secrets=await v(this));else{if(this.env.types.env=await u(this,this.config.env.types?.file?M(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:B(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await x(this,this.env.types.env,`env`),this.env.types.secrets=await d(this,this.config.env.secrets?.file?M(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:B(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await x(this,this.env.types.secrets,`secrets`),this.log(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 e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await w(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.ReflectionClass({kind:t.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await b(this,this.env.used.env,`env`),this.env.types.secrets&&(await x(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.ReflectionClass({kind:t.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await b(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(j.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),A(D,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(j.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=B(this.config.projectRoot,`docs`,`generated`);R(e)||await z(e);let n=await _(this,`env`),r=B(e,`env.md`);this.log(j.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${F(this.config.framework)||`Powerlines`} -->
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"@alloy-js/core/jsx-runtime";var V=(r={})=>[n(r.babel),{name:`env`,async config(){this.log(j.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:A(r,{types:{},prefix:[]}),transform:{babel:{plugins:[x]}}};if(e.env.types)e.env.types=P(e.env.types);else{this.log(j.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await d(this);e.env.types=P(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=P(e.env.secrets);else{let t=await m(this);e.env.secrets=P(`${t.file}#${t.name}`)}return e.env.prefix=k(e.env.prefix??[]).reduce((e,t)=>{let n=z(t);return e.includes(n)||e.push(n),e},[...F,`POWERLINES_`]),e.env.prefix=e.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),e},async configResolved(){if(this.log(j.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=A({parsed:await C(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&I(p(this,`env`)))this.log(j.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await g(this,`env`),I(f(this,`env`))&&(this.env.used.env=await h(this)),I(p(this,`secrets`))&&(this.env.types.secrets=await g(this,`secrets`)),I(f(this,`secrets`))&&(this.env.used.secrets=await _(this));else{if(this.env.types.env=await l(this,this.config.env.types?.file?M(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:R(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await b(this,this.env.types.env,`env`),this.env.types.secrets=await u(this,this.config.env.secrets?.file?M(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:R(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await b(this,this.env.types.secrets,`secrets`),this.log(j.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await C(this,this.config.env)).forEach(([e,n])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=t.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await y(this,this.env.used.env,`env`),this.env.types.secrets&&(await b(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await y(this,this.env.used.secrets,`secrets`))}},async prepare(){return this.log(j.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(B(E,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(j.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=R(this.config.projectRoot,`docs`,`generated`);I(t)||await L(t);let n=await g(this,`env`),r=R(t,`env.md`);this.log(j.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${N(this.config.framework)||`Powerlines`} -->
2
2
 
3
3
  Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
4
 
5
5
  | Name | Description | Type | Default Value | Required |
6
6
  | ---- | ----------- | ---- | ------------- | :------: |
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
- `,``)??``).trim()} | ${(0,t.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
7
+ ${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
8
+ `,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
9
9
  `)}
10
- `)},async buildEnd(){let e=p(this,`env`);this.log(j.TRACE,`Writing env reflection types to ${e}.`),await b(this,this.env.used.env,`env`)}}));var U=(e={})=>[r(e.babel),H(e),{name:`env:automd-generator`,config(){return{automd:P(e.automd??{},{generators:{env:k(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},n(e.automd)];export{U as default};
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};
@@ -1,4 +1,5 @@
1
1
  import { Reflection } from "../../../deepkit/src/types.cjs";
2
+ import { AlloyPluginContext } from "../../../plugin-alloy/src/types/plugin.cjs";
2
3
  import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
3
4
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.cjs";
4
5
  import { EnvInterface, SecretsInterface } from "./runtime.cjs";
@@ -89,7 +90,7 @@ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
89
90
  prefix: string[];
90
91
  };
91
92
  };
92
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig> {
93
+ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
93
94
  env: {
94
95
  /**
95
96
  * The type definitions reflection for the env variables and secrets
@@ -1,10 +1,12 @@
1
1
  import { Reflection } from "../../../deepkit/src/types.mjs";
2
+ import { AlloyPluginContext } from "../../../plugin-alloy/src/types/plugin.mjs";
3
+ import "../../../plugin-alloy/src/types/index.mjs";
2
4
  import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.mjs";
3
5
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.mjs";
4
6
  import "../../../plugin-babel/src/types/index.mjs";
5
7
  import { EnvInterface, SecretsInterface } from "./runtime.mjs";
6
- import { Children } from "@alloy-js/core/jsx-runtime";
7
8
  import { DotenvParseOutput } from "@stryke/env/types";
9
+ import { Children } from "@alloy-js/core/jsx-runtime";
8
10
  import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
9
11
 
10
12
  //#region ../plugin-env/src/types/plugin.d.ts
@@ -90,7 +92,7 @@ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
90
92
  prefix: string[];
91
93
  };
92
94
  };
93
- interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig> {
95
+ interface EnvPluginContext<TResolvedConfig extends EnvPluginResolvedConfig = EnvPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {
94
96
  env: {
95
97
  /**
96
98
  * The type definitions reflection for the env variables and secrets
@@ -0,0 +1,6 @@
1
+ import "../../../powerlines/src/types/build.mjs";
2
+ import "../../../powerlines/src/types/config.mjs";
3
+ import "../../../powerlines/src/types/resolved.mjs";
4
+ import "../../../powerlines/src/types/context.mjs";
5
+ import "@alloy-js/core";
6
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
@@ -1,4 +1,4 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/replace`),n=require(`@stryke/path/join-paths`),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 t=e.config.build.override.inject??e.config.build.inject;return t&&Object.keys(t).length>0&&e.fs.writeSync((0,n.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,o.camelCase)(e)!==e){if(t.length===1)return`
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
2
  import ${(0,o.camelCase)(e)} from "${t[0]}";
3
3
  export { ${(0,o.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
4
4
  import ${t[1]===`*`?`* as ${(0,o.camelCase)(e)}`:`{ ${t[1]} as ${(0,o.camelCase)(e)} }`} from "${t[0]}";
@@ -11,4 +11,4 @@ import ${(0,o.camelCase)(e)} from "${t[0]}";
11
11
  export { ${(0,o.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:t&&Object.keys(t).length>0?[(0,n.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,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;
@@ -1,4 +1,4 @@
1
- import"../entry.mjs";import{replacePath as e}from"@stryke/path/replace";import{joinPaths as t}from"@stryke/path/join-paths";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(e){let r=e.config.build.override.inject??e.config.build.inject;return r&&Object.keys(r).length>0&&e.fs.writeSync(t(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.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`
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
2
  import ${a(e)} from "${t[0]}";
3
3
  export { ${a(e)} as "${e}" }`;if(t.length>1)return`
4
4
  import ${t[1]===`*`?`* as ${a(e)}`:`{ ${t[1]} as ${a(e)} }`} from "${t[0]}";
@@ -11,4 +11,4 @@ import ${a(e)} from "${t[0]}";
11
11
  export { ${a(e)} as "${e}" }`;else return`
12
12
  import ${e} from "${t}";
13
13
  export { ${e} };`;return``}).join(`
14
- `)),n({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:r&&Object.keys(r).length>0?[t(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?i(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?i(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};
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};
@@ -1 +1 @@
1
- require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/convert/to-array`),r=require(`@stryke/fs/is-file`),i=require(`@stryke/fs/list-files`),a=require(`@stryke/path/append`),o=require(`@stryke/path/join-paths`),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/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 +1 @@
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{toArray as n}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as r}from"@stryke/fs/list-files";import{appendPath as i}from"@stryke/path/append";import{joinPaths as a}from"@stryke/path/join-paths";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{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,3 +1,5 @@
1
+ import "esbuild";
2
+
1
3
  //#region ../powerlines/src/types/build.d.ts
2
4
 
3
5
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
@@ -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";
8
7
  import "c12";
9
8
  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";
@@ -39,7 +39,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
39
39
  * @remarks
40
40
  * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
41
41
  *
42
- * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
42
+ * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
43
43
  *
44
44
  * @see https://vitejs.dev/guide/api-plugin#config
45
45
  *
@@ -215,11 +215,10 @@ interface Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<
215
215
  * @param other - The other plugin to compare against.
216
216
  * @returns `true` if the two plugins are the same, `false` otherwise.
217
217
  */
218
- dedupe?: false | ((other: Plugin<TContext>) => boolean);
218
+ dedupe?: false | ((other: Plugin<any>) => boolean);
219
219
  /**
220
220
  * A list of pre-requisite plugins that must be loaded before this plugin can be used.
221
221
  */
222
- dependsOn?: PluginConfig<TContext>[];
223
222
  /**
224
223
  * Define environments where this plugin should be active. By default, the plugin is active in all environments.
225
224
  *
@@ -39,7 +39,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
39
39
  * @remarks
40
40
  * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
41
41
  *
42
- * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
42
+ * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
43
43
  *
44
44
  * @see https://vitejs.dev/guide/api-plugin#config
45
45
  *
@@ -215,11 +215,10 @@ interface Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<
215
215
  * @param other - The other plugin to compare against.
216
216
  * @returns `true` if the two plugins are the same, `false` otherwise.
217
217
  */
218
- dedupe?: false | ((other: Plugin<TContext>) => boolean);
218
+ dedupe?: false | ((other: Plugin<any>) => boolean);
219
219
  /**
220
220
  * A list of pre-requisite plugins that must be loaded before this plugin can be used.
221
221
  */
222
- dependsOn?: PluginConfig<TContext>[];
223
222
  /**
224
223
  * Define environments where this plugin should be active. By default, the plugin is active in all environments.
225
224
  *
@@ -1,3 +1,4 @@
1
+ import "./build.mjs";
1
2
  import { BabelUserConfig, EnvironmentConfig, InlineConfig, OutputConfig, UserConfig } from "./config.mjs";
2
3
  import { NonUndefined } from "@stryke/types/base";
3
4
  import { ResolvedPreviewOptions } from "vite";