@powerlines/plugin-react 0.1.121 → 0.1.122

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.
@@ -1,3 +1,4 @@
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
1
2
  import { BuiltinFileProps } from "@powerlines/alloy/typescript/components/builtin-file";
2
3
 
3
4
  //#region src/components/react-optimized.d.ts
@@ -7,7 +8,7 @@ interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
7
8
  /**
8
9
  * Generates the `react/optimized` builtin module for the Powerlines project.
9
10
  */
10
- declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): void 0;
11
+ declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
11
12
  declare type __ΩReactOptimizedBuiltinProps = any[];
12
13
  //#endregion
13
14
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1 +1 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../vendor/index.cjs`),n=require(`../contexts/context.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@stryke/path/replace`);function a(e){let[{children:a,context:o,basePath:s},c]=(0,t.vendor_exports.splitProps)(e,[`children`,`context`,`basePath`]),l=(0,t.vendor_exports.ref)(o),u=(0,t.vendor_exports.computed)(()=>s?(0,i.replacePath)(s,l.value.workspaceConfig.workspaceRoot):l.value.workspaceConfig.workspaceRoot);return(0,r.createComponent)(t.vendor_exports.Output,(0,r.mergeProps)(c,{get basePath(){return u.value},get children(){return(0,r.createComponent)(n.PowerlinesContext.Provider,{value:{ref:l},get children(){return(0,r.createComponent)(t.vendor_exports.Show,{get when(){return!!l.value},children:a})}})}}))}exports.Output=a;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../contexts/context.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@stryke/path/replace`);function a(e){let[{children:a,context:o,meta:s,basePath:c},l]=(0,r.splitProps)(e,[`children`,`context`,`meta`,`basePath`]),u=(0,r.ref)(o),d=(0,r.ref)(s??{}),f=(0,r.computed)(()=>c?(0,i.replacePath)(c,u.value.workspaceConfig.workspaceRoot):u.value.workspaceConfig.workspaceRoot);return(0,n.createComponent)(r.Output,(0,n.mergeProps)(l,{get basePath(){return f.value},get children(){return(0,n.createComponent)(t.PowerlinesContext.Provider,{value:{ref:u,meta:d},get children(){return(0,n.createComponent)(r.Show,{get when(){return!!u.value},children:a})}})}}))}exports.Output=a;
@@ -1 +1 @@
1
- import{vendor_exports as e}from"../../vendor/index.mjs";import{PowerlinesContext as t}from"../contexts/context.mjs";import{createComponent as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{replacePath as i}from"@stryke/path/replace";function a(a){let[{children:o,context:s,basePath:c},l]=(0,e.splitProps)(a,[`children`,`context`,`basePath`]),u=(0,e.ref)(s),d=(0,e.computed)(()=>c?i(c,u.value.workspaceConfig.workspaceRoot):u.value.workspaceConfig.workspaceRoot);return n(e.Output,r(l,{get basePath(){return d.value},get children(){return n(t.Provider,{value:{ref:u},get children(){return n(e.Show,{get when(){return!!u.value},children:o})}})}}))}export{a as Output};
1
+ import{PowerlinesContext as e}from"../contexts/context.mjs";import{createComponent as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Output as r,Show as i,computed as a,ref as o,splitProps as s}from"@alloy-js/core";import{replacePath as c}from"@stryke/path/replace";function l(l){let[{children:u,context:d,meta:f,basePath:p},m]=s(l,[`children`,`context`,`meta`,`basePath`]),h=o(d),g=o(f??{}),_=a(()=>p?c(p,h.value.workspaceConfig.workspaceRoot):h.value.workspaceConfig.workspaceRoot);return t(r,n(m,{get basePath(){return _.value},get children(){return t(e.Provider,{value:{ref:h,meta:g},get children(){return t(i,{get when(){return!!h.value},children:u})}})}}))}export{l as Output};
@@ -1 +1 @@
1
- const e=require(`../../vendor/index.cjs`),t=(0,e.vendor_exports.createNamedContext)(`powerlines`);exports.PowerlinesContext=t;
1
+ const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createNamedContext)(`powerlines`);exports.PowerlinesContext=n;
@@ -1 +1 @@
1
- import{vendor_exports as e}from"../../vendor/index.mjs";const t=(0,e.createNamedContext)(`powerlines`);export{t as PowerlinesContext};
1
+ import{createNamedContext as e}from"@alloy-js/core";const t=e(`powerlines`);export{t as PowerlinesContext};
@@ -1,2 +1 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/index.cjs`),n=require(`./core/components/output.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/rollup-plugin`);s=e.__toESM(s);let c=require(`@stryke/json/storm-json`),l=require(`@stryke/path/replace`),u=require(`prettier/doc.js`),d=require(`rolldown/experimental`);const f=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@powerlines/plugin-alloy/vendor`}}},plugins:[(0,s.default)(),(0,d.viteAliasPlugin)({entries:[{find:`@alloy-js/core`,replacement:`@powerlines/plugin-alloy/vendor`},{find:`@alloy-js/core/jsx-runtime`,replacement:`@powerlines/plugin-alloy/vendor/jsx-runtime`}]})],alias:{"@alloy-js/core":`@powerlines/plugin-alloy/vendor`,"@alloy-js/core/jsx-runtime":`@powerlines/plugin-alloy/vendor/jsx-runtime`}}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@powerlines/plugin-alloy/vendor`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@powerlines/plugin-alloy/vendor`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@powerlines/plugin-alloy/vendor`),await this.fs.write(this.tsconfig.tsconfigFilePath,c.StormJSON.stringify(this.tsconfig.tsconfigJson))),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/vendor`,external:!0}:e===`@alloy-js/core/jsx-runtime`?{id:`@powerlines/plugin-alloy/vendor/jsx-runtime`,external:!0}:null}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let i=this,a=(0,t.vendor_exports.renderTree)((0,r.createComponent)(n.Output,{context:i,get basePath(){return i.workspaceConfig.workspaceRoot},children:e}));await m(this,a,this.config.alloy)}}}}];var p=f;async function m(e,n,r={}){await(0,t.vendor_exports.flushJobsAsync)();let s,c=async(n,o)=>{if(!Array.isArray(o))return;let u=async e=>{for(let t of o)await c(e,t)},d=(0,t.vendor_exports.getContextForRenderNode)(o);if(!d)return u(n);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};n?n.contents.push(e):s=e,await u(e)}else if(d.meta?.sourceFile){if(!n)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let t;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}`),t={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 h(e,o,r)}}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}`),t={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,r)}):(e.log(i.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),t={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,r)});n.contents.push(t)}else if(d.meta?.copyFile){if(!n)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.");n.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await u(n)};await c(void 0,n);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,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 u(e,s)}async function h(e,n,r={}){r.printWidth??=160,r.tabWidth??=2,r.useTabs??=!1,r.insertFinalNewLine??=!0,await(0,t.vendor_exports.flushJobsAsync)();let i=u.printer.printDocToString(g(n),r).formatted;return r.insertFinalNewLine&&!i.endsWith(`
2
- `)?`${i}\n`:i}function g(e){let n=[];for(let r of e)if(typeof r==`string`){let e=r.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));n.push(e)}else (0,t.vendor_exports.isPrintHook)(r)?n.push(r.print(r.subtree,g)):n.push(g(r));return n}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(`@alloy-js/core`),i=require(`@alloy-js/rollup-plugin`);i=e.__toESM(i);let a=require(`@stryke/json/storm-json`);const o=(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,i.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,a.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 i=this,a={};await(0,r.traverseOutput)(await(0,r.renderAsync)((0,n.createComponent)(t.Output,{context:i,meta:a,get basePath(){return i.workspaceConfig.workspaceRoot},children:e})),{visitDirectory:e=>{this.fs.existsSync(e.path)||this.fs.mkdirSync(e.path)},visitFile:e=>{if(`contents`in e){let t=a[e.path]??{};if(t.kind===`builtin`){if(!t.id)throw Error(`Built-in file "${e.path}" is missing its ID in the render metadata.`);this.emitBuiltinSync(e.contents,t.id,e.path,{skipFormat:t.skipFormat,storage:t.storage})}else t.kind===`entry`?this.emitEntrySync(e.contents,e.path,{skipFormat:t.skipFormat,storage:t.storage,...t.typeDefinition??{}}):this.fs.writeSync(e.path,e.contents)}else this.fs.copySync(e.sourcePath,e.path)}})}}}}];var s=o;exports.default=s;
@@ -1,2 +1 @@
1
- import{vendor_exports as e}from"./vendor/index.mjs";import{Output as t}from"./core/components/output.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 o from"@alloy-js/rollup-plugin";import{StormJSON as s}from"@stryke/json/storm-json";import{replacePath as c}from"@stryke/path/replace";import{printer as l}from"prettier/doc.js";import{viteAliasPlugin as u}from"rolldown/experimental";var d=(r={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...r},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@powerlines/plugin-alloy/vendor`}}},plugins:[o(),u({entries:[{find:`@alloy-js/core`,replacement:`@powerlines/plugin-alloy/vendor`},{find:`@alloy-js/core/jsx-runtime`,replacement:`@powerlines/plugin-alloy/vendor/jsx-runtime`}]})],alias:{"@alloy-js/core":`@powerlines/plugin-alloy/vendor`,"@alloy-js/core/jsx-runtime":`@powerlines/plugin-alloy/vendor/jsx-runtime`}}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@powerlines/plugin-alloy/vendor`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@powerlines/plugin-alloy/vendor`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@powerlines/plugin-alloy/vendor`),await this.fs.write(this.tsconfig.tsconfigFilePath,s.stringify(this.tsconfig.tsconfigJson))),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/vendor`,external:!0}:e===`@alloy-js/core/jsx-runtime`?{id:`@powerlines/plugin-alloy/vendor/jsx-runtime`,external:!0}:null}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async r=>{let i=this,a=(0,e.renderTree)(n(t,{context:i,get basePath(){return i.workspaceConfig.workspaceRoot},children:r}));await f(this,a,this.config.alloy)}}}}];async function f(t,n,o={}){await(0,e.flushJobsAsync)();let s,l=async(n,a)=>{if(!Array.isArray(a))return;let u=async e=>{for(let t of a)await l(e,t)},d=(0,e.getContextForRenderNode)(a);if(!d)return u(n);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};n?n.contents.push(e):s=e,await u(e)}else if(d.meta?.sourceFile){if(!n)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let e;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.");t.log(r.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),e={kind:`builtin`,id:d.meta.builtin.id,path:c(d.meta.sourceFile.path,t.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await p(t,a,o)}}else d.meta?.entry||i(t.entryPath,d.meta.sourceFile.path)?(t.log(r.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),e={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await p(t,a,o)}):(t.log(r.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),e={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await p(t,a,o)});n.contents.push(e)}else if(d.meta?.copyFile){if(!n)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(t.log(r.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.");n.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await u(n)};await l(void 0,n);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(t,s)}async function p(t,n,r={}){r.printWidth??=160,r.tabWidth??=2,r.useTabs??=!1,r.insertFinalNewLine??=!0,await(0,e.flushJobsAsync)();let i=l.printDocToString(m(n),r).formatted;return r.insertFinalNewLine&&!i.endsWith(`
2
- `)?`${i}\n`:i}function m(t){let n=[];for(let r of t)if(typeof r==`string`){let e=r.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));n.push(e)}else (0,e.isPrintHook)(r)?n.push(r.print(r.subtree,m)):n.push(m(r));return n}export{d as default};
1
+ import{Output as e}from"./core/components/output.mjs";import{createComponent as t}from"@alloy-js/core/jsx-runtime";import{renderAsync as n,traverseOutput as r}from"@alloy-js/core";import i from"@alloy-js/rollup-plugin";import{StormJSON as a}from"@stryke/json/storm-json";var o=(o={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...o},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[i()]}}},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,a.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 i=>{let a=this,o={};await r(await n(t(e,{context:a,meta:o,get basePath(){return a.workspaceConfig.workspaceRoot},children:i})),{visitDirectory:e=>{this.fs.existsSync(e.path)||this.fs.mkdirSync(e.path)},visitFile:e=>{if(`contents`in e){let t=o[e.path]??{};if(t.kind===`builtin`){if(!t.id)throw Error(`Built-in file "${e.path}" is missing its ID in the render metadata.`);this.emitBuiltinSync(e.contents,t.id,e.path,{skipFormat:t.skipFormat,storage:t.storage})}else t.kind===`entry`?this.emitEntrySync(e.contents,e.path,{skipFormat:t.skipFormat,storage:t.storage,...t.typeDefinition??{}}):this.fs.writeSync(e.path,e.contents)}else this.fs.copySync(e.sourcePath,e.path)}})}}}}];export{o as default};
@@ -1,4 +1,4 @@
1
1
  import "../../../powerlines/src/types/fs.mjs";
