@powerlines/plugin-alloy 0.25.33 → 0.25.34
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/README.md +1 -1
- package/dist/core/components/output.cjs +17 -10
- package/dist/core/components/output.mjs +18 -12
- package/dist/core/components/single-line-comment.cjs +6 -4
- package/dist/core/components/single-line-comment.mjs +7 -6
- package/dist/core/components/source-file.cjs +10 -6
- package/dist/core/components/source-file.mjs +11 -8
- package/dist/core/components/spacing.cjs +6 -4
- package/dist/core/components/spacing.mjs +7 -6
- package/dist/core/contexts/context.mjs +1 -2
- package/dist/core/contexts/meta.mjs +1 -2
- package/dist/core/contexts/reflection.mjs +1 -2
- package/dist/core/helpers/code.mjs +1 -2
- package/dist/helpers/capnp.mjs +1 -2
- package/dist/helpers/create-builtin.mjs +1 -2
- package/dist/helpers/refkey.mjs +1 -2
- package/dist/helpers/typescript.mjs +1 -2
- package/dist/index.cjs +8 -18
- package/dist/index.mjs +8 -19
- package/dist/markdown/components/front-matter.cjs +9 -7
- package/dist/markdown/components/front-matter.mjs +10 -9
- package/dist/markdown/components/markdown-file.cjs +76 -44
- package/dist/markdown/components/markdown-file.mjs +77 -46
- package/dist/markdown/components/markdown-table.cjs +49 -28
- package/dist/markdown/components/markdown-table.mjs +50 -30
- package/dist/markdown/contexts/markdown-table.mjs +1 -2
- package/dist/render.cjs +3 -3
- package/dist/render.mjs +4 -5
- package/dist/typescript/components/builtin-file.cjs +29 -19
- package/dist/typescript/components/builtin-file.mjs +30 -21
- package/dist/typescript/components/class-declaration.cjs +165 -100
- package/dist/typescript/components/class-declaration.mjs +166 -102
- package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
- package/dist/typescript/components/dynamic-import-statement.mjs +3 -8
- package/dist/typescript/components/entry-file.cjs +9 -6
- package/dist/typescript/components/entry-file.mjs +10 -8
- package/dist/typescript/components/infrastructure-file.cjs +9 -6
- package/dist/typescript/components/infrastructure-file.mjs +10 -8
- package/dist/typescript/components/interface-declaration.cjs +121 -70
- package/dist/typescript/components/interface-declaration.mjs +122 -72
- package/dist/typescript/components/object-declaration.cjs +76 -44
- package/dist/typescript/components/object-declaration.mjs +77 -46
- package/dist/typescript/components/property-name.cjs +3 -3
- package/dist/typescript/components/property-name.mjs +4 -5
- package/dist/typescript/components/record-expression.mjs +1 -2
- package/dist/typescript/components/tsdoc-reflection.cjs +225 -104
- package/dist/typescript/components/tsdoc-reflection.mjs +226 -106
- package/dist/typescript/components/tsdoc.cjs +255 -160
- package/dist/typescript/components/tsdoc.mjs +256 -162
- package/dist/typescript/components/type-declaration.cjs +20 -15
- package/dist/typescript/components/type-declaration.mjs +21 -17
- package/dist/typescript/components/type-parameters.cjs +55 -29
- package/dist/typescript/components/type-parameters.mjs +56 -31
- package/dist/typescript/components/typescript-file.cjs +145 -80
- package/dist/typescript/components/typescript-file.mjs +146 -82
- package/dist/typescript/contexts/lexical-scope.cjs +5 -3
- package/dist/typescript/contexts/lexical-scope.mjs +6 -5
- package/dist/typescript/contexts/member-scope.cjs +5 -3
- package/dist/typescript/contexts/member-scope.mjs +6 -5
- package/dist/typescript/helpers/get-call-signature-props.mjs +1 -2
- package/dist/typescript/helpers/utilities.mjs +1 -2
- package/dist/yaml/components/yaml-file.cjs +92 -47
- package/dist/yaml/components/yaml-file.mjs +93 -49
- package/package.json +16 -17
- package/dist/core/components/index.d.cts +0 -5
- package/dist/core/components/index.d.mts +0 -5
- package/dist/core/components/output.d.cts +0 -24
- package/dist/core/components/output.d.cts.map +0 -1
- package/dist/core/components/output.d.mts +0 -24
- package/dist/core/components/output.d.mts.map +0 -1
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.d.cts +0 -23
- package/dist/core/components/single-line-comment.d.cts.map +0 -1
- package/dist/core/components/single-line-comment.d.mts +0 -23
- package/dist/core/components/single-line-comment.d.mts.map +0 -1
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.d.cts +0 -33
- package/dist/core/components/source-file.d.cts.map +0 -1
- package/dist/core/components/source-file.d.mts +0 -33
- package/dist/core/components/source-file.d.mts.map +0 -1
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.d.cts +0 -24
- package/dist/core/components/spacing.d.cts.map +0 -1
- package/dist/core/components/spacing.d.mts +0 -24
- package/dist/core/components/spacing.d.mts.map +0 -1
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/context.d.cts +0 -29
- package/dist/core/contexts/context.d.cts.map +0 -1
- package/dist/core/contexts/context.d.mts +0 -29
- package/dist/core/contexts/context.d.mts.map +0 -1
- package/dist/core/contexts/context.mjs.map +0 -1
- package/dist/core/contexts/index.d.cts +0 -4
- package/dist/core/contexts/index.d.mts +0 -4
- package/dist/core/contexts/meta.d.cts +0 -48
- package/dist/core/contexts/meta.d.cts.map +0 -1
- package/dist/core/contexts/meta.d.mts +0 -48
- package/dist/core/contexts/meta.d.mts.map +0 -1
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/reflection.d.cts +0 -53
- package/dist/core/contexts/reflection.d.cts.map +0 -1
- package/dist/core/contexts/reflection.d.mts +0 -53
- package/dist/core/contexts/reflection.d.mts.map +0 -1
- package/dist/core/contexts/reflection.mjs.map +0 -1
- package/dist/core/helpers/code.d.cts +0 -29
- package/dist/core/helpers/code.d.cts.map +0 -1
- package/dist/core/helpers/code.d.mts +0 -29
- package/dist/core/helpers/code.d.mts.map +0 -1
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/index.d.cts +0 -9
- package/dist/core/index.d.mts +0 -9
- package/dist/helpers/capnp.d.cts +0 -87
- package/dist/helpers/capnp.d.cts.map +0 -1
- package/dist/helpers/capnp.d.mts +0 -87
- package/dist/helpers/capnp.d.mts.map +0 -1
- package/dist/helpers/capnp.mjs.map +0 -1
- package/dist/helpers/create-builtin.d.cts +0 -16
- package/dist/helpers/create-builtin.d.cts.map +0 -1
- package/dist/helpers/create-builtin.d.mts +0 -16
- package/dist/helpers/create-builtin.d.mts.map +0 -1
- package/dist/helpers/create-builtin.mjs.map +0 -1
- package/dist/helpers/index.d.cts +0 -5
- package/dist/helpers/index.d.mts +0 -5
- package/dist/helpers/refkey.d.cts +0 -13
- package/dist/helpers/refkey.d.cts.map +0 -1
- package/dist/helpers/refkey.d.mts +0 -13
- package/dist/helpers/refkey.d.mts.map +0 -1
- package/dist/helpers/refkey.mjs.map +0 -1
- package/dist/helpers/typescript.d.cts +0 -26
- package/dist/helpers/typescript.d.cts.map +0 -1
- package/dist/helpers/typescript.d.mts +0 -26
- package/dist/helpers/typescript.d.mts.map +0 -1
- package/dist/helpers/typescript.mjs.map +0 -1
- package/dist/index.d.cts +0 -19
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -19
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/markdown/components/front-matter.d.cts +0 -16
- package/dist/markdown/components/front-matter.d.cts.map +0 -1
- package/dist/markdown/components/front-matter.d.mts +0 -16
- package/dist/markdown/components/front-matter.d.mts.map +0 -1
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/index.d.cts +0 -4
- package/dist/markdown/components/index.d.mts +0 -4
- package/dist/markdown/components/markdown-file.d.cts +0 -29
- package/dist/markdown/components/markdown-file.d.cts.map +0 -1
- package/dist/markdown/components/markdown-file.d.mts +0 -29
- package/dist/markdown/components/markdown-file.d.mts.map +0 -1
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.d.cts +0 -28
- package/dist/markdown/components/markdown-table.d.cts.map +0 -1
- package/dist/markdown/components/markdown-table.d.mts +0 -28
- package/dist/markdown/components/markdown-table.d.mts.map +0 -1
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/markdown-table.d.cts +0 -38
- package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
- package/dist/markdown/contexts/markdown-table.d.mts +0 -38
- package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.d.cts +0 -5
- package/dist/markdown/index.d.mts +0 -5
- package/dist/render.d.cts +0 -38
- package/dist/render.d.cts.map +0 -1
- package/dist/render.d.mts +0 -38
- package/dist/render.d.mts.map +0 -1
- package/dist/render.mjs.map +0 -1
- package/dist/types/components.d.cts +0 -142
- package/dist/types/components.d.cts.map +0 -1
- package/dist/types/components.d.mts +0 -142
- package/dist/types/components.d.mts.map +0 -1
- package/dist/types/index.d.cts +0 -3
- package/dist/types/index.d.mts +0 -3
- package/dist/types/plugin.d.cts +0 -39
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -39
- package/dist/types/plugin.d.mts.map +0 -1
- package/dist/typescript/components/builtin-file.d.cts +0 -35
- package/dist/typescript/components/builtin-file.d.cts.map +0 -1
- package/dist/typescript/components/builtin-file.d.mts +0 -35
- package/dist/typescript/components/builtin-file.d.mts.map +0 -1
- package/dist/typescript/components/builtin-file.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.d.cts +0 -145
- package/dist/typescript/components/class-declaration.d.cts.map +0 -1
- package/dist/typescript/components/class-declaration.d.mts +0 -145
- package/dist/typescript/components/class-declaration.d.mts.map +0 -1
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.cts +0 -33
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +0 -33
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/entry-file.d.cts +0 -28
- package/dist/typescript/components/entry-file.d.cts.map +0 -1
- package/dist/typescript/components/entry-file.d.mts +0 -28
- package/dist/typescript/components/entry-file.d.mts.map +0 -1
- package/dist/typescript/components/entry-file.mjs.map +0 -1
- package/dist/typescript/components/index.d.cts +0 -15
- package/dist/typescript/components/index.d.mts +0 -15
- package/dist/typescript/components/infrastructure-file.d.cts +0 -21
- package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
- package/dist/typescript/components/infrastructure-file.d.mts +0 -21
- package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
- package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.d.cts +0 -86
- package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
- package/dist/typescript/components/interface-declaration.d.mts +0 -86
- package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.d.cts +0 -30
- package/dist/typescript/components/object-declaration.d.cts.map +0 -1
- package/dist/typescript/components/object-declaration.d.mts +0 -30
- package/dist/typescript/components/object-declaration.d.mts.map +0 -1
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.d.cts +0 -24
- package/dist/typescript/components/property-name.d.cts.map +0 -1
- package/dist/typescript/components/property-name.d.mts +0 -24
- package/dist/typescript/components/property-name.d.mts.map +0 -1
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.d.cts +0 -13
- package/dist/typescript/components/record-expression.d.cts.map +0 -1
- package/dist/typescript/components/record-expression.d.mts +0 -13
- package/dist/typescript/components/record-expression.d.mts.map +0 -1
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.cts +0 -44
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +0 -44
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.d.cts +0 -164
- package/dist/typescript/components/tsdoc.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc.d.mts +0 -164
- package/dist/typescript/components/tsdoc.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.d.cts +0 -18
- package/dist/typescript/components/type-declaration.d.cts.map +0 -1
- package/dist/typescript/components/type-declaration.d.mts +0 -18
- package/dist/typescript/components/type-declaration.d.mts.map +0 -1
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.d.cts +0 -24
- package/dist/typescript/components/type-parameters.d.cts.map +0 -1
- package/dist/typescript/components/type-parameters.d.mts +0 -24
- package/dist/typescript/components/type-parameters.d.mts.map +0 -1
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.d.cts +0 -50
- package/dist/typescript/components/typescript-file.d.cts.map +0 -1
- package/dist/typescript/components/typescript-file.d.mts +0 -50
- package/dist/typescript/components/typescript-file.d.mts.map +0 -1
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/lexical-scope.d.cts +0 -17
- package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +0 -17
- package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.d.cts +0 -20
- package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/member-scope.d.mts +0 -20
- package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -14
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -14
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/utilities.d.cts +0 -11
- package/dist/typescript/helpers/utilities.d.cts.map +0 -1
- package/dist/typescript/helpers/utilities.d.mts +0 -11
- package/dist/typescript/helpers/utilities.d.mts.map +0 -1
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/typescript/index.d.cts +0 -18
- package/dist/typescript/index.d.mts +0 -18
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/yaml-file.d.cts +0 -34
- package/dist/yaml/components/yaml-file.d.cts.map +0 -1
- package/dist/yaml/components/yaml-file.d.mts +0 -34
- package/dist/yaml/components/yaml-file.d.mts.map +0 -1
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.d.cts +0 -2
- package/dist/yaml/index.d.mts +0 -2
|
@@ -1,47 +1,73 @@
|
|
|
1
1
|
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
3
|
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
|
+
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
5
|
import { For, Show, code, splitProps } from "@alloy-js/core";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
6
6
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
7
7
|
import { getFileHeaderWarning } from "powerlines/utils";
|
|
8
8
|
import { isSetObject } from "@stryke/type-checks";
|
|
9
9
|
|
|
10
10
|
//#region src/yaml/components/yaml-file.tsx
|
|
11
11
|
function YamlFileDataItem({ key, value }) {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
when
|
|
12
|
+
return [
|
|
13
|
+
createComponent(Show, {
|
|
14
|
+
get when() {
|
|
15
|
+
return Boolean(key);
|
|
16
|
+
},
|
|
15
17
|
children: code`${key}:`
|
|
16
18
|
}),
|
|
17
|
-
|
|
19
|
+
createComponent(Show, {
|
|
18
20
|
when: typeof value === "string" || typeof value === "number" || typeof value === "boolean",
|
|
19
|
-
children
|
|
21
|
+
get children() {
|
|
22
|
+
return code` ${String(value)}`;
|
|
23
|
+
}
|
|
20
24
|
}),
|
|
21
|
-
|
|
22
|
-
when
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
createComponent(Show, {
|
|
26
|
+
get when() {
|
|
27
|
+
return memo(() => !!isSetObject(value))() && !Array.isArray(value);
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
return createComponent(For, {
|
|
31
|
+
get each() {
|
|
32
|
+
return Object.entries(value);
|
|
33
|
+
},
|
|
34
|
+
children: ([nestedKey, nestedValue]) => createComponent(YamlFileDataItem, {
|
|
35
|
+
key: nestedKey,
|
|
36
|
+
value: nestedValue
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
27
40
|
}),
|
|
28
|
-
|
|
29
|
-
when
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
createComponent(Show, {
|
|
42
|
+
get when() {
|
|
43
|
+
return Array.isArray(value);
|
|
44
|
+
},
|
|
45
|
+
get children() {
|
|
46
|
+
return createComponent(For, {
|
|
47
|
+
each: value,
|
|
48
|
+
children: (item) => createComponent(YamlFileDataItem, { value: item })
|
|
49
|
+
});
|
|
50
|
+
}
|
|
34
51
|
})
|
|
35
|
-
]
|
|
52
|
+
];
|
|
36
53
|
}
|
|
37
54
|
function YamlFileData({ data }) {
|
|
38
|
-
return
|
|
39
|
-
when
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
return [createComponent(Show, {
|
|
56
|
+
get when() {
|
|
57
|
+
return Boolean(data);
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
return createComponent(For, {
|
|
61
|
+
get each() {
|
|
62
|
+
return Object.entries(data ?? {});
|
|
63
|
+
},
|
|
64
|
+
children: ([key, value]) => createComponent(YamlFileDataItem, {
|
|
65
|
+
key,
|
|
66
|
+
value
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
})];
|
|
45
71
|
}
|
|
46
72
|
/**
|
|
47
73
|
* A base component representing a Powerlines generated YAML source file.
|
|
@@ -59,19 +85,30 @@ function YamlFile(props) {
|
|
|
59
85
|
"data",
|
|
60
86
|
"header"
|
|
61
87
|
]);
|
|
62
|
-
return
|
|
63
|
-
...rest,
|
|
88
|
+
return createComponent(SourceFile, mergeProps(rest, {
|
|
64
89
|
path,
|
|
65
|
-
header
|
|
90
|
+
get header() {
|
|
91
|
+
return createComponent(YamlFileHeader, { children: header });
|
|
92
|
+
},
|
|
66
93
|
filetype: "yaml",
|
|
67
|
-
children
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
get children() {
|
|
95
|
+
return [createComponent(Show, {
|
|
96
|
+
get when() {
|
|
97
|
+
return Boolean(data);
|
|
98
|
+
},
|
|
99
|
+
get children() {
|
|
100
|
+
return createComponent(YamlFileData, { data });
|
|
101
|
+
}
|
|
102
|
+
}), createComponent(Show, {
|
|
103
|
+
get when() {
|
|
104
|
+
return Boolean(children);
|
|
105
|
+
},
|
|
106
|
+
get children() {
|
|
107
|
+
return [children, createIntrinsic("hbr", {})];
|
|
108
|
+
}
|
|
109
|
+
})];
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
75
112
|
}
|
|
76
113
|
/**
|
|
77
114
|
* Renders the header for a Powerlines YAML source file.
|
|
@@ -82,21 +119,28 @@ function YamlFile(props) {
|
|
|
82
119
|
function YamlFileHeader(props) {
|
|
83
120
|
const { children } = props;
|
|
84
121
|
const context = usePowerlinesSafe();
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
when
|
|
88
|
-
|
|
122
|
+
return [
|
|
123
|
+
createComponent(Show, {
|
|
124
|
+
get when() {
|
|
125
|
+
return Boolean(children);
|
|
126
|
+
},
|
|
127
|
+
get children() {
|
|
128
|
+
return [children, createIntrinsic("hbr", {})];
|
|
129
|
+
}
|
|
89
130
|
}),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
131
|
+
createComponent(SingleLineComment, { get children() {
|
|
132
|
+
return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
133
|
+
} }),
|
|
134
|
+
createIntrinsic("hbr", {}),
|
|
135
|
+
createComponent(SingleLineComment, {
|
|
93
136
|
variant: "yaml",
|
|
94
|
-
children
|
|
137
|
+
get children() {
|
|
138
|
+
return getFileHeaderWarning(context);
|
|
139
|
+
}
|
|
95
140
|
}),
|
|
96
|
-
|
|
97
|
-
]
|
|
141
|
+
createIntrinsic("hbr", {})
|
|
142
|
+
];
|
|
98
143
|
}
|
|
99
144
|
|
|
100
145
|
//#endregion
|
|
101
|
-
export { YamlFile, YamlFileHeader };
|
|
102
|
-
//# sourceMappingURL=yaml-file.mjs.map
|
|
146
|
+
export { YamlFile, YamlFileHeader };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-alloy",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
6
6
|
"repository": {
|
|
@@ -808,30 +808,29 @@
|
|
|
808
808
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
809
809
|
"@alloy-js/json": "0.23.0-dev.2",
|
|
810
810
|
"@alloy-js/markdown": "0.23.0-dev.1",
|
|
811
|
-
"@alloy-js/rollup-plugin": "^0.1.0",
|
|
812
811
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
813
|
-
"@powerlines/deepkit": "^0.6.
|
|
814
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
812
|
+
"@powerlines/deepkit": "^0.6.128",
|
|
813
|
+
"@powerlines/plugin-babel": "^0.12.352",
|
|
815
814
|
"@storm-software/config-tools": "1.189.28",
|
|
816
|
-
"@stryke/capnp": "^0.12.
|
|
817
|
-
"@stryke/convert": "^0.6.
|
|
818
|
-
"@stryke/fs": "^0.33.
|
|
819
|
-
"@stryke/helpers": "^0.10.
|
|
820
|
-
"@stryke/json": "^0.14.
|
|
821
|
-
"@stryke/path": "^0.
|
|
822
|
-
"@stryke/string-format": "^0.17.
|
|
823
|
-
"@stryke/type-checks": "^0.5.
|
|
824
|
-
"@stryke/types": "^0.10.
|
|
825
|
-
"@stryke/unique-id": "^0.3.
|
|
815
|
+
"@stryke/capnp": "^0.12.84",
|
|
816
|
+
"@stryke/convert": "^0.6.54",
|
|
817
|
+
"@stryke/fs": "^0.33.58",
|
|
818
|
+
"@stryke/helpers": "^0.10.4",
|
|
819
|
+
"@stryke/json": "^0.14.8",
|
|
820
|
+
"@stryke/path": "^0.27.0",
|
|
821
|
+
"@stryke/string-format": "^0.17.4",
|
|
822
|
+
"@stryke/type-checks": "^0.5.39",
|
|
823
|
+
"@stryke/types": "^0.10.53",
|
|
824
|
+
"@stryke/unique-id": "^0.3.69",
|
|
826
825
|
"defu": "^6.1.4",
|
|
827
|
-
"powerlines": "^0.41.
|
|
826
|
+
"powerlines": "^0.41.14",
|
|
828
827
|
"prettier": "^3.8.1",
|
|
829
828
|
"unctx": "^2.5.0"
|
|
830
829
|
},
|
|
831
830
|
"devDependencies": {
|
|
832
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
831
|
+
"@powerlines/plugin-plugin": "^0.12.300",
|
|
833
832
|
"@types/node": "^25.5.0"
|
|
834
833
|
},
|
|
835
834
|
"publishConfig": { "access": "public" },
|
|
836
|
-
"gitHead": "
|
|
835
|
+
"gitHead": "369e884879e82b75feffe7cfd91c78584accb1d2"
|
|
837
836
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Output, OutputProps, __ΩOutputProps } from "./output.cjs";
|
|
2
|
-
import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./single-line-comment.cjs";
|
|
3
|
-
import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./source-file.cjs";
|
|
4
|
-
import { Spacing, SpacingProps, __ΩSpacingProps } from "./spacing.cjs";
|
|
5
|
-
export { Output, OutputProps, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩOutputProps, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Output, OutputProps, __ΩOutputProps } from "./output.mjs";
|
|
2
|
-
import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./single-line-comment.mjs";
|
|
3
|
-
import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./source-file.mjs";
|
|
4
|
-
import { Spacing, SpacingProps, __ΩSpacingProps } from "./spacing.mjs";
|
|
5
|
-
export { Output, OutputProps, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩOutputProps, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MetaItem } from "../contexts/meta.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
4
|
-
import { PluginContext } from "@powerlines/core";
|
|
5
|
-
|
|
6
|
-
//#region src/core/components/output.d.ts
|
|
7
|
-
interface OutputProps<TContext extends PluginContext = PluginContext> extends Omit<OutputProps$1, "basePath"> {
|
|
8
|
-
/**
|
|
9
|
-
* The current Powerlines process context.
|
|
10
|
-
*/
|
|
11
|
-
context: TContext;
|
|
12
|
-
/**
|
|
13
|
-
* The file metadata collected during rendering.
|
|
14
|
-
*/
|
|
15
|
-
meta?: Record<string, MetaItem>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
19
|
-
*/
|
|
20
|
-
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩOutputProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { Output, OutputProps, __ΩOutputProps };
|
|
24
|
-
//# sourceMappingURL=output.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.cts","names":[],"sources":["../../../src/core/components/output.tsx"],"mappings":";;;;;;UAwBiB,WAAA,kBACE,aAAA,GAAgB,aAAA,UACzB,IAAA,CAAK,aAAA;;;;EAIb,OAAA,EAAS,QAAA;EANiB;;;EAW1B,IAAA,GAAO,MAAA,SAAe,QAAA;AAAA;;;;iBAMR,MAAA,kBAAwB,aAAA,GAAgB,aAAA,CAAA,CACtD,KAAA,EAAO,WAAA,CAAY,QAAA,IAAD,eAAA,CAAU,QAAA;AAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MetaItem } from "../contexts/meta.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
4
|
-
import { PluginContext } from "@powerlines/core";
|
|
5
|
-
|
|
6
|
-
//#region src/core/components/output.d.ts
|
|
7
|
-
interface OutputProps<TContext extends PluginContext = PluginContext> extends Omit<OutputProps$1, "basePath"> {
|
|
8
|
-
/**
|
|
9
|
-
* The current Powerlines process context.
|
|
10
|
-
*/
|
|
11
|
-
context: TContext;
|
|
12
|
-
/**
|
|
13
|
-
* The file metadata collected during rendering.
|
|
14
|
-
*/
|
|
15
|
-
meta?: Record<string, MetaItem>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
19
|
-
*/
|
|
20
|
-
declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩOutputProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { Output, OutputProps, __ΩOutputProps };
|
|
24
|
-
//# sourceMappingURL=output.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.mts","names":[],"sources":["../../../src/core/components/output.tsx"],"mappings":";;;;;;UAwBiB,WAAA,kBACE,aAAA,GAAgB,aAAA,UACzB,IAAA,CAAK,aAAA;;;;EAIb,OAAA,EAAS,QAAA;EANiB;;;EAW1B,IAAA,GAAO,MAAA,SAAe,QAAA;AAAA;;;;iBAMR,MAAA,kBAAwB,aAAA,GAAgB,aAAA,CAAA,CACtD,KAAA,EAAO,WAAA,CAAY,QAAA,IAAD,eAAA,CAAU,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
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,23 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
|
|
4
|
-
//#region src/core/components/single-line-comment.d.ts
|
|
5
|
-
type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown" | "yaml";
|
|
6
|
-
interface SingleLineCommentProps extends ComponentProps {
|
|
7
|
-
/**
|
|
8
|
-
* The variant of the single line comment.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue "double-slash"
|
|
11
|
-
*/
|
|
12
|
-
variant?: SingleLineCommentVariant;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A single line comment block. The children are rendered as a prose element, which means that they
|
|
16
|
-
* are broken into multiple lines
|
|
17
|
-
*/
|
|
18
|
-
declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core0.Children;
|
|
19
|
-
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
|
-
declare type __ΩSingleLineCommentProps = any[];
|
|
21
|
-
//#endregion
|
|
22
|
-
export { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant };
|
|
23
|
-
//# sourceMappingURL=single-line-comment.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"single-line-comment.d.cts","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"mappings":";;;;KAqBY,wBAAA;AAAA,UAQK,sBAAA,SAA+B,cAAA;;AARhD;;;;EAcE,OAAA,GAAU,wBAAA;AAAA;;;;;iBAOI,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
|
|
4
|
-
//#region src/core/components/single-line-comment.d.ts
|
|
5
|
-
type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown" | "yaml";
|
|
6
|
-
interface SingleLineCommentProps extends ComponentProps {
|
|
7
|
-
/**
|
|
8
|
-
* The variant of the single line comment.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue "double-slash"
|
|
11
|
-
*/
|
|
12
|
-
variant?: SingleLineCommentVariant;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A single line comment block. The children are rendered as a prose element, which means that they
|
|
16
|
-
* are broken into multiple lines
|
|
17
|
-
*/
|
|
18
|
-
declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core0.Children;
|
|
19
|
-
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
|
-
declare type __ΩSingleLineCommentProps = any[];
|
|
21
|
-
//#endregion
|
|
22
|
-
export { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant };
|
|
23
|
-
//# sourceMappingURL=single-line-comment.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"single-line-comment.d.mts","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"mappings":";;;;KAqBY,wBAAA;AAAA,UAQK,sBAAA,SAA+B,cAAA;;AARhD;;;;EAcE,OAAA,GAAU,wBAAA;AAAA;;;;;iBAOI,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
|
|
4
|
-
import { StoragePreset } from "powerlines";
|
|
5
|
-
|
|
6
|
-
//#region src/core/components/source-file.d.ts
|
|
7
|
-
type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
8
|
-
/**
|
|
9
|
-
* The storage preset for the output files.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* If not specified, the output mode will be determined by the provided `output.mode` value.
|
|
13
|
-
*/
|
|
14
|
-
storage?: StoragePreset;
|
|
15
|
-
/**
|
|
16
|
-
* The metadata associated with the source file.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* The values stored in the metadata will be available in the rendering context.
|
|
20
|
-
*/
|
|
21
|
-
meta?: Record<string, any>;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* A base component representing a Powerlines generated source file.
|
|
25
|
-
*
|
|
26
|
-
* @param props - The properties for the source file.
|
|
27
|
-
* @returns The rendered source file component.
|
|
28
|
-
*/
|
|
29
|
-
declare function SourceFile(props: SourceFileProps): _alloy_js_core0.Children;
|
|
30
|
-
declare type __ΩSourceFileProps = any[];
|
|
31
|
-
//#endregion
|
|
32
|
-
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
33
|
-
//# sourceMappingURL=source-file.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.d.cts","names":[],"sources":["../../../src/core/components/source-file.tsx"],"mappings":";;;;;;KAkCY,eAAA,GAAkB,iBAAA,GAC5B,cAAA;;;AADF;;;;EAQI,OAAA,GAAU,aAAA;EAAA;;;;;;EAQV,IAAA,GAAO,MAAA;AAAA;;;;;AASX;;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
|
|
4
|
-
import { StoragePreset } from "powerlines";
|
|
5
|
-
|
|
6
|
-
//#region src/core/components/source-file.d.ts
|
|
7
|
-
type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
8
|
-
/**
|
|
9
|
-
* The storage preset for the output files.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* If not specified, the output mode will be determined by the provided `output.mode` value.
|
|
13
|
-
*/
|
|
14
|
-
storage?: StoragePreset;
|
|
15
|
-
/**
|
|
16
|
-
* The metadata associated with the source file.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* The values stored in the metadata will be available in the rendering context.
|
|
20
|
-
*/
|
|
21
|
-
meta?: Record<string, any>;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* A base component representing a Powerlines generated source file.
|
|
25
|
-
*
|
|
26
|
-
* @param props - The properties for the source file.
|
|
27
|
-
* @returns The rendered source file component.
|
|
28
|
-
*/
|
|
29
|
-
declare function SourceFile(props: SourceFileProps): _alloy_js_core0.Children;
|
|
30
|
-
declare type __ΩSourceFileProps = any[];
|
|
31
|
-
//#endregion
|
|
32
|
-
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
33
|
-
//# sourceMappingURL=source-file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.d.mts","names":[],"sources":["../../../src/core/components/source-file.tsx"],"mappings":";;;;;;KAkCY,eAAA,GAAkB,iBAAA,GAC5B,cAAA;;;AADF;;;;EAQI,OAAA,GAAU,aAAA;EAAA;;;;;;EAQV,IAAA,GAAO,MAAA;AAAA;;;;;AASX;;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
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,24 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/core/components/spacing.d.ts
|
|
4
|
-
interface SpacingProps {
|
|
5
|
-
/**
|
|
6
|
-
* A scale factor that determines the amount of vertical space to be added.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* 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.
|
|
10
|
-
*
|
|
11
|
-
* @defaultValue 1
|
|
12
|
-
*/
|
|
13
|
-
scale?: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A simple component that renders two horizontal breaks to create vertical spacing between elements.
|
|
17
|
-
*/
|
|
18
|
-
declare function Spacing({
|
|
19
|
-
scale
|
|
20
|
-
}: SpacingProps): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩSpacingProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { Spacing, SpacingProps, __ΩSpacingProps };
|
|
24
|
-
//# sourceMappingURL=spacing.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.d.cts","names":[],"sources":["../../../src/core/components/spacing.tsx"],"mappings":";;;UAoBiB,YAAA;;;AAAjB;;;;;AAeA;EANE,KAAA;AAAA;;;;iBAMc,OAAA,CAAA;EAAU;AAAA,GAAa,YAAA,GAAY,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/core/components/spacing.d.ts
|
|
4
|
-
interface SpacingProps {
|
|
5
|
-
/**
|
|
6
|
-
* A scale factor that determines the amount of vertical space to be added.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* 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.
|
|
10
|
-
*
|
|
11
|
-
* @defaultValue 1
|
|
12
|
-
*/
|
|
13
|
-
scale?: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A simple component that renders two horizontal breaks to create vertical spacing between elements.
|
|
17
|
-
*/
|
|
18
|
-
declare function Spacing({
|
|
19
|
-
scale
|
|
20
|
-
}: SpacingProps): _alloy_js_core0.Children;
|
|
21
|
-
declare type __ΩSpacingProps = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { Spacing, SpacingProps, __ΩSpacingProps };
|
|
24
|
-
//# sourceMappingURL=spacing.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.d.mts","names":[],"sources":["../../../src/core/components/spacing.tsx"],"mappings":";;;UAoBiB,YAAA;;;AAAjB;;;;;AAeA;EANE,KAAA;AAAA;;;;iBAMc,OAAA,CAAA;EAAU;AAAA,GAAa,YAAA,GAAY,eAAA,CAAA,QAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from "@alloy-js/core";
|
|
2
|
-
import { PluginContext } from "powerlines";
|
|
3
|
-
|
|
4
|
-
//#region src/core/contexts/context.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* The Powerlines context used in template rendering.
|
|
7
|
-
*/
|
|
8
|
-
declare const PowerlinesContext: ComponentContext<PluginContext>;
|
|
9
|
-
/**
|
|
10
|
-
* Hook to access the Powerlines Context.
|
|
11
|
-
*
|
|
12
|
-
* @returns The Context.
|
|
13
|
-
*/
|
|
14
|
-
declare function usePowerlinesContext<TContext extends PluginContext = PluginContext>(): TContext | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
17
|
-
*
|
|
18
|
-
* @returns The Powerlines context or undefined if not set.
|
|
19
|
-
*/
|
|
20
|
-
declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
23
|
-
*
|
|
24
|
-
* @returns The Powerlines context.
|
|
25
|
-
*/
|
|
26
|
-
declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
|
|
29
|
-
//# sourceMappingURL=context.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../../src/core/contexts/context.ts"],"mappings":";;;;;;AA4BA;cAAa,iBAAA,EAAmB,gBAAA,CAAiB,aAAA;;;;AAQjD;;iBAAgB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBASW,iBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBAWW,aAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from "@alloy-js/core";
|
|
2
|
-
import { PluginContext } from "powerlines";
|
|
3
|
-
|
|
4
|
-
//#region src/core/contexts/context.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* The Powerlines context used in template rendering.
|
|
7
|
-
*/
|
|
8
|
-
declare const PowerlinesContext: ComponentContext<PluginContext>;
|
|
9
|
-
/**
|
|
10
|
-
* Hook to access the Powerlines Context.
|
|
11
|
-
*
|
|
12
|
-
* @returns The Context.
|
|
13
|
-
*/
|
|
14
|
-
declare function usePowerlinesContext<TContext extends PluginContext = PluginContext>(): TContext | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
17
|
-
*
|
|
18
|
-
* @returns The Powerlines context or undefined if not set.
|
|
19
|
-
*/
|
|
20
|
-
declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
23
|
-
*
|
|
24
|
-
* @returns The Powerlines context.
|
|
25
|
-
*/
|
|
26
|
-
declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
|
|
29
|
-
//# sourceMappingURL=context.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../../src/core/contexts/context.ts"],"mappings":";;;;;;AA4BA;cAAa,iBAAA,EAAmB,gBAAA,CAAiB,aAAA;;;;AAQjD;;iBAAgB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBASW,iBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBAWW,aAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/core/contexts/context.ts"],"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 ComponentContext,\n createNamedContext,\n useContext\n} from \"@alloy-js/core\";\nimport type { PluginContext } from \"powerlines\";\n\n/**\n * The Powerlines context used in template rendering.\n */\nexport const PowerlinesContext: ComponentContext<PluginContext> =\n createNamedContext<PluginContext>(\"Powerlines\");\n\n/**\n * Hook to access the Powerlines Context.\n *\n * @returns The Context.\n */\nexport function usePowerlinesContext<\n TContext extends PluginContext = PluginContext\n>(): TContext | undefined {\n return useContext(PowerlinesContext) as TContext | undefined;\n}\n\n/**\n * Hook to safely access the {@link PluginContext | Powerlines context}.\n *\n * @returns The Powerlines context or undefined if not set.\n */\nexport function usePowerlinesSafe<\n TContext extends PluginContext = PluginContext\n>(): TContext | undefined {\n const powerlines = usePowerlinesContext<TContext>();\n\n return powerlines ?? undefined;\n}\n\n/**\n * Hook to access the {@link PluginContext | Powerlines context}.\n *\n * @returns The Powerlines context.\n */\nexport function usePowerlines<\n TContext extends PluginContext = PluginContext\n>(): TContext {\n const powerlines = usePowerlinesSafe<TContext>();\n if (!powerlines) {\n throw new Error(\n \"Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return powerlines;\n}\n"],"mappings":";;;;;;AA4BA,MAAa,oBACX,mBAAkC,aAAa;;;;;;AAOjD,SAAgB,uBAEU;AACxB,QAAO,WAAW,kBAAkB;;;;;;;AAQtC,SAAgB,oBAEU;AAGxB,QAFmB,sBAAgC,IAE9B;;;;;;;AAQvB,SAAgB,gBAEF;CACZ,MAAM,aAAa,mBAA6B;AAChD,KAAI,CAAC,WACH,OAAM,IAAI,MACR,sLACD;AAGH,QAAO"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.cjs";
|
|
2
|
-
import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./meta.cjs";
|
|
3
|
-
import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.cjs";
|
|
4
|
-
export { MetaContext, MetaItem, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩMetaItem, __ΩReflectionClassContextInterface, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.mjs";
|
|
2
|
-
import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./meta.mjs";
|
|
3
|
-
import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.mjs";
|
|
4
|
-
export { MetaContext, MetaItem, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩMetaItem, __ΩReflectionClassContextInterface, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
|