@powerlines/plugin-alloy 0.15.7 → 0.15.9
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/{chunk-CLCJnD51.mjs → _virtual/rolldown_runtime.cjs} +3 -5
- package/dist/{chunk-BrXtsOCC.cjs → _virtual/rolldown_runtime.mjs} +8 -20
- package/dist/chunk-554SZY2F.cjs +12556 -0
- package/dist/chunk-J2T6KGQO.js +12397 -0
- package/dist/core/components/index.cjs +6 -9
- package/dist/core/components/index.d.cts +3 -6
- package/dist/core/components/index.d.mts +3 -6
- package/dist/core/components/index.mjs +3 -6
- package/dist/core/components/output.cjs +39 -4
- package/dist/core/components/output.d.cts +17 -2
- package/dist/core/components/output.d.mts +17 -2
- package/dist/core/components/output.mjs +37 -3
- package/dist/core/components/single-line-comment.cjs +21 -3
- package/dist/core/components/single-line-comment.d.cts +21 -3
- package/dist/core/components/single-line-comment.d.mts +21 -3
- package/dist/core/components/single-line-comment.mjs +19 -2
- package/dist/core/components/source-file.cjs +57 -3
- package/dist/core/components/source-file.d.cts +30 -3
- package/dist/core/components/source-file.d.mts +30 -3
- package/dist/core/components/source-file.mjs +54 -2
- package/dist/core/contexts/context.cjs +28 -5
- package/dist/core/contexts/context.d.cts +25 -2
- package/dist/core/contexts/context.d.mts +25 -2
- package/dist/core/contexts/context.mjs +24 -2
- package/dist/core/contexts/index.cjs +13 -15
- package/dist/core/contexts/index.d.cts +2 -5
- package/dist/core/contexts/index.d.mts +2 -6
- package/dist/core/contexts/index.mjs +2 -4
- package/dist/core/contexts/reflection.cjs +67 -10
- package/dist/core/contexts/reflection.d.cts +50 -3
- package/dist/core/contexts/reflection.d.mts +50 -4
- package/dist/core/contexts/reflection.mjs +58 -2
- package/dist/core/index.cjs +21 -22
- package/dist/core/index.d.cts +7 -9
- package/dist/core/index.d.mts +7 -10
- package/dist/core/index.mjs +7 -8
- package/dist/deepkit/src/utilities.cjs +112 -0
- package/dist/deepkit/src/utilities.mjs +108 -0
- package/dist/helpers/capnp.cjs +274 -18
- package/dist/helpers/capnp.d.cts +85 -2
- package/dist/helpers/capnp.d.mts +85 -3
- package/dist/helpers/capnp.mjs +255 -1
- package/dist/helpers/create-builtin.cjs +18 -2
- package/dist/helpers/create-builtin.d.cts +14 -1
- package/dist/helpers/create-builtin.d.mts +14 -1
- package/dist/helpers/create-builtin.mjs +16 -1
- package/dist/helpers/index.cjs +23 -24
- package/dist/helpers/index.d.cts +4 -5
- package/dist/helpers/index.d.mts +4 -6
- package/dist/helpers/index.mjs +4 -5
- package/dist/helpers/refkey.cjs +15 -3
- package/dist/helpers/refkey.d.cts +12 -1
- package/dist/helpers/refkey.d.mts +12 -1
- package/dist/helpers/refkey.mjs +13 -2
- package/dist/helpers/typescript.cjs +45 -2
- package/dist/helpers/typescript.d.cts +22 -1
- package/dist/helpers/typescript.d.mts +22 -2
- package/dist/helpers/typescript.mjs +43 -1
- package/dist/index.cjs +32 -275
- package/dist/index.d.cts +2 -3
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -0
- package/dist/index.mjs +30 -27
- package/dist/jsx-runtime.cjs +35 -0
- package/dist/jsx-runtime.d.cts +1 -0
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.js +5 -0
- package/dist/markdown/components/index.cjs +7 -13
- package/dist/markdown/components/index.d.cts +2 -7
- package/dist/markdown/components/index.d.mts +2 -7
- package/dist/markdown/components/index.mjs +2 -8
- package/dist/markdown/components/markdown-file.cjs +117 -7
- package/dist/markdown/components/markdown-file.d.cts +22 -4
- package/dist/markdown/components/markdown-file.d.mts +22 -4
- package/dist/markdown/components/markdown-file.mjs +114 -5
- package/dist/markdown/components/markdown-table.cjs +100 -6
- package/dist/markdown/components/markdown-table.d.cts +26 -4
- package/dist/markdown/components/markdown-table.d.mts +26 -4
- package/dist/markdown/components/markdown-table.mjs +96 -3
- package/dist/markdown/contexts/index.cjs +5 -7
- package/dist/markdown/contexts/index.d.cts +1 -2
- package/dist/markdown/contexts/index.d.mts +1 -2
- package/dist/markdown/contexts/index.mjs +1 -3
- package/dist/markdown/contexts/markdown-table.cjs +36 -6
- package/dist/markdown/contexts/markdown-table.d.cts +36 -1
- package/dist/markdown/contexts/markdown-table.d.mts +36 -1
- package/dist/markdown/contexts/markdown-table.mjs +31 -2
- package/dist/markdown/index.cjs +14 -18
- package/dist/markdown/index.d.cts +5 -8
- package/dist/markdown/index.d.mts +5 -8
- package/dist/markdown/index.mjs +5 -9
- package/dist/powerlines/src/lib/utilities/file-header.cjs +13 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +12 -0
- package/dist/powerlines/src/types/babel.d.mts +2 -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 +369 -0
- package/dist/powerlines/src/types/config.d.mts +369 -0
- package/dist/powerlines/src/types/context.d.cts +362 -0
- package/dist/powerlines/src/types/context.d.mts +364 -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 +81 -0
- package/dist/powerlines/src/types/resolved.d.mts +81 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/components.cjs +0 -1
- package/dist/types/components.d.cts +141 -2
- package/dist/types/components.d.mts +141 -2
- package/dist/types/components.mjs +0 -2
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/index.mjs +0 -3
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +40 -2
- package/dist/types/plugin.d.mts +40 -2
- package/dist/types/plugin.mjs +0 -2
- package/dist/typescript/components/builtin-file.cjs +43 -8
- package/dist/typescript/components/builtin-file.d.cts +33 -6
- package/dist/typescript/components/builtin-file.d.mts +33 -6
- package/dist/typescript/components/builtin-file.mjs +41 -7
- package/dist/typescript/components/dynamic-import-statement.cjs +24 -3
- package/dist/typescript/components/dynamic-import-statement.d.cts +31 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +31 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +22 -2
- package/dist/typescript/components/entry-file.cjs +38 -7
- package/dist/typescript/components/entry-file.d.cts +26 -5
- package/dist/typescript/components/entry-file.d.mts +26 -5
- package/dist/typescript/components/entry-file.mjs +35 -6
- package/dist/typescript/components/index.cjs +43 -49
- package/dist/typescript/components/index.d.cts +9 -13
- package/dist/typescript/components/index.d.mts +9 -14
- package/dist/typescript/components/index.mjs +9 -15
- package/dist/typescript/components/record-expression.cjs +11 -3
- package/dist/typescript/components/record-expression.d.cts +11 -1
- package/dist/typescript/components/record-expression.d.mts +11 -1
- package/dist/typescript/components/record-expression.mjs +9 -2
- package/dist/typescript/components/tsdoc-reflection.cjs +172 -8
- package/dist/typescript/components/tsdoc-reflection.d.cts +17 -4
- package/dist/typescript/components/tsdoc-reflection.d.mts +17 -4
- package/dist/typescript/components/tsdoc-reflection.mjs +168 -5
- package/dist/typescript/components/tsdoc.cjs +475 -23
- package/dist/typescript/components/tsdoc.d.cts +151 -3
- package/dist/typescript/components/tsdoc.d.mts +151 -3
- package/dist/typescript/components/tsdoc.mjs +454 -3
- package/dist/typescript/components/typescript-file.cjs +192 -8
- package/dist/typescript/components/typescript-file.d.cts +46 -4
- package/dist/typescript/components/typescript-file.d.mts +46 -4
- package/dist/typescript/components/typescript-file.mjs +188 -5
- package/dist/typescript/components/typescript-interface.cjs +67 -8
- package/dist/typescript/components/typescript-interface.d.cts +23 -3
- package/dist/typescript/components/typescript-interface.d.mts +23 -4
- package/dist/typescript/components/typescript-interface.mjs +64 -6
- package/dist/typescript/components/typescript-object.cjs +124 -8
- package/dist/typescript/components/typescript-object.d.cts +24 -3
- package/dist/typescript/components/typescript-object.d.mts +24 -4
- package/dist/typescript/components/typescript-object.mjs +121 -6
- package/dist/typescript/index.cjs +44 -49
- package/dist/typescript/index.d.cts +10 -13
- package/dist/typescript/index.d.mts +10 -14
- package/dist/typescript/index.mjs +10 -15
- package/dist/vendor/index.cjs +20 -0
- package/dist/vendor/index.mjs +11 -0
- package/package.json +39 -8
- package/dist/builtin-file-BTFY397y.d.mts +0 -34
- package/dist/builtin-file-Cc9EahS_.mjs +0 -42
- package/dist/builtin-file-Cx2gYmvj.cjs +0 -47
- package/dist/builtin-file-DZ0j7GQ3.d.cts +0 -34
- package/dist/capnp-Bej06Vo6.mjs +0 -259
- package/dist/capnp-CirEkAHB.d.cts +0 -86
- package/dist/capnp-kgq1Wxjw.d.mts +0 -87
- package/dist/capnp-uHWANTSk.cjs +0 -356
- package/dist/components-BK5Ml-fB.mjs +0 -1
- package/dist/components-BYyc8-6U.cjs +0 -0
- package/dist/components-C9Lp4xr5.mjs +0 -1
- package/dist/components-CNE_Nde0.mjs +0 -1
- package/dist/components-Cvpo9IEL.cjs +0 -0
- package/dist/components-DSpDVIf0.d.cts +0 -142
- package/dist/components-Gg416Czx.cjs +0 -0
- package/dist/components-ZbItRNLr.cjs +0 -0
- package/dist/components-cffsgxGP.d.mts +0 -142
- package/dist/components-pztyf7qk.mjs +0 -1
- package/dist/context-B6PdDHc7.d.cts +0 -26
- package/dist/context-BDpEChDc.cjs +0 -43
- package/dist/context-BRIdBgyT.d.mts +0 -1680
- package/dist/context-CWt70HA3.d.cts +0 -1680
- package/dist/context-uyV_b5LD.mjs +0 -26
- package/dist/context-wYPSb88-.d.mts +0 -26
- package/dist/contexts-CWIkvja3.mjs +0 -1
- package/dist/contexts-Do5bLA7f.cjs +0 -0
- package/dist/contexts-DzdhIC7G.cjs +0 -0
- package/dist/contexts-oubuaPo0.mjs +0 -1
- package/dist/create-builtin-Be3J_vqf.mjs +0 -18
- package/dist/create-builtin-BhPGJIAV.d.mts +0 -15
- package/dist/create-builtin-Bok_ENQo.d.cts +0 -15
- package/dist/create-builtin-eQVsnSGQ.cjs +0 -24
- package/dist/dynamic-import-statement-CKVyBkh0.cjs +0 -29
- package/dist/dynamic-import-statement-CQUyuOvA.mjs +0 -23
- package/dist/dynamic-import-statement-DcFHKm1U.d.mts +0 -32
- package/dist/dynamic-import-statement-Dv-agvo9.d.cts +0 -32
- package/dist/entry-file-BZUmlDWP.d.cts +0 -27
- package/dist/entry-file-CJVwkVNJ.mjs +0 -36
- package/dist/entry-file-Cw1Nykfb.cjs +0 -44
- package/dist/entry-file-Dvn4sgIC.d.mts +0 -27
- package/dist/index-Blaks7l8.d.cts +0 -1
- package/dist/index-BwFl_eS0.d.mts +0 -1
- package/dist/index-CCKHlTA4.d.mts +0 -1
- package/dist/index-CwSIy_W-.d.cts +0 -1
- package/dist/index-D13oYj4_.d.mts +0 -1
- package/dist/index-DBGd4WeR.d.mts +0 -1
- package/dist/index-DdxxIAKU.d.cts +0 -1
- package/dist/index-DrZ2Dh-H.d.cts +0 -1
- package/dist/index-gpCH5158.d.mts +0 -1
- package/dist/index-lQ_hGQ08.d.cts +0 -1
- package/dist/jsx-runtime-CUeGxIAS.mjs +0 -6617
- package/dist/jsx-runtime-DYxEHXau.cjs +0 -7511
- package/dist/markdown-file-BMWEBCyl.cjs +0 -127
- package/dist/markdown-file-Cfrqc-hN.mjs +0 -115
- package/dist/markdown-file-DUSLyCXK.d.cts +0 -23
- package/dist/markdown-file-nmspmOXL.d.mts +0 -23
- package/dist/markdown-table-BH93E_KU.d.cts +0 -27
- package/dist/markdown-table-BOFmeE2m.d.mts +0 -27
- package/dist/markdown-table-CBzXYSUb.cjs +0 -56
- package/dist/markdown-table-CqyI4NbJ.d.cts +0 -37
- package/dist/markdown-table-D7tYGUEd.mjs +0 -97
- package/dist/markdown-table-DB3e0UqW.d.mts +0 -37
- package/dist/markdown-table-DCJGVRji.mjs +0 -33
- package/dist/markdown-table-DJnMnLrC.cjs +0 -116
- package/dist/output-BwrSWhh_.cjs +0 -45
- package/dist/output-C5E9Yg_M.d.mts +0 -18
- package/dist/output-CwItdY-C.mjs +0 -38
- package/dist/output-dEdF2_eK.d.cts +0 -18
- package/dist/plugin-CB4x_Q7V.d.mts +0 -40
- package/dist/plugin-CihR7e46.d.cts +0 -40
- package/dist/plugin-CofWgH_d.cjs +0 -0
- package/dist/plugin-DYr7uFlI.mjs +0 -1
- package/dist/record-expression-AF7Vq6a_.d.cts +0 -12
- package/dist/record-expression-B3Ey9GU1.d.mts +0 -12
- package/dist/record-expression-BAmHoqT_.mjs +0 -11
- package/dist/record-expression-Dib5JNnw.cjs +0 -16
- package/dist/refkey-1S6o7FvP.cjs +0 -20
- package/dist/refkey-Bde1cIzZ.d.cts +0 -13
- package/dist/refkey-JNhwrUqU.d.mts +0 -13
- package/dist/refkey-MvGS-pyo.mjs +0 -15
- package/dist/reflection-50U0xo4F.d.mts +0 -52
- package/dist/reflection-CEg9I3Z-.cjs +0 -107
- package/dist/reflection-DdUbSUpz.d.cts +0 -51
- package/dist/reflection-rAKwnBc8.mjs +0 -60
- package/dist/single-line-comment-BlsLcI_G.d.cts +0 -22
- package/dist/single-line-comment-CwrahJhq.d.mts +0 -22
- package/dist/single-line-comment-LR74JZLa.mjs +0 -20
- package/dist/single-line-comment-LhhrQO3v.cjs +0 -25
- package/dist/source-file-B3nELUUN.cjs +0 -62
- package/dist/source-file-BhgOu1Wr.d.mts +0 -31
- package/dist/source-file-CusamdN4.d.cts +0 -31
- package/dist/source-file-CxzTxqAg.mjs +0 -55
- package/dist/tsdoc-97Dh6htZ.cjs +0 -575
- package/dist/tsdoc-BMyugfPn.d.mts +0 -152
- package/dist/tsdoc-D2BVcBJd.mjs +0 -455
- package/dist/tsdoc-DWIcbd8M.d.cts +0 -152
- package/dist/tsdoc-reflection-B66tRNu1.d.cts +0 -18
- package/dist/tsdoc-reflection-BTAFEc-s.cjs +0 -188
- package/dist/tsdoc-reflection-CBEWiA-g.d.mts +0 -18
- package/dist/tsdoc-reflection-DOgVWcNP.mjs +0 -169
- package/dist/type-f5ttv0My.d.mts +0 -3
- package/dist/typescript-BXhP0qIJ.mjs +0 -45
- package/dist/typescript-BwiYpbhk.cjs +0 -51
- package/dist/typescript-DNBFhP72.d.mts +0 -25
- package/dist/typescript-YczHz9BQ.d.cts +0 -23
- package/dist/typescript-file-BMGxgxo7.cjs +0 -207
- package/dist/typescript-file-BqxyTQ52.d.cts +0 -47
- package/dist/typescript-file-CAT-CIk2.mjs +0 -189
- package/dist/typescript-file-CxDEGozE.d.mts +0 -47
- package/dist/typescript-interface-BGdhcY-U.d.cts +0 -24
- package/dist/typescript-interface-CTw2F_uD.d.mts +0 -25
- package/dist/typescript-interface-CqST5f2X.cjs +0 -79
- package/dist/typescript-interface-WZX7BAi8.mjs +0 -66
- package/dist/typescript-object-65Ei0RFv.d.cts +0 -25
- package/dist/typescript-object-C8Wd0Uhv.d.mts +0 -26
- package/dist/typescript-object-D1y6Cvnl.mjs +0 -122
- package/dist/typescript-object-KhCP_Nc8.cjs +0 -135
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import { printer } from "prettier/doc.js";
|
|
1
|
+
import { Output } from "./core/components/output.mjs";
|
|
2
|
+
import { vendor_exports } from "./vendor/index.mjs";
|
|
3
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
5
4
|
import alloy from "@alloy-js/rollup-plugin";
|
|
6
5
|
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
7
6
|
import { StormJSON } from "@stryke/json/storm-json";
|
|
8
7
|
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
9
8
|
import { replacePath } from "@stryke/path/replace";
|
|
10
9
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
10
|
+
import { printer } from "prettier/doc.js";
|
|
11
11
|
|
|
12
12
|
//#region src/index.tsx
|
|
13
13
|
/**
|
|
@@ -29,27 +29,30 @@ const plugin = (options = {}) => {
|
|
|
29
29
|
inputOptions: { transform: { jsx: {
|
|
30
30
|
runtime: "classic",
|
|
31
31
|
pragma: "Alloy.createElement",
|
|
32
|
-
importSource: "@alloy
|
|
32
|
+
importSource: "@powerlines/plugin-alloy/vendor"
|
|
33
33
|
} } },
|
|
34
34
|
plugins: [alloy()]
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
},
|
|
38
38
|
async configResolved() {
|
|
39
|
-
if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@alloy
|
|
39
|
+
if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@powerlines/plugin-alloy/vendor") {
|
|
40
40
|
this.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
41
41
|
if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
|
|
42
|
-
if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy
|
|
42
|
+
if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@powerlines/plugin-alloy/vendor") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@powerlines/plugin-alloy/vendor";
|
|
43
43
|
await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
|
|
44
44
|
}
|
|
45
|
-
this.dependencies["@alloy-js/core"] = "^0.22.0";
|
|
46
45
|
if (this.config.alloy?.typescript !== false) this.dependencies["@alloy-js/typescript"] = "^0.22.0";
|
|
47
46
|
if (this.config.alloy?.json === true) this.dependencies["@alloy-js/json"] = "^0.22.0";
|
|
48
47
|
if (this.config.alloy?.markdown === true) this.dependencies["@alloy-js/markdown"] = "^0.22.0";
|
|
49
48
|
},
|
|
50
49
|
resolveId(id) {
|
|
51
50
|
if (id === "@alloy-js/core") return {
|
|
52
|
-
id: "@powerlines/plugin-alloy",
|
|
51
|
+
id: "@powerlines/plugin-alloy/vendor",
|
|
52
|
+
external: true
|
|
53
|
+
};
|
|
54
|
+
if (id === "@alloy-js/core/jsx-runtime") return {
|
|
55
|
+
id: "@powerlines/plugin-alloy/vendor/jsx-runtime",
|
|
53
56
|
external: true
|
|
54
57
|
};
|
|
55
58
|
return null;
|
|
@@ -59,14 +62,14 @@ const plugin = (options = {}) => {
|
|
|
59
62
|
configResolved: {
|
|
60
63
|
order: "pre",
|
|
61
64
|
async handler() {
|
|
62
|
-
this.render = async (children
|
|
65
|
+
this.render = async (children) => {
|
|
63
66
|
const _self$ = this;
|
|
64
|
-
const tree = renderTree(createComponent(Output
|
|
67
|
+
const tree = (0, vendor_exports.renderTree)(createComponent(Output, {
|
|
65
68
|
context: _self$,
|
|
66
69
|
get basePath() {
|
|
67
70
|
return _self$.workspaceConfig.workspaceRoot;
|
|
68
71
|
},
|
|
69
|
-
children
|
|
72
|
+
children
|
|
70
73
|
}));
|
|
71
74
|
await writeTree(this, tree, this.config.alloy);
|
|
72
75
|
};
|
|
@@ -82,14 +85,14 @@ var src_default = plugin;
|
|
|
82
85
|
* @param tree - The rendered output files.
|
|
83
86
|
*/
|
|
84
87
|
async function writeTree(context, tree, options = {}) {
|
|
85
|
-
await flushJobsAsync();
|
|
88
|
+
await (0, vendor_exports.flushJobsAsync)();
|
|
86
89
|
let result;
|
|
87
|
-
const generateOutput = async (currentDirectory, root
|
|
88
|
-
if (!Array.isArray(root
|
|
90
|
+
const generateOutput = async (currentDirectory, root) => {
|
|
91
|
+
if (!Array.isArray(root)) return;
|
|
89
92
|
const recurse = async (cwd) => {
|
|
90
|
-
for (const child of root
|
|
93
|
+
for (const child of root) await generateOutput(cwd, child);
|
|
91
94
|
};
|
|
92
|
-
const renderContext = getContextForRenderNode(root
|
|
95
|
+
const renderContext = (0, vendor_exports.getContextForRenderNode)(root);
|
|
93
96
|
if (!renderContext) return recurse(currentDirectory);
|
|
94
97
|
if (renderContext.meta?.directory) {
|
|
95
98
|
const directory = {
|
|
@@ -112,7 +115,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
112
115
|
path: replacePath(renderContext.meta.sourceFile.path, context.builtinsPath),
|
|
113
116
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
114
117
|
preset: renderContext.meta.output?.mode,
|
|
115
|
-
contents: await printTree
|
|
118
|
+
contents: await printTree(context, root, options)
|
|
116
119
|
};
|
|
117
120
|
} else if (renderContext.meta?.entry || isParentPath(context.entryPath, renderContext.meta.sourceFile.path)) {
|
|
118
121
|
context.log(LogLevelLabel.TRACE, `Rendering entry module at path: ${renderContext.meta.sourceFile.path}`);
|
|
@@ -122,7 +125,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
122
125
|
path: renderContext.meta.sourceFile.path,
|
|
123
126
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
124
127
|
preset: renderContext.meta.output?.mode,
|
|
125
|
-
contents: await printTree
|
|
128
|
+
contents: await printTree(context, root, options)
|
|
126
129
|
};
|
|
127
130
|
} else {
|
|
128
131
|
context.log(LogLevelLabel.TRACE, `Rendering source file at path: ${renderContext.meta.sourceFile.path}`);
|
|
@@ -131,7 +134,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
131
134
|
path: renderContext.meta.sourceFile.path,
|
|
132
135
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
133
136
|
preset: renderContext.meta.output?.mode,
|
|
134
|
-
contents: await printTree
|
|
137
|
+
contents: await printTree(context, root, options)
|
|
135
138
|
};
|
|
136
139
|
}
|
|
137
140
|
currentDirectory.contents.push(outputFile);
|
|
@@ -149,8 +152,8 @@ async function writeTree(context, tree, options = {}) {
|
|
|
149
152
|
} else await recurse(currentDirectory);
|
|
150
153
|
};
|
|
151
154
|
await generateOutput(void 0, tree);
|
|
152
|
-
const writeOutput
|
|
153
|
-
for (const sub of output.contents) if (sub.kind === "directory") await writeOutput
|
|
155
|
+
const writeOutput = async (context$1, output) => {
|
|
156
|
+
for (const sub of output.contents) if (sub.kind === "directory") await writeOutput(context$1, sub);
|
|
154
157
|
else if (sub.kind === "builtin") await context$1.emitBuiltin(sub.contents, sub.id, sub.path);
|
|
155
158
|
else if (sub.kind === "entry") await context$1.emitEntry(sub.contents, sub.path, sub.typeDefinition);
|
|
156
159
|
else if (sub.kind === "file") if ("sourcePath" in sub && sub.sourcePath) {
|
|
@@ -161,14 +164,14 @@ async function writeTree(context, tree, options = {}) {
|
|
|
161
164
|
} else if ("contents" in sub && isSetString(sub.contents)) await context$1.fs.write(sub.path, sub.contents);
|
|
162
165
|
else throw new Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(sub, null, 2)}`);
|
|
163
166
|
};
|
|
164
|
-
await writeOutput
|
|
167
|
+
await writeOutput(context, result);
|
|
165
168
|
}
|
|
166
|
-
async function printTree
|
|
169
|
+
async function printTree(context, tree, options = {}) {
|
|
167
170
|
options.printWidth ??= 160;
|
|
168
171
|
options.tabWidth ??= 2;
|
|
169
172
|
options.useTabs ??= false;
|
|
170
173
|
options.insertFinalNewLine ??= true;
|
|
171
|
-
await flushJobsAsync();
|
|
174
|
+
await (0, vendor_exports.flushJobsAsync)();
|
|
172
175
|
const result = printer.printDocToString(printTreeWorker(tree), options).formatted;
|
|
173
176
|
return options.insertFinalNewLine && !result.endsWith("\n") ? `${result}\n` : result;
|
|
174
177
|
}
|
|
@@ -177,10 +180,10 @@ function printTreeWorker(tree) {
|
|
|
177
180
|
for (const node of tree) if (typeof node === "string") {
|
|
178
181
|
const normalizedNode = node.split(/\r?\n/).flatMap((line, index, array) => index < array.length - 1 ? [line] : [line]);
|
|
179
182
|
doc.push(normalizedNode);
|
|
180
|
-
} else if (isPrintHook(node)) doc.push(node.print(node.subtree, printTreeWorker));
|
|
183
|
+
} else if ((0, vendor_exports.isPrintHook)(node)) doc.push(node.print(node.subtree, printTreeWorker));
|
|
181
184
|
else doc.push(printTreeWorker(node));
|
|
182
185
|
return doc;
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
//#endregion
|
|
186
|
-
export {
|
|
189
|
+
export { src_default as default, plugin };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk554SZY2F_cjs = require('./chunk-554SZY2F.cjs');
|
|
4
|
+
|
|
5
|
+
// src/vendor/jsx-runtime.ts
|
|
6
|
+
chunk554SZY2F_cjs.init_cjs_shims();
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "JSX", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk554SZY2F_cjs.JSX; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "createComponent", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunk554SZY2F_cjs.createComponent; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "createIntrinsic", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunk554SZY2F_cjs.createIntrinsic; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "jsx", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunk554SZY2F_cjs.jsx; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "jsxs", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunk554SZY2F_cjs.jsxs; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "memo", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunk554SZY2F_cjs.memo; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "mergeProps", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return chunk554SZY2F_cjs.mergeProps; }
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@alloy-js/core/jsx-runtime';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@alloy-js/core/jsx-runtime';
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
require('
|
|
2
|
-
require('
|
|
3
|
-
require('../../single-line-comment-LhhrQO3v.cjs');
|
|
4
|
-
require('../../source-file-B3nELUUN.cjs');
|
|
5
|
-
const require_markdown_file = require('../../markdown-file-BMWEBCyl.cjs');
|
|
6
|
-
require('../../markdown-table-CBzXYSUb.cjs');
|
|
7
|
-
const require_markdown_table$1 = require('../../markdown-table-DJnMnLrC.cjs');
|
|
8
|
-
require('../../components-Gg416Czx.cjs');
|
|
1
|
+
const require_markdown_components_markdown_file = require('./markdown-file.cjs');
|
|
2
|
+
const require_markdown_components_markdown_table = require('./markdown-table.cjs');
|
|
9
3
|
|
|
10
|
-
exports.MarkdownFile =
|
|
11
|
-
exports.MarkdownFileHeader =
|
|
12
|
-
exports.MarkdownTable =
|
|
13
|
-
exports.MarkdownTableColumn =
|
|
14
|
-
exports.MarkdownTableColumnHeader =
|
|
4
|
+
exports.MarkdownFile = require_markdown_components_markdown_file.MarkdownFile;
|
|
5
|
+
exports.MarkdownFileHeader = require_markdown_components_markdown_file.MarkdownFileHeader;
|
|
6
|
+
exports.MarkdownTable = require_markdown_components_markdown_table.MarkdownTable;
|
|
7
|
+
exports.MarkdownTableColumn = require_markdown_components_markdown_table.MarkdownTableColumn;
|
|
8
|
+
exports.MarkdownTableColumnHeader = require_markdown_components_markdown_table.MarkdownTableColumnHeader;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import "../../source-file-CusamdN4.cjs";
|
|
4
|
-
import { i as __ΩMarkdownFileProps, n as MarkdownFileHeader, r as MarkdownFileProps, t as MarkdownFile } from "../../markdown-file-DUSLyCXK.cjs";
|
|
5
|
-
import "../../markdown-table-CqyI4NbJ.cjs";
|
|
6
|
-
import { a as MarkdownTableProps, i as MarkdownTableColumnProps, n as MarkdownTableColumn, o as __ΩMarkdownTableColumnProps, r as MarkdownTableColumnHeader, s as __ΩMarkdownTableProps, t as MarkdownTable } from "../../markdown-table-BH93E_KU.cjs";
|
|
7
|
-
import "../../index-lQ_hGQ08.cjs";
|
|
1
|
+
import { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps } from "./markdown-file.cjs";
|
|
2
|
+
import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./markdown-table.cjs";
|
|
8
3
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import "../../source-file-BhgOu1Wr.mjs";
|
|
4
|
-
import { i as __ΩMarkdownFileProps, n as MarkdownFileHeader, r as MarkdownFileProps, t as MarkdownFile } from "../../markdown-file-nmspmOXL.mjs";
|
|
5
|
-
import "../../markdown-table-DB3e0UqW.mjs";
|
|
6
|
-
import { a as MarkdownTableProps, i as MarkdownTableColumnProps, n as MarkdownTableColumn, o as __ΩMarkdownTableColumnProps, r as MarkdownTableColumnHeader, s as __ΩMarkdownTableProps, t as MarkdownTable } from "../../markdown-table-BOFmeE2m.mjs";
|
|
7
|
-
import "../../index-BwFl_eS0.mjs";
|
|
1
|
+
import { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps } from "./markdown-file.mjs";
|
|
2
|
+
import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./markdown-table.mjs";
|
|
8
3
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import "../../single-line-comment-LR74JZLa.mjs";
|
|
4
|
-
import "../../source-file-CxzTxqAg.mjs";
|
|
5
|
-
import { n as MarkdownFileHeader, t as MarkdownFile } from "../../markdown-file-Cfrqc-hN.mjs";
|
|
6
|
-
import "../../markdown-table-DCJGVRji.mjs";
|
|
7
|
-
import { n as MarkdownTableColumn, r as MarkdownTableColumnHeader, t as MarkdownTable } from "../../markdown-table-D7tYGUEd.mjs";
|
|
8
|
-
import "../../components-BK5Ml-fB.mjs";
|
|
1
|
+
import { MarkdownFile, MarkdownFileHeader } from "./markdown-file.mjs";
|
|
2
|
+
import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader } from "./markdown-table.mjs";
|
|
9
3
|
|
|
10
4
|
export { MarkdownFile, MarkdownFileHeader, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader };
|
|
@@ -1,8 +1,118 @@
|
|
|
1
|
-
require('../../
|
|
2
|
-
require('../../context
|
|
3
|
-
require('../../single-line-comment
|
|
4
|
-
require('../../source-file
|
|
5
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
3
|
+
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
4
|
+
const require_core_components_source_file = require('../../core/components/source-file.cjs');
|
|
5
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
+
let __powerlines_plugin_alloy_vendor = require("@powerlines/plugin-alloy/vendor");
|
|
7
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
8
|
+
let __alloy_js_markdown = require("@alloy-js/markdown");
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
//#region src/markdown/components/markdown-file.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
13
|
+
*
|
|
14
|
+
* @param props - The properties for the source file.
|
|
15
|
+
* @returns The rendered source file component.
|
|
16
|
+
*/
|
|
17
|
+
function MarkdownFile(props) {
|
|
18
|
+
const [{ children, preset }, rest] = (0, __powerlines_plugin_alloy_vendor.splitProps)(props, ["children", "preset"]);
|
|
19
|
+
const nodeContext = (0, __powerlines_plugin_alloy_vendor.getContext)();
|
|
20
|
+
nodeContext.meta ??= {};
|
|
21
|
+
nodeContext.meta.output = { preset };
|
|
22
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, __alloy_js_core_jsx_runtime.mergeProps)({ get header() {
|
|
23
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(MarkdownFileHeader, {});
|
|
24
|
+
} }, rest, {
|
|
25
|
+
filetype: "md",
|
|
26
|
+
reference: __alloy_js_markdown.Link,
|
|
27
|
+
get children() {
|
|
28
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_vendor.Show, {
|
|
29
|
+
get when() {
|
|
30
|
+
return Boolean(children);
|
|
31
|
+
},
|
|
32
|
+
children
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
39
|
+
*
|
|
40
|
+
* @param props - The properties for the source file header.
|
|
41
|
+
* @returns The rendered source file header.
|
|
42
|
+
*/
|
|
43
|
+
function MarkdownFileHeader(props) {
|
|
44
|
+
const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = (0, __powerlines_plugin_alloy_vendor.splitProps)(props, [
|
|
45
|
+
"children",
|
|
46
|
+
"disableEslint",
|
|
47
|
+
"disableBiome",
|
|
48
|
+
"disablePrettier"
|
|
49
|
+
]);
|
|
50
|
+
const context = require_core_contexts_context.usePowerlines();
|
|
51
|
+
return [
|
|
52
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_vendor.Show, {
|
|
53
|
+
get when() {
|
|
54
|
+
return Boolean(disableEslint);
|
|
55
|
+
},
|
|
56
|
+
get children() {
|
|
57
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
58
|
+
variant: "markdown",
|
|
59
|
+
children: "eslint-disable"
|
|
60
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_vendor.Show, {
|
|
64
|
+
get when() {
|
|
65
|
+
return Boolean(disablePrettier);
|
|
66
|
+
},
|
|
67
|
+
get children() {
|
|
68
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
69
|
+
variant: "markdown",
|
|
70
|
+
children: "prettier-ignore"
|
|
71
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_vendor.Show, {
|
|
75
|
+
get when() {
|
|
76
|
+
return Boolean(disableBiome);
|
|
77
|
+
},
|
|
78
|
+
get children() {
|
|
79
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
80
|
+
variant: "markdown",
|
|
81
|
+
children: "biome-ignore lint: disable"
|
|
82
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
83
|
+
}
|
|
84
|
+
}),
|
|
85
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_vendor.Show, {
|
|
86
|
+
get when() {
|
|
87
|
+
return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
|
|
88
|
+
},
|
|
89
|
+
get children() {
|
|
90
|
+
return (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_vendor.Show, {
|
|
94
|
+
get when() {
|
|
95
|
+
return Boolean(children);
|
|
96
|
+
},
|
|
97
|
+
get children() {
|
|
98
|
+
return [children, (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
102
|
+
variant: "markdown",
|
|
103
|
+
get children() {
|
|
104
|
+
return __powerlines_plugin_alloy_vendor.code`Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config.framework) || "Powerlines"}`;
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
108
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
109
|
+
variant: "markdown",
|
|
110
|
+
children: __powerlines_plugin_alloy_vendor.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
|
|
111
|
+
}),
|
|
112
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
exports.MarkdownFile = MarkdownFile;
|
|
118
|
+
exports.MarkdownFileHeader = MarkdownFileHeader;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../components-
|
|
3
|
-
import "
|
|
4
|
-
|
|
1
|
+
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.cjs";
|
|
2
|
+
import { SourceFileProps } from "../../core/components/source-file.cjs";
|
|
3
|
+
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/markdown-file.d.ts
|
|
6
|
+
type MarkdownFileProps = Omit<SourceFileProps, "filetype"> & ComponentProps;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The properties for the source file.
|
|
11
|
+
* @returns The rendered source file component.
|
|
12
|
+
*/
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core2.Children;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The properties for the source file header.
|
|
18
|
+
* @returns The rendered source file header.
|
|
19
|
+
*/
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core2.Children;
|
|
21
|
+
declare type __ΩMarkdownFileProps = any[];
|
|
22
|
+
//#endregion
|
|
5
23
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps };
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../components-
|
|
3
|
-
import "
|
|
4
|
-
|
|
1
|
+
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.mjs";
|
|
2
|
+
import { SourceFileProps } from "../../core/components/source-file.mjs";
|
|
3
|
+
import * as _alloy_js_core4 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/markdown-file.d.ts
|
|
6
|
+
type MarkdownFileProps = Omit<SourceFileProps, "filetype"> & ComponentProps;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The properties for the source file.
|
|
11
|
+
* @returns The rendered source file component.
|
|
12
|
+
*/
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core4.Children;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The properties for the source file header.
|
|
18
|
+
* @returns The rendered source file header.
|
|
19
|
+
*/
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core4.Children;
|
|
21
|
+
declare type __ΩMarkdownFileProps = any[];
|
|
22
|
+
//#endregion
|
|
5
23
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps };
|
|
@@ -1,7 +1,116 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
1
|
+
import { usePowerlines } from "../../core/contexts/context.mjs";
|
|
2
|
+
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
|
+
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
|
+
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
|
+
import { Show, code, getContext, splitProps } from "@powerlines/plugin-alloy/vendor";
|
|
6
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
7
|
+
import { Link } from "@alloy-js/markdown";
|
|
6
8
|
|
|
9
|
+
//#region src/markdown/components/markdown-file.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
function MarkdownFile(props) {
|
|
17
|
+
const [{ children, preset }, rest] = splitProps(props, ["children", "preset"]);
|
|
18
|
+
const nodeContext = getContext();
|
|
19
|
+
nodeContext.meta ??= {};
|
|
20
|
+
nodeContext.meta.output = { preset };
|
|
21
|
+
return createComponent(SourceFile, mergeProps({ get header() {
|
|
22
|
+
return createComponent(MarkdownFileHeader, {});
|
|
23
|
+
} }, rest, {
|
|
24
|
+
filetype: "md",
|
|
25
|
+
reference: Link,
|
|
26
|
+
get children() {
|
|
27
|
+
return createComponent(Show, {
|
|
28
|
+
get when() {
|
|
29
|
+
return Boolean(children);
|
|
30
|
+
},
|
|
31
|
+
children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
38
|
+
*
|
|
39
|
+
* @param props - The properties for the source file header.
|
|
40
|
+
* @returns The rendered source file header.
|
|
41
|
+
*/
|
|
42
|
+
function MarkdownFileHeader(props) {
|
|
43
|
+
const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = splitProps(props, [
|
|
44
|
+
"children",
|
|
45
|
+
"disableEslint",
|
|
46
|
+
"disableBiome",
|
|
47
|
+
"disablePrettier"
|
|
48
|
+
]);
|
|
49
|
+
const context = usePowerlines();
|
|
50
|
+
return [
|
|
51
|
+
createComponent(Show, {
|
|
52
|
+
get when() {
|
|
53
|
+
return Boolean(disableEslint);
|
|
54
|
+
},
|
|
55
|
+
get children() {
|
|
56
|
+
return [createComponent(SingleLineComment, {
|
|
57
|
+
variant: "markdown",
|
|
58
|
+
children: "eslint-disable"
|
|
59
|
+
}), createIntrinsic("hbr", {})];
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
createComponent(Show, {
|
|
63
|
+
get when() {
|
|
64
|
+
return Boolean(disablePrettier);
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
return [createComponent(SingleLineComment, {
|
|
68
|
+
variant: "markdown",
|
|
69
|
+
children: "prettier-ignore"
|
|
70
|
+
}), createIntrinsic("hbr", {})];
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
createComponent(Show, {
|
|
74
|
+
get when() {
|
|
75
|
+
return Boolean(disableBiome);
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
return [createComponent(SingleLineComment, {
|
|
79
|
+
variant: "markdown",
|
|
80
|
+
children: "biome-ignore lint: disable"
|
|
81
|
+
}), createIntrinsic("hbr", {})];
|
|
82
|
+
}
|
|
83
|
+
}),
|
|
84
|
+
createComponent(Show, {
|
|
85
|
+
get when() {
|
|
86
|
+
return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
|
|
87
|
+
},
|
|
88
|
+
get children() {
|
|
89
|
+
return createIntrinsic("hbr", {});
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
createComponent(Show, {
|
|
93
|
+
get when() {
|
|
94
|
+
return Boolean(children);
|
|
95
|
+
},
|
|
96
|
+
get children() {
|
|
97
|
+
return [children, createIntrinsic("hbr", {})];
|
|
98
|
+
}
|
|
99
|
+
}),
|
|
100
|
+
createComponent(SingleLineComment, {
|
|
101
|
+
variant: "markdown",
|
|
102
|
+
get children() {
|
|
103
|
+
return code`Generated by ${titleCase(context?.config.framework) || "Powerlines"}`;
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
createIntrinsic("hbr", {}),
|
|
107
|
+
createComponent(SingleLineComment, {
|
|
108
|
+
variant: "markdown",
|
|
109
|
+
children: code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
|
|
110
|
+
}),
|
|
111
|
+
createIntrinsic("hbr", {})
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
//#endregion
|
|
7
116
|
export { MarkdownFile, MarkdownFileHeader };
|