@powerlines/plugin-react 0.1.112 → 0.1.114

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 (83) hide show
  1. package/dist/index.d.cts +1 -2
  2. package/dist/plugin-alloy/src/index.cjs +2 -2
  3. package/dist/plugin-alloy/src/index.mjs +2 -2
  4. package/dist/plugin-automd/src/index.cjs +1 -1
  5. package/dist/plugin-automd/src/index.mjs +1 -1
  6. package/dist/plugin-env/src/babel/plugin.cjs +3 -3
  7. package/dist/plugin-env/src/babel/plugin.mjs +3 -3
  8. package/dist/plugin-env/src/components/docs.cjs +1 -1
  9. package/dist/plugin-env/src/components/docs.mjs +1 -1
  10. package/dist/plugin-env/src/helpers/source-file-env.cjs +1 -1
  11. package/dist/plugin-env/src/helpers/source-file-env.mjs +1 -1
  12. package/dist/plugin-env/src/index.cjs +1 -1
  13. package/dist/plugin-env/src/index.mjs +1 -1
  14. package/dist/plugin-env/src/types/plugin.d.cts +0 -1
  15. package/dist/powerlines/src/lib/build/esbuild.cjs +9 -9
  16. package/dist/powerlines/src/lib/build/esbuild.mjs +9 -9
  17. package/dist/powerlines/src/lib/entry.cjs +1 -1
  18. package/dist/powerlines/src/lib/entry.mjs +1 -1
  19. package/dist/powerlines/src/types/build.d.mts +2 -0
  20. package/dist/powerlines/src/types/resolved.d.mts +1 -0
  21. package/package.json +6 -6
  22. package/dist/deepkit/src/vendor/core.cjs +0 -1
  23. package/dist/deepkit/src/vendor/core.mjs +0 -1
  24. package/dist/plugin-alloy/src/core/components/index.cjs +0 -1
  25. package/dist/plugin-alloy/src/core/components/index.mjs +0 -1
  26. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -1
  27. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -1
  28. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -1
  29. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -1
  30. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -1
  31. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -1
  32. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -1
  33. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -1
  34. package/dist/plugin-alloy/src/core/index.cjs +0 -1
  35. package/dist/plugin-alloy/src/core/index.mjs +0 -1
  36. package/dist/plugin-alloy/src/helpers/capnp.cjs +0 -1
  37. package/dist/plugin-alloy/src/helpers/capnp.mjs +0 -1
  38. package/dist/plugin-alloy/src/helpers/create-builtin.cjs +0 -1
  39. package/dist/plugin-alloy/src/helpers/create-builtin.mjs +0 -1
  40. package/dist/plugin-alloy/src/helpers/index.cjs +0 -1
  41. package/dist/plugin-alloy/src/helpers/index.mjs +0 -1
  42. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -1
  43. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -1
  44. package/dist/plugin-alloy/src/helpers/typescript.cjs +0 -1
  45. package/dist/plugin-alloy/src/helpers/typescript.mjs +0 -1
  46. package/dist/plugin-alloy/src/markdown/components/index.cjs +0 -1
  47. package/dist/plugin-alloy/src/markdown/components/index.mjs +0 -1
  48. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -1
  49. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -1
  50. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -1
  51. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -1
  52. package/dist/plugin-alloy/src/markdown/contexts/index.cjs +0 -1
  53. package/dist/plugin-alloy/src/markdown/contexts/index.mjs +0 -1
  54. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -1
  55. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -1
  56. package/dist/plugin-alloy/src/markdown/index.cjs +0 -1
  57. package/dist/plugin-alloy/src/markdown/index.mjs +0 -1
  58. package/dist/plugin-alloy/src/types/components.d.cts +0 -2
  59. package/dist/plugin-alloy/src/types/index.d.cts +0 -2
  60. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -1
  61. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -1
  62. package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.cjs +0 -1
  63. package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.mjs +0 -1
  64. package/dist/plugin-alloy/src/typescript/components/entry-file.cjs +0 -1
  65. package/dist/plugin-alloy/src/typescript/components/entry-file.mjs +0 -1
  66. package/dist/plugin-alloy/src/typescript/components/index.cjs +0 -1
  67. package/dist/plugin-alloy/src/typescript/components/index.mjs +0 -1
  68. package/dist/plugin-alloy/src/typescript/components/record-expression.cjs +0 -1
  69. package/dist/plugin-alloy/src/typescript/components/record-expression.mjs +0 -1
  70. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
  71. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
  72. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -1
  73. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -1
  74. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -1
  75. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -1
  76. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -1
  77. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -1
  78. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -1
  79. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -1
  80. package/dist/plugin-alloy/src/typescript/index.cjs +0 -1
  81. package/dist/plugin-alloy/src/typescript/index.mjs +0 -1
  82. package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -1
  83. package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -1
package/dist/index.d.cts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./components/react-optimized.cjs";
2
- import "./components/index.cjs";
3
2
  import { Plugin } from "./powerlines/src/types/plugin.cjs";
4
3
  import { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig } from "./types/plugin.cjs";
5
4
  import { ReactEnvInterface, __ΩReactEnvInterface } from "./types/runtime.cjs";
6
- import "./types/index.cjs";
7
5
 
8
6
  //#region src/index.d.ts
7
+
9
8
  /**
10
9
  * A package containing a Powerlines plugin for building a React application.
11
10
  */
