@powerlines/plugin-react 0.1.82 → 0.1.84

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 (39) hide show
  1. package/dist/alloy/src/core/components/source-file.cjs +1 -1
  2. package/dist/alloy/src/core/components/source-file.mjs +1 -1
  3. package/dist/alloy/src/create-plugin.cjs +1 -1
  4. package/dist/alloy/src/create-plugin.mjs +1 -1
  5. package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +1 -1
  6. package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +1 -1
  7. package/dist/alloy/src/typescript/components/tsdoc.cjs +1 -1
  8. package/dist/alloy/src/typescript/components/tsdoc.mjs +1 -1
  9. package/dist/alloy/src/typescript/components/typescript-file.cjs +1 -1
  10. package/dist/alloy/src/typescript/components/typescript-file.mjs +1 -1
  11. package/dist/alloy/src/typescript/components/typescript-object.cjs +1 -1
  12. package/dist/alloy/src/typescript/components/typescript-object.mjs +1 -1
  13. package/dist/components/react-optimized.cjs +1 -1
  14. package/dist/components/react-optimized.mjs +1 -1
  15. package/dist/deepkit/src/utilities.cjs +1 -1
  16. package/dist/deepkit/src/utilities.mjs +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.mjs +1 -1
  19. package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -1
  20. package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -1
  21. package/dist/plugin-babel/src/index.cjs +1 -1
  22. package/dist/plugin-babel/src/index.mjs +1 -1
  23. package/dist/plugin-env/src/babel/plugin.cjs +4 -4
  24. package/dist/plugin-env/src/babel/plugin.mjs +3 -3
  25. package/dist/plugin-env/src/components/env.cjs +6 -6
  26. package/dist/plugin-env/src/components/env.mjs +7 -7
  27. package/dist/plugin-env/src/helpers/load.cjs +1 -1
  28. package/dist/plugin-env/src/helpers/load.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/powerlines/src/lib/build/esbuild.cjs +1 -1
  32. package/dist/powerlines/src/lib/build/esbuild.mjs +1 -1
  33. package/dist/powerlines/src/lib/entry.cjs +1 -1
  34. package/dist/powerlines/src/lib/entry.mjs +1 -1
  35. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +1 -1
  36. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +1 -1
  37. package/dist/powerlines/src/plugin-utils/helpers.cjs +1 -1
  38. package/dist/powerlines/src/plugin-utils/helpers.mjs +1 -1
  39. package/package.json +8 -8
