@powerlines/plugin-react 0.1.110 → 0.1.111
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/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/{chunk-CF6LXmkI.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +1 -2
- package/dist/components/index.d.mts +1 -2
- package/dist/components/index.mjs +1 -1
- package/dist/components/react-optimized.cjs +1 -1
- package/dist/components/react-optimized.d.cts +13 -1
- package/dist/components/react-optimized.d.mts +13 -1
- package/dist/components/react-optimized.mjs +1 -1
- package/dist/deepkit/schemas/reflection.cjs +1 -0
- package/dist/{plugin-qpXdqfDo.d.mts → deepkit/schemas/reflection.d.cts} +1 -331
- package/dist/{plugin-CP9_29iU.d.cts → deepkit/schemas/reflection.d.mts} +1 -333
- package/dist/deepkit/schemas/reflection.mjs +1 -0
- package/dist/deepkit/schemas/reflection2.cjs +1 -0
- package/dist/deepkit/schemas/reflection2.mjs +1 -0
- package/dist/deepkit/src/capnp.cjs +1 -0
- package/dist/deepkit/src/capnp.mjs +1 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +4 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +4 -0
- package/dist/deepkit/src/reflect-type.cjs +1 -0
- package/dist/deepkit/src/reflect-type.mjs +1 -0
- package/dist/deepkit/src/resolve-reflections.cjs +1 -0
- package/dist/deepkit/src/resolve-reflections.mjs +1 -0
- package/dist/deepkit/src/transformer.cjs +1 -0
- package/dist/deepkit/src/transformer.mjs +1 -0
- package/dist/deepkit/src/transpile.cjs +1 -0
- package/dist/deepkit/src/transpile.mjs +1 -0
- package/dist/deepkit/src/types.d.cts +10 -0
- package/dist/deepkit/src/types.d.mts +10 -0
- package/dist/deepkit/src/utilities.cjs +1 -0
- package/dist/deepkit/src/utilities.mjs +1 -0
- package/dist/deepkit/src/vendor/core.cjs +1 -0
- package/dist/deepkit/src/vendor/core.mjs +1 -0
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +1 -0
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +1 -0
- package/dist/deepkit/src/vendor/type.cjs +1 -0
- package/dist/deepkit/src/vendor/type.d.cts +7 -0
- package/dist/deepkit/src/vendor/type.d.mts +7 -0
- package/dist/deepkit/src/vendor/type.mjs +1 -0
- package/dist/index.cjs +1 -64
- package/dist/index.d.cts +5 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +1 -61
- 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/components.d.mts +5 -0
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/types/plugin.d.cts +38 -0
- package/dist/plugin-alloy/src/types/plugin.d.mts +38 -0
- 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 -0
- package/dist/plugin-automd/src/index.mjs +1 -0
- package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
- package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
- package/dist/plugin-automd/src/types/toc.d.cts +33 -0
- package/dist/plugin-automd/src/types/toc.d.mts +33 -0
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +1 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +1 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +1 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +1 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +1 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +1 -0
- package/dist/plugin-babel/src/helpers/index.cjs +1 -0
- package/dist/plugin-babel/src/helpers/index.mjs +1 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +1 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +1 -0
- package/dist/plugin-babel/src/helpers/options.cjs +1 -0
- package/dist/plugin-babel/src/helpers/options.mjs +1 -0
- package/dist/plugin-babel/src/index.cjs +1 -0
- package/dist/plugin-babel/src/index.mjs +1 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
- package/dist/plugin-env/src/babel/index.cjs +1 -0
- package/dist/plugin-env/src/babel/index.mjs +1 -0
- package/dist/plugin-env/src/babel/plugin.cjs +5 -0
- package/dist/plugin-env/src/babel/plugin.mjs +5 -0
- package/dist/plugin-env/src/components/docs.cjs +1 -0
- package/dist/plugin-env/src/components/docs.mjs +1 -0
- package/dist/plugin-env/src/components/env.cjs +34 -0
- package/dist/plugin-env/src/components/env.mjs +31 -0
- package/dist/plugin-env/src/components/index.cjs +1 -0
- package/dist/plugin-env/src/components/index.mjs +1 -0
- package/dist/plugin-env/src/helpers/automd-generator.cjs +1 -0
- package/dist/plugin-env/src/helpers/automd-generator.mjs +1 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +1 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +1 -0
- package/dist/plugin-env/src/helpers/index.cjs +1 -0
- package/dist/plugin-env/src/helpers/index.mjs +1 -0
- package/dist/plugin-env/src/helpers/load.cjs +1 -0
- package/dist/plugin-env/src/helpers/load.mjs +1 -0
- package/dist/plugin-env/src/helpers/persistence.cjs +1 -0
- package/dist/plugin-env/src/helpers/persistence.mjs +1 -0
- package/dist/plugin-env/src/helpers/reflect.cjs +1 -0
- package/dist/plugin-env/src/helpers/reflect.mjs +1 -0
- package/dist/plugin-env/src/helpers/source-file-env.cjs +1 -0
- package/dist/plugin-env/src/helpers/source-file-env.mjs +1 -0
- package/dist/plugin-env/src/helpers/template-helpers.cjs +1 -0
- package/dist/plugin-env/src/helpers/template-helpers.mjs +1 -0
- package/dist/plugin-env/src/index.cjs +10 -0
- package/dist/plugin-env/src/index.mjs +10 -0
- package/dist/plugin-env/src/types/plugin.d.cts +151 -0
- package/dist/plugin-env/src/types/plugin.d.mts +153 -0
- package/dist/plugin-env/src/types/runtime.d.cts +792 -0
- package/dist/plugin-env/src/types/runtime.d.mts +792 -0
- package/dist/powerlines/src/lib/build/esbuild.cjs +14 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +14 -0
- package/dist/powerlines/src/lib/entry.cjs +1 -0
- package/dist/powerlines/src/lib/entry.mjs +1 -0
- package/dist/powerlines/src/lib/logger.cjs +1 -0
- package/dist/powerlines/src/lib/logger.mjs +1 -0
- package/dist/powerlines/src/lib/typescript/tsconfig.cjs +1 -0
- package/dist/powerlines/src/lib/typescript/tsconfig.mjs +1 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +1 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +1 -0
- package/dist/powerlines/src/lib/utilities/file-header.cjs +1 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +1 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +1 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +1 -0
- package/dist/powerlines/src/types/babel.d.cts +22 -0
- package/dist/powerlines/src/types/babel.d.mts +22 -0
- package/dist/powerlines/src/types/build.d.cts +145 -0
- package/dist/powerlines/src/types/build.d.mts +145 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.d.cts +368 -0
- package/dist/powerlines/src/types/config.d.mts +369 -0
- package/dist/powerlines/src/types/context.d.cts +373 -0
- package/dist/powerlines/src/types/context.d.mts +375 -0
- package/dist/powerlines/src/types/fs.d.cts +458 -0
- package/dist/powerlines/src/types/fs.d.mts +458 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/plugin.d.cts +231 -0
- package/dist/powerlines/src/types/plugin.d.mts +231 -0
- package/dist/powerlines/src/types/resolved.d.cts +82 -0
- package/dist/powerlines/src/types/resolved.d.mts +82 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +2 -4
- package/dist/types/index.d.mts +2 -4
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +72 -2
- package/dist/types/plugin.d.mts +72 -2
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/runtime.cjs +0 -1
- package/dist/types/runtime.d.cts +14 -2
- package/dist/types/runtime.d.mts +14 -2
- package/dist/types/runtime.mjs +1 -1
- package/package.json +6 -9
- package/dist/components-BWLXb7a2.cjs +0 -0
- package/dist/components-MTvNCZDU.mjs +0 -1
- package/dist/index-C-svZlpj.d.mts +0 -1
- package/dist/index-CtCMUyZA.d.cts +0 -1
- package/dist/index-DEHBdV_z.d.mts +0 -1
- package/dist/index-_wQ5ClJU.d.cts +0 -1
- package/dist/plugin-G4qbpIjB.mjs +0 -1
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/react-optimized-AthekqzJ.cjs +0 -1
- package/dist/react-optimized-DPBN2hOh.mjs +0 -1
- package/dist/react-optimized-DmMl-ZEI.d.cts +0 -14
- package/dist/react-optimized-Y1x3FeDm.d.mts +0 -14
- package/dist/runtime-BNQjyQ7l.d.cts +0 -2495
- package/dist/runtime-Bp9G0scd.cjs +0 -0
- package/dist/runtime-CKObV75t.d.cts +0 -15
- package/dist/runtime-Do9xjHUb.d.mts +0 -2496
- package/dist/runtime-IEYS5R9b.d.mts +0 -15
- package/dist/runtime-cDYyRPa0.mjs +0 -1
- package/dist/types-C5ggNT4K.mjs +0 -1
- package/dist/types-a8gm_IaQ.cjs +0 -0
|
@@ -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/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@stryke/path/replace`);function a(e){let[{children:a,context:o,basePath:s},c]=(0,r.splitProps)(e,[`children`,`context`,`basePath`]),l=(0,r.ref)(o),u=(0,r.computed)(()=>s?(0,i.replacePath)(s,l.value.workspaceConfig.workspaceRoot):l.value.workspaceConfig.workspaceRoot);return(0,n.createComponent)(r.Output,(0,n.mergeProps)(c,{get basePath(){return u.value},get children(){return(0,n.createComponent)(t.PowerlinesContext.Provider,{value:{ref:l},get children(){return(0,n.createComponent)(r.Show,{get when(){return!!l.value},children:a})}})}}))}exports.Output=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PowerlinesContext as e}from"../contexts/context.mjs";import{createComponent as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Output as r,Show as i,computed as a,ref as o,splitProps as s}from"@alloy-js/core";import{replacePath as c}from"@stryke/path/replace";function l(l){let[{children:u,context:d,basePath:f},p]=s(l,[`children`,`context`,`basePath`]),m=o(d),h=a(()=>f?c(f,m.value.workspaceConfig.workspaceRoot):m.value.workspaceConfig.workspaceRoot);return t(r,n(p,{get basePath(){return h.value},get children(){return t(e.Provider,{value:{ref:m},get children(){return t(i,{get when(){return!!m.value},children:u})}})}}))}export{l as Output};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import"@alloy-js/core";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`defu`);n=e.__toESM(n);let r=require(`@alloy-js/core`),i=require(`@stryke/path/append`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import n from"defu";import{Show as r,splitProps as i}from"@alloy-js/core";import{appendPath as a}from"@stryke/path/append";export{};
|
|
@@ -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/string-format/title-case`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/helpers/get-unique`),a=require(`@stryke/type-checks/is-null`),o=require(`@stryke/type-checks/is-undefined`);require(`@stryke/capnp/compile`),require(`@stryke/capnp/helpers`);let s=require(`@stryke/convert/to-array`);require(`@stryke/json`);let c=require(`@stryke/path/join`),l=require(`@stryke/string-format/camel-case`);require(`@stryke/string-format/get-words`),require(`@stryke/string-format/pascal-case`),require(`@stryke/type-checks/is-bigint`),require(`@stryke/type-checks/is-number`);let u=require(`node:child_process`),d=require(`node:util`);const f=1024*1e6,p=(0,d.promisify)(u.exec);
|
|
@@ -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{titleCase as t}from"@stryke/string-format/title-case";import{isString as n}from"@stryke/type-checks/is-string";import{getUniqueBy as r}from"@stryke/helpers/get-unique";import{isNull as i}from"@stryke/type-checks/is-null";import{isUndefined as a}from"@stryke/type-checks/is-undefined";import"@stryke/capnp/compile";import"@stryke/capnp/helpers";import{toArray as o}from"@stryke/convert/to-array";import"@stryke/json";import{joinPaths as s}from"@stryke/path/join";import{camelCase as c}from"@stryke/string-format/camel-case";import"@stryke/string-format/get-words";import"@stryke/string-format/pascal-case";import"@stryke/type-checks/is-bigint";import"@stryke/type-checks/is-number";import{exec as l}from"node:child_process";import{promisify as u}from"node:util";u(l);export{};
|
|
@@ -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/string-format/title-case`),t=require(`@stryke/type-checks/is-undefined`),n=require(`@stryke/string-format/camel-case`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../deepkit/src/utilities.mjs";import{titleCase as e}from"@stryke/string-format/title-case";import{isUndefined as t}from"@stryke/type-checks/is-undefined";import{camelCase as n}from"@stryke/string-format/camel-case";export{};
|
|
@@ -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/jsx-runtime`),i=require(`@storm-software/config-tools/types`),a=require(`@stryke/path/is-parent-path`),o=require(`@stryke/type-checks/is-set-string`),s=require(`@alloy-js/core`),c=require(`@alloy-js/rollup-plugin`);c=e.__toESM(c);let l=require(`@stryke/json/storm-json`),u=require(`@stryke/path/replace`),d=require(`prettier/doc.js`);const f=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[(0,c.default)()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,l.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let t=this,i=(0,s.renderTree)((0,r.createComponent)(n.Output,{context:t,get basePath(){return t.workspaceConfig.workspaceRoot},children:e}));await m(this,i,this.config.alloy)}}}}];var p=f;async function m(e,t,n={}){await(0,s.flushJobsAsync)();let r,c=async(t,o)=>{if(!Array.isArray(o))return;let l=async e=>{for(let t of o)await c(e,t)},d=(0,s.getContextForRenderNode)(o);if(!d)return l(t);if(d.meta?.directory){let e={kind:`directory`,path:d.meta.directory.path,contents:[]};t?t.contents.push(e):r=e,await l(e)}else if(d.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let r;if(d.meta?.builtin){if(!d.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(i.LogLevelLabel.TRACE,`Rendering built-in runtime module with ID: ${d.meta.builtin.id}`),r={kind:`builtin`,id:d.meta.builtin.id,path:(0,u.replacePath)(d.meta.sourceFile.path,e.builtinsPath),filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,n)}}else d.meta?.entry||(0,a.isParentPath)(e.entryPath,d.meta.sourceFile.path)?(e.log(i.LogLevelLabel.TRACE,`Rendering entry module at path: ${d.meta.sourceFile.path}`),r={kind:`entry`,typeDefinition:d.meta.entry?.typeDefinition,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,n)}):(e.log(i.LogLevelLabel.TRACE,`Rendering source file at path: ${d.meta.sourceFile.path}`),r={kind:`file`,path:d.meta.sourceFile.path,filetype:d.meta.sourceFile.filetype,preset:d.meta.output?.mode,contents:await h(e,o,n)});t.contents.push(r)}else if(d.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(i.LogLevelLabel.TRACE,`Processing copy file operation from "${d.meta.copyFile.sourcePath}" to "${d.meta.copyFile.path}"`),!d.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!d.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:d.meta.copyFile.path,sourcePath:d.meta.copyFile.sourcePath,preset:d.meta.output?.preset})}else await l(t)};await c(void 0,t);let l=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await l(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path,n.typeDefinition);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!(0,o.isSetString)(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&(0,o.isSetString)(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await l(e,r)}async function h(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await(0,s.flushJobsAsync)();let r=d.printer.printDocToString(g(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
|
|
2
|
+
`)?`${r}\n`:r}function g(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else (0,s.isPrintHook)(n)?t.push(n.print(n.subtree,g)):t.push(g(n));return t}exports.default=p;
|
|
@@ -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{createComponent as n}from"@alloy-js/core/jsx-runtime";import{LogLevelLabel as r}from"@storm-software/config-tools/types";import{isParentPath as i}from"@stryke/path/is-parent-path";import{isSetString as a}from"@stryke/type-checks/is-set-string";import{flushJobsAsync as o,getContextForRenderNode as s,isPrintHook as c,renderTree as l}from"@alloy-js/core";import u from"@alloy-js/rollup-plugin";import{StormJSON as d}from"@stryke/json/storm-json";import{replacePath as f}from"@stryke/path/replace";import{printer as p}from"prettier/doc.js";var m=(e={})=>[{name:`alloy:config`,config(){return{alloy:{typescript:!0,...e},build:{inputOptions:{transform:{jsx:{runtime:`classic`,pragma:`Alloy.createElement`,importSource:`@alloy-js/core`}}},plugins:[u()]}}},async configResolved(){(this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`||this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource!==`@alloy-js/core`)&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`),this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource!==`@alloy-js/core`&&(this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource=`@alloy-js/core`),await this.fs.write(this.tsconfig.tsconfigFilePath,d.stringify(this.tsconfig.tsconfigJson))),this.dependencies[`@alloy-js/core`]=`^0.22.0`,this.config.alloy?.typescript!==!1&&(this.dependencies[`@alloy-js/typescript`]=`^0.22.0`),this.config.alloy?.json===!0&&(this.dependencies[`@alloy-js/json`]=`^0.22.0`),this.config.alloy?.markdown===!0&&(this.dependencies[`@alloy-js/markdown`]=`^0.22.0`)}},{name:`alloy:update-context`,configResolved:{order:`pre`,async handler(){this.render=async e=>{let r=this,i=l(n(t,{context:r,get basePath(){return r.workspaceConfig.workspaceRoot},children:e}));await h(this,i,this.config.alloy)}}}}];async function h(e,t,n={}){await o();let c,l=async(t,a)=>{if(!Array.isArray(a))return;let o=async e=>{for(let t of a)await l(e,t)},u=s(a);if(!u)return o(t);if(u.meta?.directory){let e={kind:`directory`,path:u.meta.directory.path,contents:[]};t?t.contents.push(e):c=e,await o(e)}else if(u.meta?.sourceFile){if(!t)throw Error(`Source file doesn't have parent directory. Make sure you have used the Output component.`);let o;if(u.meta?.builtin){if(!u.meta.builtin.id)throw Error("Built-in runtime module doesn't have an ID. Make sure you have used the `<BuiltinFile />` component.");e.log(r.TRACE,`Rendering built-in runtime module with ID: ${u.meta.builtin.id}`),o={kind:`builtin`,id:u.meta.builtin.id,path:f(u.meta.sourceFile.path,e.builtinsPath),filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await g(e,a,n)}}else u.meta?.entry||i(e.entryPath,u.meta.sourceFile.path)?(e.log(r.TRACE,`Rendering entry module at path: ${u.meta.sourceFile.path}`),o={kind:`entry`,typeDefinition:u.meta.entry?.typeDefinition,path:u.meta.sourceFile.path,filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await g(e,a,n)}):(e.log(r.TRACE,`Rendering source file at path: ${u.meta.sourceFile.path}`),o={kind:`file`,path:u.meta.sourceFile.path,filetype:u.meta.sourceFile.filetype,preset:u.meta.output?.mode,contents:await g(e,a,n)});t.contents.push(o)}else if(u.meta?.copyFile){if(!t)throw Error(`Copy file doesn't have parent directory. Make sure you have used the Output component.`);if(e.log(r.TRACE,`Processing copy file operation from "${u.meta.copyFile.sourcePath}" to "${u.meta.copyFile.path}"`),!u.meta.copyFile.sourcePath)throw Error("Copy file doesn't have a source path. Make sure you have provided a `sourcePath` property to the `meta.copyFile` context.");if(!u.meta.copyFile.path)throw Error("Copy file doesn't have a destination path. Make sure you have provided a `path` property to the `meta.copyFile` context.");t.contents.push({kind:`file`,path:u.meta.copyFile.path,sourcePath:u.meta.copyFile.sourcePath,preset:u.meta.output?.preset})}else await o(t)};await l(void 0,t);let u=async(e,t)=>{for(let n of t.contents)if(n.kind===`directory`)await u(e,n);else if(n.kind===`builtin`)await e.emitBuiltin(n.contents,n.id,n.path);else if(n.kind===`entry`)await e.emitEntry(n.contents,n.path,n.typeDefinition);else if(n.kind===`file`)if(`sourcePath`in n&&n.sourcePath){if(!e.fs.existsSync(n.sourcePath))throw Error(`Source file "${n.sourcePath}" for copy operation does not exist.`);let t=await e.fs.read(n.sourcePath);if(!a(t))throw Error(`Source file "${n.sourcePath}" for copy operation is empty.`);await e.fs.write(n.path,t)}else if(`contents`in n&&a(n.contents))await e.fs.write(n.path,n.contents);else throw Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(n,null,2)}`)};await u(e,c)}async function g(e,t,n={}){n.printWidth??=160,n.tabWidth??=2,n.useTabs??=!1,n.insertFinalNewLine??=!0,await o();let r=p.printDocToString(_(t),n).formatted;return n.insertFinalNewLine&&!r.endsWith(`
|
|
2
|
+
`)?`${r}\n`:r}function _(e){let t=[];for(let n of e)if(typeof n==`string`){let e=n.split(/\r?\n/).flatMap((e,t,n)=>(n.length-1,[e]));t.push(e)}else c(n)?t.push(n.print(n.subtree,_)):t.push(_(n));return t}export{m as default};
|
|
@@ -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/jsx-runtime`),t=require(`@stryke/string-format/title-case`),n=require(`@alloy-js/core`);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{createComponent as e,createIntrinsic as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{titleCase as r}from"@stryke/string-format/title-case";import{Show as i,code as a,splitProps as o}from"@alloy-js/core";import"@alloy-js/markdown";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../contexts/markdown-table.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/string-format/title-case`),n=require(`@alloy-js/core`),r=require(`@stryke/type-checks/is-undefined`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../contexts/markdown-table.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{titleCase as n}from"@stryke/string-format/title-case";import{Show as r,code as i,computed as a,splitProps as o}from"@alloy-js/core";import{isUndefined as s}from"@stryke/type-checks/is-undefined";export{};
|
|
@@ -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{};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
2
|
+
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
3
|
+
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
4
|
+
import { PrintTreeOptions } from "@alloy-js/core";
|
|
5
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
8
|
+
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
9
|
+
/**
|
|
10
|
+
* If true, the Alloy framework is used to generate Typescript output files.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue true
|
|
13
|
+
*/
|
|
14
|
+
typescript?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If true, the Alloy framework is used to generate JSON output files.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue false
|
|
19
|
+
*/
|
|
20
|
+
json?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If true, the Alloy framework is used to generate Markdown output files.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue false
|
|
25
|
+
*/
|
|
26
|
+
markdown?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type AlloyPluginUserConfig = UserConfig & {
|
|
29
|
+
alloy?: AlloyPluginOptions;
|
|
30
|
+
};
|
|
31
|
+
type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
32
|
+
alloy: AlloyPluginOptions;
|
|
33
|
+
};
|
|
34
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
35
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
2
|
+
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
3
|
+
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
4
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
5
|
+
import { PrintTreeOptions } from "@alloy-js/core";
|
|
6
|
+
|
|
7
|
+
//#region ../plugin-alloy/src/types/plugin.d.ts
|
|
8
|
+
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
9
|
+
/**
|
|
10
|
+
* If true, the Alloy framework is used to generate Typescript output files.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue true
|
|
13
|
+
*/
|
|
14
|
+
typescript?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If true, the Alloy framework is used to generate JSON output files.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue false
|
|
19
|
+
*/
|
|
20
|
+
json?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If true, the Alloy framework is used to generate Markdown output files.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue false
|
|
25
|
+
*/
|
|
26
|
+
markdown?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type AlloyPluginUserConfig = UserConfig & {
|
|
29
|
+
alloy?: AlloyPluginOptions;
|
|
30
|
+
};
|
|
31
|
+
type AlloyPluginResolvedConfig = ResolvedConfig & {
|
|
32
|
+
alloy: AlloyPluginOptions;
|
|
33
|
+
};
|
|
34
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
35
|
+
render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./tsdoc.cjs`),require(`./typescript-file.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./tsdoc.mjs";import"./typescript-file.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{splitProps as n}from"@alloy-js/core";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`),n=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{code as n}from"@alloy-js/core";import{VarDeclaration as r}from"@alloy-js/typescript";export{};
|
|
@@ -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/jsx-runtime`),n=require(`defu`);n=e.__toESM(n);let r=require(`@alloy-js/core`),i=require(`@stryke/path/join-paths`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/context.mjs";import"./typescript-file.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import n from"defu";import{computed as r,splitProps as i}from"@alloy-js/core";import{joinPaths as a}from"@stryke/path/join-paths";export{};
|
|
@@ -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/jsx-runtime`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/string-format/title-case`),r=require(`@stryke/type-checks/is-string`),i=require(`@alloy-js/core`),a=require(`@stryke/type-checks/is-undefined`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/reflection.mjs";import"./tsdoc.mjs";import{createComponent as e,memo as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{isSetString as r}from"@stryke/type-checks/is-set-string";import{titleCase as i}from"@stryke/string-format/title-case";import{isString as a}from"@stryke/type-checks/is-string";import{Show as o,code as s,computed as c,splitProps as l}from"@alloy-js/core";import{isUndefined as u}from"@stryke/type-checks/is-undefined";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../core/contexts/context.cjs`),require(`../../../../deepkit/src/utilities.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/type-checks/is-set-string`),n=require(`@alloy-js/core`),r=require(`@stryke/type-checks/is-undefined`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/context.mjs";import"../../../../deepkit/src/utilities.mjs";import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{isSetString as i}from"@stryke/type-checks/is-set-string";import{For as a,Show as o,splitProps as s}from"@alloy-js/core";import{isUndefined as c}from"@stryke/type-checks/is-undefined";export{};
|
|
@@ -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/jsx-runtime`),t=require(`@stryke/string-format/title-case`),n=require(`@stryke/type-checks/is-string`),r=require(`@alloy-js/core`),i=require(`@stryke/path/append`),a=require(`@alloy-js/typescript`);require(`@stryke/type-checks/is-boolean`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/context.mjs";import"../../core/components/single-line-comment.mjs";import"../../core/components/source-file.mjs";import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{titleCase as i}from"@stryke/string-format/title-case";import{isString as a}from"@stryke/type-checks/is-string";import{Show as o,code as s,splitProps as c}from"@alloy-js/core";import{appendPath as l}from"@stryke/path/append";import"@alloy-js/typescript";import"@stryke/type-checks/is-boolean";export{};
|
|
@@ -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/jsx-runtime`),t=require(`@stryke/type-checks/is-string`),n=require(`@alloy-js/core`);require(`@stryke/string-format/pascal-case`);let r=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../deepkit/src/vendor/type.mjs";import"../../core/contexts/reflection.mjs";import"./tsdoc-reflection.mjs";import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{isString as n}from"@stryke/type-checks/is-string";import{For as r,computed as i,splitProps as a}from"@alloy-js/core";import"@stryke/string-format/pascal-case";import"@alloy-js/typescript";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../core/contexts/reflection.cjs`),require(`../../../../deepkit/src/utilities.cjs`),require(`./tsdoc-reflection.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@stryke/type-checks/is-string`),n=require(`@alloy-js/core`),r=require(`@stryke/type-checks/is-undefined`),i=require(`@stryke/string-format/camel-case`);require(`@stryke/string-format/pascal-case`);let a=require(`@alloy-js/typescript`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../core/contexts/reflection.mjs";import"../../../../deepkit/src/utilities.mjs";import"./tsdoc-reflection.mjs";import{createComponent as e,createIntrinsic as t,memo as n}from"@alloy-js/core/jsx-runtime";import{isString as r}from"@stryke/type-checks/is-string";import{For as i,Show as a,computed as o,splitProps as s}from"@alloy-js/core";import{isUndefined as c}from"@stryke/type-checks/is-undefined";import{camelCase as l}from"@stryke/string-format/camel-case";import"@stryke/string-format/pascal-case";import"@alloy-js/typescript";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./components/index.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./components/index.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`@stryke/path/replace`),r=require(`@stryke/path/append`),i=require(`@stryke/convert/to-array`),a=require(`@stryke/path/join-paths`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`),c=require(`@stryke/path/is-type`),l=require(`automd`),u=require(`c12`),d=require(`markdown-toc`);d=e.__toESM(d);const f=(e={})=>({name:`automd`,async config(){let n=await(0,l.loadConfig)((0,a.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),e);return(!n.prefix||!Array.isArray(n.prefix))&&(n.prefix=(0,i.toArray)(n.prefix??[])),n.prefix.includes(`automd`)||n.prefix.push(`automd`),n.prefix.includes(`powerlines`)||n.prefix.push(`powerlines`),{automd:(0,t.default)(n??{},{configFile:e.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!(0,i.toArray)(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=(0,i.toArray)(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:e}=await(0,u.loadConfig)({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=(0,l.resolveConfig)((0,t.default)(this.config.automd,{...e,prefix:(0,i.toArray)(e.prefix??[])}))}this.config.automd.input=(await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>e.includes(`*`)?(0,s.listFiles)((0,c.isAbsolutePath)(e)?e:(0,r.appendPath)(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):(0,c.isAbsolutePath)(e)?e:(0,r.appendPath)(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!(0,c.isAbsolutePath)(this.config.automd.output)&&(this.config.automd.output=(0,r.appendPath)(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:(0,d.default)(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all((0,i.toArray)(this.config.automd.input).map(async e=>{let t=await this.fs.read(e);if(t){let i=await(0,l.transform)(t,this.config.automd);if(i.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);i.hasChanged&&await this.fs.write((0,r.appendPath)(this.config.automd.output?(0,o.isDirectory)(this.config.automd.output)?(0,n.replacePath)(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});var p=f;exports.default=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"defu";import{replacePath as t}from"@stryke/path/replace";import{appendPath as n}from"@stryke/path/append";import{toArray as r}from"@stryke/convert/to-array";import{joinPaths as i}from"@stryke/path/join-paths";import{isDirectory as a}from"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import{isAbsolutePath as s}from"@stryke/path/is-type";import{loadConfig as c,resolveConfig as l,transform as u}from"automd";import{loadConfig as d}from"c12";import f from"markdown-toc";var p=(p={})=>({name:`automd`,async config(){let t=await c(i(this.workspaceConfig.workspaceRoot,this.config.projectRoot),p);return(!t.prefix||!Array.isArray(t.prefix))&&(t.prefix=r(t.prefix??[])),t.prefix.includes(`automd`)||t.prefix.push(`automd`),t.prefix.includes(`powerlines`)||t.prefix.push(`powerlines`),{automd:e(t??{},{configFile:p.configFile,allowIssues:!0,dir:this.config.projectRoot,watch:!1,input:`README.md`,toc:{maxDepth:6,bullets:`-`}})}},async configResolved(){if(this.config.framework&&!r(this.config.automd.prefix).includes(this.config.framework)&&(this.config.automd.prefix=r(this.config.automd.prefix).concat(this.config.framework)),this.config.automd.configFile){let{config:t}=await d({cwd:this.config.automd.dir,configFile:this.config.automd.configFile,defaults:{ignore:[`**/node_modules`,`**/dist`,`**/.*`],dir:this.config.automd.dir}});this.config.automd=l(e(this.config.automd,{...t,prefix:r(t.prefix??[])}))}this.config.automd.input=(await Promise.all(r(this.config.automd.input).map(async e=>e.includes(`*`)?o(s(e)?e:n(e,this.config.projectRoot),{ignore:this.config.automd.ignore}):s(e)?e:n(e,this.config.projectRoot)))).flat(),this.config.automd.output&&!s(this.config.automd.output)&&(this.config.automd.output=n(this.config.automd.output,this.config.projectRoot)),this.config.automd.generators??={},this.config.automd.toc!==!1&&(this.config.automd.generators.toc??={name:`toc`,generate:e=>{let t=this.config.automd.toc??{};return{contents:f(e.block.md,{...t,maxdepth:t.maxDepth,first1:t.firstH1}).content}}})},async docs(){await Promise.all(r(this.config.automd.input).map(async e=>{let r=await this.fs.read(e);if(r){let i=await u(r,this.config.automd);if(i.hasIssues&&this.config.automd.allowIssues===!1)throw Error(`AutoMD found issues in file "${e}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);i.hasChanged&&await this.fs.write(n(this.config.automd.output?a(this.config.automd.output)?t(e,this.config.automd.output):this.config.automd.output:e,this.config.projectRoot),i.contents)}}))}});export{p as default};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TOCOptions } from "./toc.cjs";
|
|
2
|
+
import { Config } from "automd";
|
|
3
|
+
|
|
4
|
+
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
5
|
+
|
|
6
|
+
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Path to the AutoMD configuration file.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
12
|
+
*/
|
|
13
|
+
configFile?: string;
|
|
14
|
+
/**
|
|
15
|
+
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
allowIssues?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Alternate prefix strings to use for finding generators
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
27
|
+
*/
|
|
28
|
+
prefix?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* Table of Contents generator options
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
34
|
+
*/
|
|
35
|
+
toc?: false | TOCOptions;
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { AutoMDPluginOptions };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "../../../powerlines/src/types/config.mjs";
|
|
2
|
+
import "../../../powerlines/src/types/resolved.mjs";
|
|
3
|
+
import "../../../powerlines/src/types/context.mjs";
|
|
4
|
+
import { TOCOptions } from "./toc.mjs";
|
|
5
|
+
import { Config } from "automd";
|
|
6
|
+
|
|
7
|
+
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
8
|
+
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Path to the AutoMD configuration file.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
14
|
+
*/
|
|
15
|
+
configFile?: string;
|
|
16
|
+
/**
|
|
17
|
+
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue true
|
|
20
|
+
*/
|
|
21
|
+
allowIssues?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Alternate prefix strings to use for finding generators
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
29
|
+
*/
|
|
30
|
+
prefix?: string | string[];
|
|
31
|
+
/**
|
|
32
|
+
* Table of Contents generator options
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
36
|
+
*/
|
|
37
|
+
toc?: false | TOCOptions;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { AutoMDPluginOptions };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region ../plugin-automd/src/types/toc.d.ts
|
|
2
|
+
interface TOCOptions {
|
|
3
|
+
/**
|
|
4
|
+
* A slugify function to generate slugs for the headings.
|
|
5
|
+
*/
|
|
6
|
+
slugify?: (str: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* The maximum depth of headings to include in the TOC.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue 6
|
|
11
|
+
*/
|
|
12
|
+
maxDepth?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to include the first H1 heading in the TOC.
|
|
15
|
+
*/
|
|
16
|
+
firstH1?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The bullet character to use for list items in the TOC.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue "-"
|
|
21
|
+
*/
|
|
22
|
+
bullets?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A prefix to add to each heading in the TOC.
|
|
25
|
+
*/
|
|
26
|
+
prefix?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A filter function to determine which headings to include in the TOC.
|
|
29
|
+
*/
|
|
30
|
+
filter?: (str: string, level: number) => boolean;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TOCOptions };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region ../plugin-automd/src/types/toc.d.ts
|
|
2
|
+
interface TOCOptions {
|
|
3
|
+
/**
|
|
4
|
+
* A slugify function to generate slugs for the headings.
|
|
5
|
+
*/
|
|
6
|
+
slugify?: (str: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* The maximum depth of headings to include in the TOC.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue 6
|
|
11
|
+
*/
|
|
12
|
+
maxDepth?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to include the first H1 heading in the TOC.
|
|
15
|
+
*/
|
|
16
|
+
firstH1?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The bullet character to use for list items in the TOC.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue "-"
|
|
21
|
+
*/
|
|
22
|
+
bullets?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A prefix to add to each heading in the TOC.
|
|
25
|
+
*/
|
|
26
|
+
prefix?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A filter function to determine which headings to include in the TOC.
|
|
29
|
+
*/
|
|
30
|
+
filter?: (str: string, level: number) => boolean;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TOCOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@babel/generator`);t=e.__toESM(t),require(`@babel/parser`);let n=t.default;`default`in n&&(n=n.default);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/generator";import"@babel/parser";let t=e;`default`in t&&(t=t.default);export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`../../../powerlines/src/lib/logger.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`chalk`);r=e.__toESM(r);let i=require(`@babel/helper-plugin-utils`);function a(e,a){let o=o=>(0,i.declare)((i,s,c)=>{i.cache.using(()=>o.meta.checksum),i.assertVersion(`^7.0.0-0`);let l=t.extendLog(o.log,e);l(n.LogLevelLabel.TRACE,`Initializing the ${r.default.bold.cyanBright(e)} Babel plugin`);let u=a({log:l,name:e,api:i,options:s,context:o,dirname:c});return u.name=e,l(n.LogLevelLabel.TRACE,`Completed initialization of the ${r.default.bold.cyanBright(e)} Babel plugin`),u});return o.$$name=e,o}exports.createBabelPlugin=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendLog as e}from"../../../powerlines/src/lib/logger.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import n from"chalk";import{declare as r}from"@babel/helper-plugin-utils";function i(i,a){let o=o=>r((r,s,c)=>{r.cache.using(()=>o.meta.checksum),r.assertVersion(`^7.0.0-0`);let l=e(o.log,i);l(t.TRACE,`Initializing the ${n.bold.cyanBright(i)} Babel plugin`);let u=a({log:l,name:i,api:r,options:s,context:o,dirname:c});return u.name=i,l(t.TRACE,`Completed initialization of the ${n.bold.cyanBright(i)} Babel plugin`),u});return o.$$name=i,o}export{i as createBabelPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-function`);require(`@stryke/type-checks/is-object`);let n=require(`@stryke/type-checks/is-set-string`);function r(e){return(0,n.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isFunction as e}from"@stryke/type-checks/is-function";import"@stryke/type-checks/is-object";import{isSetString as t}from"@stryke/type-checks/is-set-string";function n(e){return t(e)?e:Array.isArray(e)&&e.length>0?n(e[0]):e.$$name||e.name?e.$$name||e.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./filters.cjs`),t=require(`./options.cjs`);require(`./ast-utils.cjs`);const n=require(`./create-plugin.cjs`),r=require(`./module-helpers.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getPluginName as e,isDuplicatePlugin as t}from"./filters.mjs";import{resolveBabelPlugin as n,resolvePluginFunction as r}from"./options.mjs";import"./ast-utils.mjs";import{createBabelPlugin as i}from"./create-plugin.mjs";import{addImport as a,addImportsToProgram as o}from"./module-helpers.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`),t=require(`./filters.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`@stryke/type-checks/is-function`),i=require(`chalk`);i=e.__toESM(i);function a(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?(0,r.isFunction)(t[0])?t[0](e):t[0]:(0,r.isFunction)(t)?t(e):t}catch{return t[0]}}function o(e,o,s,c){if(Array.isArray(c)&&c.length>0&&c[0]){if(c.length>2&&c[2]&&(0,r.isFunction)(c[2])&&!c[2](o,s)){e.log(n.LogLevelLabel.TRACE,`Skipping filtered Babel plugin ${i.default.bold.cyanBright(t.getPluginName(c)||`unnamed`)} for ${s}`);return}return c.length>2?[a(e,c),c[1],c[2]]:[a(e,c),c[1],null]}return[a(e,c),{},null]}exports.resolveBabelPlugin=o,exports.resolvePluginFunction=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getPluginName as e}from"./filters.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import{isFunction as n}from"@stryke/type-checks/is-function";import r from"chalk";function i(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?n(t[0])?t[0](e):t[0]:n(t)?t(e):t}catch{return t[0]}}function a(a,o,s,c){if(Array.isArray(c)&&c.length>0&&c[0]){if(c.length>2&&c[2]&&n(c[2])&&!c[2](o,s)){a.log(t.TRACE,`Skipping filtered Babel plugin ${r.bold.cyanBright(e(c)||`unnamed`)} for ${s}`);return}return c.length>2?[i(a,c),c[1],c[2]]:[i(a,c),c[1],null]}return[i(a,c),{},null]}export{a as resolveBabelPlugin,i as resolvePluginFunction};
|
|
@@ -0,0 +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(`@babel/core`),o=require(`@storm-software/config-tools/types`),s=require(`@stryke/path/file-path-fns`),c=require(`@stryke/path/is-parent-path`),l=require(`@stryke/type-checks/is-set-object`),u=require(`defu`);u=e.__toESM(u);const d=(e={})=>({name:`babel`,config(){if((0,l.isSetObject)(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=(0,u.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if((0,c.isParentPath)(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(o.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(o.LogLevelLabel.TRACE,`Babel transforming file: ${i}`);let l=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(l)&&l.length===0&&Array.isArray(d)&&d.length===0)return{code:r,id:i};[`ts`,`cts`,`mts`,`tsx`].includes((0,s.findFileExtensionSafe)(i))&&!t.isDuplicatePlugin(l,`@babel/plugin-syntax-typescript`)&&!t.isDuplicatePlugin(d,`@babel/preset-typescript`)&&l.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,s.findFileExtension)(i)===`.tsx`}]);let f=await(0,a.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:l.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,u.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,u.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;
|
|
@@ -0,0 +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{transformAsync as s}from"@babel/core";import{LogLevelLabel as c}from"@storm-software/config-tools/types";import{findFileExtension as l,findFileExtensionSafe as u}from"@stryke/path/file-path-fns";import{isParentPath as d}from"@stryke/path/is-parent-path";import{isSetObject as f}from"@stryke/type-checks/is-set-object";import p from"defu";var m=(e={})=>({name:`babel`,config(){if(f(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=p(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(r,i){if(d(i,this.powerlinesPath)||r.includes(`/* @storm-ignore */`)||r.includes(`/* @storm-disable */`))return this.log(c.TRACE,`Skipping Babel transformation for: ${i}`),{code:r,id:i};this.log(c.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(u(i))&&!t(a,`@babel/plugin-syntax-typescript`)&&!t(o,`@babel/preset-typescript`)&&a.unshift([`@babel/plugin-syntax-typescript`,{isTSX:l(i)===`.tsx`}]);let f=await s(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],p(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],p(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}}});export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "./plugin.mjs";
|