@powerlines/plugin-alloy 0.26.75 → 0.26.77

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 (164) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/core/components/index.cjs +12 -1
  3. package/dist/core/components/index.mjs +7 -1
  4. package/dist/core/components/infrastructure-file.cjs +48 -1
  5. package/dist/core/components/infrastructure-file.mjs +45 -1
  6. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  7. package/dist/core/components/output.cjs +41 -1
  8. package/dist/core/components/output.mjs +39 -1
  9. package/dist/core/components/output.mjs.map +1 -1
  10. package/dist/core/components/single-line-comment.cjs +23 -1
  11. package/dist/core/components/single-line-comment.mjs +21 -1
  12. package/dist/core/components/single-line-comment.mjs.map +1 -1
  13. package/dist/core/components/source-file.cjs +64 -1
  14. package/dist/core/components/source-file.mjs +61 -1
  15. package/dist/core/components/source-file.mjs.map +1 -1
  16. package/dist/core/components/spacing.cjs +20 -1
  17. package/dist/core/components/spacing.mjs +18 -1
  18. package/dist/core/components/spacing.mjs.map +1 -1
  19. package/dist/core/contexts/context.cjs +41 -1
  20. package/dist/core/contexts/context.mjs +36 -1
  21. package/dist/core/contexts/context.mjs.map +1 -1
  22. package/dist/core/contexts/index.cjs +22 -1
  23. package/dist/core/contexts/index.mjs +5 -1
  24. package/dist/core/contexts/meta.cjs +41 -1
  25. package/dist/core/contexts/meta.mjs +36 -1
  26. package/dist/core/contexts/meta.mjs.map +1 -1
  27. package/dist/core/contexts/reflection.cjs +80 -1
  28. package/dist/core/contexts/reflection.mjs +70 -1
  29. package/dist/core/contexts/reflection.mjs.map +1 -1
  30. package/dist/core/helpers/code.cjs +34 -1
  31. package/dist/core/helpers/code.mjs +32 -1
  32. package/dist/core/helpers/code.mjs.map +1 -1
  33. package/dist/core/helpers/index.cjs +4 -1
  34. package/dist/core/helpers/index.mjs +3 -1
  35. package/dist/core/index.cjs +37 -1
  36. package/dist/core/index.mjs +14 -1
  37. package/dist/hcl/components/block-declaration.cjs +34 -1
  38. package/dist/hcl/components/block-declaration.mjs +32 -1
  39. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  40. package/dist/hcl/components/hcl-file.cjs +83 -1
  41. package/dist/hcl/components/hcl-file.mjs +80 -1
  42. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  43. package/dist/hcl/components/index.cjs +11 -1
  44. package/dist/hcl/components/index.mjs +6 -1
  45. package/dist/hcl/components/packer-file.cjs +29 -1
  46. package/dist/hcl/components/packer-file.mjs +27 -1
  47. package/dist/hcl/components/packer-file.mjs.map +1 -1
  48. package/dist/hcl/components/terraform-file.cjs +30 -1
  49. package/dist/hcl/components/terraform-file.mjs +28 -1
  50. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  51. package/dist/hcl/index.cjs +12 -1
  52. package/dist/hcl/index.mjs +7 -1
  53. package/dist/helpers/capnp.cjs +245 -37
  54. package/dist/helpers/capnp.mjs +227 -37
  55. package/dist/helpers/capnp.mjs.map +1 -1
  56. package/dist/helpers/create-builtin.cjs +20 -1
  57. package/dist/helpers/create-builtin.mjs +18 -1
  58. package/dist/helpers/create-builtin.mjs.map +1 -1
  59. package/dist/helpers/index.cjs +25 -1
  60. package/dist/helpers/index.mjs +6 -1
  61. package/dist/helpers/refkey.cjs +17 -1
  62. package/dist/helpers/refkey.mjs +15 -1
  63. package/dist/helpers/refkey.mjs.map +1 -1
  64. package/dist/helpers/typescript.cjs +43 -19
  65. package/dist/helpers/typescript.mjs +41 -19
  66. package/dist/helpers/typescript.mjs.map +1 -1
  67. package/dist/index.cjs +55 -1
  68. package/dist/index.mjs +51 -1
  69. package/dist/index.mjs.map +1 -1
  70. package/dist/markdown/components/front-matter.cjs +29 -1
  71. package/dist/markdown/components/front-matter.mjs +27 -1
  72. package/dist/markdown/components/front-matter.mjs.map +1 -1
  73. package/dist/markdown/components/heading.cjs +24 -1
  74. package/dist/markdown/components/heading.mjs +22 -1
  75. package/dist/markdown/components/heading.mjs.map +1 -1
  76. package/dist/markdown/components/index.cjs +13 -1
  77. package/dist/markdown/components/index.mjs +6 -1
  78. package/dist/markdown/components/markdown-file.cjs +135 -1
  79. package/dist/markdown/components/markdown-file.mjs +132 -1
  80. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  81. package/dist/markdown/components/markdown-table.cjs +102 -1
  82. package/dist/markdown/components/markdown-table.mjs +98 -1
  83. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  84. package/dist/markdown/contexts/index.cjs +7 -1
  85. package/dist/markdown/contexts/index.mjs +3 -1
  86. package/dist/markdown/contexts/markdown-table.cjs +38 -1
  87. package/dist/markdown/contexts/markdown-table.mjs +33 -1
  88. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  89. package/dist/markdown/index.cjs +20 -1
  90. package/dist/markdown/index.mjs +9 -1
  91. package/dist/render.cjs +91 -1
  92. package/dist/render.mjs +88 -1
  93. package/dist/render.mjs.map +1 -1
  94. package/dist/types/components.cjs +9 -0
  95. package/dist/types/components.mjs +9 -1
  96. package/dist/types/index.mjs +1 -1
  97. package/dist/types/plugin.mjs +1 -1
  98. package/dist/typescript/components/builtin-file.cjs +63 -1
  99. package/dist/typescript/components/builtin-file.mjs +61 -1
  100. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  101. package/dist/typescript/components/class-declaration.cjs +306 -1
  102. package/dist/typescript/components/class-declaration.mjs +299 -1
  103. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  104. package/dist/typescript/components/dynamic-import-statement.cjs +26 -1
  105. package/dist/typescript/components/dynamic-import-statement.mjs +24 -1
  106. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  107. package/dist/typescript/components/entry-file.cjs +43 -1
  108. package/dist/typescript/components/entry-file.mjs +40 -1
  109. package/dist/typescript/components/entry-file.mjs.map +1 -1
  110. package/dist/typescript/components/index.cjs +64 -1
  111. package/dist/typescript/components/index.mjs +15 -1
  112. package/dist/typescript/components/interface-declaration.cjs +239 -1
  113. package/dist/typescript/components/interface-declaration.mjs +234 -1
  114. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  115. package/dist/typescript/components/object-declaration.cjs +139 -1
  116. package/dist/typescript/components/object-declaration.mjs +136 -1
  117. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  118. package/dist/typescript/components/property-name.cjs +32 -1
  119. package/dist/typescript/components/property-name.mjs +30 -1
  120. package/dist/typescript/components/property-name.mjs.map +1 -1
  121. package/dist/typescript/components/record-expression.cjs +13 -3
  122. package/dist/typescript/components/record-expression.mjs +11 -3
  123. package/dist/typescript/components/record-expression.mjs.map +1 -1
  124. package/dist/typescript/components/tsdoc-reflection.cjs +331 -1
  125. package/dist/typescript/components/tsdoc-reflection.mjs +324 -1
  126. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  127. package/dist/typescript/components/tsdoc.cjs +497 -1
  128. package/dist/typescript/components/tsdoc.mjs +475 -1
  129. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  130. package/dist/typescript/components/type-declaration.cjs +39 -1
  131. package/dist/typescript/components/type-declaration.mjs +37 -1
  132. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  133. package/dist/typescript/components/type-parameters.cjs +83 -1
  134. package/dist/typescript/components/type-parameters.mjs +81 -1
  135. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  136. package/dist/typescript/components/typescript-file.cjs +221 -1
  137. package/dist/typescript/components/typescript-file.mjs +217 -1
  138. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  139. package/dist/typescript/contexts/index.cjs +4 -1
  140. package/dist/typescript/contexts/index.mjs +3 -1
  141. package/dist/typescript/contexts/lexical-scope.cjs +26 -1
  142. package/dist/typescript/contexts/lexical-scope.mjs +24 -1
  143. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  144. package/dist/typescript/contexts/member-scope.cjs +24 -1
  145. package/dist/typescript/contexts/member-scope.mjs +22 -1
  146. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  147. package/dist/typescript/helpers/get-call-signature-props.cjs +26 -1
  148. package/dist/typescript/helpers/get-call-signature-props.mjs +24 -1
  149. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  150. package/dist/typescript/helpers/index.cjs +6 -1
  151. package/dist/typescript/helpers/index.mjs +4 -1
  152. package/dist/typescript/helpers/utilities.cjs +15 -1
  153. package/dist/typescript/helpers/utilities.mjs +13 -1
  154. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  155. package/dist/typescript/index.cjs +73 -1
  156. package/dist/typescript/index.mjs +21 -1
  157. package/dist/yaml/components/index.cjs +5 -1
  158. package/dist/yaml/components/index.mjs +3 -1
  159. package/dist/yaml/components/yaml-file.cjs +149 -1
  160. package/dist/yaml/components/yaml-file.mjs +146 -1
  161. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  162. package/dist/yaml/index.cjs +6 -1
  163. package/dist/yaml/index.mjs +4 -1
  164. package/package.json +6 -6
