@powerlines/plugin-alloy 0.18.46 → 0.18.47

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.
Files changed (153) hide show
  1. package/dist/core/components/output.cjs +2 -2
  2. package/dist/core/components/output.mjs +4 -4
  3. package/dist/core/contexts/context.cjs +1 -50
  4. package/dist/core/contexts/context.mjs +2 -46
  5. package/dist/index.cjs +2 -5
  6. package/dist/index.mjs +0 -3
  7. package/dist/powerlines/src/types/api.d.cts +3 -3
  8. package/dist/powerlines/src/types/api.d.mts +3 -3
  9. package/dist/powerlines/src/types/build.d.cts +10 -10
  10. package/dist/powerlines/src/types/build.d.mts +10 -10
  11. package/dist/powerlines/src/types/commands.d.cts +1 -1
  12. package/dist/powerlines/src/types/commands.d.mts +1 -1
  13. package/dist/powerlines/src/types/config.d.cts +5 -5
  14. package/dist/powerlines/src/types/config.d.mts +5 -5
  15. package/dist/powerlines/src/types/context.d.cts +5 -5
  16. package/dist/powerlines/src/types/context.d.mts +5 -5
  17. package/dist/powerlines/src/types/hooks.d.cts +1 -1
  18. package/dist/powerlines/src/types/hooks.d.mts +1 -1
  19. package/dist/powerlines/src/types/plugin.d.cts +5 -5
  20. package/dist/powerlines/src/types/plugin.d.mts +5 -5
  21. package/dist/powerlines/src/types/resolved.d.cts +1 -1
  22. package/dist/powerlines/src/types/resolved.d.mts +1 -1
  23. package/dist/powerlines/src/types/unplugin.d.cts +1 -1
  24. package/dist/powerlines/src/types/unplugin.d.mts +1 -1
  25. package/dist/types/plugin.d.cts +1 -9
  26. package/dist/types/plugin.d.mts +1 -9
  27. package/package.json +5 -5
  28. package/dist/core/components/index.cjs +0 -7
  29. package/dist/core/components/index.d.cts +0 -4
  30. package/dist/core/components/index.d.mts +0 -4
  31. package/dist/core/components/index.mjs +0 -5
  32. package/dist/core/components/output.d.cts +0 -23
  33. package/dist/core/components/output.d.mts +0 -23
  34. package/dist/core/components/single-line-comment.cjs +0 -22
  35. package/dist/core/components/single-line-comment.d.cts +0 -22
  36. package/dist/core/components/single-line-comment.d.mts +0 -22
  37. package/dist/core/components/single-line-comment.mjs +0 -21
  38. package/dist/core/components/source-file.cjs +0 -64
  39. package/dist/core/components/source-file.d.cts +0 -32
  40. package/dist/core/components/source-file.d.mts +0 -32
  41. package/dist/core/components/source-file.mjs +0 -62
  42. package/dist/core/contexts/context.d.cts +0 -71
  43. package/dist/core/contexts/context.d.mts +0 -71
  44. package/dist/core/contexts/index.cjs +0 -17
  45. package/dist/core/contexts/index.d.cts +0 -3
  46. package/dist/core/contexts/index.d.mts +0 -3
  47. package/dist/core/contexts/index.mjs +0 -4
  48. package/dist/core/contexts/reflection.cjs +0 -68
  49. package/dist/core/contexts/reflection.d.cts +0 -52
  50. package/dist/core/contexts/reflection.d.mts +0 -52
  51. package/dist/core/contexts/reflection.mjs +0 -60
  52. package/dist/core/index.cjs +0 -25
  53. package/dist/core/index.d.cts +0 -7
  54. package/dist/core/index.d.mts +0 -8
  55. package/dist/core/index.mjs +0 -9
  56. package/dist/helpers/capnp.cjs +0 -276
  57. package/dist/helpers/capnp.d.cts +0 -87
  58. package/dist/helpers/capnp.d.mts +0 -87
  59. package/dist/helpers/capnp.mjs +0 -259
  60. package/dist/helpers/create-builtin.cjs +0 -19
  61. package/dist/helpers/create-builtin.d.cts +0 -15
  62. package/dist/helpers/create-builtin.d.mts +0 -15
  63. package/dist/helpers/create-builtin.mjs +0 -18
  64. package/dist/helpers/index.cjs +0 -24
  65. package/dist/helpers/index.d.cts +0 -5
  66. package/dist/helpers/index.d.mts +0 -5
  67. package/dist/helpers/index.mjs +0 -6
  68. package/dist/helpers/refkey.cjs +0 -16
  69. package/dist/helpers/refkey.d.cts +0 -13
  70. package/dist/helpers/refkey.d.mts +0 -13
  71. package/dist/helpers/refkey.mjs +0 -15
  72. package/dist/helpers/typescript.cjs +0 -46
  73. package/dist/helpers/typescript.d.cts +0 -25
  74. package/dist/helpers/typescript.d.mts +0 -25
  75. package/dist/helpers/typescript.mjs +0 -45
  76. package/dist/markdown/components/index.cjs +0 -8
  77. package/dist/markdown/components/index.d.cts +0 -3
  78. package/dist/markdown/components/index.d.mts +0 -3
  79. package/dist/markdown/components/index.mjs +0 -4
  80. package/dist/markdown/components/markdown-file.cjs +0 -116
  81. package/dist/markdown/components/markdown-file.d.cts +0 -23
  82. package/dist/markdown/components/markdown-file.d.mts +0 -23
  83. package/dist/markdown/components/markdown-file.mjs +0 -114
  84. package/dist/markdown/components/markdown-table.cjs +0 -101
  85. package/dist/markdown/components/markdown-table.d.cts +0 -27
  86. package/dist/markdown/components/markdown-table.d.mts +0 -27
  87. package/dist/markdown/components/markdown-table.mjs +0 -98
  88. package/dist/markdown/contexts/index.cjs +0 -6
  89. package/dist/markdown/contexts/index.d.cts +0 -2
  90. package/dist/markdown/contexts/index.d.mts +0 -2
  91. package/dist/markdown/contexts/index.mjs +0 -3
  92. package/dist/markdown/contexts/markdown-table.cjs +0 -37
  93. package/dist/markdown/contexts/markdown-table.d.cts +0 -37
  94. package/dist/markdown/contexts/markdown-table.d.mts +0 -37
  95. package/dist/markdown/contexts/markdown-table.mjs +0 -33
  96. package/dist/markdown/index.cjs +0 -15
  97. package/dist/markdown/index.d.cts +0 -4
  98. package/dist/markdown/index.d.mts +0 -6
  99. package/dist/markdown/index.mjs +0 -7
  100. package/dist/types/components.cjs +0 -0
  101. package/dist/types/components.d.cts +0 -142
  102. package/dist/types/components.d.mts +0 -142
  103. package/dist/types/components.mjs +0 -1
  104. package/dist/types/index.cjs +0 -0
  105. package/dist/types/index.d.cts +0 -3
  106. package/dist/types/index.d.mts +0 -3
  107. package/dist/types/index.mjs +0 -1
  108. package/dist/types/plugin.cjs +0 -0
  109. package/dist/types/plugin.mjs +0 -1
  110. package/dist/typescript/components/builtin-file.cjs +0 -62
  111. package/dist/typescript/components/builtin-file.d.cts +0 -34
  112. package/dist/typescript/components/builtin-file.d.mts +0 -34
  113. package/dist/typescript/components/builtin-file.mjs +0 -61
  114. package/dist/typescript/components/dynamic-import-statement.cjs +0 -25
  115. package/dist/typescript/components/dynamic-import-statement.d.cts +0 -32
  116. package/dist/typescript/components/dynamic-import-statement.d.mts +0 -32
  117. package/dist/typescript/components/dynamic-import-statement.mjs +0 -24
  118. package/dist/typescript/components/entry-file.cjs +0 -41
  119. package/dist/typescript/components/entry-file.d.cts +0 -27
  120. package/dist/typescript/components/entry-file.d.mts +0 -27
  121. package/dist/typescript/components/entry-file.mjs +0 -39
  122. package/dist/typescript/components/index.cjs +0 -44
  123. package/dist/typescript/components/index.d.cts +0 -10
  124. package/dist/typescript/components/index.d.mts +0 -10
  125. package/dist/typescript/components/index.mjs +0 -11
  126. package/dist/typescript/components/record-expression.cjs +0 -12
  127. package/dist/typescript/components/record-expression.d.cts +0 -12
  128. package/dist/typescript/components/record-expression.d.mts +0 -12
  129. package/dist/typescript/components/record-expression.mjs +0 -11
  130. package/dist/typescript/components/tsdoc-reflection.cjs +0 -177
  131. package/dist/typescript/components/tsdoc-reflection.d.cts +0 -18
  132. package/dist/typescript/components/tsdoc-reflection.d.mts +0 -18
  133. package/dist/typescript/components/tsdoc-reflection.mjs +0 -174
  134. package/dist/typescript/components/tsdoc.cjs +0 -481
  135. package/dist/typescript/components/tsdoc.d.cts +0 -163
  136. package/dist/typescript/components/tsdoc.d.mts +0 -163
  137. package/dist/typescript/components/tsdoc.mjs +0 -461
  138. package/dist/typescript/components/typescript-file.cjs +0 -216
  139. package/dist/typescript/components/typescript-file.d.cts +0 -49
  140. package/dist/typescript/components/typescript-file.d.mts +0 -49
  141. package/dist/typescript/components/typescript-file.mjs +0 -213
  142. package/dist/typescript/components/typescript-interface.cjs +0 -69
  143. package/dist/typescript/components/typescript-interface.d.cts +0 -25
  144. package/dist/typescript/components/typescript-interface.d.mts +0 -25
  145. package/dist/typescript/components/typescript-interface.mjs +0 -67
  146. package/dist/typescript/components/typescript-object.cjs +0 -125
  147. package/dist/typescript/components/typescript-object.d.cts +0 -26
  148. package/dist/typescript/components/typescript-object.d.mts +0 -26
  149. package/dist/typescript/components/typescript-object.mjs +0 -123
  150. package/dist/typescript/index.cjs +0 -45
  151. package/dist/typescript/index.d.cts +0 -11
  152. package/dist/typescript/index.d.mts +0 -11
  153. package/dist/typescript/index.mjs +0 -12