2
2
  import "../../../powerlines/src/types/resolved.mjs";
3
- import "../vendor/index.mjs";
3
+ import { Children } from "@alloy-js/core";
4
4
  import "@alloy-js/typescript";
@@ -1,6 +1,7 @@
1
1
  import { UserConfig } from "../../../powerlines/src/types/config.cjs";
2
2
  import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
3
3
  import { PluginContext } from "../../../powerlines/src/types/context.cjs";
4
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
4
5
 
5
6
  //#region ../plugin-alloy/src/types/plugin.d.ts
6
7
  type AlloyPluginOptions = Partial<PrintTreeOptions> & {
@@ -1,10 +1,10 @@
1
1
  import { UserConfig } from "../../../powerlines/src/types/config.mjs";
2
2
  import { ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
3
3
  import { PluginContext } from "../../../powerlines/src/types/context.mjs";
4
- import { index_d_exports } from "../vendor/index.mjs";
4
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
5
5
 
6
6
  //#region ../plugin-alloy/src/types/plugin.d.ts
7
- type AlloyPluginOptions = Partial<index_d_exports.PrintTreeOptions> & {
7
+ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
8
8
  /**
9
9
  * If true, the Alloy framework is used to generate Typescript output files.
10
10
  *
@@ -31,7 +31,7 @@ type AlloyPluginResolvedConfig = ResolvedConfig & {
31
31
  alloy: AlloyPluginOptions;
32
32
  };
33
33
  type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
34
- render: <TContext extends AlloyPluginContext>(this: TContext, children: index_d_exports.Children) => Promise<void>;
34
+ render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
35
35
  };
36
36
  //#endregion
37
37
  export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
@@ -4,6 +4,7 @@ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, Allo
4
4
  import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.cjs";
5
5
  import { EnvInterface, SecretsInterface } from "./runtime.cjs";
6
6
  import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
7
+ import { Children } from "@alloy-js/core/jsx-runtime";
7
8
  import { DotenvParseOutput } from "@stryke/env/types";
8
9
 
9
10
  //#region ../plugin-env/src/types/plugin.d.ts
@@ -312,6 +312,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
312
312
  * @param options - Additional options for writing the builtin file
313
313
  */
314
314
  emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
315
+ /**
316
+ * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
317
+ *
318
+ * @param code - The source code of the builtin file
319
+ * @param id - The unique identifier of the builtin file
320
+ * @param path - An optional path to write the builtin file to
321
+ * @param options - Additional options for writing the builtin file
322
+ */
323
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
315
324
  /**
316
325
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
317
326
  *
@@ -320,6 +329,14 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
320
329
  * @param options - Additional options for writing the entry file
321
330
  */
322
331
  emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
332
+ /**
333
+ * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
334
+ *
335
+ * @param code - The source code of the entry file
336
+ * @param path - An optional path to write the entry file to
337
+ * @param options - Additional options for writing the entry file
338
+ */
339
+ emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
323
340
  /**
324
341
  * A function to update the context fields using a new user configuration options
325
342
  */
@@ -314,6 +314,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
314
314
  * @param options - Additional options for writing the builtin file
315
315
  */
316
316
  emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
317
+ /**
318
+ * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
319
+ *
320
+ * @param code - The source code of the builtin file
321
+ * @param id - The unique identifier of the builtin file
322
+ * @param path - An optional path to write the builtin file to
323
+ * @param options - Additional options for writing the builtin file
324
+ */
325
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
317
326
  /**
318
327
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
319
328
  *
@@ -322,6 +331,14 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
322
331
  * @param options - Additional options for writing the entry file
323
332
  */
324
333
  emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
334
+ /**
335
+ * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
336
+ *
337
+ * @param code - The source code of the entry file
338
+ * @param path - An optional path to write the entry file to
339
+ * @param options - Additional options for writing the entry file
340
+ */
341
+ emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
325
342
  /**
326
343
  * A function to update the context fields using a new user configuration options
327
344
  */
@@ -13,6 +13,13 @@ interface StorageAdapter {
13
13
  * A name identifying the storage adapter type.
14
14
  */
15
15
  name: string;
16
+ /**
17
+ * The storage preset for the adapter.
18
+ *
19
+ * @remarks
20
+ * This can be used as an alternate way to identify the type of storage being used.
21
+ */
22
+ preset?: StoragePreset | null;
16
23
  /**
17
24
  * Checks if a key exists in the storage.
18
25
  *
@@ -207,6 +214,13 @@ interface WriteOptions {
207
214
  * @defaultValue false
208
215
  */
209
216
  skipFormat?: boolean;
217
+ /**
218
+ * The storage preset or adapter name for the output file.
219
+ *
220
+ * @remarks
221
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
222
+ */
223
+ storage?: StoragePreset | string;
210
224
  /**
211
225
  * Additional metadata for the file.
212
226
  */
@@ -13,6 +13,13 @@ interface StorageAdapter {
13
13
  * A name identifying the storage adapter type.
14
14
  */
15
15
  name: string;
16
+ /**
17
+ * The storage preset for the adapter.
18
+ *
19
+ * @remarks
20
+ * This can be used as an alternate way to identify the type of storage being used.
21
+ */
22
+ preset?: StoragePreset | null;
16
23
  /**
17
24
  * Checks if a key exists in the storage.
18
25
  *
@@ -207,6 +214,13 @@ interface WriteOptions {
207
214
  * @defaultValue false
208
215
  */
209
216
  skipFormat?: boolean;
217
+ /**
218
+ * The storage preset or adapter name for the output file.
219
+ *
220
+ * @remarks
221
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
222
+ */
223
+ storage?: StoragePreset | string;
210
224
  /**
211
225
  * Additional metadata for the file.
212
226
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.121",
3
+ "version": "0.1.122",
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.16.3",
144
- "@powerlines/plugin-babel": "^0.12.125",
145
- "@powerlines/plugin-env": "^0.14.20",
143
+ "@powerlines/plugin-alloy": "^0.17.0",
144
+ "@powerlines/plugin-babel": "^0.12.126",
145
+ "@powerlines/plugin-env": "^0.14.21",
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.21"
154
+ "powerlines": "^0.36.22"
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": "b16324cf857ea5743fd7ad06e18607b1ba32abe0"
165
+ "gitHead": "f88fe8eb30f96536b83fc9af884972d48e31e63a"
166
166
  }
@@ -1 +0,0 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);var t={};e.__reExport(t,require(`@alloy-js/core`)),Object.defineProperty(exports,`vendor_exports`,{enumerable:!0,get:function(){return t}});var n=require(`@alloy-js/core`);Object.keys(n).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});
@@ -1,7 +0,0 @@
1
- export * from "@alloy-js/core";
2
-
3
- //#region ../plugin-alloy/src/vendor/index.d.ts
4
-
5
- import * as import___alloy_js_core from "@alloy-js/core";
6
- //#endregion
7
- export { import___alloy_js_core as index_d_exports };
@@ -1 +0,0 @@
1
- import{__reExport as e}from"../../../_virtual/rolldown_runtime.mjs";export*from"@alloy-js/core";var t={};import*as n from"@alloy-js/core";e(t,n);export{t as vendor_exports};