@@ -1 +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;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`),r=require(`@stryke/path/append`),i=require(`defu`);i=e.__toESM(i);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,r.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,i.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;
@@ -1 +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};
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{appendPath as l}from"@stryke/path/append";import u from"defu";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:l(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=u({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};
@@ -1,2 +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(`
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(`@stryke/type-checks/is-set-string`),o=require(`@storm-software/config-tools/types`),s=require(`@stryke/path/is-parent-path`),c=require(`@stryke/path/replace`),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,a)=>{if(!Array.isArray(a))return;let u=async e=>{for(let t of a)await l(e,t)},d=(0,i.getContextForRenderNode)(a);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(o.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,c.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,a,n)}}else d.meta?.entry||(0,s.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(o.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,a,n)}):(e.log(o.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,a,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(o.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,a.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,a.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
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;
@@ -1,2 +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(`
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{isSetString as u}from"@stryke/type-checks/is-set-string";import{LogLevelLabel as d}from"@storm-software/config-tools/types";import{isParentPath as f}from"@stryke/path/is-parent-path";import{replacePath as p}from"@stryke/path/replace";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(d.TRACE,`Rendering built-in runtime module with ID: ${c.meta.builtin.id}`),r={kind:`builtin`,id:c.meta.builtin.id,path:p(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||f(e.entryPath,c.meta.sourceFile.path)?(e.log(d.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(d.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(d.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(!u(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&u(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
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};
@@ -1 +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;
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-string`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@stryke/type-checks/is-set-string`),c=require(`@stryke/string-format/title-case`);function l(e){let[{children:a},l]=(0,i.splitProps)(e,[`children`]),u=n.useReflectionClass(),d=(0,i.computed)(()=>u.reflection.getTitle()||(0,c.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,s.isSetString)(d.value)||!(0,o.isUndefined)(f.value)&&f.value.length>0||!(0,o.isUndefined)(m.value)&&m.value.length>0||(0,s.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)(()=>!!a)()&&(0,i.childrenArray)(()=>a).length>0},get children(){return(0,r.createComponent)(i.List,{get children(){return(0,i.childrenArray)(()=>a)}})}})]}})):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;
@@ -1 +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};
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{isString as p}from"@stryke/type-checks/is-string";import{isUndefined as m}from"@stryke/type-checks/is-undefined";import{isSetString as h}from"@stryke/type-checks/is-set-string";import{titleCase as g}from"@stryke/string-format/title-case";function _(r){let[{children:u},p]=f(r,[`children`]),_=n(),v=d(()=>_.reflection.getTitle()||g(_.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(p,{get heading(){return _.reflection.getDescription()},get children(){return[i(c,{get when(){return h(v.value)||!m(y.value)&&y.value.length>0||!m(x.value)&&x.value.length>0||h(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};
@@ -1 +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;
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-undefined`),o=require(`@stryke/type-checks/is-set-string`);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,a.isUndefined)(n)},get children(){return[n,(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(i.Show,{get when(){return(0,r.memo)(()=>!(0,a.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,a.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,a.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,o.isSetString)(t)},get children(){return(0,r.createComponent)(l,{children:t})}}),(0,r.createComponent)(i.Show,{get when(){return!(0,a.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,o.isSetString)(c)},get children(){return(0,r.createComponent)(u,{children:c})}}),(0,r.createComponent)(i.Show,{get when(){return!(0,a.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,a.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;
@@ -1 +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};
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{isUndefined as f}from"@stryke/type-checks/is-undefined";import{isSetString as p}from"@stryke/type-checks/is-set-string";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!f(a)},get children(){return[a,r(`hbr`,{}),n(l,{get when(){return i(()=>!f(t))()&&u(()=>t).length>0},get children(){return r(`hbr`,{})}})]}}),n(l,{get when(){return i(()=>!f(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!f(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 p(t)},get children(){return n(g,{children:t})}}),n(l,{get when(){return!f(r)&&r.length>0},get children(){return n(o,{each:r??[],children:e=>n(v,{children:e})})}}),n(l,{get when(){return p(a)},get children(){return n(_,{children:a})}}),n(l,{get when(){return!f(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!f(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};
@@ -1 +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;
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(`@alloy-js/typescript`),o=require(`@stryke/type-checks/is-string`),s=require(`@stryke/path/append`),c=require(`@stryke/type-checks/is-boolean`);function l(e){let[{children:t,path:o,imports:l,tsx:f,header:p},m]=(0,i.splitProps)(e,[`children`,`path`,`imports`,`tsx`,`header`]),h=(0,i.useContext)(i.SourceDirectoryContext),g=(0,a.getSourceDirectoryData)(h),_=(0,s.appendPath)(o,h.path),v=new a.TSModuleScope(_,(0,i.useScope)());g.modules.add(v);let y=(0,i.useContext)(a.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)(a.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,a.useSourceFile)(),s=e.scope??n.scope;return(0,r.createComponent)(i.Show,{get when(){return s.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,o.isString)(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!(0,o.isString)(e)&&e.default).length>0&&t.filter(e=>(0,o.isString)(e)||!e.default).length>0?`, `:``)+(t.filter(e=>(0,o.isString)(e)||!e.default).length>0?`{ ${t.map(e=>(0,o.isString)(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),(0,r.createComponent)(i.Show,{get when(){return s.importedModules.size>0},get children(){return(0,r.createComponent)(a.ImportStatements,{get records(){return s.importedModules}})}}),(0,r.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptFile=l,exports.TypescriptFileHeader=u,exports.TypescriptFileHeaderImports=d;
@@ -1 +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};
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{ImportStatements as f,PackageContext as p,SourceFileContext as m,TSModuleScope as h,getSourceDirectoryData as g,useSourceFile as _}from"@alloy-js/typescript";import{isString as v}from"@stryke/type-checks/is-string";import{appendPath as y}from"@stryke/path/append";import{isBoolean as b}from"@stryke/type-checks/is-boolean";function x(e){let[{children:r,path:o,imports:c,tsx:f,header:_},v]=l(e,[`children`,`path`,`imports`,`tsx`,`header`]),x=u(s),w=g(x),T=y(o,x.path),E=new h(T,d());w.modules.add(E);let D=u(p);return D&&D.scope.addModule(E),e.export&&D&&(b(e.export)?D.scope.addExport(T,E):D.scope.addExport(e.export,E)),n(m.Provider,{value:{scope:E},get children(){return n(a,{value:E,get children(){return n(t,i(v,{path:T,get header(){return _??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=_(),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=>!v(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!v(e)&&e.default).length>0&&t.filter(e=>v(e)||!e.default).length>0?`, `:``)+(t.filter(e=>v(e)||!e.default).length>0?`{ ${t.map(e=>v(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(f,{get records(){return a.importedModules}})}}),r(`hbr`,{})]}})}export{x as TypescriptFile,S as TypescriptFileHeader,C as TypescriptFileHeaderImports};
@@ -1 +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;
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(`@alloy-js/typescript`),s=require(`@stryke/type-checks/is-undefined`),c=require(`@stryke/string-format/camel-case`),l=require(`@stryke/string-format/pascal-case`);function u(e){if(!e.reflection?.value)return null;let t=(0,a.computed)(()=>(0,c.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,s.isUndefined)(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>(0,s.isUndefined)(t)&&!(0,s.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,o.createValueSymbol)(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?o.TSSymbolFlags.Nullish:o.TSSymbolFlags.None,type:e.type?p.firstSymbol:void 0,namePolicy:(0,o.useTSNamePolicy)().for(`variable`)});e.type||m.moveMembersTo(h);let g=e.var?`var`:e.let?`let`:`const`,_=e.type?(0,i.createComponent)(o.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)(o.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:s}]=(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.ObjectProperty,{get name(){return s.getNameAsString()},get value(){return t.stringifyDefaultValue(s)}}),(0,i.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptObject=u;
@@ -1 +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};
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{ObjectExpression as h,ObjectProperty as g,TSSymbolFlags as _,TypeRefContext as v,createValueSymbol as y,useTSNamePolicy as b}from"@alloy-js/typescript";import{isUndefined as x}from"@stryke/type-checks/is-undefined";import{camelCase as S}from"@stryke/string-format/camel-case";import{pascalCase as C}from"@stryke/string-format/pascal-case";function w(e){if(!e.reflection?.value)return null;let n=f(()=>S(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()&&!x(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>x(t)&&!x(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)),g=p(),w=p(),E=y(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?_.Nullish:_.None,type:e.type?g.firstSymbol:void 0,namePolicy:b().for(`variable`)});e.type||w.moveMembersTo(E);let D=e.var?`var`:e.let?`let`:`const`,O=e.type?a(v,{get children(){return[`: `,a(g,{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(h,{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(g,{get name(){return r.getNameAsString()},get value(){return e(r)}}),o(`hbr`,{})]}})}export{w as TypescriptObject};
@@ -1 +1 @@
1
- const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../alloy/src/core/contexts/context.cjs`),n=require(`../alloy/src/helpers/refkey.cjs`),r=require(`../alloy/src/typescript/components/tsdoc.cjs`),i=require(`../alloy/src/typescript/components/builtin-file.cjs`);let a=require(`@alloy-js/core/jsx-runtime`),o=require(`@alloy-js/core`),s=require(`defu`);s=e.__toESM(s);let c=require(`@alloy-js/typescript`);const l=n.refkey(`isOptimizationEnabled`);function u(e){let[{override:n},u]=(0,o.splitProps)(e,[`override`]),d=t.usePowerlines();return(0,a.createComponent)(i.BuiltinFile,(0,a.mergeProps)(u,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return(0,s.default)({[`${d?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},u.imports??{})},get children(){return[(0,a.createComponent)(r.TSDoc,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[(0,a.createComponent)(r.TSDocLink,{children:`https://react.dev/reference/react-compiler/gating`}),(0,a.createComponent)(r.TSDocReturns,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),(0,a.createComponent)(c.FunctionDeclaration,{refkey:l,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:n===void 0?o.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:o.code`return ${n};`})]}}))}exports.ReactOptimizedBuiltin=u;
1
+ const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../alloy/src/core/contexts/context.cjs`),n=require(`../alloy/src/helpers/refkey.cjs`),r=require(`../alloy/src/typescript/components/tsdoc.cjs`),i=require(`../alloy/src/typescript/components/builtin-file.cjs`);let a=require(`@alloy-js/core/jsx-runtime`),o=require(`@alloy-js/core`),s=require(`@alloy-js/typescript`),c=require(`defu`);c=e.__toESM(c);const l=n.refkey(`isOptimizationEnabled`);function u(e){let[{override:n},u]=(0,o.splitProps)(e,[`override`]),d=t.usePowerlines();return(0,a.createComponent)(i.BuiltinFile,(0,a.mergeProps)(u,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return(0,c.default)({[`${d?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},u.imports??{})},get children(){return[(0,a.createComponent)(r.TSDoc,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[(0,a.createComponent)(r.TSDocLink,{children:`https://react.dev/reference/react-compiler/gating`}),(0,a.createComponent)(r.TSDocReturns,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),(0,a.createComponent)(s.FunctionDeclaration,{refkey:l,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:n===void 0?o.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:o.code`return ${n};`})]}}))}exports.ReactOptimizedBuiltin=u;
@@ -1 +1 @@
1
- import{usePowerlines as e}from"../alloy/src/core/contexts/context.mjs";import{refkey as t}from"../alloy/src/helpers/refkey.mjs";import{TSDoc as n,TSDocLink as r,TSDocReturns as i}from"../alloy/src/typescript/components/tsdoc.mjs";import{BuiltinFile as a}from"../alloy/src/typescript/components/builtin-file.mjs";import{createComponent as o,mergeProps as s}from"@alloy-js/core/jsx-runtime";import{code as c,splitProps as l}from"@alloy-js/core";import u from"defu";import{FunctionDeclaration as d}from"@alloy-js/typescript";const f=t(`isOptimizationEnabled`);function p(t){let[{override:p},m]=l(t,[`override`]),h=e();return o(a,s(m,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return u({[`${h?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},m.imports??{})},get children(){return[o(n,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[o(r,{children:`https://react.dev/reference/react-compiler/gating`}),o(i,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),o(d,{refkey:f,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:p===void 0?c`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:c`return ${p};`})]}}))}export{p as ReactOptimizedBuiltin};
1
+ import{usePowerlines as e}from"../alloy/src/core/contexts/context.mjs";import{refkey as t}from"../alloy/src/helpers/refkey.mjs";import{TSDoc as n,TSDocLink as r,TSDocReturns as i}from"../alloy/src/typescript/components/tsdoc.mjs";import{BuiltinFile as a}from"../alloy/src/typescript/components/builtin-file.mjs";import{createComponent as o,mergeProps as s}from"@alloy-js/core/jsx-runtime";import{code as c,splitProps as l}from"@alloy-js/core";import{FunctionDeclaration as u}from"@alloy-js/typescript";import d from"defu";const f=t(`isOptimizationEnabled`);function p(t){let[{override:p},m]=l(t,[`override`]),h=e();return o(a,s(m,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return d({[`${h?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},m.imports??{})},get children(){return[o(n,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[o(r,{children:`https://react.dev/reference/react-compiler/gating`}),o(i,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),o(u,{refkey:f,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:p===void 0?c`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:c`return ${p};`})]}}))}export{p as ReactOptimizedBuiltin};
@@ -1 +1 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/type.cjs`);let n=require(`@stryke/type-checks/is-undefined`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/helpers/get-unique`),a=require(`@stryke/json/storm-json`),o=require(`@stryke/type-checks/is-null`);function s(e,t){return l(e.type,t??e.getDefaultValue())}function c(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function l(e,i){return(0,n.isUndefined)(i)?`undefined`:(0,o.isNull)(i)?`null`:e.kind===t.type_exports.ReflectionKind.boolean?String(i).trim().toLowerCase()===`true`?`true`:`false`:e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,r.isString)(e.literal)?c(i):e.kind===t.type_exports.ReflectionKind.enum?u(e).kind===t.type_exports.ReflectionKind.string?c(i):`${String(i)}`:e.kind===t.type_exports.ReflectionKind.union?f(e)?c(i):`${String(i)}`:e.kind===t.type_exports.ReflectionKind.array?c(a.StormJSON.stringify(i)):e.kind===t.type_exports.ReflectionKind.object||e.kind===t.type_exports.ReflectionKind.objectLiteral?a.StormJSON.stringify(i):e.kind===t.type_exports.ReflectionKind.property||e.kind===t.type_exports.ReflectionKind.parameter?l(e.type,i):String(i)}function u(e){if(e.kind!==t.type_exports.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let n=(0,i.getUniqueBy)(e.values.filter(e=>e!=null),e=>(0,r.isString)(e)?{kind:t.type_exports.ReflectionKind.string}:{kind:t.type_exports.ReflectionKind.number});if(n.length===0)throw Error(`No valid enum members could be found.`);return n[0]&&(0,r.isString)(n[0])?{kind:t.type_exports.ReflectionKind.string}:{kind:t.type_exports.ReflectionKind.number}}function d(e){if(e.kind===t.type_exports.ReflectionKind.union&&e.types.length>0)return(0,i.getUniqueBy)(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function f(e){return d(e).some(e=>e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,r.isString)(e.literal))}exports.stringifyDefaultValue=s;
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/type.cjs`);let n=require(`@stryke/helpers/get-unique`),r=require(`@stryke/json/storm-json`),i=require(`@stryke/type-checks/is-null`),a=require(`@stryke/type-checks/is-string`),o=require(`@stryke/type-checks/is-undefined`);function s(e,t){return l(e.type,t??e.getDefaultValue())}function c(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function l(e,n){return(0,o.isUndefined)(n)?`undefined`:(0,i.isNull)(n)?`null`:e.kind===t.type_exports.ReflectionKind.boolean?String(n).trim().toLowerCase()===`true`?`true`:`false`:e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,a.isString)(e.literal)?c(n):e.kind===t.type_exports.ReflectionKind.enum?u(e).kind===t.type_exports.ReflectionKind.string?c(n):`${String(n)}`:e.kind===t.type_exports.ReflectionKind.union?f(e)?c(n):`${String(n)}`:e.kind===t.type_exports.ReflectionKind.array?c(r.StormJSON.stringify(n)):e.kind===t.type_exports.ReflectionKind.object||e.kind===t.type_exports.ReflectionKind.objectLiteral?r.StormJSON.stringify(n):e.kind===t.type_exports.ReflectionKind.property||e.kind===t.type_exports.ReflectionKind.parameter?l(e.type,n):String(n)}function u(e){if(e.kind!==t.type_exports.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let r=(0,n.getUniqueBy)(e.values.filter(e=>e!=null),e=>(0,a.isString)(e)?{kind:t.type_exports.ReflectionKind.string}:{kind:t.type_exports.ReflectionKind.number});if(r.length===0)throw Error(`No valid enum members could be found.`);return r[0]&&(0,a.isString)(r[0])?{kind:t.type_exports.ReflectionKind.string}:{kind:t.type_exports.ReflectionKind.number}}function d(e){if(e.kind===t.type_exports.ReflectionKind.union&&e.types.length>0)return(0,n.getUniqueBy)(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function f(e){return d(e).some(e=>e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,a.isString)(e.literal))}exports.stringifyDefaultValue=s;
@@ -1 +1 @@
1
- import{type_exports as e}from"./vendor/type.mjs";import{isUndefined as t}from"@stryke/type-checks/is-undefined";import{isString as n}from"@stryke/type-checks/is-string";import{getUniqueBy as r}from"@stryke/helpers/get-unique";import{StormJSON as i}from"@stryke/json/storm-json";import{isNull as a}from"@stryke/type-checks/is-null";function o(e,t){return c(e.type,t??e.getDefaultValue())}function s(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function c(r,o){return t(o)?`undefined`:a(o)?`null`:r.kind===e.ReflectionKind.boolean?String(o).trim().toLowerCase()===`true`?`true`:`false`:r.kind===e.ReflectionKind.string||r.kind===e.ReflectionKind.literal&&n(r.literal)?s(o):r.kind===e.ReflectionKind.enum?l(r).kind===e.ReflectionKind.string?s(o):`${String(o)}`:r.kind===e.ReflectionKind.union?d(r)?s(o):`${String(o)}`:r.kind===e.ReflectionKind.array?s(i.stringify(o)):r.kind===e.ReflectionKind.object||r.kind===e.ReflectionKind.objectLiteral?i.stringify(o):r.kind===e.ReflectionKind.property||r.kind===e.ReflectionKind.parameter?c(r.type,o):String(o)}function l(t){if(t.kind!==e.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${t.kind}.`);let i=r(t.values.filter(e=>e!=null),t=>n(t)?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number});if(i.length===0)throw Error(`No valid enum members could be found.`);return i[0]&&n(i[0])?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number}}function u(t){if(t.kind===e.ReflectionKind.union&&t.types.length>0)return r(t.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${t.kind}.`)}function d(t){return u(t).some(t=>t.kind===e.ReflectionKind.string||t.kind===e.ReflectionKind.literal&&n(t.literal))}export{o as stringifyDefaultValue};
1
+ import{type_exports as e}from"./vendor/type.mjs";import{getUniqueBy as t}from"@stryke/helpers/get-unique";import{StormJSON as n}from"@stryke/json/storm-json";import{isNull as r}from"@stryke/type-checks/is-null";import{isString as i}from"@stryke/type-checks/is-string";import{isUndefined as a}from"@stryke/type-checks/is-undefined";function o(e,t){return c(e.type,t??e.getDefaultValue())}function s(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function c(t,o){return a(o)?`undefined`:r(o)?`null`:t.kind===e.ReflectionKind.boolean?String(o).trim().toLowerCase()===`true`?`true`:`false`:t.kind===e.ReflectionKind.string||t.kind===e.ReflectionKind.literal&&i(t.literal)?s(o):t.kind===e.ReflectionKind.enum?l(t).kind===e.ReflectionKind.string?s(o):`${String(o)}`:t.kind===e.ReflectionKind.union?d(t)?s(o):`${String(o)}`:t.kind===e.ReflectionKind.array?s(n.stringify(o)):t.kind===e.ReflectionKind.object||t.kind===e.ReflectionKind.objectLiteral?n.stringify(o):t.kind===e.ReflectionKind.property||t.kind===e.ReflectionKind.parameter?c(t.type,o):String(o)}function l(n){if(n.kind!==e.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${n.kind}.`);let r=t(n.values.filter(e=>e!=null),t=>i(t)?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number});if(r.length===0)throw Error(`No valid enum members could be found.`);return r[0]&&i(r[0])?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number}}function u(n){if(n.kind===e.ReflectionKind.union&&n.types.length>0)return t(n.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${n.kind}.`)}function d(t){return u(t).some(t=>t.kind===e.ReflectionKind.string||t.kind===e.ReflectionKind.literal&&i(t.literal))}export{o as stringifyDefaultValue};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./alloy/src/create-plugin.cjs`),n=require(`./deepkit/src/vendor/type.cjs`),r=require(`./plugin-babel/src/index.cjs`),i=require(`./plugin-env/src/index.cjs`),a=require(`./powerlines/src/lib/typescript/tsconfig.cjs`),o=require(`./components/react-optimized.cjs`);require(`./components/index.cjs`);let s=require(`@alloy-js/core/jsx-runtime`),c=require(`@storm-software/config-tools/types`),l=require(`defu`);l=e.__toESM(l);let u=require(`@vitejs/plugin-react`);u=e.__toESM(u);const d=t.createAlloyPlugin((e={})=>({name:`react`,dependsOn:[r.default(e.babel),i.default(e.env)],config(){return(0,l.default)({react:e},{react:{jsxImportSource:this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource}},{react:{jsxRuntime:`automatic`,jsxImportSource:`react`,compiler:{target:`19`,compilationMode:`infer`,gating:{source:`${this.config.output.builtinPrefix}:react/optimized`,importSpecifierName:`isOptimizationEnabled`},enableReanimatedCheck:!0,logger:{logEvent:(e,t)=>{this.log(t.kind===`CompileSuccess`?c.LogLevelLabel.SUCCESS:t.kind===`AutoDepsEligible`||t.kind===`AutoDepsDecorations`?c.LogLevelLabel.INFO:t.kind===`CompileSkip`||t.kind===`CompileDiagnostic`?c.LogLevelLabel.DEBUG:t.kind===`Timing`?c.LogLevelLabel.TRACE:c.LogLevelLabel.ERROR,`(${e}) ${t.kind===`CompileSuccess`?`React Compiler Success`:t.kind===`AutoDepsEligible`?`React AutoDeps Eligible - ${t.depArrayLoc.identifierName||`No identifier`}`:t.kind===`AutoDepsDecorations`?`React AutoDeps Decorations - ${t.decorations.filter(e=>e.identifierName).map(e=>e.identifierName).join(`, `)}`:t.kind===`CompileSkip`?`React Compile Skip - ${t.reason}`:t.kind===`CompileDiagnostic`?`React Compile Diagnostic - (Category: ${t.detail.category}) ${t.detail.reason}${t.detail.description?`\n${t.detail.description}`:``}`:t.kind===`Timing`?`React ${t.measurement.entryType} Timing (${t.measurement.name}) - ${t.measurement.duration}ms`:`React Compiler Error - ${t.fnLoc?.identifierName||`unknown location`}`}`)}}}}})},configResolved(){if(this.dependencies.react=`^19.2.0`,this.dependencies[`react-dom`]=`^19.2.0`,this.devDependencies[`@types/react`]=`^19.2.2`,this.devDependencies[`@types/react-dom`]=`^19.2.2`,this.config.react.compiler!==!1&&(this.config.transform.babel??={},this.config.transform.babel.plugins??=[],this.config.transform.babel.plugins.push([`babel-plugin-react-compiler`,this.config.react.compiler])),this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.lib??=[],this.tsconfig.tsconfigJson.compilerOptions.module??=`esnext`,this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=this.config.react.jsxImportSource,this.tsconfig.options.jsxImportSource===`react`?this.tsconfig.tsconfigJson.compilerOptions.jsx??=`react-jsx`:this.tsconfig.tsconfigJson.compilerOptions.jsx??=`preserve`,this.environment.consumer===`client`&&(a.isMatchFound(`dom`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM`),a.isMatchFound(`dom.iterable`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM.Iterable`)),a.isMatchFound(`esnext`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`ESNext`),this.tsconfig.options.resolveJsonModule!==!0&&(this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule=!0),this.config.build.variant===`vite`){this.tsconfig.tsconfigJson.compilerOptions.types??=[],a.isMatchFound(`vite/client`,this.tsconfig.tsconfigJson.compilerOptions.types)||this.tsconfig.tsconfigJson.compilerOptions.types.push(`vite/client`);let e=this.config.build;e.build??={},e.build.target=`chrome95`,e.plugins??=[],e.plugins.unshift((0,u.default)({babel:this.config.transform.babel,jsxImportSource:this.config.react.jsxImportSource,jsxRuntime:this.config.react.jsxRuntime,reactRefreshHost:this.config.react.reactRefreshHost}))}this.env?.types?.env&&!this.env.types.env.hasProperty(`DISABLE_REACT_COMPILER`)&&this.env.types.env.addProperty({name:`DISABLE_REACT_COMPILER`,optional:!0,readonly:!0,description:`Disables the React compiler optimizations.`,visibility:n.type_exports.ReflectionVisibility.public,type:{kind:n.type_exports.ReflectionKind.boolean},default:!1})},render(){let e=this;return(0,s.createComponent)(o.ReactOptimizedBuiltin,{get override(){return e.config.react.compiler===!1?!1:void 0}})}}));var f=d;exports.ReactOptimizedBuiltin=o.ReactOptimizedBuiltin,exports.default=f,exports.plugin=d;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deepkit/src/vendor/type.cjs`),n=require(`./components/react-optimized.cjs`);require(`./components/index.cjs`);const r=require(`./alloy/src/create-plugin.cjs`),i=require(`./plugin-babel/src/index.cjs`),a=require(`./plugin-env/src/index.cjs`),o=require(`./powerlines/src/lib/typescript/tsconfig.cjs`);let s=require(`@alloy-js/core/jsx-runtime`),c=require(`defu`);c=e.__toESM(c);let l=require(`@storm-software/config-tools/types`),u=require(`@vitejs/plugin-react`);u=e.__toESM(u);const d=r.createAlloyPlugin((e={})=>({name:`react`,dependsOn:[i.default(e.babel),a.default(e.env)],config(){return(0,c.default)({react:e},{react:{jsxImportSource:this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource}},{react:{jsxRuntime:`automatic`,jsxImportSource:`react`,compiler:{target:`19`,compilationMode:`infer`,gating:{source:`${this.config.output.builtinPrefix}:react/optimized`,importSpecifierName:`isOptimizationEnabled`},enableReanimatedCheck:!0,logger:{logEvent:(e,t)=>{this.log(t.kind===`CompileSuccess`?l.LogLevelLabel.SUCCESS:t.kind===`AutoDepsEligible`||t.kind===`AutoDepsDecorations`?l.LogLevelLabel.INFO:t.kind===`CompileSkip`||t.kind===`CompileDiagnostic`?l.LogLevelLabel.DEBUG:t.kind===`Timing`?l.LogLevelLabel.TRACE:l.LogLevelLabel.ERROR,`(${e}) ${t.kind===`CompileSuccess`?`React Compiler Success`:t.kind===`AutoDepsEligible`?`React AutoDeps Eligible - ${t.depArrayLoc.identifierName||`No identifier`}`:t.kind===`AutoDepsDecorations`?`React AutoDeps Decorations - ${t.decorations.filter(e=>e.identifierName).map(e=>e.identifierName).join(`, `)}`:t.kind===`CompileSkip`?`React Compile Skip - ${t.reason}`:t.kind===`CompileDiagnostic`?`React Compile Diagnostic - (Category: ${t.detail.category}) ${t.detail.reason}${t.detail.description?`\n${t.detail.description}`:``}`:t.kind===`Timing`?`React ${t.measurement.entryType} Timing (${t.measurement.name}) - ${t.measurement.duration}ms`:`React Compiler Error - ${t.fnLoc?.identifierName||`unknown location`}`}`)}}}}})},configResolved(){if(this.dependencies.react=`^19.2.0`,this.dependencies[`react-dom`]=`^19.2.0`,this.devDependencies[`@types/react`]=`^19.2.2`,this.devDependencies[`@types/react-dom`]=`^19.2.2`,this.config.react.compiler!==!1&&(this.config.transform.babel??={},this.config.transform.babel.plugins??=[],this.config.transform.babel.plugins.push([`babel-plugin-react-compiler`,this.config.react.compiler])),this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.lib??=[],this.tsconfig.tsconfigJson.compilerOptions.module??=`esnext`,this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=this.config.react.jsxImportSource,this.tsconfig.options.jsxImportSource===`react`?this.tsconfig.tsconfigJson.compilerOptions.jsx??=`react-jsx`:this.tsconfig.tsconfigJson.compilerOptions.jsx??=`preserve`,this.environment.consumer===`client`&&(o.isMatchFound(`dom`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM`),o.isMatchFound(`dom.iterable`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM.Iterable`)),o.isMatchFound(`esnext`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`ESNext`),this.tsconfig.options.resolveJsonModule!==!0&&(this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule=!0),this.config.build.variant===`vite`){this.tsconfig.tsconfigJson.compilerOptions.types??=[],o.isMatchFound(`vite/client`,this.tsconfig.tsconfigJson.compilerOptions.types)||this.tsconfig.tsconfigJson.compilerOptions.types.push(`vite/client`);let e=this.config.build;e.build??={},e.build.target=`chrome95`,e.plugins??=[],e.plugins.unshift((0,u.default)({babel:this.config.transform.babel,jsxImportSource:this.config.react.jsxImportSource,jsxRuntime:this.config.react.jsxRuntime,reactRefreshHost:this.config.react.reactRefreshHost}))}this.env?.types?.env&&!this.env.types.env.hasProperty(`DISABLE_REACT_COMPILER`)&&this.env.types.env.addProperty({name:`DISABLE_REACT_COMPILER`,optional:!0,readonly:!0,description:`Disables the React compiler optimizations.`,visibility:t.type_exports.ReflectionVisibility.public,type:{kind:t.type_exports.ReflectionKind.boolean},default:!1})},render(){let e=this;return(0,s.createComponent)(n.ReactOptimizedBuiltin,{get override(){return e.config.react.compiler===!1?!1:void 0}})}}));var f=d;exports.ReactOptimizedBuiltin=n.ReactOptimizedBuiltin,exports.default=f,exports.plugin=d;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
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-babel/src/index.mjs";import r from"./plugin-env/src/index.mjs";import{isMatchFound as i}from"./powerlines/src/lib/typescript/tsconfig.mjs";import{ReactOptimizedBuiltin as a}from"./components/react-optimized.mjs";import"./components/index.mjs";import{createComponent as o}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import c from"defu";import l from"@vitejs/plugin-react";const u=e((e={})=>({name:`react`,dependsOn:[n(e.babel),r(e.env)],config(){return c({react:e},{react:{jsxImportSource:this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource}},{react:{jsxRuntime:`automatic`,jsxImportSource:`react`,compiler:{target:`19`,compilationMode:`infer`,gating:{source:`${this.config.output.builtinPrefix}:react/optimized`,importSpecifierName:`isOptimizationEnabled`},enableReanimatedCheck:!0,logger:{logEvent:(e,t)=>{this.log(t.kind===`CompileSuccess`?s.SUCCESS:t.kind===`AutoDepsEligible`||t.kind===`AutoDepsDecorations`?s.INFO:t.kind===`CompileSkip`||t.kind===`CompileDiagnostic`?s.DEBUG:t.kind===`Timing`?s.TRACE:s.ERROR,`(${e}) ${t.kind===`CompileSuccess`?`React Compiler Success`:t.kind===`AutoDepsEligible`?`React AutoDeps Eligible - ${t.depArrayLoc.identifierName||`No identifier`}`:t.kind===`AutoDepsDecorations`?`React AutoDeps Decorations - ${t.decorations.filter(e=>e.identifierName).map(e=>e.identifierName).join(`, `)}`:t.kind===`CompileSkip`?`React Compile Skip - ${t.reason}`:t.kind===`CompileDiagnostic`?`React Compile Diagnostic - (Category: ${t.detail.category}) ${t.detail.reason}${t.detail.description?`\n${t.detail.description}`:``}`:t.kind===`Timing`?`React ${t.measurement.entryType} Timing (${t.measurement.name}) - ${t.measurement.duration}ms`:`React Compiler Error - ${t.fnLoc?.identifierName||`unknown location`}`}`)}}}}})},configResolved(){if(this.dependencies.react=`^19.2.0`,this.dependencies[`react-dom`]=`^19.2.0`,this.devDependencies[`@types/react`]=`^19.2.2`,this.devDependencies[`@types/react-dom`]=`^19.2.2`,this.config.react.compiler!==!1&&(this.config.transform.babel??={},this.config.transform.babel.plugins??=[],this.config.transform.babel.plugins.push([`babel-plugin-react-compiler`,this.config.react.compiler])),this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.lib??=[],this.tsconfig.tsconfigJson.compilerOptions.module??=`esnext`,this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=this.config.react.jsxImportSource,this.tsconfig.options.jsxImportSource===`react`?this.tsconfig.tsconfigJson.compilerOptions.jsx??=`react-jsx`:this.tsconfig.tsconfigJson.compilerOptions.jsx??=`preserve`,this.environment.consumer===`client`&&(i(`dom`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM`),i(`dom.iterable`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM.Iterable`)),i(`esnext`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`ESNext`),this.tsconfig.options.resolveJsonModule!==!0&&(this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule=!0),this.config.build.variant===`vite`){this.tsconfig.tsconfigJson.compilerOptions.types??=[],i(`vite/client`,this.tsconfig.tsconfigJson.compilerOptions.types)||this.tsconfig.tsconfigJson.compilerOptions.types.push(`vite/client`);let e=this.config.build;e.build??={},e.build.target=`chrome95`,e.plugins??=[],e.plugins.unshift(l({babel:this.config.transform.babel,jsxImportSource:this.config.react.jsxImportSource,jsxRuntime:this.config.react.jsxRuntime,reactRefreshHost:this.config.react.reactRefreshHost}))}this.env?.types?.env&&!this.env.types.env.hasProperty(`DISABLE_REACT_COMPILER`)&&this.env.types.env.addProperty({name:`DISABLE_REACT_COMPILER`,optional:!0,readonly:!0,description:`Disables the React compiler optimizations.`,visibility:t.ReflectionVisibility.public,type:{kind:t.ReflectionKind.boolean},default:!1})},render(){let e=this;return o(a,{get override(){return e.config.react.compiler===!1?!1:void 0}})}}));var d=u;export{a as ReactOptimizedBuiltin,d as default,u as plugin};
1
+ import{type_exports as e}from"./deepkit/src/vendor/type.mjs";import{ReactOptimizedBuiltin as t}from"./components/react-optimized.mjs";import"./components/index.mjs";import{createAlloyPlugin as n}from"./alloy/src/create-plugin.mjs";import r from"./plugin-babel/src/index.mjs";import i from"./plugin-env/src/index.mjs";import{isMatchFound as a}from"./powerlines/src/lib/typescript/tsconfig.mjs";import{createComponent as o}from"@alloy-js/core/jsx-runtime";import s from"defu";import{LogLevelLabel as c}from"@storm-software/config-tools/types";import l from"@vitejs/plugin-react";const u=n((n={})=>({name:`react`,dependsOn:[r(n.babel),i(n.env)],config(){return s({react:n},{react:{jsxImportSource:this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource}},{react:{jsxRuntime:`automatic`,jsxImportSource:`react`,compiler:{target:`19`,compilationMode:`infer`,gating:{source:`${this.config.output.builtinPrefix}:react/optimized`,importSpecifierName:`isOptimizationEnabled`},enableReanimatedCheck:!0,logger:{logEvent:(e,t)=>{this.log(t.kind===`CompileSuccess`?c.SUCCESS:t.kind===`AutoDepsEligible`||t.kind===`AutoDepsDecorations`?c.INFO:t.kind===`CompileSkip`||t.kind===`CompileDiagnostic`?c.DEBUG:t.kind===`Timing`?c.TRACE:c.ERROR,`(${e}) ${t.kind===`CompileSuccess`?`React Compiler Success`:t.kind===`AutoDepsEligible`?`React AutoDeps Eligible - ${t.depArrayLoc.identifierName||`No identifier`}`:t.kind===`AutoDepsDecorations`?`React AutoDeps Decorations - ${t.decorations.filter(e=>e.identifierName).map(e=>e.identifierName).join(`, `)}`:t.kind===`CompileSkip`?`React Compile Skip - ${t.reason}`:t.kind===`CompileDiagnostic`?`React Compile Diagnostic - (Category: ${t.detail.category}) ${t.detail.reason}${t.detail.description?`\n${t.detail.description}`:``}`:t.kind===`Timing`?`React ${t.measurement.entryType} Timing (${t.measurement.name}) - ${t.measurement.duration}ms`:`React Compiler Error - ${t.fnLoc?.identifierName||`unknown location`}`}`)}}}}})},configResolved(){if(this.dependencies.react=`^19.2.0`,this.dependencies[`react-dom`]=`^19.2.0`,this.devDependencies[`@types/react`]=`^19.2.2`,this.devDependencies[`@types/react-dom`]=`^19.2.2`,this.config.react.compiler!==!1&&(this.config.transform.babel??={},this.config.transform.babel.plugins??=[],this.config.transform.babel.plugins.push([`babel-plugin-react-compiler`,this.config.react.compiler])),this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.lib??=[],this.tsconfig.tsconfigJson.compilerOptions.module??=`esnext`,this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=this.config.react.jsxImportSource,this.tsconfig.options.jsxImportSource===`react`?this.tsconfig.tsconfigJson.compilerOptions.jsx??=`react-jsx`:this.tsconfig.tsconfigJson.compilerOptions.jsx??=`preserve`,this.environment.consumer===`client`&&(a(`dom`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM`),a(`dom.iterable`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`DOM.Iterable`)),a(`esnext`,this.tsconfig.tsconfigJson.compilerOptions.lib)||this.tsconfig.tsconfigJson.compilerOptions.lib.push(`ESNext`),this.tsconfig.options.resolveJsonModule!==!0&&(this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule=!0),this.config.build.variant===`vite`){this.tsconfig.tsconfigJson.compilerOptions.types??=[],a(`vite/client`,this.tsconfig.tsconfigJson.compilerOptions.types)||this.tsconfig.tsconfigJson.compilerOptions.types.push(`vite/client`);let e=this.config.build;e.build??={},e.build.target=`chrome95`,e.plugins??=[],e.plugins.unshift(l({babel:this.config.transform.babel,jsxImportSource:this.config.react.jsxImportSource,jsxRuntime:this.config.react.jsxRuntime,reactRefreshHost:this.config.react.reactRefreshHost}))}this.env?.types?.env&&!this.env.types.env.hasProperty(`DISABLE_REACT_COMPILER`)&&this.env.types.env.addProperty({name:`DISABLE_REACT_COMPILER`,optional:!0,readonly:!0,description:`Disables the React compiler optimizations.`,visibility:e.ReflectionVisibility.public,type:{kind:e.ReflectionKind.boolean},default:!1})},render(){let e=this;return o(t,{get override(){return e.config.react.compiler===!1?!1:void 0}})}}));var d=u;export{t as ReactOptimizedBuiltin,d as default,u as plugin};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@babel/types`);t=e.__toESM(t);let n=require(`@stryke/type-checks/is-string`);function r(e,t){o(e.scope.getProgramParent().path,t)}function i(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function a(e){let t=new Map;return e.traverse({ImportDeclaration(e){i(e)&&t.set(e.node.source.value,e)}}),t}function o(e,n){a(e).get(n.module)||e.unshiftContainer(`body`,t.importDeclaration([t.importSpecifier(t.identifier(n.name||n.imported),t.identifier(n.imported))],t.stringLiteral(n.module)))}exports.addImport=r,exports.addImportsToProgram=o;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@babel/types`);n=e.__toESM(n);function r(e,t){o(e.scope.getProgramParent().path,t)}function i(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function a(e){let t=new Map;return e.traverse({ImportDeclaration(e){i(e)&&t.set(e.node.source.value,e)}}),t}function o(e,t){a(e).get(t.module)||e.unshiftContainer(`body`,n.importDeclaration([n.importSpecifier(n.identifier(t.name||t.imported),n.identifier(t.imported))],n.stringLiteral(t.module)))}exports.addImport=r,exports.addImportsToProgram=o;
@@ -1 +1 @@
1
- import"./ast-utils.mjs";import*as e from"@babel/types";import{isString as t}from"@stryke/type-checks/is-string";function n(e,t){a(e.scope.getProgramParent().path,t)}function r(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function i(e){let t=new Map;return e.traverse({ImportDeclaration(e){r(e)&&t.set(e.node.source.value,e)}}),t}function a(t,n){i(t).get(n.module)||t.unshiftContainer(`body`,e.importDeclaration([e.importSpecifier(e.identifier(n.name||n.imported),e.identifier(n.imported))],e.stringLiteral(n.module)))}export{n as addImport,a as addImportsToProgram};
1
+ import"./ast-utils.mjs";import{isString as e}from"@stryke/type-checks/is-string";import*as t from"@babel/types";function n(e,t){a(e.scope.getProgramParent().path,t)}function r(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function i(e){let t=new Map;return e.traverse({ImportDeclaration(e){r(e)&&t.set(e.node.source.value,e)}}),t}function a(e,n){i(e).get(n.module)||e.unshiftContainer(`body`,t.importDeclaration([t.importSpecifier(t.identifier(n.name||n.imported),t.identifier(n.imported))],t.stringLiteral(n.module)))}export{n as addImport,a as addImportsToProgram};
@@ -1 +1 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/filters.cjs`),n=require(`./helpers/options.cjs`),r=require(`./helpers/create-plugin.cjs`),i=require(`./helpers/module-helpers.cjs`);require(`./helpers/index.cjs`);let a=require(`@storm-software/config-tools/types`),o=require(`@stryke/path/is-parent-path`),s=require(`@stryke/type-checks/is-set-object`),c=require(`@babel/core`),l=require(`@stryke/path/file-path-fns`),u=require(`defu`);u=e.__toESM(u);const d=(e={})=>({name:`babel`,config(){if((0,s.isSetObject)(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=(0,u.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if((0,o.isParentPath)(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(a.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(a.LogLevelLabel.TRACE,`Babel transforming file: ${i}`);let s=this.config.transform.babel.plugins.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e)),d=this.config.transform.babel.presets.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e));if(Array.isArray(s)&&s.length===0&&Array.isArray(d)&&d.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes((0,l.findFileExtensionSafe)(i))&&!t.isDuplicatePlugin(s,`@babel/plugin-syntax-typescript`)&&!t.isDuplicatePlugin(d,`@babel/preset-typescript`)&&s.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,l.findFileExtension)(i)===`.tsx`}]);let f=await(0,c.transformAsync)(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:s.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,u.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:d.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,u.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!f?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:f.code,id:i}}});var f=d;exports.default=f;
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/filters.cjs`),n=require(`./helpers/options.cjs`),r=require(`./helpers/create-plugin.cjs`),i=require(`./helpers/module-helpers.cjs`);require(`./helpers/index.cjs`);let a=require(`defu`);a=e.__toESM(a);let o=require(`@storm-software/config-tools/types`),s=require(`@stryke/path/is-parent-path`),c=require(`@stryke/type-checks/is-set-object`),l=require(`@babel/core`),u=require(`@stryke/path/file-path-fns`);const d=(e={})=>({name:`babel`,config(){if((0,c.isSetObject)(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=(0,a.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if((0,s.isParentPath)(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(o.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(o.LogLevelLabel.TRACE,`Babel transforming file: ${i}`);let c=this.config.transform.babel.plugins.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e)),d=this.config.transform.babel.presets.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e));if(Array.isArray(c)&&c.length===0&&Array.isArray(d)&&d.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes((0,u.findFileExtensionSafe)(i))&&!t.isDuplicatePlugin(c,`@babel/plugin-syntax-typescript`)&&!t.isDuplicatePlugin(d,`@babel/preset-typescript`)&&c.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,u.findFileExtension)(i)===`.tsx`}]);let f=await(0,l.transformAsync)(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:c.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,a.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:d.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,a.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!f?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:f.code,id:i}}});var f=d;exports.default=f;
@@ -1 +1 @@
1
- import{getPluginName as e,isDuplicatePlugin as t}from"./helpers/filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./helpers/options.mjs";import{createBabelPlugin as i}from"./helpers/create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./helpers/module-helpers.mjs";import"./helpers/index.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import{isParentPath as c}from"@stryke/path/is-parent-path";import{isSetObject as l}from"@stryke/type-checks/is-set-object";import{transformAsync as u}from"@babel/core";import{findFileExtension as d,findFileExtensionSafe as f}from"@stryke/path/file-path-fns";import p from"defu";var m=(e={})=>({name:`babel`,config(){if(l(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=p(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if(c(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(s.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(s.TRACE,`Babel transforming file: ${i}`);let a=this.config.transform.babel.plugins.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e)),o=this.config.transform.babel.presets.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e));if(Array.isArray(a)&&a.length===0&&Array.isArray(o)&&o.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes(f(i))&&!t(a,`@babel/plugin-syntax-typescript`)&&!t(o,`@babel/preset-typescript`)&&a.unshift([`@babel/plugin-syntax-typescript`,{isTSX:d(i)===`.tsx`}]);let l=await u(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:a.map(t=>Array.isArray(t)&&t.length>=2?[t[0],p(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],p(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!l?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:l.code,id:i}}});export{m as default};
1
+ import{getPluginName as e,isDuplicatePlugin as t}from"./helpers/filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./helpers/options.mjs";import{createBabelPlugin as i}from"./helpers/create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./helpers/module-helpers.mjs";import"./helpers/index.mjs";import s from"defu";import{LogLevelLabel as c}from"@storm-software/config-tools/types";import{isParentPath as l}from"@stryke/path/is-parent-path";import{isSetObject as u}from"@stryke/type-checks/is-set-object";import{transformAsync as d}from"@babel/core";import{findFileExtension as f,findFileExtensionSafe as p}from"@stryke/path/file-path-fns";var m=(e={})=>({name:`babel`,config(){if(u(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=s(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if(l(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(c.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(c.TRACE,`Babel transforming file: ${i}`);let a=this.config.transform.babel.plugins.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e)),o=this.config.transform.babel.presets.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e));if(Array.isArray(a)&&a.length===0&&Array.isArray(o)&&o.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes(p(i))&&!t(a,`@babel/plugin-syntax-typescript`)&&!t(o,`@babel/preset-typescript`)&&a.unshift([`@babel/plugin-syntax-typescript`,{isTSX:f(i)===`.tsx`}]);let u=await d(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:a.map(t=>Array.isArray(t)&&t.length>=2?[t[0],s(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],s(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!u?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:u.code,id:i}}});export{m as default};
@@ -1,5 +1,5 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../plugin-babel/src/helpers/create-plugin.cjs`),r=require(`../../../plugin-babel/src/helpers/module-helpers.cjs`),i=require(`../../../deepkit/src/capnp.cjs`),a=require(`../../../deepkit/schemas/reflection2.cjs`),o=require(`../../../deepkit/src/utilities.cjs`),s=require(`../helpers/persistence.cjs`);let c=require(`@storm-software/config-tools/types`),l=require(`@stryke/capnp`);l=e.__toESM(l);let u=require(`@stryke/fs/buffer`),d=require(`node:fs`);const f=n.createBabelPlugin(`env`,({log:e,context:n})=>{function f(t,r,i=!1){let a=n.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(t.name){let s=n.config.env.prefix.find(e=>t.name&&t.name.startsWith(e)&&(n.env.types.env?.hasProperty(t.name.replace(`${e}_`,``))||a.some(n=>n.getAlias().includes(t.name.replace(`${e}_`,``))))),l=t.name;if(s&&(l=t.name.replace(`${s}_`,``)),e(c.LogLevelLabel.TRACE,`Environment variable ${l} found in ${r.filename||`unknown file`}.`),n.env.types.env?.hasProperty(l)||a.some(e=>e.getAlias().includes(l))){let e=n.env.types.env.hasProperty(l)?n.env.types.env.getProperty(l):a.find(e=>e.getAlias().includes(l));if(!e||e.isIgnored())return;if(n.env.used.env.hasProperty(l)||n.env.used.env.addProperty(e.property),n.config.env.inject&&i){let t=n.env.parsed?.[l];if(t===void 0){let e=n.config.env.prefix.find(e=>n.env.parsed[`${e.replace(/_$/g,``)}_${l}`]);e&&(t=n.env.parsed[`${e.replace(/_$/g,``)}_${l}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${l}\` is not defined in the .env configuration files`);return o.stringifyDefaultValue(e,t)}}else throw Error(`The "${l}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${r.filename?r.filename:`unknown`}.
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../deepkit/src/utilities.cjs`),r=require(`../../../plugin-babel/src/helpers/create-plugin.cjs`),i=require(`../../../plugin-babel/src/helpers/module-helpers.cjs`),a=require(`../../../deepkit/src/capnp.cjs`),o=require(`../../../deepkit/schemas/reflection2.cjs`),s=require(`../helpers/persistence.cjs`);let c=require(`@storm-software/config-tools/types`),l=require(`@stryke/capnp`);l=e.__toESM(l);let u=require(`@stryke/fs/buffer`),d=require(`node:fs`);const f=r.createBabelPlugin(`env`,({log:e,context:r})=>{function f(t,i,a=!1){let o=r.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(t.name){let s=r.config.env.prefix.find(e=>t.name&&t.name.startsWith(e)&&(r.env.types.env?.hasProperty(t.name.replace(`${e}_`,``))||o.some(n=>n.getAlias().includes(t.name.replace(`${e}_`,``))))),l=t.name;if(s&&(l=t.name.replace(`${s}_`,``)),e(c.LogLevelLabel.TRACE,`Environment variable ${l} found in ${i.filename||`unknown file`}.`),r.env.types.env?.hasProperty(l)||o.some(e=>e.getAlias().includes(l))){let e=r.env.types.env.hasProperty(l)?r.env.types.env.getProperty(l):o.find(e=>e.getAlias().includes(l));if(!e||e.isIgnored())return;if(r.env.used.env.hasProperty(l)||r.env.used.env.addProperty(e.property),r.config.env.inject&&a){let t=r.env.parsed?.[l];if(t===void 0){let e=r.config.env.prefix.find(e=>r.env.parsed[`${e.replace(/_$/g,``)}_${l}`]);e&&(t=r.env.parsed[`${e.replace(/_$/g,``)}_${l}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${l}\` is not defined in the .env configuration files`);return n.stringifyDefaultValue(e,t)}}else throw Error(`The "${l}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${i.filename?i.filename:`unknown`}.
2
2
 
3
- The following environment configuration names are defined in the \`env\` type definition: \n${n.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
4
- `)} \n\nUsing the following env prefix: \n${n.config.env.prefix.map(e=>` - ${e}`).join(`
5
- `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){e(c.LogLevelLabel.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let r=t.type_exports.ReflectionClass.from({kind:t.type_exports.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),o=s.getEnvReflectionsPath(n,`env`);o&&(0,d.existsSync)(o)&&(e(c.LogLevelLabel.TRACE,`Environment reflection file found at ${o}, reading existing reflection.`),r=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(i.convertFromCapnp(new l.Message((0,u.readFileBufferSync)(o),!1).getRoot(a.SerializedTypes).types)))),e(c.LogLevelLabel.TRACE,`Adding new variables to env reflection at ${o}.`),r.getProperties().filter(e=>e.getNameAsString()&&!n.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{n.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});exports.envBabelPlugin=f;
3
+ The following environment configuration names are defined in the \`env\` type definition: \n${r.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${o.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${o?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
4
+ `)} \n\nUsing the following env prefix: \n${r.config.env.prefix.map(e=>` - ${e}`).join(`
5
+ `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),i.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),i.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),i.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),i.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){e(c.LogLevelLabel.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let n=t.type_exports.ReflectionClass.from({kind:t.type_exports.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),i=s.getEnvReflectionsPath(r,`env`);i&&(0,d.existsSync)(i)&&(e(c.LogLevelLabel.TRACE,`Environment reflection file found at ${i}, reading existing reflection.`),n=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(a.convertFromCapnp(new l.Message((0,u.readFileBufferSync)(i),!1).getRoot(o.SerializedTypes).types)))),e(c.LogLevelLabel.TRACE,`Adding new variables to env reflection at ${i}.`),n.getProperties().filter(e=>e.getNameAsString()&&!r.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{r.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});exports.envBabelPlugin=f;
@@ -1,5 +1,5 @@
1
- import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{createBabelPlugin as t}from"../../../plugin-babel/src/helpers/create-plugin.mjs";import{addImport as n}from"../../../plugin-babel/src/helpers/module-helpers.mjs";import{convertFromCapnp as r}from"../../../deepkit/src/capnp.mjs";import{SerializedTypes as i}from"../../../deepkit/schemas/reflection2.mjs";import{stringifyDefaultValue as a}from"../../../deepkit/src/utilities.mjs";import{getEnvReflectionsPath as o}from"../helpers/persistence.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import*as c from"@stryke/capnp";import{readFileBufferSync as l}from"@stryke/fs/buffer";import{existsSync as u}from"node:fs";const d=t(`env`,({log:t,context:d})=>{function f(e,n,r=!1){let i=d.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(e.name){let o=d.config.env.prefix.find(t=>e.name&&e.name.startsWith(t)&&(d.env.types.env?.hasProperty(e.name.replace(`${t}_`,``))||i.some(n=>n.getAlias().includes(e.name.replace(`${t}_`,``))))),c=e.name;if(o&&(c=e.name.replace(`${o}_`,``)),t(s.TRACE,`Environment variable ${c} found in ${n.filename||`unknown file`}.`),d.env.types.env?.hasProperty(c)||i.some(e=>e.getAlias().includes(c))){let e=d.env.types.env.hasProperty(c)?d.env.types.env.getProperty(c):i.find(e=>e.getAlias().includes(c));if(!e||e.isIgnored())return;if(d.env.used.env.hasProperty(c)||d.env.used.env.addProperty(e.property),d.config.env.inject&&r){let t=d.env.parsed?.[c];if(t===void 0){let e=d.config.env.prefix.find(e=>d.env.parsed[`${e.replace(/_$/g,``)}_${c}`]);e&&(t=d.env.parsed[`${e.replace(/_$/g,``)}_${c}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${c}\` is not defined in the .env configuration files`);return a(e,t)}}else throw Error(`The "${c}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${n.filename?n.filename:`unknown`}.
1
+ import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{stringifyDefaultValue as t}from"../../../deepkit/src/utilities.mjs";import{createBabelPlugin as n}from"../../../plugin-babel/src/helpers/create-plugin.mjs";import{addImport as r}from"../../../plugin-babel/src/helpers/module-helpers.mjs";import{convertFromCapnp as i}from"../../../deepkit/src/capnp.mjs";import{SerializedTypes as a}from"../../../deepkit/schemas/reflection2.mjs";import{getEnvReflectionsPath as o}from"../helpers/persistence.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import*as c from"@stryke/capnp";import{readFileBufferSync as l}from"@stryke/fs/buffer";import{existsSync as u}from"node:fs";const d=n(`env`,({log:n,context:d})=>{function f(e,r,i=!1){let a=d.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(e.name){let o=d.config.env.prefix.find(t=>e.name&&e.name.startsWith(t)&&(d.env.types.env?.hasProperty(e.name.replace(`${t}_`,``))||a.some(n=>n.getAlias().includes(e.name.replace(`${t}_`,``))))),c=e.name;if(o&&(c=e.name.replace(`${o}_`,``)),n(s.TRACE,`Environment variable ${c} found in ${r.filename||`unknown file`}.`),d.env.types.env?.hasProperty(c)||a.some(e=>e.getAlias().includes(c))){let e=d.env.types.env.hasProperty(c)?d.env.types.env.getProperty(c):a.find(e=>e.getAlias().includes(c));if(!e||e.isIgnored())return;if(d.env.used.env.hasProperty(c)||d.env.used.env.addProperty(e.property),d.config.env.inject&&i){let n=d.env.parsed?.[c];if(n===void 0){let e=d.config.env.prefix.find(e=>d.env.parsed[`${e.replace(/_$/g,``)}_${c}`]);e&&(n=d.env.parsed[`${e.replace(/_$/g,``)}_${c}`])}if(n??=e.getDefaultValue(),e.isValueRequired()&&n===void 0)throw Error(`Environment variable \`${c}\` is not defined in the .env configuration files`);return t(e,n)}}else throw Error(`The "${c}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${r.filename?r.filename:`unknown`}.
2
2
 
3
- The following environment configuration names are defined in the \`env\` type definition: \n${d.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${i.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${i?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
3
+ The following environment configuration names are defined in the \`env\` type definition: \n${d.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
4
4
  `)} \n\nUsing the following env prefix: \n${d.config.env.prefix.map(e=>` - ${e}`).join(`
5
- `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;if(!r.name)return;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;if(!r.name)return;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){t(s.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let n=e.ReflectionClass.from({kind:e.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),a=o(d,`env`);a&&u(a)&&(t(s.TRACE,`Environment reflection file found at ${a}, reading existing reflection.`),n=(0,e.resolveClassType)((0,e.deserializeType)(r(new c.Message(l(a),!1).getRoot(i).types)))),t(s.TRACE,`Adding new variables to env reflection at ${a}.`),n.getProperties().filter(e=>e.getNameAsString()&&!d.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{d.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});export{d as envBabelPlugin};
5
+ `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){n(s.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let t=e.ReflectionClass.from({kind:e.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),r=o(d,`env`);r&&u(r)&&(n(s.TRACE,`Environment reflection file found at ${r}, reading existing reflection.`),t=(0,e.resolveClassType)((0,e.deserializeType)(i(new c.Message(l(r),!1).getRoot(a).types)))),n(s.TRACE,`Adding new variables to env reflection at ${r}.`),t.getProperties().filter(e=>e.getNameAsString()&&!d.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{d.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});export{d as envBabelPlugin};
@@ -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` {
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../alloy/src/core/contexts/context.cjs`),n=require(`../../../alloy/src/helpers/refkey.cjs`),r=require(`../../../deepkit/src/vendor/type.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(`@alloy-js/typescript`),p=require(`@stryke/type-checks/is-null`),m=require(`defu`);m=e.__toESM(m);let h=require(`@stryke/string-format/title-case`);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)(f.TypeDeclaration,{name:`Env`,export:!0,get children(){return d.code` {
2
2
  [Key in keyof EnvBase as Key ${i?.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,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)(f.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)(f.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)(f.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`
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,u.createComponent)(f.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`
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=n.refkey(`createEnv`),x=n.refkey(`env`),S=n.refkey(`EnvSerializer`);function C(e){let[{defaultConfig:n},o]=(0,d.splitProps)(e,[`defaultConfig`]),_=t.usePowerlines(),C=(0,d.computed)(()=>_&&c.loadEnvFromContext(_,process.env)),w=l.createReflectionResource(_),T=(0,d.computed)(()=>new r.type_exports.ReflectionClass({kind:r.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${(0,h.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,m.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,p.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)(f.ClassDeclaration,{refkey:S,name:`EnvSerializer`,extends:`Serializer`,export:!0,get children(){return(0,u.createComponent)(f.ClassMethod,{name:`constructor`,public:!0,children:d.code`
11
11
  super("env");
12
12
 
13
13
  this.deserializeRegistry.register(
@@ -18,7 +18,7 @@ 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,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)(f.VarDeclaration,{name:`envSerializer`,export:!1,const:!0,get initializer(){return(0,u.createComponent)(f.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)(f.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)(f.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)(f.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`
22
22
  return new Proxy<Env>(
23
23
  deserializeEnv({
24
24
  ...initialEnv,
@@ -31,4 +31,4 @@ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../al
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,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createIntrinsic)(`hbr`,{}),(0,u.createComponent)(f.VarDeclaration,{refkey:x,name:`env`,type:`Env`,export:!0,const:!0,get initializer(){return[d.code`createEnv(`,n||`{}`,d.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` {
1
+ import{usePowerlines as e}from"../../../alloy/src/core/contexts/context.mjs";import{refkey as t}from"../../../alloy/src/helpers/refkey.mjs";import{type_exports as n}from"../../../deepkit/src/vendor/type.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{ClassDeclaration as w,ClassMethod as T,ElseIfClause as E,FunctionDeclaration as D,IfStatement as O,NewExpression as k,TypeDeclaration as A,VarDeclaration as j}from"@alloy-js/typescript";import{isNull as M}from"@stryke/type-checks/is-null";import N from"defu";import{titleCase as P}from"@stryke/string-format/title-case";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(A,{name:`Env`,export:!0,get children(){return x` {
2
2
  [Key in keyof EnvBase as Key ${i?.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 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?O:E,{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?O:E,{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`
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 z=t(`createEnv`),B=t(`env`),V=t(`EnvSerializer`);function H(t){let[{defaultConfig:d},_]=C(t,[`defaultConfig`]),E=e(),O=S(()=>E&&p(E,process.env)),A=m(E),I=S(()=>new n.ReflectionClass({kind:n.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${P(E?.config?.name)} project.`,types:[]},A.data??void 0)),H=S(()=>A.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),U=S(()=>A.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 N({"@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!M(A.data)},get children(){return[h(F,{get defaultValue(){return O.value},get reflection(){return A.data}}),g(`hbr`,{}),g(`hbr`,{})]}}),h(f,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:O,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(w,{refkey:V,name:`EnvSerializer`,extends:`Serializer`,export:!0,get children(){return h(T,{name:`constructor`,public:!0,children:x`
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
+ `})}}),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(j,{name:`envSerializer`,export:!1,const:!0,get initializer(){return h(k,{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(j,{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(j,{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!!E?.entryPath},get children(){return h(D,{refkey:z,async:!1,export:!0,name:`createEnv`,parameters:[{name:`environmentConfig`,type:`Partial<Env>`,optional:!1,default:`{}`}],returnType:`Env`,get children(){return[x`
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) => { `,g(`hbr`,{}),h(y,{each:H,children:(e,t)=>h(L,{index:t,context:E,property:e})}),x`
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
+ }, `,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:E,property:e})}),g(`hbr`,{}),x`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
+ `]}})}}),g(`hbr`,{}),g(`hbr`,{}),g(`hbr`,{}),h(j,{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};
@@ -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(`defu`);i=e.__toESM(i);let a=require(`@stryke/path/join-paths`),o=require(`@stryke/env/load-env`),s=require(`@stryke/string-format/kebab-case`),c=require(`c12`);async function l(e,n,r){let a=await(0,o.loadEnv)(r,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,o.loadEnvFile)(e,r)));for(let e of t)a=(0,i.default)(e,a)}return t.removeEnvPrefix(a)}async function u(e,t,n,r,o,s){let[u,d]=await Promise.all([l(e,n,t),(0,c.loadConfig)({cwd:t,name:`storm`,envName:n,defaults:{NAME:o.name?.replace(`@${s.namespace}/`,``),MODE:n,ORG:s.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,a.joinPaths)(r,`jiti`),moduleCache:!0}})]);return(0,i.default)(u,d.config,s)}function d(e,t){return(0,i.default)({APP_NAME:(0,s.kebabCase)(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${(0,s.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:(0,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,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return(0,i.default)(d(e,process.env),n,r,a)}exports.loadEnv=f,exports.loadEnvFromContext=d;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/type-checks/is-set-string`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/type-checks/is-set-object`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/env/load-env`),s=require(`@stryke/string-format/kebab-case`),c=require(`c12`);async function l(e,n,i){let a=await(0,o.loadEnv)(i,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,o.loadEnvFile)(e,i)));for(let e of t)a=(0,r.default)(e,a)}return t.removeEnvPrefix(a)}async function u(e,t,n,i,o,s){let[u,d]=await Promise.all([l(e,n,t),(0,c.loadConfig)({cwd:t,name:`storm`,envName:n,defaults:{NAME:o.name?.replace(`@${s.namespace}/`,``),MODE:n,ORG:s.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,a.joinPaths)(i,`jiti`),moduleCache:!0}})]);return(0,r.default)(u,d.config,s)}function d(e,t){return(0,r.default)({APP_NAME:(0,s.kebabCase)(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${(0,s.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:(0,n.isSetString)(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},(0,i.isSetObject)(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return(0,r.default)(d(e,process.env),n,i,a)}exports.loadEnv=f,exports.loadEnvFromContext=d;
@@ -1 +1 @@
1
- import{removeEnvPrefix as e}from"./source-file-env.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{isSetObject as n}from"@stryke/type-checks/is-set-object";import r from"defu";import{joinPaths as i}from"@stryke/path/join-paths";import{loadEnv as a,loadEnvFile as o}from"@stryke/env/load-env";import{kebabCase as s}from"@stryke/string-format/kebab-case";import{loadConfig as c}from"c12";async function l(t,n,i){let s=await a(i,n);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>o(e,i)));for(let t of e)s=r(t,s)}return e(s)}async function u(e,t,n,a,o,s){let[u,d]=await Promise.all([l(e,n,t),c({cwd:t,name:`storm`,envName:n,defaults:{NAME:o.name?.replace(`@${s.namespace}/`,``),MODE:n,ORG:s.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:i(a,`jiti`),moduleCache:!0}})]);return r(u,d.config,s)}function d(e,i){return r({APP_NAME:s(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:`${s(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]=i[t.name]??t.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return r(d(e,process.env),n,i,a)}export{f as loadEnv,d as loadEnvFromContext};
1
+ import{removeEnvPrefix as e}from"./source-file-env.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import n from"defu";import{isSetObject as r}from"@stryke/type-checks/is-set-object";import{joinPaths as i}from"@stryke/path/join-paths";import{loadEnv as a,loadEnvFile as o}from"@stryke/env/load-env";import{kebabCase as s}from"@stryke/string-format/kebab-case";import{loadConfig as c}from"c12";async function l(t,r,i){let s=await a(i,r);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>o(e,i)));for(let t of e)s=n(t,s)}return e(s)}async function u(e,t,r,a,o,s){let[u,d]=await Promise.all([l(e,r,t),c({cwd:t,name:`storm`,envName:r,defaults:{NAME:o.name?.replace(`@${s.namespace}/`,``),MODE:r,ORG:s.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:i(a,`jiti`),moduleCache:!0}})]);return n(u,d.config,s)}function d(e,i){return n({APP_NAME:s(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:`${s(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},r(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,t)=>(e[t.name]=i[t.name]??t.getDefaultValue(),e),{}):{})}async function f(e,t){let[r,i,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return n(d(e,process.env),r,i,a)}export{f as loadEnv,d as loadEnvFromContext};
@@ -1,4 +1,4 @@
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-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`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let d=require(`@alloy-js/core/jsx-runtime`),f=require(`@storm-software/config-tools/types`),p=require(`@stryke/path/is-parent-path`),m=require(`defu`);m=e.__toESM(m);let h=require(`@stryke/convert/parse-type-definition`),g=require(`@stryke/convert/to-array`),_=require(`@stryke/env/types`),v=require(`@stryke/fs/exists`),y=require(`@stryke/fs/helpers`),b=require(`@stryke/path/join`),x=require(`@stryke/string-format/constant-case`);const S=t.createAlloyPlugin((e={})=>({name:`env`,dependsOn:[r.default(e.babel)],async config(){this.log(f.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,m.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[o.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,h.parseTypeDefinition)(t.env.types);else{this.log(f.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,h.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,h.parseTypeDefinition)(t.env.secrets);else{let e=await a.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,h.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,g.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,x.constantCase)(t);return e.includes(n)||e.push(n),e},[..._.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(f.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,m.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,v.existsSync)(a.getEnvTypeReflectionsPath(this,`env`)))this.log(f.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await a.readEnvTypeReflection(this,`env`),(0,v.existsSync)(a.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await a.readEnvReflection(this)),(0,v.existsSync)(a.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await a.readEnvTypeReflection(this,`secrets`)),(0,v.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,p.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,b.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,p.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,b.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(f.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 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 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 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 a.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(f.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),(0,d.createComponent)(u.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(f.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,b.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,v.existsSync)(e)||await(0,y.createDirectory)(e);let t=await a.readEnvTypeReflection(this,`env`),r=(0,b.joinPaths)(e,`env.md`);this.log(f.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by Powerlines -->
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../alloy/src/create-plugin.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`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let d=require(`@alloy-js/core/jsx-runtime`),f=require(`defu`);f=e.__toESM(f);let p=require(`@storm-software/config-tools/types`),m=require(`@stryke/path/is-parent-path`),h=require(`@stryke/convert/parse-type-definition`),g=require(`@stryke/convert/to-array`),_=require(`@stryke/env/types`),v=require(`@stryke/fs/exists`),y=require(`@stryke/fs/helpers`),b=require(`@stryke/path/join`),x=require(`@stryke/string-format/constant-case`);const S=n.createAlloyPlugin((e={})=>({name:`env`,dependsOn:[r.default(e.babel)],async config(){this.log(p.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,f.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[o.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,h.parseTypeDefinition)(t.env.types);else{this.log(p.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await a.getEnvDefaultTypeDefinition(this);t.env.types=(0,h.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,h.parseTypeDefinition)(t.env.secrets);else{let e=await a.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,h.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,g.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,x.constantCase)(t);return e.includes(n)||e.push(n),e},[..._.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(p.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,f.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,v.existsSync)(a.getEnvTypeReflectionsPath(this,`env`)))this.log(p.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await a.readEnvTypeReflection(this,`env`),(0,v.existsSync)(a.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await a.readEnvReflection(this)),(0,v.existsSync)(a.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await a.readEnvTypeReflection(this,`secrets`)),(0,v.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,m.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,b.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,m.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,b.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(p.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await 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`))}},render(){let e=this;return this.log(p.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),(0,d.createComponent)(u.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(p.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,b.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,v.existsSync)(e)||await(0,y.createDirectory)(e);let n=await a.readEnvTypeReflection(this,`env`),r=(0,b.joinPaths)(e,`env.md`);this.log(p.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by Powerlines -->
2
2
 
3
3
  # Environment variables configuration
4
4
 
@@ -10,7 +10,7 @@ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../alloy/sr
10
10
 
11
11
  | Name | Description | Type | Default Value | Required |
12
12
  | ---- | ----------- | ---- | ------------- | :------: |
13
- ${t.getProperties().filter(e=>e.getNameAsString()!==`__STORM_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
14
- `,``)??``).trim()} | ${(0,n.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
13
+ ${n.getProperties().filter(e=>e.getNameAsString()!==`__STORM_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
14
+ `,``)??``).trim()} | ${(0,t.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
15
15
  `)}
16
- `)},async buildEnd(){let e=a.getEnvReflectionsPath(this,`env`);this.log(f.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await a.writeEnvReflection(this,this.env.used.env,`env`)}}));var C=S;exports.default=C;
16
+ `)},async buildEnd(){let e=a.getEnvReflectionsPath(this,`env`);this.log(p.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await a.writeEnvReflection(this,this.env.used.env,`env`)}}));var C=S;exports.default=C;
@@ -1,4 +1,4 @@
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-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"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{createComponent as O}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as k}from"@storm-software/config-tools/types";import{isParentPath as A}from"@stryke/path/is-parent-path";import j from"defu";import{parseTypeDefinition as M}from"@stryke/convert/parse-type-definition";import{toArray as N}from"@stryke/convert/to-array";import{ENV_PREFIXES as P}from"@stryke/env/types";import{existsSync as F}from"@stryke/fs/exists";import{createDirectory as I}from"@stryke/fs/helpers";import{joinPaths as L}from"@stryke/path/join";import{constantCase as R}from"@stryke/string-format/constant-case";var z=e((e={})=>({name:`env`,dependsOn:[n(e.babel)],async config(){this.log(k.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:j(e,{types:{},prefix:[]}),transform:{babel:{plugins:[x]}}};if(t.env.types)t.env.types=M(t.env.types);else{this.log(k.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await d(this);t.env.types=M(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=M(t.env.secrets);else{let e=await m(this);t.env.secrets=M(`${e.file}#${e.name}`)}return t.env.prefix=N(t.env.prefix??[]).reduce((e,t)=>{let n=R(t);return e.includes(n)||e.push(n),e},[...P,`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(k.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=j({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&&F(p(this,`env`)))this.log(k.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await g(this,`env`),F(f(this,`env`))&&(this.env.used.env=await h(this)),F(p(this,`secrets`))&&(this.env.types.secrets=await g(this,`secrets`)),F(f(this,`secrets`))&&(this.env.used.secrets=await _(this));else{if(this.env.types.env=await l(this,this.config.env.types?.file?A(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:L(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?A(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:L(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(k.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(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 y(this,this.env.used.env,`env`),this.env.types.secrets&&(await b(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 y(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(k.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),O(E,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(k.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=L(this.config.projectRoot,`docs`,`generated`);F(e)||await I(e);let n=await g(this,`env`),r=L(e,`env.md`);this.log(k.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by Powerlines -->
1
+ import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import{createAlloyPlugin as t}from"../../alloy/src/create-plugin.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"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{createComponent as O}from"@alloy-js/core/jsx-runtime";import k from"defu";import{LogLevelLabel as A}from"@storm-software/config-tools/types";import{isParentPath as j}from"@stryke/path/is-parent-path";import{parseTypeDefinition as M}from"@stryke/convert/parse-type-definition";import{toArray as N}from"@stryke/convert/to-array";import{ENV_PREFIXES as P}from"@stryke/env/types";import{existsSync as F}from"@stryke/fs/exists";import{createDirectory as I}from"@stryke/fs/helpers";import{joinPaths as L}from"@stryke/path/join";import{constantCase as R}from"@stryke/string-format/constant-case";var z=t((t={})=>({name:`env`,dependsOn:[n(t.babel)],async config(){this.log(A.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:k(t,{types:{},prefix:[]}),transform:{babel:{plugins:[x]}}};if(e.env.types)e.env.types=M(e.env.types);else{this.log(A.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await d(this);e.env.types=M(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=M(e.env.secrets);else{let t=await m(this);e.env.secrets=M(`${t.file}#${t.name}`)}return e.env.prefix=N(e.env.prefix??[]).reduce((e,t)=>{let n=R(t);return e.includes(n)||e.push(n),e},[...P,`POWERLINES_`]),e.env.prefix=e.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),e},async configResolved(){if(this.log(A.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=k({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&&F(p(this,`env`)))this.log(A.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await g(this,`env`),F(f(this,`env`))&&(this.env.used.env=await h(this)),F(p(this,`secrets`))&&(this.env.types.secrets=await g(this,`secrets`)),F(f(this,`secrets`))&&(this.env.used.secrets=await _(this));else{if(this.env.types.env=await l(this,this.config.env.types?.file?j(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:L(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?j(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:L(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(A.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await 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`))}},render(){let e=this;return this.log(A.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),O(E,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(A.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=L(this.config.projectRoot,`docs`,`generated`);F(t)||await I(t);let n=await g(this,`env`),r=L(t,`env.md`);this.log(A.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by Powerlines -->
2
2
 
3
3
  # Environment variables configuration
4
4
 
@@ -10,7 +10,7 @@ import{createAlloyPlugin as e}from"../../alloy/src/create-plugin.mjs";import{typ
10
10
 
11
11
  | Name | Description | Type | Default Value | Required |
12
12
  | ---- | ----------- | ---- | ------------- | :------: |
13
- ${n.getProperties().filter(e=>e.getNameAsString()!==`__STORM_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
14
- `,``)??``).trim()} | ${(0,t.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
13
+ ${n.getProperties().filter(e=>e.getNameAsString()!==`__STORM_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
14
+ `,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
15
15
  `)}
16
- `)},async buildEnd(){let e=f(this,`env`);this.log(k.TRACE,`Writing env reflection types to ${e}.`),await y(this,this.env.used.env,`env`)}}));export{z as default};
16
+ `)},async buildEnd(){let e=f(this,`env`);this.log(A.TRACE,`Writing env reflection types to ${e}.`),await y(this,this.env.used.env,`env`)}}));export{z as default};
@@ -1,4 +1,4 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/replace`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/path/join-paths`),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,i.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/type-checks/is-string`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/path/replace`),i=require(`@stryke/path/join-paths`),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,i.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`
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]}";
@@ -1,4 +1,4 @@
1
- import"../entry.mjs";import{replacePath as e}from"@stryke/path/replace";import t from"defu";import{isString as n}from"@stryke/type-checks/is-string";import{joinPaths as r}from"@stryke/path/join-paths";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 n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync(r(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if(a(e)!==e){if(t.length===1)return`
1
+ import"../entry.mjs";import{isString as e}from"@stryke/type-checks/is-string";import t from"defu";import{replacePath as n}from"@stryke/path/replace";import{joinPaths as r}from"@stryke/path/join-paths";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 n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync(r(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).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]}";
@@ -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/type-checks/is-string`),r=require(`@stryke/convert/parse-type-definition`),i=require(`@stryke/convert/to-array`),a=require(`@stryke/helpers/get-unique`),o=require(`@stryke/path/join-paths`);require(`@stryke/fs/is-file`),require(`@stryke/fs/list-files`),require(`@stryke/hash/murmurhash`);let s=require(`@stryke/path/append`);
1
+ require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/helpers/get-unique`),t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/append`),i=require(`@stryke/path/replace`),a=require(`@stryke/convert/parse-type-definition`),o=require(`@stryke/convert/to-array`),s=require(`@stryke/path/join-paths`);require(`@stryke/fs/is-file`),require(`@stryke/fs/list-files`),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{isString as n}from"@stryke/type-checks/is-string";import{parseTypeDefinition as r}from"@stryke/convert/parse-type-definition";import{toArray as i}from"@stryke/convert/to-array";import{getUniqueBy as a}from"@stryke/helpers/get-unique";import{joinPaths as o}from"@stryke/path/join-paths";import"@stryke/fs/is-file";import"@stryke/fs/list-files";import"@stryke/hash/murmurhash";import{appendPath as s}from"@stryke/path/append";export{};
1
+ import"../plugin-utils/paths.mjs";import{getUniqueBy as e}from"@stryke/helpers/get-unique";import{isString as t}from"@stryke/type-checks/is-string";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{appendPath as r}from"@stryke/path/append";import{replacePath as i}from"@stryke/path/replace";import{parseTypeDefinition as a}from"@stryke/convert/parse-type-definition";import{toArray as o}from"@stryke/convert/to-array";import{joinPaths as s}from"@stryke/path/join-paths";import"@stryke/fs/is-file";import"@stryke/fs/list-files";import"@stryke/hash/murmurhash";export{};
@@ -1 +1 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/fs/exists`),r=require(`@stryke/path/join-paths`),i=require(`@stryke/path/append`);require(`@stryke/fs/json`),require(`typescript`);function a(e,t,n=[`.ts`,`.tsx`,`.d.ts`]){return t.find(t=>e?.toString().toLowerCase()===t?.toString().toLowerCase()||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}`||`./${e?.toString().toLowerCase()}`===t?.toString().toLowerCase()||n.some(n=>`${e?.toString().toLowerCase()}${n}`===t?.toString().toLowerCase()||`${e?.toString().toLowerCase()}${n}`==`./${t?.toString().toLowerCase()}`||`${t?.toString().toLowerCase()}${n}`==`./${e?.toString().toLowerCase()}`||e?.toString().toLowerCase()===`${t?.toString().toLowerCase()}${n}`||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}${n}`||t?.toString().toLowerCase()===`./${e?.toString().toLowerCase()}${n}`))}function o(e,t){return a(e,t)!==void 0}exports.isMatchFound=o;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/append`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/fs/exists`),i=require(`@stryke/path/join-paths`);require(`@stryke/fs/json`),require(`typescript`);function a(e,t,n=[`.ts`,`.tsx`,`.d.ts`]){return t.find(t=>e?.toString().toLowerCase()===t?.toString().toLowerCase()||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}`||`./${e?.toString().toLowerCase()}`===t?.toString().toLowerCase()||n.some(n=>`${e?.toString().toLowerCase()}${n}`===t?.toString().toLowerCase()||`${e?.toString().toLowerCase()}${n}`==`./${t?.toString().toLowerCase()}`||`${t?.toString().toLowerCase()}${n}`==`./${e?.toString().toLowerCase()}`||e?.toString().toLowerCase()===`${t?.toString().toLowerCase()}${n}`||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}${n}`||t?.toString().toLowerCase()===`./${e?.toString().toLowerCase()}${n}`))}function o(e,t){return a(e,t)!==void 0}exports.isMatchFound=o;
@@ -1 +1 @@
1
- import e from"defu";import{existsSync as t}from"@stryke/fs/exists";import{joinPaths as n}from"@stryke/path/join-paths";import{appendPath as r}from"@stryke/path/append";import"@stryke/fs/json";import i from"typescript";function a(e,t,n=[`.ts`,`.tsx`,`.d.ts`]){return t.find(t=>e?.toString().toLowerCase()===t?.toString().toLowerCase()||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}`||`./${e?.toString().toLowerCase()}`===t?.toString().toLowerCase()||n.some(n=>`${e?.toString().toLowerCase()}${n}`===t?.toString().toLowerCase()||`${e?.toString().toLowerCase()}${n}`==`./${t?.toString().toLowerCase()}`||`${t?.toString().toLowerCase()}${n}`==`./${e?.toString().toLowerCase()}`||e?.toString().toLowerCase()===`${t?.toString().toLowerCase()}${n}`||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}${n}`||t?.toString().toLowerCase()===`./${e?.toString().toLowerCase()}${n}`))}function o(e,t){return a(e,t)!==void 0}export{o as isMatchFound};
1
+ import{appendPath as e}from"@stryke/path/append";import t from"defu";import{existsSync as n}from"@stryke/fs/exists";import{joinPaths as r}from"@stryke/path/join-paths";import"@stryke/fs/json";import i from"typescript";function a(e,t,n=[`.ts`,`.tsx`,`.d.ts`]){return t.find(t=>e?.toString().toLowerCase()===t?.toString().toLowerCase()||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}`||`./${e?.toString().toLowerCase()}`===t?.toString().toLowerCase()||n.some(n=>`${e?.toString().toLowerCase()}${n}`===t?.toString().toLowerCase()||`${e?.toString().toLowerCase()}${n}`==`./${t?.toString().toLowerCase()}`||`${t?.toString().toLowerCase()}${n}`==`./${e?.toString().toLowerCase()}`||e?.toString().toLowerCase()===`${t?.toString().toLowerCase()}${n}`||e?.toString().toLowerCase()===`./${t?.toString().toLowerCase()}${n}`||t?.toString().toLowerCase()===`./${e?.toString().toLowerCase()}${n}`))}function o(e,t){return a(e,t)!==void 0}export{o as isMatchFound};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/type-checks/is-function`),r=require(`@stryke/type-checks/is-set-object`),i=require(`@stryke/type-checks/is-undefined`);function a(e){return(0,n.isFunction)(e)||(0,r.isSetObject)(e)&&`handler`in e&&(0,n.isFunction)(e.handler)}function o(e){return(0,r.isSetObject)(e)&&`handler`in e&&(0,n.isFunction)(e.handler)}function s(e){return a(e)||o(e)}function c(e){return(0,n.isFunction)(e)?e:e.handler}exports.getHookHandler=c,exports.isPluginHook=s,exports.isPluginHookFunction=a,exports.isPluginHookObject=o;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-undefined`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/type-checks/is-function`),i=require(`@stryke/type-checks/is-set-object`);function a(e){return(0,r.isFunction)(e)||(0,i.isSetObject)(e)&&`handler`in e&&(0,r.isFunction)(e.handler)}function o(e){return(0,i.isSetObject)(e)&&`handler`in e&&(0,r.isFunction)(e.handler)}function s(e){return a(e)||o(e)}function c(e){return(0,r.isFunction)(e)?e:e.handler}exports.getHookHandler=c,exports.isPluginHook=s,exports.isPluginHookFunction=a,exports.isPluginHookObject=o;
@@ -1 +1 @@
1
- import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isFunction as t}from"@stryke/type-checks/is-function";import{isSetObject as n}from"@stryke/type-checks/is-set-object";import{isUndefined as r}from"@stryke/type-checks/is-undefined";function i(e){return t(e)||n(e)&&`handler`in e&&t(e.handler)}function a(e){return n(e)&&`handler`in e&&t(e.handler)}function o(e){return i(e)||a(e)}function s(e){return t(e)?e:e.handler}export{s as getHookHandler,o as isPluginHook,i as isPluginHookFunction,a as isPluginHookObject};
1
+ import{isUndefined as e}from"@stryke/type-checks/is-undefined";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{isFunction as n}from"@stryke/type-checks/is-function";import{isSetObject as r}from"@stryke/type-checks/is-set-object";function i(e){return n(e)||r(e)&&`handler`in e&&n(e.handler)}function a(e){return r(e)&&`handler`in e&&n(e.handler)}function o(e){return i(e)||a(e)}function s(e){return n(e)?e:e.handler}export{s as getHookHandler,o as isPluginHook,i as isPluginHookFunction,a as isPluginHookObject};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for building a React application.",
6
6
  "repository": {
@@ -142,18 +142,18 @@
142
142
  "@stryke/fs": "^0.33.26",
143
143
  "@stryke/path": "^0.23.2",
144
144
  "babel-plugin-react-compiler": "^1.0.0",
145
- "@powerlines/alloy": "^0.11.91",
146
- "@powerlines/plugin-babel": "^0.12.91",
147
- "@powerlines/plugin-env": "^0.13.88",
148
- "@powerlines/plugin-plugin": "^0.12.34",
145
+ "@powerlines/alloy": "^0.11.93",
146
+ "@powerlines/plugin-babel": "^0.12.93",
147
+ "@powerlines/plugin-env": "^0.13.90",
148
+ "@powerlines/plugin-plugin": "^0.12.36",
149
149
  "@vitejs/plugin-react": "^5.1.2",
150
150
  "defu": "^6.1.4",
151
- "powerlines": "^0.34.0"
151
+ "powerlines": "^0.34.2"
152
152
  },
153
153
  "devDependencies": {
154
- "@powerlines/nx": "^0.11.13",
154
+ "@powerlines/nx": "^0.11.15",
155
155
  "@types/node": "^24.10.4"
156
156
  },
157
157
  "publishConfig": { "access": "public" },
158
- "gitHead": "ec843acfdf7935e78ac7a78ffb0ae110e6490da3"
158
+ "gitHead": "6407c0f7097c50efaf2096a8ea0b53f403f3ac0a"
159
159
  }