@powerlines/plugin-env 0.13.105 → 0.14.0

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 (57) hide show
  1. package/dist/alloy/src/create-plugin.cjs +1 -1
  2. package/dist/alloy/src/create-plugin.mjs +1 -1
  3. package/dist/alloy/src/markdown/components/markdown-file.cjs +1 -1
  4. package/dist/alloy/src/markdown/components/markdown-file.mjs +1 -1
  5. package/dist/alloy/src/typescript/components/typescript-file.cjs +1 -1
  6. package/dist/alloy/src/typescript/components/typescript-file.d.cts +1 -0
  7. package/dist/alloy/src/typescript/components/typescript-file.d.mts +1 -0
  8. package/dist/alloy/src/typescript/components/typescript-file.mjs +1 -1
  9. package/dist/alloy/src/typescript/components/typescript-interface.cjs +1 -1
  10. package/dist/alloy/src/typescript/components/typescript-interface.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/babel/plugin.d.mts +1 -1
  14. package/dist/helpers/automd-generator.cjs +1 -0
  15. package/dist/helpers/automd-generator.d.cts +14 -0
  16. package/dist/helpers/automd-generator.d.mts +14 -0
  17. package/dist/helpers/automd-generator.mjs +1 -0
  18. package/dist/helpers/load.d.mts +1 -1
  19. package/dist/helpers/persistence.d.cts +1 -1
  20. package/dist/helpers/persistence.d.mts +1 -1
  21. package/dist/index.cjs +6 -12
  22. package/dist/index.d.cts +1 -2
  23. package/dist/index.d.mts +3 -4
  24. package/dist/index.mjs +6 -12
  25. package/dist/plugin-automd/src/index.cjs +1 -0
  26. package/dist/plugin-automd/src/index.mjs +1 -0
  27. package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
  28. package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
  29. package/dist/plugin-automd/src/types/toc.d.cts +33 -0
  30. package/dist/plugin-automd/src/types/toc.d.mts +33 -0
  31. package/dist/plugin-babel/src/types/plugin.d.cts +1 -1
  32. package/dist/plugin-babel/src/types/plugin.d.mts +1 -1
  33. package/dist/powerlines/schemas/fs.d.mts +1 -0
  34. package/dist/powerlines/src/api.d.mts +7 -0
  35. package/dist/powerlines/src/index.d.mts +12 -0
  36. package/dist/powerlines/src/internal/helpers/hooks.d.mts +2 -2
  37. package/dist/powerlines/src/lib/entry.cjs +1 -1
  38. package/dist/powerlines/src/lib/entry.mjs +1 -1
  39. package/dist/powerlines/src/types/api.d.mts +1 -1
  40. package/dist/powerlines/src/types/babel.d.cts +1 -1
  41. package/dist/powerlines/src/types/babel.d.mts +1 -1
  42. package/dist/powerlines/src/types/commands.d.cts +1 -1
  43. package/dist/powerlines/src/types/commands.d.mts +1 -1
  44. package/dist/powerlines/src/types/config.d.cts +3 -3
  45. package/dist/powerlines/src/types/config.d.mts +3 -3
  46. package/dist/powerlines/src/types/context.d.mts +1 -1
  47. package/dist/powerlines/src/types/index.d.mts +4 -4
  48. package/dist/powerlines/src/types/plugin.d.cts +2 -2
  49. package/dist/powerlines/src/types/plugin.d.mts +2 -2
  50. package/dist/powerlines/src/types/unplugin.d.mts +1 -1
  51. package/dist/types/plugin.d.cts +9 -1
  52. package/dist/types/plugin.d.mts +8 -0
  53. package/package.json +9 -7
  54. package/dist/alloy/src/types/plugin.d.cts +0 -15
  55. package/dist/alloy/src/types/plugin.d.mts +0 -15
  56. package/dist/plugin-plugin/src/types/plugin.d.cts +0 -21
  57. package/dist/plugin-plugin/src/types/plugin.d.mts +0 -24
