@powerlines/plugin-crypto 0.10.32 → 0.10.34

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 (164) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  2. package/dist/{chunk-X42XA8SV.mjs → _virtual/rolldown_runtime.mjs} +1 -1
  3. package/dist/alloy/src/core/components/output.cjs +1 -0
  4. package/dist/alloy/src/core/components/output.mjs +1 -0
  5. package/dist/alloy/src/core/components/single-line-comment.cjs +1 -0
  6. package/dist/alloy/src/core/components/single-line-comment.mjs +1 -0
  7. package/dist/alloy/src/core/components/source-file.cjs +1 -0
  8. package/dist/alloy/src/core/components/source-file.mjs +1 -0
  9. package/dist/alloy/src/core/contexts/context.cjs +1 -0
  10. package/dist/alloy/src/core/contexts/context.mjs +1 -0
  11. package/dist/alloy/src/core/contexts/reflection.cjs +1 -0
  12. package/dist/alloy/src/core/contexts/reflection.mjs +1 -0
  13. package/dist/alloy/src/create-plugin.cjs +2 -0
  14. package/dist/alloy/src/create-plugin.mjs +2 -0
  15. package/dist/alloy/src/helpers/refkey.cjs +1 -0
  16. package/dist/alloy/src/helpers/refkey.mjs +1 -0
  17. package/dist/alloy/src/markdown/components/markdown-file.cjs +1 -0
  18. package/dist/alloy/src/markdown/components/markdown-file.mjs +1 -0
  19. package/dist/alloy/src/markdown/components/markdown-table.cjs +1 -0
  20. package/dist/alloy/src/markdown/components/markdown-table.mjs +1 -0
  21. package/dist/alloy/src/markdown/contexts/markdown-table.cjs +1 -0
  22. package/dist/alloy/src/markdown/contexts/markdown-table.mjs +1 -0
  23. package/dist/alloy/src/typescript/components/builtin-file.cjs +1 -0
  24. package/dist/alloy/src/typescript/components/builtin-file.mjs +1 -0
  25. package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +1 -0
  26. package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +1 -0
  27. package/dist/alloy/src/typescript/components/tsdoc.cjs +1 -0
  28. package/dist/alloy/src/typescript/components/tsdoc.mjs +1 -0
  29. package/dist/alloy/src/typescript/components/typescript-file.cjs +1 -0
  30. package/dist/alloy/src/typescript/components/typescript-file.mjs +1 -0
  31. package/dist/alloy/src/typescript/components/typescript-interface.cjs +1 -0
  32. package/dist/alloy/src/typescript/components/typescript-interface.mjs +1 -0
  33. package/dist/alloy/src/typescript/components/typescript-object.cjs +1 -0
  34. package/dist/alloy/src/typescript/components/typescript-object.mjs +1 -0
  35. package/dist/components/crypto.cjs +133 -0
  36. package/dist/components/crypto.d.cts +13 -0
  37. package/dist/components/crypto.d.mts +13 -0
  38. package/dist/components/crypto.mjs +133 -0
  39. package/dist/components/index.cjs +1 -0
  40. package/dist/components/index.d.mts +1 -0
  41. package/dist/components/index.mjs +1 -0
  42. package/dist/deepkit/schemas/reflection.cjs +1 -0
  43. package/dist/deepkit/schemas/reflection.d.cts +1560 -0
  44. package/dist/deepkit/schemas/reflection.d.mts +1560 -0
  45. package/dist/deepkit/schemas/reflection.mjs +1 -0
  46. package/dist/deepkit/schemas/reflection2.cjs +1 -0
  47. package/dist/deepkit/schemas/reflection2.mjs +1 -0
  48. package/dist/deepkit/src/capnp.cjs +1 -0
  49. package/dist/deepkit/src/capnp.mjs +1 -0
  50. package/dist/deepkit/src/reflect-type.cjs +1 -0
  51. package/dist/deepkit/src/reflect-type.mjs +1 -0
  52. package/dist/deepkit/src/resolve-reflections.cjs +1 -0
  53. package/dist/deepkit/src/resolve-reflections.mjs +1 -0
  54. package/dist/deepkit/src/types.d.cts +10 -0
  55. package/dist/deepkit/src/types.d.mts +10 -0
  56. package/dist/deepkit/src/utilities.cjs +1 -0
  57. package/dist/deepkit/src/utilities.mjs +1 -0
  58. package/dist/deepkit/src/vendor/type.cjs +1 -0
  59. package/dist/deepkit/src/vendor/type.d.cts +7 -0
  60. package/dist/deepkit/src/vendor/type.d.mts +7 -0
  61. package/dist/deepkit/src/vendor/type.mjs +1 -0
  62. package/dist/index.cjs +1 -208
  63. package/dist/index.d.cts +4 -12
  64. package/dist/index.d.mts +5 -12
  65. package/dist/index.mjs +1 -205
  66. package/dist/plugin-babel/src/helpers/ast-utils.cjs +1 -0
  67. package/dist/plugin-babel/src/helpers/ast-utils.mjs +1 -0
  68. package/dist/plugin-babel/src/helpers/create-plugin.cjs +1 -0
  69. package/dist/plugin-babel/src/helpers/create-plugin.mjs +1 -0
  70. package/dist/plugin-babel/src/helpers/filters.cjs +1 -0
  71. package/dist/plugin-babel/src/helpers/filters.mjs +1 -0
  72. package/dist/plugin-babel/src/helpers/index.cjs +1 -0
  73. package/dist/plugin-babel/src/helpers/index.mjs +1 -0
  74. package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -0
  75. package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -0
  76. package/dist/plugin-babel/src/helpers/options.cjs +1 -0
  77. package/dist/plugin-babel/src/helpers/options.mjs +1 -0
  78. package/dist/plugin-babel/src/index.cjs +1 -0
  79. package/dist/plugin-babel/src/index.mjs +1 -0
  80. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  81. package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
  82. package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
  83. package/dist/plugin-env/src/babel/index.cjs +1 -0
  84. package/dist/plugin-env/src/babel/index.mjs +1 -0
  85. package/dist/plugin-env/src/babel/plugin.cjs +5 -0
  86. package/dist/plugin-env/src/babel/plugin.mjs +5 -0
  87. package/dist/plugin-env/src/components/docs.cjs +1 -0
  88. package/dist/plugin-env/src/components/docs.mjs +1 -0
  89. package/dist/plugin-env/src/components/env.cjs +34 -0
  90. package/dist/plugin-env/src/components/env.mjs +31 -0
  91. package/dist/plugin-env/src/components/index.cjs +1 -0
  92. package/dist/plugin-env/src/components/index.mjs +1 -0
  93. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +1 -0
  94. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +1 -0
  95. package/dist/plugin-env/src/helpers/index.cjs +1 -0
  96. package/dist/plugin-env/src/helpers/index.mjs +1 -0
  97. package/dist/plugin-env/src/helpers/load.cjs +1 -0
  98. package/dist/plugin-env/src/helpers/load.mjs +1 -0
  99. package/dist/plugin-env/src/helpers/persistence.cjs +1 -0
  100. package/dist/plugin-env/src/helpers/persistence.mjs +1 -0
  101. package/dist/plugin-env/src/helpers/reflect.cjs +1 -0
  102. package/dist/plugin-env/src/helpers/reflect.mjs +1 -0
  103. package/dist/plugin-env/src/helpers/source-file-env.cjs +1 -0
  104. package/dist/plugin-env/src/helpers/source-file-env.mjs +1 -0
  105. package/dist/plugin-env/src/helpers/template-helpers.cjs +1 -0
  106. package/dist/plugin-env/src/helpers/template-helpers.mjs +1 -0
  107. package/dist/plugin-env/src/index.cjs +16 -0
  108. package/dist/plugin-env/src/index.mjs +16 -0
  109. package/dist/plugin-env/src/types/plugin.d.cts +135 -0
  110. package/dist/plugin-env/src/types/plugin.d.mts +136 -0
  111. package/dist/plugin-env/src/types/runtime.d.cts +792 -0
  112. package/dist/plugin-env/src/types/runtime.d.mts +792 -0
  113. package/dist/powerlines/src/lib/build/esbuild.cjs +14 -0
  114. package/dist/powerlines/src/lib/build/esbuild.mjs +14 -0
  115. package/dist/powerlines/src/lib/entry.cjs +1 -0
  116. package/dist/powerlines/src/lib/entry.mjs +1 -0
  117. package/dist/powerlines/src/lib/logger.cjs +1 -0
  118. package/dist/powerlines/src/lib/logger.mjs +1 -0
  119. package/dist/powerlines/src/lib/utilities/bundle.cjs +1 -0
  120. package/dist/powerlines/src/lib/utilities/bundle.mjs +1 -0
  121. package/dist/powerlines/src/lib/utilities/file-header.cjs +10 -0
  122. package/dist/powerlines/src/lib/utilities/file-header.mjs +10 -0
  123. package/dist/powerlines/src/lib/utilities/resolve.cjs +1 -0
  124. package/dist/powerlines/src/lib/utilities/resolve.mjs +1 -0
  125. package/dist/powerlines/src/plugin-utils/helpers.cjs +1 -0
  126. package/dist/powerlines/src/plugin-utils/helpers.mjs +1 -0
  127. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  128. package/dist/powerlines/src/plugin-utils/paths.mjs +1 -0
  129. package/dist/powerlines/src/types/babel.d.cts +22 -0
  130. package/dist/powerlines/src/types/babel.d.mts +22 -0
  131. package/dist/powerlines/src/types/build.d.cts +139 -0
  132. package/dist/powerlines/src/types/build.d.mts +139 -0
  133. package/dist/powerlines/src/types/commands.d.cts +8 -0
  134. package/dist/powerlines/src/types/commands.d.mts +9 -0
  135. package/dist/powerlines/src/types/config.d.cts +356 -0
  136. package/dist/powerlines/src/types/config.d.mts +357 -0
  137. package/dist/powerlines/src/types/context.d.cts +358 -0
  138. package/dist/powerlines/src/types/context.d.mts +360 -0
  139. package/dist/powerlines/src/types/fs.d.cts +458 -0
  140. package/dist/powerlines/src/types/fs.d.mts +458 -0
  141. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  142. package/dist/powerlines/src/types/plugin.d.cts +232 -0
  143. package/dist/powerlines/src/types/plugin.d.mts +232 -0
  144. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  145. package/dist/powerlines/src/types/resolved.d.mts +82 -0
  146. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  147. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  148. package/dist/types/index.cjs +0 -1
  149. package/dist/types/index.d.cts +1 -2
  150. package/dist/types/index.d.mts +1 -2
  151. package/dist/types/index.mjs +1 -1
  152. package/dist/types/plugin.cjs +0 -1
  153. package/dist/types/plugin.d.cts +41 -1
  154. package/dist/types/plugin.d.mts +41 -1
  155. package/dist/types/plugin.mjs +1 -1
  156. package/package.json +8 -8
  157. package/dist/index-CEgs-Dz2.d.cts +0 -1
  158. package/dist/index-D9zIjQH9.d.mts +0 -1
  159. package/dist/plugin-DHXHjv16.cjs +0 -0
  160. package/dist/plugin-DzeYlbKJ.mjs +0 -1
  161. package/dist/plugin-Eengqhgj.d.mts +0 -4207
  162. package/dist/plugin-QQeJHnEx.d.cts +0 -4208
  163. package/dist/types-BKeuN6sy.mjs +0 -1
  164. package/dist/types-DHkg7xmX.cjs +0 -0
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(e,n,r,i)=>{i&&(t(e,Symbol.toStringTag,{value:`Module`}),r&&t(r,Symbol.toStringTag,{value:`Module`})),o(e,n,`default`),r&&o(r,n,`default`)},c=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__reExport=s,exports.__toESM=c;
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},a=(t,n,r,a)=>{a&&(e(t,Symbol.toStringTag,{value:`Module`}),r&&e(r,Symbol.toStringTag,{value:`Module`})),i(t,n,`default`),r&&i(r,n,`default`)};export{a as t};
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},a=(t,n,r,a)=>{a&&(e(t,Symbol.toStringTag,{value:`Module`}),r&&e(r,Symbol.toStringTag,{value:`Module`})),i(t,n,`default`),r&&i(r,n,`default`)};export{a as __reExport};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../contexts/context.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@stryke/path/replace`);function a(e){let[{children:a,context:o,basePath:s},c]=(0,r.splitProps)(e,[`children`,`context`,`basePath`]),l=(0,r.ref)(o),u=(0,r.computed)(()=>s?(0,i.replacePath)(s,l.value.workspaceConfig.workspaceRoot):l.value.workspaceConfig.workspaceRoot);return(0,n.createComponent)(r.Output,(0,n.mergeProps)(c,{get basePath(){return u.value},get children(){return(0,n.createComponent)(t.PowerlinesContext.Provider,{value:{ref:l},get children(){return(0,n.createComponent)(r.Show,{get when(){return!!l.value},children:a})}})}}))}exports.Output=a;
@@ -0,0 +1 @@
1
+ import{PowerlinesContext as e}from"../contexts/context.mjs";import{createComponent as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Output as r,Show as i,computed as a,ref as o,splitProps as s}from"@alloy-js/core";import{replacePath as c}from"@stryke/path/replace";function l(l){let[{children:u,context:d,basePath:f},p]=s(l,[`children`,`context`,`basePath`]),m=o(d),h=a(()=>f?c(f,m.value.workspaceConfig.workspaceRoot):m.value.workspaceConfig.workspaceRoot);return t(r,n(p,{get basePath(){return h.value},get children(){return t(e.Provider,{value:{ref:m},get children(){return t(i,{get when(){return!!m.value},children:u})}})}}))}export{l as Output};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`);function r(e){let{variant:r=`double-slash`,children:i}=e,a=r===`slash-star`?`/* `:r===`slash-star-star`?`/** `:r===`triple-slash`?`/// `:r===`markdown`?`<!-- `:`// `;return[a,(0,t.createIntrinsic)(`align`,{string:a,get children(){return[(0,t.createComponent)(n.Prose,{children:i}),r===`slash-star`||r===`slash-star-star`?` */ `:r===`markdown`?` -->`:``]}})]}exports.SingleLineComment=r;
@@ -0,0 +1 @@
1
+ import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{Prose as n}from"@alloy-js/core";function r(r){let{variant:i=`double-slash`,children:a}=r,o=i===`slash-star`?`/* `:i===`slash-star-star`?`/** `:i===`triple-slash`?`/// `:i===`markdown`?`<!-- `:`// `;return[o,t(`align`,{string:o,get children(){return[e(n,{children:a}),i===`slash-star`||i===`slash-star-star`?` */ `:i===`markdown`?` -->`:``]}})]}export{r as SingleLineComment};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/path/append`);function a(e){let[{children:a,meta:o,path:s,header:c,preset:l,filetype:u,reference:d}]=(0,n.splitProps)(e,[`children`,`meta`,`path`,`header`,`preset`,`filetype`,`reference`]),f=(0,n.useContext)(n.SourceDirectoryContext),p={path:(0,i.appendPath)(s,f.path),filetype:u,reference:d};f?.addContent(p);let m=(0,n.useFormatOptions)({printWidth:e.printWidth,tabWidth:e.tabWidth,useTabs:e.useTabs,insertFinalNewLine:e.insertFinalNewLine}),h=(0,n.getContext)();return h.meta=(0,r.default)({sourceFile:p,printOptions:m,output:{preset:l}},o??{}),(0,t.createComponent)(n.SourceFileContext.Provider,{value:p,get children(){return[(0,t.createComponent)(n.Show,{when:c!==void 0,get children(){return[c,(0,t.createIntrinsic)(`hbr`,{})]}}),a]}})}exports.SourceFile=a;
@@ -0,0 +1 @@
1
+ import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{Show as n,SourceDirectoryContext as r,SourceFileContext as i,getContext as a,splitProps as o,useContext as s,useFormatOptions as c}from"@alloy-js/core";import l from"defu";import{appendPath as u}from"@stryke/path/append";function d(d){let[{children:f,meta:p,path:m,header:h,preset:g,filetype:_,reference:v}]=o(d,[`children`,`meta`,`path`,`header`,`preset`,`filetype`,`reference`]),y=s(r),b={path:u(m,y.path),filetype:_,reference:v};y?.addContent(b);let x=c({printWidth:d.printWidth,tabWidth:d.tabWidth,useTabs:d.useTabs,insertFinalNewLine:d.insertFinalNewLine}),S=a();return S.meta=l({sourceFile:b,printOptions:x,output:{preset:g}},p??{}),e(i.Provider,{value:b,get children(){return[e(n,{when:h!==void 0,get children(){return[h,t(`hbr`,{})]}}),f]}})}export{d as SourceFile};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createContext)();function r(){return(0,t.useContext)(n)}function i(){return r()?.ref?.value}exports.PowerlinesContext=n,exports.usePowerlines=i;
@@ -0,0 +1 @@
1
+ import{createContext as e,useContext as t}from"@alloy-js/core";const n=e();function r(){return t(n)}function i(){return r()?.ref?.value}export{n as PowerlinesContext,i as usePowerlines};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createContext)();function r(){let e=(0,t.useContext)(n);if(!e)throw Error("Powerlines - ReflectionClass Context is not set. Make sure this component is wrapped in a `Output` component or being rendered by the `RenderPlugin` from `@powerlines/devkit`.");return e}const i=(0,t.createNamedContext)(`reflection-property`);function a(){let e=(0,t.useContext)(i);if(!e)throw Error("Powerlines - Reflection Property Context is not set. Make sure this component is wrapped in a `Output` component or being rendered by the `RenderPlugin` from `@powerlines/devkit`.");return e}const o=(0,t.createNamedContext)(`reflection-method`),s=(0,t.createNamedContext)(`reflection-parameter`);exports.ReflectionClassContext=n,exports.ReflectionPropertyContext=i,exports.useReflectionClass=r,exports.useReflectionProperty=a;
@@ -0,0 +1 @@
1
+ import{createContext as e,createNamedContext as t,useContext as n}from"@alloy-js/core";const r=e();function i(){let e=n(r);if(!e)throw Error("Powerlines - ReflectionClass Context is not set. Make sure this component is wrapped in a `Output` component or being rendered by the `RenderPlugin` from `@powerlines/devkit`.");return e}const a=t(`reflection-property`);function o(){let e=n(a);if(!e)throw Error("Powerlines - Reflection Property Context is not set. Make sure this component is wrapped in a `Output` component or being rendered by the `RenderPlugin` from `@powerlines/devkit`.");return e}t(`reflection-method`),t(`reflection-parameter`);export{r as ReflectionClassContext,a as ReflectionPropertyContext,i as useReflectionClass,o as useReflectionProperty};
@@ -0,0 +1,2 @@
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../powerlines/src/plugin-utils/helpers.cjs`),n=require(`./core/components/output.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@storm-software/config-tools/types`),o=require(`@stryke/path/is-parent-path`),s=require(`@stryke/path/replace`),c=require(`@stryke/type-checks/is-set-string`),l=require(`prettier/doc.js`);function u(e){return a=>{let o=e(a);return{...o,async prepare(){let e=this;if(t.isPluginHook(o.prepare)&&o.enforce!==`post`&&(t.isPluginHookFunction(o.prepare)||t.isPluginHookObject(o.prepare)&&o.prepare.order!==`post`)&&await Promise.resolve(t.getHookHandler(o.prepare).call(this)),t.isPluginHook(o.render)){let t=(0,i.renderTree)((0,r.createComponent)(n.Output,{context:e,get basePath(){return e.workspaceConfig.workspaceRoot},get children(){return o.render.call(e)}}));await d(this,t,a?.alloy)}t.isPluginHook(o.prepare)&&(o.enforce===`post`||t.isPluginHookObject(o.prepare)&&o.prepare.order===`post`)&&await Promise.resolve(t.getHookHandler(o.prepare).call(this))}}}}async function d(e,t,n={}){await(0,i.flushJobsAsync)();let r,l=async(t,c)=>{if(!Array.isArray(c))return;let u=async e=>{for(let t of c)await l(e,t)},d=(0,i.getContextForRenderNode)(c);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await u(e)}else if(d.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(d.meta?.builtin){if(!d.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(a.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,s.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)}}else d.meta?.entry||(0,o.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(a.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)}):(e.log(a.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)});t.contents.push(r)}else if(d.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(a.LogLevelLabel.TRACE,`Processing copy file operation from "${d.meta.copyFile.sourcePath}" to "${d.meta.copyFile.path}"`),!d.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!d.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await u(t)};await l(void 0,t);let u=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await u(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!(0,c.isSetString)(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&(0,c.isSetString)(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await u(e,r)}async function f(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,i.flushJobsAsync)();let r=l.printer.printDocToString(p(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
2
+ `)?`${r}\n`:r}function p(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else (0,i.isPrintHook)(n)?t.push(n.print(n.subtree,p)):t.push(p(n));return t}exports.createAlloyPlugin=u;
@@ -0,0 +1,2 @@
1
+ import{getHookHandler as e,isPluginHook as t,isPluginHookFunction as n,isPluginHookObject as r}from"../../powerlines/src/plugin-utils/helpers.mjs";import{Output as i}from"./core/components/output.mjs";import{createComponent as a}from"@alloy-js/core/jsx-runtime";import{flushJobsAsync as o,getContextForRenderNode as s,isPrintHook as c,renderTree as l}from"@alloy-js/core";import{LogLevelLabel as u}from"@storm-software/config-tools/types";import{isParentPath as d}from"@stryke/path/is-parent-path";import{replacePath as f}from"@stryke/path/replace";import{isSetString as p}from"@stryke/type-checks/is-set-string";import{printer as m}from"prettier/doc.js";function h(o){return s=>{let c=o(s);return{...c,async prepare(){let o=this;if(t(c.prepare)&&c.enforce!==`post`&&(n(c.prepare)||r(c.prepare)&&c.prepare.order!==`post`)&&await Promise.resolve(e(c.prepare).call(this)),t(c.render)){let e=l(a(i,{context:o,get basePath(){return o.workspaceConfig.workspaceRoot},get children(){return c.render.call(o)}}));await g(this,e,s?.alloy)}t(c.prepare)&&(c.enforce===`post`||r(c.prepare)&&c.prepare.order===`post`)&&await Promise.resolve(e(c.prepare).call(this))}}}}async function g(e,t,n={}){await o();let r,i=async(t,a)=>{if(!Array.isArray(a))return;let o=async e=>{for(let t of a)await i(e,t)},c=s(a);if(!c)return o(t);if(c.meta?.directory){let e={kind:`directory`,path:c.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await o(e)}else if(c.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(c.meta?.builtin){if(!c.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(u.TRACE,`Rendering built-in runtime module with ID: ${c.meta.builtin.id}`),r={kind:`builtin`,id:c.meta.builtin.id,path:f(c.meta.sourceFile.path,e.builtinsPath),filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)}}else c.meta?.entry||d(e.entryPath,c.meta.sourceFile.path)?(e.log(u.TRACE,`Rendering entry module at path: ${c.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:c.meta.entry?.typeDefinition,path:c.meta.sourceFile.path,filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)}):(e.log(u.TRACE,`Rendering source file at path: ${c.meta.sourceFile.path}`),r={kind:`file`,path:c.meta.sourceFile.path,filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)});t.contents.push(r)}else if(c.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(u.TRACE,`Processing copy file operation from "${c.meta.copyFile.sourcePath}" to "${c.meta.copyFile.path}"`),!c.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!c.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:c.meta.copyFile.path,sourcePath:c.meta.copyFile.sourcePath,preset:c.meta.output?.preset})}else await o(t)};await i(void 0,t);let a=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await a(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!p(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&p(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await a(e,r)}async function _(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await o();let r=m.printDocToString(v(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
2
+ `)?`${r}\n`:r}function v(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else c(n)?t.push(n.print(n.subtree,v)):t.push(v(n));return t}export{h as createAlloyPlugin};
@@ -0,0 +1 @@
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);function n(...e){return(0,t.refkey)(`powerlines`,...e)}exports.refkey=n;
@@ -0,0 +1 @@
1
+ import{refkey as e}from"@alloy-js/core";function t(...t){return e(`powerlines`,...t)}export{t as refkey};
@@ -0,0 +1 @@
1
+ require(`../../core/components/single-line-comment.cjs`),require(`../../core/components/source-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);require(`@alloy-js/markdown`);
@@ -0,0 +1 @@
1
+ import"../../core/components/single-line-comment.mjs";import"../../core/components/source-file.mjs";import{createComponent as e,createIntrinsic as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Show as r,code as i,getContext as a,splitProps as o}from"@alloy-js/core";import"@alloy-js/markdown";export{};
@@ -0,0 +1 @@
1
+ require(`../contexts/markdown-table.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@stryke/type-checks/is-undefined`),r=require(`@stryke/string-format/title-case`);
@@ -0,0 +1 @@
1
+ import"../contexts/markdown-table.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{Prose as n,Show as r,code as i,computed as a,splitProps as o}from"@alloy-js/core";import{isUndefined as s}from"@stryke/type-checks/is-undefined";import{titleCase as c}from"@stryke/string-format/title-case";export{};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createNamedContext)(`markdown-table-column`,{}),r=(0,t.createContext)({columns:[],data:[]});
@@ -0,0 +1 @@
1
+ import{createContext as e,createNamedContext as t,useContext as n}from"@alloy-js/core";t(`markdown-table-column`,{}),e({columns:[],data:[]});export{};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`./tsdoc.cjs`),n=require(`./typescript-file.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`);function a(e){let[{children:a,imports:o,id:s,description:c,tsx:l},u]=(0,i.splitProps)(e,[`children`,`imports`,`id`,`description`,`tsx`]);return(0,r.createComponent)(n.TypescriptFile,(0,r.mergeProps)({get header(){return(0,r.createComponent)(n.TypescriptFileHeader,{get header(){return(0,r.createComponent)(t.TSDocModule,{name:s,children:c})},get children(){return(0,r.createComponent)(n.TypescriptFileHeaderImports,{imports:o})}})},meta:{builtin:{id:s}}},u,{path:`${s}${l?`.tsx`:`.ts`}`,children:a}))}exports.BuiltinFile=a;
@@ -0,0 +1 @@
1
+ import{TSDocModule as e}from"./tsdoc.mjs";import{TypescriptFile as t,TypescriptFileHeader as n,TypescriptFileHeaderImports as r}from"./typescript-file.mjs";import{createComponent as i,mergeProps as a}from"@alloy-js/core/jsx-runtime";import{splitProps as o}from"@alloy-js/core";function s(s){let[{children:c,imports:l,id:u,description:d,tsx:f},p]=o(s,[`children`,`imports`,`id`,`description`,`tsx`]);return i(t,a({get header(){return i(n,{get header(){return i(e,{name:u,children:d})},get children(){return i(r,{imports:l})}})},meta:{builtin:{id:u}}},p,{path:`${u}${f?`.tsx`:`.ts`}`,children:c}))}export{s as BuiltinFile};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`./tsdoc.cjs`),n=require(`../../core/contexts/reflection.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@stryke/type-checks/is-set-string`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@stryke/string-format/title-case`),c=require(`@stryke/type-checks/is-string`);function l(e){let[{children:c},l]=(0,i.splitProps)(e,[`children`]),u=n.useReflectionClass(),d=(0,i.computed)(()=>u.reflection.getTitle()||(0,s.titleCase)(u.reflection.getName())),f=(0,i.computed)(()=>u.reflection.getAlias()),p=(0,i.computed)(()=>u.reflection.getDomain()),m=(0,i.computed)(()=>u.reflection.getPermission()),h=(0,i.computed)(()=>u.reflection.isReadonly()),g=(0,i.computed)(()=>u.reflection.isInternal()),_=(0,i.computed)(()=>u.reflection.isIgnored()),v=(0,i.computed)(()=>u.reflection.isHidden());return u.reflection.getName()?(0,r.createComponent)(t.TSDoc,(0,r.mergeProps)(l,{get heading(){return u.reflection.getDescription()},get children(){return[(0,r.createComponent)(i.Show,{get when(){return(0,a.isSetString)(d.value)||!(0,o.isUndefined)(f.value)&&f.value.length>0||!(0,o.isUndefined)(m.value)&&m.value.length>0||(0,a.isSetString)(p.value)||!(0,o.isUndefined)(h.value)||!(0,o.isUndefined)(g.value)||!(0,o.isUndefined)(_.value)||!(0,o.isUndefined)(v.value)},get children(){return(0,r.createComponent)(t.TSDocAttributesTags,{get title(){return d.value},get alias(){return f.value},get domain(){return p.value},get permission(){return m.value},get readonly(){return h.value},get internal(){return g.value},get ignore(){return _.value},get hidden(){return v.value}})}}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!!c)()&&(0,i.childrenArray)(()=>c).length>0},get children(){return(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>c)}})}})]}})):null}function u(e){let[{children:a},o]=(0,i.splitProps)(e,[`children`]),s=n.useReflectionProperty();return(0,r.createComponent)(t.TSDoc,(0,r.mergeProps)({get heading(){return s.getDescription()}},o,{get children(){return[(0,r.createComponent)(t.TSDocAttributesTags,{get title(){return s.getTitle()},get alias(){return s.getAlias()},get domain(){return s.getDomain()},get permission(){return s.getPermission()},get readonly(){return s.isReadonly()},get internal(){return s.isInternal()},get ignore(){return s.isIgnored()},get hidden(){return s.isHidden()}}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!!a)()&&(0,i.childrenArray)(()=>a).length>0},get children(){return(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>a)}})}})]}}))}exports.TSDocReflectionClass=l,exports.TSDocReflectionProperty=u;
@@ -0,0 +1 @@
1
+ import{TSDoc as e,TSDocAttributesTags as t}from"./tsdoc.mjs";import{useReflectionClass as n,useReflectionProperty as r}from"../../core/contexts/reflection.mjs";import{createComponent as i,memo as a,mergeProps as o}from"@alloy-js/core/jsx-runtime";import{List as s,Show as c,childrenArray as l,code as u,computed as d,splitProps as f}from"@alloy-js/core";import{isSetString as p}from"@stryke/type-checks/is-set-string";import{isUndefined as m}from"@stryke/type-checks/is-undefined";import{titleCase as h}from"@stryke/string-format/title-case";import{isString as g}from"@stryke/type-checks/is-string";function _(r){let[{children:u},g]=f(r,[`children`]),_=n(),v=d(()=>_.reflection.getTitle()||h(_.reflection.getName())),y=d(()=>_.reflection.getAlias()),b=d(()=>_.reflection.getDomain()),x=d(()=>_.reflection.getPermission()),S=d(()=>_.reflection.isReadonly()),C=d(()=>_.reflection.isInternal()),w=d(()=>_.reflection.isIgnored()),T=d(()=>_.reflection.isHidden());return _.reflection.getName()?i(e,o(g,{get heading(){return _.reflection.getDescription()},get children(){return[i(c,{get when(){return p(v.value)||!m(y.value)&&y.value.length>0||!m(x.value)&&x.value.length>0||p(b.value)||!m(S.value)||!m(C.value)||!m(w.value)||!m(T.value)},get children(){return i(t,{get title(){return v.value},get alias(){return y.value},get domain(){return b.value},get permission(){return x.value},get readonly(){return S.value},get internal(){return C.value},get ignore(){return w.value},get hidden(){return T.value}})}}),i(c,{get when(){return a(()=>!!u)()&&l(()=>u).length>0},get children(){return i(s,{get children(){return l(()=>u)}})}})]}})):null}function v(n){let[{children:u},d]=f(n,[`children`]),p=r();return i(e,o({get heading(){return p.getDescription()}},d,{get children(){return[i(t,{get title(){return p.getTitle()},get alias(){return p.getAlias()},get domain(){return p.getDomain()},get permission(){return p.getPermission()},get readonly(){return p.isReadonly()},get internal(){return p.isInternal()},get ignore(){return p.isIgnored()},get hidden(){return p.isHidden()}}),i(c,{get when(){return a(()=>!!u)()&&l(()=>u).length>0},get children(){return i(s,{get children(){return l(()=>u)}})}})]}}))}export{_ as TSDocReflectionClass,v as TSDocReflectionProperty};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../core/contexts/context.cjs`),n=require(`../../../../deepkit/src/utilities.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@stryke/type-checks/is-set-string`),o=require(`@stryke/type-checks/is-undefined`);function s(e){let[{children:t,heading:n}]=(0,i.splitProps)(e,[`children`,`heading`]);return[`/**`,(0,r.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.Show,{get when(){return!(0,o.isUndefined)(n)},get children(){return[n,(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!(0,o.isUndefined)(t))()&&(0,i.childrenArray)(()=>t).length>0},get children(){return(0,r.createIntrinsic)(`hbr`,{})}})]}}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!(0,o.isUndefined)(t))()&&(0,i.childrenArray)(()=>t).length>0},get children(){return(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>t)}})}})]}}),(0,r.createIntrinsic)(`hbr`,{}),` */`,(0,r.createIntrinsic)(`hbr`,{})]}function c(e){let[{children:t,tag:n}]=(0,i.splitProps)(e,[`children`,`tag`]);return[`@${n} `,(0,r.createComponent)(i.Show,{get when(){return!!t},get children(){return(0,r.createIntrinsic)(`align`,{width:2,get children(){return(0,r.createComponent)(i.Prose,{children:t})}})}}),(0,r.createIntrinsic)(`hbr`,{})]}function l(e){let[{children:t},n]=(0,i.splitProps)(e,[`children`]);return(0,r.createComponent)(c,(0,r.mergeProps)(n,{tag:`title`,children:t}))}function u(e){let[{children:t},n]=(0,i.splitProps)(e,[`children`]);return(0,r.createComponent)(c,(0,r.mergeProps)(n,{tag:`domain`,children:t}))}function d(e){let[{children:t},n]=(0,i.splitProps)(e,[`children`]);return(0,r.createComponent)(c,(0,r.mergeProps)(n,{tag:`alias`,children:t}))}function f(e){let[{children:t},n]=(0,i.splitProps)(e,[`children`]);return(0,r.createComponent)(c,(0,r.mergeProps)(n,{tag:`permission`,children:t}))}function p(e){return[`@defaultValue `,(0,r.createComponent)(i.Show,{get when(){return!(0,o.isUndefined)(e.value)},get children(){return(0,r.createIntrinsic)(`align`,{width:2,get children(){return(0,r.createComponent)(i.Prose,{get children(){return n.stringifyDefaultValue(e.value)}})}})}}),(0,r.createIntrinsic)(`hbr`,{})]}function m(e){return[`@remarks `,(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.List,{hardline:!0,get children(){return(0,i.childrenArray)(()=>e.children)}})]}function h(e){return(0,r.createComponent)(c,(0,r.mergeProps)(e,{tag:`see`}))}function g(e){let[{tsx:t,fenced:n=!0,language:a,children:o}]=(0,i.splitProps)(e,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.Show,{when:n,get children(){return["```",a||(t?`tsx`:`ts`),(0,r.createIntrinsic)(`hbr`,{})]}}),o,(0,r.createComponent)(i.Show,{when:n,get children(){return[(0,r.createIntrinsic)(`hbr`,{}),"```"]}})]}function _(){return(0,r.createComponent)(c,{tag:`readonly`})}function v(){return(0,r.createComponent)(c,{tag:`internal`})}function y(){return(0,r.createComponent)(c,{tag:`ignore`})}function b(){return(0,r.createComponent)(c,{tag:`hidden`})}function x(e){let[{title:t,alias:n,permission:s,domain:c,readonly:m,internal:h,ignore:g,hidden:x,defaultValue:S}]=(0,i.splitProps)(e,[`title`,`alias`,`permission`,`domain`,`readonly`,`internal`,`ignore`,`hidden`,`defaultValue`]);return[(0,r.createComponent)(i.Show,{get when(){return(0,a.isSetString)(t)},get children(){return(0,r.createComponent)(l,{children:t})}}),(0,r.createComponent)(i.Show,{get when(){return!(0,o.isUndefined)(n)&&n.length>0},get children(){return(0,r.createComponent)(i.For,{each:n??[],children:e=>(0,r.createComponent)(d,{children:e})})}}),(0,r.createComponent)(i.Show,{get when(){return(0,a.isSetString)(c)},get children(){return(0,r.createComponent)(u,{children:c})}}),(0,r.createComponent)(i.Show,{get when(){return!(0,o.isUndefined)(s)&&s.length>0},get children(){return(0,r.createComponent)(i.For,{each:s??[],children:e=>(0,r.createComponent)(f,{children:e})})}}),(0,r.createComponent)(i.Show,{when:m===!0,get children(){return(0,r.createComponent)(_,{})}}),(0,r.createComponent)(i.Show,{when:h===!0,get children(){return(0,r.createComponent)(v,{})}}),(0,r.createComponent)(i.Show,{when:g===!0,get children(){return(0,r.createComponent)(y,{})}}),(0,r.createComponent)(i.Show,{when:x===!0,get children(){return(0,r.createComponent)(b,{})}}),(0,r.createComponent)(i.Show,{get when(){return!(0,o.isUndefined)(S)},get children(){return(0,r.createComponent)(p,{value:S})}})]}function S(e){return[`@param `,(0,r.createComponent)(C,{get name(){return e.name},get optional(){return e.optional},get defaultValue(){return e.defaultValue}}),(0,r.createComponent)(w,{get children(){return e.children}})]}function C(e){return[(0,r.createComponent)(i.Show,{get when(){return e.optional},children:`[`}),(0,r.memo)(()=>e.name),(0,r.createComponent)(i.Show,{get when(){return!!e.defaultValue},get children(){return[`=`,(0,r.memo)(()=>e.defaultValue)]}}),(0,r.createComponent)(i.Show,{get when(){return e.optional},children:`]`})]}function w(e){return(0,r.createComponent)(i.Show,{get when(){return!!e.children},get children(){return[` - `,(0,r.createIntrinsic)(`align`,{width:2,get children(){return(0,r.createComponent)(i.Prose,{get children(){return e.children}})}})]}})}function T(e){return(0,r.createComponent)(c,(0,r.mergeProps)(e,{tag:`returns`}))}function E(e){return(0,r.createComponent)(c,(0,r.mergeProps)(e,{tag:`throws`}))}function D(e){let[{children:n,name:a,prefix:o}]=(0,i.splitProps)(e,[`children`,`name`,`prefix`]),s=t.usePowerlines();return[`/**`,(0,r.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.Show,{get when(){return!!n},get children(){return[(0,r.createComponent)(i.List,{hardline:!0,get children(){return(0,i.childrenArray)(()=>n)}}),(0,r.createIntrinsic)(`hbr`,{}),(0,r.createIntrinsic)(`hbr`,{})]}}),`@module `,(0,r.memo)(()=>o||s?.config.output.builtinPrefix),`:`,a]}}),(0,r.createIntrinsic)(`hbr`,{}),` */`]}exports.TSDoc=s,exports.TSDocAttributesTags=x,exports.TSDocExample=g,exports.TSDocLink=h,exports.TSDocModule=D,exports.TSDocParam=S,exports.TSDocRemarks=m,exports.TSDocReturns=T,exports.TSDocThrows=E;
@@ -0,0 +1 @@
1
+ import{usePowerlines as e}from"../../core/contexts/context.mjs";import{stringifyDefaultValue as t}from"../../../../deepkit/src/utilities.mjs";import{createComponent as n,createIntrinsic as r,memo as i,mergeProps as a}from"@alloy-js/core/jsx-runtime";import{For as o,List as s,Prose as c,Show as l,childrenArray as u,splitProps as d}from"@alloy-js/core";import{isSetString as f}from"@stryke/type-checks/is-set-string";import{isUndefined as p}from"@stryke/type-checks/is-undefined";function m(e){let[{children:t,heading:a}]=d(e,[`children`,`heading`]);return[`/**`,r(`align`,{string:` * `,get children(){return[r(`hbr`,{}),n(l,{get when(){return!p(a)},get children(){return[a,r(`hbr`,{}),n(l,{get when(){return i(()=>!p(t))()&&u(()=>t).length>0},get children(){return r(`hbr`,{})}})]}}),n(l,{get when(){return i(()=>!p(t))()&&u(()=>t).length>0},get children(){return n(s,{get children(){return u(()=>t)}})}})]}}),r(`hbr`,{}),` */`,r(`hbr`,{})]}function h(e){let[{children:t,tag:i}]=d(e,[`children`,`tag`]);return[`@${i} `,n(l,{get when(){return!!t},get children(){return r(`align`,{width:2,get children(){return n(c,{children:t})}})}}),r(`hbr`,{})]}function g(e){let[{children:t},r]=d(e,[`children`]);return n(h,a(r,{tag:`title`,children:t}))}function _(e){let[{children:t},r]=d(e,[`children`]);return n(h,a(r,{tag:`domain`,children:t}))}function v(e){let[{children:t},r]=d(e,[`children`]);return n(h,a(r,{tag:`alias`,children:t}))}function y(e){let[{children:t},r]=d(e,[`children`]);return n(h,a(r,{tag:`permission`,children:t}))}function b(e){return[`@defaultValue `,n(l,{get when(){return!p(e.value)},get children(){return r(`align`,{width:2,get children(){return n(c,{get children(){return t(e.value)}})}})}}),r(`hbr`,{})]}function x(e){return[`@remarks `,r(`hbr`,{}),n(s,{hardline:!0,get children(){return u(()=>e.children)}})]}function S(e){return n(h,a(e,{tag:`see`}))}function C(e){let[{tsx:t,fenced:i=!0,language:a,children:o}]=d(e,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,r(`hbr`,{}),n(l,{when:i,get children(){return["```",a||(t?`tsx`:`ts`),r(`hbr`,{})]}}),o,n(l,{when:i,get children(){return[r(`hbr`,{}),"```"]}})]}function w(){return n(h,{tag:`readonly`})}function T(){return n(h,{tag:`internal`})}function E(){return n(h,{tag:`ignore`})}function D(){return n(h,{tag:`hidden`})}function O(e){let[{title:t,alias:r,permission:i,domain:a,readonly:s,internal:c,ignore:u,hidden:m,defaultValue:h}]=d(e,[`title`,`alias`,`permission`,`domain`,`readonly`,`internal`,`ignore`,`hidden`,`defaultValue`]);return[n(l,{get when(){return f(t)},get children(){return n(g,{children:t})}}),n(l,{get when(){return!p(r)&&r.length>0},get children(){return n(o,{each:r??[],children:e=>n(v,{children:e})})}}),n(l,{get when(){return f(a)},get children(){return n(_,{children:a})}}),n(l,{get when(){return!p(i)&&i.length>0},get children(){return n(o,{each:i??[],children:e=>n(y,{children:e})})}}),n(l,{when:s===!0,get children(){return n(w,{})}}),n(l,{when:c===!0,get children(){return n(T,{})}}),n(l,{when:u===!0,get children(){return n(E,{})}}),n(l,{when:m===!0,get children(){return n(D,{})}}),n(l,{get when(){return!p(h)},get children(){return n(b,{value:h})}})]}function k(e){return[`@param `,n(A,{get name(){return e.name},get optional(){return e.optional},get defaultValue(){return e.defaultValue}}),n(j,{get children(){return e.children}})]}function A(e){return[n(l,{get when(){return e.optional},children:`[`}),i(()=>e.name),n(l,{get when(){return!!e.defaultValue},get children(){return[`=`,i(()=>e.defaultValue)]}}),n(l,{get when(){return e.optional},children:`]`})]}function j(e){return n(l,{get when(){return!!e.children},get children(){return[` - `,r(`align`,{width:2,get children(){return n(c,{get children(){return e.children}})}})]}})}function M(e){return n(h,a(e,{tag:`returns`}))}function N(e){return n(h,a(e,{tag:`throws`}))}function P(t){let[{children:a,name:o,prefix:c}]=d(t,[`children`,`name`,`prefix`]),f=e();return[`/**`,r(`align`,{string:` * `,get children(){return[r(`hbr`,{}),n(l,{get when(){return!!a},get children(){return[n(s,{hardline:!0,get children(){return u(()=>a)}}),r(`hbr`,{}),r(`hbr`,{})]}}),`@module `,i(()=>c||f?.config.output.builtinPrefix),`:`,o]}}),r(`hbr`,{}),` */`]}export{m as TSDoc,O as TSDocAttributesTags,C as TSDocExample,S as TSDocLink,P as TSDocModule,k as TSDocParam,x as TSDocRemarks,M as TSDocReturns,N as TSDocThrows};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../core/components/single-line-comment.cjs`),n=require(`../../core/components/source-file.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@stryke/type-checks/is-string`),o=require(`@stryke/path/append`),s=require(`@alloy-js/typescript`),c=require(`@stryke/type-checks/is-boolean`);function l(e){let[{children:t,path:a,imports:l,tsx:f,header:p},m]=(0,i.splitProps)(e,[`children`,`path`,`imports`,`tsx`,`header`]),h=(0,i.useContext)(i.SourceDirectoryContext),g=(0,s.getSourceDirectoryData)(h),_=(0,o.appendPath)(a,h.path),v=new s.TSModuleScope(_,(0,i.useScope)());g.modules.add(v);let y=(0,i.useContext)(s.PackageContext);return y&&y.scope.addModule(v),e.export&&y&&((0,c.isBoolean)(e.export)?y.scope.addExport(_,v):y.scope.addExport(e.export,v)),(0,r.createComponent)(s.SourceFileContext.Provider,{value:{scope:v},get children(){return(0,r.createComponent)(i.Scope,{value:v,get children(){return(0,r.createComponent)(n.SourceFile,(0,r.mergeProps)(m,{path:_,get header(){return p??(0,r.createComponent)(u,{get children(){return(0,r.createComponent)(d,{imports:l,scope:v})}})},filetype:f?`tsx`:`typescript`,children:t}))}})}})}function u(e){let{header:n,disableEslint:a=!0,disableBiome:o=!0,disablePrettier:s=!1,children:c}=e;return[(0,r.createComponent)(i.Show,{get when(){return!!n},get children(){return[n,(0,r.createIntrinsic)(`hbr`,{})]}}),(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.Show,{get when(){return!!a},get children(){return[(0,r.createComponent)(t.SingleLineComment,{variant:`slash-star`,children:`eslint-disable`}),(0,r.createIntrinsic)(`hbr`,{})]}}),(0,r.createComponent)(i.Show,{get when(){return!!s},get children(){return[(0,r.createComponent)(t.SingleLineComment,{variant:`slash-star`,children:`prettier-ignore`}),(0,r.createIntrinsic)(`hbr`,{})]}}),(0,r.createComponent)(i.Show,{get when(){return!!o},get children(){return[(0,r.createComponent)(t.SingleLineComment,{children:`biome-ignore lint: disable`}),(0,r.createIntrinsic)(`hbr`,{})]}}),(0,r.createComponent)(i.Show,{get when(){return!!a||!!s||!!o},get children(){return(0,r.createIntrinsic)(`hbr`,{})}}),(0,r.createComponent)(i.Show,{get when(){return!!c},get children(){return[c,(0,r.createIntrinsic)(`hbr`,{})]}}),(0,r.createComponent)(t.SingleLineComment,{children:i.code`Generated by Powerlines`}),(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(t.SingleLineComment,{children:i.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),(0,r.createIntrinsic)(`hbr`,{})]}function d(e){let{imports:t}=e,n=(0,s.useSourceFile)(),o=e.scope??n.scope;return(0,r.createComponent)(i.Show,{get when(){return o.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[(0,r.createComponent)(i.Show,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>i.code`import ${t===null?``:t.filter(e=>!(0,a.isString)(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!(0,a.isString)(e)&&e.default).length>0&&t.filter(e=>(0,a.isString)(e)||!e.default).length>0?`, `:``)+(t.filter(e=>(0,a.isString)(e)||!e.default).length>0?`{ ${t.map(e=>(0,a.isString)(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),(0,r.createComponent)(i.Show,{get when(){return o.importedModules.size>0},get children(){return(0,r.createComponent)(s.ImportStatements,{get records(){return o.importedModules}})}}),(0,r.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptFile=l,exports.TypescriptFileHeader=u,exports.TypescriptFileHeaderImports=d;
@@ -0,0 +1 @@
1
+ import{SingleLineComment as e}from"../../core/components/single-line-comment.mjs";import{SourceFile as t}from"../../core/components/source-file.mjs";import{createComponent as n,createIntrinsic as r,mergeProps as i}from"@alloy-js/core/jsx-runtime";import{Scope as a,Show as o,SourceDirectoryContext as s,code as c,splitProps as l,useContext as u,useScope as d}from"@alloy-js/core";import{isString as f}from"@stryke/type-checks/is-string";import{appendPath as p}from"@stryke/path/append";import{ImportStatements as m,PackageContext as h,SourceFileContext as g,TSModuleScope as _,getSourceDirectoryData as v,useSourceFile as y}from"@alloy-js/typescript";import{isBoolean as b}from"@stryke/type-checks/is-boolean";function x(e){let[{children:r,path:o,imports:c,tsx:f,header:m},y]=l(e,[`children`,`path`,`imports`,`tsx`,`header`]),x=u(s),w=v(x),T=p(o,x.path),E=new _(T,d());w.modules.add(E);let D=u(h);return D&&D.scope.addModule(E),e.export&&D&&(b(e.export)?D.scope.addExport(T,E):D.scope.addExport(e.export,E)),n(g.Provider,{value:{scope:E},get children(){return n(a,{value:E,get children(){return n(t,i(y,{path:T,get header(){return m??n(S,{get children(){return n(C,{imports:c,scope:E})}})},filetype:f?`tsx`:`typescript`,children:r}))}})}})}function S(t){let{header:i,disableEslint:a=!0,disableBiome:s=!0,disablePrettier:l=!1,children:u}=t;return[n(o,{get when(){return!!i},get children(){return[i,r(`hbr`,{})]}}),r(`hbr`,{}),n(o,{get when(){return!!a},get children(){return[n(e,{variant:`slash-star`,children:`eslint-disable`}),r(`hbr`,{})]}}),n(o,{get when(){return!!l},get children(){return[n(e,{variant:`slash-star`,children:`prettier-ignore`}),r(`hbr`,{})]}}),n(o,{get when(){return!!s},get children(){return[n(e,{children:`biome-ignore lint: disable`}),r(`hbr`,{})]}}),n(o,{get when(){return!!a||!!l||!!s},get children(){return r(`hbr`,{})}}),n(o,{get when(){return!!u},get children(){return[u,r(`hbr`,{})]}}),n(e,{children:c`Generated by Powerlines`}),r(`hbr`,{}),n(e,{children:c`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),r(`hbr`,{})]}function C(e){let{imports:t}=e,i=y(),a=e.scope??i.scope;return n(o,{get when(){return a.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[n(o,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>c`import ${t===null?``:t.filter(e=>!f(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!f(e)&&e.default).length>0&&t.filter(e=>f(e)||!e.default).length>0?`, `:``)+(t.filter(e=>f(e)||!e.default).length>0?`{ ${t.map(e=>f(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),n(o,{get when(){return a.importedModules.size>0},get children(){return n(m,{get records(){return a.importedModules}})}}),r(`hbr`,{})]}})}export{x as TypescriptFile,S as TypescriptFileHeader,C as TypescriptFileHeaderImports};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/vendor/type.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@alloy-js/typescript`),s=require(`@stryke/string-format/pascal-case`);function c(e){let[{name:t,reflection:c},u]=(0,a.splitProps)(e,[`name`,`reflection`]),d=(0,a.computed)(()=>(0,s.pascalCase)(t||c.getName())),f=c.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return(0,i.createComponent)(n.ReflectionClassContext.Provider,{value:{reflection:c},get children(){return[(0,i.createComponent)(r.TSDocReflectionClass,{}),(0,i.createComponent)(o.InterfaceDeclaration,(0,i.mergeProps)({export:!0,get name(){return d.value}},u,{get children(){return(0,i.createComponent)(a.For,{each:f,doubleHardline:!0,semicolon:!0,children:e=>(0,i.createComponent)(l,{property:e})})}}))]}})}function l(e){let[{property:s},c]=(0,a.splitProps)(e,[`property`]);return(0,i.createComponent)(n.ReflectionPropertyContext.Provider,{value:s,get children(){return[(0,i.createComponent)(r.TSDocReflectionProperty,{}),(0,i.createComponent)(o.InterfaceMember,(0,i.mergeProps)({get name(){return s.getNameAsString()},get readonly(){return s.isReadonly()},get optional(){return s.isOptional()},get nullish(){return s.isNullable()},get type(){return(0,t.type_exports.stringifyType)(s.getType())}},c))]}})}exports.TypeScriptInterface=c;
@@ -0,0 +1 @@
1
+ import{type_exports as e}from"../../../../deepkit/src/vendor/type.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{createComponent as a,mergeProps as o}from"@alloy-js/core/jsx-runtime";import{For as s,computed as c,splitProps as l}from"@alloy-js/core";import{InterfaceDeclaration as u,InterfaceMember as d}from"@alloy-js/typescript";import{pascalCase as f}from"@stryke/string-format/pascal-case";function p(e){let[{name:n,reflection:i},d]=l(e,[`name`,`reflection`]),p=c(()=>f(n||i.getName())),h=i.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return a(t.Provider,{value:{reflection:i},get children(){return[a(r,{}),a(u,o({export:!0,get name(){return p.value}},d,{get children(){return a(s,{each:h,doubleHardline:!0,semicolon:!0,children:e=>a(m,{property:e})})}}))]}})}function m(t){let[{property:r},s]=l(t,[`property`]);return a(n.Provider,{value:r,get children(){return[a(i,{}),a(d,o({get name(){return r.getNameAsString()},get readonly(){return r.isReadonly()},get optional(){return r.isOptional()},get nullish(){return r.isNullable()},get type(){return(0,e.stringifyType)(r.getType())}},s))]}})}export{p as TypeScriptInterface};
@@ -0,0 +1 @@
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/utilities.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@stryke/string-format/camel-case`),c=require(`@alloy-js/typescript`),l=require(`@stryke/string-format/pascal-case`);function u(e){if(!e.reflection?.value)return null;let t=(0,a.computed)(()=>(0,s.camelCase)(e.name||e.reflection.value.getName())),u=(0,a.computed)(()=>e.type||(0,l.pascalCase)(e.reflection.value.getName())),f=(0,a.computed)(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!(0,o.isUndefined)(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>(0,o.isUndefined)(t)&&!(0,o.isUndefined)(e.defaultValue?.value?.[n])?e.defaultValue?.value?.[n]:t,void 0)??t.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1)),p=(0,a.createSymbolSlot)(),m=(0,a.createSymbolSlot)(),h=(0,c.createValueSymbol)(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?c.TSSymbolFlags.Nullish:c.TSSymbolFlags.None,type:e.type?p.firstSymbol:void 0,namePolicy:(0,c.useTSNamePolicy)().for(`variable`)});e.type||m.moveMembersTo(h);let g=e.var?`var`:e.let?`let`:`const`,_=e.type?(0,i.createComponent)(c.TypeRefContext,{get children(){return[`: `,(0,i.createComponent)(p,{get children(){return e.type}})]}}):void 0;return(0,i.createComponent)(a.Show,{get when(){return!!e.reflection.value},get children(){return(0,i.createComponent)(n.ReflectionClassContext.Provider,{get value(){return{reflection:e.reflection.value,override:{name:t.value,type:u.value,defaultValue:e.defaultValue?.value}}},get children(){return[(0,i.createComponent)(a.Show,{get when(){return!!t.value&&!!u.value},get children(){return[(0,i.createComponent)(r.TSDocReflectionClass,{}),(0,i.createComponent)(a.Declaration,{symbol:h,get children(){return[(0,i.memo)(()=>e.export?`export `:``),(0,i.memo)(()=>e.default?`default `:``),g,` `,(0,i.createComponent)(a.Name,{}),_,` =`,` `,(0,i.createComponent)(m,{get children(){return e.initializer??e.children??(0,i.createComponent)(c.ObjectExpression,{get children(){return(0,i.createComponent)(a.For,{get each(){return f.value??[]},comma:!0,doubleHardline:!0,children:e=>(0,i.createComponent)(d,{property:e})})}})}})]}})]}}),(0,i.createIntrinsic)(`hbr`,{})]}})}})}function d(e){let[{property:o}]=(0,a.splitProps)(e,[`property`]);return(0,i.createComponent)(n.ReflectionPropertyContext.Provider,{value:o,get children(){return[(0,i.createComponent)(r.TSDocReflectionProperty,{}),(0,i.createComponent)(c.ObjectProperty,{get name(){return o.getNameAsString()},get value(){return t.stringifyDefaultValue(o)}}),(0,i.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptObject=u;
@@ -0,0 +1 @@
1
+ import{stringifyDefaultValue as e}from"../../../../deepkit/src/utilities.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{createComponent as a,createIntrinsic as o,memo as s}from"@alloy-js/core/jsx-runtime";import{Declaration as c,For as l,Name as u,Show as d,computed as f,createSymbolSlot as p,splitProps as m}from"@alloy-js/core";import{isUndefined as h}from"@stryke/type-checks/is-undefined";import{camelCase as g}from"@stryke/string-format/camel-case";import{ObjectExpression as _,ObjectProperty as v,TSSymbolFlags as y,TypeRefContext as b,createValueSymbol as x,useTSNamePolicy as S}from"@alloy-js/typescript";import{pascalCase as C}from"@stryke/string-format/pascal-case";function w(e){if(!e.reflection?.value)return null;let n=f(()=>g(e.name||e.reflection.value.getName())),i=f(()=>e.type||C(e.reflection.value.getName())),m=f(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!h(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>h(t)&&!h(e.defaultValue?.value?.[n])?e.defaultValue?.value?.[n]:t,void 0)??t.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1)),v=p(),w=p(),E=x(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?y.Nullish:y.None,type:e.type?v.firstSymbol:void 0,namePolicy:S().for(`variable`)});e.type||w.moveMembersTo(E);let D=e.var?`var`:e.let?`let`:`const`,O=e.type?a(b,{get children(){return[`: `,a(v,{get children(){return e.type}})]}}):void 0;return a(d,{get when(){return!!e.reflection.value},get children(){return a(t.Provider,{get value(){return{reflection:e.reflection.value,override:{name:n.value,type:i.value,defaultValue:e.defaultValue?.value}}},get children(){return[a(d,{get when(){return!!n.value&&!!i.value},get children(){return[a(r,{}),a(c,{symbol:E,get children(){return[s(()=>e.export?`export `:``),s(()=>e.default?`default `:``),D,` `,a(u,{}),O,` =`,` `,a(w,{get children(){return e.initializer??e.children??a(_,{get children(){return a(l,{get each(){return m.value??[]},comma:!0,doubleHardline:!0,children:e=>a(T,{property:e})})}})}})]}})]}}),o(`hbr`,{})]}})}})}function T(t){let[{property:r}]=m(t,[`property`]);return a(n.Provider,{value:r,get children(){return[a(i,{}),a(v,{get name(){return r.getNameAsString()},get value(){return e(r)}}),o(`hbr`,{})]}})}export{w as TypescriptObject};
@@ -0,0 +1,133 @@
1
+ const e=require(`../powerlines/src/lib/utilities/file-header.cjs`);function t(t){return`
2
+ /**
3
+ * The cryptography module provides custom helper functions to support encrypting and decrypting data.
4
+ *
5
+ * @module ${t.config.output.builtinPrefix}:crypto
6
+ */
7
+
8
+ ${e.getFileHeader(t)}
9
+
10
+ import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
11
+ import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
12
+ import { scrypt } from "@noble/hashes/scrypt.js";
13
+ import { blake3 } from "@noble/hashes/blake3.js";
14
+ ${t.config.crypto.encryptionKey?`
15
+ const nonce = randomBytes(24);
16
+ const chacha = xchacha20poly1305(hexToBytes("${t.config.crypto.encryptionKey}"), nonce);
17
+
18
+ /**
19
+ * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
20
+ *
21
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
22
+ *
23
+ * @param plaintext - The data to encrypt.
24
+ * @returns The encrypted data.
25
+ */
26
+ export function encrypt(plaintext: string): string {
27
+ return chacha.encrypt(
28
+ nonce,
29
+ new TextEncoder().encode(plaintext),
30
+ null
31
+ );
32
+ }
33
+
34
+ /**
35
+ * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
36
+ *
37
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
38
+ *
39
+ * @param encrypted - The encrypted data to decrypt.
40
+ * @returns The decrypted data.
41
+ */
42
+ export function decrypt(encrypted: string): string {
43
+ const decrypted = chacha.decrypt(
44
+ nonce,
45
+ encrypted,
46
+ null
47
+ );
48
+
49
+ return new TextDecoder().decode(decrypted);
50
+ }
51
+ `:``}
52
+
53
+ /**
54
+ * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
55
+ *
56
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
57
+ *
58
+ * @param password - The password used to derive the encryption key.
59
+ * @param plaintext - The data to encrypt.
60
+ * @returns The encrypted data.
61
+ */
62
+ export function encryptWithPassword(password: string, plaintext: string): string {
63
+ const key = scrypt(
64
+ new TextEncoder().encode(password),
65
+ hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
66
+ 1048576, // requires 1GB of RAM to calculate
67
+ 8,
68
+ 1,
69
+ 32
70
+ );
71
+
72
+ return chacha20poly1305(key).encrypt(
73
+ nonce,
74
+ new TextEncoder().encode(plaintext),
75
+ null
76
+ );
77
+ }
78
+
79
+ /**
80
+ * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
81
+ *
82
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
83
+ *
84
+ * @param password - The password used to derive the decryption key.
85
+ * @param encrypted - The encrypted data to decrypt.
86
+ * @returns The decrypted data.
87
+ */
88
+ export function decryptWithPassword(password: string, encrypted: string): string {
89
+ const key = scrypt(
90
+ new TextEncoder().encode(password),
91
+ hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
92
+ 1048576, // requires 1GB of RAM to calculate
93
+ 8,
94
+ 1,
95
+ 32
96
+ );
97
+
98
+ const decrypted = chacha20poly1305(key).decrypt(
99
+ nonce,
100
+ encrypted,
101
+ null
102
+ );
103
+
104
+ return new TextDecoder().decode(decrypted);
105
+ }
106
+
107
+ /**
108
+ * Hashes data using the [BLAKE3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3) hash function.
109
+ *
110
+ * @see https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3
111
+ *
112
+ * @param data - The data to hash.
113
+ * @returns The hashed data.
114
+ */
115
+ export function hash(data: string): string {
116
+ return Buffer.from(
117
+ blake3(new TextEncoder().encode(data), {
118
+ key: ${t.config.crypto.salt?`hexToBytes("${t.config.crypto.salt}")`:`new TextEncoder().encode("powerlines")`})
119
+ })
120
+ ).toString("hex");
121
+ }
122
+
123
+ // Export noble cipher and hash functions for advanced usage
124
+
125
+ export * from "@noble/ciphers/chacha.js";
126
+ export * from "@noble/ciphers/aes.js";
127
+ export * from "@noble/ciphers/utils.js";
128
+ export * from '@noble/hashes/blake3.js';
129
+ export * from '@noble/hashes/pbkdf2.js';
130
+ export * from '@noble/hashes/scrypt.js';
131
+ export * from '@noble/hashes/utils.js';
132
+
133
+ `}exports.cryptoModule=t;
@@ -0,0 +1,13 @@
1
+ import { CryptoPluginContext } from "../types/plugin.cjs";
2
+
3
+ //#region src/components/crypto.d.ts
4
+
5
+ /**
6
+ * Generates the crypto module content.
7
+ *
8
+ * @param context - The build context containing runtime information.
9
+ * @returns A string representing the crypto module code.
10
+ */
11
+ declare function cryptoModule(context: CryptoPluginContext): string;
12
+ //#endregion
13
+ export { cryptoModule };
@@ -0,0 +1,13 @@
1
+ import { CryptoPluginContext } from "../types/plugin.mjs";
2
+
3
+ //#region src/components/crypto.d.ts
4
+
5
+ /**
6
+ * Generates the crypto module content.
7
+ *
8
+ * @param context - The build context containing runtime information.
9
+ * @returns A string representing the crypto module code.
10
+ */
11
+ declare function cryptoModule(context: CryptoPluginContext): string;
12
+ //#endregion
13
+ export { cryptoModule };
@@ -0,0 +1,133 @@
1
+ import{getFileHeader as e}from"../powerlines/src/lib/utilities/file-header.mjs";function t(t){return`
2
+ /**
3
+ * The cryptography module provides custom helper functions to support encrypting and decrypting data.
4
+ *
5
+ * @module ${t.config.output.builtinPrefix}:crypto
6
+ */
7
+
8
+ ${e(t)}
9
+
10
+ import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
11
+ import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
12
+ import { scrypt } from "@noble/hashes/scrypt.js";
13
+ import { blake3 } from "@noble/hashes/blake3.js";
14
+ ${t.config.crypto.encryptionKey?`
15
+ const nonce = randomBytes(24);
16
+ const chacha = xchacha20poly1305(hexToBytes("${t.config.crypto.encryptionKey}"), nonce);
17
+
18
+ /**
19
+ * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
20
+ *
21
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
22
+ *
23
+ * @param plaintext - The data to encrypt.
24
+ * @returns The encrypted data.
25
+ */
26
+ export function encrypt(plaintext: string): string {
27
+ return chacha.encrypt(
28
+ nonce,
29
+ new TextEncoder().encode(plaintext),
30
+ null
31
+ );
32
+ }
33
+
34
+ /**
35
+ * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
36
+ *
37
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
38
+ *
39
+ * @param encrypted - The encrypted data to decrypt.
40
+ * @returns The decrypted data.
41
+ */
42
+ export function decrypt(encrypted: string): string {
43
+ const decrypted = chacha.decrypt(
44
+ nonce,
45
+ encrypted,
46
+ null
47
+ );
48
+
49
+ return new TextDecoder().decode(decrypted);
50
+ }
51
+ `:``}
52
+
53
+ /**
54
+ * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
55
+ *
56
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
57
+ *
58
+ * @param password - The password used to derive the encryption key.
59
+ * @param plaintext - The data to encrypt.
60
+ * @returns The encrypted data.
61
+ */
62
+ export function encryptWithPassword(password: string, plaintext: string): string {
63
+ const key = scrypt(
64
+ new TextEncoder().encode(password),
65
+ hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
66
+ 1048576, // requires 1GB of RAM to calculate
67
+ 8,
68
+ 1,
69
+ 32
70
+ );
71
+
72
+ return chacha20poly1305(key).encrypt(
73
+ nonce,
74
+ new TextEncoder().encode(plaintext),
75
+ null
76
+ );
77
+ }
78
+
79
+ /**
80
+ * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
81
+ *
82
+ * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
83
+ *
84
+ * @param password - The password used to derive the decryption key.
85
+ * @param encrypted - The encrypted data to decrypt.
86
+ * @returns The decrypted data.
87
+ */
88
+ export function decryptWithPassword(password: string, encrypted: string): string {
89
+ const key = scrypt(
90
+ new TextEncoder().encode(password),
91
+ hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
92
+ 1048576, // requires 1GB of RAM to calculate
93
+ 8,
94
+ 1,
95
+ 32
96
+ );
97
+
98
+ const decrypted = chacha20poly1305(key).decrypt(
99
+ nonce,
100
+ encrypted,
101
+ null
102
+ );
103
+
104
+ return new TextDecoder().decode(decrypted);
105
+ }
106
+
107
+ /**
108
+ * Hashes data using the [BLAKE3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3) hash function.
109
+ *
110
+ * @see https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3
111
+ *
112
+ * @param data - The data to hash.
113
+ * @returns The hashed data.
114
+ */
115
+ export function hash(data: string): string {
116
+ return Buffer.from(
117
+ blake3(new TextEncoder().encode(data), {
118
+ key: ${t.config.crypto.salt?`hexToBytes("${t.config.crypto.salt}")`:`new TextEncoder().encode("powerlines")`})
119
+ })
120
+ ).toString("hex");
121
+ }
122
+
123
+ // Export noble cipher and hash functions for advanced usage
124
+
125
+ export * from "@noble/ciphers/chacha.js";
126
+ export * from "@noble/ciphers/aes.js";
127
+ export * from "@noble/ciphers/utils.js";
128
+ export * from '@noble/hashes/blake3.js';
129
+ export * from '@noble/hashes/pbkdf2.js';
130
+ export * from '@noble/hashes/scrypt.js';
131
+ export * from '@noble/hashes/utils.js';
132
+
133
+ `}export{t as cryptoModule};
@@ -0,0 +1 @@
1
+ const e=require(`./crypto.cjs`);
@@ -0,0 +1 @@
1
+ import { cryptoModule } from "./crypto.mjs";
@@ -0,0 +1 @@
1
+ import{cryptoModule as e}from"./crypto.mjs";export{};