@powerlines/plugin-alloy 0.25.29 → 0.25.31
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/core/components/output.cjs +12 -7
- package/dist/core/components/output.mjs +12 -7
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +5 -8
- package/dist/core/components/single-line-comment.mjs +5 -8
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +8 -7
- package/dist/core/components/source-file.mjs +8 -7
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +5 -6
- package/dist/core/components/spacing.mjs +5 -6
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +12 -9
- package/dist/markdown/components/front-matter.mjs +12 -9
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +57 -41
- package/dist/markdown/components/markdown-file.mjs +57 -41
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +31 -20
- package/dist/markdown/components/markdown-table.mjs +31 -20
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +10 -4
- package/dist/render.mjs +10 -4
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +21 -9
- package/dist/typescript/components/builtin-file.mjs +21 -9
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +112 -79
- package/dist/typescript/components/class-declaration.mjs +112 -79
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +6 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +6 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +7 -3
- package/dist/typescript/components/entry-file.mjs +7 -3
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/infrastructure-file.cjs +7 -3
- package/dist/typescript/components/infrastructure-file.mjs +7 -3
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +83 -47
- package/dist/typescript/components/interface-declaration.mjs +83 -47
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +48 -36
- package/dist/typescript/components/object-declaration.mjs +48 -36
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +2 -2
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +112 -54
- package/dist/typescript/components/tsdoc-reflection.mjs +112 -54
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +211 -140
- package/dist/typescript/components/tsdoc.mjs +211 -140
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +17 -9
- package/dist/typescript/components/type-declaration.mjs +17 -9
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +33 -33
- package/dist/typescript/components/type-parameters.mjs +33 -33
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +90 -65
- package/dist/typescript/components/typescript-file.mjs +90 -65
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +5 -1
- package/dist/typescript/contexts/lexical-scope.mjs +5 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +5 -2
- package/dist/typescript/contexts/member-scope.mjs +5 -2
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +58 -48
- package/dist/yaml/components/yaml-file.mjs +58 -48
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -4,6 +4,7 @@ const require_core_contexts_context = require('../contexts/context.cjs');
|
|
|
4
4
|
const require_core_contexts_meta = require('../contexts/meta.cjs');
|
|
5
5
|
require('../contexts/index.cjs');
|
|
6
6
|
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
8
|
|
|
8
9
|
//#region src/core/components/output.tsx
|
|
9
10
|
/**
|
|
@@ -16,13 +17,17 @@ function Output(props) {
|
|
|
16
17
|
"meta"
|
|
17
18
|
]);
|
|
18
19
|
const contextRef = (0, _alloy_js_core.computed)(() => context);
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_contexts_meta.MetaContext.Provider, {
|
|
21
|
+
value: meta,
|
|
22
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_contexts_context.PowerlinesContext.Provider, {
|
|
23
|
+
value: contextRef.value,
|
|
24
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Output, {
|
|
25
|
+
...rest,
|
|
26
|
+
basePath: contextRef.value.workspaceConfig.workspaceRoot,
|
|
27
|
+
children
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
});
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
//#endregion
|
|
@@ -2,6 +2,7 @@ import { PowerlinesContext } from "../contexts/context.mjs";
|
|
|
2
2
|
import { MetaContext } from "../contexts/meta.mjs";
|
|
3
3
|
import "../contexts/index.mjs";
|
|
4
4
|
import { Output as Output$1, computed, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { jsx } from "@alloy-js/core/jsx-runtime";
|
|
5
6
|
|
|
6
7
|
//#region src/core/components/output.tsx
|
|
7
8
|
/**
|
|
@@ -14,13 +15,17 @@ function Output(props) {
|
|
|
14
15
|
"meta"
|
|
15
16
|
]);
|
|
16
17
|
const contextRef = computed(() => context);
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
return /* @__PURE__ */ jsx(MetaContext.Provider, {
|
|
19
|
+
value: meta,
|
|
20
|
+
children: /* @__PURE__ */ jsx(PowerlinesContext.Provider, {
|
|
21
|
+
value: contextRef.value,
|
|
22
|
+
children: /* @__PURE__ */ jsx(Output$1, {
|
|
23
|
+
...rest,
|
|
24
|
+
basePath: contextRef.value.workspaceConfig.workspaceRoot,
|
|
25
|
+
children
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.mjs","names":["OutputExternal"],"sources":["../../../src/core/components/output.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { OutputProps as OutputPropsExternal } from \"@alloy-js/core\";\nimport { computed, Output as OutputExternal, splitProps } from \"@alloy-js/core\";\nimport type { PluginContext } from \"@powerlines/core\";\nimport { MetaContext, MetaItem } from \"../contexts\";\nimport { PowerlinesContext } from \"../contexts/context\";\n\nexport interface OutputProps<\n TContext extends PluginContext = PluginContext\n> extends Omit<OutputPropsExternal, \"basePath\"> {\n /**\n * The current Powerlines process context.\n */\n context: TContext;\n\n /**\n * The file metadata collected during rendering.\n */\n meta?: Record<string, MetaItem>;\n}\n\n/**\n * Output component for rendering the Powerlines plugin's output files via templates.\n */\nexport function Output<TContext extends PluginContext = PluginContext>(\n props: OutputProps<TContext>\n) {\n const [{ children, context, meta = {} }, rest] = splitProps(props, [\n \"children\",\n \"context\",\n \"meta\"\n ]);\n\n const contextRef = computed(() => context);\n\n return (\n <MetaContext.Provider value={meta}>\n <PowerlinesContext.Provider value={contextRef.value}>\n <OutputExternal\n {...rest}\n basePath={contextRef.value.workspaceConfig.workspaceRoot}>\n {children}\n </OutputExternal>\n </PowerlinesContext.Provider>\n </MetaContext.Provider>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.mjs","names":["OutputExternal"],"sources":["../../../src/core/components/output.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { OutputProps as OutputPropsExternal } from \"@alloy-js/core\";\nimport { computed, Output as OutputExternal, splitProps } from \"@alloy-js/core\";\nimport type { PluginContext } from \"@powerlines/core\";\nimport { MetaContext, MetaItem } from \"../contexts\";\nimport { PowerlinesContext } from \"../contexts/context\";\n\nexport interface OutputProps<\n TContext extends PluginContext = PluginContext\n> extends Omit<OutputPropsExternal, \"basePath\"> {\n /**\n * The current Powerlines process context.\n */\n context: TContext;\n\n /**\n * The file metadata collected during rendering.\n */\n meta?: Record<string, MetaItem>;\n}\n\n/**\n * Output component for rendering the Powerlines plugin's output files via templates.\n */\nexport function Output<TContext extends PluginContext = PluginContext>(\n props: OutputProps<TContext>\n) {\n const [{ children, context, meta = {} }, rest] = splitProps(props, [\n \"children\",\n \"context\",\n \"meta\"\n ]);\n\n const contextRef = computed(() => context);\n\n return (\n <MetaContext.Provider value={meta}>\n <PowerlinesContext.Provider value={contextRef.value}>\n <OutputExternal\n {...rest}\n basePath={contextRef.value.workspaceConfig.workspaceRoot}>\n {children}\n </OutputExternal>\n </PowerlinesContext.Provider>\n </MetaContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,OACd,OACA;CACA,MAAM,CAAC,EAAE,UAAU,SAAS,OAAO,EAAE,IAAI,QAAQ,WAAW,OAAO;EACjE;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAa,eAAe,QAAQ;AAE1C,QACE,oBAAC,YAAY,UAAb;EAAsB,OAAO;YAC3B,oBAAC,kBAAkB,UAAnB;GAA4B,OAAO,WAAW;aAC5C,oBAACA,UAAD;IACE,GAAI;IACJ,UAAU,WAAW,MAAM,gBAAgB;IAC1C;IACc;GACU;EACR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
5
|
|
|
5
6
|
//#region src/core/components/single-line-comment.tsx
|
|
6
7
|
/**
|
|
@@ -10,14 +11,10 @@ let _alloy_js_core = require("@alloy-js/core");
|
|
|
10
11
|
function SingleLineComment(props) {
|
|
11
12
|
const { variant = "double-slash", children } = props;
|
|
12
13
|
const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : variant === "yaml" ? "# " : "// ";
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""}
|
|
19
|
-
</align>
|
|
20
|
-
</>;
|
|
14
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [commentStart, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)("align", {
|
|
15
|
+
string: commentStart,
|
|
16
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""]
|
|
17
|
+
})] });
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Prose } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
|
|
3
4
|
//#region src/core/components/single-line-comment.tsx
|
|
4
5
|
/**
|
|
@@ -8,14 +9,10 @@ import { Prose } from "@alloy-js/core";
|
|
|
8
9
|
function SingleLineComment(props) {
|
|
9
10
|
const { variant = "double-slash", children } = props;
|
|
10
11
|
const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : variant === "yaml" ? "# " : "// ";
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""}
|
|
17
|
-
</align>
|
|
18
|
-
</>;
|
|
12
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [commentStart, /* @__PURE__ */ jsxs("align", {
|
|
13
|
+
string: commentStart,
|
|
14
|
+
children: [/* @__PURE__ */ jsx(Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""]
|
|
15
|
+
})] });
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-line-comment.mjs","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Prose } from \"@alloy-js/core\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type SingleLineCommentVariant =\n | \"double-slash\"\n | \"triple-slash\"\n | \"slash-star\"\n | \"slash-star-star\"\n | \"markdown\"\n | \"yaml\";\n\nexport interface SingleLineCommentProps extends ComponentProps {\n /**\n * The variant of the single line comment.\n *\n * @defaultValue \"double-slash\"\n */\n variant?: SingleLineCommentVariant;\n}\n\n/**\n * A single line comment block. The children are rendered as a prose element, which means that they\n * are broken into multiple lines\n */\nexport function SingleLineComment(props: SingleLineCommentProps) {\n const { variant = \"double-slash\", children } = props;\n\n const commentStart =\n variant === \"slash-star\"\n ? \"/* \"\n : variant === \"slash-star-star\"\n ? \"/** \"\n : variant === \"triple-slash\"\n ? \"/// \"\n : variant === \"markdown\"\n ? \"<!-- \"\n : variant === \"yaml\"\n ? \"# \"\n : \"// \";\n\n return (\n <>\n {commentStart}\n <align string={commentStart}>\n <Prose>{children}</Prose>\n\n {variant === \"slash-star\" || variant === \"slash-star-star\"\n ? \" */ \"\n : variant === \"markdown\"\n ? \" -->\"\n : \"\"}\n </align>\n </>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"single-line-comment.mjs","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Prose } from \"@alloy-js/core\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type SingleLineCommentVariant =\n | \"double-slash\"\n | \"triple-slash\"\n | \"slash-star\"\n | \"slash-star-star\"\n | \"markdown\"\n | \"yaml\";\n\nexport interface SingleLineCommentProps extends ComponentProps {\n /**\n * The variant of the single line comment.\n *\n * @defaultValue \"double-slash\"\n */\n variant?: SingleLineCommentVariant;\n}\n\n/**\n * A single line comment block. The children are rendered as a prose element, which means that they\n * are broken into multiple lines\n */\nexport function SingleLineComment(props: SingleLineCommentProps) {\n const { variant = \"double-slash\", children } = props;\n\n const commentStart =\n variant === \"slash-star\"\n ? \"/* \"\n : variant === \"slash-star-star\"\n ? \"/** \"\n : variant === \"triple-slash\"\n ? \"/// \"\n : variant === \"markdown\"\n ? \"<!-- \"\n : variant === \"yaml\"\n ? \"# \"\n : \"// \";\n\n return (\n <>\n {commentStart}\n <align string={commentStart}>\n <Prose>{children}</Prose>\n\n {variant === \"slash-star\" || variant === \"slash-star-star\"\n ? \" */ \"\n : variant === \"markdown\"\n ? \" -->\"\n : \"\"}\n </align>\n </>\n );\n}\n"],"mappings":";;;;;;;;AA0CA,SAAgB,kBAAkB,OAA+B;CAC/D,MAAM,EAAE,UAAU,gBAAgB,aAAa;CAE/C,MAAM,eACJ,YAAY,eACR,QACA,YAAY,oBACV,SACA,YAAY,iBACV,SACA,YAAY,aACV,UACA,YAAY,SACV,OACA;AAEd,QACE,4CACG,cACD,qBAAC,SAAD;EAAO,QAAQ;YAAf,CACE,oBAAC,OAAD,EAAQ,UAAiB,GAExB,YAAY,gBAAgB,YAAY,oBACrC,SACA,YAAY,aACV,SACA,GACA;IACP"}
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_contexts_meta = require('../contexts/meta.cjs');
|
|
4
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
6
|
let _stryke_path_append = require("@stryke/path/append");
|
|
6
7
|
let defu = require("defu");
|
|
7
8
|
defu = require_runtime.__toESM(defu);
|
|
@@ -46,13 +47,13 @@ function SourceFile(props) {
|
|
|
46
47
|
storage,
|
|
47
48
|
...meta ?? {}
|
|
48
49
|
};
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.SourceFileContext.Provider, {
|
|
51
|
+
value: sourceFile,
|
|
52
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
53
|
+
when: header !== void 0,
|
|
54
|
+
children: [header, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
55
|
+
}), children]
|
|
56
|
+
});
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMeta } from "../contexts/meta.mjs";
|
|
2
2
|
import { Show, SourceDirectoryContext, SourceFileContext, getContext, splitProps, useContext, useFormatOptions } from "@alloy-js/core";
|
|
3
|
+
import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
3
4
|
import { appendPath } from "@stryke/path/append";
|
|
4
5
|
import defu from "defu";
|
|
5
6
|
|
|
@@ -43,13 +44,13 @@ function SourceFile(props) {
|
|
|
43
44
|
storage,
|
|
44
45
|
...meta ?? {}
|
|
45
46
|
};
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
return /* @__PURE__ */ jsxs(SourceFileContext.Provider, {
|
|
48
|
+
value: sourceFile,
|
|
49
|
+
children: [/* @__PURE__ */ jsxs(Show, {
|
|
50
|
+
when: header !== void 0,
|
|
51
|
+
children: [header, /* @__PURE__ */ jsx("hbr", {})]
|
|
52
|
+
}), children]
|
|
53
|
+
});
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/core/components/source-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n getContext,\n Show,\n SourceDirectoryContext,\n SourceFileContext,\n SourceFileProps as SourceFilePropsExternal,\n splitProps,\n useContext,\n useFormatOptions\n} from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport type { StoragePreset } from \"powerlines\";\nimport { ComponentProps } from \"../../types/components\";\nimport { useMeta } from \"../contexts/meta\";\n\nexport type SourceFileProps = SourceFilePropsExternal &\n ComponentProps & {\n /**\n * The storage preset for the output files.\n *\n * @remarks\n * If not specified, the output mode will be determined by the provided `output.mode` value.\n */\n storage?: StoragePreset;\n\n /**\n * The metadata associated with the source file.\n *\n * @remarks\n * The values stored in the metadata will be available in the rendering context.\n */\n meta?: Record<string, any>;\n };\n\n/**\n * A base component representing a Powerlines generated source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function SourceFile(props: SourceFileProps) {\n const [{ children, meta, path, header, storage, filetype, reference }] =\n splitProps(props, [\n \"children\",\n \"meta\",\n \"path\",\n \"header\",\n \"storage\",\n \"filetype\",\n \"reference\"\n ]);\n\n const metadata = useMeta();\n const parentDirectory = useContext(SourceDirectoryContext)!;\n\n const sourceFile: SourceFileContext = {\n path: appendPath(path, parentDirectory.path),\n filetype,\n reference\n };\n parentDirectory?.addContent(sourceFile);\n\n const printOptions = useFormatOptions({\n printWidth: props.printWidth,\n tabWidth: props.tabWidth,\n useTabs: props.useTabs,\n insertFinalNewLine: props.insertFinalNewLine\n });\n\n const nodeContext = getContext()!;\n nodeContext.meta = defu(\n {\n sourceFile,\n printOptions\n },\n meta ?? {}\n );\n\n if (metadata) {\n metadata[sourceFile.path] = {\n storage,\n ...(meta ?? {})\n };\n }\n\n return (\n <SourceFileContext.Provider value={sourceFile}>\n <Show when={header !== undefined}>\n {header}\n <hbr />\n </Show>\n {children}\n </SourceFileContext.Provider>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/core/components/source-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n getContext,\n Show,\n SourceDirectoryContext,\n SourceFileContext,\n SourceFileProps as SourceFilePropsExternal,\n splitProps,\n useContext,\n useFormatOptions\n} from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport type { StoragePreset } from \"powerlines\";\nimport { ComponentProps } from \"../../types/components\";\nimport { useMeta } from \"../contexts/meta\";\n\nexport type SourceFileProps = SourceFilePropsExternal &\n ComponentProps & {\n /**\n * The storage preset for the output files.\n *\n * @remarks\n * If not specified, the output mode will be determined by the provided `output.mode` value.\n */\n storage?: StoragePreset;\n\n /**\n * The metadata associated with the source file.\n *\n * @remarks\n * The values stored in the metadata will be available in the rendering context.\n */\n meta?: Record<string, any>;\n };\n\n/**\n * A base component representing a Powerlines generated source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function SourceFile(props: SourceFileProps) {\n const [{ children, meta, path, header, storage, filetype, reference }] =\n splitProps(props, [\n \"children\",\n \"meta\",\n \"path\",\n \"header\",\n \"storage\",\n \"filetype\",\n \"reference\"\n ]);\n\n const metadata = useMeta();\n const parentDirectory = useContext(SourceDirectoryContext)!;\n\n const sourceFile: SourceFileContext = {\n path: appendPath(path, parentDirectory.path),\n filetype,\n reference\n };\n parentDirectory?.addContent(sourceFile);\n\n const printOptions = useFormatOptions({\n printWidth: props.printWidth,\n tabWidth: props.tabWidth,\n useTabs: props.useTabs,\n insertFinalNewLine: props.insertFinalNewLine\n });\n\n const nodeContext = getContext()!;\n nodeContext.meta = defu(\n {\n sourceFile,\n printOptions\n },\n meta ?? {}\n );\n\n if (metadata) {\n metadata[sourceFile.path] = {\n storage,\n ...(meta ?? {})\n };\n }\n\n return (\n <SourceFileContext.Provider value={sourceFile}>\n <Show when={header !== undefined}>\n {header}\n <hbr />\n </Show>\n {children}\n </SourceFileContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA2DA,SAAgB,WAAW,OAAwB;CACjD,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,QAAQ,SAAS,UAAU,eACxD,WAAW,OAAO;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEJ,MAAM,WAAW,SAAS;CAC1B,MAAM,kBAAkB,WAAW,uBAAuB;CAE1D,MAAM,aAAgC;EACpC,MAAM,WAAW,MAAM,gBAAgB,KAAK;EAC5C;EACA;EACD;AACD,kBAAiB,WAAW,WAAW;CAEvC,MAAM,eAAe,iBAAiB;EACpC,YAAY,MAAM;EAClB,UAAU,MAAM;EAChB,SAAS,MAAM;EACf,oBAAoB,MAAM;EAC3B,CAAC;CAEF,MAAM,cAAc,YAAY;AAChC,aAAY,OAAO,KACjB;EACE;EACA;EACD,EACD,QAAQ,EAAE,CACX;AAED,KAAI,SACF,UAAS,WAAW,QAAQ;EAC1B;EACA,GAAI,QAAQ,EAAE;EACf;AAGH,QACE,qBAAC,kBAAkB,UAAnB;EAA4B,OAAO;YAAnC,CACE,qBAAC,MAAD;GAAM,MAAM,WAAW;aAAvB,CACG,QACD,oBAAC,OAAD,EAAO,EACF;MACN,SAC0B"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
5
|
|
|
5
6
|
//#region src/core/components/spacing.tsx
|
|
6
7
|
/**
|
|
7
8
|
* A simple component that renders two horizontal breaks to create vertical spacing between elements.
|
|
8
9
|
*/
|
|
9
10
|
function Spacing({ scale = 1 }) {
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</>}
|
|
15
|
-
</_alloy_js_core.For>;
|
|
11
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
12
|
+
each: Array.from({ length: scale }),
|
|
13
|
+
children: (_) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
|
|
14
|
+
});
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
//#endregion
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { For } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
|
|
3
4
|
//#region src/core/components/spacing.tsx
|
|
4
5
|
/**
|
|
5
6
|
* A simple component that renders two horizontal breaks to create vertical spacing between elements.
|
|
6
7
|
*/
|
|
7
8
|
function Spacing({ scale = 1 }) {
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</>}
|
|
13
|
-
</For>;
|
|
9
|
+
return /* @__PURE__ */ jsx(For, {
|
|
10
|
+
each: Array.from({ length: scale }),
|
|
11
|
+
children: (_) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hbr", {}), /* @__PURE__ */ jsx("hbr", {})] })
|
|
12
|
+
});
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.mjs","names":[],"sources":["../../../src/core/components/spacing.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\n\nexport interface SpacingProps {\n /**\n * A scale factor that determines the amount of vertical space to be added.\n *\n * @remarks\n * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.\n *\n * @defaultValue 1\n */\n scale?: number;\n}\n\n/**\n * A simple component that renders two horizontal breaks to create vertical spacing between elements.\n */\nexport function Spacing({ scale = 1 }: SpacingProps) {\n return (\n <For each={Array.from({ length: scale })}>\n {_ => (\n <>\n <hbr />\n <hbr />\n </>\n )}\n </For>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"spacing.mjs","names":[],"sources":["../../../src/core/components/spacing.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\n\nexport interface SpacingProps {\n /**\n * A scale factor that determines the amount of vertical space to be added.\n *\n * @remarks\n * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.\n *\n * @defaultValue 1\n */\n scale?: number;\n}\n\n/**\n * A simple component that renders two horizontal breaks to create vertical spacing between elements.\n */\nexport function Spacing({ scale = 1 }: SpacingProps) {\n return (\n <For each={Array.from({ length: scale })}>\n {_ => (\n <>\n <hbr />\n <hbr />\n </>\n )}\n </For>\n );\n}\n"],"mappings":";;;;;;;AAmCA,SAAgB,QAAQ,EAAE,QAAQ,KAAmB;AACnD,QACE,oBAAC,KAAD;EAAK,MAAM,MAAM,KAAK,EAAE,QAAQ,OAAO,CAAC;aACrC,MACC,4CACE,oBAAC,OAAD,EAAO,GACP,oBAAC,OAAD,EAAO,EACN;EAED"}
|
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let _alloy_js_rollup_plugin = require("@alloy-js/rollup-plugin");
|
|
4
4
|
_alloy_js_rollup_plugin = require_runtime.__toESM(_alloy_js_rollup_plugin);
|
|
5
|
+
let _powerlines_plugin_babel_helpers = require("@powerlines/plugin-babel/helpers");
|
|
5
6
|
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
6
7
|
|
|
7
8
|
//#region src/index.tsx
|
|
@@ -39,6 +40,10 @@ const plugin = (options = {}) => {
|
|
|
39
40
|
if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
|
|
40
41
|
await this.fs.write(this.tsconfig.tsconfigFilePath, _stryke_json_storm_json.StormJSON.stringify(this.tsconfig.tsconfigJson));
|
|
41
42
|
}
|
|
43
|
+
if (this.config.babel && (!this.config.babel.plugins || !(0, _powerlines_plugin_babel_helpers.isDuplicatePlugin)(this.config.babel.plugins, "@babel/plugin-syntax-jsx"))) {
|
|
44
|
+
this.config.babel.plugins ??= [];
|
|
45
|
+
this.config.babel.plugins.push("@babel/plugin-syntax-jsx");
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
}];
|
|
44
49
|
};
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAyBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;cAUC,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KAuEJ,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAyBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;cAUC,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KAuEJ,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import rollupPlugin from "@alloy-js/rollup-plugin";
|
|
2
|
+
import { isDuplicatePlugin } from "@powerlines/plugin-babel/helpers";
|
|
2
3
|
import { StormJSON } from "@stryke/json/storm-json";
|
|
3
4
|
|
|
4
5
|
//#region src/index.tsx
|
|
@@ -36,6 +37,10 @@ const plugin = (options = {}) => {
|
|
|
36
37
|
if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
|
|
37
38
|
await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
|
|
38
39
|
}
|
|
40
|
+
if (this.config.babel && (!this.config.babel.plugins || !isDuplicatePlugin(this.config.babel.plugins, "@babel/plugin-syntax-jsx"))) {
|
|
41
|
+
this.config.babel.plugins ??= [];
|
|
42
|
+
this.config.babel.plugins.push("@babel/plugin-syntax-jsx");
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
}];
|
|
41
46
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport rollupPlugin from \"@alloy-js/rollup-plugin\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n resolve: {\n external: [/^@alloy-js\\//]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: {\n runtime: \"automatic\",\n importSource: \"@alloy-js/core\"\n }\n }\n },\n plugins: [rollupPlugin()]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n if (\n this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"react-jsx\" ||\n this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n\n if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== \"react-jsx\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"react-jsx\";\n }\n\n if (\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n \"@alloy-js/core\";\n }\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport rollupPlugin from \"@alloy-js/rollup-plugin\";\nimport { isDuplicatePlugin } from \"@powerlines/plugin-babel/helpers\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n resolve: {\n external: [/^@alloy-js\\//]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: {\n runtime: \"automatic\",\n importSource: \"@alloy-js/core\"\n }\n }\n },\n plugins: [rollupPlugin()]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n if (\n this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"react-jsx\" ||\n this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n\n if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== \"react-jsx\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"react-jsx\";\n }\n\n if (\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n \"@alloy-js/core\";\n }\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n\n if (\n this.config.babel &&\n (!this.config.babel.plugins ||\n !isDuplicatePlugin(\n this.config.babel.plugins,\n \"@babel/plugin-syntax-jsx\"\n ))\n ) {\n this.config.babel.plugins ??= [];\n this.config.babel.plugins.push(\"@babel/plugin-syntax-jsx\");\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAoCA,MAAa,UAGX,UAA8B,EAAE,KAC7B;AACH,QAAO,CACL;EACE,MAAM;EACN,SAAS;AACP,QAAK,MACH,6DACD;AAED,UAAO;IACL,OAAO;KACL,YAAY;KACZ,GAAG;KACJ;IACD,SAAS,EACP,UAAU,CAAC,eAAe,EAC3B;IACD,QAAQ;KACN,cAAc,EACZ,WAAW,EACT,KAAK;MACH,SAAS;MACT,cAAc;MACf,EACF,EACF;KACD,SAAS,CAAC,cAAc,CAAC;KAC1B;IACF;;EAEH,MAAM,iBAAiB;AACrB,QAAK,MAAM,4DAA4D;AACvE,OACE,KAAK,SAAS,aAAa,iBAAiB,QAAQ,eACpD,KAAK,SAAS,aAAa,iBAAiB,oBAC1C,kBACF;AACA,SAAK,SAAS,aAAa,oBAAoB,EAAE;AAEjD,QAAI,KAAK,SAAS,aAAa,gBAAgB,QAAQ,YACrD,MAAK,SAAS,aAAa,gBAAgB,MAAM;AAGnD,QACE,KAAK,SAAS,aAAa,gBAAgB,oBAC3C,iBAEA,MAAK,SAAS,aAAa,gBAAgB,kBACzC;AAGJ,UAAM,KAAK,GAAG,MACZ,KAAK,SAAS,kBACd,UAAU,UAAU,KAAK,SAAS,aAAa,CAChD;;AAGH,OACE,KAAK,OAAO,UACX,CAAC,KAAK,OAAO,MAAM,WAClB,CAAC,kBACC,KAAK,OAAO,MAAM,SAClB,2BACD,GACH;AACA,SAAK,OAAO,MAAM,YAAY,EAAE;AAChC,SAAK,OAAO,MAAM,QAAQ,KAAK,2BAA2B;;;EAG/D,CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
5
|
|
|
5
6
|
//#region src/markdown/components/front-matter.tsx
|
|
6
7
|
/**
|
|
@@ -9,15 +10,17 @@ let _alloy_js_core = require("@alloy-js/core");
|
|
|
9
10
|
* @see https://jekyllrb.com/docs/front-matter/
|
|
10
11
|
*/
|
|
11
12
|
function FrontMatter(props) {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
14
|
+
"---",
|
|
15
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
16
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
17
|
+
each: Object.entries(props.data),
|
|
18
|
+
hardline: true,
|
|
19
|
+
children: ([key, value]) => _alloy_js_core.code`${key}: ${JSON.stringify(value)}`
|
|
20
|
+
}),
|
|
21
|
+
"---",
|
|
22
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
23
|
+
] });
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { For, code } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
|
|
3
4
|
//#region src/markdown/components/front-matter.tsx
|
|
4
5
|
/**
|
|
@@ -7,15 +8,17 @@ import { For, code } from "@alloy-js/core";
|
|
|
7
8
|
* @see https://jekyllrb.com/docs/front-matter/
|
|
8
9
|
*/
|
|
9
10
|
function FrontMatter(props) {
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
"---",
|
|
13
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
14
|
+
/* @__PURE__ */ jsx(For, {
|
|
15
|
+
each: Object.entries(props.data),
|
|
16
|
+
hardline: true,
|
|
17
|
+
children: ([key, value]) => code`${key}: ${JSON.stringify(value)}`
|
|
18
|
+
}),
|
|
19
|
+
"---",
|
|
20
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
21
|
+
] });
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-matter.mjs","names":[],"sources":["../../../src/markdown/components/front-matter.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"front-matter.mjs","names":[],"sources":["../../../src/markdown/components/front-matter.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;AA6BA,SAAgB,YAAY,OAAyB;AACnD,QACE;EACG;EACD,oBAAC,OAAD,EAAO;EACP,oBAAC,KAAD;GAAK,MAAM,OAAO,QAAQ,MAAM,KAAK;GAAE;cACnC,CAAC,KAAK,WAAW,IAAI,GAAG,IAAI,IAAI,KAAK,UAAU,MAAM;GACnD;EACL;EACD,oBAAC,OAAD,EAAO;EACN"}
|
|
@@ -5,6 +5,7 @@ const require_core_components_single_line_comment = require('../../core/componen
|
|
|
5
5
|
const require_core_components_source_file = require('../../core/components/source-file.cjs');
|
|
6
6
|
const require_markdown_components_front_matter = require('./front-matter.cjs');
|
|
7
7
|
let _alloy_js_core = require("@alloy-js/core");
|
|
8
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
9
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
9
10
|
let powerlines_utils = require("powerlines/utils");
|
|
10
11
|
let _alloy_js_markdown = require("@alloy-js/markdown");
|
|
@@ -23,9 +24,17 @@ function MarkdownFile(props) {
|
|
|
23
24
|
"storage",
|
|
24
25
|
"frontMatter"
|
|
25
26
|
]);
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_source_file.SourceFile, {
|
|
28
|
+
header: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(MarkdownFileHeader, { frontMatter }),
|
|
29
|
+
...rest,
|
|
30
|
+
filetype: "md",
|
|
31
|
+
reference: _alloy_js_markdown.Link,
|
|
32
|
+
storage,
|
|
33
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
34
|
+
when: Boolean(children),
|
|
35
|
+
children
|
|
36
|
+
})
|
|
37
|
+
});
|
|
29
38
|
}
|
|
30
39
|
/**
|
|
31
40
|
* Renders the header for a Powerlines Typescript source file.
|
|
@@ -42,44 +51,51 @@ function MarkdownFileHeader(props) {
|
|
|
42
51
|
"frontMatter"
|
|
43
52
|
]);
|
|
44
53
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
54
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
56
|
+
when: (0, _stryke_type_checks.isSetObject)(frontMatter) && Object.keys(frontMatter).length > 0,
|
|
57
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_markdown_components_front_matter.FrontMatter, { data: frontMatter })
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
60
|
+
when: Boolean(disableEslint),
|
|
61
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
62
|
+
variant: "markdown",
|
|
63
|
+
children: "eslint-disable"
|
|
64
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
67
|
+
when: Boolean(disablePrettier),
|
|
68
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
69
|
+
variant: "markdown",
|
|
70
|
+
children: "prettier-ignore"
|
|
71
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
74
|
+
when: Boolean(disableBiome),
|
|
75
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
76
|
+
variant: "markdown",
|
|
77
|
+
children: "biome-ignore lint: disable"
|
|
78
|
+
}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
81
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
82
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
85
|
+
when: Boolean(children),
|
|
86
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
89
|
+
variant: "markdown",
|
|
90
|
+
children: `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
93
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
94
|
+
variant: "markdown",
|
|
95
|
+
children: (0, powerlines_utils.getFileHeaderWarning)(context)
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
98
|
+
] });
|
|
83
99
|
}
|
|
84
100
|
|
|
85
101
|
//#endregion
|