@@ -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(`@stryke/type-checks/is-set-string`),i=require(`@storm-software/config-tools/types`),a=require(`@stryke/path/replace`),o=require(`@stryke/path/is-parent-path`),s=require(`@alloy-js/core`),c=require(`@alloy-js/core/jsx-runtime`),l=require(`prettier/doc.js`);function u(e){return r=>{let i=e(r);return{...i,async prepare(){let e=this;if(t.isPluginHook(i.prepare)&&i.enforce!==`post`&&(t.isPluginHookFunction(i.prepare)||t.isPluginHookObject(i.prepare)&&i.prepare.order!==`post`)&&await Promise.resolve(t.getHookHandler(i.prepare).call(this)),t.isPluginHook(i.render)){let t=(0,s.renderTree)((0,c.createComponent)(n.Output,{context:e,get basePath(){return e.workspaceConfig.workspaceRoot},get children(){return i.render.call(e)}}));await d(this,t,r?.alloy)}t.isPluginHook(i.prepare)&&(i.enforce===`post`||t.isPluginHookObject(i.prepare)&&i.prepare.order===`post`)&&await Promise.resolve(t.getHookHandler(i.prepare).call(this))}}}}async function d(e,t,n={}){await(0,s.flushJobsAsync)();let c,l=async(t,r)=>{if(!Array.isArray(r))return;let u=async e=>{for(let t of r)await l(e,t)},d=(0,s.getContextForRenderNode)(r);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):c=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 s;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(i.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),s={kind:`builtin`,id:d.meta.builtin.id,path:(0,a.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,r,n)}}else d.meta?.entry||(0,o.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(i.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),s={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,r,n)}):(e.log(i.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),s={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,r,n)});t.contents.push(s)}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(i.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,r.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,r.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,c)}async function f(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,s.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(`@stryke/type-checks/is-set-string`),i=require(`@storm-software/config-tools/types`),a=require(`@stryke/path/replace`),o=require(`@stryke/path/is-parent-path`),s=require(`@alloy-js/core`),c=require(`@alloy-js/core/jsx-runtime`),l=require(`prettier/doc.js`);function u(e){return r=>{let i=e(r);return{...i,async prepare(){let e=this;if(t.isPluginHook(i.prepare)&&i.enforce!==`post`&&(t.isPluginHookFunction(i.prepare)||t.isPluginHookObject(i.prepare)&&i.prepare.order!==`post`)&&await Promise.resolve(t.getHookHandler(i.prepare).call(this)),t.isPluginHook(i.render)){let t=(0,s.renderTree)((0,c.createComponent)(n.Output,{context:e,get basePath(){return e.workspaceConfig.workspaceRoot},get children(){return i.render.call(e)}}));await d(this,t,r?.alloy)}t.isPluginHook(i.prepare)&&(i.enforce===`post`||t.isPluginHookObject(i.prepare)&&i.prepare.order===`post`)&&await Promise.resolve(t.getHookHandler(i.prepare).call(this))}}}}async function d(e,t,n={}){await(0,s.flushJobsAsync)();let c,l=async(t,r)=>{if(!Array.isArray(r))return;let u=async e=>{for(let t of r)await l(e,t)},d=(0,s.getContextForRenderNode)(r);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):c=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 s;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(i.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),s={kind:`builtin`,id:d.meta.builtin.id,path:(0,a.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,r,n)}}else d.meta?.entry||(0,o.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(i.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),s={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,r,n)}):(e.log(i.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),s={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,r,n)});t.contents.push(s)}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(i.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,n.typeDefinition);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,r.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,r.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,c)}async function f(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,s.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,s.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{isSetString as a}from"@stryke/type-checks/is-set-string";import{LogLevelLabel as o}from"@storm-software/config-tools/types";import{replacePath as s}from"@stryke/path/replace";import{isParentPath as c}from"@stryke/path/is-parent-path";import{flushJobsAsync as l,getContextForRenderNode as u,isPrintHook as d,renderTree as f}from"@alloy-js/core";import{createComponent as p}from"@alloy-js/core/jsx-runtime";import{printer as m}from"prettier/doc.js";function h(a){return o=>{let s=a(o);return{...s,async prepare(){let a=this;if(t(s.prepare)&&s.enforce!==`post`&&(n(s.prepare)||r(s.prepare)&&s.prepare.order!==`post`)&&await Promise.resolve(e(s.prepare).call(this)),t(s.render)){let e=f(p(i,{context:a,get basePath(){return a.workspaceConfig.workspaceRoot},get children(){return s.render.call(a)}}));await g(this,e,o?.alloy)}t(s.prepare)&&(s.enforce===`post`||r(s.prepare)&&s.prepare.order===`post`)&&await Promise.resolve(e(s.prepare).call(this))}}}}async function g(e,t,n={}){await l();let r,i=async(t,a)=>{if(!Array.isArray(a))return;let l=async e=>{for(let t of a)await i(e,t)},d=u(a);if(!d)return l(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await l(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.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:s(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await _(e,a,n)}}else d.meta?.entry||c(e.entryPath,d.meta.sourceFile.path)?(e.log(o.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 _(e,a,n)}):(e.log(o.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 _(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.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 l(t)};await i(void 0,t);let d=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await d(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(!a(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&a(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 d(e,r)}async function _(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await l();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{isSetString as a}from"@stryke/type-checks/is-set-string";import{LogLevelLabel as o}from"@storm-software/config-tools/types";import{replacePath as s}from"@stryke/path/replace";import{isParentPath as c}from"@stryke/path/is-parent-path";import{flushJobsAsync as l,getContextForRenderNode as u,isPrintHook as d,renderTree as f}from"@alloy-js/core";import{createComponent as p}from"@alloy-js/core/jsx-runtime";import{printer as m}from"prettier/doc.js";function h(a){return o=>{let s=a(o);return{...s,async prepare(){let a=this;if(t(s.prepare)&&s.enforce!==`post`&&(n(s.prepare)||r(s.prepare)&&s.prepare.order!==`post`)&&await Promise.resolve(e(s.prepare).call(this)),t(s.render)){let e=f(p(i,{context:a,get basePath(){return a.workspaceConfig.workspaceRoot},get children(){return s.render.call(a)}}));await g(this,e,o?.alloy)}t(s.prepare)&&(s.enforce===`post`||r(s.prepare)&&s.prepare.order===`post`)&&await Promise.resolve(e(s.prepare).call(this))}}}}async function g(e,t,n={}){await l();let r,i=async(t,a)=>{if(!Array.isArray(a))return;let l=async e=>{for(let t of a)await i(e,t)},d=u(a);if(!d)return l(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await l(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.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:s(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await _(e,a,n)}}else d.meta?.entry||c(e.entryPath,d.meta.sourceFile.path)?(e.log(o.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 _(e,a,n)}):(e.log(o.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 _(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.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 l(t)};await i(void 0,t);let d=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await d(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,n.typeDefinition);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(!a(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&a(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 d(e,r)}async function _(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await l();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 d(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(`../../core/components/single-line-comment.cjs`),n=require(`../../core/components/source-file.cjs`);let r=require(`@alloy-js/core`),i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/markdown`);function o(e){let[{children:t,preset:o},c]=(0,r.splitProps)(e,[`children`,`preset`]),l=(0,r.getContext)();return l.meta??={},l.meta.output={preset:o},(0,i.createComponent)(n.SourceFile,(0,i.mergeProps)({get header(){return(0,i.createComponent)(s,{})}},c,{filetype:`md`,reference:a.Link,get children(){return(0,i.createComponent)(r.Show,{get when(){return!!t},children:t})}}))}function s(e){let[{children:n,disableEslint:a=!0,disableBiome:o=!0,disablePrettier:s=!1}]=(0,r.splitProps)(e,[`children`,`disableEslint`,`disableBiome`,`disablePrettier`]);return[(0,i.createComponent)(r.Show,{get when(){return!!a},get children(){return[(0,i.createComponent)(t.SingleLineComment,{variant:`markdown`,children:`eslint-disable`}),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(r.Show,{get when(){return!!s},get children(){return[(0,i.createComponent)(t.SingleLineComment,{variant:`markdown`,children:`prettier-ignore`}),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(r.Show,{get when(){return!!o},get children(){return[(0,i.createComponent)(t.SingleLineComment,{variant:`markdown`,children:`biome-ignore lint: disable`}),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(r.Show,{get when(){return!!a||!!s||!!o},get children(){return(0,i.createIntrinsic)(`hbr`,{})}}),(0,i.createComponent)(r.Show,{get when(){return!!n},get children(){return[n,(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(t.SingleLineComment,{variant:`markdown`,children:r.code`Generated by Powerlines`}),(0,i.createIntrinsic)(`hbr`,{}),(0,i.createComponent)(t.SingleLineComment,{variant:`markdown`,children:r.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),(0,i.createIntrinsic)(`hbr`,{})]}exports.MarkdownFile=o;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../core/contexts/context.cjs`),n=require(`../../core/components/single-line-comment.cjs`),r=require(`../../core/components/source-file.cjs`);let i=require(`@stryke/string-format/title-case`),a=require(`@alloy-js/core`),o=require(`@alloy-js/core/jsx-runtime`),s=require(`@alloy-js/markdown`);function c(e){let[{children:t,preset:n},i]=(0,a.splitProps)(e,[`children`,`preset`]),c=(0,a.getContext)();return c.meta??={},c.meta.output={preset:n},(0,o.createComponent)(r.SourceFile,(0,o.mergeProps)({get header(){return(0,o.createComponent)(l,{})}},i,{filetype:`md`,reference:s.Link,get children(){return(0,o.createComponent)(a.Show,{get when(){return!!t},children:t})}}))}function l(e){let[{children:r,disableEslint:s=!0,disableBiome:c=!0,disablePrettier:l=!1}]=(0,a.splitProps)(e,[`children`,`disableEslint`,`disableBiome`,`disablePrettier`]),u=t.usePowerlines();return[(0,o.createComponent)(a.Show,{get when(){return!!s},get children(){return[(0,o.createComponent)(n.SingleLineComment,{variant:`markdown`,children:`eslint-disable`}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(a.Show,{get when(){return!!l},get children(){return[(0,o.createComponent)(n.SingleLineComment,{variant:`markdown`,children:`prettier-ignore`}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(a.Show,{get when(){return!!c},get children(){return[(0,o.createComponent)(n.SingleLineComment,{variant:`markdown`,children:`biome-ignore lint: disable`}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(a.Show,{get when(){return!!s||!!l||!!c},get children(){return(0,o.createIntrinsic)(`hbr`,{})}}),(0,o.createComponent)(a.Show,{get when(){return!!r},get children(){return[r,(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(n.SingleLineComment,{variant:`markdown`,get children(){return a.code`Generated by ${(0,i.titleCase)(u?.config.framework)||`Powerlines`}`}}),(0,o.createIntrinsic)(`hbr`,{}),(0,o.createComponent)(n.SingleLineComment,{variant:`markdown`,children:a.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`}),(0,o.createIntrinsic)(`hbr`,{})]}exports.MarkdownFile=c;
@@ -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{Show as n,code as r,getContext as i,splitProps as a}from"@alloy-js/core";import{createComponent as o,createIntrinsic as s,mergeProps as c}from"@alloy-js/core/jsx-runtime";import{Link as l}from"@alloy-js/markdown";function u(e){let[{children:r,preset:s},u]=a(e,[`children`,`preset`]),f=i();return f.meta??={},f.meta.output={preset:s},o(t,c({get header(){return o(d,{})}},u,{filetype:`md`,reference:l,get children(){return o(n,{get when(){return!!r},children:r})}}))}function d(t){let[{children:i,disableEslint:c=!0,disableBiome:l=!0,disablePrettier:u=!1}]=a(t,[`children`,`disableEslint`,`disableBiome`,`disablePrettier`]);return[o(n,{get when(){return!!c},get children(){return[o(e,{variant:`markdown`,children:`eslint-disable`}),s(`hbr`,{})]}}),o(n,{get when(){return!!u},get children(){return[o(e,{variant:`markdown`,children:`prettier-ignore`}),s(`hbr`,{})]}}),o(n,{get when(){return!!l},get children(){return[o(e,{variant:`markdown`,children:`biome-ignore lint: disable`}),s(`hbr`,{})]}}),o(n,{get when(){return!!c||!!u||!!l},get children(){return s(`hbr`,{})}}),o(n,{get when(){return!!i},get children(){return[i,s(`hbr`,{})]}}),o(e,{variant:`markdown`,children:r`Generated by Powerlines`}),s(`hbr`,{}),o(e,{variant:`markdown`,children:r`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),s(`hbr`,{})]}export{u as MarkdownFile};
1
+ import{usePowerlines as e}from"../../core/contexts/context.mjs";import{SingleLineComment as t}from"../../core/components/single-line-comment.mjs";import{SourceFile as n}from"../../core/components/source-file.mjs";import{titleCase as r}from"@stryke/string-format/title-case";import{Show as i,code as a,getContext as o,splitProps as s}from"@alloy-js/core";import{createComponent as c,createIntrinsic as l,mergeProps as u}from"@alloy-js/core/jsx-runtime";import{Link as d}from"@alloy-js/markdown";function f(e){let[{children:t,preset:r},a]=s(e,[`children`,`preset`]),l=o();return l.meta??={},l.meta.output={preset:r},c(n,u({get header(){return c(p,{})}},a,{filetype:`md`,reference:d,get children(){return c(i,{get when(){return!!t},children:t})}}))}function p(n){let[{children:o,disableEslint:u=!0,disableBiome:d=!0,disablePrettier:f=!1}]=s(n,[`children`,`disableEslint`,`disableBiome`,`disablePrettier`]),p=e();return[c(i,{get when(){return!!u},get children(){return[c(t,{variant:`markdown`,children:`eslint-disable`}),l(`hbr`,{})]}}),c(i,{get when(){return!!f},get children(){return[c(t,{variant:`markdown`,children:`prettier-ignore`}),l(`hbr`,{})]}}),c(i,{get when(){return!!d},get children(){return[c(t,{variant:`markdown`,children:`biome-ignore lint: disable`}),l(`hbr`,{})]}}),c(i,{get when(){return!!u||!!f||!!d},get children(){return l(`hbr`,{})}}),c(i,{get when(){return!!o},get children(){return[o,l(`hbr`,{})]}}),c(t,{variant:`markdown`,get children(){return a`Generated by ${r(p?.config.framework)||`Powerlines`}`}}),l(`hbr`,{}),c(t,{variant:`markdown`,children:a`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`}),l(`hbr`,{})]}export{f as MarkdownFile};
@@ -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(`@stryke/type-checks/is-string`),i=require(`@stryke/path/append`),a=require(`@alloy-js/core`),o=require(`@alloy-js/core/jsx-runtime`),s=require(`@alloy-js/typescript`),c=require(`@stryke/type-checks/is-boolean`);function l(e){let[{children:t,path:r,imports:l,tsx:f,header:p},m]=(0,a.splitProps)(e,[`children`,`path`,`imports`,`tsx`,`header`]),h=(0,a.useContext)(a.SourceDirectoryContext),g=(0,s.getSourceDirectoryData)(h),_=(0,i.appendPath)(r,h.path),v=new s.TSModuleScope(_,(0,a.useScope)());g.modules.add(v);let y=(0,a.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,o.createComponent)(s.SourceFileContext.Provider,{value:{scope:v},get children(){return(0,o.createComponent)(a.Scope,{value:v,get children(){return(0,o.createComponent)(n.SourceFile,(0,o.mergeProps)(m,{path:_,get header(){return p??(0,o.createComponent)(u,{get children(){return(0,o.createComponent)(d,{imports:l,scope:v})}})},filetype:f?`tsx`:`typescript`,children:t}))}})}})}function u(e){let{header:n,disableEslint:r=!0,disableBiome:i=!0,disablePrettier:s=!1,children:c}=e;return[(0,o.createComponent)(a.Show,{get when(){return!!n},get children(){return[n,(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createIntrinsic)(`hbr`,{}),(0,o.createComponent)(a.Show,{get when(){return!!r},get children(){return[(0,o.createComponent)(t.SingleLineComment,{variant:`slash-star`,children:`eslint-disable`}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(a.Show,{get when(){return!!s},get children(){return[(0,o.createComponent)(t.SingleLineComment,{variant:`slash-star`,children:`prettier-ignore`}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(a.Show,{get when(){return!!i},get children(){return[(0,o.createComponent)(t.SingleLineComment,{children:`biome-ignore lint: disable`}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(a.Show,{get when(){return!!r||!!s||!!i},get children(){return(0,o.createIntrinsic)(`hbr`,{})}}),(0,o.createComponent)(a.Show,{get when(){return!!c},get children(){return[c,(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(t.SingleLineComment,{children:a.code`Generated by Powerlines`}),(0,o.createIntrinsic)(`hbr`,{}),(0,o.createComponent)(t.SingleLineComment,{children:a.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),(0,o.createIntrinsic)(`hbr`,{})]}function d(e){let{imports:t}=e,n=(0,s.useSourceFile)(),i=e.scope??n.scope;return(0,o.createComponent)(a.Show,{get when(){return i.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[(0,o.createComponent)(a.Show,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>a.code`import ${t===null?``:t.filter(e=>!(0,r.isString)(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!(0,r.isString)(e)&&e.default).length>0&&t.filter(e=>(0,r.isString)(e)||!e.default).length>0?`, `:``)+(t.filter(e=>(0,r.isString)(e)||!e.default).length>0?`{ ${t.map(e=>(0,r.isString)(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),(0,o.createComponent)(a.Show,{get when(){return i.importedModules.size>0},get children(){return(0,o.createComponent)(s.ImportStatements,{get records(){return i.importedModules}})}}),(0,o.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptFile=l,exports.TypescriptFileHeader=u,exports.TypescriptFileHeaderImports=d;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../core/contexts/context.cjs`),n=require(`../../core/components/single-line-comment.cjs`),r=require(`../../core/components/source-file.cjs`);let i=require(`@stryke/string-format/title-case`),a=require(`@stryke/type-checks/is-string`),o=require(`@stryke/path/append`),s=require(`@alloy-js/core`),c=require(`@alloy-js/core/jsx-runtime`),l=require(`@alloy-js/typescript`),u=require(`@stryke/type-checks/is-boolean`);function d(e){let[{children:t,path:n,imports:i,tsx:a,header:d,hashbang:m},h]=(0,s.splitProps)(e,[`children`,`path`,`imports`,`tsx`,`header`,`hashbang`]),g=(0,s.useContext)(s.SourceDirectoryContext),_=(0,l.getSourceDirectoryData)(g),v=(0,o.appendPath)(n,g.path),y=new l.TSModuleScope(v,(0,s.useScope)());_.modules.add(y);let b=(0,s.useContext)(l.PackageContext);return b&&b.scope.addModule(y),e.export&&b&&((0,u.isBoolean)(e.export)?b.scope.addExport(v,y):b.scope.addExport(e.export,y)),(0,c.createComponent)(l.SourceFileContext.Provider,{value:{scope:y},get children(){return(0,c.createComponent)(s.Scope,{value:y,get children(){return(0,c.createComponent)(r.SourceFile,(0,c.mergeProps)(h,{path:v,get header(){return d??(0,c.createComponent)(f,{hashbang:m,get children(){return(0,c.createComponent)(p,{imports:i,scope:y})}})},filetype:a?`tsx`:`typescript`,children:t}))}})}})}function f(e){let{header:r,hashbang:a,disableEslint:o=!0,disableBiome:l=!0,disablePrettier:u=!1,children:d}=e,f=t.usePowerlines();return[(0,c.createComponent)(s.Show,{get when(){return!!a},get children(){return[(0,c.memo)(()=>a===!0?s.code`#!/usr/bin/env ${f?.config.mode===`development`?`-S NODE_OPTIONS=--enable-source-maps`:``} node`:a),(0,c.createIntrinsic)(`hbr`,{})]}}),(0,c.createComponent)(s.Show,{get when(){return!!r},get children(){return[r,(0,c.createIntrinsic)(`hbr`,{})]}}),(0,c.createIntrinsic)(`hbr`,{}),(0,c.createComponent)(s.Show,{get when(){return!!o},get children(){return[(0,c.createComponent)(n.SingleLineComment,{variant:`slash-star`,children:`eslint-disable`}),(0,c.createIntrinsic)(`hbr`,{})]}}),(0,c.createComponent)(s.Show,{get when(){return!!u},get children(){return[(0,c.createComponent)(n.SingleLineComment,{variant:`slash-star`,children:`prettier-ignore`}),(0,c.createIntrinsic)(`hbr`,{})]}}),(0,c.createComponent)(s.Show,{get when(){return!!l},get children(){return[(0,c.createComponent)(n.SingleLineComment,{children:`biome-ignore lint: disable`}),(0,c.createIntrinsic)(`hbr`,{})]}}),(0,c.createComponent)(s.Show,{get when(){return!!o||!!u||!!l},get children(){return(0,c.createIntrinsic)(`hbr`,{})}}),(0,c.createComponent)(s.Show,{get when(){return!!d},get children(){return[d,(0,c.createIntrinsic)(`hbr`,{})]}}),(0,c.createComponent)(n.SingleLineComment,{get children(){return s.code`Generated by ${(0,i.titleCase)(f?.config.framework)||`Powerlines`}`}}),(0,c.createIntrinsic)(`hbr`,{}),(0,c.createComponent)(n.SingleLineComment,{children:s.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`}),(0,c.createIntrinsic)(`hbr`,{})]}function p(e){let{imports:t}=e,n=(0,l.useSourceFile)(),r=e.scope??n.scope;return(0,c.createComponent)(s.Show,{get when(){return r.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[(0,c.createComponent)(s.Show,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>s.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,c.createComponent)(s.Show,{get when(){return r.importedModules.size>0},get children(){return(0,c.createComponent)(l.ImportStatements,{get records(){return r.importedModules}})}}),(0,c.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptFile=d,exports.TypescriptFileHeader=f,exports.TypescriptFileHeaderImports=p;
@@ -4,6 +4,7 @@ import { Children } from "@alloy-js/core";
4
4
 
5
5
  //#region ../alloy/src/typescript/components/typescript-file.d.ts
6
6
  type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
7
+ hashbang?: Children | true;
7
8
  header?: Children;
8
9
  imports?: TypescriptFileImports;
9
10
  export?: boolean | string;
@@ -5,6 +5,7 @@ import { TSModuleScope } from "@alloy-js/typescript";
5
5
 
6
6
  //#region ../alloy/src/typescript/components/typescript-file.d.ts
7
7
  type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & {
8
+ hashbang?: Children | true;
8
9
  header?: Children;
9
10
  imports?: TypescriptFileImports;
10
11
  export?: boolean | string;
@@ -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{isString as n}from"@stryke/type-checks/is-string";import{appendPath as r}from"@stryke/path/append";import{Scope as i,Show as a,SourceDirectoryContext as o,code as s,splitProps as c,useContext as l,useScope as u}from"@alloy-js/core";import{createComponent as d,createIntrinsic as f,mergeProps as p}from"@alloy-js/core/jsx-runtime";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:n,path:a,imports:s,tsx:f,header:m},y]=c(e,[`children`,`path`,`imports`,`tsx`,`header`]),x=l(o),w=v(x),T=r(a,x.path),E=new _(T,u());w.modules.add(E);let D=l(h);return D&&D.scope.addModule(E),e.export&&D&&(b(e.export)?D.scope.addExport(T,E):D.scope.addExport(e.export,E)),d(g.Provider,{value:{scope:E},get children(){return d(i,{value:E,get children(){return d(t,p(y,{path:T,get header(){return m??d(S,{get children(){return d(C,{imports:s,scope:E})}})},filetype:f?`tsx`:`typescript`,children:n}))}})}})}function S(t){let{header:n,disableEslint:r=!0,disableBiome:i=!0,disablePrettier:o=!1,children:c}=t;return[d(a,{get when(){return!!n},get children(){return[n,f(`hbr`,{})]}}),f(`hbr`,{}),d(a,{get when(){return!!r},get children(){return[d(e,{variant:`slash-star`,children:`eslint-disable`}),f(`hbr`,{})]}}),d(a,{get when(){return!!o},get children(){return[d(e,{variant:`slash-star`,children:`prettier-ignore`}),f(`hbr`,{})]}}),d(a,{get when(){return!!i},get children(){return[d(e,{children:`biome-ignore lint: disable`}),f(`hbr`,{})]}}),d(a,{get when(){return!!r||!!o||!!i},get children(){return f(`hbr`,{})}}),d(a,{get when(){return!!c},get children(){return[c,f(`hbr`,{})]}}),d(e,{children:s`Generated by Powerlines`}),f(`hbr`,{}),d(e,{children:s`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),f(`hbr`,{})]}function C(e){let{imports:t}=e,r=y(),i=e.scope??r.scope;return d(a,{get when(){return i.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[d(a,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>s`import ${t===null?``:t.filter(e=>!n(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!n(e)&&e.default).length>0&&t.filter(e=>n(e)||!e.default).length>0?`, `:``)+(t.filter(e=>n(e)||!e.default).length>0?`{ ${t.map(e=>n(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),d(a,{get when(){return i.importedModules.size>0},get children(){return d(m,{get records(){return i.importedModules}})}}),f(`hbr`,{})]}})}export{x as TypescriptFile,S as TypescriptFileHeader,C as TypescriptFileHeaderImports};
1
+ import{usePowerlines as e}from"../../core/contexts/context.mjs";import{SingleLineComment as t}from"../../core/components/single-line-comment.mjs";import{SourceFile as n}from"../../core/components/source-file.mjs";import{titleCase as r}from"@stryke/string-format/title-case";import{isString as i}from"@stryke/type-checks/is-string";import{appendPath as a}from"@stryke/path/append";import{Scope as o,Show as s,SourceDirectoryContext as c,code as l,splitProps as u,useContext as d,useScope as f}from"@alloy-js/core";import{createComponent as p,createIntrinsic as m,memo as h,mergeProps as g}from"@alloy-js/core/jsx-runtime";import{ImportStatements as _,PackageContext as v,SourceFileContext as y,TSModuleScope as b,getSourceDirectoryData as x,useSourceFile as S}from"@alloy-js/typescript";import{isBoolean as C}from"@stryke/type-checks/is-boolean";function w(e){let[{children:t,path:r,imports:i,tsx:s,header:l,hashbang:m},h]=u(e,[`children`,`path`,`imports`,`tsx`,`header`,`hashbang`]),_=d(c),S=x(_),w=a(r,_.path),D=new b(w,f());S.modules.add(D);let O=d(v);return O&&O.scope.addModule(D),e.export&&O&&(C(e.export)?O.scope.addExport(w,D):O.scope.addExport(e.export,D)),p(y.Provider,{value:{scope:D},get children(){return p(o,{value:D,get children(){return p(n,g(h,{path:w,get header(){return l??p(T,{hashbang:m,get children(){return p(E,{imports:i,scope:D})}})},filetype:s?`tsx`:`typescript`,children:t}))}})}})}function T(n){let{header:i,hashbang:a,disableEslint:o=!0,disableBiome:c=!0,disablePrettier:u=!1,children:d}=n,f=e();return[p(s,{get when(){return!!a},get children(){return[h(()=>a===!0?l`#!/usr/bin/env ${f?.config.mode===`development`?`-S NODE_OPTIONS=--enable-source-maps`:``} node`:a),m(`hbr`,{})]}}),p(s,{get when(){return!!i},get children(){return[i,m(`hbr`,{})]}}),m(`hbr`,{}),p(s,{get when(){return!!o},get children(){return[p(t,{variant:`slash-star`,children:`eslint-disable`}),m(`hbr`,{})]}}),p(s,{get when(){return!!u},get children(){return[p(t,{variant:`slash-star`,children:`prettier-ignore`}),m(`hbr`,{})]}}),p(s,{get when(){return!!c},get children(){return[p(t,{children:`biome-ignore lint: disable`}),m(`hbr`,{})]}}),p(s,{get when(){return!!o||!!u||!!c},get children(){return m(`hbr`,{})}}),p(s,{get when(){return!!d},get children(){return[d,m(`hbr`,{})]}}),p(t,{get children(){return l`Generated by ${r(f?.config.framework)||`Powerlines`}`}}),m(`hbr`,{}),p(t,{children:l`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`}),m(`hbr`,{})]}function E(e){let{imports:t}=e,n=S(),r=e.scope??n.scope;return p(s,{get when(){return r.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[p(s,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>l`import ${t===null?``:t.filter(e=>!i(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!i(e)&&e.default).length>0&&t.filter(e=>i(e)||!e.default).length>0?`, `:``)+(t.filter(e=>i(e)||!e.default).length>0?`{ ${t.map(e=>i(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),p(s,{get when(){return r.importedModules.size>0},get children(){return p(_,{get records(){return r.importedModules}})}}),m(`hbr`,{})]}})}export{w as TypescriptFile,T as TypescriptFileHeader,E as TypescriptFileHeaderImports};
@@ -1 +1 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/vendor/type.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core`),a=require(`@alloy-js/core/jsx-runtime`),o=require(`@alloy-js/typescript`),s=require(`@stryke/string-format/pascal-case`);function c(e){let[{name:t,reflection:c},u]=(0,i.splitProps)(e,[`name`,`reflection`]),d=(0,i.computed)(()=>(0,s.pascalCase)(t||c.getName())),f=c.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return(0,a.createComponent)(n.ReflectionClassContext.Provider,{value:{reflection:c},get children(){return[(0,a.createComponent)(r.TSDocReflectionClass,{}),(0,a.createComponent)(o.InterfaceDeclaration,(0,a.mergeProps)({export:!0,get name(){return d.value}},u,{get children(){return(0,a.createComponent)(i.For,{each:f,doubleHardline:!0,semicolon:!0,children:e=>(0,a.createComponent)(l,{property:e})})}}))]}})}function l(e){let[{property:s},c]=(0,i.splitProps)(e,[`property`]);return(0,a.createComponent)(n.ReflectionPropertyContext.Provider,{value:s,get children(){return[(0,a.createComponent)(r.TSDocReflectionProperty,{}),(0,a.createComponent)(o.InterfaceMember,(0,a.mergeProps)({get name(){return s.getNameAsString()},get readonly(){return s.isReadonly()},get optional(){return s.isOptional()},get nullish(){return s.isNullable()},get type(){return(0,t.type_exports.stringifyType)(s.getType())}},c))]}})}exports.TypeScriptInterface=c;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/vendor/type.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@stryke/type-checks/is-string`),a=require(`@alloy-js/core`),o=require(`@alloy-js/core/jsx-runtime`),s=require(`@alloy-js/typescript`),c=require(`@stryke/string-format/pascal-case`);function l(e){let[{name:t,reflection:l},d]=(0,a.splitProps)(e,[`name`,`reflection`]),f=(0,a.computed)(()=>(0,c.pascalCase)(((0,i.isString)(t)?t:t.toString())||l.getName())),p=l.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return(0,o.createComponent)(n.ReflectionClassContext.Provider,{value:{reflection:l},get children(){return[(0,o.createComponent)(r.TSDocReflectionClass,{}),(0,o.createComponent)(s.InterfaceDeclaration,(0,o.mergeProps)({export:!0,get name(){return f.value}},d,{get children(){return(0,o.createComponent)(a.For,{each:p,doubleHardline:!0,semicolon:!0,children:e=>(0,o.createComponent)(u,{property:e})})}}))]}})}function u(e){let[{property:i},c]=(0,a.splitProps)(e,[`property`]);return(0,o.createComponent)(n.ReflectionPropertyContext.Provider,{value:i,get children(){return[(0,o.createComponent)(r.TSDocReflectionProperty,{}),(0,o.createComponent)(s.InterfaceMember,(0,o.mergeProps)({get name(){return i.getNameAsString()},get readonly(){return i.isReadonly()},get optional(){return i.isOptional()},get nullish(){return i.isNullable()},get type(){return(0,t.type_exports.stringifyType)(i.getType())}},c))]}})}exports.TypeScriptInterface=l;
@@ -1 +1 @@
1
- import{type_exports as e}from"../../../../deepkit/src/vendor/type.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{For as a,computed as o,splitProps as s}from"@alloy-js/core";import{createComponent as c,mergeProps as l}from"@alloy-js/core/jsx-runtime";import{InterfaceDeclaration as u,InterfaceMember as d}from"@alloy-js/typescript";import{pascalCase as f}from"@stryke/string-format/pascal-case";function p(e){let[{name:n,reflection:i},d]=s(e,[`name`,`reflection`]),p=o(()=>f(n||i.getName())),h=i.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return c(t.Provider,{value:{reflection:i},get children(){return[c(r,{}),c(u,l({export:!0,get name(){return p.value}},d,{get children(){return c(a,{each:h,doubleHardline:!0,semicolon:!0,children:e=>c(m,{property:e})})}}))]}})}function m(t){let[{property:r},a]=s(t,[`property`]);return c(n.Provider,{value:r,get children(){return[c(i,{}),c(d,l({get name(){return r.getNameAsString()},get readonly(){return r.isReadonly()},get optional(){return r.isOptional()},get nullish(){return r.isNullable()},get type(){return(0,e.stringifyType)(r.getType())}},a))]}})}export{p as TypeScriptInterface};
1
+ import{type_exports as e}from"../../../../deepkit/src/vendor/type.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{isString as a}from"@stryke/type-checks/is-string";import{For as o,computed as s,splitProps as c}from"@alloy-js/core";import{createComponent as l,mergeProps as u}from"@alloy-js/core/jsx-runtime";import{InterfaceDeclaration as d,InterfaceMember as f}from"@alloy-js/typescript";import{pascalCase as p}from"@stryke/string-format/pascal-case";function m(e){let[{name:n,reflection:i},f]=c(e,[`name`,`reflection`]),m=s(()=>p((a(n)?n:n.toString())||i.getName())),g=i.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return l(t.Provider,{value:{reflection:i},get children(){return[l(r,{}),l(d,u({export:!0,get name(){return m.value}},f,{get children(){return l(o,{each:g,doubleHardline:!0,semicolon:!0,children:e=>l(h,{property:e})})}}))]}})}function h(t){let[{property:r},a]=c(t,[`property`]);return l(n.Provider,{value:r,get children(){return[l(i,{}),l(f,u({get name(){return r.getNameAsString()},get readonly(){return r.isReadonly()},get optional(){return r.isOptional()},get nullish(){return r.isNullable()},get type(){return(0,e.stringifyType)(r.getType())}},a))]}})}export{m as TypeScriptInterface};
@@ -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(`@stryke/string-format/camel-case`),a=require(`@alloy-js/core`),o=require(`@alloy-js/core/jsx-runtime`),s=require(`@stryke/type-checks/is-undefined`),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,i.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,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,o.createComponent)(c.TypeRefContext,{get children(){return[`: `,(0,o.createComponent)(p,{get children(){return e.type}})]}}):void 0;return(0,o.createComponent)(a.Show,{get when(){return!!e.reflection.value},get children(){return(0,o.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,o.createComponent)(a.Show,{get when(){return!!t.value&&!!u.value},get children(){return[(0,o.createComponent)(r.TSDocReflectionClass,{}),(0,o.createComponent)(a.Declaration,{symbol:h,get children(){return[(0,o.memo)(()=>e.export?`export `:``),(0,o.memo)(()=>e.default?`default `:``),g,` `,(0,o.createComponent)(a.Name,{}),_,` =`,` `,(0,o.createComponent)(m,{get children(){return e.initializer??e.children??(0,o.createComponent)(c.ObjectExpression,{get children(){return(0,o.createComponent)(a.For,{get each(){return f.value??[]},comma:!0,doubleHardline:!0,children:e=>(0,o.createComponent)(d,{property:e})})}})}})]}})]}}),(0,o.createIntrinsic)(`hbr`,{})]}})}})}function d(e){let[{property:i}]=(0,a.splitProps)(e,[`property`]);return(0,o.createComponent)(n.ReflectionPropertyContext.Provider,{value:i,get children(){return[(0,o.createComponent)(r.TSDocReflectionProperty,{}),(0,o.createComponent)(c.ObjectProperty,{get name(){return i.getNameAsString()},get value(){return t.stringifyDefaultValue(i)}}),(0,o.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(`@stryke/string-format/camel-case`),a=require(`@stryke/type-checks/is-string`),o=require(`@alloy-js/core`),s=require(`@alloy-js/core/jsx-runtime`),c=require(`@stryke/type-checks/is-undefined`),l=require(`@alloy-js/typescript`),u=require(`@stryke/string-format/pascal-case`);function d(e){if(!e.reflection?.value)return null;let t=(0,o.computed)(()=>(0,i.camelCase)(((0,a.isString)(e.name)?e.name:e.name.toString())||e.reflection.value.getName())),d=(0,o.computed)(()=>e.type||(0,u.pascalCase)(e.reflection.value.getName())),p=(0,o.computed)(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!(0,c.isUndefined)(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>(0,c.isUndefined)(t)&&!(0,c.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)),m=(0,o.createSymbolSlot)(),h=(0,o.createSymbolSlot)(),g=(0,l.createValueSymbol)(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?l.TSSymbolFlags.Nullish:l.TSSymbolFlags.None,type:e.type?m.firstSymbol:void 0,namePolicy:(0,l.useTSNamePolicy)().for(`variable`)});e.type||h.moveMembersTo(g);let _=e.var?`var`:e.let?`let`:`const`,v=e.type?(0,s.createComponent)(l.TypeRefContext,{get children(){return[`: `,(0,s.createComponent)(m,{get children(){return e.type}})]}}):void 0;return(0,s.createComponent)(o.Show,{get when(){return!!e.reflection.value},get children(){return(0,s.createComponent)(n.ReflectionClassContext.Provider,{get value(){return{reflection:e.reflection.value,override:{name:t.value,type:d.value,defaultValue:e.defaultValue?.value}}},get children(){return[(0,s.createComponent)(o.Show,{get when(){return!!t.value&&!!d.value},get children(){return[(0,s.createComponent)(r.TSDocReflectionClass,{}),(0,s.createComponent)(o.Declaration,{symbol:g,get children(){return[(0,s.memo)(()=>e.export?`export `:``),(0,s.memo)(()=>e.default?`default `:``),_,` `,(0,s.createComponent)(o.Name,{}),v,` =`,` `,(0,s.createComponent)(h,{get children(){return e.initializer??e.children??(0,s.createComponent)(l.ObjectExpression,{get children(){return(0,s.createComponent)(o.For,{get each(){return p.value??[]},comma:!0,doubleHardline:!0,children:e=>(0,s.createComponent)(f,{property:e})})}})}})]}})]}}),(0,s.createIntrinsic)(`hbr`,{})]}})}})}function f(e){let[{property:i}]=(0,o.splitProps)(e,[`property`]);return(0,s.createComponent)(n.ReflectionPropertyContext.Provider,{value:i,get children(){return[(0,s.createComponent)(r.TSDocReflectionProperty,{}),(0,s.createComponent)(l.ObjectProperty,{get name(){return i.getNameAsString()},get value(){return t.stringifyDefaultValue(i)}}),(0,s.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptObject=d;
@@ -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{camelCase as a}from"@stryke/string-format/camel-case";import{Declaration as o,For as s,Name as c,Show as l,computed as u,createSymbolSlot as d,splitProps as f}from"@alloy-js/core";import{createComponent as p,createIntrinsic as m,memo as h}from"@alloy-js/core/jsx-runtime";import{isUndefined as g}from"@stryke/type-checks/is-undefined";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=u(()=>a(e.name||e.reflection.value.getName())),i=u(()=>e.type||C(e.reflection.value.getName())),f=u(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!g(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>g(t)&&!g(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=d(),w=d(),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?p(b,{get children(){return[`: `,p(v,{get children(){return e.type}})]}}):void 0;return p(l,{get when(){return!!e.reflection.value},get children(){return p(t.Provider,{get value(){return{reflection:e.reflection.value,override:{name:n.value,type:i.value,defaultValue:e.defaultValue?.value}}},get children(){return[p(l,{get when(){return!!n.value&&!!i.value},get children(){return[p(r,{}),p(o,{symbol:E,get children(){return[h(()=>e.export?`export `:``),h(()=>e.default?`default `:``),D,` `,p(c,{}),O,` =`,` `,p(w,{get children(){return e.initializer??e.children??p(_,{get children(){return p(s,{get each(){return f.value??[]},comma:!0,doubleHardline:!0,children:e=>p(T,{property:e})})}})}})]}})]}}),m(`hbr`,{})]}})}})}function T(t){let[{property:r}]=f(t,[`property`]);return p(n.Provider,{value:r,get children(){return[p(i,{}),p(v,{get name(){return r.getNameAsString()},get value(){return e(r)}}),m(`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{camelCase as a}from"@stryke/string-format/camel-case";import{isString as o}from"@stryke/type-checks/is-string";import{Declaration as s,For as c,Name as l,Show as u,computed as d,createSymbolSlot as f,splitProps as p}from"@alloy-js/core";import{createComponent as m,createIntrinsic as h,memo as g}from"@alloy-js/core/jsx-runtime";import{isUndefined as _}from"@stryke/type-checks/is-undefined";import{ObjectExpression as v,ObjectProperty as y,TSSymbolFlags as b,TypeRefContext as x,createValueSymbol as S,useTSNamePolicy as C}from"@alloy-js/typescript";import{pascalCase as w}from"@stryke/string-format/pascal-case";function T(e){if(!e.reflection?.value)return null;let n=d(()=>a((o(e.name)?e.name:e.name.toString())||e.reflection.value.getName())),i=d(()=>e.type||w(e.reflection.value.getName())),p=d(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!_(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>_(t)&&!_(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)),y=f(),T=f(),D=S(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?b.Nullish:b.None,type:e.type?y.firstSymbol:void 0,namePolicy:C().for(`variable`)});e.type||T.moveMembersTo(D);let O=e.var?`var`:e.let?`let`:`const`,k=e.type?m(x,{get children(){return[`: `,m(y,{get children(){return e.type}})]}}):void 0;return m(u,{get when(){return!!e.reflection.value},get children(){return m(t.Provider,{get value(){return{reflection:e.reflection.value,override:{name:n.value,type:i.value,defaultValue:e.defaultValue?.value}}},get children(){return[m(u,{get when(){return!!n.value&&!!i.value},get children(){return[m(r,{}),m(s,{symbol:D,get children(){return[g(()=>e.export?`export `:``),g(()=>e.default?`default `:``),O,` `,m(l,{}),k,` =`,` `,m(T,{get children(){return e.initializer??e.children??m(v,{get children(){return m(c,{get each(){return p.value??[]},comma:!0,doubleHardline:!0,children:e=>m(E,{property:e})})}})}})]}})]}}),h(`hbr`,{})]}})}})}function E(t){let[{property:r}]=p(t,[`property`]);return m(n.Provider,{value:r,get children(){return[m(i,{}),m(y,{get name(){return r.getNameAsString()},get value(){return e(r)}}),h(`hbr`,{})]}})}export{T as TypescriptObject};
@@ -1,6 +1,6 @@
1
1
  import { DeclareBabelTransformPluginReturn } from "../powerlines/src/types/babel.mjs";
2
+ import "../powerlines/src/index.mjs";
2
3
  import { EnvPluginContext, EnvPluginResolvedConfig } from "../types/plugin.mjs";
3
- import "../powerlines/src/types/index.mjs";
4
4
  import "../index.mjs";
5
5
 
6
6
  //#region src/babel/plugin.d.ts
@@ -0,0 +1 @@
1
+ const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`automd`);const r=e=>(0,n.defineGenerator)({name:`env`,async generate(){let n=(0,t.joinPaths)(e.config.projectRoot,`docs`,`generated`,`env.md`);return e.fs.existsSync(n)?{contents:await e.fs.read(n)||``}:{contents:``}}});exports.env=r;
@@ -0,0 +1,14 @@
1
+ import { UnresolvedContext } from "../powerlines/src/types/context.cjs";
2
+ import * as automd0 from "automd";
3
+
4
+ //#region src/helpers/automd-generator.d.ts
5
+
6
+ /**
7
+ * AutoMD generator to generate environment variable documentation
8
+ *
9
+ * @param context - The generator context.
10
+ * @returns The generated documentation content.
11
+ */
12
+ declare const env: (context: UnresolvedContext) => automd0.Generator;
13
+ //#endregion
14
+ export { env };
@@ -0,0 +1,14 @@
1
+ import { UnresolvedContext } from "../powerlines/src/types/context.mjs";
2
+ import * as automd0 from "automd";
3
+
4
+ //#region src/helpers/automd-generator.d.ts
5
+
6
+ /**
7
+ * AutoMD generator to generate environment variable documentation
8
+ *
9
+ * @param context - The generator context.
10
+ * @returns The generated documentation content.
11
+ */
12
+ declare const env: (context: UnresolvedContext) => automd0.Generator;
13
+ //#endregion
14
+ export { env };
@@ -0,0 +1 @@
1
+ import{joinPaths as e}from"@stryke/path/join-paths";import{defineGenerator as t}from"automd";const n=n=>t({name:`env`,async generate(){let t=e(n.config.projectRoot,`docs`,`generated`,`env.md`);return n.fs.existsSync(t)?{contents:await n.fs.read(t)||``}:{contents:``}}});export{n as env};
@@ -1,6 +1,6 @@
1
1
  import { EnvironmentResolvedConfig } from "../powerlines/src/types/resolved.mjs";
2
+ import "../powerlines/src/index.mjs";
2
3
  import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.mjs";
3
- import "../powerlines/src/types/index.mjs";
4
4
  import { DotenvParseOutput } from "@stryke/env/types";
5
5
 
6
6
  //#region src/helpers/load.d.ts
@@ -1,5 +1,5 @@
1
- import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
2
1
  import { Context, UnresolvedContext } from "../powerlines/src/types/context.cjs";
2
+ import { type_d_exports } from "../deepkit/src/vendor/type.cjs";
3
3
  import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.cjs";
4
4
  import { TypeDefinition } from "@stryke/types/configuration";
5
5
 
@@ -1,5 +1,5 @@
1
- import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
2
1
  import { Context, UnresolvedContext } from "../powerlines/src/types/context.mjs";
2
+ import { type_d_exports } from "../deepkit/src/vendor/type.mjs";
3
3
  import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.mjs";
4
4
  import { TypeDefinition } from "@stryke/types/configuration";
5
5
 
package/dist/index.cjs CHANGED
@@ -1,16 +1,10 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deepkit/src/vendor/type.cjs`),n=require(`./helpers/reflect.cjs`),r=require(`./helpers/persistence.cjs`),i=require(`./helpers/template-helpers.cjs`),a=require(`./helpers/source-file-env.cjs`),o=require(`./helpers/load.cjs`),s=require(`./helpers/create-reflection-resource.cjs`);require(`./helpers/index.cjs`);const c=require(`./components/docs.cjs`),l=require(`./components/env.cjs`);require(`./components/index.cjs`);const u=require(`./babel/plugin.cjs`);require(`./babel/index.cjs`);const d=require(`./alloy/src/create-plugin.cjs`),f=require(`./plugin-babel/src/index.cjs`);let p=require(`defu`);p=e.__toESM(p);let m=require(`@stryke/convert/parse-type-definition`),h=require(`@storm-software/config-tools/types`),g=require(`@stryke/convert/to-array`),_=require(`@stryke/path/is-parent-path`),v=require(`@stryke/env/types`),y=require(`@alloy-js/core/jsx-runtime`),b=require(`@stryke/path/join`),x=require(`@stryke/fs/exists`),S=require(`@stryke/fs/helpers`),C=require(`@stryke/string-format/constant-case`);const w=d.createAlloyPlugin((e={})=>({name:`env`,dependsOn:[f.default(e.babel)],async config(){this.log(h.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,p.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[u.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,m.parseTypeDefinition)(t.env.types);else{this.log(h.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await r.getEnvDefaultTypeDefinition(this);t.env.types=(0,m.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,m.parseTypeDefinition)(t.env.secrets);else{let e=await r.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,m.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,g.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,C.constantCase)(t);return e.includes(n)||e.push(n),e},[...v.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(h.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,p.default)({parsed:await o.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,x.existsSync)(r.getEnvTypeReflectionsPath(this,`env`)))this.log(h.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await r.readEnvTypeReflection(this,`env`),(0,x.existsSync)(r.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await r.readEnvReflection(this)),(0,x.existsSync)(r.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await r.readEnvTypeReflection(this,`secrets`)),(0,x.existsSync)(r.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await r.readSecretsReflection(this));else{if(this.env.types.env=await n.reflectEnv(this,this.config.env.types?.file?(0,_.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 r.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await n.reflectSecrets(this,this.config.env.secrets?.file?(0,_.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 r.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(h.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 o.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 r.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await r.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 r.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(h.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),(0,y.createComponent)(l.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(h.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,b.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,x.existsSync)(e)||await(0,S.createDirectory)(e);let n=await r.readEnvTypeReflection(this,`env`),i=(0,b.joinPaths)(e,`env.md`);this.log(h.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${i}"`),await this.fs.write(i,`<!-- Generated by Powerlines -->
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deepkit/src/vendor/type.cjs`),n=require(`./helpers/reflect.cjs`),r=require(`./helpers/persistence.cjs`),i=require(`./helpers/template-helpers.cjs`),a=require(`./helpers/source-file-env.cjs`),o=require(`./helpers/load.cjs`),s=require(`./helpers/create-reflection-resource.cjs`);require(`./helpers/index.cjs`);const c=require(`./helpers/automd-generator.cjs`),l=require(`./components/docs.cjs`),u=require(`./components/env.cjs`);require(`./components/index.cjs`);const d=require(`./babel/plugin.cjs`);require(`./babel/index.cjs`);const f=require(`./alloy/src/create-plugin.cjs`),p=require(`./plugin-automd/src/index.cjs`),m=require(`./plugin-babel/src/index.cjs`);let h=require(`@stryke/string-format/title-case`),g=require(`defu`);g=e.__toESM(g);let _=require(`@stryke/convert/parse-type-definition`),v=require(`@storm-software/config-tools/types`),y=require(`@stryke/convert/to-array`),b=require(`@stryke/path/is-parent-path`),x=require(`@stryke/env/types`),S=require(`@alloy-js/core/jsx-runtime`),C=require(`@stryke/path/join`),w=require(`@stryke/fs/exists`),T=require(`@stryke/fs/helpers`),E=require(`@stryke/string-format/constant-case`);const D=f.createAlloyPlugin((e={})=>({name:`env`,async config(){this.log(v.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,g.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[d.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,_.parseTypeDefinition)(t.env.types);else{this.log(v.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await r.getEnvDefaultTypeDefinition(this);t.env.types=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,_.parseTypeDefinition)(t.env.secrets);else{let e=await r.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,_.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,y.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,E.constantCase)(t);return e.includes(n)||e.push(n),e},[...x.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(v.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,g.default)({parsed:await o.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,w.existsSync)(r.getEnvTypeReflectionsPath(this,`env`)))this.log(v.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await r.readEnvTypeReflection(this,`env`),(0,w.existsSync)(r.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await r.readEnvReflection(this)),(0,w.existsSync)(r.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await r.readEnvTypeReflection(this,`secrets`)),(0,w.existsSync)(r.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await r.readSecretsReflection(this));else{if(this.env.types.env=await n.reflectEnv(this,this.config.env.types?.file?(0,b.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await r.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await n.reflectSecrets(this,this.config.env.secrets?.file?(0,b.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await r.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(v.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 o.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 r.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await r.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 r.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(v.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),(0,S.createComponent)(u.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(v.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,C.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,w.existsSync)(e)||await(0,T.createDirectory)(e);let n=await r.readEnvTypeReflection(this,`env`),i=(0,C.joinPaths)(e,`env.md`);this.log(v.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${i}"`),await this.fs.write(i,`<!-- Generated by ${(0,h.titleCase)(this.config.framework)||`Powerlines`} -->
2
2
 
3
- # Environment variables configuration
3
+ Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
4
 
5
- Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project.
6
-
7
- ## Environment Configuration
8
-
9
- The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
10
-
11
- | Name | Description | Type | Default Value | Required |
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(`
5
+ | Name | Description | Type | Default Value | Required |
6
+ | ---- | ----------- | ---- | ------------- | :------: |
7
+ ${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
14
8
  `,``)??``).trim()} | ${(0,t.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
15
9
  `)}
16
- `)},async buildEnd(){let e=r.getEnvReflectionsPath(this,`env`);this.log(h.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await r.writeEnvReflection(this,this.env.used.env,`env`)}}));var T=w;exports.BaseEnv=n.BaseEnv,exports.BaseSecrets=n.BaseSecrets,exports.EnvBuiltin=l.EnvBuiltin,exports.EnvDocs=c.EnvDocs,exports.EnvTypeDefinition=l.EnvTypeDefinition,exports.createEnvReflection=n.createEnvReflection,exports.createReflectionResource=s.createReflectionResource,exports.createSecretsReflection=n.createSecretsReflection,exports.createTemplateReflection=i.createTemplateReflection,exports.default=T,exports.envBabelPlugin=u.envBabelPlugin,exports.formatEnvField=a.formatEnvField,exports.getEnvDefaultTypeDefinition=r.getEnvDefaultTypeDefinition,exports.getEnvReflectionsPath=r.getEnvReflectionsPath,exports.getEnvTypeReflectionsPath=r.getEnvTypeReflectionsPath,exports.getSecretsDefaultTypeDefinition=r.getSecretsDefaultTypeDefinition,exports.loadEnv=o.loadEnv,exports.loadEnvFromContext=o.loadEnvFromContext,exports.mergeEnvReflections=n.mergeEnvReflections,exports.mergeSecretsReflections=n.mergeSecretsReflections,exports.plugin=w,exports.readEnvReflection=r.readEnvReflection,exports.readEnvTypeReflection=r.readEnvTypeReflection,exports.readSecretsReflection=r.readSecretsReflection,exports.reflectEnv=n.reflectEnv,exports.reflectSecrets=n.reflectSecrets,exports.removeEnvPrefix=a.removeEnvPrefix,exports.resolveRuntimeTypeFile=r.resolveRuntimeTypeFile,exports.writeEnvReflection=r.writeEnvReflection,exports.writeEnvReflectionSync=r.writeEnvReflectionSync,exports.writeEnvTypeReflection=r.writeEnvTypeReflection;
10
+ `)},async buildEnd(){let e=r.getEnvReflectionsPath(this,`env`);this.log(v.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await r.writeEnvReflection(this,this.env.used.env,`env`)}})),O=(e={})=>[m.default(e.babel),D(e),{name:`env:automd-generator`,config(){return{automd:(0,g.default)(e.automd??{},{generators:{env:c.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},p.default(e.automd)];var k=O;exports.BaseEnv=n.BaseEnv,exports.BaseSecrets=n.BaseSecrets,exports.EnvBuiltin=u.EnvBuiltin,exports.EnvDocs=l.EnvDocs,exports.EnvTypeDefinition=u.EnvTypeDefinition,exports.createEnvReflection=n.createEnvReflection,exports.createReflectionResource=s.createReflectionResource,exports.createSecretsReflection=n.createSecretsReflection,exports.createTemplateReflection=i.createTemplateReflection,exports.default=k,exports.envBabelPlugin=d.envBabelPlugin,exports.formatEnvField=a.formatEnvField,exports.getEnvDefaultTypeDefinition=r.getEnvDefaultTypeDefinition,exports.getEnvReflectionsPath=r.getEnvReflectionsPath,exports.getEnvTypeReflectionsPath=r.getEnvTypeReflectionsPath,exports.getSecretsDefaultTypeDefinition=r.getSecretsDefaultTypeDefinition,exports.loadEnv=o.loadEnv,exports.loadEnvFromContext=o.loadEnvFromContext,exports.mergeEnvReflections=n.mergeEnvReflections,exports.mergeSecretsReflections=n.mergeSecretsReflections,exports.plugin=O,exports.readEnvReflection=r.readEnvReflection,exports.readEnvTypeReflection=r.readEnvTypeReflection,exports.readSecretsReflection=r.readSecretsReflection,exports.reflectEnv=n.reflectEnv,exports.reflectSecrets=n.reflectSecrets,exports.removeEnvPrefix=a.removeEnvPrefix,exports.resolveRuntimeTypeFile=r.resolveRuntimeTypeFile,exports.writeEnvReflection=r.writeEnvReflection,exports.writeEnvReflectionSync=r.writeEnvReflectionSync,exports.writeEnvTypeReflection=r.writeEnvTypeReflection;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Plugin } from "./powerlines/src/types/plugin.cjs";
2
2
  import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.cjs";
3
3
  import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.cjs";
4
- import { AlloyPluginBuilder, AlloyPluginOptions } from "./alloy/src/types/plugin.cjs";
5
4
  import { EnvDocs } from "./components/docs.cjs";
6
5
  import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./components/env.cjs";
7
6
  import { createReflectionResource } from "./helpers/create-reflection-resource.cjs";
@@ -16,6 +15,6 @@ import { envBabelPlugin } from "./babel/plugin.cjs";
16
15
  /**
17
16
  * A Powerlines plugin to inject environment variables into the source code.
18
17
  */
19
- declare const plugin: <T extends EnvPluginContext<EnvPluginResolvedConfig>>(options: Parameters<AlloyPluginBuilder<EnvPluginContext<EnvPluginResolvedConfig>>>[0] & AlloyPluginOptions) => Plugin<T>;
18
+ declare const plugin: <TContext extends EnvPluginContext = EnvPluginContext>(options?: EnvPluginOptions) => Plugin<TContext>[];
20
19
  //#endregion
21
20
  export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, EnvBuiltin, EnvBuiltinProps, EnvDocs, EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, EnvTypeDefinition, SecretsInterface, __ΩCreateEnvReflectionOptions, __ΩEnvBuiltinProps, __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType, __ΩSecretsInterface, createEnvReflection, createReflectionResource, createSecretsReflection, createTemplateReflection, plugin as default, plugin, envBabelPlugin, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
package/dist/index.d.mts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { Plugin } from "./powerlines/src/types/plugin.mjs";
2
+ import "./powerlines/src/index.mjs";
2
3
  import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.mjs";
3
4
  import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.mjs";
4
- import "./types/index.mjs";
5
- import { AlloyPluginBuilder, AlloyPluginOptions } from "./alloy/src/types/plugin.mjs";
6
- import "./powerlines/src/types/index.mjs";
7
5
  import { EnvDocs } from "./components/docs.mjs";
8
6
  import { EnvBuiltin, EnvBuiltinProps, EnvTypeDefinition, __ΩEnvBuiltinProps } from "./components/env.mjs";
9
7
  import "./components/index.mjs";
@@ -14,6 +12,7 @@ import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflecti
14
12
  import { formatEnvField, removeEnvPrefix } from "./helpers/source-file-env.mjs";
15
13
  import { createTemplateReflection } from "./helpers/template-helpers.mjs";
16
14
  import "./helpers/index.mjs";
15
+ import "./types/index.mjs";
17
16
  import { envBabelPlugin } from "./babel/plugin.mjs";
18
17
  import "./babel/index.mjs";
19
18
 
@@ -21,6 +20,6 @@ import "./babel/index.mjs";
21
20
  /**
22
21
  * A Powerlines plugin to inject environment variables into the source code.
23
22
  */
24
- declare const plugin: <T extends EnvPluginContext<EnvPluginResolvedConfig>>(options: Parameters<AlloyPluginBuilder<EnvPluginContext<EnvPluginResolvedConfig>>>[0] & AlloyPluginOptions) => Plugin<T>;
23
+ declare const plugin: <TContext extends EnvPluginContext = EnvPluginContext>(options?: EnvPluginOptions) => Plugin<TContext>[];
25
24
  //#endregion
26
25
  export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, EnvBuiltin, EnvBuiltinProps, EnvDocs, EnvInterface, EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, EnvTypeDefinition, SecretsInterface, __ΩCreateEnvReflectionOptions, __ΩEnvBuiltinProps, __ΩEnvInterface, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType, __ΩSecretsInterface, createEnvReflection, createReflectionResource, createSecretsReflection, createTemplateReflection, plugin as default, plugin, envBabelPlugin, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
package/dist/index.mjs CHANGED
@@ -1,16 +1,10 @@
1
- import{type_exports as e}from"./deepkit/src/vendor/type.mjs";import{BaseEnv as t,BaseSecrets as n,createEnvReflection as r,createSecretsReflection as i,mergeEnvReflections as a,mergeSecretsReflections as o,reflectEnv as s,reflectSecrets as c}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as l,getEnvReflectionsPath as u,getEnvTypeReflectionsPath as d,getSecretsDefaultTypeDefinition as f,readEnvReflection as p,readEnvTypeReflection as m,readSecretsReflection as h,resolveRuntimeTypeFile as g,writeEnvReflection as _,writeEnvReflectionSync as v,writeEnvTypeReflection as y}from"./helpers/persistence.mjs";import{createTemplateReflection as b}from"./helpers/template-helpers.mjs";import{formatEnvField as x,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"./helpers/index.mjs";import{EnvDocs as E}from"./components/docs.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import"./components/index.mjs";import{envBabelPlugin as k}from"./babel/plugin.mjs";import"./babel/index.mjs";import{createAlloyPlugin as A}from"./alloy/src/create-plugin.mjs";import j from"./plugin-babel/src/index.mjs";import M from"defu";import{parseTypeDefinition as N}from"@stryke/convert/parse-type-definition";import{LogLevelLabel as P}from"@storm-software/config-tools/types";import{toArray as F}from"@stryke/convert/to-array";import{isParentPath as I}from"@stryke/path/is-parent-path";import{ENV_PREFIXES as L}from"@stryke/env/types";import{createComponent as R}from"@alloy-js/core/jsx-runtime";import{joinPaths as z}from"@stryke/path/join";import{existsSync as B}from"@stryke/fs/exists";import{createDirectory as V}from"@stryke/fs/helpers";import{constantCase as H}from"@stryke/string-format/constant-case";const U=A((t={})=>({name:`env`,dependsOn:[j(t.babel)],async config(){this.log(P.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:M(t,{types:{},prefix:[]}),transform:{babel:{plugins:[k]}}};if(e.env.types)e.env.types=N(e.env.types);else{this.log(P.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await l(this);e.env.types=N(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=N(e.env.secrets);else{let t=await f(this);e.env.secrets=N(`${t.file}#${t.name}`)}return e.env.prefix=F(e.env.prefix??[]).reduce((e,t)=>{let n=H(t);return e.includes(n)||e.push(n),e},[...L,`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(P.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=M({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&&B(d(this,`env`)))this.log(P.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await m(this,`env`),B(u(this,`env`))&&(this.env.used.env=await p(this)),B(d(this,`secrets`))&&(this.env.types.secrets=await m(this,`secrets`)),B(u(this,`secrets`))&&(this.env.used.secrets=await h(this));else{if(this.env.types.env=await s(this,this.config.env.types?.file?I(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:z(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 y(this,this.env.types.env,`env`),this.env.types.secrets=await c(this,this.config.env.secrets?.file?I(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:z(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 y(this,this.env.types.secrets,`secrets`),this.log(P.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 _(this,this.env.used.env,`env`),this.env.types.secrets&&(await y(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 _(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(P.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),R(D,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(P.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=z(this.config.projectRoot,`docs`,`generated`);B(t)||await V(t);let n=await m(this,`env`),r=z(t,`env.md`);this.log(P.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{BaseEnv as t,BaseSecrets as n,createEnvReflection as r,createSecretsReflection as i,mergeEnvReflections as a,mergeSecretsReflections as o,reflectEnv as s,reflectSecrets as c}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as l,getEnvReflectionsPath as u,getEnvTypeReflectionsPath as d,getSecretsDefaultTypeDefinition as f,readEnvReflection as p,readEnvTypeReflection as m,readSecretsReflection as h,resolveRuntimeTypeFile as g,writeEnvReflection as _,writeEnvReflectionSync as v,writeEnvTypeReflection as y}from"./helpers/persistence.mjs";import{createTemplateReflection as b}from"./helpers/template-helpers.mjs";import{formatEnvField as x,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"./helpers/index.mjs";import{env as E}from"./helpers/automd-generator.mjs";import{EnvDocs as D}from"./components/docs.mjs";import{EnvBuiltin as O,EnvTypeDefinition as k}from"./components/env.mjs";import"./components/index.mjs";import{envBabelPlugin as A}from"./babel/plugin.mjs";import"./babel/index.mjs";import{createAlloyPlugin as j}from"./alloy/src/create-plugin.mjs";import M from"./plugin-automd/src/index.mjs";import N from"./plugin-babel/src/index.mjs";import{titleCase as P}from"@stryke/string-format/title-case";import F from"defu";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{LogLevelLabel as L}from"@storm-software/config-tools/types";import{toArray as R}from"@stryke/convert/to-array";import{isParentPath as z}from"@stryke/path/is-parent-path";import{ENV_PREFIXES as B}from"@stryke/env/types";import{createComponent as V}from"@alloy-js/core/jsx-runtime";import{joinPaths as H}from"@stryke/path/join";import{existsSync as U}from"@stryke/fs/exists";import{createDirectory as W}from"@stryke/fs/helpers";import{constantCase as G}from"@stryke/string-format/constant-case";const K=j((t={})=>({name:`env`,async config(){this.log(L.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:F(t,{types:{},prefix:[]}),transform:{babel:{plugins:[A]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(L.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await l(this);e.env.types=I(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=I(e.env.secrets);else{let t=await f(this);e.env.secrets=I(`${t.file}#${t.name}`)}return e.env.prefix=R(e.env.prefix??[]).reduce((e,t)=>{let n=G(t);return e.includes(n)||e.push(n),e},[...B,`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(L.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=F({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&&U(d(this,`env`)))this.log(L.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await m(this,`env`),U(u(this,`env`))&&(this.env.used.env=await p(this)),U(d(this,`secrets`))&&(this.env.types.secrets=await m(this,`secrets`)),U(u(this,`secrets`))&&(this.env.used.secrets=await h(this));else{if(this.env.types.env=await s(this,this.config.env.types?.file?z(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:H(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 y(this,this.env.types.env,`env`),this.env.types.secrets=await c(this,this.config.env.secrets?.file?z(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:H(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 y(this,this.env.types.secrets,`secrets`),this.log(L.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 _(this,this.env.used.env,`env`),this.env.types.secrets&&(await y(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 _(this,this.env.used.secrets,`secrets`))}},render(){let e=this;return this.log(L.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),V(O,{get defaultConfig(){return e.config.env.defaultConfig}})},async docs(){this.log(L.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=H(this.config.projectRoot,`docs`,`generated`);U(t)||await W(t);let n=await m(this,`env`),r=H(t,`env.md`);this.log(L.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${P(this.config.framework)||`Powerlines`} -->
2
2
 
3
- # Environment variables configuration
3
+ Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
4
 
5
- Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project.
6
-
7
- ## Environment Configuration
8
-
9
- The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
10
-
11
- | Name | Description | Type | Default Value | Required |
12
- | ---- | ----------- | ---- | ------------- | :------: |
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(`
5
+ | Name | Description | Type | Default Value | Required |
6
+ | ---- | ----------- | ---- | ------------- | :------: |
7
+ ${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
14
8
  `,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
15
9
  `)}
16
- `)},async buildEnd(){let e=u(this,`env`);this.log(P.TRACE,`Writing env reflection types to ${e}.`),await _(this,this.env.used.env,`env`)}}));var W=U;export{t as BaseEnv,n as BaseSecrets,D as EnvBuiltin,E as EnvDocs,O as EnvTypeDefinition,r as createEnvReflection,T as createReflectionResource,i as createSecretsReflection,b as createTemplateReflection,W as default,k as envBabelPlugin,x as formatEnvField,l as getEnvDefaultTypeDefinition,u as getEnvReflectionsPath,d as getEnvTypeReflectionsPath,f as getSecretsDefaultTypeDefinition,C as loadEnv,w as loadEnvFromContext,a as mergeEnvReflections,o as mergeSecretsReflections,U as plugin,p as readEnvReflection,m as readEnvTypeReflection,h as readSecretsReflection,s as reflectEnv,c as reflectSecrets,S as removeEnvPrefix,g as resolveRuntimeTypeFile,_ as writeEnvReflection,v as writeEnvReflectionSync,y as writeEnvTypeReflection};
10
+ `)},async buildEnd(){let e=u(this,`env`);this.log(L.TRACE,`Writing env reflection types to ${e}.`),await _(this,this.env.used.env,`env`)}})),q=(e={})=>[N(e.babel),K(e),{name:`env:automd-generator`,config(){return{automd:F(e.automd??{},{generators:{env:E(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},M(e.automd)];var J=q;export{t as BaseEnv,n as BaseSecrets,O as EnvBuiltin,D as EnvDocs,k as EnvTypeDefinition,r as createEnvReflection,T as createReflectionResource,i as createSecretsReflection,b as createTemplateReflection,J as default,A as envBabelPlugin,x as formatEnvField,l as getEnvDefaultTypeDefinition,u as getEnvReflectionsPath,d as getEnvTypeReflectionsPath,f as getSecretsDefaultTypeDefinition,C as loadEnv,w as loadEnvFromContext,a as mergeEnvReflections,o as mergeSecretsReflections,q as plugin,p as readEnvReflection,m as readEnvTypeReflection,h as readSecretsReflection,s as reflectEnv,c as reflectSecrets,S as removeEnvPrefix,g as resolveRuntimeTypeFile,_ as writeEnvReflection,v as writeEnvReflectionSync,y as writeEnvTypeReflection};
@@ -0,0 +1 @@
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/path/replace`),i=require(`@stryke/convert/to-array`),a=require(`@stryke/fs/is-file`),o=require(`@stryke/fs/list-files`),s=require(`@stryke/path/append`),c=require(`c12`),l=require(`automd`),u=require(`@stryke/path/is-type`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let r=await(0,l.loadConfig)((0,t.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!r.prefix||!Array.isArray(r.prefix))&&(r.prefix=(0,i.toArray)(r.prefix??[])),r.prefix.includes(`automd`)||r.prefix.push(`automd`),r.prefix.includes(`powerlines`)||r.prefix.push(`powerlines`),{automd:(0,n.default)(r??{},{configFile:e.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!(0,i.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,i.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,c.loadConfig)({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=(0,l.resolveConfig)((0,n.default)(this.config.automd,{...e,prefix:(0,i.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,o.listFiles)((0,u.isAbsolutePath)(e)?e:(0,s.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,u.isAbsolutePath)(e)?e:(0,s.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,u.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,s.appendPath)(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:(0,d.default)(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let n=await(0,l.transform)(t,this.config.automd);if(n.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);n.hasChanged&&await this.fs.write((0,s.appendPath)(this.config.automd.output?(0,a.isDirectory)(this.config.automd.output)?(0,r.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),n.contents)}}))}});var p=f;exports.default=p;
@@ -0,0 +1 @@
1
+ import{joinPaths as e}from"@stryke/path/join-paths";import t from"defu";import{replacePath as n}from"@stryke/path/replace";import{toArray as r}from"@stryke/convert/to-array";import{isDirectory as i}from"@stryke/fs/is-file";import{listFiles as a}from"@stryke/fs/list-files";import{appendPath as o}from"@stryke/path/append";import{loadConfig as s}from"c12";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{isAbsolutePath as d}from"@stryke/path/is-type";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let n=await c(e(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=r(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:t(n??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!r(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=r(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await s({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(t(this.config.automd,{...e,prefix:r(e.prefix??[])}))}this.config.automd.input=(await Promise.all(r(this.config.automd.input).map(async e=>e.includes(`*`)?a(d(e)?e:o(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):d(e)?e:o(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!d(this.config.automd.output)&&(this.config.automd.output=o(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:f(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all(r(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let r=await u(t,this.config.automd);if(r.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);r.hasChanged&&await this.fs.write(o(this.config.automd.output?i(this.config.automd.output)?n(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),r.contents)}}))}});export{p as default};
@@ -0,0 +1,38 @@
1
+ import { TOCOptions } from "./toc.cjs";
2
+ import { Config } from "automd";
3
+
4
+ //#region ../plugin-automd/src/types/plugin.d.ts
5
+
6
+ type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
7
+ /**
8
+ * Path to the AutoMD configuration file.
9
+ *
10
+ * @remarks
11
+ * If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
12
+ */
13
+ configFile?: string;
14
+ /**
15
+ * An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
16
+ *
17
+ * @defaultValue true
18
+ */
19
+ allowIssues?: boolean;
20
+ /**
21
+ * Alternate prefix strings to use for finding generators
22
+ *
23
+ * @remarks
24
+ * By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
25
+ *
26
+ * @defaultValue ["automd", "powerlines", "\{framework\}"]
27
+ */
28
+ prefix?: string | string[];
29
+ /**
30
+ * Table of Contents generator options
31
+ *
32
+ * @remarks
33
+ * If set to `false`, the built-in Table of Contents generator will be disabled.
34
+ */
35
+ toc?: false | TOCOptions;
36
+ };
37
+ //#endregion
38
+ export { AutoMDPluginOptions };
@@ -0,0 +1,40 @@
1
+ import "../../../powerlines/src/types/resolved.mjs";
2
+ import "../../../powerlines/src/types/config.mjs";
3
+ import "../../../powerlines/src/types/context.mjs";
4
+ import { TOCOptions } from "./toc.mjs";
5
+ import { Config } from "automd";
6
+
7
+ //#region ../plugin-automd/src/types/plugin.d.ts
8
+ type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
9
+ /**
10
+ * Path to the AutoMD configuration file.
11
+ *
12
+ * @remarks
13
+ * If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
14
+ */
15
+ configFile?: string;
16
+ /**
17
+ * An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
18
+ *
19
+ * @defaultValue true
20
+ */
21
+ allowIssues?: boolean;
22
+ /**
23
+ * Alternate prefix strings to use for finding generators
24
+ *
25
+ * @remarks
26
+ * By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
27
+ *
28
+ * @defaultValue ["automd", "powerlines", "\{framework\}"]
29
+ */
30
+ prefix?: string | string[];
31
+ /**
32
+ * Table of Contents generator options
33
+ *
34
+ * @remarks
35
+ * If set to `false`, the built-in Table of Contents generator will be disabled.
36
+ */
37
+ toc?: false | TOCOptions;
38
+ };
39
+ //#endregion
40
+ export { AutoMDPluginOptions };
@@ -0,0 +1,33 @@
1
+ //#region ../plugin-automd/src/types/toc.d.ts
2
+ interface TOCOptions {
3
+ /**
4
+ * A slugify function to generate slugs for the headings.
5
+ */
6
+ slugify?: (str: string) => string;
7
+ /**
8
+ * The maximum depth of headings to include in the TOC.
9
+ *
10
+ * @defaultValue 6
11
+ */
12
+ maxDepth?: number;
13
+ /**
14
+ * Whether to include the first H1 heading in the TOC.
15
+ */
16
+ firstH1?: boolean;
17
+ /**
18
+ * The bullet character to use for list items in the TOC.
19
+ *
20
+ * @defaultValue "-"
21
+ */
22
+ bullets?: string;
23
+ /**
24
+ * A prefix to add to each heading in the TOC.
25
+ */
26
+ prefix?: string;
27
+ /**
28
+ * A filter function to determine which headings to include in the TOC.
29
+ */
30
+ filter?: (str: string, level: number) => boolean;
31
+ }
32
+ //#endregion
33
+ export { TOCOptions };
@@ -0,0 +1,33 @@
1
+ //#region ../plugin-automd/src/types/toc.d.ts
2
+ interface TOCOptions {
3
+ /**
4
+ * A slugify function to generate slugs for the headings.
5
+ */
6
+ slugify?: (str: string) => string;
7
+ /**
8
+ * The maximum depth of headings to include in the TOC.
9
+ *
10
+ * @defaultValue 6
11
+ */
12
+ maxDepth?: number;
13
+ /**
14
+ * Whether to include the first H1 heading in the TOC.
15
+ */
16
+ firstH1?: boolean;
17
+ /**
18
+ * The bullet character to use for list items in the TOC.
19
+ *
20
+ * @defaultValue "-"
21
+ */
22
+ bullets?: string;
23
+ /**
24
+ * A prefix to add to each heading in the TOC.
25
+ */
26
+ prefix?: string;
27
+ /**
28
+ * A filter function to determine which headings to include in the TOC.
29
+ */
30
+ filter?: (str: string, level: number) => boolean;
31
+ }
32
+ //#endregion
33
+ export { TOCOptions };
@@ -1,6 +1,6 @@
1
1
  import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
2
- import { PluginContext } from "../../../powerlines/src/types/context.cjs";
3
2
  import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.cjs";
3
+ import { PluginContext } from "../../../powerlines/src/types/context.cjs";
4
4
 
5
5
  //#region ../plugin-babel/src/types/plugin.d.ts
6
6
  type BabelPluginOptions = Partial<BabelUserConfig>;
@@ -1,6 +1,6 @@
1
1
  import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
2
- import { PluginContext } from "../../../powerlines/src/types/context.mjs";
3
2
  import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.mjs";
3
+ import { PluginContext } from "../../../powerlines/src/types/context.mjs";
4
4
 
5
5
  //#region ../plugin-babel/src/types/plugin.d.ts
6
6
  type BabelPluginOptions = Partial<BabelUserConfig>;
@@ -0,0 +1 @@
1
+ import "@stryke/capnp";
@@ -0,0 +1,7 @@
1
+ import "./types/resolved.mjs";
2
+ import "./types/config.mjs";
3
+ import "./types/hooks.mjs";
4
+ import "./types/context.mjs";
5
+ import "./internal/helpers/hooks.mjs";
6
+ import "./types/api.mjs";
7
+ import "./types/index.mjs";
@@ -0,0 +1,12 @@
1
+ import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./types/babel.mjs";
2
+ import { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant } from "./types/build.mjs";
3
+ import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./types/fs.mjs";
4
+ import { CommandType, SUPPORTED_COMMANDS } from "./types/commands.mjs";
5
+ import { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition } from "./types/resolved.mjs";
6
+ import { BasePluginHookFunctions, BuildPlugin, ConfigResult, Plugin, PluginBuildPlugins, PluginHook, PluginHookObject, PluginHooks, TypesResult } from "./types/plugin.mjs";
7
+ import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./types/tsconfig.mjs";
8
+ import { BabelUserConfig, BaseConfig, CommonUserConfig, DeployConfig, EnvironmentConfig, InlineConfig, LogFn, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, ProjectType, UserConfig, WorkspaceConfig } from "./types/config.mjs";
9
+ import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./types/context.mjs";
10
+ import "./types/index.mjs";
11
+ import "./api.mjs";
12
+ import "../schemas/fs.mjs";
@@ -1,5 +1,5 @@
1
1
  import "../../types/resolved.mjs";
2
2
  import "../../types/hooks.mjs";
3
3
  import "../../types/context.mjs";
4
- import { MaybePromise } from "@stryke/types/base";
5
- import { ArrayValues } from "@stryke/types/array";
4
+ import { ArrayValues } from "@stryke/types/array";
5
+ import { MaybePromise } from "@stryke/types/base";
@@ -1 +1 @@
1
- require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/join-paths`),t=require(`@stryke/convert/parse-type-definition`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`);require(`@stryke/fs/is-file`),require(`@stryke/fs/list-files`),require(`@stryke/hash/murmurhash`);let o=require(`@stryke/helpers/get-unique`),s=require(`@stryke/path/append`);
1
+ require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/join-paths`),t=require(`@stryke/convert/parse-type-definition`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`);require(`@stryke/hash/murmurhash`);let c=require(`@stryke/helpers/get-unique`),l=require(`@stryke/path/append`);
@@ -1 +1 @@
1
- import"../plugin-utils/paths.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import{parseTypeDefinition as t}from"@stryke/convert/parse-type-definition";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{replacePath as r}from"@stryke/path/replace";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import"@stryke/fs/list-files";import"@stryke/hash/murmurhash";import{getUniqueBy as o}from"@stryke/helpers/get-unique";import{appendPath as s}from"@stryke/path/append";export{};
1
+ import"../plugin-utils/paths.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import{parseTypeDefinition as t}from"@stryke/convert/parse-type-definition";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{replacePath as r}from"@stryke/path/replace";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import"@stryke/hash/murmurhash";import{getUniqueBy as s}from"@stryke/helpers/get-unique";import{appendPath as c}from"@stryke/path/append";export{};
@@ -1,5 +1,5 @@
1
1
  import "./resolved.mjs";
2
+ import "./config.mjs";
2
3
  import "./hooks.mjs";
3
4
  import "./context.mjs";
4
- import "./config.mjs";
5
5
  import "../internal/helpers/hooks.mjs";
@@ -1,5 +1,5 @@
1
- import { Context } from "./context.cjs";
2
1
  import { LogFn } from "./config.cjs";
2
+ import { Context } from "./context.cjs";
3
3
  import { PluginItem, PluginObj, PluginPass } from "@babel/core";
4
4
  import { BabelAPI } from "@babel/helper-plugin-utils";
5
5
 
@@ -1,5 +1,5 @@
1
- import { Context } from "./context.mjs";
2
1
  import { LogFn } from "./config.mjs";
2
+ import { Context } from "./context.mjs";
3
3
  import { BabelAPI } from "@babel/helper-plugin-utils";
4
4
  import { PluginItem, PluginObj, PluginPass } from "@babel/core";
5
5
 
@@ -1,5 +1,5 @@
1
- import { MaybePromise } from "@stryke/types/base";
2
1
  import { ArrayValues } from "@stryke/types/array";
2
+ import { MaybePromise } from "@stryke/types/base";
3
3
 
4
4
  //#region ../powerlines/src/types/commands.d.ts
5
5
  declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
@@ -1,6 +1,6 @@
1
1
  import "./context.mjs";
2
- import { MaybePromise } from "@stryke/types/base";
3
2
  import { ArrayValues } from "@stryke/types/array";
3
+ import { MaybePromise } from "@stryke/types/base";
4
4
 
5
5
  //#region ../powerlines/src/types/commands.d.ts
6
6
  declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
@@ -1,14 +1,14 @@
1
- import { StoragePort, StoragePreset } from "./fs.cjs";
1
+ import { BabelTransformPluginOptions } from "./babel.cjs";
2
2
  import { BuildConfig, BuildResolvedConfig } from "./build.cjs";
3
+ import { StoragePort, StoragePreset } from "./fs.cjs";
3
4
  import { Plugin } from "./plugin.cjs";
4
5
  import { TSConfig } from "./tsconfig.cjs";
5
6
  import { PluginContext } from "./context.cjs";
6
- import { BabelTransformPluginOptions } from "./babel.cjs";
7
+ import { MaybePromise } from "@stryke/types/base";
7
8
  import { transformAsync } from "@babel/core";
8
9
  import { Format } from "@storm-software/build-tools/types";
9
10
  import { LogLevelLabel } from "@storm-software/config-tools/types";
10
11
  import { StormWorkspaceConfig } from "@storm-software/config/types";
11
- import { MaybePromise } from "@stryke/types/base";
12
12
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
13
13
  import { AssetGlob } from "@stryke/types/file";
14
14
  import { PreviewOptions } from "vite";
@@ -1,15 +1,15 @@
1
- import { StoragePort, StoragePreset } from "./fs.mjs";
1
+ import { BabelTransformPluginOptions } from "./babel.mjs";
2
2
  import { BuildConfig, BuildResolvedConfig } from "./build.mjs";
3
+ import { StoragePort, StoragePreset } from "./fs.mjs";
3
4
  import { Plugin } from "./plugin.mjs";
4
5
  import { TSConfig } from "./tsconfig.mjs";
5
6
  import { PluginContext } from "./context.mjs";
6
- import { BabelTransformPluginOptions } from "./babel.mjs";
7
7
  import { LogLevelLabel } from "@storm-software/config-tools/types";
8
8
  import "c12";
9
9
  import { transformAsync } from "@babel/core";
10
+ import { MaybePromise } from "@stryke/types/base";
10
11
  import { Format } from "@storm-software/build-tools/types";
11
12
  import { StormWorkspaceConfig } from "@storm-software/config/types";
12
- import { MaybePromise } from "@stryke/types/base";
13
13
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
14
14
  import { AssetGlob } from "@stryke/types/file";
15
15
  import { PreviewOptions } from "vite";
@@ -1,9 +1,9 @@
1
1
  import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
2
2
  import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
3
3
  import "./plugin.mjs";
4
- import "./hooks.mjs";
5
4
  import { ParsedTypeScriptConfig } from "./tsconfig.mjs";
6
5
  import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
6
+ import "./hooks.mjs";
7
7
  import { NonUndefined } from "@stryke/types/base";
8
8
  import { EnvPaths } from "@stryke/env/get-env-paths";
9
9
  import { FetchRequestOptions } from "@stryke/http/fetch";
@@ -1,12 +1,12 @@
1
- import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
1
+ import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./babel.mjs";
2
2
  import { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant } from "./build.mjs";
3
+ import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
3
4
  import { CommandType, SUPPORTED_COMMANDS } from "./commands.mjs";
4
5
  import { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
5
6
  import { BasePluginHookFunctions, BuildPlugin, ConfigResult, Plugin, PluginBuildPlugins, PluginHook, PluginHookObject, PluginHooks, TypesResult } from "./plugin.mjs";
6
- import "./hooks.mjs";
7
7
  import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
8
- import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./context.mjs";
9
- import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./babel.mjs";
10
8
  import { BabelUserConfig, BaseConfig, CommonUserConfig, DeployConfig, EnvironmentConfig, InlineConfig, LogFn, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, ProjectType, UserConfig, WorkspaceConfig } from "./config.mjs";
9
+ import "./hooks.mjs";
10
+ import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./context.mjs";
11
11
  import "./api.mjs";
12
12
  import "./unplugin.mjs";
@@ -1,11 +1,11 @@
1
1
  import { UnpluginBuildVariant } from "./build.cjs";
2
2
  import { CommandType } from "./commands.cjs";
3
3
  import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.cjs";
4
- import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
5
4
  import { EnvironmentConfig, PluginConfig } from "./config.cjs";
5
+ import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
6
+ import { ArrayValues } from "@stryke/types/array";
6
7
  import { FunctionLike, MaybePromise } from "@stryke/types/base";
7
8
  import { ExternalIdResult, HookFilter, TransformResult, UnpluginOptions } from "unplugin";
8
- import { ArrayValues } from "@stryke/types/array";
9
9
 
10
10
  //#region ../powerlines/src/types/plugin.d.ts
11
11
  interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
@@ -1,11 +1,11 @@
1
1
  import { UnpluginBuildVariant } from "./build.mjs";
2
2
  import { CommandType } from "./commands.mjs";
3
3
  import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.mjs";
4
- import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
5
4
  import { EnvironmentConfig, PluginConfig } from "./config.mjs";
5
+ import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
6
+ import { ArrayValues } from "@stryke/types/array";
6
7
  import { FunctionLike, MaybePromise } from "@stryke/types/base";
7
8
  import { ExternalIdResult, HookFilter, TransformResult, UnpluginOptions } from "unplugin";
8
- import { ArrayValues } from "@stryke/types/array";
9
9
 
10
10
  //#region ../powerlines/src/types/plugin.d.ts
11
11
  interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
@@ -1,7 +1,7 @@
1
1
  import "./build.mjs";
2
2
  import "./resolved.mjs";
3
3
  import "./plugin.mjs";
4
- import "./context.mjs";
5
4
  import "./config.mjs";
5
+ import "./context.mjs";
6
6
  import "./api.mjs";
7
7
  import { UnpluginOptions } from "unplugin";
@@ -1,8 +1,9 @@
1
1
  import { Reflection } from "../deepkit/src/types.cjs";
2
+ import { AutoMDPluginOptions } from "../plugin-automd/src/types/plugin.cjs";
2
3
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../plugin-babel/src/types/plugin.cjs";
3
4
  import { EnvInterface, SecretsInterface } from "./runtime.cjs";
4
- import { Children } from "@alloy-js/core/jsx-runtime";
5
5
  import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
6
+ import { Children } from "@alloy-js/core/jsx-runtime";
6
7
  import { DotenvParseOutput } from "@stryke/env/types";
7
8
 
8
9
  //#region src/types/plugin.d.ts
@@ -46,6 +47,13 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
46
47
  * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.
47
48
  */
48
49
  babel?: BabelPluginOptions;
50
+ /**
51
+ * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
52
+ *
53
+ * @remarks
54
+ * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
55
+ */
56
+ automd?: AutoMDPluginOptions;
49
57
  };
50
58
  type EnvPluginUserConfig = BabelPluginUserConfig & {
51
59
  env: EnvPluginOptions;
@@ -1,4 +1,5 @@
1
1
  import { Reflection } from "../deepkit/src/types.mjs";
2
+ import { AutoMDPluginOptions } from "../plugin-automd/src/types/plugin.mjs";
2
3
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../plugin-babel/src/types/plugin.mjs";
3
4
  import "../plugin-babel/src/types/index.mjs";
4
5
  import { EnvInterface, SecretsInterface } from "./runtime.mjs";
@@ -47,6 +48,13 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
47
48
  * This option allows you to customize the Babel transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Babel settings.
48
49
  */
49
50
  babel?: BabelPluginOptions;
51
+ /**
52
+ * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
53
+ *
54
+ * @remarks
55
+ * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
56
+ */
57
+ automd?: AutoMDPluginOptions;
50
58
  };
51
59
  type EnvPluginUserConfig = BabelPluginUserConfig & {
52
60
  env: EnvPluginOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-env",
3
- "version": "0.13.105",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "repository": {
@@ -187,14 +187,16 @@
187
187
  "files": ["dist/**/*"],
188
188
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
189
189
  "dependencies": {
190
+ "automd": "^0.4.2",
190
191
  "@alloy-js/core": "^0.21.0",
191
192
  "@alloy-js/typescript": "^0.21.0",
192
193
  "@alloy-js/markdown": "^0.21.0",
193
194
  "@babel/core": "^7.28.5",
194
195
  "@babel/types": "^7.28.5",
195
- "@powerlines/alloy": "^0.11.108",
196
- "@powerlines/plugin-babel": "^0.12.105",
197
- "@powerlines/plugin-plugin": "^0.12.48",
196
+ "@powerlines/alloy": "^0.12.1",
197
+ "@powerlines/plugin-automd": "^0.1.98",
198
+ "@powerlines/plugin-babel": "^0.12.107",
199
+ "@powerlines/plugin-plugin": "^0.12.50",
198
200
  "@storm-software/config-tools": "^1.188.73",
199
201
  "@stryke/capnp": "^0.12.51",
200
202
  "@stryke/env": "^0.20.43",
@@ -203,16 +205,16 @@
203
205
  "@stryke/string-format": "^0.12.29",
204
206
  "@stryke/type-checks": "^0.5.14",
205
207
  "@stryke/types": "^0.10.28",
206
- "powerlines": "^0.36.1"
208
+ "powerlines": "^0.36.3"
207
209
  },
208
210
  "devDependencies": {
209
211
  "@alloy-js/babel-preset": "^0.2.1",
210
212
  "@babel/preset-typescript": "^7.28.5",
211
- "@powerlines/nx": "^0.11.27",
213
+ "@powerlines/nx": "^0.11.29",
212
214
  "@types/node": "^24.10.4",
213
215
  "typescript": "^5.9.3",
214
216
  "vite": "8.0.0-beta.2"
215
217
  },
216
218
  "publishConfig": { "access": "public" },
217
- "gitHead": "313870c334e3a40e3c219bfc3f15268401c48353"
219
+ "gitHead": "0d695fa64043ba14e7c7ae8759e9e0cf5b2a6b38"
218
220
  }
@@ -1,15 +0,0 @@
1
- import { Plugin } from "../../../powerlines/src/types/plugin.cjs";
2
- import { PluginContext } from "../../../powerlines/src/types/context.cjs";
3
- import { PluginPluginAlloyOptions } from "../../../plugin-plugin/src/types/plugin.cjs";
4
- import { Children } from "@alloy-js/core/jsx-runtime";
5
-
6
- //#region ../alloy/src/types/plugin.d.ts
7
- interface AlloyPluginOptions {
8
- alloy?: PluginPluginAlloyOptions;
9
- }
10
- type AlloyPluginBuilderResult<TContext extends PluginContext = PluginContext> = Plugin<TContext> & {
11
- render: (this: TContext) => Children;
12
- };
13
- type AlloyPluginBuilder<TContext extends PluginContext = PluginContext, TOptions = any> = <T extends TContext>(options: TOptions) => AlloyPluginBuilderResult<T>;
14
- //#endregion
15
- export { AlloyPluginBuilder, AlloyPluginOptions };
@@ -1,15 +0,0 @@
1
- import { Plugin } from "../../../powerlines/src/types/plugin.mjs";
2
- import { PluginContext } from "../../../powerlines/src/types/context.mjs";
3
- import { PluginPluginAlloyOptions } from "../../../plugin-plugin/src/types/plugin.mjs";
4
- import { Children } from "@alloy-js/core/jsx-runtime";
5
-
6
- //#region ../alloy/src/types/plugin.d.ts
7
- interface AlloyPluginOptions {
8
- alloy?: PluginPluginAlloyOptions;
9
- }
10
- type AlloyPluginBuilderResult<TContext extends PluginContext = PluginContext> = Plugin<TContext> & {
11
- render: (this: TContext) => Children;
12
- };
13
- type AlloyPluginBuilder<TContext extends PluginContext = PluginContext, TOptions = any> = <T extends TContext>(options: TOptions) => AlloyPluginBuilderResult<T>;
14
- //#endregion
15
- export { AlloyPluginBuilder, AlloyPluginOptions };
@@ -1,21 +0,0 @@
1
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
2
- import { PrintTreeOptions } from "@alloy-js/core";
3
-
4
- //#region ../plugin-plugin/src/types/plugin.d.ts
5
-
6
- type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
7
- /**
8
- * If true, the Alloy framework is used to generate JSON output files.
9
- *
10
- * @defaultValue false
11
- */
12
- generatesJson?: boolean;
13
- /**
14
- * If true, the Alloy framework is used to generate Markdown output files.
15
- *
16
- * @defaultValue false
17
- */
18
- generatesMarkdown?: boolean;
19
- };
20
- //#endregion
21
- export { PluginPluginAlloyOptions };
@@ -1,24 +0,0 @@
1
- import "../../../powerlines/src/types/build.mjs";
2
- import "../../../powerlines/src/types/resolved.mjs";
3
- import "../../../powerlines/src/types/context.mjs";
4
- import "../../../powerlines/src/types/config.mjs";
5
- import { PrintTreeOptions } from "@alloy-js/core";
6
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
7
-
8
- //#region ../plugin-plugin/src/types/plugin.d.ts
9
- type PluginPluginAlloyOptions = Partial<PrintTreeOptions> & {
10
- /**
11
- * If true, the Alloy framework is used to generate JSON output files.
12
- *
13
- * @defaultValue false
14
- */
15
- generatesJson?: boolean;
16
- /**
17
- * If true, the Alloy framework is used to generate Markdown output files.
18
- *
19
- * @defaultValue false
20
- */
21
- generatesMarkdown?: boolean;
22
- };
23
- //#endregion
24
- export { PluginPluginAlloyOptions };