@@ -1,5 +1,4 @@
1
1
  import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
2
- import { UserConfig } from "../powerlines/src/types/config.mjs";
3
2
  import { PluginContext } from "../powerlines/src/types/context.mjs";
4
3
  import { Children, PrintTreeOptions } from "@alloy-js/core";
5
4
 
@@ -24,18 +23,11 @@ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
24
23
  */
25
24
  markdown?: boolean;
26
25
  };
27
- type AlloyPluginUserConfig = UserConfig & {
28
- alloy?: AlloyPluginOptions;
29
- };
30
26
  type AlloyPluginResolvedConfig = ResolvedConfig & {
31
27
  alloy: AlloyPluginOptions;
32
28
  };
33
29
  type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
34
30
  render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
35
31
  };
36
- declare type __ΩAlloyPluginOptions = any[];
37
- declare type __ΩAlloyPluginUserConfig = any[];
38
- declare type __ΩAlloyPluginResolvedConfig = any[];
39
- declare type __ΩAlloyPluginContext = any[];
40
32
  //#endregion
41
- export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig };
33
+ export { AlloyPluginContext, AlloyPluginOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.18.46",
3
+ "version": "0.18.47",
4
4
  "type": "module",
5
5
  "description": "A package containing various Alloy framework components and helper utilities.",
6
6
  "repository": {
@@ -360,7 +360,7 @@
360
360
  "@alloy-js/markdown": "^0.22.0",
361
361
  "@alloy-js/rollup-plugin": "^0.1.0",
362
362
  "@alloy-js/typescript": "^0.22.0",
363
- "@powerlines/deepkit": "^0.5.77",
363
+ "@powerlines/deepkit": "^0.5.78",
364
364
  "@storm-software/config-tools": "^1.188.80",
365
365
  "@stryke/capnp": "^0.12.55",
366
366
  "@stryke/convert": "^0.6.32",
@@ -373,13 +373,13 @@
373
373
  "@stryke/types": "^0.10.31",
374
374
  "@stryke/unique-id": "^0.3.41",
375
375
  "defu": "^6.1.4",
376
- "powerlines": "^0.37.34",
376
+ "powerlines": "^0.37.35",
377
377
  "prettier": "^3.8.0"
378
378
  },
379
379
  "devDependencies": {
380
- "@powerlines/plugin-plugin": "^0.12.112",
380
+ "@powerlines/plugin-plugin": "^0.12.113",
381
381
  "@types/node": "^24.10.8"
382
382
  },
383
383
  "publishConfig": { "access": "public" },
384
- "gitHead": "2b048de9f7fe2c6d953dd8452da1503422358581"
384
+ "gitHead": "65656903e05b8a85e4d46f7449a8c2bd8f90332e"
385
385
  }