@@ -1,2 +1,2 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./core/contexts/context.cjs`),n=require(`./core/components/output.cjs`);require(`./core/index.cjs`),require(`./helpers/index.cjs`),require(`./markdown/index.cjs`),require(`./typescript/index.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@storm-software/config-tools/types`),a=require(`@stryke/path/is-parent-path`),o=require(`@stryke/type-checks/is-set-string`),s=require(`@alloy-js/core`),c=require(`@alloy-js/rollup-plugin`);c=e.__toESM(c);let l=require(`@stryke/json/storm-json`),u=require(`@stryke/path/replace`),d=require(`prettier/doc.js`);const f=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[(0,c.default)()],alias:{"@alloy-js/core":`@powerlines/plugin-alloy/vendor`},external:[`@alloy-js/core`,`@vue/reactivity`,`@vue/shared`]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,l.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let t=this,i=(0,s.renderTree)((0,r.createComponent)(n.Output,{context:t,get basePath(){return t.workspaceConfig.workspaceRoot},children:e}));await m(this,i,this.config.alloy)}}}}];var p=f;async function m(e,t,n={}){await(0,s.flushJobsAsync)();let r,c=async(t,o)=>{if(!Array.isArray(o))return;let l=async e=>{for(let t of o)await c(e,t)},d=(0,s.getContextForRenderNode)(o);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(i.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,u.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,n)}}else d.meta?.entry||(0,a.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(i.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,n)}):(e.log(i.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,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(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 l(t)};await c(void 0,t);let l=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await l(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,o.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,o.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 l(e,r)}async function h(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,s.flushJobsAsync)();let r=d.printer.printDocToString(g(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
2
- `)?`${r}\n`:r}function g(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,g)):t.push(g(n));return t}exports.default=p;
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./core/components/output.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@storm-software/config-tools/types`),i=require(`@stryke/path/is-parent-path`),a=require(`@stryke/type-checks/is-set-string`),o=require(`@alloy-js/core`),s=require(`@alloy-js/rollup-plugin`);s=e.__toESM(s);let c=require(`@stryke/json/storm-json`),l=require(`@stryke/path/replace`),u=require(`prettier/doc.js`);const d=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[(0,s.default)()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,c.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)},resolveId(e){return e===`@alloy-js/core`?{id:`@powerlines/plugin-alloy`,external:!0}:null}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let r=this,i=(0,o.renderTree)((0,n.createComponent)(t.Output,{context:r,get basePath(){return r.workspaceConfig.workspaceRoot},children:e}));await p(this,i,this.config.alloy)}}}}];var f=d;async function p(e,t,n={}){await(0,o.flushJobsAsync)();let s,c=async(t,a)=>{if(!Array.isArray(a))return;let u=async e=>{for(let t of a)await c(e,t)},d=(0,o.getContextForRenderNode)(a);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):s=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 o;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(r.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),o={kind:`builtin`,id:d.meta.builtin.id,path:(0,l.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await m(e,a,n)}}else d.meta?.entry||(0,i.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(r.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),o={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await m(e,a,n)}):(e.log(r.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),o={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await m(e,a,n)});t.contents.push(o)}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(r.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 c(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,a.isSetString)(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&(0,a.isSetString)(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await u(e,s)}async function m(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,o.flushJobsAsync)();let r=u.printer.printDocToString(h(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
2
+ `)?`${r}\n`:r}function h(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,o.isPrintHook)(n)?t.push(n.print(n.subtree,h)):t.push(h(n));return t}exports.default=f,Object.keys(o).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})});
@@ -1,2 +1,2 @@
1
- import{PowerlinesContext as e}from"./core/contexts/context.mjs";import{Output as t}from"./core/components/output.mjs";import"./core/index.mjs";import"./helpers/index.mjs";import"./markdown/index.mjs";import"./typescript/index.mjs";import{createComponent as n}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as r}from"@storm-software/config-tools/types";import{isParentPath as i}from"@stryke/path/is-parent-path";import{isSetString as a}from"@stryke/type-checks/is-set-string";import{flushJobsAsync as o,getContextForRenderNode as s,isPrintHook as c,renderTree as l}from"@alloy-js/core";import u from"@alloy-js/rollup-plugin";import{StormJSON as d}from"@stryke/json/storm-json";import{replacePath as f}from"@stryke/path/replace";import{printer as p}from"prettier/doc.js";var m=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[u()],alias:{"@alloy-js/core":`@powerlines/plugin-alloy/vendor`},external:[`@alloy-js/core`,`@vue/reactivity`,`@vue/shared`]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,d.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let r=this,i=l(n(t,{context:r,get basePath(){return r.workspaceConfig.workspaceRoot},children:e}));await h(this,i,this.config.alloy)}}}}];async function h(e,t,n={}){await o();let c,l=async(t,a)=>{if(!Array.isArray(a))return;let o=async e=>{for(let t of a)await l(e,t)},u=s(a);if(!u)return o(t);if(u.meta?.directory){let e={kind:`directory`,path:u.meta.directory.path,contents:[]};t?t.contents.push(e):c=e,await o(e)}else if(u.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let o;if(u.meta?.builtin){if(!u.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(r.TRACE,`Rendering built-in runtime module with ID: ${u.meta.builtin.id}`),o={kind:`builtin`,id:u.meta.builtin.id,path:f(u.meta.sourceFile.path,e.builtinsPath),filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await g(e,a,n)}}else u.meta?.entry||i(e.entryPath,u.meta.sourceFile.path)?(e.log(r.TRACE,`Rendering entry module at path: ${u.meta.sourceFile.path}`),o={kind:`entry`,typeDefinition:u.meta.entry?.typeDefinition,path:u.meta.sourceFile.path,filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await g(e,a,n)}):(e.log(r.TRACE,`Rendering source file at path: ${u.meta.sourceFile.path}`),o={kind:`file`,path:u.meta.sourceFile.path,filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await g(e,a,n)});t.contents.push(o)}else if(u.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(r.TRACE,`Processing copy file operation from "${u.meta.copyFile.sourcePath}" to "${u.meta.copyFile.path}"`),!u.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(!u.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:u.meta.copyFile.path,sourcePath:u.meta.copyFile.sourcePath,preset:u.meta.output?.preset})}else await o(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(!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 u(e,c)}async function g(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await o();let r=p.printDocToString(_(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
2
- `)?`${r}\n`:r}function _(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else c(n)?t.push(n.print(n.subtree,_)):t.push(_(n));return t}export{m as default};
1
+ import{Output as e}from"./core/components/output.mjs";import{createComponent as t}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as n}from"@storm-software/config-tools/types";import{isParentPath as r}from"@stryke/path/is-parent-path";import{isSetString as i}from"@stryke/type-checks/is-set-string";import{flushJobsAsync as a,getContextForRenderNode as o,isPrintHook as s,renderTree as c}from"@alloy-js/core";import l from"@alloy-js/rollup-plugin";import{StormJSON as u}from"@stryke/json/storm-json";import{replacePath as d}from"@stryke/path/replace";import{printer as f}from"prettier/doc.js";export*from"@alloy-js/core";var p=(n={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...n},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[l()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,u.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)},resolveId(e){return e===`@alloy-js/core`?{id:`@powerlines/plugin-alloy`,external:!0}:null}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async n=>{let r=this,i=c(t(e,{context:r,get basePath(){return r.workspaceConfig.workspaceRoot},children:n}));await m(this,i,this.config.alloy)}}}}];async function m(e,t,s={}){await a();let c,l=async(t,i)=>{if(!Array.isArray(i))return;let a=async e=>{for(let t of i)await l(e,t)},u=o(i);if(!u)return a(t);if(u.meta?.directory){let e={kind:`directory`,path:u.meta.directory.path,contents:[]};t?t.contents.push(e):c=e,await a(e)}else if(u.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let a;if(u.meta?.builtin){if(!u.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(n.TRACE,`Rendering built-in runtime module with ID: ${u.meta.builtin.id}`),a={kind:`builtin`,id:u.meta.builtin.id,path:d(u.meta.sourceFile.path,e.builtinsPath),filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await h(e,i,s)}}else u.meta?.entry||r(e.entryPath,u.meta.sourceFile.path)?(e.log(n.TRACE,`Rendering entry module at path: ${u.meta.sourceFile.path}`),a={kind:`entry`,typeDefinition:u.meta.entry?.typeDefinition,path:u.meta.sourceFile.path,filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await h(e,i,s)}):(e.log(n.TRACE,`Rendering source file at path: ${u.meta.sourceFile.path}`),a={kind:`file`,path:u.meta.sourceFile.path,filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await h(e,i,s)});t.contents.push(a)}else if(u.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(n.TRACE,`Processing copy file operation from "${u.meta.copyFile.sourcePath}" to "${u.meta.copyFile.path}"`),!u.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(!u.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:u.meta.copyFile.path,sourcePath:u.meta.copyFile.sourcePath,preset:u.meta.output?.preset})}else await a(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(!i(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&i(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 h(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await a();let r=f.printDocToString(g(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
2
+ `)?`${r}\n`:r}function g(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 s(n)?t.push(n.print(n.subtree,g)):t.push(g(n));return t}export{p as default};
@@ -1 +1 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/path/replace`),r=require(`@stryke/path/append`),i=require(`@stryke/convert/to-array`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`),c=require(`@stryke/path/is-type`),l=require(`automd`),u=require(`c12`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let n=await(0,l.loadConfig)((0,a.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=(0,i.toArray)(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:(0,t.default)(n??{},{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,u.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,t.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,s.listFiles)((0,c.isAbsolutePath)(e)?e:(0,r.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,c.isAbsolutePath)(e)?e:(0,r.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,c.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,r.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 i=await(0,l.transform)(t,this.config.automd);if(i.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.`);i.hasChanged&&await this.fs.write((0,r.appendPath)(this.config.automd.output?(0,o.isDirectory)(this.config.automd.output)?(0,n.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});var p=f;exports.default=p;
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/path/replace`),r=require(`@stryke/convert/to-array`),i=require(`@stryke/fs/is-file`),a=require(`@stryke/fs/list-files`),o=require(`@stryke/path/append`),s=require(`@stryke/path/is-type`),c=require(`@stryke/path/join-paths`),l=require(`automd`),u=require(`c12`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let n=await(0,l.loadConfig)((0,c.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=(0,r.toArray)(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:(0,t.default)(n??{},{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,r.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,r.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,u.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,t.default)(this.config.automd,{...e,prefix:(0,r.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,r.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,a.listFiles)((0,s.isAbsolutePath)(e)?e:(0,o.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,s.isAbsolutePath)(e)?e:(0,o.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,s.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,o.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,r.toArray)(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let r=await(0,l.transform)(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((0,o.appendPath)(this.config.automd.output?(0,i.isDirectory)(this.config.automd.output)?(0,n.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),r.contents)}}))}});var p=f;exports.default=p;
@@ -1 +1 @@
1
- import e from"defu";import{replacePath as t}from"@stryke/path/replace";import{appendPath as n}from"@stryke/path/append";import{toArray as r}from"@stryke/convert/to-array";import{joinPaths as i}from"@stryke/path/join-paths";import{isDirectory as a}from"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import{isAbsolutePath as s}from"@stryke/path/is-type";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{loadConfig as d}from"c12";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let t=await c(i(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=r(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:e(t??{},{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:t}=await d({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(e(this.config.automd,{...t,prefix:r(t.prefix??[])}))}this.config.automd.input=(await Promise.all(r(this.config.automd.input).map(async e=>e.includes(`*`)?o(s(e)?e:n(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):s(e)?e:n(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!s(this.config.automd.output)&&(this.config.automd.output=n(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 r=await this.fs.read(e);if(r){let i=await u(r,this.config.automd);if(i.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.`);i.hasChanged&&await this.fs.write(n(this.config.automd.output?a(this.config.automd.output)?t(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});export{p as default};
1
+ import e from"defu";import{replacePath as t}from"@stryke/path/replace";import{toArray as n}from"@stryke/convert/to-array";import{isDirectory as r}from"@stryke/fs/is-file";import{listFiles as i}from"@stryke/fs/list-files";import{appendPath as a}from"@stryke/path/append";import{isAbsolutePath as o}from"@stryke/path/is-type";import{joinPaths as s}from"@stryke/path/join-paths";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{loadConfig as d}from"c12";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let t=await c(s(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=n(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:e(t??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!n(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=n(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:t}=await d({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(e(this.config.automd,{...t,prefix:n(t.prefix??[])}))}this.config.automd.input=(await Promise.all(n(this.config.automd.input).map(async e=>e.includes(`*`)?i(o(e)?e:a(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):o(e)?e:a(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!o(this.config.automd.output)&&(this.config.automd.output=a(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(n(this.config.automd.input).map(async e=>{let n=await this.fs.read(e);if(n){let i=await u(n,this.config.automd);if(i.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.`);i.hasChanged&&await this.fs.write(a(this.config.automd.output?r(this.config.automd.output)?t(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});export{p as default};
@@ -1,5 +1,5 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../plugin-babel/src/helpers/create-plugin.cjs`),r=require(`../../../plugin-babel/src/helpers/module-helpers.cjs`),i=require(`../../../deepkit/src/utilities.cjs`),a=require(`../../../deepkit/src/capnp.cjs`),o=require(`../../../deepkit/schemas/reflection2.cjs`),s=require(`../helpers/persistence.cjs`);let c=require(`@storm-software/config-tools/types`),l=require(`@stryke/capnp`);l=e.__toESM(l);let u=require(`@stryke/fs/buffer`),d=require(`node:fs`);const f=n.createBabelPlugin(`env`,({log:e,context:n})=>{function f(t,r,a=!1){let o=n.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(t.name){let s=n.config.env.prefix.find(e=>t.name&&t.name.startsWith(e)&&(n.env.types.env?.hasProperty(t.name.replace(`${e}_`,``))||o.some(n=>n.getAlias().includes(t.name.replace(`${e}_`,``))))),l=t.name;if(s&&(l=t.name.replace(`${s}_`,``)),e(c.LogLevelLabel.TRACE,`Environment variable ${l} found in ${r.filename||`unknown file`}.`),n.env.types.env?.hasProperty(l)||o.some(e=>e.getAlias().includes(l))){let e=n.env.types.env.hasProperty(l)?n.env.types.env.getProperty(l):o.find(e=>e.getAlias().includes(l));if(!e||e.isIgnored())return;if(n.env.used.env.hasProperty(l)||n.env.used.env.addProperty(e.property),n.config.env.inject&&a){let t=n.env.parsed?.[l];if(t===void 0){let e=n.config.env.prefix.find(e=>n.env.parsed[`${e.replace(/_$/g,``)}_${l}`]);e&&(t=n.env.parsed[`${e.replace(/_$/g,``)}_${l}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${l}\` is not defined in the .env configuration files`);return i.stringifyDefaultValue(e,t)}}else throw Error(`The "${l}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${r.filename?r.filename:`unknown`}.
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../plugin-babel/src/helpers/create-plugin.cjs`),r=require(`../../../plugin-babel/src/helpers/module-helpers.cjs`),i=require(`../../../deepkit/src/capnp.cjs`),a=require(`../../../deepkit/schemas/reflection2.cjs`),o=require(`../../../deepkit/src/utilities.cjs`),s=require(`../helpers/persistence.cjs`);let c=require(`@storm-software/config-tools/types`),l=require(`@stryke/capnp`);l=e.__toESM(l);let u=require(`@stryke/fs/buffer`),d=require(`node:fs`);const f=n.createBabelPlugin(`env`,({log:e,context:n})=>{function f(t,r,i=!1){let a=n.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(t.name){let s=n.config.env.prefix.find(e=>t.name&&t.name.startsWith(e)&&(n.env.types.env?.hasProperty(t.name.replace(`${e}_`,``))||a.some(n=>n.getAlias().includes(t.name.replace(`${e}_`,``))))),l=t.name;if(s&&(l=t.name.replace(`${s}_`,``)),e(c.LogLevelLabel.TRACE,`Environment variable ${l} found in ${r.filename||`unknown file`}.`),n.env.types.env?.hasProperty(l)||a.some(e=>e.getAlias().includes(l))){let e=n.env.types.env.hasProperty(l)?n.env.types.env.getProperty(l):a.find(e=>e.getAlias().includes(l));if(!e||e.isIgnored())return;if(n.env.used.env.hasProperty(l)||n.env.used.env.addProperty(e.property),n.config.env.inject&&i){let t=n.env.parsed?.[l];if(t===void 0){let e=n.config.env.prefix.find(e=>n.env.parsed[`${e.replace(/_$/g,``)}_${l}`]);e&&(t=n.env.parsed[`${e.replace(/_$/g,``)}_${l}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${l}\` is not defined in the .env configuration files`);return o.stringifyDefaultValue(e,t)}}else throw Error(`The "${l}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${r.filename?r.filename:`unknown`}.
2
2
 
3
- The following environment configuration names are defined in the \`env\` type definition: \n${n.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${o.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${o?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
3
+ The following environment configuration names are defined in the \`env\` type definition: \n${n.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
4
4
  `)} \n\nUsing the following env prefix: \n${n.config.env.prefix.map(e=>` - ${e}`).join(`
5
- `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){e(c.LogLevelLabel.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let r=t.type_exports.ReflectionClass.from({kind:t.type_exports.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),i=s.getEnvReflectionsPath(n,`env`);i&&(0,d.existsSync)(i)&&(e(c.LogLevelLabel.TRACE,`Environment reflection file found at ${i}, reading existing reflection.`),r=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(a.convertFromCapnp(new l.Message((0,u.readFileBufferSync)(i),!1).getRoot(o.SerializedTypes).types)))),e(c.LogLevelLabel.TRACE,`Adding new variables to env reflection at ${i}.`),r.getProperties().filter(e=>e.getNameAsString()&&!n.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{n.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});exports.envBabelPlugin=f;
5
+ `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){e(c.LogLevelLabel.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let r=t.type_exports.ReflectionClass.from({kind:t.type_exports.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),o=s.getEnvReflectionsPath(n,`env`);o&&(0,d.existsSync)(o)&&(e(c.LogLevelLabel.TRACE,`Environment reflection file found at ${o}, reading existing reflection.`),r=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(i.convertFromCapnp(new l.Message((0,u.readFileBufferSync)(o),!1).getRoot(a.SerializedTypes).types)))),e(c.LogLevelLabel.TRACE,`Adding new variables to env reflection at ${o}.`),r.getProperties().filter(e=>e.getNameAsString()&&!n.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{n.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});exports.envBabelPlugin=f;
@@ -1,5 +1,5 @@
1
- import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{createBabelPlugin as t}from"../../../plugin-babel/src/helpers/create-plugin.mjs";import{addImport as n}from"../../../plugin-babel/src/helpers/module-helpers.mjs";import{stringifyDefaultValue as r}from"../../../deepkit/src/utilities.mjs";import{convertFromCapnp as i}from"../../../deepkit/src/capnp.mjs";import{SerializedTypes as a}from"../../../deepkit/schemas/reflection2.mjs";import{getEnvReflectionsPath as o}from"../helpers/persistence.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import*as c from"@stryke/capnp";import{readFileBufferSync as l}from"@stryke/fs/buffer";import{existsSync as u}from"node:fs";const d=t(`env`,({log:t,context:d})=>{function f(e,n,i=!1){let a=d.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(e.name){let o=d.config.env.prefix.find(t=>e.name&&e.name.startsWith(t)&&(d.env.types.env?.hasProperty(e.name.replace(`${t}_`,``))||a.some(n=>n.getAlias().includes(e.name.replace(`${t}_`,``))))),c=e.name;if(o&&(c=e.name.replace(`${o}_`,``)),t(s.TRACE,`Environment variable ${c} found in ${n.filename||`unknown file`}.`),d.env.types.env?.hasProperty(c)||a.some(e=>e.getAlias().includes(c))){let e=d.env.types.env.hasProperty(c)?d.env.types.env.getProperty(c):a.find(e=>e.getAlias().includes(c));if(!e||e.isIgnored())return;if(d.env.used.env.hasProperty(c)||d.env.used.env.addProperty(e.property),d.config.env.inject&&i){let t=d.env.parsed?.[c];if(t===void 0){let e=d.config.env.prefix.find(e=>d.env.parsed[`${e.replace(/_$/g,``)}_${c}`]);e&&(t=d.env.parsed[`${e.replace(/_$/g,``)}_${c}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${c}\` is not defined in the .env configuration files`);return r(e,t)}}else throw Error(`The "${c}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${n.filename?n.filename:`unknown`}.
1
+ import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{createBabelPlugin as t}from"../../../plugin-babel/src/helpers/create-plugin.mjs";import{addImport as n}from"../../../plugin-babel/src/helpers/module-helpers.mjs";import{convertFromCapnp as r}from"../../../deepkit/src/capnp.mjs";import{SerializedTypes as i}from"../../../deepkit/schemas/reflection2.mjs";import{stringifyDefaultValue as a}from"../../../deepkit/src/utilities.mjs";import{getEnvReflectionsPath as o}from"../helpers/persistence.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import*as c from"@stryke/capnp";import{readFileBufferSync as l}from"@stryke/fs/buffer";import{existsSync as u}from"node:fs";const d=t(`env`,({log:t,context:d})=>{function f(e,n,r=!1){let i=d.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(e.name){let o=d.config.env.prefix.find(t=>e.name&&e.name.startsWith(t)&&(d.env.types.env?.hasProperty(e.name.replace(`${t}_`,``))||i.some(n=>n.getAlias().includes(e.name.replace(`${t}_`,``))))),c=e.name;if(o&&(c=e.name.replace(`${o}_`,``)),t(s.TRACE,`Environment variable ${c} found in ${n.filename||`unknown file`}.`),d.env.types.env?.hasProperty(c)||i.some(e=>e.getAlias().includes(c))){let e=d.env.types.env.hasProperty(c)?d.env.types.env.getProperty(c):i.find(e=>e.getAlias().includes(c));if(!e||e.isIgnored())return;if(d.env.used.env.hasProperty(c)||d.env.used.env.addProperty(e.property),d.config.env.inject&&r){let t=d.env.parsed?.[c];if(t===void 0){let e=d.config.env.prefix.find(e=>d.env.parsed[`${e.replace(/_$/g,``)}_${c}`]);e&&(t=d.env.parsed[`${e.replace(/_$/g,``)}_${c}`])}if(t??=e.getDefaultValue(),e.isValueRequired()&&t===void 0)throw Error(`Environment variable \`${c}\` is not defined in the .env configuration files`);return a(e,t)}}else throw Error(`The "${c}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${n.filename?n.filename:`unknown`}.
2
2
 
3
- The following environment configuration names are defined in the \`env\` type definition: \n${d.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
3
+ The following environment configuration names are defined in the \`env\` type definition: \n${d.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${i.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${i?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
4
4
  `)} \n\nUsing the following env prefix: \n${d.config.env.prefix.map(e=>` - ${e}`).join(`
5
- `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;if(!r.name)return;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;if(!r.name)return;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){t(s.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let n=e.ReflectionClass.from({kind:e.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),r=o(d,`env`);r&&u(r)&&(t(s.TRACE,`Environment reflection file found at ${r}, reading existing reflection.`),n=(0,e.resolveClassType)((0,e.deserializeType)(i(new c.Message(l(r),!1).getRoot(a).types)))),t(s.TRACE,`Adding new variables to env reflection at ${r}.`),n.getProperties().filter(e=>e.getNameAsString()&&!d.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{d.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});export{d as envBabelPlugin};
5
+ `)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;if(!r.name)return;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let r=e.get(`property`)?.node;if(!r.name)return;f(r,t,!1),e.replaceWithSourceString(`env.${r.name}`),n(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){t(s.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let n=e.ReflectionClass.from({kind:e.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),a=o(d,`env`);a&&u(a)&&(t(s.TRACE,`Environment reflection file found at ${a}, reading existing reflection.`),n=(0,e.resolveClassType)((0,e.deserializeType)(r(new c.Message(l(a),!1).getRoot(i).types)))),t(s.TRACE,`Adding new variables to env reflection at ${a}.`),n.getProperties().filter(e=>e.getNameAsString()&&!d.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{d.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});export{d as envBabelPlugin};
@@ -1 +1 @@
1
- require(`../../../deepkit/src/vendor/type.cjs`),require(`../helpers/create-reflection-resource.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@stryke/path/join`);require(`@alloy-js/markdown`);let r=require(`@powerlines/alloy/core/contexts/context`);require(`@powerlines/alloy/markdown/components/markdown-file`),require(`@powerlines/alloy/markdown/components/markdown-table`);
1
+ require(`../../../deepkit/src/vendor/type.cjs`),require(`../helpers/create-reflection-resource.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@stryke/path/join`),r=require(`@powerlines/alloy/core/contexts/context`);require(`@alloy-js/markdown`),require(`@powerlines/alloy/markdown/components/markdown-file`),require(`@powerlines/alloy/markdown/components/markdown-table`);
@@ -1 +1 @@
1
- import"../../../deepkit/src/vendor/type.mjs";import"../helpers/create-reflection-resource.mjs";import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{Show as n,code as r}from"@alloy-js/core";import{joinPaths as i}from"@stryke/path/join";import"@alloy-js/markdown";import{usePowerlines as a}from"@powerlines/alloy/core/contexts/context";import"@powerlines/alloy/markdown/components/markdown-file";import"@powerlines/alloy/markdown/components/markdown-table";export{};
1
+ import"../../../deepkit/src/vendor/type.mjs";import"../helpers/create-reflection-resource.mjs";import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{Show as n,code as r}from"@alloy-js/core";import{joinPaths as i}from"@stryke/path/join";import{usePowerlines as a}from"@powerlines/alloy/core/contexts/context";import"@alloy-js/markdown";import"@powerlines/alloy/markdown/components/markdown-file";import"@powerlines/alloy/markdown/components/markdown-table";export{};
@@ -1 +1 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/string-format/camel-case`),r=require(`@stryke/env/types`);function i(e){if((0,t.isString)(e)){let t=r.ENV_PREFIXES.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let r=i(n);return r&&(t[r]=e[n]),t},{})}exports.removeEnvPrefix=i;
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/env/types`),r=require(`@stryke/string-format/camel-case`);function i(e){if((0,t.isString)(e)){let t=n.ENV_PREFIXES.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),e.toUpperCase());for(;t.startsWith(`_`);)t=t.slice(1);return t}return Object.keys(e).reduce((t,n)=>{let r=i(n);return r&&(t[r]=e[n]),t},{})}exports.removeEnvPrefix=i;
@@ -1 +1 @@
1
- import{isString as e}from"@stryke/type-checks/is-string";import{camelCase as t}from"@stryke/string-format/camel-case";import{ENV_PREFIXES as n}from"@stryke/env/types";function r(t){if(e(t)){let e=n.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),t.toUpperCase());for(;e.startsWith(`_`);)e=e.slice(1);return e}return Object.keys(t).reduce((e,n)=>{let i=r(n);return i&&(e[i]=t[n]),e},{})}export{r as removeEnvPrefix};
1
+ import{isString as e}from"@stryke/type-checks/is-string";import{ENV_PREFIXES as t}from"@stryke/env/types";import{camelCase as n}from"@stryke/string-format/camel-case";function r(n){if(e(n)){let e=t.reduce((e,t)=>(e.startsWith(t)&&(e=e.slice(t.length)),e),n.toUpperCase());for(;e.startsWith(`_`);)e=e.slice(1);return e}return Object.keys(n).reduce((e,t)=>{let i=r(t);return i&&(e[i]=n[t]),e},{})}export{r as removeEnvPrefix};
@@ -1,4 +1,4 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-babel/src/index.cjs`),r=require(`../../plugin-alloy/src/index.cjs`),i=require(`../../plugin-automd/src/index.cjs`),a=require(`./helpers/reflect.cjs`),o=require(`./helpers/persistence.cjs`),s=require(`./babel/plugin.cjs`),c=require(`./helpers/source-file-env.cjs`),l=require(`./helpers/load.cjs`),u=require(`./helpers/create-reflection-resource.cjs`),d=require(`./components/env.cjs`),f=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let p=require(`@alloy-js/core/jsx-runtime`),m=require(`@storm-software/config-tools/types`),h=require(`@stryke/path/is-parent-path`),g=require(`defu`);g=e.__toESM(g);let _=require(`@stryke/string-format/title-case`),v=require(`@stryke/convert/to-array`),y=require(`@stryke/path/join`),b=require(`@stryke/convert/parse-type-definition`),x=require(`@stryke/env/types`),S=require(`@stryke/fs/exists`),C=require(`@stryke/fs/helpers`),w=require(`@stryke/string-format/constant-case`);const T=(e={})=>[r.default(e.alloy),n.default(e.babel),{name:`env`,async config(){this.log(m.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,g.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[s.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,b.parseTypeDefinition)(t.env.types);else{this.log(m.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await o.getEnvDefaultTypeDefinition(this);t.env.types=(0,b.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,b.parseTypeDefinition)(t.env.secrets);else{let e=await o.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,b.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,v.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,w.constantCase)(t);return e.includes(n)||e.push(n),e},[...x.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(m.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,g.default)({parsed:await l.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,S.existsSync)(o.getEnvTypeReflectionsPath(this,`env`)))this.log(m.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await o.readEnvTypeReflection(this,`env`),(0,S.existsSync)(o.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await o.readEnvReflection(this)),(0,S.existsSync)(o.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await o.readEnvTypeReflection(this,`secrets`)),(0,S.existsSync)(o.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await o.readSecretsReflection(this));else{if(this.env.types.env=await a.reflectEnv(this,this.config.env.types?.file?(0,h.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,y.joinPaths)(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await o.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await a.reflectSecrets(this,this.config.env.secrets?.file?(0,h.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,y.joinPaths)(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(m.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await l.loadEnv(this,this.config.env)).forEach(([t,n])=>{let r=this.config.env.prefix.reduce((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,t),i=e.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await o.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await o.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){let e=this;return this.log(m.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,p.createComponent)(d.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}}))},async docs(){this.log(m.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,y.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,S.existsSync)(e)||await(0,C.createDirectory)(e);let n=await o.readEnvTypeReflection(this,`env`),r=(0,y.joinPaths)(e,`env.md`);this.log(m.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,_.titleCase)(this.config.framework)||`Powerlines`} -->
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-babel/src/index.cjs`),r=require(`../../plugin-alloy/src/index.cjs`),i=require(`../../plugin-automd/src/index.cjs`),a=require(`./helpers/reflect.cjs`),o=require(`./helpers/persistence.cjs`),s=require(`./babel/plugin.cjs`),c=require(`./helpers/source-file-env.cjs`),l=require(`./helpers/load.cjs`),u=require(`./helpers/create-reflection-resource.cjs`),d=require(`./components/env.cjs`),f=require(`./helpers/automd-generator.cjs`);require(`./babel/index.cjs`),require(`./components/index.cjs`),require(`./helpers/index.cjs`);let p=require(`@alloy-js/core/jsx-runtime`),m=require(`@storm-software/config-tools/types`),h=require(`@stryke/path/is-parent-path`),g=require(`defu`);g=e.__toESM(g);let _=require(`@stryke/string-format/title-case`),v=require(`@stryke/convert/to-array`),y=require(`@stryke/convert/parse-type-definition`),b=require(`@stryke/env/types`),x=require(`@stryke/fs/exists`),S=require(`@stryke/fs/helpers`),C=require(`@stryke/path/join`),w=require(`@stryke/string-format/constant-case`);const T=(e={})=>[r.default(e.alloy),n.default(e.babel),{name:`env`,async config(){this.log(m.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,g.default)(e,{types:{},prefix:[]}),transform:{babel:{plugins:[s.envBabelPlugin]}}};if(t.env.types)t.env.types=(0,y.parseTypeDefinition)(t.env.types);else{this.log(m.LogLevelLabel.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let e=await o.getEnvDefaultTypeDefinition(this);t.env.types=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}if(t.env.secrets)t.env.secrets=(0,y.parseTypeDefinition)(t.env.secrets);else{let e=await o.getSecretsDefaultTypeDefinition(this);t.env.secrets=(0,y.parseTypeDefinition)(`${e.file}#${e.name}`)}return t.env.prefix=(0,v.toArray)(t.env.prefix??[]).reduce((e,t)=>{let n=(0,w.constantCase)(t);return e.includes(n)||e.push(n),e},[...b.ENV_PREFIXES,`POWERLINES_`]),t.env.prefix=t.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),t},async configResolved(){if(this.log(m.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,g.default)({parsed:await l.loadEnv(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&(0,x.existsSync)(o.getEnvTypeReflectionsPath(this,`env`)))this.log(m.LogLevelLabel.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await o.readEnvTypeReflection(this,`env`),(0,x.existsSync)(o.getEnvReflectionsPath(this,`env`))&&(this.env.used.env=await o.readEnvReflection(this)),(0,x.existsSync)(o.getEnvTypeReflectionsPath(this,`secrets`))&&(this.env.types.secrets=await o.readEnvTypeReflection(this,`secrets`)),(0,x.existsSync)(o.getEnvReflectionsPath(this,`secrets`))&&(this.env.used.secrets=await o.readSecretsReflection(this));else{if(this.env.types.env=await a.reflectEnv(this,this.config.env.types?.file?(0,h.isParentPath)(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await o.writeEnvTypeReflection(this,this.env.types.env,`env`),this.env.types.secrets=await a.reflectSecrets(this,this.config.env.secrets?.file?(0,h.isParentPath)(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:(0,C.joinPaths)(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.log(m.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await l.loadEnv(this,this.config.env)).forEach(([t,n])=>{let r=this.config.env.prefix.reduce((e,n)=>t.replace(/_$/g,``).startsWith(n)?t.replace(/_$/g,``).slice(n.length):e,t),i=e.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await o.writeEnvReflection(this,this.env.used.env,`env`),this.env.types.secrets&&(await o.writeEnvTypeReflection(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await o.writeEnvReflection(this,this.env.used.secrets,`secrets`))}},async prepare(){let e=this;return this.log(m.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,p.createComponent)(d.EnvBuiltin,{get defaultConfig(){return e.config.env.defaultConfig}}))},async docs(){this.log(m.LogLevelLabel.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let e=(0,C.joinPaths)(this.config.projectRoot,`docs`,`generated`);(0,x.existsSync)(e)||await(0,S.createDirectory)(e);let n=await o.readEnvTypeReflection(this,`env`),r=(0,C.joinPaths)(e,`env.md`);this.log(m.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,_.titleCase)(this.config.framework)||`Powerlines`} -->
2
2
 
3
3
  Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
4
 
@@ -1,4 +1,4 @@
1
- import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-babel/src/index.mjs";import n from"../../plugin-alloy/src/index.mjs";import r from"../../plugin-automd/src/index.mjs";import{BaseEnv as i,BaseSecrets as a,createEnvReflection as o,createSecretsReflection as s,mergeEnvReflections as c,mergeSecretsReflections as l,reflectEnv as u,reflectSecrets as d}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as f,getEnvReflectionsPath as p,getEnvTypeReflectionsPath as m,getSecretsDefaultTypeDefinition as h,readEnvReflection as g,readEnvTypeReflection as _,readSecretsReflection as v,resolveRuntimeTypeFile as y,writeEnvReflection as b,writeEnvTypeReflection as x}from"./helpers/persistence.mjs";import{envBabelPlugin as S}from"./babel/plugin.mjs";import{removeEnvPrefix as C}from"./helpers/source-file-env.mjs";import{loadEnv as w,loadEnvFromContext as T}from"./helpers/load.mjs";import{createReflectionResource as E}from"./helpers/create-reflection-resource.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import{env as k}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{createComponent as A}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as j}from"@storm-software/config-tools/types";import{isParentPath as M}from"@stryke/path/is-parent-path";import N from"defu";import{titleCase as P}from"@stryke/string-format/title-case";import{toArray as F}from"@stryke/convert/to-array";import{joinPaths as I}from"@stryke/path/join";import{parseTypeDefinition as L}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as R}from"@stryke/env/types";import{existsSync as z}from"@stryke/fs/exists";import{createDirectory as B}from"@stryke/fs/helpers";import{constantCase as V}from"@stryke/string-format/constant-case";var H=(i={})=>[n(i.alloy),t(i.babel),{name:`env`,async config(){this.log(j.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:N(i,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(e.env.types)e.env.types=L(e.env.types);else{this.log(j.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await f(this);e.env.types=L(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=L(e.env.secrets);else{let t=await h(this);e.env.secrets=L(`${t.file}#${t.name}`)}return e.env.prefix=F(e.env.prefix??[]).reduce((e,t)=>{let n=V(t);return e.includes(n)||e.push(n),e},[...R,`POWERLINES_`]),e.env.prefix=e.env.prefix.reduce((e,t)=>(e.includes(t.replace(/_$/g,``))||e.push(t.replace(/_$/g,``)),e),[]),e},async configResolved(){if(this.log(j.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=N({parsed:await w(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&z(m(this,`env`)))this.log(j.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await _(this,`env`),z(p(this,`env`))&&(this.env.used.env=await g(this)),z(m(this,`secrets`))&&(this.env.types.secrets=await _(this,`secrets`)),z(p(this,`secrets`))&&(this.env.used.secrets=await v(this));else{if(this.env.types.env=await u(this,this.config.env.types?.file?M(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:I(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await x(this,this.env.types.env,`env`),this.env.types.secrets=await d(this,this.config.env.secrets?.file?M(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:I(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await x(this,this.env.types.secrets,`secrets`),this.log(j.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await w(this,this.config.env)).forEach(([e,n])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=t.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await b(this,this.env.used.env,`env`),this.env.types.secrets&&(await x(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await b(this,this.env.used.secrets,`secrets`))}},async prepare(){let e=this;return this.log(j.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(A(D,{get defaultConfig(){return e.config.env.defaultConfig}}))},async docs(){this.log(j.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=I(this.config.projectRoot,`docs`,`generated`);z(t)||await B(t);let n=await _(this,`env`),r=I(t,`env.md`);this.log(j.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${P(this.config.framework)||`Powerlines`} -->
1
+ import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-babel/src/index.mjs";import n from"../../plugin-alloy/src/index.mjs";import r from"../../plugin-automd/src/index.mjs";import{BaseEnv as i,BaseSecrets as a,createEnvReflection as o,createSecretsReflection as s,mergeEnvReflections as c,mergeSecretsReflections as l,reflectEnv as u,reflectSecrets as d}from"./helpers/reflect.mjs";import{getEnvDefaultTypeDefinition as f,getEnvReflectionsPath as p,getEnvTypeReflectionsPath as m,getSecretsDefaultTypeDefinition as h,readEnvReflection as g,readEnvTypeReflection as _,readSecretsReflection as v,resolveRuntimeTypeFile as y,writeEnvReflection as b,writeEnvTypeReflection as x}from"./helpers/persistence.mjs";import{envBabelPlugin as S}from"./babel/plugin.mjs";import{removeEnvPrefix as C}from"./helpers/source-file-env.mjs";import{loadEnv as w,loadEnvFromContext as T}from"./helpers/load.mjs";import{createReflectionResource as E}from"./helpers/create-reflection-resource.mjs";import{EnvBuiltin as D,EnvTypeDefinition as O}from"./components/env.mjs";import{env as k}from"./helpers/automd-generator.mjs";import"./babel/index.mjs";import"./components/index.mjs";import"./helpers/index.mjs";import{createComponent as A}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as j}from"@storm-software/config-tools/types";import{isParentPath as M}from"@stryke/path/is-parent-path";import N from"defu";import{titleCase as P}from"@stryke/string-format/title-case";import{toArray as F}from"@stryke/convert/to-array";import{parseTypeDefinition as I}from"@stryke/convert/parse-type-definition";import{ENV_PREFIXES as L}from"@stryke/env/types";import{existsSync as R}from"@stryke/fs/exists";import{createDirectory as z}from"@stryke/fs/helpers";import{joinPaths as B}from"@stryke/path/join";import{constantCase as V}from"@stryke/string-format/constant-case";var H=(i={})=>[n(i.alloy),t(i.babel),{name:`env`,async config(){this.log(j.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:N(i,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(j.WARN,"The `env.types` configuration parameter was not provided. Please ensure this is expected.");let t=await f(this);e.env.types=I(`${t.file}#${t.name}`)}if(e.env.secrets)e.env.secrets=I(e.env.secrets);else{let t=await h(this);e.env.secrets=I(`${t.file}#${t.name}`)}return e.env.prefix=F(e.env.prefix??[]).reduce((e,t)=>{let n=V(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(j.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=N({parsed:await w(this,this.config.env)},this.env??{},{types:{env:{}},used:{env:{},secrets:{}},parsed:{},injected:{}}),this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&R(m(this,`env`)))this.log(j.TRACE,`Skipping reflection initialization as the meta checksum has not changed.`),this.env.types.env=await _(this,`env`),R(p(this,`env`))&&(this.env.used.env=await g(this)),R(m(this,`secrets`))&&(this.env.types.secrets=await _(this,`secrets`)),R(p(this,`secrets`))&&(this.env.used.secrets=await v(this));else{if(this.env.types.env=await u(this,this.config.env.types?.file?M(this.config.env.types?.file,this.workspaceConfig.workspaceRoot)?this.config.env.types?.file:B(this.config.projectRoot,this.config.env.types?.file):void 0,this.config.env.types?.name),!this.env.types.env)throw Error(`Failed to find the environment configuration type reflection in the context.`);if(await x(this,this.env.types.env,`env`),this.env.types.secrets=await d(this,this.config.env.secrets?.file?M(this.config.env.secrets?.file,this.workspaceConfig.workspaceRoot)?this.config.env.secrets?.file:B(this.config.projectRoot,this.config.env.secrets?.file):void 0,this.config.env.secrets?.name),!this.env.types.secrets)throw Error(`Failed to find the secrets configuration type reflection in the context.`);await x(this,this.env.types.secrets,`secrets`),this.log(j.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await w(this,this.config.env)).forEach(([e,n])=>{let r=this.config.env.prefix.reduce((t,n)=>e.replace(/_$/g,``).startsWith(n)?e.replace(/_$/g,``).slice(n.length):t,e),i=t.find(e=>e?.getAlias().reverse().includes(r));(this.env.types.env?.hasProperty(r)||i)&&this.env.types.env.getProperty(r).setDefaultValue(n)}),this.env.used.env=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`An object containing the environment configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.env),await b(this,this.env.used.env,`env`),this.env.types.secrets&&(await x(this,this.env.types.secrets,`secrets`),this.env.used.secrets=new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`An object containing the secret configuration parameters used by the ${this.config.name?`${this.config.name} application`:`application`}.`,types:[]},this.env.types.secrets),await b(this,this.env.used.secrets,`secrets`))}},async prepare(){let e=this;return this.log(j.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(A(D,{get defaultConfig(){return e.config.env.defaultConfig}}))},async docs(){this.log(j.TRACE,`Writing Environment documentation for the Powerlines project artifacts.`);let t=B(this.config.projectRoot,`docs`,`generated`);R(t)||await z(t);let n=await _(this,`env`),r=B(t,`env.md`);this.log(j.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${P(this.config.framework)||`Powerlines`} -->
2
2
 
3
3
  Below is a list of environment variables used by the [${this.packageJson.name}](https://www.npmjs.com/package/${this.packageJson.name}) package. These values can be updated in the \`.env\` file in the root of the project. The variables in the list below are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text to the public.
4
4
 
@@ -1,7 +1,6 @@
1
1
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.cjs";
2
2
  import { Reflection } from "../../../deepkit/src/types.cjs";
3
3
  import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "../../../plugin-alloy/src/types/plugin.cjs";
4
- import "../../../plugin-alloy/src/types/index.cjs";
5
4
  import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
6
5
  import { EnvInterface, SecretsInterface } from "./runtime.cjs";
7
6
  import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
@@ -1,14 +1,14 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/type-checks/is-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/string-format/camel-case`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/helpers/omit`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync((0,a.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,i.camelCase)(e)!==e){if(t.length===1)return`
2
- import ${(0,i.camelCase)(e)} from "${t[0]}";
3
- export { ${(0,i.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
4
- import ${t[1]===`*`?`* as ${(0,i.camelCase)(e)}`:`{ ${t[1]} as ${(0,i.camelCase)(e)} }`} from "${t[0]}";
5
- export { ${(0,i.camelCase)(e)} as "${e}" }`}else if(t.length===1)return`
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/type-checks/is-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/path/join-paths`),a=require(`@stryke/helpers/omit`),o=require(`@stryke/string-format/camel-case`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let n=e.config.build.override.inject??e.config.build.inject;return n&&Object.keys(n).length>0&&e.fs.writeSync((0,i.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,o.camelCase)(e)!==e){if(t.length===1)return`
2
+ import ${(0,o.camelCase)(e)} from "${t[0]}";
3
+ export { ${(0,o.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
4
+ import ${t[1]===`*`?`* as ${(0,o.camelCase)(e)}`:`{ ${t[1]} as ${(0,o.camelCase)(e)} }`} from "${t[0]}";
5
+ export { ${(0,o.camelCase)(e)} as "${e}" }`}else if(t.length===1)return`
6
6
  import ${e} from "${t[0]}";
7
7
  export { ${e} };`;else if(t.length>1)return`
8
8
  import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
9
- export { ${e} };`}else if((0,i.camelCase)(e)!==e)return`
10
- import ${(0,i.camelCase)(e)} from "${t[0]}";
11
- export { ${(0,i.camelCase)(e)} as "${e}" }`;else return`
9
+ export { ${e} };`}else if((0,o.camelCase)(e)!==e)return`
10
+ import ${(0,o.camelCase)(e)} from "${t[0]}";
11
+ export { ${(0,o.camelCase)(e)} as "${e}" }`;else return`
12
12
  import ${e} from "${t}";
13
13
  export { ${e} };`;return``}).join(`
14
- `)),(0,t.default)({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?(0,o.omit)(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?(0,o.omit)(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},s)}exports.extractESBuildConfig=c;
14
+ `)),(0,t.default)({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[(0,i.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?(0,a.omit)(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?(0,a.omit)(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},s)}exports.extractESBuildConfig=c;
@@ -1,14 +1,14 @@
1
- import"../entry.mjs";import e from"defu";import{isString as t}from"@stryke/type-checks/is-string";import{replacePath as n}from"@stryke/path/replace";import{camelCase as r}from"@stryke/string-format/camel-case";import{joinPaths as i}from"@stryke/path/join-paths";import{omit as a}from"@stryke/helpers/omit";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(t){let n=t.config.build.override.inject??t.config.build.inject;return n&&Object.keys(n).length>0&&t.fs.writeSync(i(t.workspaceConfig.workspaceRoot,t.config.projectRoot,t.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if(r(e)!==e){if(t.length===1)return`
2
- import ${r(e)} from "${t[0]}";
3
- export { ${r(e)} as "${e}" }`;if(t.length>1)return`
4
- import ${t[1]===`*`?`* as ${r(e)}`:`{ ${t[1]} as ${r(e)} }`} from "${t[0]}";
5
- export { ${r(e)} as "${e}" }`}else if(t.length===1)return`
1
+ import"../entry.mjs";import e from"defu";import{isString as t}from"@stryke/type-checks/is-string";import{replacePath as n}from"@stryke/path/replace";import{joinPaths as r}from"@stryke/path/join-paths";import{omit as i}from"@stryke/helpers/omit";import{camelCase as a}from"@stryke/string-format/camel-case";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(t){let n=t.config.build.override.inject??t.config.build.inject;return n&&Object.keys(n).length>0&&t.fs.writeSync(r(t.workspaceConfig.workspaceRoot,t.config.projectRoot,t.artifactsPath,`inject-shim.js`),Object.entries(n).map(([e,t])=>{if(t)if(Array.isArray(t)){if(a(e)!==e){if(t.length===1)return`
2
+ import ${a(e)} from "${t[0]}";
3
+ export { ${a(e)} as "${e}" }`;if(t.length>1)return`
4
+ import ${t[1]===`*`?`* as ${a(e)}`:`{ ${t[1]} as ${a(e)} }`} from "${t[0]}";
5
+ export { ${a(e)} as "${e}" }`}else if(t.length===1)return`
6
6
  import ${e} from "${t[0]}";
7
7
  export { ${e} };`;else if(t.length>1)return`
8
8
  import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
9
- export { ${e} };`}else if(r(e)!==e)return`
10
- import ${r(e)} from "${t[0]}";
11
- export { ${r(e)} as "${e}" }`;else return`
9
+ export { ${e} };`}else if(a(e)!==e)return`
10
+ import ${a(e)} from "${t[0]}";
11
+ export { ${a(e)} as "${e}" }`;else return`
12
12
  import ${e} from "${t}";
13
13
  export { ${e} };`;return``}).join(`
14
- `)),e({alias:t.builtins.reduce((e,n)=>{if(!e[n]){let r=t.fs.ids[n];r&&(e[n]=r)}return e},t.config.build.alias?Array.isArray(t.config.build.alias)?t.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):t.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[i(t.workspaceConfig.workspaceRoot,t.config.projectRoot,t.artifactsPath,`inject-shim.js`)]:void 0},t.config.build.variant===`esbuild`?a(t.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},t.config.build.variant===`esbuild`?a(t.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:t.config.build.mainFields,conditions:t.config.build.conditions,define:t.config.build.define,resolveExtensions:t.config.build.extensions,packages:t.config.build.skipNodeModulesBundle?`external`:t.config.build.variant===`esbuild`?t.config.build.packages:void 0,format:Array.isArray(t.config.output.format)?t.config.output.format[0]:t.config.output.format,platform:t.config.build.platform,treeShaking:!!t.config.build?.treeshake||t.config.build?.treeShaking,outdir:t.config.output.buildPath,tsconfig:t.tsconfig.tsconfigFilePath,minify:t.config.mode!==`development`,metafile:t.config.mode===`development`,sourcemap:t.config.mode===`development`},o)}export{s as extractESBuildConfig};
14
+ `)),e({alias:t.builtins.reduce((e,n)=>{if(!e[n]){let r=t.fs.ids[n];r&&(e[n]=r)}return e},t.config.build.alias?Array.isArray(t.config.build.alias)?t.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):t.config.build.alias:{}),inject:n&&Object.keys(n).length>0?[r(t.workspaceConfig.workspaceRoot,t.config.projectRoot,t.artifactsPath,`inject-shim.js`)]:void 0},t.config.build.variant===`esbuild`?i(t.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},t.config.build.variant===`esbuild`?i(t.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:t.config.build.mainFields,conditions:t.config.build.conditions,define:t.config.build.define,resolveExtensions:t.config.build.extensions,packages:t.config.build.skipNodeModulesBundle?`external`:t.config.build.variant===`esbuild`?t.config.build.packages:void 0,format:Array.isArray(t.config.output.format)?t.config.output.format[0]:t.config.output.format,platform:t.config.build.platform,treeShaking:!!t.config.build?.treeshake||t.config.build?.treeShaking,outdir:t.config.output.buildPath,tsconfig:t.tsconfig.tsconfigFilePath,minify:t.config.mode!==`development`,metafile:t.config.mode===`development`,sourcemap:t.config.mode===`development`},o)}export{s as extractESBuildConfig};
@@ -1 +1 @@
1
- require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/type-checks/is-set-string`),t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/path/replace`),r=require(`@stryke/path/append`),i=require(`@stryke/helpers/get-unique`),a=require(`@stryke/convert/to-array`),o=require(`@stryke/path/join-paths`),s=require(`@stryke/fs/is-file`),c=require(`@stryke/fs/list-files`),l=require(`@stryke/convert/parse-type-definition`);require(`@stryke/hash/murmurhash`);
1
+ require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/type-checks/is-set-string`),t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/path/replace`),r=require(`@stryke/convert/to-array`),i=require(`@stryke/fs/is-file`),a=require(`@stryke/fs/list-files`),o=require(`@stryke/path/append`),s=require(`@stryke/path/join-paths`),c=require(`@stryke/convert/parse-type-definition`),l=require(`@stryke/helpers/get-unique`);require(`@stryke/hash/murmurhash`);
@@ -1 +1 @@
1
- import"../plugin-utils/paths.mjs";import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isString as t}from"@stryke/type-checks/is-string";import{replacePath as n}from"@stryke/path/replace";import{appendPath as r}from"@stryke/path/append";import{getUniqueBy as i}from"@stryke/helpers/get-unique";import{toArray as a}from"@stryke/convert/to-array";import{joinPaths as o}from"@stryke/path/join-paths";import"@stryke/fs/is-file";import{listFiles as s}from"@stryke/fs/list-files";import{parseTypeDefinition as c}from"@stryke/convert/parse-type-definition";import"@stryke/hash/murmurhash";export{};
1
+ import"../plugin-utils/paths.mjs";import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isString as t}from"@stryke/type-checks/is-string";import{replacePath as n}from"@stryke/path/replace";import{toArray as r}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as i}from"@stryke/fs/list-files";import{appendPath as a}from"@stryke/path/append";import{joinPaths as o}from"@stryke/path/join-paths";import{parseTypeDefinition as s}from"@stryke/convert/parse-type-definition";import{getUniqueBy as c}from"@stryke/helpers/get-unique";import"@stryke/hash/murmurhash";export{};
@@ -1,3 +1,5 @@
1
+ import "esbuild";
2
+
1
3
  //#region ../powerlines/src/types/build.d.ts
2
4
 
3
5
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
@@ -1,3 +1,4 @@
1
+ import "./build.mjs";
1
2
  import { BabelUserConfig, EnvironmentConfig, InlineConfig, OutputConfig, UserConfig } from "./config.mjs";
2
3
  import { NonUndefined } from "@stryke/types/base";
3
4
  import { ResolvedPreviewOptions } from "vite";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.112",
3
+ "version": "0.1.114",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for building a React application.",
6
6
  "repository": {
@@ -140,9 +140,9 @@
140
140
  "@alloy-js/json": "^0.22.0",
141
141
  "@alloy-js/markdown": "^0.22.0",
142
142
  "@alloy-js/typescript": "^0.22.0",
143
- "@powerlines/plugin-alloy": "^0.15.5",
144
- "@powerlines/plugin-babel": "^0.12.117",
145
- "@powerlines/plugin-env": "^0.14.11",
143
+ "@powerlines/plugin-alloy": "^0.15.7",
144
+ "@powerlines/plugin-babel": "^0.12.119",
145
+ "@powerlines/plugin-env": "^0.14.13",
146
146
  "@storm-software/config-tools": "^1.188.74",
147
147
  "@stryke/cli": "^0.12.36",
148
148
  "@stryke/convert": "^0.6.29",
@@ -151,7 +151,7 @@
151
151
  "@vitejs/plugin-react": "^5.1.2",
152
152
  "babel-plugin-react-compiler": "^1.0.0",
153
153
  "defu": "^6.1.4",
154
- "powerlines": "^0.36.13"
154
+ "powerlines": "^0.36.15"
155
155
  },
156
156
  "devDependencies": {
157
157
  "@babel/core": "^7.28.5",
@@ -162,5 +162,5 @@
162
162
  "react-dom": "^19.2.3"
163
163
  },
164
164
  "publishConfig": { "access": "public" },
165
- "gitHead": "483677f34524b653a72b313c463081c800043753"
165
+ "gitHead": "7e415f360c9011a40e8ae2a0b8b7cc92ba94076f"
166
166
  }
@@ -1 +0,0 @@
1
- var e=require(`@deepkit/core`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -1 +0,0 @@
1
- export*from"@deepkit/core";export{};
@@ -1 +0,0 @@
1
- const e=require(`./output.cjs`);require(`./single-line-comment.cjs`),require(`./source-file.cjs`);
@@ -1 +0,0 @@
1
- import{Output as e}from"./output.mjs";import"./single-line-comment.mjs";import"./source-file.mjs";export{};
@@ -1 +0,0 @@
1
- let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);
@@ -1 +0,0 @@
1
- import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import"@alloy-js/core";export{};
@@ -1 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`defu`);n=e.__toESM(n);let r=require(`@alloy-js/core`),i=require(`@stryke/path/append`);
@@ -1 +0,0 @@
1
- import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import n from"defu";import{Show as r,splitProps as i}from"@alloy-js/core";import{appendPath as a}from"@stryke/path/append";export{};
@@ -1 +0,0 @@
1
- const e=require(`./context.cjs`);require(`./reflection.cjs`);
@@ -1 +0,0 @@
1
- import{PowerlinesContext as e}from"./context.mjs";import"./reflection.mjs";export{};
@@ -1 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createContext)(),r=(0,t.createNamedContext)(`reflection-property`),i=(0,t.createNamedContext)(`reflection-method`),a=(0,t.createNamedContext)(`reflection-parameter`);
@@ -1 +0,0 @@
1
- import{createContext as e,createNamedContext as t}from"@alloy-js/core";e(),t(`reflection-property`),t(`reflection-method`),t(`reflection-parameter`);export{};
@@ -1 +0,0 @@
1
- const e=require(`./contexts/context.cjs`),t=require(`./components/output.cjs`);require(`./components/index.cjs`),require(`./contexts/index.cjs`);
@@ -1 +0,0 @@
1
- import{PowerlinesContext as e}from"./contexts/context.mjs";import{Output as t}from"./components/output.mjs";import"./components/index.mjs";import"./contexts/index.mjs";export{};
@@ -1 +0,0 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`../../../deepkit/src/vendor/type.cjs`),require(`../../../deepkit/src/utilities.cjs`),require(`../../../deepkit/src/vendor/core.cjs`),require(`../../../powerlines/src/lib/utilities/file-header.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/string-format/title-case`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/helpers/get-unique`),a=require(`@stryke/type-checks/is-null`),o=require(`@stryke/type-checks/is-undefined`);require(`@stryke/capnp/compile`),require(`@stryke/capnp/helpers`);let s=require(`@stryke/convert/to-array`);require(`@stryke/json`);let c=require(`@stryke/path/join`),l=require(`@stryke/string-format/camel-case`);require(`@stryke/string-format/get-words`),require(`@stryke/string-format/pascal-case`),require(`@stryke/type-checks/is-bigint`),require(`@stryke/type-checks/is-number`);let u=require(`node:child_process`),d=require(`node:util`);const f=1024*1e6,p=(0,d.promisify)(u.exec);
@@ -1 +0,0 @@
1
- import"../../../deepkit/src/vendor/type.mjs";import"../../../deepkit/src/utilities.mjs";import"../../../deepkit/src/vendor/core.mjs";import"../../../powerlines/src/lib/utilities/file-header.mjs";import e from"defu";import{titleCase as t}from"@stryke/string-format/title-case";import{isString as n}from"@stryke/type-checks/is-string";import{getUniqueBy as r}from"@stryke/helpers/get-unique";import{isNull as i}from"@stryke/type-checks/is-null";import{isUndefined as a}from"@stryke/type-checks/is-undefined";import"@stryke/capnp/compile";import"@stryke/capnp/helpers";import{toArray as o}from"@stryke/convert/to-array";import"@stryke/json";import{joinPaths as s}from"@stryke/path/join";import{camelCase as c}from"@stryke/string-format/camel-case";import"@stryke/string-format/get-words";import"@stryke/string-format/pascal-case";import"@stryke/type-checks/is-bigint";import"@stryke/type-checks/is-number";import{exec as l}from"node:child_process";import{promisify as u}from"node:util";u(l);export{};
@@ -1 +0,0 @@
1
- let e=require(`@alloy-js/typescript`);
@@ -1 +0,0 @@
1
- import"@alloy-js/typescript";export{};
@@ -1 +0,0 @@
1
- require(`./capnp.cjs`),require(`./create-builtin.cjs`),require(`./refkey.cjs`),require(`./typescript.cjs`);
@@ -1 +0,0 @@
1
- import"./capnp.mjs";import"./create-builtin.mjs";import"./refkey.mjs";import"./typescript.mjs";export{};
@@ -1 +0,0 @@
1
- let e=require(`@alloy-js/core`);
@@ -1 +0,0 @@
1
- import"@alloy-js/core";export{};
@@ -1 +0,0 @@
1
- require(`../../../deepkit/src/utilities.cjs`);let e=require(`@stryke/string-format/title-case`),t=require(`@stryke/type-checks/is-undefined`),n=require(`@stryke/string-format/camel-case`);
@@ -1 +0,0 @@
1
- import"../../../deepkit/src/utilities.mjs";import{titleCase as e}from"@stryke/string-format/title-case";import{isUndefined as t}from"@stryke/type-checks/is-undefined";import{camelCase as n}from"@stryke/string-format/camel-case";export{};
@@ -1 +0,0 @@
1
- require(`./markdown-file.cjs`),require(`./markdown-table.cjs`);
@@ -1 +0,0 @@
1
- import"./markdown-file.mjs";import"./markdown-table.mjs";export{};
@@ -1 +0,0 @@
1
- require(`../../core/contexts/context.cjs`),require(`../../core/components/single-line-comment.cjs`),require(`../../core/components/source-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/string-format/title-case`),n=require(`@alloy-js/core`);require(`@alloy-js/markdown`);
@@ -1 +0,0 @@
1
- import"../../core/contexts/context.mjs";import"../../core/components/single-line-comment.mjs";import"../../core/components/source-file.mjs";import{createComponent as e,createIntrinsic as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{titleCase as r}from"@stryke/string-format/title-case";import{Show as i,code as a,splitProps as o}from"@alloy-js/core";import"@alloy-js/markdown";export{};
@@ -1 +0,0 @@
1
- require(`../contexts/markdown-table.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/string-format/title-case`),n=require(`@alloy-js/core`),r=require(`@stryke/type-checks/is-undefined`);
@@ -1 +0,0 @@
1
- import"../contexts/markdown-table.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{titleCase as n}from"@stryke/string-format/title-case";import{Show as r,code as i,computed as a,splitProps as o}from"@alloy-js/core";import{isUndefined as s}from"@stryke/type-checks/is-undefined";export{};
@@ -1 +0,0 @@
1
- require(`./markdown-table.cjs`);
@@ -1 +0,0 @@
1
- import"./markdown-table.mjs";export{};
@@ -1 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createNamedContext)(`markdown-table-column`,{}),r=(0,t.createContext)({columns:[],data:[]});
@@ -1 +0,0 @@
1
- import{createContext as e,createNamedContext as t}from"@alloy-js/core";t(`markdown-table-column`,{}),e({columns:[],data:[]});export{};
@@ -1 +0,0 @@
1
- require(`./components/index.cjs`),require(`./contexts/index.cjs`);
@@ -1 +0,0 @@
1
- import"./components/index.mjs";import"./contexts/index.mjs";export{};
@@ -1,2 +0,0 @@
1
- import "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
@@ -1,2 +0,0 @@
1
- import "./components.cjs";
2
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.cjs";
@@ -1 +0,0 @@
1
- require(`./tsdoc.cjs`),require(`./typescript-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);
@@ -1 +0,0 @@
1
- import"./tsdoc.mjs";import"./typescript-file.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{splitProps as n}from"@alloy-js/core";export{};
@@ -1 +0,0 @@
1
- let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@alloy-js/typescript`);
@@ -1 +0,0 @@
1
- import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{code as n}from"@alloy-js/core";import{VarDeclaration as r}from"@alloy-js/typescript";export{};
@@ -1 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../../core/contexts/context.cjs`),require(`./typescript-file.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`defu`);n=e.__toESM(n);let r=require(`@alloy-js/core`),i=require(`@stryke/path/join-paths`);
@@ -1 +0,0 @@
1
- import"../../core/contexts/context.mjs";import"./typescript-file.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import n from"defu";import{computed as r,splitProps as i}from"@alloy-js/core";import{joinPaths as a}from"@stryke/path/join-paths";export{};
@@ -1 +0,0 @@
1
- require(`./tsdoc.cjs`),require(`./typescript-file.cjs`),require(`./builtin-file.cjs`),require(`./dynamic-import-statement.cjs`),require(`./entry-file.cjs`),require(`./record-expression.cjs`),require(`./tsdoc-reflection.cjs`),require(`./typescript-interface.cjs`),require(`./typescript-object.cjs`);
@@ -1 +0,0 @@
1
- import"./tsdoc.mjs";import"./typescript-file.mjs";import"./builtin-file.mjs";import"./dynamic-import-statement.mjs";import"./entry-file.mjs";import"./record-expression.mjs";import"./tsdoc-reflection.mjs";import"./typescript-interface.mjs";import"./typescript-object.mjs";export{};
@@ -1 +0,0 @@
1
- let e=require(`@alloy-js/core`);
@@ -1 +0,0 @@
1
- import{code as e}from"@alloy-js/core";export{};
@@ -1 +0,0 @@
1
- require(`../../core/contexts/reflection.cjs`),require(`./tsdoc.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/string-format/title-case`),r=require(`@stryke/type-checks/is-string`),i=require(`@alloy-js/core`),a=require(`@stryke/type-checks/is-undefined`);
@@ -1 +0,0 @@
1
- import"../../core/contexts/reflection.mjs";import"./tsdoc.mjs";import{createComponent as e,memo as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{isSetString as r}from"@stryke/type-checks/is-set-string";import{titleCase as i}from"@stryke/string-format/title-case";import{isString as a}from"@stryke/type-checks/is-string";import{Show as o,code as s,computed as c,splitProps as l}from"@alloy-js/core";import{isUndefined as u}from"@stryke/type-checks/is-undefined";export{};
@@ -1 +0,0 @@
1
- require(`../../core/contexts/context.cjs`),require(`../../../../deepkit/src/utilities.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@alloy-js/core`),r=require(`@stryke/type-checks/is-undefined`);
@@ -1 +0,0 @@
1
- import"../../core/contexts/context.mjs";import"../../../../deepkit/src/utilities.mjs";import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{isSetString as i}from"@stryke/type-checks/is-set-string";import{For as a,Show as o,splitProps as s}from"@alloy-js/core";import{isUndefined as c}from"@stryke/type-checks/is-undefined";export{};
@@ -1 +0,0 @@
1
- require(`../../core/contexts/context.cjs`),require(`../../core/components/single-line-comment.cjs`),require(`../../core/components/source-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/string-format/title-case`),n=require(`@stryke/type-checks/is-string`),r=require(`@alloy-js/core`),i=require(`@stryke/path/append`),a=require(`@alloy-js/typescript`);require(`@stryke/type-checks/is-boolean`);
@@ -1 +0,0 @@
1
- import"../../core/contexts/context.mjs";import"../../core/components/single-line-comment.mjs";import"../../core/components/source-file.mjs";import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{titleCase as i}from"@stryke/string-format/title-case";import{isString as a}from"@stryke/type-checks/is-string";import{Show as o,code as s,splitProps as c}from"@alloy-js/core";import{appendPath as l}from"@stryke/path/append";import"@alloy-js/typescript";import"@stryke/type-checks/is-boolean";export{};
@@ -1 +0,0 @@
1
- require(`../../../../deepkit/src/vendor/type.cjs`),require(`../../core/contexts/reflection.cjs`),require(`./tsdoc-reflection.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/type-checks/is-string`),n=require(`@alloy-js/core`);require(`@stryke/string-format/pascal-case`);let r=require(`@alloy-js/typescript`);
@@ -1 +0,0 @@
1
- import"../../../../deepkit/src/vendor/type.mjs";import"../../core/contexts/reflection.mjs";import"./tsdoc-reflection.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{isString as n}from"@stryke/type-checks/is-string";import{For as r,computed as i,splitProps as a}from"@alloy-js/core";import"@stryke/string-format/pascal-case";import"@alloy-js/typescript";export{};
@@ -1 +0,0 @@
1
- require(`../../core/contexts/reflection.cjs`),require(`../../../../deepkit/src/utilities.cjs`),require(`./tsdoc-reflection.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/type-checks/is-string`),n=require(`@alloy-js/core`),r=require(`@stryke/type-checks/is-undefined`),i=require(`@stryke/string-format/camel-case`);require(`@stryke/string-format/pascal-case`);let a=require(`@alloy-js/typescript`);
@@ -1 +0,0 @@
1
- import"../../core/contexts/reflection.mjs";import"../../../../deepkit/src/utilities.mjs";import"./tsdoc-reflection.mjs";import{createComponent as e,createIntrinsic as t,memo as n}from"@alloy-js/core/jsx-runtime";import{isString as r}from"@stryke/type-checks/is-string";import{For as i,Show as a,computed as o,splitProps as s}from"@alloy-js/core";import{isUndefined as c}from"@stryke/type-checks/is-undefined";import{camelCase as l}from"@stryke/string-format/camel-case";import"@stryke/string-format/pascal-case";import"@alloy-js/typescript";export{};
@@ -1 +0,0 @@
1
- require(`./components/index.cjs`);
@@ -1 +0,0 @@
1
- import"./components/index.mjs";export{};
@@ -1 +0,0 @@
1
- let e=require(`@stryke/string-format/title-case`);
@@ -1 +0,0 @@
1
- import{titleCase as e}from"@stryke/string-format/title-case";export{};