@powerlines/plugin-date 0.12.107 → 0.12.109
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.
- package/dist/alloy/src/create-plugin.cjs +1 -1
- package/dist/alloy/src/create-plugin.mjs +1 -1
- package/dist/alloy/src/markdown/components/markdown-file.cjs +1 -1
- package/dist/alloy/src/markdown/components/markdown-file.mjs +1 -1
- package/dist/alloy/src/typescript/components/typescript-file.cjs +1 -1
- package/dist/alloy/src/typescript/components/typescript-file.mjs +1 -1
- package/dist/alloy/src/typescript/components/typescript-interface.cjs +1 -1
- package/dist/alloy/src/typescript/components/typescript-interface.mjs +1 -1
- package/dist/alloy/src/typescript/components/typescript-object.cjs +1 -1
- package/dist/alloy/src/typescript/components/typescript-object.mjs +1 -1
- package/package.json +5 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../powerlines/src/plugin-utils/helpers.cjs`),n=require(`./core/components/output.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@storm-software/config-tools/types`),o=require(`@stryke/path/is-parent-path`),s=require(`@stryke/path/replace`),c=require(`@stryke/type-checks/is-set-string`),l=require(`prettier/doc.js`);function u(e){return a=>{let o=e(a);return{...o,async prepare(){let e=this;if(t.isPluginHook(o.prepare)&&o.enforce!==`post`&&(t.isPluginHookFunction(o.prepare)||t.isPluginHookObject(o.prepare)&&o.prepare.order!==`post`)&&await Promise.resolve(t.getHookHandler(o.prepare).call(this)),t.isPluginHook(o.render)){let t=(0,i.renderTree)((0,r.createComponent)(n.Output,{context:e,get basePath(){return e.workspaceConfig.workspaceRoot},get children(){return o.render.call(e)}}));await d(this,t,a?.alloy)}t.isPluginHook(o.prepare)&&(o.enforce===`post`||t.isPluginHookObject(o.prepare)&&o.prepare.order===`post`)&&await Promise.resolve(t.getHookHandler(o.prepare).call(this))}}}}async function d(e,t,n={}){await(0,i.flushJobsAsync)();let r,l=async(t,c)=>{if(!Array.isArray(c))return;let u=async e=>{for(let t of c)await l(e,t)},d=(0,i.getContextForRenderNode)(c);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await u(e)}else if(d.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(d.meta?.builtin){if(!d.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(a.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,s.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)}}else d.meta?.entry||(0,o.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(a.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)}):(e.log(a.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)});t.contents.push(r)}else if(d.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(a.LogLevelLabel.TRACE,`Processing copy file operation from "${d.meta.copyFile.sourcePath}" to "${d.meta.copyFile.path}"`),!d.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!d.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await u(t)};await l(void 0,t);let u=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await u(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!(0,c.isSetString)(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&(0,c.isSetString)(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await u(e,r)}async function f(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,i.flushJobsAsync)();let r=l.printer.printDocToString(p(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../powerlines/src/plugin-utils/helpers.cjs`),n=require(`./core/components/output.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@storm-software/config-tools/types`),o=require(`@stryke/path/is-parent-path`),s=require(`@stryke/path/replace`),c=require(`@stryke/type-checks/is-set-string`),l=require(`prettier/doc.js`);function u(e){return a=>{let o=e(a);return{...o,async prepare(){let e=this;if(t.isPluginHook(o.prepare)&&o.enforce!==`post`&&(t.isPluginHookFunction(o.prepare)||t.isPluginHookObject(o.prepare)&&o.prepare.order!==`post`)&&await Promise.resolve(t.getHookHandler(o.prepare).call(this)),t.isPluginHook(o.render)){let t=(0,i.renderTree)((0,r.createComponent)(n.Output,{context:e,get basePath(){return e.workspaceConfig.workspaceRoot},get children(){return o.render.call(e)}}));await d(this,t,a?.alloy)}t.isPluginHook(o.prepare)&&(o.enforce===`post`||t.isPluginHookObject(o.prepare)&&o.prepare.order===`post`)&&await Promise.resolve(t.getHookHandler(o.prepare).call(this))}}}}async function d(e,t,n={}){await(0,i.flushJobsAsync)();let r,l=async(t,c)=>{if(!Array.isArray(c))return;let u=async e=>{for(let t of c)await l(e,t)},d=(0,i.getContextForRenderNode)(c);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await u(e)}else if(d.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(d.meta?.builtin){if(!d.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(a.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,s.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)}}else d.meta?.entry||(0,o.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(a.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)}):(e.log(a.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(e,c,n)});t.contents.push(r)}else if(d.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(a.LogLevelLabel.TRACE,`Processing copy file operation from "${d.meta.copyFile.sourcePath}" to "${d.meta.copyFile.path}"`),!d.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!d.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await u(t)};await l(void 0,t);let u=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await u(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path,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,c.isSetString)(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&(0,c.isSetString)(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await u(e,r)}async function f(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,i.flushJobsAsync)();let r=l.printer.printDocToString(p(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
|
|
2
2
|
`)?`${r}\n`:r}function p(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else (0,i.isPrintHook)(n)?t.push(n.print(n.subtree,p)):t.push(p(n));return t}exports.createAlloyPlugin=u;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getHookHandler as e,isPluginHook as t,isPluginHookFunction as n,isPluginHookObject as r}from"../../powerlines/src/plugin-utils/helpers.mjs";import{Output as i}from"./core/components/output.mjs";import{createComponent as a}from"@alloy-js/core/jsx-runtime";import{flushJobsAsync as o,getContextForRenderNode as s,isPrintHook as c,renderTree as l}from"@alloy-js/core";import{LogLevelLabel as u}from"@storm-software/config-tools/types";import{isParentPath as d}from"@stryke/path/is-parent-path";import{replacePath as f}from"@stryke/path/replace";import{isSetString as p}from"@stryke/type-checks/is-set-string";import{printer as m}from"prettier/doc.js";function h(o){return s=>{let c=o(s);return{...c,async prepare(){let o=this;if(t(c.prepare)&&c.enforce!==`post`&&(n(c.prepare)||r(c.prepare)&&c.prepare.order!==`post`)&&await Promise.resolve(e(c.prepare).call(this)),t(c.render)){let e=l(a(i,{context:o,get basePath(){return o.workspaceConfig.workspaceRoot},get children(){return c.render.call(o)}}));await g(this,e,s?.alloy)}t(c.prepare)&&(c.enforce===`post`||r(c.prepare)&&c.prepare.order===`post`)&&await Promise.resolve(e(c.prepare).call(this))}}}}async function g(e,t,n={}){await o();let r,i=async(t,a)=>{if(!Array.isArray(a))return;let o=async e=>{for(let t of a)await i(e,t)},c=s(a);if(!c)return o(t);if(c.meta?.directory){let e={kind:`directory`,path:c.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await o(e)}else if(c.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(c.meta?.builtin){if(!c.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(u.TRACE,`Rendering built-in runtime module with ID: ${c.meta.builtin.id}`),r={kind:`builtin`,id:c.meta.builtin.id,path:f(c.meta.sourceFile.path,e.builtinsPath),filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)}}else c.meta?.entry||d(e.entryPath,c.meta.sourceFile.path)?(e.log(u.TRACE,`Rendering entry module at path: ${c.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:c.meta.entry?.typeDefinition,path:c.meta.sourceFile.path,filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)}):(e.log(u.TRACE,`Rendering source file at path: ${c.meta.sourceFile.path}`),r={kind:`file`,path:c.meta.sourceFile.path,filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)});t.contents.push(r)}else if(c.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(u.TRACE,`Processing copy file operation from "${c.meta.copyFile.sourcePath}" to "${c.meta.copyFile.path}"`),!c.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!c.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:c.meta.copyFile.path,sourcePath:c.meta.copyFile.sourcePath,preset:c.meta.output?.preset})}else await o(t)};await i(void 0,t);let a=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await a(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!p(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&p(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await a(e,r)}async function _(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await o();let r=m.printDocToString(v(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
|
|
1
|
+
import{getHookHandler as e,isPluginHook as t,isPluginHookFunction as n,isPluginHookObject as r}from"../../powerlines/src/plugin-utils/helpers.mjs";import{Output as i}from"./core/components/output.mjs";import{createComponent as a}from"@alloy-js/core/jsx-runtime";import{flushJobsAsync as o,getContextForRenderNode as s,isPrintHook as c,renderTree as l}from"@alloy-js/core";import{LogLevelLabel as u}from"@storm-software/config-tools/types";import{isParentPath as d}from"@stryke/path/is-parent-path";import{replacePath as f}from"@stryke/path/replace";import{isSetString as p}from"@stryke/type-checks/is-set-string";import{printer as m}from"prettier/doc.js";function h(o){return s=>{let c=o(s);return{...c,async prepare(){let o=this;if(t(c.prepare)&&c.enforce!==`post`&&(n(c.prepare)||r(c.prepare)&&c.prepare.order!==`post`)&&await Promise.resolve(e(c.prepare).call(this)),t(c.render)){let e=l(a(i,{context:o,get basePath(){return o.workspaceConfig.workspaceRoot},get children(){return c.render.call(o)}}));await g(this,e,s?.alloy)}t(c.prepare)&&(c.enforce===`post`||r(c.prepare)&&c.prepare.order===`post`)&&await Promise.resolve(e(c.prepare).call(this))}}}}async function g(e,t,n={}){await o();let r,i=async(t,a)=>{if(!Array.isArray(a))return;let o=async e=>{for(let t of a)await i(e,t)},c=s(a);if(!c)return o(t);if(c.meta?.directory){let e={kind:`directory`,path:c.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await o(e)}else if(c.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(c.meta?.builtin){if(!c.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(u.TRACE,`Rendering built-in runtime module with ID: ${c.meta.builtin.id}`),r={kind:`builtin`,id:c.meta.builtin.id,path:f(c.meta.sourceFile.path,e.builtinsPath),filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)}}else c.meta?.entry||d(e.entryPath,c.meta.sourceFile.path)?(e.log(u.TRACE,`Rendering entry module at path: ${c.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:c.meta.entry?.typeDefinition,path:c.meta.sourceFile.path,filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)}):(e.log(u.TRACE,`Rendering source file at path: ${c.meta.sourceFile.path}`),r={kind:`file`,path:c.meta.sourceFile.path,filetype:c.meta.sourceFile.filetype,preset:c.meta.output?.mode,contents:await _(e,a,n)});t.contents.push(r)}else if(c.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(u.TRACE,`Processing copy file operation from "${c.meta.copyFile.sourcePath}" to "${c.meta.copyFile.path}"`),!c.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!c.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:c.meta.copyFile.path,sourcePath:c.meta.copyFile.sourcePath,preset:c.meta.output?.preset})}else await o(t)};await i(void 0,t);let a=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await a(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path,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(!p(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&p(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await a(e,r)}async function _(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await o();let r=m.printDocToString(v(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
|
|
2
2
|
`)?`${r}\n`:r}function v(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else c(n)?t.push(n.print(n.subtree,v)):t.push(v(n));return t}export{h as createAlloyPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../core/components/single-line-comment.cjs`),require(`../../core/components/source-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);require(`@alloy-js/markdown`);
|
|
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(`@alloy-js/core`),n=require(`@stryke/string-format/title-case`);require(`@alloy-js/markdown`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../core/components/single-line-comment.mjs";import"../../core/components/source-file.mjs";import{createComponent as e,createIntrinsic as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Show as r,code as i,getContext as a,splitProps as o}from"@alloy-js/core";import"@alloy-js/markdown";export{};
|
|
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{Show as r,code as i,getContext as a,splitProps as o}from"@alloy-js/core";import{titleCase as s}from"@stryke/string-format/title-case";import"@alloy-js/markdown";export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../core/components/single-line-comment.cjs`),
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../core/contexts/context.cjs`),n=require(`../../core/components/single-line-comment.cjs`),r=require(`../../core/components/source-file.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/string-format/title-case`),s=require(`@stryke/type-checks/is-string`),c=require(`@stryke/path/append`),l=require(`@alloy-js/typescript`),u=require(`@stryke/type-checks/is-boolean`);function d(e){let[{children:t,path:n,imports:o,tsx:s,header:d,hashbang:m},h]=(0,a.splitProps)(e,[`children`,`path`,`imports`,`tsx`,`header`,`hashbang`]),g=(0,a.useContext)(a.SourceDirectoryContext),_=(0,l.getSourceDirectoryData)(g),v=(0,c.appendPath)(n,g.path),y=new l.TSModuleScope(v,(0,a.useScope)());_.modules.add(y);let b=(0,a.useContext)(l.PackageContext);return b&&b.scope.addModule(y),e.export&&b&&((0,u.isBoolean)(e.export)?b.scope.addExport(v,y):b.scope.addExport(e.export,y)),(0,i.createComponent)(l.SourceFileContext.Provider,{value:{scope:y},get children(){return(0,i.createComponent)(a.Scope,{value:y,get children(){return(0,i.createComponent)(r.SourceFile,(0,i.mergeProps)(h,{path:v,get header(){return d??(0,i.createComponent)(f,{hashbang:m,get children(){return(0,i.createComponent)(p,{imports:o,scope:y})}})},filetype:s?`tsx`:`typescript`,children:t}))}})}})}function f(e){let{header:r,hashbang:s,disableEslint:c=!0,disableBiome:l=!0,disablePrettier:u=!1,children:d}=e,f=t.usePowerlines();return[(0,i.createComponent)(a.Show,{get when(){return!!s},get children(){return[(0,i.memo)(()=>s===!0?a.code`#!/usr/bin/env ${f?.config.mode===`development`?`-S NODE_OPTIONS=--enable-source-maps`:``} node`:s),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(a.Show,{get when(){return!!r},get children(){return[r,(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createIntrinsic)(`hbr`,{}),(0,i.createComponent)(a.Show,{get when(){return!!c},get children(){return[(0,i.createComponent)(n.SingleLineComment,{variant:`slash-star`,children:`eslint-disable`}),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(a.Show,{get when(){return!!u},get children(){return[(0,i.createComponent)(n.SingleLineComment,{variant:`slash-star`,children:`prettier-ignore`}),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(a.Show,{get when(){return!!l},get children(){return[(0,i.createComponent)(n.SingleLineComment,{children:`biome-ignore lint: disable`}),(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(a.Show,{get when(){return!!c||!!u||!!l},get children(){return(0,i.createIntrinsic)(`hbr`,{})}}),(0,i.createComponent)(a.Show,{get when(){return!!d},get children(){return[d,(0,i.createIntrinsic)(`hbr`,{})]}}),(0,i.createComponent)(n.SingleLineComment,{get children(){return a.code`Generated by ${(0,o.titleCase)(f?.config.framework)||`Powerlines`}`}}),(0,i.createIntrinsic)(`hbr`,{}),(0,i.createComponent)(n.SingleLineComment,{children:a.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`}),(0,i.createIntrinsic)(`hbr`,{})]}function p(e){let{imports:t}=e,n=(0,l.useSourceFile)(),r=e.scope??n.scope;return(0,i.createComponent)(a.Show,{get when(){return r.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[(0,i.createComponent)(a.Show,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>a.code`import ${t===null?``:t.filter(e=>!(0,s.isString)(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!(0,s.isString)(e)&&e.default).length>0&&t.filter(e=>(0,s.isString)(e)||!e.default).length>0?`, `:``)+(t.filter(e=>(0,s.isString)(e)||!e.default).length>0?`{ ${t.map(e=>(0,s.isString)(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),(0,i.createComponent)(a.Show,{get when(){return r.importedModules.size>0},get children(){return(0,i.createComponent)(l.ImportStatements,{get records(){return r.importedModules}})}}),(0,i.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptFile=d,exports.TypescriptFileHeader=f,exports.TypescriptFileHeaderImports=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{usePowerlines as e}from"../../core/contexts/context.mjs";import{SingleLineComment as t}from"../../core/components/single-line-comment.mjs";import{SourceFile as n}from"../../core/components/source-file.mjs";import{createComponent as r,createIntrinsic as i,memo as a,mergeProps as o}from"@alloy-js/core/jsx-runtime";import{Scope as s,Show as c,SourceDirectoryContext as l,code as u,splitProps as d,useContext as f,useScope as p}from"@alloy-js/core";import{titleCase as m}from"@stryke/string-format/title-case";import{isString as h}from"@stryke/type-checks/is-string";import{appendPath as g}from"@stryke/path/append";import{ImportStatements as _,PackageContext as v,SourceFileContext as y,TSModuleScope as b,getSourceDirectoryData as x,useSourceFile as S}from"@alloy-js/typescript";import{isBoolean as C}from"@stryke/type-checks/is-boolean";function w(e){let[{children:t,path:i,imports:a,tsx:c,header:u,hashbang:m},h]=d(e,[`children`,`path`,`imports`,`tsx`,`header`,`hashbang`]),_=f(l),S=x(_),w=g(i,_.path),D=new b(w,p());S.modules.add(D);let O=f(v);return O&&O.scope.addModule(D),e.export&&O&&(C(e.export)?O.scope.addExport(w,D):O.scope.addExport(e.export,D)),r(y.Provider,{value:{scope:D},get children(){return r(s,{value:D,get children(){return r(n,o(h,{path:w,get header(){return u??r(T,{hashbang:m,get children(){return r(E,{imports:a,scope:D})}})},filetype:c?`tsx`:`typescript`,children:t}))}})}})}function T(n){let{header:o,hashbang:s,disableEslint:l=!0,disableBiome:d=!0,disablePrettier:f=!1,children:p}=n,h=e();return[r(c,{get when(){return!!s},get children(){return[a(()=>s===!0?u`#!/usr/bin/env ${h?.config.mode===`development`?`-S NODE_OPTIONS=--enable-source-maps`:``} node`:s),i(`hbr`,{})]}}),r(c,{get when(){return!!o},get children(){return[o,i(`hbr`,{})]}}),i(`hbr`,{}),r(c,{get when(){return!!l},get children(){return[r(t,{variant:`slash-star`,children:`eslint-disable`}),i(`hbr`,{})]}}),r(c,{get when(){return!!f},get children(){return[r(t,{variant:`slash-star`,children:`prettier-ignore`}),i(`hbr`,{})]}}),r(c,{get when(){return!!d},get children(){return[r(t,{children:`biome-ignore lint: disable`}),i(`hbr`,{})]}}),r(c,{get when(){return!!l||!!f||!!d},get children(){return i(`hbr`,{})}}),r(c,{get when(){return!!p},get children(){return[p,i(`hbr`,{})]}}),r(t,{get children(){return u`Generated by ${m(h?.config.framework)||`Powerlines`}`}}),i(`hbr`,{}),r(t,{children:u`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`}),i(`hbr`,{})]}function E(e){let{imports:t}=e,n=S(),a=e.scope??n.scope;return r(c,{get when(){return a.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[r(c,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>u`import ${t===null?``:t.filter(e=>!h(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!h(e)&&e.default).length>0&&t.filter(e=>h(e)||!e.default).length>0?`, `:``)+(t.filter(e=>h(e)||!e.default).length>0?`{ ${t.map(e=>h(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),r(c,{get when(){return a.importedModules.size>0},get children(){return r(_,{get records(){return a.importedModules}})}}),i(`hbr`,{})]}})}export{w as TypescriptFile,T as TypescriptFileHeader,E as TypescriptFileHeaderImports};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/vendor/type.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@alloy-js/typescript`),
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/vendor/type.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/type-checks/is-string`),s=require(`@alloy-js/typescript`),c=require(`@stryke/string-format/pascal-case`);function l(e){let[{name:t,reflection:l},d]=(0,a.splitProps)(e,[`name`,`reflection`]),f=(0,a.computed)(()=>(0,c.pascalCase)(((0,o.isString)(t)?t:t.toString())||l.getName())),p=l.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return(0,i.createComponent)(n.ReflectionClassContext.Provider,{value:{reflection:l},get children(){return[(0,i.createComponent)(r.TSDocReflectionClass,{}),(0,i.createComponent)(s.InterfaceDeclaration,(0,i.mergeProps)({export:!0,get name(){return f.value}},d,{get children(){return(0,i.createComponent)(a.For,{each:p,doubleHardline:!0,semicolon:!0,children:e=>(0,i.createComponent)(u,{property:e})})}}))]}})}function u(e){let[{property:o},c]=(0,a.splitProps)(e,[`property`]);return(0,i.createComponent)(n.ReflectionPropertyContext.Provider,{value:o,get children(){return[(0,i.createComponent)(r.TSDocReflectionProperty,{}),(0,i.createComponent)(s.InterfaceMember,(0,i.mergeProps)({get name(){return o.getNameAsString()},get readonly(){return o.isReadonly()},get optional(){return o.isOptional()},get nullish(){return o.isNullable()},get type(){return(0,t.type_exports.stringifyType)(o.getType())}},c))]}})}exports.TypeScriptInterface=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{type_exports as e}from"../../../../deepkit/src/vendor/type.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{createComponent as a,mergeProps as o}from"@alloy-js/core/jsx-runtime";import{For as s,computed as c,splitProps as l}from"@alloy-js/core";import{InterfaceDeclaration as
|
|
1
|
+
import{type_exports as e}from"../../../../deepkit/src/vendor/type.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{createComponent as a,mergeProps as o}from"@alloy-js/core/jsx-runtime";import{For as s,computed as c,splitProps as l}from"@alloy-js/core";import{isString as u}from"@stryke/type-checks/is-string";import{InterfaceDeclaration as d,InterfaceMember as f}from"@alloy-js/typescript";import{pascalCase as p}from"@stryke/string-format/pascal-case";function m(e){let[{name:n,reflection:i},f]=l(e,[`name`,`reflection`]),m=c(()=>p((u(n)?n:n.toString())||i.getName())),g=i.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1);return a(t.Provider,{value:{reflection:i},get children(){return[a(r,{}),a(d,o({export:!0,get name(){return m.value}},f,{get children(){return a(s,{each:g,doubleHardline:!0,semicolon:!0,children:e=>a(h,{property:e})})}}))]}})}function h(t){let[{property:r},s]=l(t,[`property`]);return a(n.Provider,{value:r,get children(){return[a(i,{}),a(f,o({get name(){return r.getNameAsString()},get readonly(){return r.isReadonly()},get optional(){return r.isOptional()},get nullish(){return r.isNullable()},get type(){return(0,e.stringifyType)(r.getType())}},s))]}})}export{m as TypeScriptInterface};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/utilities.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@stryke/string-format/camel-case`),
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../../deepkit/src/utilities.cjs`),n=require(`../../core/contexts/reflection.cjs`),r=require(`./tsdoc-reflection.cjs`);let i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/type-checks/is-undefined`),s=require(`@stryke/type-checks/is-string`),c=require(`@stryke/string-format/camel-case`),l=require(`@alloy-js/typescript`),u=require(`@stryke/string-format/pascal-case`);function d(e){if(!e.reflection?.value)return null;let t=(0,a.computed)(()=>(0,c.camelCase)(((0,s.isString)(e.name)?e.name:e.name.toString())||e.reflection.value.getName())),d=(0,a.computed)(()=>e.type||(0,u.pascalCase)(e.reflection.value.getName())),p=(0,a.computed)(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!(0,o.isUndefined)(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>(0,o.isUndefined)(t)&&!(0,o.isUndefined)(e.defaultValue?.value?.[n])?e.defaultValue?.value?.[n]:t,void 0)??t.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1)),m=(0,a.createSymbolSlot)(),h=(0,a.createSymbolSlot)(),g=(0,l.createValueSymbol)(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?l.TSSymbolFlags.Nullish:l.TSSymbolFlags.None,type:e.type?m.firstSymbol:void 0,namePolicy:(0,l.useTSNamePolicy)().for(`variable`)});e.type||h.moveMembersTo(g);let _=e.var?`var`:e.let?`let`:`const`,v=e.type?(0,i.createComponent)(l.TypeRefContext,{get children(){return[`: `,(0,i.createComponent)(m,{get children(){return e.type}})]}}):void 0;return(0,i.createComponent)(a.Show,{get when(){return!!e.reflection.value},get children(){return(0,i.createComponent)(n.ReflectionClassContext.Provider,{get value(){return{reflection:e.reflection.value,override:{name:t.value,type:d.value,defaultValue:e.defaultValue?.value}}},get children(){return[(0,i.createComponent)(a.Show,{get when(){return!!t.value&&!!d.value},get children(){return[(0,i.createComponent)(r.TSDocReflectionClass,{}),(0,i.createComponent)(a.Declaration,{symbol:g,get children(){return[(0,i.memo)(()=>e.export?`export `:``),(0,i.memo)(()=>e.default?`default `:``),_,` `,(0,i.createComponent)(a.Name,{}),v,` =`,` `,(0,i.createComponent)(h,{get children(){return e.initializer??e.children??(0,i.createComponent)(l.ObjectExpression,{get children(){return(0,i.createComponent)(a.For,{get each(){return p.value??[]},comma:!0,doubleHardline:!0,children:e=>(0,i.createComponent)(f,{property:e})})}})}})]}})]}}),(0,i.createIntrinsic)(`hbr`,{})]}})}})}function f(e){let[{property:o}]=(0,a.splitProps)(e,[`property`]);return(0,i.createComponent)(n.ReflectionPropertyContext.Provider,{value:o,get children(){return[(0,i.createComponent)(r.TSDocReflectionProperty,{}),(0,i.createComponent)(l.ObjectProperty,{get name(){return o.getNameAsString()},get value(){return t.stringifyDefaultValue(o)}}),(0,i.createIntrinsic)(`hbr`,{})]}})}exports.TypescriptObject=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stringifyDefaultValue as e}from"../../../../deepkit/src/utilities.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{createComponent as a,createIntrinsic as o,memo as s}from"@alloy-js/core/jsx-runtime";import{Declaration as c,For as l,Name as u,Show as d,computed as f,createSymbolSlot as p,splitProps as m}from"@alloy-js/core";import{isUndefined as h}from"@stryke/type-checks/is-undefined";import{
|
|
1
|
+
import{stringifyDefaultValue as e}from"../../../../deepkit/src/utilities.mjs";import{ReflectionClassContext as t,ReflectionPropertyContext as n}from"../../core/contexts/reflection.mjs";import{TSDocReflectionClass as r,TSDocReflectionProperty as i}from"./tsdoc-reflection.mjs";import{createComponent as a,createIntrinsic as o,memo as s}from"@alloy-js/core/jsx-runtime";import{Declaration as c,For as l,Name as u,Show as d,computed as f,createSymbolSlot as p,splitProps as m}from"@alloy-js/core";import{isUndefined as h}from"@stryke/type-checks/is-undefined";import{isString as g}from"@stryke/type-checks/is-string";import{camelCase as _}from"@stryke/string-format/camel-case";import{ObjectExpression as v,ObjectProperty as y,TSSymbolFlags as b,TypeRefContext as x,createValueSymbol as S,useTSNamePolicy as C}from"@alloy-js/typescript";import{pascalCase as w}from"@stryke/string-format/pascal-case";function T(e){if(!e.reflection?.value)return null;let n=f(()=>_((g(e.name)?e.name:e.name.toString())||e.reflection.value.getName())),i=f(()=>e.type||w(e.reflection.value.getName())),m=f(()=>e.reflection.value.getProperties().filter(t=>!t.isIgnored()&&!h(e.defaultValue?.value?.[t.getNameAsString()]??t.getAlias().reduce((t,n)=>h(t)&&!h(e.defaultValue?.value?.[n])?e.defaultValue?.value?.[n]:t,void 0)??t.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1)),y=p(),T=p(),D=S(e.name,{refkeys:e.refkey,default:e.default,export:e.export,metadata:e.metadata,tsFlags:e.nullish?b.Nullish:b.None,type:e.type?y.firstSymbol:void 0,namePolicy:C().for(`variable`)});e.type||T.moveMembersTo(D);let O=e.var?`var`:e.let?`let`:`const`,k=e.type?a(x,{get children(){return[`: `,a(y,{get children(){return e.type}})]}}):void 0;return a(d,{get when(){return!!e.reflection.value},get children(){return a(t.Provider,{get value(){return{reflection:e.reflection.value,override:{name:n.value,type:i.value,defaultValue:e.defaultValue?.value}}},get children(){return[a(d,{get when(){return!!n.value&&!!i.value},get children(){return[a(r,{}),a(c,{symbol:D,get children(){return[s(()=>e.export?`export `:``),s(()=>e.default?`default `:``),O,` `,a(u,{}),k,` =`,` `,a(T,{get children(){return e.initializer??e.children??a(v,{get children(){return a(l,{get each(){return m.value??[]},comma:!0,doubleHardline:!0,children:e=>a(E,{property:e})})}})}})]}})]}}),o(`hbr`,{})]}})}})}function E(t){let[{property:r}]=m(t,[`property`]);return a(n.Provider,{value:r,get children(){return[a(i,{}),a(y,{get name(){return r.getNameAsString()},get value(){return e(r)}}),o(`hbr`,{})]}})}export{T as TypescriptObject};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-date",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.109",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -128,15 +128,15 @@
|
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@powerlines/plugin-env": "^0.13.
|
|
131
|
+
"@powerlines/plugin-env": "^0.13.106",
|
|
132
132
|
"@storm-software/config-tools": "^1.188.73",
|
|
133
133
|
"@stryke/path": "^0.24.0",
|
|
134
|
-
"powerlines": "^0.36.
|
|
134
|
+
"powerlines": "^0.36.2"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@powerlines/nx": "^0.11.
|
|
137
|
+
"@powerlines/nx": "^0.11.28",
|
|
138
138
|
"@types/node": "^24.10.4"
|
|
139
139
|
},
|
|
140
140
|
"publishConfig": { "access": "public" },
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "916e24a276b03bbc9d64349bf85f37ffb43d5e87"
|
|
142
142
|
}
|