@powerlines/plugin-crypto 0.10.87 → 0.10.89
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/deepkit/src/utilities.cjs +1 -1
- package/dist/deepkit/src/utilities.mjs +1 -1
- package/dist/plugin-alloy/src/core/components/output.cjs +1 -1
- package/dist/plugin-alloy/src/core/components/output.mjs +1 -1
- package/dist/plugin-alloy/src/core/contexts/context.cjs +1 -1
- package/dist/plugin-alloy/src/core/contexts/context.mjs +1 -1
- package/dist/plugin-alloy/src/index.cjs +2 -2
- package/dist/plugin-alloy/src/index.mjs +2 -2
- package/dist/plugin-alloy/src/types/components.d.mts +2 -3
- package/dist/plugin-alloy/src/types/plugin.d.cts +3 -4
- package/dist/plugin-alloy/src/types/plugin.d.mts +3 -4
- package/dist/plugin-alloy/src/vendor.cjs +1 -0
- package/dist/plugin-alloy/src/vendor.d.cts +7 -0
- package/dist/plugin-alloy/src/vendor.d.mts +7 -0
- package/dist/plugin-alloy/src/vendor.mjs +1 -0
- package/dist/plugin-automd/src/index.cjs +1 -1
- package/dist/plugin-automd/src/index.mjs +1 -1
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -1
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -1
- package/dist/plugin-env/src/babel/plugin.cjs +4 -4
- package/dist/plugin-env/src/babel/plugin.mjs +3 -3
- package/dist/plugin-env/src/components/docs.cjs +1 -1
- package/dist/plugin-env/src/components/docs.mjs +1 -1
- package/dist/plugin-env/src/components/env.cjs +2 -2
- package/dist/plugin-env/src/components/env.mjs +2 -2
- package/dist/plugin-env/src/helpers/load.cjs +1 -1
- package/dist/plugin-env/src/helpers/load.mjs +1 -1
- package/dist/plugin-env/src/helpers/reflect.cjs +1 -1
- package/dist/plugin-env/src/helpers/reflect.mjs +1 -1
- package/dist/plugin-env/src/helpers/source-file-env.cjs +1 -1
- package/dist/plugin-env/src/helpers/source-file-env.mjs +1 -1
- package/dist/plugin-env/src/index.cjs +2 -2
- package/dist/plugin-env/src/index.mjs +2 -2
- package/dist/powerlines/src/lib/build/esbuild.cjs +9 -9
- package/dist/powerlines/src/lib/build/esbuild.mjs +9 -9
- package/dist/powerlines/src/lib/entry.cjs +1 -1
- package/dist/powerlines/src/lib/entry.mjs +1 -1
- package/dist/powerlines/src/lib/logger.cjs +1 -1
- package/dist/powerlines/src/lib/logger.mjs +1 -1
- package/package.json +5 -5
- package/dist/deepkit/src/vendor/core.cjs +0 -1
- package/dist/deepkit/src/vendor/core.mjs +0 -1
- package/dist/plugin-alloy/src/core/components/index.cjs +0 -1
- package/dist/plugin-alloy/src/core/components/index.mjs +0 -1
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -1
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -1
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -1
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -1
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -1
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -1
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -1
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -1
- package/dist/plugin-alloy/src/core/index.cjs +0 -1
- package/dist/plugin-alloy/src/core/index.mjs +0 -1
- package/dist/plugin-alloy/src/helpers/capnp.cjs +0 -1
- package/dist/plugin-alloy/src/helpers/capnp.mjs +0 -1
- package/dist/plugin-alloy/src/helpers/create-builtin.cjs +0 -1
- package/dist/plugin-alloy/src/helpers/create-builtin.mjs +0 -1
- package/dist/plugin-alloy/src/helpers/index.cjs +0 -1
- package/dist/plugin-alloy/src/helpers/index.mjs +0 -1
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -1
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -1
- package/dist/plugin-alloy/src/helpers/typescript.cjs +0 -1
- package/dist/plugin-alloy/src/helpers/typescript.mjs +0 -1
- package/dist/plugin-alloy/src/markdown/components/index.cjs +0 -1
- package/dist/plugin-alloy/src/markdown/components/index.mjs +0 -1
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -1
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -1
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -1
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -1
- package/dist/plugin-alloy/src/markdown/contexts/index.cjs +0 -1
- package/dist/plugin-alloy/src/markdown/contexts/index.mjs +0 -1
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -1
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -1
- package/dist/plugin-alloy/src/markdown/index.cjs +0 -1
- package/dist/plugin-alloy/src/markdown/index.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/entry-file.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/entry-file.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/index.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/index.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/record-expression.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/record-expression.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -1
- package/dist/plugin-alloy/src/typescript/index.cjs +0 -1
- package/dist/plugin-alloy/src/typescript/index.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/type.cjs`);let n=require(`@stryke/json/storm-json`),r=require(`@stryke/
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/type.cjs`);let n=require(`@stryke/json/storm-json`),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`);function s(e,t){return l(e.type,t??e.getDefaultValue())}function c(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function l(e,i){return(0,o.isUndefined)(i)?`undefined`:(0,a.isNull)(i)?`null`:e.kind===t.type_exports.ReflectionKind.boolean?String(i).trim().toLowerCase()===`true`?`true`:`false`:e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,r.isString)(e.literal)?c(i):e.kind===t.type_exports.ReflectionKind.enum?u(e).kind===t.type_exports.ReflectionKind.string?c(i):`${String(i)}`:e.kind===t.type_exports.ReflectionKind.union?f(e)?c(i):`${String(i)}`:e.kind===t.type_exports.ReflectionKind.array?c(n.StormJSON.stringify(i)):e.kind===t.type_exports.ReflectionKind.object||e.kind===t.type_exports.ReflectionKind.objectLiteral?n.StormJSON.stringify(i):e.kind===t.type_exports.ReflectionKind.property||e.kind===t.type_exports.ReflectionKind.parameter?l(e.type,i):String(i)}function u(e){if(e.kind!==t.type_exports.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let n=(0,i.getUniqueBy)(e.values.filter(e=>e!=null),e=>(0,r.isString)(e)?{kind:t.type_exports.ReflectionKind.string}:{kind:t.type_exports.ReflectionKind.number});if(n.length===0)throw Error(`No valid enum members could be found.`);return n[0]&&(0,r.isString)(n[0])?{kind:t.type_exports.ReflectionKind.string}:{kind:t.type_exports.ReflectionKind.number}}function d(e){if(e.kind===t.type_exports.ReflectionKind.union&&e.types.length>0)return(0,i.getUniqueBy)(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function f(e){return d(e).some(e=>e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,r.isString)(e.literal))}exports.stringifyDefaultValue=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{type_exports as e}from"./vendor/type.mjs";import{StormJSON as t}from"@stryke/json/storm-json";import{
|
|
1
|
+
import{type_exports as e}from"./vendor/type.mjs";import{StormJSON as t}from"@stryke/json/storm-json";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";function o(e,t){return c(e.type,t??e.getDefaultValue())}function s(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function c(r,o){return a(o)?`undefined`:i(o)?`null`:r.kind===e.ReflectionKind.boolean?String(o).trim().toLowerCase()===`true`?`true`:`false`:r.kind===e.ReflectionKind.string||r.kind===e.ReflectionKind.literal&&n(r.literal)?s(o):r.kind===e.ReflectionKind.enum?l(r).kind===e.ReflectionKind.string?s(o):`${String(o)}`:r.kind===e.ReflectionKind.union?d(r)?s(o):`${String(o)}`:r.kind===e.ReflectionKind.array?s(t.stringify(o)):r.kind===e.ReflectionKind.object||r.kind===e.ReflectionKind.objectLiteral?t.stringify(o):r.kind===e.ReflectionKind.property||r.kind===e.ReflectionKind.parameter?c(r.type,o):String(o)}function l(t){if(t.kind!==e.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${t.kind}.`);let i=r(t.values.filter(e=>e!=null),t=>n(t)?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number});if(i.length===0)throw Error(`No valid enum members could be found.`);return i[0]&&n(i[0])?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number}}function u(t){if(t.kind===e.ReflectionKind.union&&t.types.length>0)return r(t.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${t.kind}.`)}function d(t){return u(t).some(t=>t.kind===e.ReflectionKind.string||t.kind===e.ReflectionKind.literal&&n(t.literal))}export{o as stringifyDefaultValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../contexts/context.cjs`);let
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../../vendor.cjs`),n=require(`../contexts/context.cjs`);let r=require(`@stryke/path/replace`),i=require(`react/jsx-runtime`);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,r.replacePath)(s,l.value.workspaceConfig.workspaceRoot):l.value.workspaceConfig.workspaceRoot);return(0,i.jsx)(t.vendor_exports.Output,{...c,basePath:u.value,children:(0,i.jsx)(n.PowerlinesContext.Provider,{value:{ref:l},children:(0,i.jsx)(t.vendor_exports.Show,{when:!!l.value,children:a})})})}exports.Output=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{vendor_exports as e}from"../../vendor.mjs";import{PowerlinesContext as t}from"../contexts/context.mjs";import{replacePath as n}from"@stryke/path/replace";import{jsx as r}from"react/jsx-runtime";function i(i){let[{children:a,context:o,basePath:s},c]=(0,e.splitProps)(i,[`children`,`context`,`basePath`]),l=(0,e.ref)(o),u=(0,e.computed)(()=>s?n(s,l.value.workspaceConfig.workspaceRoot):l.value.workspaceConfig.workspaceRoot);return r(e.Output,{...c,basePath:u.value,children:r(t.Provider,{value:{ref:l},children:r(e.Show,{when:!!l.value,children:a})})})}export{i as Output};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require(`../../vendor.cjs`),t=(0,e.vendor_exports.createContext)();exports.PowerlinesContext=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{vendor_exports as e}from"../../vendor.mjs";const t=(0,e.createContext)();export{t as PowerlinesContext};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./
|
|
2
|
-
`)?`${i}\n`:i}function
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor.cjs`),n=require(`./core/components/output.cjs`);let r=require(`@alloy-js/rollup-plugin`);r=e.__toESM(r);let i=require(`@storm-software/config-tools/types`),a=require(`@stryke/json/storm-json`),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`),u=require(`react/jsx-runtime`);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,r.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`)},resolveId(e){return e===`@alloy-js/core`?{id:`@powerlines/plugin-alloy/vendor`,external:!0}:null}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let r=(0,t.vendor_exports.renderTree)((0,u.jsx)(n.Output,{context:this,basePath:this.workspaceConfig.workspaceRoot,children:e}));await p(this,r,this.config.alloy)}}}}];var f=d;async function p(e,n,r={}){await(0,t.vendor_exports.flushJobsAsync)();let a,l=async(n,c)=>{if(!Array.isArray(c))return;let u=async e=>{for(let t of c)await l(e,t)},d=(0,t.vendor_exports.getContextForRenderNode)(c);if(!d)return u(n);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};n?n.contents.push(e):a=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,s.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await m(e,c,r)}}else d.meta?.entry||(0,o.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(i.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),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 m(e,c,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 m(e,c,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 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(!(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,a)}async function m(e,n,r={}){r.printWidth??=160,r.tabWidth??=2,r.useTabs??=!1,r.insertFinalNewLine??=!0,await(0,t.vendor_exports.flushJobsAsync)();let i=l.printer.printDocToString(h(n),r).formatted;return r.insertFinalNewLine&&!i.endsWith(`
|
|
2
|
+
`)?`${i}\n`:i}function h(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,h)):n.push(h(r));return n}exports.default=f;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)?`${i}\n`:i}function
|
|
1
|
+
import{vendor_exports as e}from"./vendor.mjs";import{Output as t}from"./core/components/output.mjs";import n from"@alloy-js/rollup-plugin";import{LogLevelLabel as r}from"@storm-software/config-tools/types";import{StormJSON as i}from"@stryke/json/storm-json";import{isParentPath as a}from"@stryke/path/is-parent-path";import{replacePath as o}from"@stryke/path/replace";import{isSetString as s}from"@stryke/type-checks/is-set-string";import{printer as c}from"prettier/doc.js";import{jsx as l}from"react/jsx-runtime";var u=(r={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...r},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[n()]}}},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,i.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/vendor`,external:!0}:null}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async n=>{let r=(0,e.renderTree)(l(t,{context:this,basePath:this.workspaceConfig.workspaceRoot,children:n}));await d(this,r,this.config.alloy)}}}}];async function d(t,n,i={}){await(0,e.flushJobsAsync)();let c,l=async(n,s)=>{if(!Array.isArray(s))return;let u=async e=>{for(let t of s)await l(e,t)},d=(0,e.getContextForRenderNode)(s);if(!d)return u(n);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};n?n.contents.push(e):c=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:o(d.meta.sourceFile.path,t.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await f(t,s,i)}}else d.meta?.entry||a(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 f(t,s,i)}):(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 f(t,s,i)});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(!s(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&s(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,c)}async function f(t,n,r={}){r.printWidth??=160,r.tabWidth??=2,r.useTabs??=!1,r.insertFinalNewLine??=!0,await(0,e.flushJobsAsync)();let i=c.printDocToString(p(n),r).formatted;return r.insertFinalNewLine&&!i.endsWith(`
|
|
2
|
+
`)?`${i}\n`:i}function p(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,p)):n.push(p(r));return n}export{u as default};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "../../../powerlines/src/types/fs.mjs";
|
|
2
2
|
import "../../../powerlines/src/types/resolved.mjs";
|
|
3
|
-
import "
|
|
4
|
-
import "@alloy-js/typescript";
|
|
5
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import "../vendor.mjs";
|
|
4
|
+
import "@alloy-js/typescript";
|
|
@@ -1,11 +1,10 @@
|
|
|
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 {
|
|
5
|
-
import { PrintTreeOptions } from "@alloy-js/core";
|
|
4
|
+
import { vendor_d_exports } from "../vendor.cjs";
|
|
6
5
|
|
|
7
6
|
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
8
|
-
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
7
|
+
type AlloyPluginOptions = Partial<vendor_d_exports.PrintTreeOptions> & {
|
|
9
8
|
/**
|
|
10
9
|
* If true, the Alloy framework is used to generate Typescript output files.
|
|
11
10
|
*
|
|
@@ -32,7 +31,7 @@ type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
|
32
31
|
alloy: AlloyPluginOptions;
|
|
33
32
|
};
|
|
34
33
|
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
35
|
-
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
34
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: vendor_d_exports.Children) => Promise<void>;
|
|
36
35
|
};
|
|
37
36
|
//#endregion
|
|
38
37
|
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -1,11 +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 {
|
|
5
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { vendor_d_exports } from "../vendor.mjs";
|
|
6
5
|
|
|
7
6
|
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
8
|
-
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
7
|
+
type AlloyPluginOptions = Partial<vendor_d_exports.PrintTreeOptions> & {
|
|
9
8
|
/**
|
|
10
9
|
* If true, the Alloy framework is used to generate Typescript output files.
|
|
11
10
|
*
|
|
@@ -32,7 +31,7 @@ type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
|
32
31
|
alloy: AlloyPluginOptions;
|
|
33
32
|
};
|
|
34
33
|
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
35
|
-
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
34
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: vendor_d_exports.Children) => Promise<void>;
|
|
36
35
|
};
|
|
37
36
|
//#endregion
|
|
38
37
|
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -0,0 +1 @@
|
|
|
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]}})});
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/replace`),n=require(`@stryke/
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/replace`),n=require(`@stryke/convert/to-array`),r=require(`@stryke/fs/is-file`),i=require(`@stryke/fs/list-files`),a=require(`@stryke/path/append`),o=require(`@stryke/path/is-type`),s=require(`@stryke/path/join-paths`),c=require(`automd`),l=require(`c12`),u=require(`defu`);u=e.__toESM(u);let d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let t=await(0,c.loadConfig)((0,s.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=(0,n.toArray)(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:(0,u.default)(t??{},{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,n.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,n.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,l.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,c.resolveConfig)((0,u.default)(this.config.automd,{...e,prefix:(0,n.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,n.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,i.listFiles)((0,o.isAbsolutePath)(e)?e:(0,a.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,o.isAbsolutePath)(e)?e:(0,a.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,o.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,a.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,n.toArray)(this.config.automd.input).map(async e=>{let n=await this.fs.read(e);if(n){let i=await(0,c.transform)(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((0,a.appendPath)(this.config.automd.output?(0,r.isDirectory)(this.config.automd.output)?(0,t.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});var p=f;exports.default=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{replacePath as e}from"@stryke/path/replace";import{
|
|
1
|
+
import{replacePath as e}from"@stryke/path/replace";import{toArray as t}from"@stryke/convert/to-array";import{isDirectory as n}from"@stryke/fs/is-file";import{listFiles as r}from"@stryke/fs/list-files";import{appendPath as i}from"@stryke/path/append";import{isAbsolutePath as a}from"@stryke/path/is-type";import{joinPaths as o}from"@stryke/path/join-paths";import{loadConfig as s,resolveConfig as c,transform as l}from"automd";import{loadConfig as u}from"c12";import d from"defu";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let e=await s(o(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!e.prefix||!Array.isArray(e.prefix))&&(e.prefix=t(e.prefix??[])),e.prefix.includes(`automd`)||e.prefix.push(`automd`),e.prefix.includes(`powerlines`)||e.prefix.push(`powerlines`),{automd:d(e??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!t(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=t(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await u({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=c(d(this.config.automd,{...e,prefix:t(e.prefix??[])}))}this.config.automd.input=(await Promise.all(t(this.config.automd.input).map(async e=>e.includes(`*`)?r(a(e)?e:i(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):a(e)?e:i(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!a(this.config.automd.output)&&(this.config.automd.output=i(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(t(this.config.automd.input).map(async t=>{let r=await this.fs.read(t);if(r){let a=await l(r,this.config.automd);if(a.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${t}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);a.hasChanged&&await this.fs.write(i(this.config.automd.output?n(this.config.automd.output)?e(t,this.config.automd.output):this.config.automd.output:t,this.config.projectRoot),a.contents)}}))}});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@babel/types`);t=e.__toESM(t);let n=require(`@stryke/type-checks/is-string`);function r(e,t){o(e.scope.getProgramParent().path,t)}function i(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function a(e){let t=new Map;return e.traverse({ImportDeclaration(e){i(e)&&t.set(e.node.source.value,e)}}),t}function o(e,n){a(e).get(n.module)||e.unshiftContainer(`body`,t.importDeclaration([t.importSpecifier(t.identifier(n.name||n.imported),t.identifier(n.imported))],t.stringLiteral(n.module)))}exports.addImport=r,exports.addImportsToProgram=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./ast-utils.mjs";import{isString as
|
|
1
|
+
import"./ast-utils.mjs";import*as e from"@babel/types";import{isString as t}from"@stryke/type-checks/is-string";function n(e,t){a(e.scope.getProgramParent().path,t)}function r(e){return e.get(`specifiers`).filter(Boolean).every(e=>e?.isImportSpecifier())&&e.node.importKind!==`type`&&e.node.importKind!==`typeof`}function i(e){let t=new Map;return e.traverse({ImportDeclaration(e){r(e)&&t.set(e.node.source.value,e)}}),t}function a(t,n){i(t).get(n.module)||t.unshiftContainer(`body`,e.importDeclaration([e.importSpecifier(e.identifier(n.name||n.imported),e.identifier(n.imported))],e.stringLiteral(n.module)))}export{n as addImport,a as addImportsToProgram};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../
|
|
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${
|
|
4
|
-
`)} \n\nUsing the following env prefix: \n${
|
|
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}`),
|
|
3
|
+
The following environment configuration names are defined in the \`env\` type definition: \n${n.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
|
|
4
|
+
`)} \n\nUsing the following env prefix: \n${n.config.env.prefix.map(e=>` - ${e}`).join(`
|
|
5
|
+
`)} \n\nPlease check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \n\n`)}}return{visitor:{MemberExpression(e,t){if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`$storm`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isCallExpression({callee:{name:`useStorm`,type:`Identifier`}})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isIdentifier({name:`process`})&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}else if(e.get(`object`)?.get(`property`)?.isIdentifier({name:`env`})&&e.get(`object`)?.get(`object`)?.isMetaProperty()&&e.get(`property`)?.isIdentifier()){let n=e.get(`property`)?.node;if(!n.name)return;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r.addImport(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){e(c.LogLevelLabel.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let r=t.type_exports.ReflectionClass.from({kind:t.type_exports.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),o=s.getEnvReflectionsPath(n,`env`);o&&(0,d.existsSync)(o)&&(e(c.LogLevelLabel.TRACE,`Environment reflection file found at ${o}, reading existing reflection.`),r=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(i.convertFromCapnp(new l.Message((0,u.readFileBufferSync)(o),!1).getRoot(a.SerializedTypes).types)))),e(c.LogLevelLabel.TRACE,`Adding new variables to env reflection at ${o}.`),r.getProperties().filter(e=>e.getNameAsString()&&!n.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{n.env.used.env.addProperty({...e,name:e.getNameAsString(),description:e.getDescription()??`The ${e.getNameAsString()} variable.`,default:e.getDefaultValue(),optional:e.isOptional()?!0:void 0,readonly:e.isReadonly()?!0:void 0,visibility:e.getVisibility(),type:e.getType(),tags:e.getTags()})})}}});exports.envBabelPlugin=f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{
|
|
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)} ${
|
|
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
|
|
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`),t=require(`react/jsx-runtime`),n=require(`@stryke/path/join`)
|
|
1
|
+
require(`../../../deepkit/src/vendor/type.cjs`),require(`../helpers/create-reflection-resource.cjs`);let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`),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{Show as e,code as t}from"@alloy-js/core";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{joinPaths as i}from"@stryke/path/join";import
|
|
1
|
+
import"../../../deepkit/src/vendor/type.mjs";import"../helpers/create-reflection-resource.mjs";import{Show as e,code as t}from"@alloy-js/core";import{jsx as n,jsxs as r}from"react/jsx-runtime";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,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../helpers/load.cjs`),r=require(`../helpers/create-reflection-resource.cjs`);let i=require(`@alloy-js/core`),a=require(`react/jsx-runtime`),o=require(`defu`);o=e.__toESM(o);let s=require(`@stryke/
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../helpers/load.cjs`),r=require(`../helpers/create-reflection-resource.cjs`);let i=require(`@alloy-js/core`),a=require(`react/jsx-runtime`),o=require(`defu`);o=e.__toESM(o);let s=require(`@stryke/string-format/title-case`),c=require(`@stryke/type-checks/is-null`),l=require(`@alloy-js/typescript`),u=require(`@powerlines/alloy/core/contexts/context`),d=require(`@powerlines/alloy/helpers/refkey`),f=require(`@powerlines/alloy/typescript/components/builtin-file`),p=require(`@powerlines/alloy/typescript/components/tsdoc`),m=require(`@powerlines/alloy/typescript/components/typescript-interface`),h=require(`@powerlines/alloy/typescript/components/typescript-object`);function g(e){let[{defaultValue:t,reflection:n}]=(0,i.splitProps)(e,[`defaultValue`,`reflection`]),r=(0,u.usePowerlines)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.TypeScriptInterface,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(l.TypeDeclaration,{name:`Env`,export:!0,children:i.code` {
|
|
2
2
|
[Key in keyof EnvBase as Key ${r?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
|
|
3
3
|
}
|
|
4
4
|
`})]})}function _(e){let[{context:t,name:n}]=(0,i.splitProps)(e,[`context`,`name`]);return t?i.code`propertyName === "${n}" || propertyName.replace(/^(${t.config.env.prefix.sort((e,t)=>e.startsWith(t)?-1:t.startsWith(e)?1:e.localeCompare(t)).map(e=>`${e.replace(/_$/,``)}_`).join(`|`)})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${n.toLowerCase().replace(/[\s\-_]+/g,``)}"`:null}function v(e){let[{context:t,property:n,index:r}]=(0,i.splitProps)(e,[`context`,`property`,`index`]);return t?(0,a.jsx)(a.Fragment,{children:r===0?(0,a.jsx)(l.IfStatement,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`return target["${n.getNameAsString()}"];`}):(0,a.jsx)(l.ElseIfClause,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`return target["${n.getNameAsString()}"];`})}):null}function y(e){let[{context:t,property:n,index:r}]=(0,i.splitProps)(e,[`context`,`property`,`index`]);return t?(0,a.jsx)(a.Fragment,{children:r===0?(0,a.jsx)(l.IfStatement,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`
|
|
@@ -7,7 +7,7 @@ const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../de
|
|
|
7
7
|
`}):(0,a.jsx)(l.ElseIfClause,{condition:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{name:n.getNameAsString(),context:t}),(0,a.jsxs)(i.Show,{when:n.getAlias()&&n.getAlias().length>0,children:[i.code` || `,(0,a.jsx)(i.For,{each:n.getAlias(),joiner:i.code` || `,children:e=>(0,a.jsx)(_,{name:e,context:t})})]})]}),children:i.code`
|
|
8
8
|
target["${n.getNameAsString()}"] = newValue;
|
|
9
9
|
return true;
|
|
10
|
-
`})}):null}const b=(0,d.refkey)(`createEnv`),x=(0,d.refkey)(`env`),S=(0,d.refkey)(`EnvSerializer`);function C(e){let[{defaultConfig:d},m]=(0,i.splitProps)(e,[`defaultConfig`]),_=(0,u.usePowerlines)(),C=(0,i.computed)(()=>_&&n.loadEnvFromContext(_,process.env)),w=r.createReflectionResource(_),T=(0,i.computed)(()=>new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${(0,
|
|
10
|
+
`})}):null}const b=(0,d.refkey)(`createEnv`),x=(0,d.refkey)(`env`),S=(0,d.refkey)(`EnvSerializer`);function C(e){let[{defaultConfig:d},m]=(0,i.splitProps)(e,[`defaultConfig`]),_=(0,u.usePowerlines)(),C=(0,i.computed)(()=>_&&n.loadEnvFromContext(_,process.env)),w=r.createReflectionResource(_),T=(0,i.computed)(()=>new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${(0,s.titleCase)(_?.config?.name)} project.`,types:[]},w.data??void 0)),E=(0,i.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),D=(0,i.computed)(()=>w.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return(0,a.jsxs)(f.BuiltinFile,{...m,id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,imports:(0,o.default)({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},m.imports??{}),children:[(0,a.jsxs)(i.Show,{when:!(0,c.isNull)(w.data),children:[(0,a.jsx)(g,{defaultValue:C.value,reflection:w.data}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{})]}),(0,a.jsx)(h.TypescriptObject,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:C,reflection:T,export:!0,const:!0}),(0,a.jsx)(`hbr`,{}),(0,a.jsx)(`hbr`,{}),(0,a.jsxs)(p.TSDoc,{heading:`The environment configuration serializer for the Powerlines application.`,children:[(0,a.jsx)(p.TSDocLink,{children:`https://deepkit.io/docs/serialization/serializers`}),(0,a.jsx)(p.TSDocLink,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),(0,a.jsx)(p.TSDocRemarks,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),(0,a.jsx)(l.ClassDeclaration,{refkey:S,name:`EnvSerializer`,extends:`Serializer`,export:!0,children:(0,a.jsx)(l.ClassMethod,{name:`constructor`,public:!0,children:i.code`
|
|
11
11
|
super("env");
|
|
12
12
|
|
|
13
13
|
this.deserializeRegistry.register(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{loadEnvFromContext as t}from"../helpers/load.mjs";import{createReflectionResource as n}from"../helpers/create-reflection-resource.mjs";import{For as r,Show as i,code as a,computed as o,splitProps as s}from"@alloy-js/core";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import d from"defu";import{
|
|
1
|
+
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{loadEnvFromContext as t}from"../helpers/load.mjs";import{createReflectionResource as n}from"../helpers/create-reflection-resource.mjs";import{For as r,Show as i,code as a,computed as o,splitProps as s}from"@alloy-js/core";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import d from"defu";import{titleCase as f}from"@stryke/string-format/title-case";import{isNull as p}from"@stryke/type-checks/is-null";import{ClassDeclaration as m,ClassMethod as h,ElseIfClause as g,FunctionDeclaration as _,IfStatement as v,NewExpression as y,TypeDeclaration as b,VarDeclaration as x}from"@alloy-js/typescript";import{usePowerlines as S}from"@powerlines/alloy/core/contexts/context";import{refkey as C}from"@powerlines/alloy/helpers/refkey";import{BuiltinFile as w}from"@powerlines/alloy/typescript/components/builtin-file";import{TSDoc as T,TSDocExample as E,TSDocLink as D,TSDocParam as O,TSDocRemarks as k,TSDocReturns as A,TSDocThrows as j}from"@powerlines/alloy/typescript/components/tsdoc";import{TypeScriptInterface as M}from"@powerlines/alloy/typescript/components/typescript-interface";import{TypescriptObject as N}from"@powerlines/alloy/typescript/components/typescript-object";function P(e){let[{defaultValue:t,reflection:n}]=s(e,[`defaultValue`,`reflection`]),r=S();return u(c,{children:[l(M,{name:` EnvBase`,extends:[`EnvInterface`],defaultValue:t,reflection:n,export:!0}),l(`hbr`,{}),l(`hbr`,{}),l(b,{name:`Env`,export:!0,children:a` {
|
|
2
2
|
[Key in keyof EnvBase as Key ${r?.config.env.prefix.map(e=>`| \`${e.replace(/_$/g,``)}_\${Key}\``).join(` `)}]: EnvBase[Key];
|
|
3
3
|
}
|
|
4
4
|
`})]})}function F(e){let[{context:t,name:n}]=s(e,[`context`,`name`]);return t?a`propertyName === "${n}" || propertyName.replace(/^(${t.config.env.prefix.sort((e,t)=>e.startsWith(t)?-1:t.startsWith(e)?1:e.localeCompare(t)).map(e=>`${e.replace(/_$/,``)}_`).join(`|`)})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${n.toLowerCase().replace(/[\s\-_]+/g,``)}"`:null}function I(e){let[{context:t,property:n,index:o}]=s(e,[`context`,`property`,`index`]);return t?l(c,{children:l(o===0?v:g,{condition:u(c,{children:[l(F,{name:n.getNameAsString(),context:t}),u(i,{when:n.getAlias()&&n.getAlias().length>0,children:[a` || `,l(r,{each:n.getAlias(),joiner:a` || `,children:e=>l(F,{name:e,context:t})})]})]}),children:a`return target["${n.getNameAsString()}"];`})}):null}function L(e){let[{context:t,property:n,index:o}]=s(e,[`context`,`property`,`index`]);return t?l(c,{children:l(o===0?v:g,{condition:u(c,{children:[l(F,{name:n.getNameAsString(),context:t}),u(i,{when:n.getAlias()&&n.getAlias().length>0,children:[a` || `,l(r,{each:n.getAlias(),joiner:a` || `,children:e=>l(F,{name:e,context:t})})]})]}),children:a`
|
|
5
5
|
target["${n.getNameAsString()}"] = newValue;
|
|
6
6
|
return true;
|
|
7
|
-
`})}):null}const R=C(`createEnv`),z=C(`env`),B=C(`EnvSerializer`);function V(g){let[{defaultConfig:v},b]=s(g,[`defaultConfig`]),C=S(),M=o(()=>C&&t(C,process.env)),F=n(C),V=o(()=>new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${
|
|
7
|
+
`})}):null}const R=C(`createEnv`),z=C(`env`),B=C(`EnvSerializer`);function V(g){let[{defaultConfig:v},b]=s(g,[`defaultConfig`]),C=S(),M=o(()=>C&&t(C,process.env)),F=n(C),V=o(()=>new e.ReflectionClass({kind:e.ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${f(C?.config?.name)} project.`,types:[]},F.data??void 0)),H=o(()=>F.data?.getProperties().filter(e=>!e.isIgnored()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]),U=o(()=>F.data?.getProperties().filter(e=>!e.isIgnored()&&!e.isReadonly()).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString()))??[]);return u(w,{...b,id:`env`,description:`The Powerlines environment configuration module provides an interface to define environment configuration parameters.`,imports:d({"@powerlines/deepkit/vendor/type":[`Type`,`stringify`,`serializer`,`serializeFunction`,`deserializeFunction`,`ReflectionKind`,`TemplateState`,`Serializer`,`TypeProperty`,`TypePropertySignature`],"@powerlines/plugin-env/types/runtime":[{name:`EnvInterface`}]},b.imports??{}),children:[u(i,{when:!p(F.data),children:[l(P,{defaultValue:M.value,reflection:F.data}),l(`hbr`,{}),l(`hbr`,{})]}),l(N,{name:`initialEnv`,type:`Partial<EnvBase>`,defaultValue:M,reflection:V,export:!0,const:!0}),l(`hbr`,{}),l(`hbr`,{}),u(T,{heading:`The environment configuration serializer for the Powerlines application.`,children:[l(D,{children:`https://deepkit.io/docs/serialization/serializers`}),l(D,{children:`https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918`}),l(k,{children:`This serializer is used to serialize and deserialize the Powerlines environment configuration.`})]}),l(m,{refkey:B,name:`EnvSerializer`,extends:`Serializer`,export:!0,children:l(h,{name:`constructor`,public:!0,children:a`
|
|
8
8
|
super("env");
|
|
9
9
|
|
|
10
10
|
this.deserializeRegistry.register(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/type-checks/is-set-string`),r=require(
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./source-file-env.cjs`);let n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/join-paths`),i=require(`c12`),a=require(`defu`);a=e.__toESM(a);let o=require(`@stryke/type-checks/is-set-object`),s=require(`@stryke/string-format/kebab-case`),c=require(`@stryke/env/load-env`);async function l(e,n,r){let i=await(0,c.loadEnv)(r,n);if(e.additionalFiles&&e.additionalFiles?.length>0){let t=await Promise.all(e.additionalFiles.map(async e=>(0,c.loadEnvFile)(e,r)));for(let e of t)i=(0,a.default)(e,i)}return t.removeEnvPrefix(i)}async function u(e,t,n,o,s,c){let[u,d]=await Promise.all([l(e,n,t),(0,i.loadConfig)({cwd:t,name:`storm`,envName:n,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:n,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:(0,r.joinPaths)(o,`jiti`),moduleCache:!0}})]);return(0,a.default)(u,d.config,c)}function d(e,t){return(0,a.default)({APP_NAME:(0,s.kebabCase)(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${(0,s.kebabCase)(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:(0,n.isSetString)(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},(0,o.isSetObject)(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,n)=>(e[n.name]=t[n.name]??n.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,r,i]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return(0,a.default)(d(e,process.env),n,r,i)}exports.loadEnv=f,exports.loadEnvFromContext=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeEnvPrefix as e}from"./source-file-env.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import
|
|
1
|
+
import{removeEnvPrefix as e}from"./source-file-env.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{joinPaths as n}from"@stryke/path/join-paths";import{loadConfig as r}from"c12";import i from"defu";import{isSetObject as a}from"@stryke/type-checks/is-set-object";import{kebabCase as o}from"@stryke/string-format/kebab-case";import{loadEnv as s,loadEnvFile as c}from"@stryke/env/load-env";async function l(t,n,r){let a=await s(r,n);if(t.additionalFiles&&t.additionalFiles?.length>0){let e=await Promise.all(t.additionalFiles.map(async e=>c(e,r)));for(let t of e)a=i(t,a)}return e(a)}async function u(e,t,a,o,s,c){let[u,d]=await Promise.all([l(e,a,t),r({cwd:t,name:`storm`,envName:a,defaults:{NAME:s.name?.replace(`@${c.namespace}/`,``),MODE:a,ORG:c.organization},globalRc:!0,packageJson:!0,dotenv:!0,jitiOptions:{fsCache:n(o,`jiti`),moduleCache:!0}})]);return i(u,d.config,c)}function d(e,n){return i({APP_NAME:o(e.config.name||e.packageJson.name?.replace(`/${e.workspaceConfig.namespace}`,``)),APP_VERSION:e.packageJson.version,BUILD_ID:e.meta.buildId,BUILD_TIMESTAMP:new Date(e.meta.timestamp).toISOString(),BUILD_CHECKSUM:e.meta.checksum,RELEASE_ID:e.meta.releaseId,RELEASE_TAG:`${o(e.config.name)}@${e.packageJson.version}`,DEFAULT_LOCALE:e.workspaceConfig.locale,DEFAULT_TIMEZONE:e.workspaceConfig.timezone,LOG_LEVEL:e.config.logLevel,ERROR_URL:e.workspaceConfig.error?.url,ORGANIZATION:t(e.workspaceConfig.organization)?e.workspaceConfig.organization:e.workspaceConfig.organization?.name,PLATFORM:e.config.build.platform,MODE:e.workspaceConfig.mode,DEBUG:e.workspaceConfig.mode===`development`,STACKTRACE:e.workspaceConfig.mode===`development`,ENVIRONMENT:e.environment},a(e?.env?.types?.env)?e.env.types.env?.getProperties().reduce((e,t)=>(e[t.name]=n[t.name]??t.getDefaultValue(),e),{}):{})}async function f(e,t){let[n,r,a]=await Promise.all([u(t,e.config.projectRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.workspaceConfig.workspaceRoot,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig),u(t,e.envPaths.config,e.config.mode,e.cachePath,e.packageJson,e.workspaceConfig)]);return i(d(e,process.env),n,r,a)}export{f as loadEnv,d as loadEnvFromContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../deepkit/src/reflect-type.cjs`),r=require(`./persistence.cjs`);let i=require(`@stryke/path/is-parent-path`),a=require(`@stryke/
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../deepkit/src/vendor/type.cjs`),n=require(`../../../deepkit/src/reflect-type.cjs`),r=require(`./persistence.cjs`);let i=require(`@stryke/path/is-parent-path`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/string-format/title-case`);function s(e,n){return d(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}function c(e,n){return f(e,{type:(0,t.type_exports.merge)(n.map(e=>e.type))})}var l=class{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},u=class{ENCRYPTION_KEY};function d(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base environment configuration definition for the ${(0,o.titleCase)(e.config.name)} project.`,classType:l,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${(0,o.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${e.config.name?`${(0,o.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function f(e,n={}){let r=n.superReflection??new t.type_exports.ReflectionClass({kind:t.type_exports.ReflectionKind.class,description:`The base secrets configuration definition for the ${(0,o.titleCase)(e.config.name)} project.`,classType:u,types:[],implements:[{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${(0,o.titleCase)(e.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new t.type_exports.ReflectionClass(n.type??{kind:t.type_exports.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${e.config.name?`${(0,o.titleCase)(e.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function p(e,o,c){let l;o&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,i.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,o),name:c},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getEnvDefaultTypeDefinition(e));return s(e,[await r.readEnvTypeReflection(e,`env`),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}async function m(e,o,s){let l;o&&(l=(0,t.type_exports.resolveClassType)(await n.reflectType(e,{file:(0,i.isParentPath)(o,e.workspaceConfig.workspaceRoot)?o:(0,a.joinPaths)(e.workspaceConfig.workspaceRoot,o),name:s},{skipNodeModulesBundle:!0})));let u=await n.reflectType(e,await r.getSecretsDefaultTypeDefinition(e));return c(e,[await r.readSecretsReflection(e),l,(0,t.type_exports.resolveClassType)(u)].filter(Boolean))}exports.BaseEnv=l,exports.BaseSecrets=u,exports.createEnvReflection=d,exports.createSecretsReflection=f,exports.mergeEnvReflections=s,exports.mergeSecretsReflections=c,exports.reflectEnv=p,exports.reflectSecrets=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{reflectType as t}from"../../../deepkit/src/reflect-type.mjs";import{getEnvDefaultTypeDefinition as n,getSecretsDefaultTypeDefinition as r,readEnvTypeReflection as i,readSecretsReflection as a}from"./persistence.mjs";import{isParentPath as o}from"@stryke/path/is-parent-path";import{
|
|
1
|
+
import{type_exports as e}from"../../../deepkit/src/vendor/type.mjs";import{reflectType as t}from"../../../deepkit/src/reflect-type.mjs";import{getEnvDefaultTypeDefinition as n,getSecretsDefaultTypeDefinition as r,readEnvTypeReflection as i,readSecretsReflection as a}from"./persistence.mjs";import{isParentPath as o}from"@stryke/path/is-parent-path";import{joinPaths as s}from"@stryke/path/join-paths";import{titleCase as c}from"@stryke/string-format/title-case";function l(t,n){return p(t,{type:(0,e.merge)(n.map(e=>e.type))})}function u(t,n){return m(t,{type:(0,e.merge)(n.map(e=>e.type))})}var d=class{APP_NAME;APP_VERSION;BUILD_ID;BUILD_TIMESTAMP;BUILD_CHECKSUM;RELEASE_ID;RELEASE_TAG;ORGANIZATION;PLATFORM=`neutral`;MODE=`production`;ENVIRONMENT;DEBUG=!1;TEST=!1;MINIMAL=!1;NO_COLOR=!1;FORCE_COLOR=!1;FORCE_HYPERLINK=!1;STACKTRACE=!1;INCLUDE_ERROR_DATA=!1;ERROR_URL;DEFAULT_TIMEZONE;DEFAULT_LOCALE;CI=!1},f=class{ENCRYPTION_KEY};function p(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base environment configuration definition for the ${c(t.config.name)} project.`,classType:d,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`EnvInterface`,description:`The environment configuration interface definition for the ${c(t.config.name)} project.`,types:[]}]});r.name=`Env`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Env`,description:`A schema describing the list of available environment variables that can be used by the ${t.config.name?`${c(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Env`,i}function m(t,n={}){let r=n.superReflection??new e.ReflectionClass({kind:e.ReflectionKind.class,description:`The base secrets configuration definition for the ${c(t.config.name)} project.`,classType:f,types:[],implements:[{kind:e.ReflectionKind.objectLiteral,typeName:`SecretsInterface`,description:`The secrets configuration interface definition for the ${c(t.config.name)} project.`,types:[]}]});r.name=`Secrets`;let i=new e.ReflectionClass(n.type??{kind:e.ReflectionKind.objectLiteral,typeName:`Secrets`,description:`A schema describing the list of available environment secrets that can be used by the ${t.config.name?`${c(t.config.name)} application`:`application`}.`,types:[]},r);return i.name=`Secrets`,i}async function h(r,a,c){let u;a&&(u=(0,e.resolveClassType)(await t(r,{file:o(a,r.workspaceConfig.workspaceRoot)?a:s(r.workspaceConfig.workspaceRoot,a),name:c},{skipNodeModulesBundle:!0})));let d=await t(r,await n(r));return l(r,[await i(r,`env`),u,(0,e.resolveClassType)(d)].filter(Boolean))}async function g(n,i,c){let l;i&&(l=(0,e.resolveClassType)(await t(n,{file:o(i,n.workspaceConfig.workspaceRoot)?i:s(n.workspaceConfig.workspaceRoot,i),name:c},{skipNodeModulesBundle:!0})));let d=await t(n,await r(n));return u(n,[await a(n),l,(0,e.resolveClassType)(d)].filter(Boolean))}export{d as BaseEnv,f as BaseSecrets,p as createEnvReflection,m as createSecretsReflection,l as mergeEnvReflections,u as mergeSecretsReflections,h as reflectEnv,g as reflectSecrets};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@stryke/
|
|
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{
|
|
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-alloy/src/index.cjs`),r=require(`../../plugin-automd/src/index.cjs`),i=require(`../../plugin-babel/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(`@storm-software/config-tools/types`),m=require(`@stryke/path/is-parent-path`),h=require(`react/jsx-runtime`),g=require(
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../deepkit/src/vendor/type.cjs`),n=require(`../../plugin-alloy/src/index.cjs`),r=require(`../../plugin-automd/src/index.cjs`),i=require(`../../plugin-babel/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(`@storm-software/config-tools/types`),m=require(`@stryke/path/is-parent-path`),h=require(`react/jsx-runtime`),g=require(`@stryke/convert/to-array`),_=require(`defu`);_=e.__toESM(_);let v=require(`@stryke/string-format/title-case`),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={})=>[n.default(e.alloy),i.default(e.babel),{name:`env`,async config(){this.log(p.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let t={env:(0,_.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(p.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,g.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(p.LogLevelLabel.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=(0,_.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(p.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,m.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,m.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(p.LogLevelLabel.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let e=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await 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(){return this.log(p.LogLevelLabel.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render((0,h.jsx)(d.EnvBuiltin,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(p.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(p.LogLevelLabel.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${(0,v.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
|
|
|
@@ -7,4 +7,4 @@ Below is a list of environment variables used by the [${this.packageJson.name}](
|
|
|
7
7
|
${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(e=>`| ${e.getNameAsString().trim()} | ${(e.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
8
8
|
`,``)??``).trim()} | ${(0,t.type_exports.stringifyType)(e.getType()).trim().replaceAll(` | `,`, or `)} | ${e.hasDefault()?String(e.getDefaultValue())?.includes(`"`)?e.getDefaultValue():`\`${e.getDefaultValue()}\``:``} | ${e.isValueRequired()?``:`✔`} |`).join(`
|
|
9
9
|
`)}
|
|
10
|
-
`)},async buildEnd(){let e=o.getEnvReflectionsPath(this,`env`);this.log(p.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await o.writeEnvReflection(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:(0,
|
|
10
|
+
`)},async buildEnd(){let e=o.getEnvReflectionsPath(this,`env`);this.log(p.LogLevelLabel.TRACE,`Writing env reflection types to ${e}.`),await o.writeEnvReflection(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:(0,_.default)(e.automd??{},{generators:{env:f.env(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},r.default(e.automd)];var E=T;exports.default=E;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-alloy/src/index.mjs";import n from"../../plugin-automd/src/index.mjs";import r from"../../plugin-babel/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{LogLevelLabel as A}from"@storm-software/config-tools/types";import{isParentPath as j}from"@stryke/path/is-parent-path";import{jsx as M}from"react/jsx-runtime";import
|
|
1
|
+
import{type_exports as e}from"../../deepkit/src/vendor/type.mjs";import t from"../../plugin-alloy/src/index.mjs";import n from"../../plugin-automd/src/index.mjs";import r from"../../plugin-babel/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{LogLevelLabel as A}from"@storm-software/config-tools/types";import{isParentPath as j}from"@stryke/path/is-parent-path";import{jsx as M}from"react/jsx-runtime";import{toArray as N}from"@stryke/convert/to-array";import P from"defu";import{titleCase as F}from"@stryke/string-format/title-case";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={})=>[t(i.alloy),r(i.babel),{name:`env`,async config(){this.log(A.TRACE,"Providing default configuration for the Powerlines `env` build plugin.");let e={env:P(i,{types:{},prefix:[]}),transform:{babel:{plugins:[S]}}};if(e.env.types)e.env.types=I(e.env.types);else{this.log(A.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=N(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(A.TRACE,`Environment plugin configuration has been resolved for the Powerlines project.`),this.config.env.inject??=this.config.projectType===`application`,this.env=P({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(A.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?j(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?j(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(A.TRACE,`Resolved ${this.env.types.env.getProperties().length??0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length??0} secret configuration parameters`);let t=this.env.types.env.getProperties().filter(e=>e.getAlias().length>0);Object.entries(await 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(){return this.log(A.TRACE,`Preparing the Environment runtime artifacts for the Powerlines project.`),this.render(M(D,{defaultConfig:this.config.env.defaultConfig}))},async docs(){this.log(A.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(A.TRACE,`Documenting environment variables configuration in "${r}"`),await this.fs.write(r,`<!-- Generated by ${F(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
|
|
|
@@ -7,4 +7,4 @@ Below is a list of environment variables used by the [${this.packageJson.name}](
|
|
|
7
7
|
${n.getProperties().filter(e=>e.getNameAsString()!==`__POWERLINES_INJECTED__`).sort((e,t)=>e.getNameAsString().localeCompare(t.getNameAsString())).map(t=>`| ${t.getNameAsString().trim()} | ${(t.getDescription()?.replaceAll(`\r`,``)?.replaceAll(`
|
|
8
8
|
`,``)??``).trim()} | ${(0,e.stringifyType)(t.getType()).trim().replaceAll(` | `,`, or `)} | ${t.hasDefault()?String(t.getDefaultValue())?.includes(`"`)?t.getDefaultValue():`\`${t.getDefaultValue()}\``:``} | ${t.isValueRequired()?``:`✔`} |`).join(`
|
|
9
9
|
`)}
|
|
10
|
-
`)},async buildEnd(){let e=p(this,`env`);this.log(A.TRACE,`Writing env reflection types to ${e}.`),await b(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:
|
|
10
|
+
`)},async buildEnd(){let e=p(this,`env`);this.log(A.TRACE,`Writing env reflection types to ${e}.`),await b(this,this.env.used.env,`env`)}},{name:`env:automd-generator`,config(){return{automd:P(i.automd??{},{generators:{env:k(this)}})}}},{name:`env:vite`,vite:{configResolved(){return{envPrefix:this.config?.env?.prefix}}}},n(i.automd)];export{H as default};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/replace`),n=require(`defu`);
|
|
2
|
-
import ${(0,
|
|
3
|
-
export { ${(0,
|
|
4
|
-
import ${t[1]===`*`?`* as ${(0,
|
|
5
|
-
export { ${(0,
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/replace`),n=require(`@stryke/path/join-paths`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/helpers/omit`),o=require(`@stryke/string-format/camel-case`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let t=e.config.build.override.inject??e.config.build.inject;return t&&Object.keys(t).length>0&&e.fs.writeSync((0,n.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(t).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,o.camelCase)(e)!==e){if(t.length===1)return`
|
|
2
|
+
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,
|
|
10
|
-
import ${(0,
|
|
11
|
-
export { ${(0,
|
|
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,
|
|
14
|
+
`)),(0,r.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:t&&Object.keys(t).length>0?[(0,n.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{replacePath as e}from"@stryke/path/replace";import
|
|
2
|
-
import ${
|
|
3
|
-
export { ${
|
|
4
|
-
import ${t[1]===`*`?`* as ${
|
|
5
|
-
export { ${
|
|
1
|
+
import"../entry.mjs";import{replacePath as e}from"@stryke/path/replace";import{joinPaths as t}from"@stryke/path/join-paths";import n from"defu";import{isString as r}from"@stryke/type-checks/is-string";import{omit as i}from"@stryke/helpers/omit";import{camelCase as a}from"@stryke/string-format/camel-case";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(e){let r=e.config.build.override.inject??e.config.build.inject;return r&&Object.keys(r).length>0&&e.fs.writeSync(t(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(r).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(
|
|
10
|
-
import ${
|
|
11
|
-
export { ${
|
|
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
|
-
`)),
|
|
14
|
+
`)),n({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:r&&Object.keys(r).length>0?[t(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?i(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?i(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`},o)}export{s as extractESBuildConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/
|
|
1
|
+
require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/replace`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/convert/to-array`),r=require(`@stryke/fs/is-file`),i=require(`@stryke/fs/list-files`),a=require(`@stryke/path/append`),o=require(`@stryke/path/join-paths`),s=require(`@stryke/type-checks/is-string`),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{replacePath as e}from"@stryke/path/replace";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{
|
|
1
|
+
import"../plugin-utils/paths.mjs";import{replacePath as e}from"@stryke/path/replace";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{toArray as n}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as r}from"@stryke/fs/list-files";import{appendPath as i}from"@stryke/path/append";import{joinPaths as a}from"@stryke/path/join-paths";import{isString as o}from"@stryke/type-checks/is-string";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 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@storm-software/config-tools/types`),n=require(
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@storm-software/config-tools/types`),n=require(`chalk`);n=e.__toESM(n),require(`@storm-software/config-tools/logger`),require(`@storm-software/config-tools/utilities/colors`),require(`@stryke/helpers/noop`);let r=require(`@stryke/string-format/kebab-case`),i=require(`@stryke/string-format/title-case`);const a=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],o=(e,t)=>(r,...o)=>e(r,` ${n.default.inverse.hex(a[t.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%a.length]||a[0])(` ${(0,i.titleCase)(t)} `)} ${o.join(` `)} `);exports.extendLog=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LogLevelLabel as e}from"@storm-software/config-tools/types";import
|
|
1
|
+
import{LogLevelLabel as e}from"@storm-software/config-tools/types";import t from"chalk";import"@storm-software/config-tools/logger";import"@storm-software/config-tools/utilities/colors";import"@stryke/helpers/noop";import{kebabCase as n}from"@stryke/string-format/kebab-case";import{titleCase as r}from"@stryke/string-format/title-case";const i=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#D8B4FE`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`,`#8B5CF6`],a=(e,n)=>(a,...o)=>e(a,` ${t.inverse.hex(i[n.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%i.length]||i[0])(` ${r(n)} `)} ${o.join(` `)} `);export{a as extendLog};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-crypto",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.89",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin that provides unique identifier generation capabilities at runtime by adding the `id` builtin module.",
|
|
6
6
|
"repository": {
|
|
@@ -128,17 +128,17 @@
|
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@powerlines/plugin-env": "^0.14.
|
|
131
|
+
"@powerlines/plugin-env": "^0.14.14",
|
|
132
132
|
"@storm-software/config-tools": "^1.188.74",
|
|
133
133
|
"@stryke/path": "^0.24.0",
|
|
134
134
|
"defu": "^6.1.4",
|
|
135
|
-
"powerlines": "^0.36.
|
|
135
|
+
"powerlines": "^0.36.16",
|
|
136
136
|
"@noble/ciphers": "^2.1.1"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@powerlines/nx": "^0.11.
|
|
139
|
+
"@powerlines/nx": "^0.11.42",
|
|
140
140
|
"@types/node": "^24.10.4"
|
|
141
141
|
},
|
|
142
142
|
"publishConfig": { "access": "public" },
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "d81b9da2628c49a75e654462be7062599d2c6441"
|
|
144
144
|
}
|
|
@@ -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`),t=require(`react/jsx-runtime`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"@alloy-js/core";import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`),n=require(`react/jsx-runtime`),r=require(`@stryke/path/append`),i=require(`defu`);i=e.__toESM(i);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Show as e,splitProps as t}from"@alloy-js/core";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{appendPath as i}from"@stryke/path/append";import a from"defu";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/helpers/get-unique`),r=require(`@stryke/type-checks/is-null`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/type-checks/is-undefined`);require(`@stryke/capnp/compile`),require(`@stryke/capnp/helpers`);let o=require(`@stryke/convert/to-array`);require(`@stryke/json`);let s=require(`@stryke/path/join`),c=require(`@stryke/string-format/camel-case`);require(`@stryke/string-format/get-words`),require(`@stryke/string-format/pascal-case`);let l=require(`@stryke/string-format/title-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{getUniqueBy as t}from"@stryke/helpers/get-unique";import{isNull as n}from"@stryke/type-checks/is-null";import{isString as r}from"@stryke/type-checks/is-string";import{isUndefined as i}from"@stryke/type-checks/is-undefined";import"@stryke/capnp/compile";import"@stryke/capnp/helpers";import{toArray as a}from"@stryke/convert/to-array";import"@stryke/json";import{joinPaths as o}from"@stryke/path/join";import{camelCase as s}from"@stryke/string-format/camel-case";import"@stryke/string-format/get-words";import"@stryke/string-format/pascal-case";import{titleCase as c}from"@stryke/string-format/title-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/type-checks/is-undefined`),t=require(`@stryke/string-format/camel-case`),n=require(`@stryke/string-format/title-case`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../../deepkit/src/utilities.mjs";import{isUndefined as e}from"@stryke/type-checks/is-undefined";import{camelCase as t}from"@stryke/string-format/camel-case";import{titleCase as n}from"@stryke/string-format/title-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`),t=require(`react/jsx-runtime`),n=require(`@stryke/string-format/title-case`);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{Show as e,code as t,splitProps as n}from"@alloy-js/core";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{titleCase as o}from"@stryke/string-format/title-case";import"@alloy-js/markdown";export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../contexts/markdown-table.cjs`);let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`),n=require(`@stryke/type-checks/is-undefined`),r=require(`@stryke/string-format/title-case`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../contexts/markdown-table.mjs";import{Show as e,code as t,computed as n,splitProps as r}from"@alloy-js/core";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{isUndefined as s}from"@stryke/type-checks/is-undefined";import{titleCase as c}from"@stryke/string-format/title-case";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 +0,0 @@
|
|
|
1
|
-
require(`./tsdoc.cjs`),require(`./typescript-file.cjs`);let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./tsdoc.mjs";import"./typescript-file.mjs";import{splitProps as e}from"@alloy-js/core";import{jsx as t}from"react/jsx-runtime";export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`),n=require(`@alloy-js/typescript`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{code as e}from"@alloy-js/core";import{jsx as t}from"react/jsx-runtime";import{VarDeclaration as n}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`),n=require(`react/jsx-runtime`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/path/join-paths`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../core/contexts/context.mjs";import"./typescript-file.mjs";import{computed as e,splitProps as t}from"@alloy-js/core";import{jsx as n}from"react/jsx-runtime";import r from"defu";import{joinPaths as i}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`),t=require(`@stryke/type-checks/is-set-string`),n=require(`react/jsx-runtime`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/type-checks/is-undefined`),a=require(`@stryke/string-format/title-case`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../core/contexts/reflection.mjs";import"./tsdoc.mjs";import{Show as e,code as t,computed as n,splitProps as r}from"@alloy-js/core";import{isSetString as i}from"@stryke/type-checks/is-set-string";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{isString as s}from"@stryke/type-checks/is-string";import{isUndefined as c}from"@stryke/type-checks/is-undefined";import{titleCase as l}from"@stryke/string-format/title-case";export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../core/contexts/context.cjs`),require(`../../../../deepkit/src/utilities.cjs`);let e=require(`@alloy-js/core`),t=require(`@stryke/type-checks/is-set-string`),n=require(`react/jsx-runtime`),r=require(`@stryke/type-checks/is-undefined`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../core/contexts/context.mjs";import"../../../../deepkit/src/utilities.mjs";import{For as e,Show as t,splitProps as n}from"@alloy-js/core";import{isSetString as r}from"@stryke/type-checks/is-set-string";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{isUndefined as s}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`),t=require(`react/jsx-runtime`),n=require(`@stryke/path/append`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/string-format/title-case`),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{Show as e,code as t,splitProps as n}from"@alloy-js/core";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{appendPath as o}from"@stryke/path/append";import{isString as s}from"@stryke/type-checks/is-string";import{titleCase as c}from"@stryke/string-format/title-case";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`),t=require(`react/jsx-runtime`),n=require(`@stryke/type-checks/is-string`);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{For as e,computed as t,splitProps as n}from"@alloy-js/core";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{isString as a}from"@stryke/type-checks/is-string";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`),t=require(`react/jsx-runtime`),n=require(`@stryke/type-checks/is-string`),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{For as e,Show as t,computed as n,splitProps as r}from"@alloy-js/core";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{isString as o}from"@stryke/type-checks/is-string";import{isUndefined as s}from"@stryke/type-checks/is-undefined";import{camelCase as c}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{};
|