@@ -1 +1,29 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -1 +1,12 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./source-file.cjs`),t=require(`./infrastructure-file.cjs`),n=require(`./output.cjs`),r=require(`./single-line-comment.cjs`),i=require(`./spacing.cjs`);exports.InfrastructureFile=t.InfrastructureFile,exports.Output=n.Output,exports.SingleLineComment=r.SingleLineComment,exports.SourceFile=e.SourceFile,exports.Spacing=i.Spacing;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_core_components_source_file = require('./source-file.cjs');
3
+ const require_core_components_infrastructure_file = require('./infrastructure-file.cjs');
4
+ const require_core_components_output = require('./output.cjs');
5
+ const require_core_components_single_line_comment = require('./single-line-comment.cjs');
6
+ const require_core_components_spacing = require('./spacing.cjs');
7
+
8
+ exports.InfrastructureFile = require_core_components_infrastructure_file.InfrastructureFile;
9
+ exports.Output = require_core_components_output.Output;
10
+ exports.SingleLineComment = require_core_components_single_line_comment.SingleLineComment;
11
+ exports.SourceFile = require_core_components_source_file.SourceFile;
12
+ exports.Spacing = require_core_components_spacing.Spacing;
@@ -1 +1,7 @@
1
- import{SourceFile as e}from"./source-file.mjs";import{InfrastructureFile as t}from"./infrastructure-file.mjs";import{Output as n}from"./output.mjs";import{SingleLineComment as r}from"./single-line-comment.mjs";import{Spacing as i}from"./spacing.mjs";export{t as InfrastructureFile,n as Output,r as SingleLineComment,e as SourceFile,i as Spacing};
1
+ import { SourceFile } from "./source-file.mjs";
2
+ import { InfrastructureFile } from "./infrastructure-file.mjs";
3
+ import { Output } from "./output.mjs";
4
+ import { SingleLineComment } from "./single-line-comment.mjs";
5
+ import { Spacing } from "./spacing.mjs";
6
+
7
+ export { InfrastructureFile, Output, SingleLineComment, SourceFile, Spacing };
@@ -1 +1,48 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../contexts/context.cjs`),n=require(`./source-file.cjs`);let r=require(`@stryke/path/file-path-fns`),i=require(`@alloy-js/core/jsx-runtime`),a=require(`@alloy-js/core`),o=require(`@stryke/path/append`),s=require(`@stryke/path/replace`),c=require(`defu`);c=e.__toESM(c);function l(e){let[{children:l,meta:u,id:d,extension:f,filetype:p},m]=(0,a.splitProps)(e,[`children`,`meta`,`id`,`extension`,`filetype`]),h=t.usePowerlinesSafe(),g=(0,a.computed)(()=>p||f?.replace(/^\.*/,``)||((0,r.hasFileExtension)(d)?(0,r.findFileExtensionSafe)(d):``)),_=(0,a.computed)(()=>(0,o.appendExtension)((0,s.replaceExtension)(h?(0,o.appendPath)(d,(0,s.replacePath)(h.infrastructurePath,h.config.cwd)):d),g.value));return(0,i.createComponent)(n.SourceFile,(0,i.mergeProps)(m,{get filetype(){return g.value},get path(){return _.value},get meta(){return(0,c.default)({kind:`infrastructure`},u??{})},children:l}))}exports.InfrastructureFile=l;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_contexts_context = require('../contexts/context.cjs');
4
+ const require_core_components_source_file = require('./source-file.cjs');
5
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
8
+ let _stryke_path_append = require("@stryke/path/append");
9
+ let _stryke_path_replace = require("@stryke/path/replace");
10
+ let defu = require("defu");
11
+ defu = require_runtime.__toESM(defu);
12
+
13
+ //#region src/core/components/infrastructure-file.tsx
14
+ /**
15
+ * A base component representing a Powerlines generated infrastructure file.
16
+ *
17
+ * @param props - The properties for the infrastructure file.
18
+ * @returns The rendered infrastructure file component.
19
+ */
20
+ function InfrastructureFile(props) {
21
+ const [{ children, meta, id, extension, filetype: _filetype }, rest] = (0, _alloy_js_core.splitProps)(props, [
22
+ "children",
23
+ "meta",
24
+ "id",
25
+ "extension",
26
+ "filetype"
27
+ ]);
28
+ const context = require_core_contexts_context.usePowerlinesSafe();
29
+ const filetype = (0, _alloy_js_core.computed)(() => _filetype || extension?.replace(/^\.*/, "") || ((0, _stryke_path_file_path_fns.hasFileExtension)(id) ? (0, _stryke_path_file_path_fns.findFileExtensionSafe)(id) : ""));
30
+ const path = (0, _alloy_js_core.computed)(() => {
31
+ return (0, _stryke_path_append.appendExtension)((0, _stryke_path_replace.replaceExtension)(context ? (0, _stryke_path_append.appendPath)(id, (0, _stryke_path_replace.replacePath)(context.infrastructurePath, context.config.cwd)) : id), filetype.value);
32
+ });
33
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
34
+ get filetype() {
35
+ return filetype.value;
36
+ },
37
+ get path() {
38
+ return path.value;
39
+ },
40
+ get meta() {
41
+ return (0, defu.default)({ kind: "infrastructure" }, meta ?? {});
42
+ },
43
+ children
44
+ }));
45
+ }
46
+
47
+ //#endregion
48
+ exports.InfrastructureFile = InfrastructureFile;
@@ -1,2 +1,46 @@
1
- import{usePowerlinesSafe as e}from"../contexts/context.mjs";import{SourceFile as t}from"./source-file.mjs";import{findFileExtensionSafe as n,hasFileExtension as r}from"@stryke/path/file-path-fns";import{createComponent as i,mergeProps as a}from"@alloy-js/core/jsx-runtime";import{computed as o,splitProps as s}from"@alloy-js/core";import{appendExtension as c,appendPath as l}from"@stryke/path/append";import{replaceExtension as u,replacePath as d}from"@stryke/path/replace";import f from"defu";function p(p){let[{children:m,meta:h,id:g,extension:_,filetype:v},y]=s(p,[`children`,`meta`,`id`,`extension`,`filetype`]),b=e(),x=o(()=>v||_?.replace(/^\.*/,``)||(r(g)?n(g):``)),S=o(()=>c(u(b?l(g,d(b.infrastructurePath,b.config.cwd)):g),x.value));return i(t,a(y,{get filetype(){return x.value},get path(){return S.value},get meta(){return f({kind:`infrastructure`},h??{})},children:m}))}export{p as InfrastructureFile};
1
+ import { usePowerlinesSafe } from "../contexts/context.mjs";
2
+ import { SourceFile } from "./source-file.mjs";
3
+ import { findFileExtensionSafe, hasFileExtension } from "@stryke/path/file-path-fns";
4
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { computed, splitProps } from "@alloy-js/core";
6
+ import { appendExtension, appendPath } from "@stryke/path/append";
7
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
8
+ import defu from "defu";
9
+
10
+ //#region src/core/components/infrastructure-file.tsx
11
+ /**
12
+ * A base component representing a Powerlines generated infrastructure file.
13
+ *
14
+ * @param props - The properties for the infrastructure file.
15
+ * @returns The rendered infrastructure file component.
16
+ */
17
+ function InfrastructureFile(props) {
18
+ const [{ children, meta, id, extension, filetype: _filetype }, rest] = splitProps(props, [
19
+ "children",
20
+ "meta",
21
+ "id",
22
+ "extension",
23
+ "filetype"
24
+ ]);
25
+ const context = usePowerlinesSafe();
26
+ const filetype = computed(() => _filetype || extension?.replace(/^\.*/, "") || (hasFileExtension(id) ? findFileExtensionSafe(id) : ""));
27
+ const path = computed(() => {
28
+ return appendExtension(replaceExtension(context ? appendPath(id, replacePath(context.infrastructurePath, context.config.cwd)) : id), filetype.value);
29
+ });
30
+ return createComponent(SourceFile, mergeProps(rest, {
31
+ get filetype() {
32
+ return filetype.value;
33
+ },
34
+ get path() {
35
+ return path.value;
36
+ },
37
+ get meta() {
38
+ return defu({ kind: "infrastructure" }, meta ?? {});
39
+ },
40
+ children
41
+ }));
42
+ }
43
+
44
+ //#endregion
45
+ export { InfrastructureFile };
2
46
  //# sourceMappingURL=infrastructure-file.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"infrastructure-file.mjs","names":[],"sources":["../../../src/core/components/infrastructure-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 { computed, splitProps } from \"@alloy-js/core\";\nimport { appendExtension, appendPath } from \"@stryke/path/append\";\nimport {\n findFileExtensionSafe,\n hasFileExtension\n} from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { SourceFile, SourceFileProps } from \"./source-file\";\n\nexport type InfrastructureFileProps = Omit<SourceFileProps, \"path\"> & {\n /**\n * The infrastructure module identifier.\n */\n id: string;\n\n /**\n * The extension for the infrastructure file. This is used to determine the file extension if the `id` does not already include one.\n *\n * @remarks\n * If none is provided, the file extension will be determined by the {@link SourceFileProps.filetype | filetype} property.\n */\n extension?: string;\n};\n\n/**\n * A base component representing a Powerlines generated infrastructure file.\n *\n * @param props - The properties for the infrastructure file.\n * @returns The rendered infrastructure file component.\n */\nexport function InfrastructureFile(props: InfrastructureFileProps) {\n const [{ children, meta, id, extension, filetype: _filetype }, rest] =\n splitProps(props, [\"children\", \"meta\", \"id\", \"extension\", \"filetype\"]);\n\n const context = usePowerlinesSafe();\n const filetype = computed(\n () =>\n _filetype ||\n extension?.replace(/^\\.*/, \"\") ||\n (hasFileExtension(id) ? findFileExtensionSafe(id) : \"\")\n );\n const path = computed(() => {\n const value = context\n ? appendPath(\n id,\n replacePath(context.infrastructurePath, context.config.cwd)\n )\n : id;\n\n return appendExtension(replaceExtension(value), filetype.value);\n });\n\n return (\n <SourceFile\n {...rest}\n filetype={filetype.value}\n path={path.value}\n meta={defu(\n {\n kind: \"infrastructure\"\n },\n meta ?? {}\n )}>\n {children}\n </SourceFile>\n );\n}\n"],"mappings":"8eAgCA,SAAI,EAAA,EAAA,CACF,GAAI,CAAA,CAAA,WAEF,OACA,KACD,YACC,SAAE,GACD,GAAQ,EAAW,EAAM,CAAA,WAAc,OAAQ,KAAC,YAAkB,WAAO,CAAA,CAC1E,EAAA,GAAA,CACF,EAAY,MAAM,GAAA,GAAA,QAAA,OAAA,GAAA,GAAA,EAAA,EAAA,CAAA,EAAA,EAAA,CAAA,IAAA,CACnB,EAAA,MAEC,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,mBAAA,EAAA,OAAA,IAAA,CAAA,CAAA,EAAA,CAAA,EAAA,MAAA,CACE,CACH,OAAA,EAAA,EAAA,EAAA,EAAA,CACG,IAAA,UAAc,CACd,OAAQ,EAAI,OAEhB,IAAO,MAAQ,CACb,OAAS,EAAA,kBAGT,OAAM,EAAU,CACV,KAAA,iBACD,CAAC,GAAA,EAAA,CAAA,EAEF,WACH,CAAC,CAAC"}
1
+ {"version":3,"file":"infrastructure-file.mjs","names":[],"sources":["../../../src/core/components/infrastructure-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 { computed, splitProps } from \"@alloy-js/core\";\nimport { appendExtension, appendPath } from \"@stryke/path/append\";\nimport {\n findFileExtensionSafe,\n hasFileExtension\n} from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { SourceFile, SourceFileProps } from \"./source-file\";\n\nexport type InfrastructureFileProps = Omit<SourceFileProps, \"path\"> & {\n /**\n * The infrastructure module identifier.\n */\n id: string;\n\n /**\n * The extension for the infrastructure file. This is used to determine the file extension if the `id` does not already include one.\n *\n * @remarks\n * If none is provided, the file extension will be determined by the {@link SourceFileProps.filetype | filetype} property.\n */\n extension?: string;\n};\n\n/**\n * A base component representing a Powerlines generated infrastructure file.\n *\n * @param props - The properties for the infrastructure file.\n * @returns The rendered infrastructure file component.\n */\nexport function InfrastructureFile(props: InfrastructureFileProps) {\n const [{ children, meta, id, extension, filetype: _filetype }, rest] =\n splitProps(props, [\"children\", \"meta\", \"id\", \"extension\", \"filetype\"]);\n\n const context = usePowerlinesSafe();\n const filetype = computed(\n () =>\n _filetype ||\n extension?.replace(/^\\.*/, \"\") ||\n (hasFileExtension(id) ? findFileExtensionSafe(id) : \"\")\n );\n const path = computed(() => {\n const value = context\n ? appendPath(\n id,\n replacePath(context.infrastructurePath, context.config.cwd)\n )\n : id;\n\n return appendExtension(replaceExtension(value), filetype.value);\n });\n\n return (\n <SourceFile\n {...rest}\n filetype={filetype.value}\n path={path.value}\n meta={defu(\n {\n kind: \"infrastructure\"\n },\n meta ?? {}\n )}>\n {children}\n </SourceFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,SAAI,mBAAA,OAAA;CACF,MAAI,CAAA,YAEF,MACA,IACD,WACC,UAAE,aACD,QAAQ,WAAW,OAAM;EAAA;EAAc;EAAQ;EAAC;EAAkB;EAAO,CAAA;CAC5E,MAAE,UAAA,mBAAA;CACF,MAAA,WAAY,eAAM,aAAA,WAAA,QAAA,QAAA,GAAA,KAAA,iBAAA,GAAA,GAAA,sBAAA,GAAA,GAAA,IAAA;CACnB,MAAA,OAAA,eAAA;AAEC,SAAA,gBAAA,4GAAA,EAAA,SAAA,MAAA;GACE;AACH,QAAA,gBAAA,YAAA,WAAA,MAAA;EACG,IAAA,WAAc;AACd,UAAQ,SAAI;;EAEhB,IAAO,OAAQ;AACb,UAAS,KAAA;;;AAGT,UAAM,KAAU,EACV,MAAA,kBACD,EAAC,QAAA,EAAA,CAAA;;EAEF;EACH,CAAC,CAAC"}
@@ -1 +1,41 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../contexts/context.cjs`),t=require(`../contexts/meta.cjs`);require(`../contexts/index.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`);function i(i){let[{children:a,context:o,meta:s={}},c]=(0,r.splitProps)(i,[`children`,`context`,`meta`]),l=(0,r.computed)(()=>o);return(0,n.createComponent)(t.MetaContext.Provider,{value:s,get children(){return(0,n.createComponent)(e.PowerlinesContext.Provider,{get value(){return l.value},get children(){return(0,n.createComponent)(r.Output,(0,n.mergeProps)(c,{get basePath(){return l.value.config.cwd},children:a}))}})}})}exports.Output=i;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_contexts_context = require('../contexts/context.cjs');
4
+ const require_core_contexts_meta = require('../contexts/meta.cjs');
5
+ require('../contexts/index.cjs');
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
8
+
9
+ //#region src/core/components/output.tsx
10
+ /**
11
+ * Output component for rendering the Powerlines plugin's output files via templates.
12
+ */
13
+ function Output(props) {
14
+ const [{ children, context, meta = {} }, rest] = (0, _alloy_js_core.splitProps)(props, [
15
+ "children",
16
+ "context",
17
+ "meta"
18
+ ]);
19
+ const contextRef = (0, _alloy_js_core.computed)(() => context);
20
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_meta.MetaContext.Provider, {
21
+ value: meta,
22
+ get children() {
23
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_context.PowerlinesContext.Provider, {
24
+ get value() {
25
+ return contextRef.value;
26
+ },
27
+ get children() {
28
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Output, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
29
+ get basePath() {
30
+ return contextRef.value.config.cwd;
31
+ },
32
+ children
33
+ }));
34
+ }
35
+ });
36
+ }
37
+ });
38
+ }
39
+
40
+ //#endregion
41
+ exports.Output = Output;
@@ -1,2 +1,40 @@
1
- import{PowerlinesContext as e}from"../contexts/context.mjs";import{MetaContext as t}from"../contexts/meta.mjs";import"../contexts/index.mjs";import{createComponent as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{Output as i,computed as a,splitProps as o}from"@alloy-js/core";function s(s){let[{children:c,context:l,meta:u={}},d]=o(s,[`children`,`context`,`meta`]),f=a(()=>l);return n(t.Provider,{value:u,get children(){return n(e.Provider,{get value(){return f.value},get children(){return n(i,r(d,{get basePath(){return f.value.config.cwd},children:c}))}})}})}export{s as Output};
1
+ import { PowerlinesContext } from "../contexts/context.mjs";
2
+ import { MetaContext } from "../contexts/meta.mjs";
3
+ import "../contexts/index.mjs";
4
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { Output as Output$1, computed, splitProps } from "@alloy-js/core";
6
+
7
+ //#region src/core/components/output.tsx
8
+ /**
9
+ * Output component for rendering the Powerlines plugin's output files via templates.
10
+ */
11
+ function Output(props) {
12
+ const [{ children, context, meta = {} }, rest] = splitProps(props, [
13
+ "children",
14
+ "context",
15
+ "meta"
16
+ ]);
17
+ const contextRef = computed(() => context);
18
+ return createComponent(MetaContext.Provider, {
19
+ value: meta,
20
+ get children() {
21
+ return createComponent(PowerlinesContext.Provider, {
22
+ get value() {
23
+ return contextRef.value;
24
+ },
25
+ get children() {
26
+ return createComponent(Output$1, mergeProps(rest, {
27
+ get basePath() {
28
+ return contextRef.value.config.cwd;
29
+ },
30
+ children
31
+ }));
32
+ }
33
+ });
34
+ }
35
+ });
36
+ }
37
+
38
+ //#endregion
39
+ export { Output };
2
40
  //# sourceMappingURL=output.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.mjs","names":[],"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 {...rest} basePath={contextRef.value.config.cwd}>\n {children}\n </OutputExternal>\n </PowerlinesContext.Provider>\n </MetaContext.Provider>\n );\n}\n"],"mappings":"gSAyBA,SAAW,EAAQ,EAAA,CACjB,GAAA,CAAO,CACL,WACA,UACA,OAAA,EAAA,EACF,GAAS,EAAQ,EAAA,CAAA,WAAA,UAAA,OAAA,CAAA,YAEjB,OAAE,EAAA,EAAA,SAAA,CACA,MAAK,EACL,IAAA,UAAA,CACE,OAAG,EAAe,EAAS,SAAA,CACjC,IAAA,OAAA,iBAGG,IAAO,UAAa,CACrB,OAAA,EAAA,EAAA,EAAA,EAAA,CACK,IAAS,UAAO,CACd,OAAY,EAAQ,MAAA,OAAA,KAER,WAChB,CAAA,CAAQ,EAER,CAAA"}
1
+ {"version":3,"file":"output.mjs","names":[],"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 {...rest} basePath={contextRef.value.config.cwd}>\n {children}\n </OutputExternal>\n </PowerlinesContext.Provider>\n </MetaContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;AAyBA,SAAW,OAAQ,OAAA;CACjB,MAAA,CAAO,EACL,UACA,SACA,OAAA,EAAA,IACF,QAAS,WAAQ,OAAA;EAAA;EAAA;EAAA;EAAA,CAAA;;AAEjB,QAAE,gBAAA,YAAA,UAAA;EACA,OAAK;EACL,IAAA,WAAA;AACE,UAAG,gBAAe,kBAAS,UAAA;IACjC,IAAA,QAAA;;;IAGG,IAAO,WAAa;AACrB,YAAA,gBAAA,UAAA,WAAA,MAAA;MACK,IAAS,WAAO;AACd,cAAY,WAAQ,MAAA,OAAA;;MAER;MAChB,CAAA,CAAQ;;IAER,CAAA"}
@@ -1 +1,23 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);function n(n){let{variant:r=`double-slash`,children:i}=n,a=r===`slash-star`?`/* `:r===`slash-star-star`?`/** `:r===`triple-slash`?`/// `:r===`markdown`?`<!-- `:r===`yaml`||r===`hcl`?`# `:`// `;return[a,(0,e.createIntrinsic)(`align`,{string:a,get children(){return[(0,e.createComponent)(t.Prose,{children:i}),r===`slash-star`||r===`slash-star-star`?` */ `:r===`markdown`?` -->`:``]}})]}exports.SingleLineComment=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
+
6
+ //#region src/core/components/single-line-comment.tsx
7
+ /**
8
+ * A single line comment block. The children are rendered as a prose element, which means that they
9
+ * are broken into multiple lines
10
+ */
11
+ function SingleLineComment(props) {
12
+ const { variant = "double-slash", children } = props;
13
+ const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : variant === "yaml" || variant === "hcl" ? "# " : "// ";
14
+ return [commentStart, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("align", {
15
+ string: commentStart,
16
+ get children() {
17
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""];
18
+ }
19
+ })];
20
+ }
21
+
22
+ //#endregion
23
+ exports.SingleLineComment = SingleLineComment;
@@ -1,2 +1,22 @@
1
- import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{Prose as n}from"@alloy-js/core";function r(r){let{variant:i=`double-slash`,children:a}=r,o=i===`slash-star`?`/* `:i===`slash-star-star`?`/** `:i===`triple-slash`?`/// `:i===`markdown`?`<!-- `:i===`yaml`||i===`hcl`?`# `:`// `;return[o,t(`align`,{string:o,get children(){return[e(n,{children:a}),i===`slash-star`||i===`slash-star-star`?` */ `:i===`markdown`?` -->`:``]}})]}export{r as SingleLineComment};
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" ? "<!-- " : variant === "yaml" || variant === "hcl" ? "# " : "// ";
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 };
2
22
  //# sourceMappingURL=single-line-comment.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"single-line-comment.mjs","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Prose } from \"@alloy-js/core\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type SingleLineCommentVariant =\n | \"double-slash\"\n | \"triple-slash\"\n | \"slash-star\"\n | \"slash-star-star\"\n | \"markdown\"\n | \"yaml\"\n | \"hcl\";\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\" || variant === \"hcl\"\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":"yHAyBA,SAAgB,EAAI,EAAA,CAClB,GAAG,CACD,UAAK,eACL,YAAA,EAEG,EAAU,IAAA,aAA+B,MAAA,IAAe,kBAAA,OAAA,IAAA,eAAA,OAAA,IAAA,WAAA,QAAA,IAAA,QAAA,IAAA,MAAA,KAAA,MAC7D,MAAE,CAAA,EAAA,EAAA,QAAA,CACA,OAAK,EACN,IAAA,UAAA,CACG,MAAA,CAAA,EAA0B,EAAA,CAC5B,WACF,CAAA,CAAQ,IAAE,cAAwB,IAAA,kBAAA,OAAA,IAAA,WAAA,OAAA,GAAA"}
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 | \"hcl\";\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\" || variant === \"hcl\"\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":";;;;;;;;AAyBA,SAAgB,kBAAI,OAAA;CAClB,MAAG,EACD,UAAK,gBACL;CAEJ,MAAO,eAAU,YAAA,eAA+B,QAAA,YAAe,oBAAA,SAAA,YAAA,iBAAA,SAAA,YAAA,aAAA,UAAA,YAAA,UAAA,YAAA,QAAA,OAAA;AAC7D,QAAE,CAAA,cAAA,gBAAA,SAAA;EACA,QAAK;EACN,IAAA,WAAA;AACG,UAAA,CAAA,gBAA0B,OAAA,EAC5B,UACF,CAAA,EAAQ,YAAE,gBAAwB,YAAA,oBAAA,SAAA,YAAA,aAAA,SAAA,GAAA"}
@@ -1 +1,64 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../contexts/meta.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@stryke/path/append`),a=require(`defu`);a=e.__toESM(a);function o(e){let[{children:o,meta:s,path:c,header:l,storage:u,filetype:d,reference:f}]=(0,r.splitProps)(e,[`children`,`meta`,`path`,`header`,`storage`,`filetype`,`reference`]),p=t.useMeta(),m=(0,r.useContext)(r.SourceDirectoryContext),h={path:(0,i.appendPath)(c,m.path),filetype:d,reference:f};m?.addContent(h);let g=(0,r.useFormatOptions)({printWidth:e.printWidth,tabWidth:e.tabWidth,useTabs:e.useTabs,insertFinalNewLine:e.insertFinalNewLine}),_=(0,r.getContext)();return _.meta=(0,a.default)({sourceFile:h,printOptions:g},s??{}),p&&(p[h.path]={storage:u,...s??{}}),(0,n.createComponent)(r.SourceFileContext.Provider,{value:h,get children(){return[(0,n.createComponent)(r.Show,{when:l!==void 0,get children(){return[l,(0,n.createIntrinsic)(`hbr`,{})]}}),o]}})}exports.SourceFile=o;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_contexts_meta = require('../contexts/meta.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_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_meta.useMeta();
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,2 +1,62 @@
1
- import{useMeta as e}from"../contexts/meta.mjs";import{createComponent as t,createIntrinsic as n}from"@alloy-js/core/jsx-runtime";import{Show as r,SourceDirectoryContext as i,SourceFileContext as a,getContext as o,splitProps as s,useContext as c,useFormatOptions as l}from"@alloy-js/core";import{appendPath as u}from"@stryke/path/append";import d from"defu";function f(f){let[{children:p,meta:m,path:h,header:g,storage:_,filetype:v,reference:y}]=s(f,[`children`,`meta`,`path`,`header`,`storage`,`filetype`,`reference`]),b=e(),x=c(i),S={path:u(h,x.path),filetype:v,reference:y};x?.addContent(S);let C=l({printWidth:f.printWidth,tabWidth:f.tabWidth,useTabs:f.useTabs,insertFinalNewLine:f.insertFinalNewLine}),w=o();return w.meta=d({sourceFile:S,printOptions:C},m??{}),b&&(b[S.path]={storage:_,...m??{}}),t(a.Provider,{value:S,get children(){return[t(r,{when:g!==void 0,get children(){return[g,n(`hbr`,{})]}}),p]}})}export{f as SourceFile};
1
+ import { useMeta } from "../contexts/meta.mjs";
2
+ import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
+ import { Show, SourceDirectoryContext, SourceFileContext, getContext, splitProps, useContext, useFormatOptions } from "@alloy-js/core";
4
+ import { appendPath } from "@stryke/path/append";
5
+ import defu from "defu";
6
+
7
+ //#region src/core/components/source-file.tsx
8
+ /**
9
+ * A base component representing a Powerlines generated source file.
10
+ *
11
+ * @param props - The properties for the source file.
12
+ * @returns The rendered source file component.
13
+ */
14
+ function SourceFile(props) {
15
+ const [{ children, meta, path, header, storage, filetype, reference }] = splitProps(props, [
16
+ "children",
17
+ "meta",
18
+ "path",
19
+ "header",
20
+ "storage",
21
+ "filetype",
22
+ "reference"
23
+ ]);
24
+ const metadata = useMeta();
25
+ const parentDirectory = useContext(SourceDirectoryContext);
26
+ const sourceFile = {
27
+ path: appendPath(path, parentDirectory.path),
28
+ filetype,
29
+ reference
30
+ };
31
+ parentDirectory?.addContent(sourceFile);
32
+ const printOptions = useFormatOptions({
33
+ printWidth: props.printWidth,
34
+ tabWidth: props.tabWidth,
35
+ useTabs: props.useTabs,
36
+ insertFinalNewLine: props.insertFinalNewLine
37
+ });
38
+ const nodeContext = getContext();
39
+ nodeContext.meta = defu({
40
+ sourceFile,
41
+ printOptions
42
+ }, meta ?? {});
43
+ if (metadata) metadata[sourceFile.path] = {
44
+ storage,
45
+ ...meta ?? {}
46
+ };
47
+ return createComponent(SourceFileContext.Provider, {
48
+ value: sourceFile,
49
+ get children() {
50
+ return [createComponent(Show, {
51
+ when: header !== void 0,
52
+ get children() {
53
+ return [header, createIntrinsic("hbr", {})];
54
+ }
55
+ }), children];
56
+ }
57
+ });
58
+ }
59
+
60
+ //#endregion
61
+ export { SourceFile };
2
62
  //# sourceMappingURL=source-file.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/core/components/source-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n getContext,\n Show,\n SourceDirectoryContext,\n SourceFileContext,\n SourceFileProps as SourceFilePropsExternal,\n splitProps,\n useContext,\n useFormatOptions\n} from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport type { StoragePreset } from \"powerlines\";\nimport { ComponentProps } from \"../../types/components\";\nimport { useMeta } from \"../contexts/meta\";\n\nexport type SourceFileProps = SourceFilePropsExternal &\n ComponentProps & {\n /**\n * The storage preset for the output files.\n *\n * @remarks\n * If not specified, the output mode will be determined by the provided `output.mode` value.\n */\n storage?: StoragePreset;\n\n /**\n * The metadata associated with the source file.\n *\n * @remarks\n * The values stored in the metadata will be available in the rendering context.\n */\n meta?: Record<string, any>;\n };\n\n/**\n * A base component representing a Powerlines generated source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function SourceFile(props: SourceFileProps) {\n const [{ children, meta, path, header, storage, filetype, reference }] =\n splitProps(props, [\n \"children\",\n \"meta\",\n \"path\",\n \"header\",\n \"storage\",\n \"filetype\",\n \"reference\"\n ]);\n\n const metadata = useMeta();\n const parentDirectory = useContext(SourceDirectoryContext)!;\n\n const sourceFile: SourceFileContext = {\n path: appendPath(path, parentDirectory.path),\n filetype,\n reference\n };\n parentDirectory?.addContent(sourceFile);\n\n const printOptions = useFormatOptions({\n printWidth: props.printWidth,\n tabWidth: props.tabWidth,\n useTabs: props.useTabs,\n insertFinalNewLine: props.insertFinalNewLine\n });\n\n const nodeContext = getContext()!;\n nodeContext.meta = defu(\n {\n sourceFile,\n printOptions\n },\n meta ?? {}\n );\n\n if (metadata) {\n metadata[sourceFile.path] = {\n storage,\n ...(meta ?? {})\n };\n }\n\n return (\n <SourceFileContext.Provider value={sourceFile}>\n <Show when={header !== undefined}>\n {header}\n <hbr />\n </Show>\n {children}\n </SourceFileContext.Provider>\n );\n}\n"],"mappings":"qWA8BA,SAAc,EAAa,EAAO,CAClC,GAAQ,CAAC,CACT,WAAA,OAEA,OACE,SACE,UACA,WACA,cACG,EAAC,EAAA,CAAA,WAAA,OAAA,OAAA,SAAA,UAAA,WAAA,YAAA,CAAA,CACD,EAAO,GAAc,CACtB,EAAA,EAAA,EAAA,CACF,EAAU,kBAEV,WACA,YACD,CACD,GAAM,WAAA,EAAA,CACN,IAAK,EAAW,EAAsB,CACpC,WAAE,EAAA,WACF,SAAO,EAAO,SACf,QAAA,EAAA,gDAED,CAAA,CACG,EAAe,GAAc,CAWhC,MAVD,GAAA,KAAA,EAAA,CACG,aACA,eACF,CAAA,GAAA,EAAA,CAAA,CACI,IACJ,EAAS,EAAU,MAAW,CAC5B,UACE,GAAC,GAAS,EAAA,CACX,EAEE,EAAO,EAAA,SAAA,CACV,MAAG,EACH,IAAG,UAAS,CACV,MAAC,CAAA,EAAS,EAAA,CACV,KAAA,IAAA,IAAA,kBAEE,MAAS,CAAC,EAAQ,EAAE,MAAA,EAAA,CAAA,CAAA,QAIzB,CAAC"}
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":";;;;;;;;;;;;;AA8BA,SAAc,WAAa,OAAO;CAClC,MAAQ,CAAC,EACT,gBAEA,MACE,QACE,SACA,UACA,eACG,WAAC,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACN,MAAK,WAAO,SAAc;CAC1B,MAAI,kBAAA,WAAA,uBAAA;CACJ,MAAE,aAAU;;EAEV;EACA;EACD;AACD,kBAAM,WAAA,WAAA;CACN,MAAK,eAAW,iBAAsB;EACpC,YAAE,MAAA;EACF,UAAO,MAAO;EACf,SAAA,MAAA;;EAED,CAAA;CACA,MAAG,cAAe,YAAc;AACjC,aAAA,OAAA,KAAA;EACG;EACA;EACF,EAAA,QAAA,EAAA,CAAA;AACF,KAAM,SACJ,UAAS,WAAU,QAAW;EAC5B;EACE,GAAC,QAAS,EAAA;EACX;AAEH,QAAK,gBAAO,kBAAA,UAAA;EACV,OAAG;EACH,IAAG,WAAS;AACV,UAAC,CAAA,gBAAS,MAAA;IACV,MAAA,WAAA;;AAEE,YAAS,CAAC,QAAQ,gBAAE,OAAA,EAAA,CAAA,CAAA;;;;EAIzB,CAAC"}
@@ -1 +1,20 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);function n({scale:n=1}){return(0,e.createComponent)(t.For,{get each(){return Array.from({length:n})},children:t=>[(0,e.createIntrinsic)(`hbr`,{}),(0,e.createIntrinsic)(`hbr`,{})]})}exports.Spacing=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
+
6
+ //#region src/core/components/spacing.tsx
7
+ /**
8
+ * A simple component that renders two horizontal breaks to create vertical spacing between elements.
9
+ */
10
+ function Spacing({ scale = 1 }) {
11
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
12
+ get each() {
13
+ return Array.from({ length: scale });
14
+ },
15
+ children: (_) => [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
16
+ });
17
+ }
18
+
19
+ //#endregion
20
+ exports.Spacing = Spacing;
@@ -1,2 +1,19 @@
1
- import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{For as n}from"@alloy-js/core";function r({scale:r=1}){return e(n,{get each(){return Array.from({length:r})},children:e=>[t(`hbr`,{}),t(`hbr`,{})]})}export{r as Spacing};
1
+ import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { For } from "@alloy-js/core";
3
+
4
+ //#region src/core/components/spacing.tsx
5
+ /**
6
+ * A simple component that renders two horizontal breaks to create vertical spacing between elements.
7
+ */
8
+ function Spacing({ scale = 1 }) {
9
+ return createComponent(For, {
10
+ get each() {
11
+ return Array.from({ length: scale });
12
+ },
13
+ children: (_) => [createIntrinsic("hbr", {}), createIntrinsic("hbr", {})]
14
+ });
15
+ }
16
+
17
+ //#endregion
18
+ export { Spacing };
2
19
  //# sourceMappingURL=spacing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"spacing.mjs","names":[],"sources":["../../../src/core/components/spacing.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\n\nexport interface SpacingProps {\n /**\n * A scale factor that determines the amount of vertical space to be added.\n *\n * @remarks\n * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.\n *\n * @defaultValue 1\n */\n scale?: number;\n}\n\n/**\n * A simple component that renders two horizontal breaks to create vertical spacing between elements.\n */\nexport function Spacing({ scale = 1 }: SpacingProps) {\n return (\n <For each={Array.from({ length: scale })}>\n {_ => (\n <>\n <hbr />\n <hbr />\n </>\n )}\n </For>\n );\n}\n"],"mappings":"uHAuBA,SAAG,EAAA,CACD,QAAI,GACH,CACD,OAAC,EAAA,EAAA,CACC,IAAE,MAAA,CACF,OAAA,MAAA,KAAA,CACI,OAAQ,EAChB,CAAA,EAEE,SAAA,GAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,CACC,CAAC"}
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":";;;;;;;AAuBA,SAAG,QAAA,EACD,QAAI,KACH;AACD,QAAC,gBAAA,KAAA;EACC,IAAE,OAAA;AACF,UAAA,MAAA,KAAA,EACI,QAAQ,OAChB,CAAA;;EAEE,WAAA,MAAA,CAAA,gBAAA,OAAA,EAAA,CAAA,EAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;EACC,CAAC"}
@@ -1 +1,41 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core`);const t=(0,e.createNamedContext)(`Powerlines`);function n(){return(0,e.useContext)(t)}function r(){return n()??void 0}function i(){let e=r();if(!e)throw Error("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`.");return e}exports.PowerlinesContext=t,exports.usePowerlines=i,exports.usePowerlinesContext=n,exports.usePowerlinesSafe=r;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core = require("@alloy-js/core");
4
+
5
+ //#region src/core/contexts/context.ts
6
+ /**
7
+ * The Powerlines context used in template rendering.
8
+ */
9
+ const PowerlinesContext = (0, _alloy_js_core.createNamedContext)("Powerlines");
10
+ /**
11
+ * Hook to access the Powerlines Context.
12
+ *
13
+ * @returns The Context.
14
+ */
15
+ function usePowerlinesContext() {
16
+ return (0, _alloy_js_core.useContext)(PowerlinesContext);
17
+ }
18
+ /**
19
+ * Hook to safely access the {@link PluginContext | Powerlines context}.
20
+ *
21
+ * @returns The Powerlines context or undefined if not set.
22
+ */
23
+ function usePowerlinesSafe() {
24
+ return usePowerlinesContext() ?? void 0;
25
+ }
26
+ /**
27
+ * Hook to access the {@link PluginContext | Powerlines context}.
28
+ *
29
+ * @returns The Powerlines context.
30
+ */
31
+ function usePowerlines() {
32
+ const powerlines = usePowerlinesSafe();
33
+ if (!powerlines) throw new Error("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`.");
34
+ return powerlines;
35
+ }
36
+
37
+ //#endregion
38
+ exports.PowerlinesContext = PowerlinesContext;
39
+ exports.usePowerlines = usePowerlines;
40
+ exports.usePowerlinesContext = usePowerlinesContext;
41
+ exports.usePowerlinesSafe = usePowerlinesSafe;