@@ -1,7 +0,0 @@
1
- const require_core_components_output = require('./output.cjs');
2
- const require_core_components_single_line_comment = require('./single-line-comment.cjs');
3
- const require_core_components_source_file = require('./source-file.cjs');
4
-
5
- exports.Output = require_core_components_output.Output;
6
- exports.SingleLineComment = require_core_components_single_line_comment.SingleLineComment;
7
- exports.SourceFile = require_core_components_source_file.SourceFile;
@@ -1,4 +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
- export { Output, OutputProps, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, __ΩOutputProps, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps };
@@ -1,4 +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
- export { Output, OutputProps, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, __ΩOutputProps, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps };
@@ -1,5 +0,0 @@
1
- import { Output } from "./output.mjs";
2
- import { SingleLineComment } from "./single-line-comment.mjs";
3
- import { SourceFile } from "./source-file.mjs";
4
-
5
- export { Output, SingleLineComment, SourceFile };
@@ -1,23 +0,0 @@
1
- import { PluginContext } from "../../powerlines/src/types/context.cjs";
2
- import { MetaItem } from "../contexts/context.cjs";
3
- import * as _alloy_js_core1 from "@alloy-js/core";
4
- import { OutputProps as OutputProps$1 } from "@alloy-js/core";
5
-
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$1 {
8
- /**
9
- * The current Powerlines process context.
10
- */
11
- context: TContext;
12
- /**
13
- * Metadata for the current render.
14
- */
15
- meta?: TMeta;
16
- }
17
- /**
18
- * Output component for rendering the Powerlines plugin's output files via templates.
19
- */
20
- declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core1.Children;
21
- declare type __ΩOutputProps = any[];
22
- //#endregion
23
- export { Output, OutputProps, __ΩOutputProps };
@@ -1,23 +0,0 @@
1
- import { PluginContext } from "../../powerlines/src/types/context.mjs";
2
- import { MetaItem } from "../contexts/context.mjs";
3
- import * as _alloy_js_core6 from "@alloy-js/core";
4
- import { OutputProps as OutputProps$1 } from "@alloy-js/core";
5
-
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$1 {
8
- /**
9
- * The current Powerlines process context.
10
- */
11
- context: TContext;
12
- /**
13
- * Metadata for the current render.
14
- */
15
- meta?: TMeta;
16
- }
17
- /**
18
- * Output component for rendering the Powerlines plugin's output files via templates.
19
- */
20
- declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core6.Children;
21
- declare type __ΩOutputProps = any[];
22
- //#endregion
23
- export { Output, OutputProps, __ΩOutputProps };
@@ -1,22 +0,0 @@
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/core/components/single-line-comment.tsx
6
- /**
7
- * A single line comment block. The children are rendered as a prose element, which means that they
8
- * are broken into multiple lines
9
- */
10
- function SingleLineComment(props) {
11
- const { variant = "double-slash", children } = props;
12
- const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : "// ";
13
- return [commentStart, (0, __alloy_js_core_jsx_runtime.createIntrinsic)("align", {
14
- string: commentStart,
15
- get children() {
16
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""];
17
- }
18
- })];
19
- }
20
-
21
- //#endregion
22
- exports.SingleLineComment = SingleLineComment;
@@ -1,22 +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";
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 };
@@ -1,22 +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";
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 };
@@ -1,21 +0,0 @@
1
- import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { Prose } from "@alloy-js/core";
3
-
4
- //#region src/core/components/single-line-comment.tsx
5
- /**
6
- * A single line comment block. The children are rendered as a prose element, which means that they
7
- * are broken into multiple lines
8
- */
9
- function SingleLineComment(props) {
10
- const { variant = "double-slash", children } = props;
11
- const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : "// ";
12
- return [commentStart, createIntrinsic("align", {
13
- string: commentStart,
14
- get children() {
15
- return [createComponent(Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""];
16
- }
17
- })];
18
- }
19
-
20
- //#endregion
21
- export { SingleLineComment };
@@ -1,64 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_core_contexts_context = require('../contexts/context.cjs');
3
- require('../contexts/index.cjs');
4
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
- let __alloy_js_core = require("@alloy-js/core");
6
- let __stryke_path_append = require("@stryke/path/append");
7
- let defu = require("defu");
8
- defu = require_rolldown_runtime.__toESM(defu);
9
-
10
- //#region src/core/components/source-file.tsx
11
- /**
12
- * A base component representing a Powerlines generated source file.
13
- *
14
- * @param props - The properties for the source file.
15
- * @returns The rendered source file component.
16
- */
17
- function SourceFile(props) {
18
- const [{ children, meta, path, header, storage, filetype, reference }] = (0, __alloy_js_core.splitProps)(props, [
19
- "children",
20
- "meta",
21
- "path",
22
- "header",
23
- "storage",
24
- "filetype",
25
- "reference"
26
- ]);
27
- const metadata = require_core_contexts_context.useMetaSafe();
28
- const parentDirectory = (0, __alloy_js_core.useContext)(__alloy_js_core.SourceDirectoryContext);
29
- const sourceFile = {
30
- path: (0, __stryke_path_append.appendPath)(path, parentDirectory.path),
31
- filetype,
32
- reference
33
- };
34
- parentDirectory?.addContent(sourceFile);
35
- const printOptions = (0, __alloy_js_core.useFormatOptions)({
36
- printWidth: props.printWidth,
37
- tabWidth: props.tabWidth,
38
- useTabs: props.useTabs,
39
- insertFinalNewLine: props.insertFinalNewLine
40
- });
41
- const nodeContext = (0, __alloy_js_core.getContext)();
42
- nodeContext.meta = (0, defu.default)({
43
- sourceFile,
44
- printOptions
45
- }, meta ?? {});
46
- if (metadata) metadata[sourceFile.path] = {
47
- storage,
48
- ...meta ?? {}
49
- };
50
- return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.SourceFileContext.Provider, {
51
- value: sourceFile,
52
- get children() {
53
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
54
- when: header !== void 0,
55
- get children() {
56
- return [header, (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
57
- }
58
- }), children];
59
- }
60
- });
61
- }
62
-
63
- //#endregion
64
- exports.SourceFile = SourceFile;
@@ -1,32 +0,0 @@
1
- import { StoragePreset } from "../../powerlines/src/types/fs.cjs";
2
- import { ComponentProps } from "../../types/components.cjs";
3
- import * as _alloy_js_core0 from "@alloy-js/core";
4
- import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
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 };
@@ -1,32 +0,0 @@
1
- import { StoragePreset } from "../../powerlines/src/types/fs.mjs";
2
- import { ComponentProps } from "../../types/components.mjs";
3
- import * as _alloy_js_core0 from "@alloy-js/core";
4
- import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
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 };
@@ -1,62 +0,0 @@
1
- import { useMetaSafe } from "../contexts/context.mjs";
2
- import "../contexts/index.mjs";
3
- import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
- import { Show, SourceDirectoryContext, SourceFileContext, getContext, splitProps, useContext, useFormatOptions } from "@alloy-js/core";
5
- import { appendPath } from "@stryke/path/append";
6
- import defu from "defu";
7
-
8
- //#region src/core/components/source-file.tsx
9
- /**
10
- * A base component representing a Powerlines generated source file.
11
- *
12
- * @param props - The properties for the source file.
13
- * @returns The rendered source file component.
14
- */
15
- function SourceFile(props) {
16
- const [{ children, meta, path, header, storage, filetype, reference }] = splitProps(props, [
17
- "children",
18
- "meta",
19
- "path",
20
- "header",
21
- "storage",
22
- "filetype",
23
- "reference"
24
- ]);
25
- const metadata = useMetaSafe();
26
- const parentDirectory = useContext(SourceDirectoryContext);
27
- const sourceFile = {
28
- path: appendPath(path, parentDirectory.path),
29
- filetype,
30
- reference
31
- };
32
- parentDirectory?.addContent(sourceFile);
33
- const printOptions = useFormatOptions({
34
- printWidth: props.printWidth,
35
- tabWidth: props.tabWidth,
36
- useTabs: props.useTabs,
37
- insertFinalNewLine: props.insertFinalNewLine
38
- });
39
- const nodeContext = getContext();
40
- nodeContext.meta = defu({
41
- sourceFile,
42
- printOptions
43
- }, meta ?? {});
44
- if (metadata) metadata[sourceFile.path] = {
45
- storage,
46
- ...meta ?? {}
47
- };
48
- return createComponent(SourceFileContext.Provider, {
49
- value: sourceFile,
50
- get children() {
51
- return [createComponent(Show, {
52
- when: header !== void 0,
53
- get children() {
54
- return [header, createIntrinsic("hbr", {})];
55
- }
56
- }), children];
57
- }
58
- });
59
- }
60
-
61
- //#endregion
62
- export { SourceFile };
@@ -1,71 +0,0 @@
1
- import { StoragePreset } from "../../powerlines/src/types/fs.cjs";
2
- import { PluginContext } from "../../powerlines/src/types/context.cjs";
3
- import { ComponentContext, Ref } from "@alloy-js/core";
4
-
5
- //#region src/core/contexts/context.d.ts
6
- interface MetaItem {
7
- /**
8
- * The kind of metadata item.
9
- */
10
- kind?: "builtin" | "entry" | string;
11
- /**
12
- * Whether to skip formatting for this output.
13
- */
14
- skipFormat?: boolean;
15
- /**
16
- * The storage preset or adapter name for the output files.
17
- *
18
- * @remarks
19
- * If not specified, the output mode will be determined by the provided `output.mode` value.
20
- */
21
- storage?: StoragePreset | string;
22
- [key: string]: any;
23
- }
24
- interface PowerlinesContextInterface<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> {
25
- /**
26
- * The current Powerlines context.
27
- */
28
- ref: Ref<TContext>;
29
- /**
30
- * The current render metadata.
31
- */
32
- meta: Ref<TMeta>;
33
- }
34
- /**
35
- * The Powerlines context used in template rendering.
36
- */
37
- declare const PowerlinesContext: ComponentContext<PowerlinesContextInterface<any, any>>;
38
- /**
39
- * Hook to access the Powerlines Context.
40
- *
41
- * @returns The Context.
42
- */
43
- declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> | undefined;
44
- /**
45
- * Hook to safely access the {@link PluginContext | Powerlines context}.
46
- *
47
- * @returns The Powerlines context or undefined if not set.
48
- */
49
- declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | undefined;
50
- /**
51
- * Hook to access the {@link PluginContext | Powerlines context}.
52
- *
53
- * @returns The Powerlines context.
54
- */
55
- declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
56
- /**
57
- * Hook to safely access the render context's metadata.
58
- *
59
- * @returns The Powerlines context or undefined if not set.
60
- */
61
- declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta | undefined;
62
- /**
63
- * Hook to access the render context's metadata.
64
- *
65
- * @returns The Powerlines context.
66
- */
67
- declare function useMeta<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta;
68
- declare type __ΩMetaItem = any[];
69
- declare type __ΩPowerlinesContextInterface = any[];
70
- //#endregion
71
- export { MetaItem, PowerlinesContext, PowerlinesContextInterface, __ΩMetaItem, __ΩPowerlinesContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
@@ -1,71 +0,0 @@
1
- import { StoragePreset } from "../../powerlines/src/types/fs.mjs";
2
- import { PluginContext } from "../../powerlines/src/types/context.mjs";
3
- import { ComponentContext, Ref } from "@alloy-js/core";
4
-
5
- //#region src/core/contexts/context.d.ts
6
- interface MetaItem {
7
- /**
8
- * The kind of metadata item.
9
- */
10
- kind?: "builtin" | "entry" | string;
11
- /**
12
- * Whether to skip formatting for this output.
13
- */
14
- skipFormat?: boolean;
15
- /**
16
- * The storage preset or adapter name for the output files.
17
- *
18
- * @remarks
19
- * If not specified, the output mode will be determined by the provided `output.mode` value.
20
- */
21
- storage?: StoragePreset | string;
22
- [key: string]: any;
23
- }
24
- interface PowerlinesContextInterface<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>> {
25
- /**
26
- * The current Powerlines context.
27
- */
28
- ref: Ref<TContext>;
29
- /**
30
- * The current render metadata.
31
- */
32
- meta: Ref<TMeta>;
33
- }
34
- /**
35
- * The Powerlines context used in template rendering.
36
- */
37
- declare const PowerlinesContext: ComponentContext<PowerlinesContextInterface<any, any>>;
38
- /**
39
- * Hook to access the Powerlines Context.
40
- *
41
- * @returns The Context.
42
- */
43
- declare function usePowerlinesContext<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): PowerlinesContextInterface<TContext, TMeta> | undefined;
44
- /**
45
- * Hook to safely access the {@link PluginContext | Powerlines context}.
46
- *
47
- * @returns The Powerlines context or undefined if not set.
48
- */
49
- declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | undefined;
50
- /**
51
- * Hook to access the {@link PluginContext | Powerlines context}.
52
- *
53
- * @returns The Powerlines context.
54
- */
55
- declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
56
- /**
57
- * Hook to safely access the render context's metadata.
58
- *
59
- * @returns The Powerlines context or undefined if not set.
60
- */
61
- declare function useMetaSafe<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta | undefined;
62
- /**
63
- * Hook to access the render context's metadata.
64
- *
65
- * @returns The Powerlines context.
66
- */
67
- declare function useMeta<TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(): TMeta;
68
- declare type __ΩMetaItem = any[];
69
- declare type __ΩPowerlinesContextInterface = any[];
70
- //#endregion
71
- export { MetaItem, PowerlinesContext, PowerlinesContextInterface, __ΩMetaItem, __ΩPowerlinesContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
@@ -1,17 +0,0 @@
1
- const require_core_contexts_context = require('./context.cjs');
2
- const require_core_contexts_reflection = require('./reflection.cjs');
3
-
4
- exports.PowerlinesContext = require_core_contexts_context.PowerlinesContext;
5
- exports.ReflectionClassContext = require_core_contexts_reflection.ReflectionClassContext;
6
- exports.ReflectionMethodContext = require_core_contexts_reflection.ReflectionMethodContext;
7
- exports.ReflectionParameterContext = require_core_contexts_reflection.ReflectionParameterContext;
8
- exports.ReflectionPropertyContext = require_core_contexts_reflection.ReflectionPropertyContext;
9
- exports.useMeta = require_core_contexts_context.useMeta;
10
- exports.useMetaSafe = require_core_contexts_context.useMetaSafe;
11
- exports.usePowerlines = require_core_contexts_context.usePowerlines;
12
- exports.usePowerlinesContext = require_core_contexts_context.usePowerlinesContext;
13
- exports.usePowerlinesSafe = require_core_contexts_context.usePowerlinesSafe;
14
- exports.useReflectionClass = require_core_contexts_reflection.useReflectionClass;
15
- exports.useReflectionMethod = require_core_contexts_reflection.useReflectionMethod;
16
- exports.useReflectionParameter = require_core_contexts_reflection.useReflectionParameter;
17
- exports.useReflectionProperty = require_core_contexts_reflection.useReflectionProperty;
@@ -1,3 +0,0 @@
1
- import { MetaItem, PowerlinesContext, PowerlinesContextInterface, __ΩMetaItem, __ΩPowerlinesContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.cjs";
2
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.cjs";
3
- export { MetaItem, PowerlinesContext, PowerlinesContextInterface, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩMetaItem, __ΩPowerlinesContextInterface, __ΩReflectionClassContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,3 +0,0 @@
1
- import { MetaItem, PowerlinesContext, PowerlinesContextInterface, __ΩMetaItem, __ΩPowerlinesContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.mjs";
2
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.mjs";
3
- export { MetaItem, PowerlinesContext, PowerlinesContextInterface, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩMetaItem, __ΩPowerlinesContextInterface, __ΩReflectionClassContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,4 +0,0 @@
1
- import { PowerlinesContext, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.mjs";
2
- import { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.mjs";
3
-
4
- export { PowerlinesContext, ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };