@powerlines/plugin-alloy 0.18.119 → 0.19.1
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/index.cjs +6 -6
- package/dist/core/components/output.d.cts +5 -5
- package/dist/core/components/output.d.mts +5 -5
- package/dist/core/components/output.mjs +4 -4
- package/dist/core/components/single-line-comment.d.cts +2 -2
- package/dist/core/components/single-line-comment.d.mts +2 -2
- package/dist/core/components/source-file.d.cts +5 -5
- package/dist/core/components/source-file.d.mts +4 -4
- package/dist/core/contexts/context.cjs +5 -5
- package/dist/core/contexts/context.d.cts +5 -5
- package/dist/core/contexts/context.d.mts +5 -5
- package/dist/core/contexts/context.mjs +5 -5
- package/dist/core/index.cjs +6 -6
- package/dist/index.cjs +32 -32
- package/dist/index.mjs +31 -31
- package/dist/internal/unctx.cjs +3 -8
- package/dist/internal/unctx.mjs +2 -6
- package/dist/markdown/components/front-matter.cjs +28 -0
- package/dist/markdown/components/front-matter.d.cts +15 -0
- package/dist/markdown/components/front-matter.d.mts +15 -0
- package/dist/markdown/components/front-matter.mjs +27 -0
- package/dist/markdown/components/index.cjs +9 -7
- package/dist/markdown/components/index.d.cts +3 -2
- package/dist/markdown/components/index.d.mts +3 -2
- package/dist/markdown/components/index.mjs +2 -1
- package/dist/markdown/components/markdown-file.cjs +28 -13
- package/dist/markdown/components/markdown-file.d.cts +10 -5
- package/dist/markdown/components/markdown-file.d.mts +10 -5
- package/dist/markdown/components/markdown-file.mjs +21 -6
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/markdown/index.cjs +9 -7
- package/dist/markdown/index.d.cts +3 -2
- package/dist/markdown/index.d.mts +3 -2
- package/dist/markdown/index.mjs +2 -1
- package/dist/node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.cjs +83 -0
- package/dist/node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs +82 -0
- package/dist/typescript/components/builtin-file.cjs +6 -6
- 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.cjs +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/index.cjs +43 -43
- package/dist/typescript/components/tsdoc-reflection.cjs +7 -7
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
- package/dist/typescript/components/typescript-file.cjs +8 -8
- package/dist/typescript/components/typescript-interface.cjs +3 -3
- package/dist/typescript/components/typescript-interface.d.cts +3 -3
- package/dist/typescript/components/typescript-interface.d.mts +3 -3
- 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 +3 -3
- package/dist/typescript/index.cjs +43 -43
- package/package.json +16 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
const require_output = require('./output.cjs');
|
|
2
|
+
const require_single_line_comment = require('./single-line-comment.cjs');
|
|
3
|
+
const require_source_file = require('./source-file.cjs');
|
|
4
4
|
|
|
5
|
-
exports.Output =
|
|
6
|
-
exports.SingleLineComment =
|
|
7
|
-
exports.SourceFile =
|
|
5
|
+
exports.Output = require_output.Output;
|
|
6
|
+
exports.SingleLineComment = require_single_line_comment.SingleLineComment;
|
|
7
|
+
exports.SourceFile = require_source_file.SourceFile;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MetaItem } from "../contexts/context.cjs";
|
|
2
|
-
import * as
|
|
3
|
-
import { OutputProps
|
|
2
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { OutputProps } from "@alloy-js/core";
|
|
4
4
|
import { PluginContext } from "powerlines/types/context";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/output.d.ts
|
|
7
|
-
interface OutputProps<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> extends OutputProps
|
|
7
|
+
interface OutputProps$1<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> extends OutputProps {
|
|
8
8
|
/**
|
|
9
9
|
* The current Powerlines process context.
|
|
10
10
|
*/
|
|
@@ -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$1<TContext, TMeta>): _alloy_js_core0.Children;
|
|
21
21
|
declare type __ΩOutputProps = any[];
|
|
22
22
|
//#endregion
|
|
23
|
-
export { Output, OutputProps, __ΩOutputProps };
|
|
23
|
+
export { Output, OutputProps$1 as OutputProps, __ΩOutputProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MetaItem } from "../contexts/context.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import { OutputProps
|
|
2
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { OutputProps } from "@alloy-js/core";
|
|
4
4
|
import { PluginContext } from "powerlines/types/context";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/output.d.ts
|
|
7
|
-
interface OutputProps<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> extends OutputProps
|
|
7
|
+
interface OutputProps$1<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> extends OutputProps {
|
|
8
8
|
/**
|
|
9
9
|
* The current Powerlines process context.
|
|
10
10
|
*/
|
|
@@ -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$1<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps$1<TContext, TMeta>): _alloy_js_core0.Children;
|
|
21
21
|
declare type __ΩOutputProps = any[];
|
|
22
22
|
//#endregion
|
|
23
|
-
export { Output, OutputProps, __ΩOutputProps };
|
|
23
|
+
export { Output$1 as Output, OutputProps$1 as OutputProps, __ΩOutputProps };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Output
|
|
2
|
+
import { Output, Show, computed, splitProps } from "@alloy-js/core";
|
|
3
3
|
import { replacePath } from "@stryke/path/replace";
|
|
4
4
|
|
|
5
5
|
//#region src/core/components/output.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
8
8
|
*/
|
|
9
|
-
function Output(props) {
|
|
9
|
+
function Output$1(props) {
|
|
10
10
|
const [{ children, context, basePath }, rest] = splitProps(props, [
|
|
11
11
|
"children",
|
|
12
12
|
"context",
|
|
13
13
|
"basePath"
|
|
14
14
|
]);
|
|
15
15
|
const basePathRef = computed(() => basePath ? replacePath(basePath, context.workspaceConfig.workspaceRoot) : context.workspaceConfig.workspaceRoot);
|
|
16
|
-
return createComponent(Output
|
|
16
|
+
return createComponent(Output, mergeProps(rest, {
|
|
17
17
|
get basePath() {
|
|
18
18
|
return basePathRef.value;
|
|
19
19
|
},
|
|
@@ -29,4 +29,4 @@ function Output(props) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
32
|
-
export { Output };
|
|
32
|
+
export { Output$1 as Output };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core6 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_core6.Children;
|
|
19
19
|
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
20
|
declare type __ΩSingleLineCommentProps = any[];
|
|
21
21
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core1 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_core1.Children;
|
|
19
19
|
declare type __ΩSingleLineCommentVariant = any[];
|
|
20
20
|
declare type __ΩSingleLineCommentProps = any[];
|
|
21
21
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
3
|
-
import { SourceFileProps
|
|
2
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { SourceFileProps } from "@alloy-js/core";
|
|
4
4
|
import { StoragePreset } from "powerlines/types/fs";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/source-file.d.ts
|
|
7
|
-
type SourceFileProps = SourceFileProps
|
|
7
|
+
type SourceFileProps$1 = SourceFileProps & ComponentProps & {
|
|
8
8
|
/**
|
|
9
9
|
* The storage preset for the output files.
|
|
10
10
|
*
|
|
@@ -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$1): _alloy_js_core0.Children;
|
|
30
30
|
declare type __ΩSourceFileProps = any[];
|
|
31
31
|
//#endregion
|
|
32
|
-
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
32
|
+
export { SourceFile, SourceFileProps$1 as SourceFileProps, __ΩSourceFileProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
2
|
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
3
|
-
import { SourceFileProps
|
|
3
|
+
import { SourceFileProps } from "@alloy-js/core";
|
|
4
4
|
import { StoragePreset } from "powerlines/types/fs";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/source-file.d.ts
|
|
7
|
-
type SourceFileProps = SourceFileProps
|
|
7
|
+
type SourceFileProps$1 = SourceFileProps & ComponentProps & {
|
|
8
8
|
/**
|
|
9
9
|
* The storage preset for the output files.
|
|
10
10
|
*
|
|
@@ -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): _alloy_js_core0.Children;
|
|
29
|
+
declare function SourceFile(props: SourceFileProps$1): _alloy_js_core0.Children;
|
|
30
30
|
declare type __ΩSourceFileProps = any[];
|
|
31
31
|
//#endregion
|
|
32
|
-
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
32
|
+
export { SourceFile, SourceFileProps$1 as SourceFileProps, __ΩSourceFileProps };
|
|
@@ -7,15 +7,15 @@ const require_unctx = require('../../internal/unctx.cjs');
|
|
|
7
7
|
* @returns The Context.
|
|
8
8
|
*/
|
|
9
9
|
function usePowerlinesContext() {
|
|
10
|
-
return require_unctx.unctx.
|
|
10
|
+
return require_unctx.unctx.tryUse();
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
14
14
|
*
|
|
15
|
-
* @returns The Powerlines context or
|
|
15
|
+
* @returns The Powerlines context or null if not set.
|
|
16
16
|
*/
|
|
17
17
|
function usePowerlinesSafe() {
|
|
18
|
-
return usePowerlinesContext()?.value;
|
|
18
|
+
return usePowerlinesContext()?.value ?? null;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
@@ -30,10 +30,10 @@ function usePowerlines() {
|
|
|
30
30
|
/**
|
|
31
31
|
* Hook to safely access the render context's metadata.
|
|
32
32
|
*
|
|
33
|
-
* @returns The Powerlines context or
|
|
33
|
+
* @returns The Powerlines context or null if not set.
|
|
34
34
|
*/
|
|
35
35
|
function useMetaSafe() {
|
|
36
|
-
return usePowerlinesContext()?.meta;
|
|
36
|
+
return usePowerlinesContext()?.meta ?? null;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Hook to access the render context's metadata.
|
|
@@ -35,13 +35,13 @@ interface PowerlinesContextInterface<TContext extends PluginContext = PluginCont
|
|
|
35
35
|
*
|
|
36
36
|
* @returns The Context.
|
|
37
37
|
*/
|
|
38
|
-
declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> |
|
|
38
|
+
declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> | null;
|
|
39
39
|
/**
|
|
40
40
|
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
41
41
|
*
|
|
42
|
-
* @returns The Powerlines context or
|
|
42
|
+
* @returns The Powerlines context or null if not set.
|
|
43
43
|
*/
|
|
44
|
-
declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext |
|
|
44
|
+
declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | null;
|
|
45
45
|
/**
|
|
46
46
|
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
47
47
|
*
|
|
@@ -51,9 +51,9 @@ declare function usePowerlines<TContext extends PluginContext = PluginContext>()
|
|
|
51
51
|
/**
|
|
52
52
|
* Hook to safely access the render context's metadata.
|
|
53
53
|
*
|
|
54
|
-
* @returns The Powerlines context or
|
|
54
|
+
* @returns The Powerlines context or null if not set.
|
|
55
55
|
*/
|
|
56
|
-
declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta |
|
|
56
|
+
declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta | null;
|
|
57
57
|
/**
|
|
58
58
|
* Hook to access the render context's metadata.
|
|
59
59
|
*
|
|
@@ -35,13 +35,13 @@ interface PowerlinesContextInterface<TContext extends PluginContext = PluginCont
|
|
|
35
35
|
*
|
|
36
36
|
* @returns The Context.
|
|
37
37
|
*/
|
|
38
|
-
declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> |
|
|
38
|
+
declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> | null;
|
|
39
39
|
/**
|
|
40
40
|
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
41
41
|
*
|
|
42
|
-
* @returns The Powerlines context or
|
|
42
|
+
* @returns The Powerlines context or null if not set.
|
|
43
43
|
*/
|
|
44
|
-
declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext |
|
|
44
|
+
declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | null;
|
|
45
45
|
/**
|
|
46
46
|
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
47
47
|
*
|
|
@@ -51,9 +51,9 @@ declare function usePowerlines<TContext extends PluginContext = PluginContext>()
|
|
|
51
51
|
/**
|
|
52
52
|
* Hook to safely access the render context's metadata.
|
|
53
53
|
*
|
|
54
|
-
* @returns The Powerlines context or
|
|
54
|
+
* @returns The Powerlines context or null if not set.
|
|
55
55
|
*/
|
|
56
|
-
declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta |
|
|
56
|
+
declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta | null;
|
|
57
57
|
/**
|
|
58
58
|
* Hook to access the render context's metadata.
|
|
59
59
|
*
|
|
@@ -7,15 +7,15 @@ import { unctx } from "../../internal/unctx.mjs";
|
|
|
7
7
|
* @returns The Context.
|
|
8
8
|
*/
|
|
9
9
|
function usePowerlinesContext() {
|
|
10
|
-
return unctx.
|
|
10
|
+
return unctx.tryUse();
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
14
14
|
*
|
|
15
|
-
* @returns The Powerlines context or
|
|
15
|
+
* @returns The Powerlines context or null if not set.
|
|
16
16
|
*/
|
|
17
17
|
function usePowerlinesSafe() {
|
|
18
|
-
return usePowerlinesContext()?.value;
|
|
18
|
+
return usePowerlinesContext()?.value ?? null;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
@@ -30,10 +30,10 @@ function usePowerlines() {
|
|
|
30
30
|
/**
|
|
31
31
|
* Hook to safely access the render context's metadata.
|
|
32
32
|
*
|
|
33
|
-
* @returns The Powerlines context or
|
|
33
|
+
* @returns The Powerlines context or null if not set.
|
|
34
34
|
*/
|
|
35
35
|
function useMetaSafe() {
|
|
36
|
-
return usePowerlinesContext()?.meta;
|
|
36
|
+
return usePowerlinesContext()?.meta ?? null;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Hook to access the render context's metadata.
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const require_output = require('./components/output.cjs');
|
|
2
|
+
const require_single_line_comment = require('./components/single-line-comment.cjs');
|
|
3
3
|
const require_core_contexts_context = require('./contexts/context.cjs');
|
|
4
4
|
const require_core_contexts_reflection = require('./contexts/reflection.cjs');
|
|
5
5
|
require('./contexts/index.cjs');
|
|
6
|
-
const
|
|
6
|
+
const require_source_file = require('./components/source-file.cjs');
|
|
7
7
|
require('./components/index.cjs');
|
|
8
8
|
|
|
9
|
-
exports.Output =
|
|
9
|
+
exports.Output = require_output.Output;
|
|
10
10
|
exports.ReflectionClassContext = require_core_contexts_reflection.ReflectionClassContext;
|
|
11
11
|
exports.ReflectionMethodContext = require_core_contexts_reflection.ReflectionMethodContext;
|
|
12
12
|
exports.ReflectionParameterContext = require_core_contexts_reflection.ReflectionParameterContext;
|
|
13
13
|
exports.ReflectionPropertyContext = require_core_contexts_reflection.ReflectionPropertyContext;
|
|
14
|
-
exports.SingleLineComment =
|
|
15
|
-
exports.SourceFile =
|
|
14
|
+
exports.SingleLineComment = require_single_line_comment.SingleLineComment;
|
|
15
|
+
exports.SourceFile = require_source_file.SourceFile;
|
|
16
16
|
exports.useMeta = require_core_contexts_context.useMeta;
|
|
17
17
|
exports.useMetaSafe = require_core_contexts_context.useMetaSafe;
|
|
18
18
|
exports.usePowerlines = require_core_contexts_context.usePowerlines;
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_output = require('./core/components/output.cjs');
|
|
4
4
|
const require_unctx = require('./internal/unctx.cjs');
|
|
5
5
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
6
|
let __alloy_js_babel_preset = require("@alloy-js/babel-preset");
|
|
@@ -58,44 +58,44 @@ const plugin = (options = {}) => {
|
|
|
58
58
|
async handler() {
|
|
59
59
|
this.debug("Attaching the `render` method to the context object.");
|
|
60
60
|
this.render = async (children) => {
|
|
61
|
+
const _self$ = this;
|
|
61
62
|
const meta = {};
|
|
62
|
-
|
|
63
|
+
require_unctx.unctx.set({
|
|
63
64
|
value: this,
|
|
64
65
|
meta
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (metadata.
|
|
83
|
-
|
|
84
|
-
this.emitBuiltinSync(file.contents, metadata.id, {
|
|
85
|
-
skipFormat: metadata.skipFormat,
|
|
86
|
-
storage: metadata.storage,
|
|
87
|
-
extension: (0, __stryke_path_file_path_fns.findFileExtension)(file.path)
|
|
88
|
-
});
|
|
89
|
-
} else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
|
|
66
|
+
});
|
|
67
|
+
await (0, __alloy_js_core.traverseOutput)(await (0, __alloy_js_core.renderAsync)((0, __alloy_js_core_jsx_runtime.createComponent)(require_output.Output, {
|
|
68
|
+
context: _self$,
|
|
69
|
+
meta,
|
|
70
|
+
get basePath() {
|
|
71
|
+
return _self$.workspaceConfig.workspaceRoot;
|
|
72
|
+
},
|
|
73
|
+
children
|
|
74
|
+
})), {
|
|
75
|
+
visitDirectory: (directory) => {
|
|
76
|
+
if (this.fs.existsSync(directory.path)) return;
|
|
77
|
+
this.fs.mkdirSync(directory.path);
|
|
78
|
+
},
|
|
79
|
+
visitFile: (file) => {
|
|
80
|
+
if ("contents" in file) {
|
|
81
|
+
const metadata = meta[file.path] ?? {};
|
|
82
|
+
if (metadata.kind === "builtin") {
|
|
83
|
+
if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
|
|
84
|
+
this.emitBuiltinSync(file.contents, metadata.id, {
|
|
90
85
|
skipFormat: metadata.skipFormat,
|
|
91
86
|
storage: metadata.storage,
|
|
92
|
-
|
|
87
|
+
extension: (0, __stryke_path_file_path_fns.findFileExtension)(file.path)
|
|
93
88
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
} else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
|
|
90
|
+
skipFormat: metadata.skipFormat,
|
|
91
|
+
storage: metadata.storage,
|
|
92
|
+
...metadata.typeDefinition ?? {}
|
|
93
|
+
});
|
|
94
|
+
else this.emitSync(file.contents, file.path, metadata);
|
|
95
|
+
} else this.fs.copySync(file.sourcePath, file.path);
|
|
96
|
+
}
|
|
98
97
|
});
|
|
98
|
+
require_unctx.unctx.unset();
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -54,44 +54,44 @@ const plugin = (options = {}) => {
|
|
|
54
54
|
async handler() {
|
|
55
55
|
this.debug("Attaching the `render` method to the context object.");
|
|
56
56
|
this.render = async (children) => {
|
|
57
|
+
const _self$ = this;
|
|
57
58
|
const meta = {};
|
|
58
|
-
|
|
59
|
+
unctx.set({
|
|
59
60
|
value: this,
|
|
60
61
|
meta
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (metadata.
|
|
79
|
-
|
|
80
|
-
this.emitBuiltinSync(file.contents, metadata.id, {
|
|
81
|
-
skipFormat: metadata.skipFormat,
|
|
82
|
-
storage: metadata.storage,
|
|
83
|
-
extension: findFileExtension(file.path)
|
|
84
|
-
});
|
|
85
|
-
} else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
|
|
62
|
+
});
|
|
63
|
+
await traverseOutput(await renderAsync(createComponent(Output$1, {
|
|
64
|
+
context: _self$,
|
|
65
|
+
meta,
|
|
66
|
+
get basePath() {
|
|
67
|
+
return _self$.workspaceConfig.workspaceRoot;
|
|
68
|
+
},
|
|
69
|
+
children
|
|
70
|
+
})), {
|
|
71
|
+
visitDirectory: (directory) => {
|
|
72
|
+
if (this.fs.existsSync(directory.path)) return;
|
|
73
|
+
this.fs.mkdirSync(directory.path);
|
|
74
|
+
},
|
|
75
|
+
visitFile: (file) => {
|
|
76
|
+
if ("contents" in file) {
|
|
77
|
+
const metadata = meta[file.path] ?? {};
|
|
78
|
+
if (metadata.kind === "builtin") {
|
|
79
|
+
if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
|
|
80
|
+
this.emitBuiltinSync(file.contents, metadata.id, {
|
|
86
81
|
skipFormat: metadata.skipFormat,
|
|
87
82
|
storage: metadata.storage,
|
|
88
|
-
|
|
83
|
+
extension: findFileExtension(file.path)
|
|
89
84
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
} else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
|
|
86
|
+
skipFormat: metadata.skipFormat,
|
|
87
|
+
storage: metadata.storage,
|
|
88
|
+
...metadata.typeDefinition ?? {}
|
|
89
|
+
});
|
|
90
|
+
else this.emitSync(file.contents, file.path, metadata);
|
|
91
|
+
} else this.fs.copySync(file.sourcePath, file.path);
|
|
92
|
+
}
|
|
94
93
|
});
|
|
94
|
+
unctx.unset();
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
}
|
package/dist/internal/unctx.cjs
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
let node_async_hooks = require("node:async_hooks");
|
|
3
|
-
let unctx = require("unctx");
|
|
1
|
+
const require_index = require('../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.cjs');
|
|
4
2
|
|
|
5
3
|
//#region src/internal/unctx.ts
|
|
6
|
-
const unctx
|
|
7
|
-
asyncContext: true,
|
|
8
|
-
AsyncLocalStorage: node_async_hooks.AsyncLocalStorage
|
|
9
|
-
});
|
|
4
|
+
const unctx = require_index.createContext();
|
|
10
5
|
|
|
11
6
|
//#endregion
|
|
12
|
-
exports.unctx = unctx
|
|
7
|
+
exports.unctx = unctx;
|
package/dist/internal/unctx.mjs
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext } from "unctx";
|
|
1
|
+
import { createContext } from "../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/internal/unctx.ts
|
|
5
|
-
const unctx = createContext(
|
|
6
|
-
asyncContext: true,
|
|
7
|
-
AsyncLocalStorage
|
|
8
|
-
});
|
|
4
|
+
const unctx = createContext();
|
|
9
5
|
|
|
10
6
|
//#endregion
|
|
11
7
|
export { unctx };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
|
|
5
|
+
//#region src/markdown/components/front-matter.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Renders YAML front matter for a markdown file.
|
|
8
|
+
*
|
|
9
|
+
* @see https://jekyllrb.com/docs/front-matter/
|
|
10
|
+
*/
|
|
11
|
+
function FrontMatter(props) {
|
|
12
|
+
return [
|
|
13
|
+
"---",
|
|
14
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
15
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
16
|
+
get each() {
|
|
17
|
+
return Object.entries(props.data);
|
|
18
|
+
},
|
|
19
|
+
hardline: true,
|
|
20
|
+
children: ([key, value]) => __alloy_js_core.code`${key}: ${JSON.stringify(value)}`
|
|
21
|
+
}),
|
|
22
|
+
"---",
|
|
23
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.FrontMatter = FrontMatter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _alloy_js_core15 from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/markdown/components/front-matter.d.ts
|
|
4
|
+
interface FrontMatterProps {
|
|
5
|
+
data: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders YAML front matter for a markdown file.
|
|
9
|
+
*
|
|
10
|
+
* @see https://jekyllrb.com/docs/front-matter/
|
|
11
|
+
*/
|
|
12
|
+
declare function FrontMatter(props: FrontMatterProps): _alloy_js_core15.Children;
|
|
13
|
+
declare type __ΩFrontMatterProps = any[];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _alloy_js_core5 from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/markdown/components/front-matter.d.ts
|
|
4
|
+
interface FrontMatterProps {
|
|
5
|
+
data: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders YAML front matter for a markdown file.
|
|
9
|
+
*
|
|
10
|
+
* @see https://jekyllrb.com/docs/front-matter/
|
|
11
|
+
*/
|
|
12
|
+
declare function FrontMatter(props: FrontMatterProps): _alloy_js_core5.Children;
|
|
13
|
+
declare type __ΩFrontMatterProps = any[];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { For, code } from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
//#region src/markdown/components/front-matter.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Renders YAML front matter for a markdown file.
|
|
7
|
+
*
|
|
8
|
+
* @see https://jekyllrb.com/docs/front-matter/
|
|
9
|
+
*/
|
|
10
|
+
function FrontMatter(props) {
|
|
11
|
+
return [
|
|
12
|
+
"---",
|
|
13
|
+
createIntrinsic("hbr", {}),
|
|
14
|
+
createComponent(For, {
|
|
15
|
+
get each() {
|
|
16
|
+
return Object.entries(props.data);
|
|
17
|
+
},
|
|
18
|
+
hardline: true,
|
|
19
|
+
children: ([key, value]) => code`${key}: ${JSON.stringify(value)}`
|
|
20
|
+
}),
|
|
21
|
+
"---",
|
|
22
|
+
createIntrinsic("hbr", {})
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { FrontMatter };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const require_front_matter = require('./front-matter.cjs');
|
|
2
|
+
const require_markdown_file = require('./markdown-file.cjs');
|
|
3
|
+
const require_markdown_table = require('./markdown-table.cjs');
|
|
3
4
|
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
5
|
+
exports.FrontMatter = require_front_matter.FrontMatter;
|
|
6
|
+
exports.MarkdownFile = require_markdown_file.MarkdownFile;
|
|
7
|
+
exports.MarkdownFileHeader = require_markdown_file.MarkdownFileHeader;
|
|
8
|
+
exports.MarkdownTable = require_markdown_table.MarkdownTable;
|
|
9
|
+
exports.MarkdownTableColumn = require_markdown_table.MarkdownTableColumn;
|
|
10
|
+
exports.MarkdownTableColumnHeader = require_markdown_table.MarkdownTableColumnHeader;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./front-matter.cjs";
|
|
2
|
+
import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./markdown-file.cjs";
|
|
2
3
|
import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./markdown-table.cjs";
|
|
3
|
-
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
|
|
4
|
+
export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
|