@powerlines/plugin-alloy 0.15.7 → 0.15.8
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/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 +25 -271
- package/dist/index.d.cts +2 -3
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +23 -23
- 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.cjs +20 -0
- package/dist/vendor.d.cts +1 -0
- package/dist/vendor.d.ts +1 -0
- package/dist/vendor.js +12420 -0
- package/dist/vendor.mjs +11 -0
- package/package.json +25 -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
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stringifyValue } from "../deepkit/src/utilities.mjs";
|
|
2
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
3
|
+
import { camelCase } from "@stryke/string-format/camel-case";
|
|
4
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
2
5
|
|
|
6
|
+
//#region src/helpers/typescript.ts
|
|
7
|
+
/**
|
|
8
|
+
* Generates a TypeScript object for the given reflection class.
|
|
9
|
+
*
|
|
10
|
+
* @param reflection - The reflection class to generate the object for.
|
|
11
|
+
* @param options - Options for generating the object.
|
|
12
|
+
* @returns A string containing the TypeScript object definition.
|
|
13
|
+
*/
|
|
14
|
+
function generateTypeScriptObject(reflection, options = {}) {
|
|
15
|
+
if (!reflection) return "";
|
|
16
|
+
return `
|
|
17
|
+
/**
|
|
18
|
+
* ${reflection.getDescription() || `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`}.
|
|
19
|
+
*/
|
|
20
|
+
export const ${camelCase(options.overrideName || reflection.getName())}${options.overrideExtends !== false && (options.overrideExtends || reflection.getSuperReflectionClass()?.getName()) ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}` : ""} = {
|
|
21
|
+
${reflection.getProperties().filter((item) => !item.isIgnored() && !isUndefined(options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
22
|
+
if (isUndefined(ret) && !isUndefined(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
|
|
23
|
+
return ret;
|
|
24
|
+
}, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1).map((item) => ` /**
|
|
25
|
+
* ${item.getDescription() || item.getTitle() || titleCase(item.getNameAsString())}
|
|
26
|
+
*
|
|
27
|
+
* @title ${item.getTitle() || titleCase(item.getNameAsString())}${item.getAlias().length ? `
|
|
28
|
+
${item.getAlias().map((alias) => ` * @alias ${alias}`).join("\n")}` : ""}${item.getDomain() ? `
|
|
29
|
+
* @domain ${item.getDomain()}` : ""}${item.getPermission().length ? `
|
|
30
|
+
${item.getPermission().map((permission) => ` * @permission ${permission}`).join("\n")}` : ""}${item.isInternal() ? `
|
|
31
|
+
* @internal` : ""}${item.isReadonly() ? `
|
|
32
|
+
* @readonly` : ""}${item.isIgnored() ? `
|
|
33
|
+
* @ignored` : ""}${item.isHidden() ? `
|
|
34
|
+
* @hidden` : ""}
|
|
35
|
+
*/
|
|
36
|
+
${item.getNameAsString()}: ${stringifyValue(item.getType(), options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
37
|
+
if (isUndefined(ret) && !isUndefined(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
|
|
38
|
+
return ret;
|
|
39
|
+
}, void 0) ?? item.getDefaultValue())}`).join(", \n")}
|
|
40
|
+
};
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
3
45
|
export { generateTypeScriptObject };
|
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
require('./
|
|
5
|
-
|
|
6
|
-
let prettier_doc_js = require("prettier/doc.js");
|
|
2
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_core_components_output = require('./core/components/output.cjs');
|
|
4
|
+
const require_vendor = require('./vendor.cjs');
|
|
5
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
6
|
let __alloy_js_rollup_plugin = require("@alloy-js/rollup-plugin");
|
|
8
|
-
__alloy_js_rollup_plugin =
|
|
7
|
+
__alloy_js_rollup_plugin = require_rolldown_runtime.__toESM(__alloy_js_rollup_plugin);
|
|
9
8
|
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
10
9
|
let __stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
11
10
|
let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
12
11
|
let __stryke_path_replace = require("@stryke/path/replace");
|
|
13
12
|
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
14
|
-
let
|
|
13
|
+
let prettier_doc_js = require("prettier/doc.js");
|
|
15
14
|
|
|
16
15
|
//#region src/index.tsx
|
|
17
16
|
/**
|
|
@@ -53,7 +52,7 @@ const plugin = (options = {}) => {
|
|
|
53
52
|
},
|
|
54
53
|
resolveId(id) {
|
|
55
54
|
if (id === "@alloy-js/core") return {
|
|
56
|
-
id: "@powerlines/plugin-alloy",
|
|
55
|
+
id: "@powerlines/plugin-alloy/vendor",
|
|
57
56
|
external: true
|
|
58
57
|
};
|
|
59
58
|
return null;
|
|
@@ -63,14 +62,14 @@ const plugin = (options = {}) => {
|
|
|
63
62
|
configResolved: {
|
|
64
63
|
order: "pre",
|
|
65
64
|
async handler() {
|
|
66
|
-
this.render = async (children
|
|
65
|
+
this.render = async (children) => {
|
|
67
66
|
const _self$ = this;
|
|
68
|
-
const tree =
|
|
67
|
+
const tree = (0, require_vendor.vendor_exports.renderTree)((0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
|
|
69
68
|
context: _self$,
|
|
70
69
|
get basePath() {
|
|
71
70
|
return _self$.workspaceConfig.workspaceRoot;
|
|
72
71
|
},
|
|
73
|
-
children
|
|
72
|
+
children
|
|
74
73
|
}));
|
|
75
74
|
await writeTree(this, tree, this.config.alloy);
|
|
76
75
|
};
|
|
@@ -86,14 +85,14 @@ var src_default = plugin;
|
|
|
86
85
|
* @param tree - The rendered output files.
|
|
87
86
|
*/
|
|
88
87
|
async function writeTree(context, tree, options = {}) {
|
|
89
|
-
await
|
|
88
|
+
await (0, require_vendor.vendor_exports.flushJobsAsync)();
|
|
90
89
|
let result;
|
|
91
|
-
const generateOutput = async (currentDirectory, root
|
|
92
|
-
if (!Array.isArray(root
|
|
90
|
+
const generateOutput = async (currentDirectory, root) => {
|
|
91
|
+
if (!Array.isArray(root)) return;
|
|
93
92
|
const recurse = async (cwd) => {
|
|
94
|
-
for (const child of root
|
|
93
|
+
for (const child of root) await generateOutput(cwd, child);
|
|
95
94
|
};
|
|
96
|
-
const renderContext =
|
|
95
|
+
const renderContext = (0, require_vendor.vendor_exports.getContextForRenderNode)(root);
|
|
97
96
|
if (!renderContext) return recurse(currentDirectory);
|
|
98
97
|
if (renderContext.meta?.directory) {
|
|
99
98
|
const directory = {
|
|
@@ -116,7 +115,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
116
115
|
path: (0, __stryke_path_replace.replacePath)(renderContext.meta.sourceFile.path, context.builtinsPath),
|
|
117
116
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
118
117
|
preset: renderContext.meta.output?.mode,
|
|
119
|
-
contents: await printTree
|
|
118
|
+
contents: await printTree(context, root, options)
|
|
120
119
|
};
|
|
121
120
|
} else if (renderContext.meta?.entry || (0, __stryke_path_is_parent_path.isParentPath)(context.entryPath, renderContext.meta.sourceFile.path)) {
|
|
122
121
|
context.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Rendering entry module at path: ${renderContext.meta.sourceFile.path}`);
|
|
@@ -126,7 +125,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
126
125
|
path: renderContext.meta.sourceFile.path,
|
|
127
126
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
128
127
|
preset: renderContext.meta.output?.mode,
|
|
129
|
-
contents: await printTree
|
|
128
|
+
contents: await printTree(context, root, options)
|
|
130
129
|
};
|
|
131
130
|
} else {
|
|
132
131
|
context.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Rendering source file at path: ${renderContext.meta.sourceFile.path}`);
|
|
@@ -135,7 +134,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
135
134
|
path: renderContext.meta.sourceFile.path,
|
|
136
135
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
137
136
|
preset: renderContext.meta.output?.mode,
|
|
138
|
-
contents: await printTree
|
|
137
|
+
contents: await printTree(context, root, options)
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
140
|
currentDirectory.contents.push(outputFile);
|
|
@@ -153,8 +152,8 @@ async function writeTree(context, tree, options = {}) {
|
|
|
153
152
|
} else await recurse(currentDirectory);
|
|
154
153
|
};
|
|
155
154
|
await generateOutput(void 0, tree);
|
|
156
|
-
const writeOutput
|
|
157
|
-
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);
|
|
158
157
|
else if (sub.kind === "builtin") await context$1.emitBuiltin(sub.contents, sub.id, sub.path);
|
|
159
158
|
else if (sub.kind === "entry") await context$1.emitEntry(sub.contents, sub.path, sub.typeDefinition);
|
|
160
159
|
else if (sub.kind === "file") if ("sourcePath" in sub && sub.sourcePath) {
|
|
@@ -165,14 +164,14 @@ async function writeTree(context, tree, options = {}) {
|
|
|
165
164
|
} else if ("contents" in sub && (0, __stryke_type_checks_is_set_string.isSetString)(sub.contents)) await context$1.fs.write(sub.path, sub.contents);
|
|
166
165
|
else throw new Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(sub, null, 2)}`);
|
|
167
166
|
};
|
|
168
|
-
await writeOutput
|
|
167
|
+
await writeOutput(context, result);
|
|
169
168
|
}
|
|
170
|
-
async function printTree
|
|
169
|
+
async function printTree(context, tree, options = {}) {
|
|
171
170
|
options.printWidth ??= 160;
|
|
172
171
|
options.tabWidth ??= 2;
|
|
173
172
|
options.useTabs ??= false;
|
|
174
173
|
options.insertFinalNewLine ??= true;
|
|
175
|
-
await
|
|
174
|
+
await (0, require_vendor.vendor_exports.flushJobsAsync)();
|
|
176
175
|
const result = prettier_doc_js.printer.printDocToString(printTreeWorker(tree), options).formatted;
|
|
177
176
|
return options.insertFinalNewLine && !result.endsWith("\n") ? `${result}\n` : result;
|
|
178
177
|
}
|
|
@@ -181,256 +180,11 @@ function printTreeWorker(tree) {
|
|
|
181
180
|
for (const node of tree) if (typeof node === "string") {
|
|
182
181
|
const normalizedNode = node.split(/\r?\n/).flatMap((line, index, array) => index < array.length - 1 ? [line] : [line]);
|
|
183
182
|
doc.push(normalizedNode);
|
|
184
|
-
} else if (
|
|
183
|
+
} else if ((0, require_vendor.vendor_exports.isPrintHook)(node)) doc.push(node.print(node.subtree, printTreeWorker));
|
|
185
184
|
else doc.push(printTreeWorker(node));
|
|
186
185
|
return doc;
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
//#endregion
|
|
190
|
-
exports.AppendFile = require_jsx_runtime.AppendFile;
|
|
191
|
-
exports.AppendRegion = require_jsx_runtime.AppendRegion;
|
|
192
|
-
exports.AssignmentContext = require_jsx_runtime.AssignmentContext;
|
|
193
|
-
exports.BasicScope = require_jsx_runtime.BasicScope;
|
|
194
|
-
exports.BasicSymbol = require_jsx_runtime.BasicSymbol;
|
|
195
|
-
exports.BinderContext = require_jsx_runtime.BinderContext;
|
|
196
|
-
exports.Block = require_jsx_runtime.Block;
|
|
197
|
-
exports.CopyFile = require_jsx_runtime.CopyFile;
|
|
198
|
-
exports.Declaration = require_jsx_runtime.Declaration;
|
|
199
|
-
exports.DeclarationContext = require_jsx_runtime.DeclarationContext;
|
|
200
|
-
exports.For = require_jsx_runtime.For;
|
|
201
|
-
exports.FormatOptions = require_jsx_runtime.FormatOptions;
|
|
202
|
-
exports.Indent = require_jsx_runtime.Indent;
|
|
203
|
-
exports.List = require_jsx_runtime.List;
|
|
204
|
-
exports.Match = require_jsx_runtime.Match;
|
|
205
|
-
exports.MemberContext = require_jsx_runtime.MemberContext;
|
|
206
|
-
exports.MemberDeclaration = require_jsx_runtime.MemberDeclaration;
|
|
207
|
-
exports.MemberDeclarationContext = require_jsx_runtime.MemberDeclarationContext;
|
|
208
|
-
exports.MemberName = require_jsx_runtime.MemberName;
|
|
209
|
-
exports.MemberScope = require_jsx_runtime.MemberScope;
|
|
210
|
-
exports.Name = require_jsx_runtime.Name;
|
|
211
|
-
exports.NamePolicyContext = require_jsx_runtime.NamePolicyContext;
|
|
212
|
-
exports.Output = require_jsx_runtime.Output;
|
|
213
|
-
exports.OutputDeclarationSpace = require_jsx_runtime.OutputDeclarationSpace;
|
|
214
|
-
exports.OutputMemberSpace = require_jsx_runtime.OutputMemberSpace;
|
|
215
|
-
exports.OutputScope = require_jsx_runtime.OutputScope;
|
|
216
|
-
exports.OutputSymbol = require_jsx_runtime.OutputSymbol;
|
|
217
|
-
exports.Prose = require_jsx_runtime.Prose;
|
|
218
|
-
exports.REFKEYABLE = require_jsx_runtime.REFKEYABLE;
|
|
219
|
-
exports.RENDERABLE = require_jsx_runtime.RENDERABLE;
|
|
220
|
-
exports.ReactiveUnionSet = require_jsx_runtime.ReactiveUnionSet;
|
|
221
|
-
exports.ReferenceOrContent = require_jsx_runtime.ReferenceOrContent;
|
|
222
|
-
exports.Scope = require_jsx_runtime.Scope;
|
|
223
|
-
exports.ScopeContext = require_jsx_runtime.ScopeContext;
|
|
224
|
-
exports.Show = require_jsx_runtime.Show;
|
|
225
|
-
exports.SourceDirectory = require_jsx_runtime.SourceDirectory;
|
|
226
|
-
exports.SourceDirectoryContext = require_jsx_runtime.SourceDirectoryContext;
|
|
227
|
-
exports.SourceFile = require_jsx_runtime.SourceFile;
|
|
228
|
-
exports.SourceFileContext = require_jsx_runtime.SourceFileContext;
|
|
229
|
-
exports.StatementList = require_jsx_runtime.StatementList;
|
|
230
|
-
exports.Switch = require_jsx_runtime.Switch;
|
|
231
|
-
exports.SymbolTable = require_jsx_runtime.SymbolTable;
|
|
232
|
-
exports.TO_SYMBOL = require_jsx_runtime.TO_SYMBOL;
|
|
233
|
-
exports.TemplateFile = require_jsx_runtime.TemplateFile;
|
|
234
|
-
exports.TemplateVariable = require_jsx_runtime.TemplateVariable;
|
|
235
|
-
Object.defineProperty(exports, 'TrackOpTypes', {
|
|
236
|
-
enumerable: true,
|
|
237
|
-
get: function () {
|
|
238
|
-
return __vue_reactivity.TrackOpTypes;
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
Object.defineProperty(exports, 'TriggerOpTypes', {
|
|
242
|
-
enumerable: true,
|
|
243
|
-
get: function () {
|
|
244
|
-
return __vue_reactivity.TriggerOpTypes;
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
exports.UpdateFile = require_jsx_runtime.UpdateFile;
|
|
248
|
-
exports.Wrap = require_jsx_runtime.Wrap;
|
|
249
|
-
exports.baseListPropsToMapJoinArgs = require_jsx_runtime.baseListPropsToMapJoinArgs;
|
|
250
|
-
exports.children = require_jsx_runtime.children;
|
|
251
|
-
exports.childrenArray = require_jsx_runtime.childrenArray;
|
|
252
|
-
exports.code = require_jsx_runtime.code;
|
|
253
|
-
Object.defineProperty(exports, 'computed', {
|
|
254
|
-
enumerable: true,
|
|
255
|
-
get: function () {
|
|
256
|
-
return __vue_reactivity.computed;
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
exports.contextsByKey = require_jsx_runtime.contextsByKey;
|
|
260
|
-
exports.createAssignmentContext = require_jsx_runtime.createAssignmentContext;
|
|
261
|
-
exports.createComponent = require_jsx_runtime.createComponent;
|
|
262
|
-
exports.createContentSlot = require_jsx_runtime.createContentSlot;
|
|
263
|
-
exports.createContext = require_jsx_runtime.createContext;
|
|
264
|
-
exports.createCustomContext = require_jsx_runtime.createCustomContext;
|
|
265
|
-
exports.createDeclarationTap = require_jsx_runtime.createDeclarationTap;
|
|
266
|
-
exports.createFileResource = require_jsx_runtime.createFileResource;
|
|
267
|
-
exports.createFormatOptionsContextFor = require_jsx_runtime.createFormatOptionsContextFor;
|
|
268
|
-
exports.createIntrinsic = require_jsx_runtime.createIntrinsic;
|
|
269
|
-
exports.createMemberTap = require_jsx_runtime.createMemberTap;
|
|
270
|
-
exports.createNamePolicy = require_jsx_runtime.createNamePolicy;
|
|
271
|
-
exports.createNamedContext = require_jsx_runtime.createNamedContext;
|
|
272
|
-
exports.createOutputBinder = require_jsx_runtime.createOutputBinder;
|
|
273
|
-
exports.createRenderTreeHook = require_jsx_runtime.createRenderTreeHook;
|
|
274
|
-
exports.createResource = require_jsx_runtime.createResource;
|
|
275
|
-
exports.createScopeTap = require_jsx_runtime.createScopeTap;
|
|
276
|
-
exports.createSourceFileTap = require_jsx_runtime.createSourceFileTap;
|
|
277
|
-
exports.createSymbolSlot = require_jsx_runtime.createSymbolSlot;
|
|
278
|
-
exports.createTap = require_jsx_runtime.createTap;
|
|
279
|
-
exports.decl = require_jsx_runtime.decl;
|
|
280
189
|
exports.default = src_default;
|
|
281
|
-
exports.
|
|
282
|
-
exports.effect = require_jsx_runtime.effect;
|
|
283
|
-
exports.emitSymbol = require_jsx_runtime.emitSymbol;
|
|
284
|
-
exports.findKeyedChild = require_jsx_runtime.findKeyedChild;
|
|
285
|
-
exports.findKeyedChildren = require_jsx_runtime.findKeyedChildren;
|
|
286
|
-
exports.findUnkeyedChildren = require_jsx_runtime.findUnkeyedChildren;
|
|
287
|
-
exports.flushJobs = require_jsx_runtime.flushJobs;
|
|
288
|
-
exports.flushJobsAsync = require_jsx_runtime.flushJobsAsync;
|
|
289
|
-
exports.getAssignmentSymbol = require_jsx_runtime.getAssignmentSymbol;
|
|
290
|
-
exports.getContext = require_jsx_runtime.getContext;
|
|
291
|
-
exports.getContextForRenderNode = require_jsx_runtime.getContextForRenderNode;
|
|
292
|
-
exports.getElementCache = require_jsx_runtime.getElementCache;
|
|
293
|
-
exports.getSymbolCreator = require_jsx_runtime.getSymbolCreator;
|
|
294
|
-
exports.getSymbolCreatorSymbol = require_jsx_runtime.getSymbolCreatorSymbol;
|
|
295
|
-
exports.inspectRefkey = require_jsx_runtime.inspectRefkey;
|
|
296
|
-
exports.instantiateTakenMembersTo = require_jsx_runtime.instantiateTakenMembersTo;
|
|
297
|
-
exports.intrinsicElementKey = require_jsx_runtime.intrinsicElementKey;
|
|
298
|
-
exports.isComponentCreator = require_jsx_runtime.isComponentCreator;
|
|
299
|
-
exports.isCustomContext = require_jsx_runtime.isCustomContext;
|
|
300
|
-
exports.isIntrinsicElement = require_jsx_runtime.isIntrinsicElement;
|
|
301
|
-
exports.isKeyedChild = require_jsx_runtime.isKeyedChild;
|
|
302
|
-
exports.isLibrarySymbolReference = require_jsx_runtime.isLibrarySymbolReference;
|
|
303
|
-
exports.isMemberRefkey = require_jsx_runtime.isMemberRefkey;
|
|
304
|
-
exports.isNamekey = require_jsx_runtime.isNamekey;
|
|
305
|
-
exports.isPrintHook = require_jsx_runtime.isPrintHook;
|
|
306
|
-
Object.defineProperty(exports, 'isProxy', {
|
|
307
|
-
enumerable: true,
|
|
308
|
-
get: function () {
|
|
309
|
-
return __vue_reactivity.isProxy;
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
Object.defineProperty(exports, 'isReactive', {
|
|
313
|
-
enumerable: true,
|
|
314
|
-
get: function () {
|
|
315
|
-
return __vue_reactivity.isReactive;
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
Object.defineProperty(exports, 'isRef', {
|
|
319
|
-
enumerable: true,
|
|
320
|
-
get: function () {
|
|
321
|
-
return __vue_reactivity.isRef;
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
exports.isRefkey = require_jsx_runtime.isRefkey;
|
|
325
|
-
exports.isRefkeyable = require_jsx_runtime.isRefkeyable;
|
|
326
|
-
exports.isRenderableObject = require_jsx_runtime.isRenderableObject;
|
|
327
|
-
exports.isSymbolRefkey = require_jsx_runtime.isSymbolRefkey;
|
|
328
|
-
exports.join = require_jsx_runtime.join;
|
|
329
|
-
exports.mapJoin = require_jsx_runtime.mapJoin;
|
|
330
|
-
exports.matchTag = require_jsx_runtime.matchTag;
|
|
331
|
-
exports.memberRefkey = require_jsx_runtime.memberRefkey;
|
|
332
|
-
exports.memo = require_jsx_runtime.memo;
|
|
333
|
-
exports.mergeProps = require_jsx_runtime.mergeProps;
|
|
334
|
-
exports.moveTakenMembersTo = require_jsx_runtime.moveTakenMembersTo;
|
|
335
|
-
exports.namekey = require_jsx_runtime.namekey;
|
|
336
|
-
exports.notifyContentState = require_jsx_runtime.notifyContentState;
|
|
337
|
-
exports.onCleanup = require_jsx_runtime.onCleanup;
|
|
338
|
-
exports.plugin = plugin;
|
|
339
|
-
exports.popStack = require_jsx_runtime.popStack;
|
|
340
|
-
exports.printHookTag = require_jsx_runtime.printHookTag;
|
|
341
|
-
exports.printRenderStack = require_jsx_runtime.printRenderStack;
|
|
342
|
-
exports.printTree = require_jsx_runtime.printTree;
|
|
343
|
-
exports.pushStack = require_jsx_runtime.pushStack;
|
|
344
|
-
exports.queueJob = require_jsx_runtime.queueJob;
|
|
345
|
-
Object.defineProperty(exports, 'reactive', {
|
|
346
|
-
enumerable: true,
|
|
347
|
-
get: function () {
|
|
348
|
-
return __vue_reactivity.reactive;
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
Object.defineProperty(exports, 'ref', {
|
|
352
|
-
enumerable: true,
|
|
353
|
-
get: function () {
|
|
354
|
-
return __vue_reactivity.ref;
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
exports.refId = require_jsx_runtime.refId;
|
|
358
|
-
exports.refkey = require_jsx_runtime.refkey;
|
|
359
|
-
exports.render = require_jsx_runtime.render;
|
|
360
|
-
exports.renderAsync = require_jsx_runtime.renderAsync;
|
|
361
|
-
exports.renderTree = require_jsx_runtime.renderTree;
|
|
362
|
-
exports.resolve = require_jsx_runtime.resolve;
|
|
363
|
-
exports.root = require_jsx_runtime.root;
|
|
364
|
-
exports.scheduler = require_jsx_runtime.scheduler;
|
|
365
|
-
Object.defineProperty(exports, 'shallowReactive', {
|
|
366
|
-
enumerable: true,
|
|
367
|
-
get: function () {
|
|
368
|
-
return __vue_reactivity.shallowReactive;
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
Object.defineProperty(exports, 'shallowRef', {
|
|
372
|
-
enumerable: true,
|
|
373
|
-
get: function () {
|
|
374
|
-
return __vue_reactivity.shallowRef;
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
exports.shouldDebug = require_jsx_runtime.shouldDebug;
|
|
378
|
-
exports.sourceFilesForTree = require_jsx_runtime.sourceFilesForTree;
|
|
379
|
-
exports.sourceFilesForTreeAsync = require_jsx_runtime.sourceFilesForTreeAsync;
|
|
380
|
-
exports.splitProps = require_jsx_runtime.splitProps;
|
|
381
|
-
exports.stc = require_jsx_runtime.stc;
|
|
382
|
-
exports.sti = require_jsx_runtime.sti;
|
|
383
|
-
exports.symbolForRefkey = require_jsx_runtime.symbolForRefkey;
|
|
384
|
-
exports.taggedComponent = require_jsx_runtime.taggedComponent;
|
|
385
|
-
exports.takeSymbols = require_jsx_runtime.takeSymbols;
|
|
386
|
-
exports.text = require_jsx_runtime.text;
|
|
387
|
-
Object.defineProperty(exports, 'toRaw', {
|
|
388
|
-
enumerable: true,
|
|
389
|
-
get: function () {
|
|
390
|
-
return __vue_reactivity.toRaw;
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
Object.defineProperty(exports, 'toRef', {
|
|
394
|
-
enumerable: true,
|
|
395
|
-
get: function () {
|
|
396
|
-
return __vue_reactivity.toRef;
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
exports.toRefkey = require_jsx_runtime.toRefkey;
|
|
400
|
-
Object.defineProperty(exports, 'toRefs', {
|
|
401
|
-
enumerable: true,
|
|
402
|
-
get: function () {
|
|
403
|
-
return __vue_reactivity.toRefs;
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
Object.defineProperty(exports, 'track', {
|
|
407
|
-
enumerable: true,
|
|
408
|
-
get: function () {
|
|
409
|
-
return __vue_reactivity.track;
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
exports.trackPromise = require_jsx_runtime.trackPromise;
|
|
413
|
-
exports.traverseOutput = require_jsx_runtime.traverseOutput;
|
|
414
|
-
Object.defineProperty(exports, 'trigger', {
|
|
415
|
-
enumerable: true,
|
|
416
|
-
get: function () {
|
|
417
|
-
return __vue_reactivity.trigger;
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
exports.unresolvedRefkey = require_jsx_runtime.unresolvedRefkey;
|
|
421
|
-
exports.untrack = require_jsx_runtime.untrack;
|
|
422
|
-
exports.useBinder = require_jsx_runtime.useBinder;
|
|
423
|
-
exports.useContext = require_jsx_runtime.useContext;
|
|
424
|
-
exports.useFormatOptions = require_jsx_runtime.useFormatOptions;
|
|
425
|
-
exports.useMemberContext = require_jsx_runtime.useMemberContext;
|
|
426
|
-
exports.useMemberDeclaration = require_jsx_runtime.useMemberDeclaration;
|
|
427
|
-
exports.useMemberScope = require_jsx_runtime.useMemberScope;
|
|
428
|
-
exports.useNamePolicy = require_jsx_runtime.useNamePolicy;
|
|
429
|
-
exports.useScope = require_jsx_runtime.useScope;
|
|
430
|
-
Object.defineProperty(exports, 'watch', {
|
|
431
|
-
enumerable: true,
|
|
432
|
-
get: function () {
|
|
433
|
-
return __vue_reactivity.watch;
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
exports.writeOutput = require_jsx_runtime.writeOutput;
|
|
190
|
+
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export * from "@alloy-js/core";
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions } from "./types/plugin.cjs";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
|
6
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export * from "@alloy-js/core";
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions } from "./types/plugin.mjs";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
|
6
5
|
|
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.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
|
/**
|
|
@@ -49,7 +49,7 @@ const plugin = (options = {}) => {
|
|
|
49
49
|
},
|
|
50
50
|
resolveId(id) {
|
|
51
51
|
if (id === "@alloy-js/core") return {
|
|
52
|
-
id: "@powerlines/plugin-alloy",
|
|
52
|
+
id: "@powerlines/plugin-alloy/vendor",
|
|
53
53
|
external: true
|
|
54
54
|
};
|
|
55
55
|
return null;
|
|
@@ -59,14 +59,14 @@ const plugin = (options = {}) => {
|
|
|
59
59
|
configResolved: {
|
|
60
60
|
order: "pre",
|
|
61
61
|
async handler() {
|
|
62
|
-
this.render = async (children
|
|
62
|
+
this.render = async (children) => {
|
|
63
63
|
const _self$ = this;
|
|
64
|
-
const tree = renderTree(createComponent(Output
|
|
64
|
+
const tree = (0, vendor_exports.renderTree)(createComponent(Output, {
|
|
65
65
|
context: _self$,
|
|
66
66
|
get basePath() {
|
|
67
67
|
return _self$.workspaceConfig.workspaceRoot;
|
|
68
68
|
},
|
|
69
|
-
children
|
|
69
|
+
children
|
|
70
70
|
}));
|
|
71
71
|
await writeTree(this, tree, this.config.alloy);
|
|
72
72
|
};
|
|
@@ -82,14 +82,14 @@ var src_default = plugin;
|
|
|
82
82
|
* @param tree - The rendered output files.
|
|
83
83
|
*/
|
|
84
84
|
async function writeTree(context, tree, options = {}) {
|
|
85
|
-
await flushJobsAsync();
|
|
85
|
+
await (0, vendor_exports.flushJobsAsync)();
|
|
86
86
|
let result;
|
|
87
|
-
const generateOutput = async (currentDirectory, root
|
|
88
|
-
if (!Array.isArray(root
|
|
87
|
+
const generateOutput = async (currentDirectory, root) => {
|
|
88
|
+
if (!Array.isArray(root)) return;
|
|
89
89
|
const recurse = async (cwd) => {
|
|
90
|
-
for (const child of root
|
|
90
|
+
for (const child of root) await generateOutput(cwd, child);
|
|
91
91
|
};
|
|
92
|
-
const renderContext = getContextForRenderNode(root
|
|
92
|
+
const renderContext = (0, vendor_exports.getContextForRenderNode)(root);
|
|
93
93
|
if (!renderContext) return recurse(currentDirectory);
|
|
94
94
|
if (renderContext.meta?.directory) {
|
|
95
95
|
const directory = {
|
|
@@ -112,7 +112,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
112
112
|
path: replacePath(renderContext.meta.sourceFile.path, context.builtinsPath),
|
|
113
113
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
114
114
|
preset: renderContext.meta.output?.mode,
|
|
115
|
-
contents: await printTree
|
|
115
|
+
contents: await printTree(context, root, options)
|
|
116
116
|
};
|
|
117
117
|
} else if (renderContext.meta?.entry || isParentPath(context.entryPath, renderContext.meta.sourceFile.path)) {
|
|
118
118
|
context.log(LogLevelLabel.TRACE, `Rendering entry module at path: ${renderContext.meta.sourceFile.path}`);
|
|
@@ -122,7 +122,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
122
122
|
path: renderContext.meta.sourceFile.path,
|
|
123
123
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
124
124
|
preset: renderContext.meta.output?.mode,
|
|
125
|
-
contents: await printTree
|
|
125
|
+
contents: await printTree(context, root, options)
|
|
126
126
|
};
|
|
127
127
|
} else {
|
|
128
128
|
context.log(LogLevelLabel.TRACE, `Rendering source file at path: ${renderContext.meta.sourceFile.path}`);
|
|
@@ -131,7 +131,7 @@ async function writeTree(context, tree, options = {}) {
|
|
|
131
131
|
path: renderContext.meta.sourceFile.path,
|
|
132
132
|
filetype: renderContext.meta.sourceFile.filetype,
|
|
133
133
|
preset: renderContext.meta.output?.mode,
|
|
134
|
-
contents: await printTree
|
|
134
|
+
contents: await printTree(context, root, options)
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
currentDirectory.contents.push(outputFile);
|
|
@@ -149,8 +149,8 @@ async function writeTree(context, tree, options = {}) {
|
|
|
149
149
|
} else await recurse(currentDirectory);
|
|
150
150
|
};
|
|
151
151
|
await generateOutput(void 0, tree);
|
|
152
|
-
const writeOutput
|
|
153
|
-
for (const sub of output.contents) if (sub.kind === "directory") await writeOutput
|
|
152
|
+
const writeOutput = async (context$1, output) => {
|
|
153
|
+
for (const sub of output.contents) if (sub.kind === "directory") await writeOutput(context$1, sub);
|
|
154
154
|
else if (sub.kind === "builtin") await context$1.emitBuiltin(sub.contents, sub.id, sub.path);
|
|
155
155
|
else if (sub.kind === "entry") await context$1.emitEntry(sub.contents, sub.path, sub.typeDefinition);
|
|
156
156
|
else if (sub.kind === "file") if ("sourcePath" in sub && sub.sourcePath) {
|
|
@@ -161,14 +161,14 @@ async function writeTree(context, tree, options = {}) {
|
|
|
161
161
|
} else if ("contents" in sub && isSetString(sub.contents)) await context$1.fs.write(sub.path, sub.contents);
|
|
162
162
|
else throw new Error(`Unexpected output extracted from the render tree: \n\n${JSON.stringify(sub, null, 2)}`);
|
|
163
163
|
};
|
|
164
|
-
await writeOutput
|
|
164
|
+
await writeOutput(context, result);
|
|
165
165
|
}
|
|
166
|
-
async function printTree
|
|
166
|
+
async function printTree(context, tree, options = {}) {
|
|
167
167
|
options.printWidth ??= 160;
|
|
168
168
|
options.tabWidth ??= 2;
|
|
169
169
|
options.useTabs ??= false;
|
|
170
170
|
options.insertFinalNewLine ??= true;
|
|
171
|
-
await flushJobsAsync();
|
|
171
|
+
await (0, vendor_exports.flushJobsAsync)();
|
|
172
172
|
const result = printer.printDocToString(printTreeWorker(tree), options).formatted;
|
|
173
173
|
return options.insertFinalNewLine && !result.endsWith("\n") ? `${result}\n` : result;
|
|
174
174
|
}
|
|
@@ -177,10 +177,10 @@ function printTreeWorker(tree) {
|
|
|
177
177
|
for (const node of tree) if (typeof node === "string") {
|
|
178
178
|
const normalizedNode = node.split(/\r?\n/).flatMap((line, index, array) => index < array.length - 1 ? [line] : [line]);
|
|
179
179
|
doc.push(normalizedNode);
|
|
180
|
-
} else if (isPrintHook(node)) doc.push(node.print(node.subtree, printTreeWorker));
|
|
180
|
+
} else if ((0, vendor_exports.isPrintHook)(node)) doc.push(node.print(node.subtree, printTreeWorker));
|
|
181
181
|
else doc.push(printTreeWorker(node));
|
|
182
182
|
return doc;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
//#endregion
|
|
186
|
-
export {
|
|
186
|
+
export { src_default as default, plugin };
|
|
@@ -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 };
|