@powerlines/plugin-alloy 0.18.112 → 0.18.114
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.d.mts +2 -2
- package/dist/core/components/single-line-comment.d.cts +2 -2
- package/dist/core/components/source-file.d.cts +2 -2
- package/dist/core/components/source-file.d.mts +2 -2
- package/dist/deepkit/src/utilities.cjs +114 -0
- package/dist/deepkit/src/utilities.mjs +110 -0
- package/dist/helpers/capnp.cjs +10 -10
- package/dist/helpers/capnp.mjs +6 -6
- package/dist/helpers/typescript.cjs +2 -2
- package/dist/helpers/typescript.mjs +1 -1
- package/dist/index.cjs +5 -7
- package/dist/index.mjs +5 -6
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +6 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +6 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +4 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +5 -0
- package/dist/plugin-babel/src/helpers/options.cjs +49 -0
- package/dist/plugin-babel/src/helpers/options.mjs +46 -0
- package/dist/plugin-babel/src/index.cjs +83 -0
- package/dist/plugin-babel/src/index.mjs +81 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +1 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +2 -0
- package/dist/powerlines/src/lib/logger.cjs +9 -0
- package/dist/powerlines/src/lib/logger.mjs +9 -0
- 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/commands.d.mts +1 -0
- package/dist/powerlines/src/types/config.d.mts +2 -2
- package/dist/powerlines/src/types/unplugin.d.mts +1 -0
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
- package/dist/typescript/components/entry-file.d.cts +2 -2
- package/dist/typescript/components/entry-file.d.mts +2 -2
- package/dist/typescript/components/tsdoc-reflection.cjs +2 -2
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
- package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
- package/dist/typescript/components/tsdoc-reflection.mjs +2 -2
- package/dist/typescript/components/tsdoc.cjs +3 -3
- package/dist/typescript/components/tsdoc.d.mts +1 -1
- package/dist/typescript/components/tsdoc.mjs +2 -2
- package/dist/typescript/components/typescript-file.cjs +1 -1
- package/dist/typescript/components/typescript-file.mjs +1 -1
- package/dist/typescript/components/typescript-interface.cjs +2 -2
- package/dist/typescript/components/typescript-interface.d.cts +3 -3
- package/dist/typescript/components/typescript-interface.d.mts +4 -4
- package/dist/typescript/components/typescript-interface.mjs +2 -2
- package/dist/typescript/components/typescript-object.cjs +3 -3
- package/dist/typescript/components/typescript-object.d.cts +3 -3
- package/dist/typescript/components/typescript-object.d.mts +1 -1
- package/dist/typescript/components/typescript-object.mjs +2 -2
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluginContext } from "../../powerlines/src/types/context.mjs";
|
|
2
2
|
import { MetaItem } from "../contexts/context.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core16 from "@alloy-js/core";
|
|
4
4
|
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/output.d.ts
|
|
@@ -17,7 +17,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext, TMeta exte
|
|
|
17
17
|
/**
|
|
18
18
|
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
19
19
|
*/
|
|
20
|
-
declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>):
|
|
20
|
+
declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core16.Children;
|
|
21
21
|
declare type __ΩOutputProps = any[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { Output, OutputProps, __ΩOutputProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core13 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/core/components/single-line-comment.d.ts
|
|
5
5
|
type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown";
|
|
@@ -15,7 +15,7 @@ interface SingleLineCommentProps extends ComponentProps {
|
|
|
15
15
|
* A single line comment block. The children are rendered as a prose element, which means that they
|
|
16
16
|
* are broken into multiple lines
|
|
17
17
|
*/
|
|
18
|
-
declare function SingleLineComment(props: SingleLineCommentProps):
|
|
18
|
+
declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core13.Children;
|
|
19
19
|
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
20
|
declare type __ΩSingleLineCommentProps = any[];
|
|
21
21
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoragePreset } from "../../powerlines/src/types/fs.cjs";
|
|
2
2
|
import { ComponentProps } from "../../types/components.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core4 from "@alloy-js/core";
|
|
4
4
|
import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/source-file.d.ts
|
|
@@ -26,7 +26,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
|
26
26
|
* @param props - The properties for the source file.
|
|
27
27
|
* @returns The rendered source file component.
|
|
28
28
|
*/
|
|
29
|
-
declare function SourceFile(props: SourceFileProps):
|
|
29
|
+
declare function SourceFile(props: SourceFileProps): _alloy_js_core4.Children;
|
|
30
30
|
declare type __ΩSourceFileProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoragePreset } from "../../powerlines/src/types/fs.mjs";
|
|
2
2
|
import { ComponentProps } from "../../types/components.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core12 from "@alloy-js/core";
|
|
4
4
|
import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/source-file.d.ts
|
|
@@ -26,7 +26,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
|
26
26
|
* @param props - The properties for the source file.
|
|
27
27
|
* @returns The rendered source file component.
|
|
28
28
|
*/
|
|
29
|
-
declare function SourceFile(props: SourceFileProps):
|
|
29
|
+
declare function SourceFile(props: SourceFileProps): _alloy_js_core12.Children;
|
|
30
30
|
declare type __ΩSourceFileProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
3
|
+
let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
4
|
+
let __stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
5
|
+
let __stryke_type_checks = require("@stryke/type-checks");
|
|
6
|
+
let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
7
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
8
|
+
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
9
|
+
|
|
10
|
+
//#region ../deepkit/src/utilities.ts
|
|
11
|
+
/**
|
|
12
|
+
* Converts any {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind}'s value to string representation.
|
|
13
|
+
*
|
|
14
|
+
* @param property - The {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind} containing the value to stringify.
|
|
15
|
+
* @param value - The value to stringify.
|
|
16
|
+
* @returns A string representation of the value.
|
|
17
|
+
*/
|
|
18
|
+
function stringifyDefaultValue(property, value) {
|
|
19
|
+
return (0, __stryke_type_checks.isSetObject)(property) ? stringifyValue(property.type, value ?? property.getDefaultValue()) : stringifyValue({ kind: property }, value);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Stringifies a value as a string.
|
|
23
|
+
*
|
|
24
|
+
* @param value - The value to stringify.
|
|
25
|
+
* @returns A string representation of the value.
|
|
26
|
+
*/
|
|
27
|
+
function stringifyStringValue(value) {
|
|
28
|
+
return `"${String(value).replaceAll("\"", "\\\"")}"`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Converts any {@link Type}'s actual value to string representation.
|
|
32
|
+
*
|
|
33
|
+
* @param type - The {@link Type} of the value to stringify.
|
|
34
|
+
* @param value - The value to stringify.
|
|
35
|
+
* @returns A string representation of the value.
|
|
36
|
+
*/
|
|
37
|
+
function stringifyValue(type, value) {
|
|
38
|
+
return (0, __stryke_type_checks_is_undefined.isUndefined)(value) ? "undefined" : (0, __stryke_type_checks_is_null.isNull)(value) ? "null" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && (0, __stryke_type_checks_is_string.isString)(type.literal) ? stringifyStringValue(value) : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum ? getEnumReflectionType(type).kind === __powerlines_deepkit_vendor_type.ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union ? isStringUnion(type) ? stringifyStringValue(value) : `${String(value)}` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array ? stringifyStringValue(__stryke_json_storm_json.StormJSON.stringify(value)) : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.object || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral ? __stryke_json_storm_json.StormJSON.stringify(value) : (type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.property || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.parameter) && type.type?.kind ? stringifyValue(type.type, value) : String(value)?.includes("\"") || String(value)?.includes("'") ? stringifyStringValue(value) : String(value);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Converts a {@link TypeEnum} to its underlying primitive type representation.
|
|
42
|
+
*
|
|
43
|
+
* @param type - The {@link TypeEnum} to evaluate.
|
|
44
|
+
* @returns A string representation of the primitive type.
|
|
45
|
+
*/
|
|
46
|
+
function getEnumReflectionType(type) {
|
|
47
|
+
if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
|
|
48
|
+
const unique = (0, __stryke_helpers_get_unique.getUniqueBy)(type.values.filter((value) => value !== void 0 && value !== null), (enumMember) => (0, __stryke_type_checks_is_string.isString)(enumMember) ? { kind: __powerlines_deepkit_vendor_type.ReflectionKind.string } : { kind: __powerlines_deepkit_vendor_type.ReflectionKind.number });
|
|
49
|
+
if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
|
|
50
|
+
return unique[0] && (0, __stryke_type_checks_is_string.isString)(unique[0]) ? { kind: __powerlines_deepkit_vendor_type.ReflectionKind.string } : { kind: __powerlines_deepkit_vendor_type.ReflectionKind.number };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Converts a {@link TypeUnion} to its underlying primitive type representation.
|
|
54
|
+
*
|
|
55
|
+
* @param type - The {@link TypeUnion} to evaluate.
|
|
56
|
+
* @returns A string representation of the primitive type.
|
|
57
|
+
*/
|
|
58
|
+
function getUnionTypes(type) {
|
|
59
|
+
if (type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union && type.types.length > 0) return (0, __stryke_helpers_get_unique.getUniqueBy)(type.types, (member) => member.kind);
|
|
60
|
+
throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
|
|
61
|
+
}
|
|
62
|
+
function isStringUnion(type) {
|
|
63
|
+
return getUnionTypes(type).some((member) => member.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || member.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && (0, __stryke_type_checks_is_string.isString)(member.literal));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Converts a ReflectionKind to its string representation.
|
|
67
|
+
*
|
|
68
|
+
* @param kind - The {@link ReflectionKind} to convert.
|
|
69
|
+
* @returns A string representation of the kind.
|
|
70
|
+
*/
|
|
71
|
+
function kindToName(kind) {
|
|
72
|
+
if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.void) return "void";
|
|
73
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.never) return "never";
|
|
74
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.null) return "null";
|
|
75
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.undefined) return "undefined";
|
|
76
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.symbol) return "symbol";
|
|
77
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.bigint) return "bigint";
|
|
78
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) return "number";
|
|
79
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.string) return "string";
|
|
80
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean) return "boolean";
|
|
81
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal) return "literal";
|
|
82
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.class) return "class";
|
|
83
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.array) return "array";
|
|
84
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.object) return "object";
|
|
85
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral) return "objectLiteral";
|
|
86
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.union) return "union";
|
|
87
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum) return "enum";
|
|
88
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.regexp) return "regexp";
|
|
89
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.templateLiteral) return "templateLiteral";
|
|
90
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.property) return "property";
|
|
91
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.method) return "method";
|
|
92
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.function) return "function";
|
|
93
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.parameter) return "parameter";
|
|
94
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.promise) return "promise";
|
|
95
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.typeParameter) return "typeParameter";
|
|
96
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.tuple) return "tuple";
|
|
97
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.tupleMember) return "tupleMember";
|
|
98
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.enumMember) return "enumMember";
|
|
99
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.rest) return "rest";
|
|
100
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.indexSignature) return "indexSignature";
|
|
101
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.propertySignature) return "propertySignature";
|
|
102
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.methodSignature) return "methodSignature";
|
|
103
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.infer) return "infer";
|
|
104
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.callSignature) return "callSignature";
|
|
105
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.any) return "any";
|
|
106
|
+
else if (kind === __powerlines_deepkit_vendor_type.ReflectionKind.intersection) return "intersection";
|
|
107
|
+
return "unknown";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
exports.getUnionTypes = getUnionTypes;
|
|
112
|
+
exports.kindToName = kindToName;
|
|
113
|
+
exports.stringifyDefaultValue = stringifyDefaultValue;
|
|
114
|
+
exports.stringifyValue = stringifyValue;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
2
|
+
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
3
|
+
import { StormJSON } from "@stryke/json/storm-json";
|
|
4
|
+
import { isSetObject } from "@stryke/type-checks";
|
|
5
|
+
import { isNull } from "@stryke/type-checks/is-null";
|
|
6
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
7
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
8
|
+
|
|
9
|
+
//#region ../deepkit/src/utilities.ts
|
|
10
|
+
/**
|
|
11
|
+
* Converts any {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind}'s value to string representation.
|
|
12
|
+
*
|
|
13
|
+
* @param property - The {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind} containing the value to stringify.
|
|
14
|
+
* @param value - The value to stringify.
|
|
15
|
+
* @returns A string representation of the value.
|
|
16
|
+
*/
|
|
17
|
+
function stringifyDefaultValue(property, value) {
|
|
18
|
+
return isSetObject(property) ? stringifyValue(property.type, value ?? property.getDefaultValue()) : stringifyValue({ kind: property }, value);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Stringifies a value as a string.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to stringify.
|
|
24
|
+
* @returns A string representation of the value.
|
|
25
|
+
*/
|
|
26
|
+
function stringifyStringValue(value) {
|
|
27
|
+
return `"${String(value).replaceAll("\"", "\\\"")}"`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Converts any {@link Type}'s actual value to string representation.
|
|
31
|
+
*
|
|
32
|
+
* @param type - The {@link Type} of the value to stringify.
|
|
33
|
+
* @param value - The value to stringify.
|
|
34
|
+
* @returns A string representation of the value.
|
|
35
|
+
*/
|
|
36
|
+
function stringifyValue(type, value) {
|
|
37
|
+
return isUndefined(value) ? "undefined" : isNull(value) ? "null" : type.kind === ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type.kind === ReflectionKind.string || type.kind === ReflectionKind.literal && isString(type.literal) ? stringifyStringValue(value) : type.kind === ReflectionKind.enum ? getEnumReflectionType(type).kind === ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type.kind === ReflectionKind.union ? isStringUnion(type) ? stringifyStringValue(value) : `${String(value)}` : type.kind === ReflectionKind.array ? stringifyStringValue(StormJSON.stringify(value)) : type.kind === ReflectionKind.object || type.kind === ReflectionKind.objectLiteral ? StormJSON.stringify(value) : (type.kind === ReflectionKind.property || type.kind === ReflectionKind.parameter) && type.type?.kind ? stringifyValue(type.type, value) : String(value)?.includes("\"") || String(value)?.includes("'") ? stringifyStringValue(value) : String(value);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Converts a {@link TypeEnum} to its underlying primitive type representation.
|
|
41
|
+
*
|
|
42
|
+
* @param type - The {@link TypeEnum} to evaluate.
|
|
43
|
+
* @returns A string representation of the primitive type.
|
|
44
|
+
*/
|
|
45
|
+
function getEnumReflectionType(type) {
|
|
46
|
+
if (type.kind !== ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
|
|
47
|
+
const unique = getUniqueBy(type.values.filter((value) => value !== void 0 && value !== null), (enumMember) => isString(enumMember) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number });
|
|
48
|
+
if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
|
|
49
|
+
return unique[0] && isString(unique[0]) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Converts a {@link TypeUnion} to its underlying primitive type representation.
|
|
53
|
+
*
|
|
54
|
+
* @param type - The {@link TypeUnion} to evaluate.
|
|
55
|
+
* @returns A string representation of the primitive type.
|
|
56
|
+
*/
|
|
57
|
+
function getUnionTypes(type) {
|
|
58
|
+
if (type.kind === ReflectionKind.union && type.types.length > 0) return getUniqueBy(type.types, (member) => member.kind);
|
|
59
|
+
throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
|
|
60
|
+
}
|
|
61
|
+
function isStringUnion(type) {
|
|
62
|
+
return getUnionTypes(type).some((member) => member.kind === ReflectionKind.string || member.kind === ReflectionKind.literal && isString(member.literal));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Converts a ReflectionKind to its string representation.
|
|
66
|
+
*
|
|
67
|
+
* @param kind - The {@link ReflectionKind} to convert.
|
|
68
|
+
* @returns A string representation of the kind.
|
|
69
|
+
*/
|
|
70
|
+
function kindToName(kind) {
|
|
71
|
+
if (kind === ReflectionKind.void) return "void";
|
|
72
|
+
else if (kind === ReflectionKind.never) return "never";
|
|
73
|
+
else if (kind === ReflectionKind.null) return "null";
|
|
74
|
+
else if (kind === ReflectionKind.undefined) return "undefined";
|
|
75
|
+
else if (kind === ReflectionKind.symbol) return "symbol";
|
|
76
|
+
else if (kind === ReflectionKind.bigint) return "bigint";
|
|
77
|
+
else if (kind === ReflectionKind.number) return "number";
|
|
78
|
+
else if (kind === ReflectionKind.string) return "string";
|
|
79
|
+
else if (kind === ReflectionKind.boolean) return "boolean";
|
|
80
|
+
else if (kind === ReflectionKind.literal) return "literal";
|
|
81
|
+
else if (kind === ReflectionKind.class) return "class";
|
|
82
|
+
else if (kind === ReflectionKind.array) return "array";
|
|
83
|
+
else if (kind === ReflectionKind.object) return "object";
|
|
84
|
+
else if (kind === ReflectionKind.objectLiteral) return "objectLiteral";
|
|
85
|
+
else if (kind === ReflectionKind.union) return "union";
|
|
86
|
+
else if (kind === ReflectionKind.enum) return "enum";
|
|
87
|
+
else if (kind === ReflectionKind.regexp) return "regexp";
|
|
88
|
+
else if (kind === ReflectionKind.templateLiteral) return "templateLiteral";
|
|
89
|
+
else if (kind === ReflectionKind.property) return "property";
|
|
90
|
+
else if (kind === ReflectionKind.method) return "method";
|
|
91
|
+
else if (kind === ReflectionKind.function) return "function";
|
|
92
|
+
else if (kind === ReflectionKind.parameter) return "parameter";
|
|
93
|
+
else if (kind === ReflectionKind.promise) return "promise";
|
|
94
|
+
else if (kind === ReflectionKind.typeParameter) return "typeParameter";
|
|
95
|
+
else if (kind === ReflectionKind.tuple) return "tuple";
|
|
96
|
+
else if (kind === ReflectionKind.tupleMember) return "tupleMember";
|
|
97
|
+
else if (kind === ReflectionKind.enumMember) return "enumMember";
|
|
98
|
+
else if (kind === ReflectionKind.rest) return "rest";
|
|
99
|
+
else if (kind === ReflectionKind.indexSignature) return "indexSignature";
|
|
100
|
+
else if (kind === ReflectionKind.propertySignature) return "propertySignature";
|
|
101
|
+
else if (kind === ReflectionKind.methodSignature) return "methodSignature";
|
|
102
|
+
else if (kind === ReflectionKind.infer) return "infer";
|
|
103
|
+
else if (kind === ReflectionKind.callSignature) return "callSignature";
|
|
104
|
+
else if (kind === ReflectionKind.any) return "any";
|
|
105
|
+
else if (kind === ReflectionKind.intersection) return "intersection";
|
|
106
|
+
return "unknown";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { getUnionTypes, kindToName, stringifyDefaultValue, stringifyValue };
|
package/dist/helpers/capnp.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
|
|
2
|
+
const require_utilities = require('../deepkit/src/utilities.cjs');
|
|
3
|
+
const require_file_header = require('../powerlines/src/lib/utilities/file-header.cjs');
|
|
4
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
5
|
+
let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
6
|
+
let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
7
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
3
8
|
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
4
9
|
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
6
10
|
let defu = require("defu");
|
|
7
11
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
8
|
-
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
9
12
|
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
10
13
|
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
11
14
|
let __powerlines_deepkit_vendor_core = require("@powerlines/deepkit/vendor/core");
|
|
12
15
|
let __stryke_capnp_compile = require("@stryke/capnp/compile");
|
|
13
16
|
let __stryke_capnp_helpers = require("@stryke/capnp/helpers");
|
|
14
17
|
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
15
|
-
let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
16
18
|
let __stryke_json = require("@stryke/json");
|
|
17
19
|
let __stryke_path_join = require("@stryke/path/join");
|
|
18
20
|
let __stryke_string_format_get_words = require("@stryke/string-format/get-words");
|
|
19
21
|
let __stryke_type_checks_is_bigint = require("@stryke/type-checks/is-bigint");
|
|
20
|
-
let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
21
22
|
let __stryke_type_checks_is_number = require("@stryke/type-checks/is-number");
|
|
22
23
|
let node_buffer = require("node:buffer");
|
|
23
24
|
let node_child_process = require("node:child_process");
|
|
24
25
|
let node_util = require("node:util");
|
|
25
|
-
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
26
26
|
|
|
27
27
|
//#region src/helpers/capnp.ts
|
|
28
28
|
/**
|
|
@@ -95,7 +95,7 @@ function isVoidType(type) {
|
|
|
95
95
|
* @returns A string representation of the Cap'n Proto primitive type.
|
|
96
96
|
*/
|
|
97
97
|
function getCapnpUnionTypes(type) {
|
|
98
|
-
return
|
|
98
|
+
return require_utilities.getUnionTypes(type);
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
|
|
@@ -118,7 +118,7 @@ async function generateCapnpId() {
|
|
|
118
118
|
}
|
|
119
119
|
async function generateCapnp(context, reflection, options) {
|
|
120
120
|
return `${(await generateCapnpId()).trim()};
|
|
121
|
-
${
|
|
121
|
+
${require_file_header.getBaseFileHeader(context).replace(/^\r*\n*/g, "").replaceAll("//", "#")}
|
|
122
122
|
${reflection.getMethods().length === 0 ? generateCapnpStruct(reflection, options) : generateCapnpInterface(reflection, options)}
|
|
123
123
|
`.trim();
|
|
124
124
|
}
|
|
@@ -187,7 +187,7 @@ function generateCapnpMethodSchema(reflection, indexCounter) {
|
|
|
187
187
|
if (!methodName) throw new Error(`Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`);
|
|
188
188
|
return `${(0, __stryke_string_format_camel_case.camelCase)(methodName)} @${indexCounter()} (${reflection.getParameters().map((param) => {
|
|
189
189
|
return `${(0, __stryke_string_format_camel_case.camelCase)(param.getName())} :${generateCapnpPrimitive(param.getType())}${param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : ""}`;
|
|
190
|
-
}).join(", ")})${isVoidType(reflection.getReturnType()) ? "" : ` -> (${
|
|
190
|
+
}).join(", ")})${isVoidType(reflection.getReturnType()) ? "" : ` -> (${require_utilities.kindToName(reflection.getReturnType().kind)}: ${generateCapnpPrimitive(reflection.getReturnType())})`}; # ${(reflection.getDescription() || `The ${(0, __stryke_string_format_title_case.titleCase)(reflection.reflectionClass.getTitle() || reflection.reflectionClass.getName())} interface ${(0, __stryke_string_format_title_case.titleCase)(methodName)} method.`).replaceAll("\n", ". ")}`;
|
|
191
191
|
}
|
|
192
192
|
function generateCapnpPropertyComment(reflection) {
|
|
193
193
|
const result = (0, __stryke_string_format_get_words.getWords)(reflection.getDescription() || `A schema property for ${(0, __stryke_string_format_title_case.titleCase)(reflection.getTitle() || reflection.getNameAsString())} field.`, { relaxed: true }).reduce((ret, word) => {
|
|
@@ -207,7 +207,7 @@ ${generateCapnpPropertyComment(reflection)}`;
|
|
|
207
207
|
else if (getCapnpUnionTypes(reflection.type).filter((type) => type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && ((0, __stryke_type_checks_is_string.isString)(type.literal) || (0, __stryke_type_checks_is_number.isNumber)(type.literal))).length === 1) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(reflection.getNameAsString())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
|
|
208
208
|
${generateCapnpPropertyComment(reflection)}`;
|
|
209
209
|
else return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} :union {
|
|
210
|
-
${getCapnpUnionTypes(reflection.type).map((type) => ` ${
|
|
210
|
+
${getCapnpUnionTypes(reflection.type).map((type) => ` ${require_utilities.kindToName(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(type)};`).join("\n")}
|
|
211
211
|
}
|
|
212
212
|
${generateCapnpPropertyComment(reflection)}`;
|
|
213
213
|
else if (reflection.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
|
package/dist/helpers/capnp.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { getUnionTypes, kindToName } from "
|
|
1
|
+
import { getUnionTypes, kindToName } from "../deepkit/src/utilities.mjs";
|
|
2
|
+
import { getBaseFileHeader } from "../powerlines/src/lib/utilities/file-header.mjs";
|
|
3
|
+
import { ReflectionKind, memberNameToString } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
5
|
+
import { isNull } from "@stryke/type-checks/is-null";
|
|
6
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
2
7
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
3
8
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
4
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
5
9
|
import defu from "defu";
|
|
6
|
-
import { ReflectionKind, memberNameToString } from "@powerlines/deepkit/vendor/type";
|
|
7
10
|
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
8
11
|
import { camelCase } from "@stryke/string-format/camel-case";
|
|
9
12
|
import { getClassName } from "@powerlines/deepkit/vendor/core";
|
|
10
13
|
import { capnpc } from "@stryke/capnp/compile";
|
|
11
14
|
import { resolveOptions } from "@stryke/capnp/helpers";
|
|
12
15
|
import { toArray } from "@stryke/convert/to-array";
|
|
13
|
-
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
14
16
|
import { StormJSON } from "@stryke/json";
|
|
15
17
|
import { joinPaths } from "@stryke/path/join";
|
|
16
18
|
import { getWords } from "@stryke/string-format/get-words";
|
|
17
19
|
import { isBigInt } from "@stryke/type-checks/is-bigint";
|
|
18
|
-
import { isNull } from "@stryke/type-checks/is-null";
|
|
19
20
|
import { isNumber } from "@stryke/type-checks/is-number";
|
|
20
21
|
import { Buffer } from "node:buffer";
|
|
21
22
|
import { exec } from "node:child_process";
|
|
22
23
|
import { promisify } from "node:util";
|
|
23
|
-
import { getBaseFileHeader } from "powerlines/lib/utilities/file-header";
|
|
24
24
|
|
|
25
25
|
//#region src/helpers/capnp.ts
|
|
26
26
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
|
|
2
|
+
const require_utilities = require('../deepkit/src/utilities.cjs');
|
|
3
3
|
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
4
4
|
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
5
|
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
@@ -34,7 +34,7 @@ export const ${(0, __stryke_string_format_camel_case.camelCase)(options.override
|
|
|
34
34
|
* @ignored` : ""}${item.isHidden() ? `
|
|
35
35
|
* @hidden` : ""}
|
|
36
36
|
*/
|
|
37
|
-
${item.getNameAsString()}: ${
|
|
37
|
+
${item.getNameAsString()}: ${require_utilities.stringifyValue(item.getType(), options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
38
38
|
if ((0, __stryke_type_checks_is_undefined.isUndefined)(ret) && !(0, __stryke_type_checks_is_undefined.isUndefined)(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
|
|
39
39
|
return ret;
|
|
40
40
|
}, void 0) ?? item.getDefaultValue())}`).join(", \n")}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stringifyValue } from "
|
|
1
|
+
import { stringifyValue } from "../deepkit/src/utilities.mjs";
|
|
2
2
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
3
3
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
4
4
|
import { camelCase } from "@stryke/string-format/camel-case";
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
3
|
const require_core_components_output = require('./core/components/output.cjs');
|
|
4
|
+
const require_index = require('./plugin-babel/src/index.cjs');
|
|
4
5
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
6
|
let __alloy_js_core = require("@alloy-js/core");
|
|
6
7
|
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
8
|
+
let __stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
7
9
|
let __alloy_js_babel_preset = require("@alloy-js/babel-preset");
|
|
8
10
|
__alloy_js_babel_preset = require_rolldown_runtime.__toESM(__alloy_js_babel_preset);
|
|
9
|
-
let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
10
|
-
__powerlines_plugin_babel = require_rolldown_runtime.__toESM(__powerlines_plugin_babel);
|
|
11
|
-
let __stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
12
11
|
|
|
13
12
|
//#region src/index.tsx
|
|
14
13
|
/**
|
|
@@ -19,7 +18,7 @@ let __stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
|
19
18
|
*/
|
|
20
19
|
const plugin = (options = {}) => {
|
|
21
20
|
return [
|
|
22
|
-
|
|
21
|
+
require_index.default(),
|
|
23
22
|
{
|
|
24
23
|
name: "alloy:config",
|
|
25
24
|
config() {
|
|
@@ -61,7 +60,7 @@ const plugin = (options = {}) => {
|
|
|
61
60
|
order: "pre",
|
|
62
61
|
async handler() {
|
|
63
62
|
this.debug("Attaching the `render` method to the context object.");
|
|
64
|
-
async
|
|
63
|
+
this.render = async (children) => {
|
|
65
64
|
const _self$ = this;
|
|
66
65
|
const meta = {};
|
|
67
66
|
await (0, __alloy_js_core.traverseOutput)(await (0, __alloy_js_core.renderAsync)((0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
|
|
@@ -95,8 +94,7 @@ const plugin = (options = {}) => {
|
|
|
95
94
|
} else this.fs.copySync(file.sourcePath, file.path);
|
|
96
95
|
}
|
|
97
96
|
});
|
|
98
|
-
}
|
|
99
|
-
this.render = render.bind(this);
|
|
97
|
+
};
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Output as Output$1 } from "./core/components/output.mjs";
|
|
2
|
+
import src_default$1 from "./plugin-babel/src/index.mjs";
|
|
2
3
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
3
4
|
import { renderAsync, traverseOutput } from "@alloy-js/core";
|
|
4
5
|
import { findFileExtension, findFileExtensionSafe } from "@stryke/path/file-path-fns";
|
|
5
|
-
import alloyPreset from "@alloy-js/babel-preset";
|
|
6
|
-
import babel from "@powerlines/plugin-babel";
|
|
7
6
|
import { StormJSON } from "@stryke/json/storm-json";
|
|
7
|
+
import alloyPreset from "@alloy-js/babel-preset";
|
|
8
8
|
|
|
9
9
|
//#region src/index.tsx
|
|
10
10
|
/**
|
|
@@ -15,7 +15,7 @@ import { StormJSON } from "@stryke/json/storm-json";
|
|
|
15
15
|
*/
|
|
16
16
|
const plugin = (options = {}) => {
|
|
17
17
|
return [
|
|
18
|
-
|
|
18
|
+
src_default$1(),
|
|
19
19
|
{
|
|
20
20
|
name: "alloy:config",
|
|
21
21
|
config() {
|
|
@@ -57,7 +57,7 @@ const plugin = (options = {}) => {
|
|
|
57
57
|
order: "pre",
|
|
58
58
|
async handler() {
|
|
59
59
|
this.debug("Attaching the `render` method to the context object.");
|
|
60
|
-
async
|
|
60
|
+
this.render = async (children) => {
|
|
61
61
|
const _self$ = this;
|
|
62
62
|
const meta = {};
|
|
63
63
|
await traverseOutput(await renderAsync(createComponent(Output$1, {
|
|
@@ -91,8 +91,7 @@ const plugin = (options = {}) => {
|
|
|
91
91
|
} else this.fs.copySync(file.sourcePath, file.path);
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
}
|
|
95
|
-
this.render = render.bind(this);
|
|
94
|
+
};
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
97
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.cjs";
|
|
2
2
|
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core14 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-file.d.ts
|
|
6
6
|
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
@@ -10,14 +10,14 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
|
10
10
|
* @param props - The properties for the source file.
|
|
11
11
|
* @returns The rendered source file component.
|
|
12
12
|
*/
|
|
13
|
-
declare function MarkdownFile(props: MarkdownFileProps):
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core14.Children;
|
|
14
14
|
/**
|
|
15
15
|
* Renders the header for a Powerlines Typescript source file.
|
|
16
16
|
*
|
|
17
17
|
* @param props - The properties for the source file header.
|
|
18
18
|
* @returns The rendered source file header.
|
|
19
19
|
*/
|
|
20
|
-
declare function MarkdownFileHeader(props: SourceFileHeaderProps):
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core14.Children;
|
|
21
21
|
declare type __ΩMarkdownFileProps = any[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
2
|
import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core10 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-table.d.ts
|
|
6
6
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that provides a context for rendering markdown tables.
|
|
11
11
|
*/
|
|
12
|
-
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>):
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core10.Children;
|
|
13
13
|
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
14
|
width?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Component that provides a context for rendering markdown tables.
|
|
18
18
|
*/
|
|
19
|
-
declare function MarkdownTableColumn(props: MarkdownTableColumnProps):
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core10.Children;
|
|
20
20
|
/**
|
|
21
21
|
* Component that provides a context for rendering markdown tables.
|
|
22
22
|
*/
|
|
23
|
-
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps):
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core10.Children;
|
|
24
24
|
declare type __ΩMarkdownTableProps = any[];
|
|
25
25
|
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
26
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
2
|
import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core9 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-table.d.ts
|
|
6
6
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that provides a context for rendering markdown tables.
|
|
11
11
|
*/
|
|
12
|
-
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>):
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core9.Children;
|
|
13
13
|
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
14
|
width?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Component that provides a context for rendering markdown tables.
|
|
18
18
|
*/
|
|
19
|
-
declare function MarkdownTableColumn(props: MarkdownTableColumnProps):
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core9.Children;
|
|
20
20
|
/**
|
|
21
21
|
* Component that provides a context for rendering markdown tables.
|
|
22
22
|
*/
|
|
23
|
-
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps):
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core9.Children;
|
|
24
24
|
declare type __ΩMarkdownTableProps = any[];
|
|
25
25
|
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
26
|
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __babel_generator = require("@babel/generator");
|
|
3
|
+
__babel_generator = require_rolldown_runtime.__toESM(__babel_generator);
|
|
4
|
+
require("@babel/parser");
|
|
5
|
+
|
|
6
|
+
//#region ../plugin-babel/src/helpers/ast-utils.ts
|
|
7
|
+
let generate = __babel_generator.default;
|
|
8
|
+
if ("default" in generate) generate = generate.default;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
require('../../../powerlines/src/lib/logger.cjs');
|
|
3
|
+
let chalk = require("chalk");
|
|
4
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
5
|
+
require("@babel/helper-plugin-utils");
|
|
6
|
+
require("@storm-software/config-tools/types");
|