@powerlines/plugin-crypto 0.10.83 → 0.10.85
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/deepkit/src/vendor/core.cjs +1 -0
- package/dist/deepkit/src/vendor/core.mjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugin-alloy/src/core/components/index.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/index.mjs +1 -0
- package/dist/plugin-alloy/src/core/components/output.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +1 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +1 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +1 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +1 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +1 -0
- package/dist/plugin-alloy/src/core/index.cjs +1 -0
- package/dist/plugin-alloy/src/core/index.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/capnp.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/capnp.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/create-builtin.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/create-builtin.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/index.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/index.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +1 -0
- package/dist/plugin-alloy/src/helpers/typescript.cjs +1 -0
- package/dist/plugin-alloy/src/helpers/typescript.mjs +1 -0
- package/dist/plugin-alloy/src/index.cjs +2 -0
- package/dist/plugin-alloy/src/index.mjs +2 -0
- package/dist/plugin-alloy/src/markdown/components/index.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/index.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/index.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/index.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +1 -0
- package/dist/plugin-alloy/src/markdown/index.cjs +1 -0
- package/dist/plugin-alloy/src/markdown/index.mjs +1 -0
- package/dist/plugin-alloy/src/types/index.d.mts +1 -1
- package/dist/plugin-alloy/src/types/plugin.d.cts +5 -1
- package/dist/plugin-alloy/src/types/plugin.d.mts +5 -2
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/dynamic-import-statement.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/entry-file.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/entry-file.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/index.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/index.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/record-expression.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/record-expression.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +1 -0
- package/dist/plugin-alloy/src/typescript/index.cjs +1 -0
- package/dist/plugin-alloy/src/typescript/index.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/filters.cjs +1 -1
- package/dist/plugin-babel/src/helpers/filters.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-babel/src/index.cjs +1 -1
- package/dist/plugin-babel/src/index.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 +8 -8
- package/dist/plugin-env/src/components/env.mjs +7 -7
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +1 -1
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +1 -1
- 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/plugin-env/src/types/plugin.d.cts +10 -3
- package/dist/plugin-env/src/types/plugin.d.mts +10 -3
- 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/dist/powerlines/src/types/config.d.mts +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/type.cjs`);let n=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/helpers/get-unique`),i=require(`@stryke/type-checks/is-null`),a=require(`@stryke/type-checks/is-string`),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,r){return(0,o.isUndefined)(r)?`undefined`:(0,i.isNull)(r)?`null`:e.kind===t.type_exports.ReflectionKind.boolean?String(r).trim().toLowerCase()===`true`?`true`:`false`:e.kind===t.type_exports.ReflectionKind.string||e.kind===t.type_exports.ReflectionKind.literal&&(0,a.isString)(e.literal)?c(r):e.kind===t.type_exports.ReflectionKind.enum?u(e).kind===t.type_exports.ReflectionKind.string?c(r):`${String(r)}`:e.kind===t.type_exports.ReflectionKind.union?f(e)?c(r):`${String(r)}`:e.kind===t.type_exports.ReflectionKind.array?c(n.StormJSON.stringify(r)):e.kind===t.type_exports.ReflectionKind.object||e.kind===t.type_exports.ReflectionKind.objectLiteral?n.StormJSON.stringify(r):e.kind===t.type_exports.ReflectionKind.property||e.kind===t.type_exports.ReflectionKind.parameter?l(e.type,r):String(r)}function u(e){if(e.kind!==t.type_exports.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let n=(0,r.getUniqueBy)(e.values.filter(e=>e!=null),e=>(0,a.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,a.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,r.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,a.isString)(e.literal))}exports.stringifyDefaultValue=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{type_exports as e}from"./vendor/type.mjs";import{
|
|
1
|
+
import{type_exports as e}from"./vendor/type.mjs";import{StormJSON as t}from"@stryke/json/storm-json";import{getUniqueBy as n}from"@stryke/helpers/get-unique";import{isNull as r}from"@stryke/type-checks/is-null";import{isString as i}from"@stryke/type-checks/is-string";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(n,o){return a(o)?`undefined`:r(o)?`null`:n.kind===e.ReflectionKind.boolean?String(o).trim().toLowerCase()===`true`?`true`:`false`:n.kind===e.ReflectionKind.string||n.kind===e.ReflectionKind.literal&&i(n.literal)?s(o):n.kind===e.ReflectionKind.enum?l(n).kind===e.ReflectionKind.string?s(o):`${String(o)}`:n.kind===e.ReflectionKind.union?d(n)?s(o):`${String(o)}`:n.kind===e.ReflectionKind.array?s(t.stringify(o)):n.kind===e.ReflectionKind.object||n.kind===e.ReflectionKind.objectLiteral?t.stringify(o):n.kind===e.ReflectionKind.property||n.kind===e.ReflectionKind.parameter?c(n.type,o):String(o)}function l(t){if(t.kind!==e.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${t.kind}.`);let r=n(t.values.filter(e=>e!=null),t=>i(t)?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number});if(r.length===0)throw Error(`No valid enum members could be found.`);return r[0]&&i(r[0])?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number}}function u(t){if(t.kind===e.ReflectionKind.union&&t.types.length>0)return n(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&&i(t.literal))}export{o as stringifyDefaultValue};
|
|
@@ -0,0 +1 @@
|
|
|
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]}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"@deepkit/core";export{};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./plugin-env/src/index.cjs`),n=require(`./components/crypto.cjs`);require(`./components/index.cjs`);let r=require(`@noble/ciphers/utils.js`),i=require(
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./plugin-env/src/index.cjs`),n=require(`./components/crypto.cjs`);require(`./components/index.cjs`);let r=require(`@noble/ciphers/utils.js`),i=require(`@storm-software/config-tools/types`),a=require(`defu`);a=e.__toESM(a);function o(e={}){return[t.default(e.env),{name:`crypto`,config(){return{crypto:(0,a.default)(e,{salt:`${(this.config.name??this.workspaceConfig?.name)||this.packageJson?.name}-application`})}},configResolved(){this.dependencies[`@noble/ciphers`]=`^2.0.1`,this.dependencies[`@noble/hashes`]=`^2.0.1`,this.config.crypto.salt??=this.env.parsed.SALT,this.config.crypto.salt||(this.log(i.LogLevelLabel.WARN,"No salt provided to the Crypto plugin - a salt value will be generated automatically. Please note: It's highly recommended to provide a unique salt value via the `salt` plugin option or the `SALT` environment variable."),this.config.crypto.salt=(0,r.bytesToHex)((0,r.randomBytes)(12))),this.config.crypto.encryptionKey??=this.env.parsed.ENCRYPTION_KEY,this.config.crypto.encryptionKey||(this.log(i.LogLevelLabel.WARN,"No encryption key provided to the Crypto plugin - a secure key will be generated automatically. Please note: it's highly recommended to provide a secure encryption key via the `encryptionKey` plugin option or the `ENCRYPTION_KEY` environment variable."),this.config.crypto.encryptionKey=(0,r.bytesToHex)((0,r.randomBytes)(32)))},async prepare(){this.log(i.LogLevelLabel.TRACE,`Preparing the Crypto runtime artifacts for the Powerlines project.`),await this.emitBuiltin(await Promise.resolve(n.cryptoModule(this)),`crypto`,`crypto.ts`)}}]}var s=o;exports.cryptoModule=n.cryptoModule,exports.default=s,exports.plugin=o;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./plugin-env/src/index.mjs";import{cryptoModule as t}from"./components/crypto.mjs";import"./components/index.mjs";import{bytesToHex as n,randomBytes as r}from"@noble/ciphers/utils.js";import
|
|
1
|
+
import e from"./plugin-env/src/index.mjs";import{cryptoModule as t}from"./components/crypto.mjs";import"./components/index.mjs";import{bytesToHex as n,randomBytes as r}from"@noble/ciphers/utils.js";import{LogLevelLabel as i}from"@storm-software/config-tools/types";import a from"defu";function o(o={}){return[e(o.env),{name:`crypto`,config(){return{crypto:a(o,{salt:`${(this.config.name??this.workspaceConfig?.name)||this.packageJson?.name}-application`})}},configResolved(){this.dependencies[`@noble/ciphers`]=`^2.0.1`,this.dependencies[`@noble/hashes`]=`^2.0.1`,this.config.crypto.salt??=this.env.parsed.SALT,this.config.crypto.salt||(this.log(i.WARN,"No salt provided to the Crypto plugin - a salt value will be generated automatically. Please note: It's highly recommended to provide a unique salt value via the `salt` plugin option or the `SALT` environment variable."),this.config.crypto.salt=n(r(12))),this.config.crypto.encryptionKey??=this.env.parsed.ENCRYPTION_KEY,this.config.crypto.encryptionKey||(this.log(i.WARN,"No encryption key provided to the Crypto plugin - a secure key will be generated automatically. Please note: it's highly recommended to provide a secure encryption key via the `encryptionKey` plugin option or the `ENCRYPTION_KEY` environment variable."),this.config.crypto.encryptionKey=n(r(32)))},async prepare(){this.log(i.TRACE,`Preparing the Crypto runtime artifacts for the Powerlines project.`),await this.emitBuiltin(await Promise.resolve(t(this)),`crypto`,`crypto.ts`)}}]}var s=o;export{t as cryptoModule,s as default,o as plugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./output.cjs`);require(`./single-line-comment.cjs`),require(`./source-file.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Output as e}from"./output.mjs";import"./single-line-comment.mjs";import"./source-file.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../contexts/context.cjs`);let n=require(`@alloy-js/core`),r=require(`@stryke/path/replace`),i=require(`react/jsx-runtime`);function a(e){let[{children:a,context:o,basePath:s},c]=(0,n.splitProps)(e,[`children`,`context`,`basePath`]),l=(0,n.ref)(o),u=(0,n.computed)(()=>s?(0,r.replacePath)(s,l.value.workspaceConfig.workspaceRoot):l.value.workspaceConfig.workspaceRoot);return(0,i.jsx)(n.Output,{...c,basePath:u.value,children:(0,i.jsx)(t.PowerlinesContext.Provider,{value:{ref:l},children:(0,i.jsx)(n.Show,{when:!!l.value,children:a})})})}exports.Output=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PowerlinesContext as e}from"../contexts/context.mjs";import{Output as t,Show as n,computed as r,ref as i,splitProps as a}from"@alloy-js/core";import{replacePath as o}from"@stryke/path/replace";import{jsx as s}from"react/jsx-runtime";function c(c){let[{children:l,context:u,basePath:d},f]=a(c,[`children`,`context`,`basePath`]),p=i(u),m=r(()=>d?o(d,p.value.workspaceConfig.workspaceRoot):p.value.workspaceConfig.workspaceRoot);return s(t,{...f,basePath:m.value,children:s(e.Provider,{value:{ref:p},children:s(n,{when:!!p.value,children:l})})})}export{c as Output};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"@alloy-js/core";import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core`);const n=(0,t.createContext)();exports.PowerlinesContext=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e}from"@alloy-js/core";const t=e();export{t as PowerlinesContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./context.cjs`);require(`./reflection.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PowerlinesContext as e}from"./context.mjs";import"./reflection.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,createNamedContext as t}from"@alloy-js/core";e(),t(`reflection-property`),t(`reflection-method`),t(`reflection-parameter`);export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./contexts/context.cjs`),t=require(`./components/output.cjs`);require(`./components/index.cjs`),require(`./contexts/index.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"@alloy-js/typescript";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./capnp.cjs`),require(`./create-builtin.cjs`),require(`./refkey.cjs`),require(`./typescript.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./capnp.mjs";import"./create-builtin.mjs";import"./refkey.mjs";import"./typescript.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/core`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"@alloy-js/core";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./core/contexts/context.cjs`),n=require(`./core/components/output.cjs`);require(`./core/index.cjs`),require(`./helpers/index.cjs`),require(`./markdown/index.cjs`),require(`./typescript/index.cjs`);let r=require(`@alloy-js/core`),i=require(`@alloy-js/rollup-plugin`);i=e.__toESM(i);let a=require(`@storm-software/config-tools/types`),o=require(`@stryke/json/storm-json`),s=require(`@stryke/path/is-parent-path`),c=require(`@stryke/path/replace`),l=require(`@stryke/type-checks/is-set-string`),u=require(`prettier/doc.js`),d=require(`react/jsx-runtime`);const f=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[(0,i.default)()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,o.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let t=(0,r.renderTree)((0,d.jsx)(n.Output,{context:this,basePath:this.workspaceConfig.workspaceRoot,children:e}));await m(this,t,this.config.alloy)}}}}];var p=f;async function m(e,t,n={}){await(0,r.flushJobsAsync)();let i,o=async(t,l)=>{if(!Array.isArray(l))return;let u=async e=>{for(let t of l)await o(e,t)},d=(0,r.getContextForRenderNode)(l);if(!d)return u(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):i=e,await u(e)}else if(d.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(d.meta?.builtin){if(!d.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(a.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,c.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,l,n)}}else d.meta?.entry||(0,s.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(a.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,l,n)}):(e.log(a.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,l,n)});t.contents.push(r)}else if(d.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(a.LogLevelLabel.TRACE,`Processing copy file operation from "${d.meta.copyFile.sourcePath}" to "${d.meta.copyFile.path}"`),!d.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!d.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await u(t)};await o(void 0,t);let u=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await u(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path,n.typeDefinition);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!(0,l.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,l.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,i)}async function h(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,r.flushJobsAsync)();let i=u.printer.printDocToString(g(t),n).formatted;return n.insertFinalNewLine&&!i.endsWith(`
|
|
2
|
+
`)?`${i}\n`:i}function g(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else (0,r.isPrintHook)(n)?t.push(n.print(n.subtree,g)):t.push(g(n));return t}exports.default=p;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{PowerlinesContext as e}from"./core/contexts/context.mjs";import{Output as t}from"./core/components/output.mjs";import"./core/index.mjs";import"./helpers/index.mjs";import"./markdown/index.mjs";import"./typescript/index.mjs";import{flushJobsAsync as n,getContextForRenderNode as r,isPrintHook as i,renderTree as a}from"@alloy-js/core";import o from"@alloy-js/rollup-plugin";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import{StormJSON as c}from"@stryke/json/storm-json";import{isParentPath as l}from"@stryke/path/is-parent-path";import{replacePath as u}from"@stryke/path/replace";import{isSetString as d}from"@stryke/type-checks/is-set-string";import{printer as f}from"prettier/doc.js";import{jsx as p}from"react/jsx-runtime";var m=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[o()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,c.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let n=a(p(t,{context:this,basePath:this.workspaceConfig.workspaceRoot,children:e}));await h(this,n,this.config.alloy)}}}}];async function h(e,t,i={}){await n();let a,o=async(t,n)=>{if(!Array.isArray(n))return;let c=async e=>{for(let t of n)await o(e,t)},d=r(n);if(!d)return c(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):a=e,await c(e)}else if(d.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(d.meta?.builtin){if(!d.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(s.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:u(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await g(e,n,i)}}else d.meta?.entry||l(e.entryPath,d.meta.sourceFile.path)?(e.log(s.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await g(e,n,i)}):(e.log(s.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await g(e,n,i)});t.contents.push(r)}else if(d.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(s.TRACE,`Processing copy file operation from "${d.meta.copyFile.sourcePath}" to "${d.meta.copyFile.path}"`),!d.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!d.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await c(t)};await o(void 0,t);let c=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await c(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(!d(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&d(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 c(e,a)}async function g(e,t,r={}){r.printWidth??=160,r.tabWidth??=2,r.useTabs??=!1,r.insertFinalNewLine??=!0,await n();let i=f.printDocToString(_(t),r).formatted;return r.insertFinalNewLine&&!i.endsWith(`
|
|
2
|
+
`)?`${i}\n`:i}function _(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else i(n)?t.push(n.print(n.subtree,_)):t.push(_(n));return t}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./markdown-file.cjs`),require(`./markdown-table.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./markdown-file.mjs";import"./markdown-table.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./markdown-table.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./markdown-table.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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:[]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,createNamedContext as t}from"@alloy-js/core";t(`markdown-table-column`,{}),e({columns:[],data:[]});export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./components/index.cjs`),require(`./contexts/index.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./components/index.mjs";import"./contexts/index.mjs";export{};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "./components.mjs";
|
|
2
|
-
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig } from "./plugin.mjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
1
2
|
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
2
3
|
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
3
4
|
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
@@ -24,6 +25,9 @@ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
|
24
25
|
*/
|
|
25
26
|
markdown?: boolean;
|
|
26
27
|
};
|
|
28
|
+
type AlloyPluginUserConfig = UserConfig & {
|
|
29
|
+
alloy?: AlloyPluginOptions;
|
|
30
|
+
};
|
|
27
31
|
type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
28
32
|
alloy: AlloyPluginOptions;
|
|
29
33
|
};
|
|
@@ -31,4 +35,4 @@ type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = Allo
|
|
|
31
35
|
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
32
36
|
};
|
|
33
37
|
//#endregion
|
|
34
|
-
export { AlloyPluginContext };
|
|
38
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../powerlines/src/types/config.mjs";
|
|
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
4
|
import { PrintTreeOptions } from "@alloy-js/core";
|
|
@@ -25,6 +25,9 @@ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
|
25
25
|
*/
|
|
26
26
|
markdown?: boolean;
|
|
27
27
|
};
|
|
28
|
+
type AlloyPluginUserConfig = UserConfig & {
|
|
29
|
+
alloy?: AlloyPluginOptions;
|
|
30
|
+
};
|
|
28
31
|
type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
29
32
|
alloy: AlloyPluginOptions;
|
|
30
33
|
};
|
|
@@ -32,4 +35,4 @@ type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = Allo
|
|
|
32
35
|
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
33
36
|
};
|
|
34
37
|
//#endregion
|
|
35
|
-
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig };
|
|
38
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./tsdoc.cjs`),require(`./typescript-file.cjs`);let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/core`),t=require(`react/jsx-runtime`),n=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/core`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{code as e}from"@alloy-js/core";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
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`);
|
|
@@ -0,0 +1 @@
|
|
|
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{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./components/index.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./components/index.mjs";export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/path/replace`),n=require(`@stryke/path/append`),r=require(`defu`);r=e.__toESM(r);let i=require(`@stryke/convert/to-array`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`),c=require(`@stryke/path/is-type`),l=require(`automd`),u=require(`c12`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let t=await(0,l.loadConfig)((0,a.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=(0,i.toArray)(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:(0,r.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,i.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,i.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,u.loadConfig)({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=(0,l.resolveConfig)((0,r.default)(this.config.automd,{...e,prefix:(0,i.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,s.listFiles)((0,c.isAbsolutePath)(e)?e:(0,n.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,c.isAbsolutePath)(e)?e:(0,n.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,c.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,n.appendPath)(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:(0,d.default)(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>{let r=await this.fs.read(e);if(r){let i=await(0,l.transform)(r,this.config.automd);if(i.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);i.hasChanged&&await this.fs.write((0,n.appendPath)(this.config.automd.output?(0,o.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{
|
|
1
|
+
import{replacePath as e}from"@stryke/path/replace";import{appendPath as t}from"@stryke/path/append";import n from"defu";import{toArray as r}from"@stryke/convert/to-array";import{joinPaths as i}from"@stryke/path/join-paths";import{isDirectory as a}from"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import{isAbsolutePath as s}from"@stryke/path/is-type";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{loadConfig as d}from"c12";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let e=await c(i(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!e.prefix||!Array.isArray(e.prefix))&&(e.prefix=r(e.prefix??[])),e.prefix.includes(`automd`)||e.prefix.push(`automd`),e.prefix.includes(`powerlines`)||e.prefix.push(`powerlines`),{automd:n(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&&!r(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=r(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await d({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(n(this.config.automd,{...e,prefix:r(e.prefix??[])}))}this.config.automd.input=(await Promise.all(r(this.config.automd.input).map(async e=>e.includes(`*`)?o(s(e)?e:t(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):s(e)?e:t(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!s(this.config.automd.output)&&(this.config.automd.output=t(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:f(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all(r(this.config.automd.input).map(async n=>{let r=await this.fs.read(n);if(r){let i=await u(r,this.config.automd);if(i.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${n}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);i.hasChanged&&await this.fs.write(t(this.config.automd.output?a(this.config.automd.output)?e(n,this.config.automd.output):this.config.automd.output:n,this.config.projectRoot),i.contents)}}))}});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/type-checks/is-function`);require(`@stryke/type-checks/is-object`);function r(e){return(0,t.isSetString)(e)?e:Array.isArray(e)&&e.length>0?r(e[0]):e.$$name||e.name?e.$$name||e.name:void 0}function i(e,t){return!!(r(t)&&e.some(e=>Array.isArray(e)&&r(e[0])===r(t)))}exports.getPluginName=r,exports.isDuplicatePlugin=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isFunction as t}from"@stryke/type-checks/is-function";import"@stryke/type-checks/is-object";function n(t){return e(t)?t:Array.isArray(t)&&t.length>0?n(t[0]):t.$$name||t.name?t.$$name||t.name:void 0}function r(e,t){return!!(n(t)&&e.some(e=>Array.isArray(e)&&n(e[0])===n(t)))}export{n as getPluginName,r as isDuplicatePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@babel/types`);
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./ast-utils.cjs`);let t=require(`@stryke/type-checks/is-string`),n=require(`@babel/types`);n=e.__toESM(n);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,t){a(e).get(t.module)||e.unshiftContainer(`body`,n.importDeclaration([n.importSpecifier(n.identifier(t.name||t.imported),n.identifier(t.imported))],n.stringLiteral(t.module)))}exports.addImport=r,exports.addImportsToProgram=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./ast-utils.mjs";import
|
|
1
|
+
import"./ast-utils.mjs";import{isString as e}from"@stryke/type-checks/is-string";import*as t from"@babel/types";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(e,n){i(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)))}export{n as addImport,a as addImportsToProgram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/filters.cjs`),n=require(`./helpers/options.cjs`),r=require(`./helpers/create-plugin.cjs`),i=require(`./helpers/module-helpers.cjs`);require(`./helpers/index.cjs`);let a=require(`defu`);
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/filters.cjs`),n=require(`./helpers/options.cjs`),r=require(`./helpers/create-plugin.cjs`),i=require(`./helpers/module-helpers.cjs`);require(`./helpers/index.cjs`);let a=require(`@storm-software/config-tools/types`),o=require(`@stryke/path/is-parent-path`),s=require(`defu`);s=e.__toESM(s);let c=require(`@babel/core`),l=require(`@stryke/path/file-path-fns`),u=require(`@stryke/type-checks/is-set-object`);const d=(e={})=>({name:`babel`,config(){if((0,u.isSetObject)(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=(0,s.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if((0,o.isParentPath)(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(a.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(a.LogLevelLabel.TRACE,`Babel transforming file: ${i}`);let u=this.config.transform.babel.plugins.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e)),d=this.config.transform.babel.presets.map(e=>n.resolveBabelPlugin(this,r,i,e)).filter((e,n,r)=>e&&!t.isDuplicatePlugin(r,e));if(Array.isArray(u)&&u.length===0&&Array.isArray(d)&&d.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes((0,l.findFileExtensionSafe)(i))&&!t.isDuplicatePlugin(u,`@babel/plugin-syntax-typescript`)&&!t.isDuplicatePlugin(d,`@babel/preset-typescript`)&&u.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,l.findFileExtension)(i)===`.tsx`}]);let f=await(0,c.transformAsync)(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:u.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,s.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:d.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,s.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!f?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:f.code,id:i}}});var f=d;exports.default=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPluginName as e,isDuplicatePlugin as t}from"./helpers/filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./helpers/options.mjs";import{createBabelPlugin as i}from"./helpers/create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./helpers/module-helpers.mjs";import"./helpers/index.mjs";import s
|
|
1
|
+
import{getPluginName as e,isDuplicatePlugin as t}from"./helpers/filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./helpers/options.mjs";import{createBabelPlugin as i}from"./helpers/create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./helpers/module-helpers.mjs";import"./helpers/index.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import{isParentPath as c}from"@stryke/path/is-parent-path";import l from"defu";import{transformAsync as u}from"@babel/core";import{findFileExtension as d,findFileExtensionSafe as f}from"@stryke/path/file-path-fns";import{isSetObject as p}from"@stryke/type-checks/is-set-object";var m=(e={})=>({name:`babel`,config(){if(p(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=l(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if(c(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(s.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(s.TRACE,`Babel transforming file: ${i}`);let a=this.config.transform.babel.plugins.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e)),o=this.config.transform.babel.presets.map(e=>n(this,r,i,e)).filter((e,n,r)=>e&&!t(r,e));if(Array.isArray(a)&&a.length===0&&Array.isArray(o)&&o.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes(f(i))&&!t(a,`@babel/plugin-syntax-typescript`)&&!t(o,`@babel/preset-typescript`)&&a.unshift([`@babel/plugin-syntax-typescript`,{isTSX:d(i)===`.tsx`}]);let p=await u(r,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:i,plugins:a.map(t=>Array.isArray(t)&&t.length>=2?[t[0],l(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],l(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!p?.code)throw Error(`Powerlines - Babel plugin failed to compile ${i}`);return{code:p.code,id:i}}});export{m as default};
|
|
@@ -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(`../../../deepkit/src/utilities.cjs`),r=require(`../../../plugin-babel/src/helpers/create-plugin.cjs`),i=require(`../../../plugin-babel/src/helpers/module-helpers.cjs`),a=require(`../../../deepkit/src/capnp.cjs`),o=require(`../../../deepkit/schemas/reflection2.cjs`),s=require(`../helpers/persistence.cjs`);let c=require(`@storm-software/config-tools/types`),l=require(`@stryke/capnp`);l=e.__toESM(l);let u=require(`@stryke/fs/buffer`),d=require(`node:fs`);const f=r.createBabelPlugin(`env`,({log:e,context:r})=>{function f(t,i,a=!1){let o=r.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(t.name){let s=r.config.env.prefix.find(e=>t.name&&t.name.startsWith(e)&&(r.env.types.env?.hasProperty(t.name.replace(`${e}_`,``))||o.some(n=>n.getAlias().includes(t.name.replace(`${e}_`,``))))),l=t.name;if(s&&(l=t.name.replace(`${s}_`,``)),e(c.LogLevelLabel.TRACE,`Environment variable ${l} found in ${i.filename||`unknown file`}.`),r.env.types.env?.hasProperty(l)||o.some(e=>e.getAlias().includes(l))){let e=r.env.types.env.hasProperty(l)?r.env.types.env.getProperty(l):o.find(e=>e.getAlias().includes(l));if(!e||e.isIgnored())return;if(r.env.used.env.hasProperty(l)||r.env.used.env.addProperty(e.property),r.config.env.inject&&a){let t=r.env.parsed?.[l];if(t===void 0){let e=r.config.env.prefix.find(e=>r.env.parsed[`${e.replace(/_$/g,``)}_${l}`]);e&&(t=r.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 n.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 ${i.filename?i.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${r.env.types.env?.getPropertyNames().sort((e,t)=>String(e).localeCompare(String(t))).map(e=>` - ${String(e)} ${o.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${o?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
|
|
4
|
+
`)} \n\nUsing the following env prefix: \n${r.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}`),i.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}`),i.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}`),i.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}`),i.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 n=t.type_exports.ReflectionClass.from({kind:t.type_exports.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),i=s.getEnvReflectionsPath(r,`env`);i&&(0,d.existsSync)(i)&&(e(c.LogLevelLabel.TRACE,`Environment reflection file found at ${i}, reading existing reflection.`),n=(0,t.type_exports.resolveClassType)((0,t.type_exports.deserializeType)(a.convertFromCapnp(new l.Message((0,u.readFileBufferSync)(i),!1).getRoot(o.SerializedTypes).types)))),e(c.LogLevelLabel.TRACE,`Adding new variables to env reflection at ${i}.`),n.getProperties().filter(e=>e.getNameAsString()&&!r.env.used.env.hasProperty(e.getNameAsString())).forEach(e=>{r.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{stringifyDefaultValue as t}from"../../../deepkit/src/utilities.mjs";import{createBabelPlugin as n}from"../../../plugin-babel/src/helpers/create-plugin.mjs";import{addImport as r}from"../../../plugin-babel/src/helpers/module-helpers.mjs";import{convertFromCapnp as i}from"../../../deepkit/src/capnp.mjs";import{SerializedTypes as a}from"../../../deepkit/schemas/reflection2.mjs";import{getEnvReflectionsPath as o}from"../helpers/persistence.mjs";import{LogLevelLabel as s}from"@storm-software/config-tools/types";import*as c from"@stryke/capnp";import{readFileBufferSync as l}from"@stryke/fs/buffer";import{existsSync as u}from"node:fs";const d=n(`env`,({log:n,context:d})=>{function f(e,r,i=!1){let a=d.env.types.env?.getProperties().filter(e=>e.getAlias().length>0);if(e.name){let o=d.config.env.prefix.find(t=>e.name&&e.name.startsWith(t)&&(d.env.types.env?.hasProperty(e.name.replace(`${t}_`,``))||a.some(n=>n.getAlias().includes(e.name.replace(`${t}_`,``))))),c=e.name;if(o&&(c=e.name.replace(`${o}_`,``)),n(s.TRACE,`Environment variable ${c} found in ${r.filename||`unknown file`}.`),d.env.types.env?.hasProperty(c)||a.some(e=>e.getAlias().includes(c))){let e=d.env.types.env.hasProperty(c)?d.env.types.env.getProperty(c):a.find(e=>e.getAlias().includes(c));if(!e||e.isIgnored())return;if(d.env.used.env.hasProperty(c)||d.env.used.env.addProperty(e.property),d.config.env.inject&&i){let n=d.env.parsed?.[c];if(n===void 0){let e=d.config.env.prefix.find(e=>d.env.parsed[`${e.replace(/_$/g,``)}_${c}`]);e&&(n=d.env.parsed[`${e.replace(/_$/g,``)}_${c}`])}if(n??=e.getDefaultValue(),e.isValueRequired()&&n===void 0)throw Error(`Environment variable \`${c}\` is not defined in the .env configuration files`);return t(e,n)}}else throw Error(`The "${c}" 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${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)} ${a.some(t=>t.getNameAsString()===String(e)&&t.getAlias().length>0)?`(Alias: ${a?.find(t=>t.getNameAsString()===String(e))?.getAlias().join(`, `)})`:``}`).join(`
|
|
4
4
|
`)} \n\nUsing the following env prefix: \n${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 n=e.get(`property`)?.node;f(n,t,!1),e.replaceWithSourceString(`env.${n.name}`),r(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(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(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(e,{module:`storm:env`,name:`env`,imported:`env`})}}},post(){n(s.TRACE,`Adding environment variables from ${this.filename||`unknown file`} to env.json.`);let t=e.ReflectionClass.from({kind:e.ReflectionKind.objectLiteral,description:`An object containing the environment variables used by the application.`,types:[]}),r=o(d,`env`);r&&u(r)&&(n(s.TRACE,`Environment reflection file found at ${r}, reading existing reflection.`),t=(0,e.resolveClassType)((0,e.deserializeType)(i(new c.Message(l(r),!1).getRoot(a).types)))),n(s.TRACE,`Adding new variables to env reflection at ${r}.`),t.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(`@
|
|
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`);require(`@alloy-js/markdown`);let r=require(`@powerlines/alloy/core/contexts/context`);require(`@powerlines/alloy/markdown/components/markdown-file`),require(`@powerlines/alloy/markdown/components/markdown-table`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../deepkit/src/vendor/type.mjs";import"../helpers/create-reflection-resource.mjs";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"@alloy-js/markdown";import{usePowerlines as a}from"@powerlines/alloy/core/contexts/context";import"@powerlines/alloy/markdown/components/markdown-file";import"@powerlines/alloy/markdown/components/markdown-table";export{};
|