@powerlines/plugin-alloy 0.25.70 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/core/components/index.cjs +3 -1
- package/dist/core/components/index.d.cts +3 -2
- package/dist/core/components/index.d.mts +3 -2
- package/dist/core/components/index.mjs +3 -2
- package/dist/core/components/infrastructure-file.cjs +48 -0
- package/dist/core/components/infrastructure-file.d.cts +28 -0
- package/dist/core/components/infrastructure-file.d.cts.map +1 -0
- package/dist/core/components/infrastructure-file.d.mts +28 -0
- package/dist/core/components/infrastructure-file.d.mts.map +1 -0
- package/dist/core/components/infrastructure-file.mjs +46 -0
- package/dist/core/components/infrastructure-file.mjs.map +1 -0
- package/dist/core/components/output.d.cts +2 -2
- package/dist/core/components/output.d.cts.map +1 -1
- package/dist/core/components/output.d.mts +2 -2
- package/dist/core/components/output.d.mts.map +1 -1
- package/dist/core/components/single-line-comment.cjs +1 -1
- package/dist/core/components/single-line-comment.d.cts +3 -3
- package/dist/core/components/single-line-comment.d.cts.map +1 -1
- package/dist/core/components/single-line-comment.d.mts +3 -3
- package/dist/core/components/single-line-comment.d.mts.map +1 -1
- package/dist/core/components/single-line-comment.mjs +1 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.d.cts +2 -2
- package/dist/core/components/source-file.d.cts.map +1 -1
- package/dist/core/components/source-file.d.mts +2 -2
- package/dist/core/components/source-file.d.mts.map +1 -1
- package/dist/core/components/spacing.d.cts +2 -2
- package/dist/core/components/spacing.d.cts.map +1 -1
- package/dist/core/components/spacing.d.mts +2 -2
- package/dist/core/components/spacing.d.mts.map +1 -1
- package/dist/core/index.cjs +3 -1
- package/dist/core/index.d.cts +3 -2
- package/dist/core/index.d.mts +3 -2
- package/dist/core/index.mjs +3 -2
- package/dist/hcl/components/block-declaration.cjs +34 -0
- package/dist/hcl/components/block-declaration.d.cts +22 -0
- package/dist/hcl/components/block-declaration.d.cts.map +1 -0
- package/dist/hcl/components/block-declaration.d.mts +22 -0
- package/dist/hcl/components/block-declaration.d.mts.map +1 -0
- package/dist/hcl/components/block-declaration.mjs +33 -0
- package/dist/hcl/components/block-declaration.mjs.map +1 -0
- package/dist/hcl/components/hcl-file.cjs +83 -0
- package/dist/hcl/components/hcl-file.d.cts +27 -0
- package/dist/hcl/components/hcl-file.d.cts.map +1 -0
- package/dist/hcl/components/hcl-file.d.mts +27 -0
- package/dist/hcl/components/hcl-file.d.mts.map +1 -0
- package/dist/hcl/components/hcl-file.mjs +81 -0
- package/dist/hcl/components/hcl-file.mjs.map +1 -0
- package/dist/hcl/components/index.cjs +11 -0
- package/dist/hcl/components/index.d.cts +5 -0
- package/dist/hcl/components/index.d.mts +5 -0
- package/dist/hcl/components/index.mjs +6 -0
- package/dist/hcl/components/packer-file.cjs +29 -0
- package/dist/hcl/components/packer-file.d.cts +19 -0
- package/dist/hcl/components/packer-file.d.cts.map +1 -0
- package/dist/hcl/components/packer-file.d.mts +19 -0
- package/dist/hcl/components/packer-file.d.mts.map +1 -0
- package/dist/hcl/components/packer-file.mjs +28 -0
- package/dist/hcl/components/packer-file.mjs.map +1 -0
- package/dist/hcl/components/terraform-file.cjs +30 -0
- package/dist/hcl/components/terraform-file.d.cts +20 -0
- package/dist/hcl/components/terraform-file.d.cts.map +1 -0
- package/dist/hcl/components/terraform-file.d.mts +20 -0
- package/dist/hcl/components/terraform-file.d.mts.map +1 -0
- package/dist/hcl/components/terraform-file.mjs +29 -0
- package/dist/hcl/components/terraform-file.mjs.map +1 -0
- package/dist/hcl/index.cjs +12 -0
- package/dist/hcl/index.d.cts +5 -0
- package/dist/hcl/index.d.mts +5 -0
- package/dist/hcl/index.mjs +7 -0
- package/dist/helpers/capnp.cjs +2 -2
- package/dist/helpers/capnp.mjs +2 -2
- package/dist/helpers/typescript.cjs +1 -1
- package/dist/helpers/typescript.mjs +1 -1
- package/dist/markdown/components/front-matter.d.cts +2 -2
- package/dist/markdown/components/front-matter.d.cts.map +1 -1
- package/dist/markdown/components/front-matter.d.mts +2 -2
- package/dist/markdown/components/front-matter.d.mts.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +1 -1
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-file.d.cts.map +1 -1
- package/dist/markdown/components/markdown-file.d.mts +3 -3
- package/dist/markdown/components/markdown-file.d.mts.map +1 -1
- package/dist/markdown/components/markdown-file.mjs +1 -1
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.cts.map +1 -1
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/markdown/components/markdown-table.d.mts.map +1 -1
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/builtin-file.d.mts.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -1
- package/dist/typescript/components/entry-file.cjs +1 -1
- package/dist/typescript/components/entry-file.d.cts +2 -2
- package/dist/typescript/components/entry-file.d.cts.map +1 -1
- package/dist/typescript/components/entry-file.d.mts +2 -2
- package/dist/typescript/components/entry-file.d.mts.map +1 -1
- package/dist/typescript/components/entry-file.mjs +1 -1
- package/dist/typescript/components/index.cjs +0 -2
- package/dist/typescript/components/index.d.cts +1 -2
- package/dist/typescript/components/index.d.mts +1 -2
- package/dist/typescript/components/index.mjs +1 -2
- package/dist/typescript/components/interface-declaration.d.cts +3 -3
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -1
- package/dist/typescript/components/interface-declaration.d.mts +2 -2
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
- package/dist/typescript/components/object-declaration.d.cts +4 -4
- package/dist/typescript/components/object-declaration.d.cts.map +1 -1
- package/dist/typescript/components/object-declaration.d.mts +3 -3
- package/dist/typescript/components/object-declaration.d.mts.map +1 -1
- package/dist/typescript/components/property-name.d.cts +2 -2
- package/dist/typescript/components/property-name.d.cts.map +1 -1
- package/dist/typescript/components/property-name.d.mts +2 -2
- package/dist/typescript/components/property-name.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.d.cts +7 -7
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +7 -7
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.d.cts +1 -1
- package/dist/typescript/components/type-declaration.d.cts +2 -2
- package/dist/typescript/components/type-declaration.d.cts.map +1 -1
- package/dist/typescript/components/type-declaration.d.mts +2 -2
- package/dist/typescript/components/type-declaration.d.mts.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +2 -2
- package/dist/typescript/components/typescript-file.mjs +2 -2
- package/dist/typescript/contexts/lexical-scope.d.cts +2 -2
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +2 -2
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -1
- package/dist/typescript/index.cjs +0 -2
- package/dist/typescript/index.d.cts +1 -2
- package/dist/typescript/index.d.mts +1 -2
- package/dist/typescript/index.mjs +1 -2
- package/dist/yaml/components/yaml-file.cjs +1 -1
- package/dist/yaml/components/yaml-file.mjs +1 -1
- package/package.json +104 -20
- package/dist/typescript/components/infrastructure-file.cjs +0 -40
- package/dist/typescript/components/infrastructure-file.d.cts +0 -21
- package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
- package/dist/typescript/components/infrastructure-file.d.mts +0 -21
- package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
- package/dist/typescript/components/infrastructure-file.mjs +0 -38
- package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
//#region src/hcl/components/block-declaration.d.ts
|
|
5
|
+
interface BlockDeclarationProps extends ComponentProps {
|
|
6
|
+
type: string;
|
|
7
|
+
label: string | string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A base component representing a block declaration in HCL. The children are rendered as a prose element, which means that they are broken into multiple lines. This component can be used to create more specific block declaration components, such as resource blocks, provider blocks, etc.
|
|
11
|
+
*
|
|
12
|
+
* @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language
|
|
13
|
+
* @see https://opentofu.org/docs/language/attr-as-blocks/#summary
|
|
14
|
+
*
|
|
15
|
+
* @param props - The properties for the source file.
|
|
16
|
+
* @returns The rendered source file component.
|
|
17
|
+
*/
|
|
18
|
+
declare function BlockDeclaration(props: BlockDeclarationProps): _$_alloy_js_core0.Children;
|
|
19
|
+
declare type __ΩBlockDeclarationProps = any[];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps };
|
|
22
|
+
//# sourceMappingURL=block-declaration.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-declaration.d.mts","names":[],"sources":["../../../src/hcl/components/block-declaration.tsx"],"mappings":";;;;UAsBiB,qBAAA,SAA8B,cAAA;EAC7C,IAAA;EACA,KAAA;AAAA;;;;;;;;;AAYF;iBAAgB,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,iBAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { code as code$1 } from "../../core/helpers/code.mjs";
|
|
2
|
+
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { Prose, Show } from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/block-declaration.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A base component representing a block declaration in HCL. The children are rendered as a prose element, which means that they are broken into multiple lines. This component can be used to create more specific block declaration components, such as resource blocks, provider blocks, etc.
|
|
8
|
+
*
|
|
9
|
+
* @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language
|
|
10
|
+
* @see https://opentofu.org/docs/language/attr-as-blocks/#summary
|
|
11
|
+
*
|
|
12
|
+
* @param props - The properties for the source file.
|
|
13
|
+
* @returns The rendered source file component.
|
|
14
|
+
*/
|
|
15
|
+
function BlockDeclaration(props) {
|
|
16
|
+
const { children, type, label } = props;
|
|
17
|
+
return [
|
|
18
|
+
memo(() => code$1`${type} ${Array.isArray(label) ? label.join(" ") : label} {`),
|
|
19
|
+
createComponent(Prose, { get children() {
|
|
20
|
+
return createComponent(Show, {
|
|
21
|
+
get when() {
|
|
22
|
+
return Boolean(children);
|
|
23
|
+
},
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
} }),
|
|
27
|
+
code$1`} `
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { BlockDeclaration };
|
|
33
|
+
//# sourceMappingURL=block-declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-declaration.mjs","names":[],"sources":["../../../src/hcl/components/block-declaration.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, Show } from \"@alloy-js/core\";\nimport { code } from \"../../core/helpers/code\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface BlockDeclarationProps extends ComponentProps {\n type: string;\n label: string | string[];\n}\n\n/**\n * A base component representing a block declaration in HCL. The children are rendered as a prose element, which means that they are broken into multiple lines. This component can be used to create more specific block declaration components, such as resource blocks, provider blocks, etc.\n *\n * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language\n * @see https://opentofu.org/docs/language/attr-as-blocks/#summary\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function BlockDeclaration(props: BlockDeclarationProps) {\n const { children, type, label } = props;\n\n return (\n <>\n {code`${type} ${Array.isArray(label) ? label.join(\" \") : label} {`}\n <Prose>\n <Show when={Boolean(children)}>{children}</Show>\n </Prose>\n {code`} `}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAoCA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,YAEN,MACE,UACE;AACJ,QAAK;EAAA,WAAK,MAAA,GAAA,KAAA,GAAA,MAAA,QAAA,MAAA,GAAA,MAAA,KAAA,IAAA,GAAA,MAAA,IAAA;EAAA,gBAAA,OAAA,EACR,IAAI,WAAW;AACb,UAAO,gBAAA,MAAA;IACN,IAAK,OAAG;AACT,YAAA,QAAA,SAAA;;IAEN"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
4
|
+
const require_core_components_infrastructure_file = require('../../core/components/infrastructure-file.cjs');
|
|
5
|
+
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
6
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
9
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
|
+
let powerlines_utils = require("powerlines/utils");
|
|
11
|
+
|
|
12
|
+
//#region src/hcl/components/hcl-file.tsx
|
|
13
|
+
/**
|
|
14
|
+
* A base component representing a Powerlines generated HCL source file.
|
|
15
|
+
*
|
|
16
|
+
* @param props - The properties for the source file.
|
|
17
|
+
* @returns The rendered source file component.
|
|
18
|
+
*/
|
|
19
|
+
function HCLFile(props) {
|
|
20
|
+
const [{ children, storage, header, filetype: _filetype, id }, rest] = (0, _alloy_js_core.splitProps)(props, [
|
|
21
|
+
"children",
|
|
22
|
+
"storage",
|
|
23
|
+
"header",
|
|
24
|
+
"filetype",
|
|
25
|
+
"id"
|
|
26
|
+
]);
|
|
27
|
+
const filetype = (0, _alloy_js_core.computed)(() => _filetype || (0, _stryke_path_file_path_fns.findFileExtension)(id) || "hcl");
|
|
28
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_infrastructure_file.InfrastructureFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get header() {
|
|
29
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(HCLFileHeader, { children: header });
|
|
30
|
+
} }, rest, {
|
|
31
|
+
id,
|
|
32
|
+
get filetype() {
|
|
33
|
+
return filetype.value;
|
|
34
|
+
},
|
|
35
|
+
storage: storage || "fs",
|
|
36
|
+
get children() {
|
|
37
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
38
|
+
get when() {
|
|
39
|
+
return Boolean(children);
|
|
40
|
+
},
|
|
41
|
+
children
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Renders the header for a Powerlines HCL source file.
|
|
48
|
+
*
|
|
49
|
+
* @param props - The properties for the source file header.
|
|
50
|
+
* @returns The rendered source file header.
|
|
51
|
+
*/
|
|
52
|
+
function HCLFileHeader(props) {
|
|
53
|
+
const [{ children }] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
54
|
+
const context = require_core_contexts_context.usePowerlines();
|
|
55
|
+
return [
|
|
56
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
57
|
+
get when() {
|
|
58
|
+
return Boolean(children);
|
|
59
|
+
},
|
|
60
|
+
get children() {
|
|
61
|
+
return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
65
|
+
variant: "hcl",
|
|
66
|
+
get children() {
|
|
67
|
+
return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
71
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
72
|
+
variant: "hcl",
|
|
73
|
+
get children() {
|
|
74
|
+
return (0, powerlines_utils.getFileHeaderWarning)(context);
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
exports.HCLFile = HCLFile;
|
|
83
|
+
exports.HCLFileHeader = HCLFileHeader;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
+
import { InfrastructureFileProps } from "../../core/components/infrastructure-file.cjs";
|
|
3
|
+
import { Children } from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/hcl-file.d.ts
|
|
6
|
+
type HCLFileProps = Omit<InfrastructureFileProps, "header" | "filetype"> & ComponentProps & {
|
|
7
|
+
header?: Children;
|
|
8
|
+
filetype?: "hcl" | "tf" | `${string}.hcl` | `${string}.tf`;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A base component representing a Powerlines generated HCL source file.
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
declare function HCLFile(props: HCLFileProps): Children;
|
|
17
|
+
/**
|
|
18
|
+
* Renders the header for a Powerlines HCL source file.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The properties for the source file header.
|
|
21
|
+
* @returns The rendered source file header.
|
|
22
|
+
*/
|
|
23
|
+
declare function HCLFileHeader(props: ComponentProps): Children;
|
|
24
|
+
declare type __ΩHCLFileProps = any[];
|
|
25
|
+
//#endregion
|
|
26
|
+
export { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps };
|
|
27
|
+
//# sourceMappingURL=hcl-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hcl-file.d.cts","names":[],"sources":["../../../src/hcl/components/hcl-file.tsx"],"mappings":";;;;;KA8BY,YAAA,GAAe,IAAA,CACzB,uBAAA,2BAGA,cAAA;EACE,MAAA,GAAS,QAAA;EACT,QAAA;AAAA;;;;;;;iBASY,OAAA,CAAQ,KAAA,EAAO,YAAA,GAAY,QAAA;;;;;;;iBAwB3B,aAAA,CAAc,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
+
import { InfrastructureFileProps } from "../../core/components/infrastructure-file.mjs";
|
|
3
|
+
import { Children } from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/hcl-file.d.ts
|
|
6
|
+
type HCLFileProps = Omit<InfrastructureFileProps, "header" | "filetype"> & ComponentProps & {
|
|
7
|
+
header?: Children;
|
|
8
|
+
filetype?: "hcl" | "tf" | `${string}.hcl` | `${string}.tf`;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A base component representing a Powerlines generated HCL source file.
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
declare function HCLFile(props: HCLFileProps): Children;
|
|
17
|
+
/**
|
|
18
|
+
* Renders the header for a Powerlines HCL source file.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The properties for the source file header.
|
|
21
|
+
* @returns The rendered source file header.
|
|
22
|
+
*/
|
|
23
|
+
declare function HCLFileHeader(props: ComponentProps): Children;
|
|
24
|
+
declare type __ΩHCLFileProps = any[];
|
|
25
|
+
//#endregion
|
|
26
|
+
export { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps };
|
|
27
|
+
//# sourceMappingURL=hcl-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hcl-file.d.mts","names":[],"sources":["../../../src/hcl/components/hcl-file.tsx"],"mappings":";;;;;KA8BY,YAAA,GAAe,IAAA,CACzB,uBAAA,2BAGA,cAAA;EACE,MAAA,GAAS,QAAA;EACT,QAAA;AAAA;;;;;;;iBASY,OAAA,CAAQ,KAAA,EAAO,YAAA,GAAY,QAAA;;;;;;;iBAwB3B,aAAA,CAAc,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { usePowerlines } from "../../core/contexts/context.mjs";
|
|
2
|
+
import { InfrastructureFile } from "../../core/components/infrastructure-file.mjs";
|
|
3
|
+
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
4
|
+
import { findFileExtension } from "@stryke/path/file-path-fns";
|
|
5
|
+
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
6
|
+
import { Show, computed, splitProps } from "@alloy-js/core";
|
|
7
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
+
import { getFileHeaderWarning } from "powerlines/utils";
|
|
9
|
+
|
|
10
|
+
//#region src/hcl/components/hcl-file.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A base component representing a Powerlines generated HCL source file.
|
|
13
|
+
*
|
|
14
|
+
* @param props - The properties for the source file.
|
|
15
|
+
* @returns The rendered source file component.
|
|
16
|
+
*/
|
|
17
|
+
function HCLFile(props) {
|
|
18
|
+
const [{ children, storage, header, filetype: _filetype, id }, rest] = splitProps(props, [
|
|
19
|
+
"children",
|
|
20
|
+
"storage",
|
|
21
|
+
"header",
|
|
22
|
+
"filetype",
|
|
23
|
+
"id"
|
|
24
|
+
]);
|
|
25
|
+
const filetype = computed(() => _filetype || findFileExtension(id) || "hcl");
|
|
26
|
+
return createComponent(InfrastructureFile, mergeProps({ get header() {
|
|
27
|
+
return createComponent(HCLFileHeader, { children: header });
|
|
28
|
+
} }, rest, {
|
|
29
|
+
id,
|
|
30
|
+
get filetype() {
|
|
31
|
+
return filetype.value;
|
|
32
|
+
},
|
|
33
|
+
storage: storage || "fs",
|
|
34
|
+
get children() {
|
|
35
|
+
return createComponent(Show, {
|
|
36
|
+
get when() {
|
|
37
|
+
return Boolean(children);
|
|
38
|
+
},
|
|
39
|
+
children
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renders the header for a Powerlines HCL source file.
|
|
46
|
+
*
|
|
47
|
+
* @param props - The properties for the source file header.
|
|
48
|
+
* @returns The rendered source file header.
|
|
49
|
+
*/
|
|
50
|
+
function HCLFileHeader(props) {
|
|
51
|
+
const [{ children }] = splitProps(props, ["children"]);
|
|
52
|
+
const context = usePowerlines();
|
|
53
|
+
return [
|
|
54
|
+
createComponent(Show, {
|
|
55
|
+
get when() {
|
|
56
|
+
return Boolean(children);
|
|
57
|
+
},
|
|
58
|
+
get children() {
|
|
59
|
+
return [children, createIntrinsic("hbr", {})];
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
createComponent(SingleLineComment, {
|
|
63
|
+
variant: "hcl",
|
|
64
|
+
get children() {
|
|
65
|
+
return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
createIntrinsic("hbr", {}),
|
|
69
|
+
createComponent(SingleLineComment, {
|
|
70
|
+
variant: "hcl",
|
|
71
|
+
get children() {
|
|
72
|
+
return getFileHeaderWarning(context);
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
createIntrinsic("hbr", {})
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { HCLFile, HCLFileHeader };
|
|
81
|
+
//# sourceMappingURL=hcl-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hcl-file.mjs","names":[],"sources":["../../../src/hcl/components/hcl-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 { Children, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport {\n InfrastructureFile,\n InfrastructureFileProps\n} from \"../../core/components/infrastructure-file\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { usePowerlines } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type HCLFileProps = Omit<\n InfrastructureFileProps,\n \"header\" | \"filetype\"\n> &\n ComponentProps & {\n header?: Children;\n filetype?: \"hcl\" | \"tf\" | `${string}.hcl` | `${string}.tf`;\n };\n\n/**\n * A base component representing a Powerlines generated HCL source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function HCLFile(props: HCLFileProps) {\n const [{ children, storage, header, filetype: _filetype, id }, rest] =\n splitProps(props, [\"children\", \"storage\", \"header\", \"filetype\", \"id\"]);\n\n const filetype = computed(() => _filetype || findFileExtension(id) || \"hcl\");\n\n return (\n <InfrastructureFile\n header={<HCLFileHeader>{header}</HCLFileHeader>}\n {...rest}\n id={id}\n filetype={filetype.value}\n storage={storage || \"fs\"}>\n <Show when={Boolean(children)}>{children}</Show>\n </InfrastructureFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines HCL source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function HCLFileHeader(props: ComponentProps) {\n const [{ children }] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"hcl\">{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"hcl\">\n {getFileHeaderWarning(context)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;CAuCE,MAAA,CAAA,EACE,UACH,SACG,QACA,UAAQ,WACV,MACF,QAAO,WAAiB,OAAO;EAAA;EAAa;EAAC;EAAA;EAAA;EAAA,CAAA;CAC3C,MAAM,WAAW,eAAW,aAAiB,kBAAkB,GAAA,IAAM,MAAA;AACrE,QAAE,gBAAoB,oBAAuB,WAAU;AAEvD,SAAM,gBAAuB,eAAe,oBAE5C,CAAM;IAEL,EAAE,MAAC;EACE;EACJ,IAAI,WAAI;AACN,UAAA,SAAU;;EAEZ,SAAQ,WAAM;EACd,IAAE,WAAA;AACH,UAAA,gBAAA,MAAA;IACH,IAAA,OAAA;;;IAGe;IACd,CAAA;;EAEE,CAAC,CAAA;;;;;;;;AASJ,SAAgB,cAAU,OAAU;CAClC,MAAM,CAAC,EACL,cACG,WAAS,OAAA,CAAA,WAAA,CAAA;CACd,MAAM,UAAE,eAAA;AACR,QAAM;EAAA,gBAAI,MAAA;GACR,IAAG,OAAA;AACD,WAAE,QAAU,SAAS;;GAEvB,IAAG,WAAK;AACN,WAAC,CAAA,UAAiB,gBAAc,OAAA,EAAA,CAAA,CAAA;;GAEnC,CAAC;EAAE,gBAAE,mBAAiB;GACrB,SAAQ;GACR,IAAE,WAAA;AACH,WAAA,gBAAA,UAAA,SAAA,QAAA,UAAA,IAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_hcl_components_block_declaration = require('./block-declaration.cjs');
|
|
3
|
+
const require_hcl_components_hcl_file = require('./hcl-file.cjs');
|
|
4
|
+
const require_hcl_components_packer_file = require('./packer-file.cjs');
|
|
5
|
+
const require_hcl_components_terraform_file = require('./terraform-file.cjs');
|
|
6
|
+
|
|
7
|
+
exports.BlockDeclaration = require_hcl_components_block_declaration.BlockDeclaration;
|
|
8
|
+
exports.HCLFile = require_hcl_components_hcl_file.HCLFile;
|
|
9
|
+
exports.HCLFileHeader = require_hcl_components_hcl_file.HCLFileHeader;
|
|
10
|
+
exports.PackerFile = require_hcl_components_packer_file.PackerFile;
|
|
11
|
+
exports.TerraformFile = require_hcl_components_terraform_file.TerraformFile;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps } from "./block-declaration.cjs";
|
|
2
|
+
import { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps } from "./hcl-file.cjs";
|
|
3
|
+
import { PackerFile, PackerFileProps, __ΩPackerFileProps } from "./packer-file.cjs";
|
|
4
|
+
import { TerraformFile, TerraformFileProps, __ΩTerraformFileProps } from "./terraform-file.cjs";
|
|
5
|
+
export { BlockDeclaration, BlockDeclarationProps, HCLFile, HCLFileHeader, HCLFileProps, PackerFile, PackerFileProps, TerraformFile, TerraformFileProps, __ΩBlockDeclarationProps, __ΩHCLFileProps, __ΩPackerFileProps, __ΩTerraformFileProps };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps } from "./block-declaration.mjs";
|
|
2
|
+
import { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps } from "./hcl-file.mjs";
|
|
3
|
+
import { PackerFile, PackerFileProps, __ΩPackerFileProps } from "./packer-file.mjs";
|
|
4
|
+
import { TerraformFile, TerraformFileProps, __ΩTerraformFileProps } from "./terraform-file.mjs";
|
|
5
|
+
export { BlockDeclaration, BlockDeclarationProps, HCLFile, HCLFileHeader, HCLFileProps, PackerFile, PackerFileProps, TerraformFile, TerraformFileProps, __ΩBlockDeclarationProps, __ΩHCLFileProps, __ΩPackerFileProps, __ΩTerraformFileProps };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BlockDeclaration } from "./block-declaration.mjs";
|
|
2
|
+
import { HCLFile, HCLFileHeader } from "./hcl-file.mjs";
|
|
3
|
+
import { PackerFile } from "./packer-file.mjs";
|
|
4
|
+
import { TerraformFile } from "./terraform-file.mjs";
|
|
5
|
+
|
|
6
|
+
export { BlockDeclaration, HCLFile, HCLFileHeader, PackerFile, TerraformFile };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_hcl_components_hcl_file = require('./hcl-file.cjs');
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
|
|
7
|
+
//#region src/hcl/components/packer-file.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
|
|
10
|
+
*
|
|
11
|
+
* @see https://developer.hashicorp.com/packer
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
function PackerFile(props) {
|
|
17
|
+
const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
18
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_hcl_components_hcl_file.HCLFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ filetype: "pkr.hcl" }, rest, { get children() {
|
|
19
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
20
|
+
get when() {
|
|
21
|
+
return Boolean(children);
|
|
22
|
+
},
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
} }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.PackerFile = PackerFile;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HCLFileProps } from "./hcl-file.cjs";
|
|
2
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { PartialKeys } from "@stryke/types/base";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/packer-file.d.ts
|
|
6
|
+
type PackerFileProps = PartialKeys<HCLFileProps, "filetype">;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developer.hashicorp.com/packer
|
|
11
|
+
*
|
|
12
|
+
* @param props - The properties for the source file.
|
|
13
|
+
* @returns The rendered source file component.
|
|
14
|
+
*/
|
|
15
|
+
declare function PackerFile(props: PackerFileProps): _$_alloy_js_core0.Children;
|
|
16
|
+
declare type __ΩPackerFileProps = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { PackerFile, PackerFileProps, __ΩPackerFileProps };
|
|
19
|
+
//# sourceMappingURL=packer-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packer-file.d.cts","names":[],"sources":["../../../src/hcl/components/packer-file.tsx"],"mappings":";;;;;KAsBY,eAAA,GAAkB,WAAA,CAAY,YAAA;;;AAA1C;;;;;AAUA;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,iBAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HCLFileProps } from "./hcl-file.mjs";
|
|
2
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { PartialKeys } from "@stryke/types/base";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/packer-file.d.ts
|
|
6
|
+
type PackerFileProps = PartialKeys<HCLFileProps, "filetype">;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developer.hashicorp.com/packer
|
|
11
|
+
*
|
|
12
|
+
* @param props - The properties for the source file.
|
|
13
|
+
* @returns The rendered source file component.
|
|
14
|
+
*/
|
|
15
|
+
declare function PackerFile(props: PackerFileProps): _$_alloy_js_core0.Children;
|
|
16
|
+
declare type __ΩPackerFileProps = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { PackerFile, PackerFileProps, __ΩPackerFileProps };
|
|
19
|
+
//# sourceMappingURL=packer-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packer-file.d.mts","names":[],"sources":["../../../src/hcl/components/packer-file.tsx"],"mappings":";;;;;KAsBY,eAAA,GAAkB,WAAA,CAAY,YAAA;;;AAA1C;;;;;AAUA;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,iBAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HCLFile } from "./hcl-file.mjs";
|
|
2
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { Show, splitProps } from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/packer-file.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
|
|
8
|
+
*
|
|
9
|
+
* @see https://developer.hashicorp.com/packer
|
|
10
|
+
*
|
|
11
|
+
* @param props - The properties for the source file.
|
|
12
|
+
* @returns The rendered source file component.
|
|
13
|
+
*/
|
|
14
|
+
function PackerFile(props) {
|
|
15
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
16
|
+
return createComponent(HCLFile, mergeProps({ filetype: "pkr.hcl" }, rest, { get children() {
|
|
17
|
+
return createComponent(Show, {
|
|
18
|
+
get when() {
|
|
19
|
+
return Boolean(children);
|
|
20
|
+
},
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
} }));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { PackerFile };
|
|
28
|
+
//# sourceMappingURL=packer-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packer-file.mjs","names":[],"sources":["../../../src/hcl/components/packer-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 { Show, splitProps } from \"@alloy-js/core\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { HCLFile, HCLFileProps } from \"./hcl-file\";\n\nexport type PackerFileProps = PartialKeys<HCLFileProps, \"filetype\">;\n\n/**\n * A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.\n *\n * @see https://developer.hashicorp.com/packer\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function PackerFile(props: PackerFileProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <HCLFile filetype=\"pkr.hcl\" {...rest}>\n <Show when={Boolean(children)}>{children}</Show>\n </HCLFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAgB,WAAW,OAAwB;CACjD,MAAM,CAAC,cAEP,QAAO,WAAA,OAAA,CAAA,WAAA,CAAA;AACP,QAAG,gBAAsB,SAAS,WAAK,EACrC,UAAQ,WACT,EAAE,MAAC,EACH,IAAA,WAAA;AACH,SAAA,gBAAA,MAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_hcl_components_hcl_file = require('./hcl-file.cjs');
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
|
|
7
|
+
//#region src/hcl/components/terraform-file.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.
|
|
10
|
+
*
|
|
11
|
+
* @see https://developer.hashicorp.com/terraform
|
|
12
|
+
* @see https://opentofu.org
|
|
13
|
+
*
|
|
14
|
+
* @param props - The properties for the source file.
|
|
15
|
+
* @returns The rendered source file component.
|
|
16
|
+
*/
|
|
17
|
+
function TerraformFile(props) {
|
|
18
|
+
const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
19
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_hcl_components_hcl_file.HCLFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ filetype: "tf" }, rest, { get children() {
|
|
20
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
21
|
+
get when() {
|
|
22
|
+
return Boolean(children);
|
|
23
|
+
},
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
} }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.TerraformFile = TerraformFile;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HCLFileProps } from "./hcl-file.cjs";
|
|
2
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { PartialKeys } from "@stryke/types/base";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/terraform-file.d.ts
|
|
6
|
+
type TerraformFileProps = PartialKeys<HCLFileProps, "filetype">;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developer.hashicorp.com/terraform
|
|
11
|
+
* @see https://opentofu.org
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
declare function TerraformFile(props: TerraformFileProps): _$_alloy_js_core0.Children;
|
|
17
|
+
declare type __ΩTerraformFileProps = any[];
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TerraformFile, TerraformFileProps, __ΩTerraformFileProps };
|
|
20
|
+
//# sourceMappingURL=terraform-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraform-file.d.cts","names":[],"sources":["../../../src/hcl/components/terraform-file.tsx"],"mappings":";;;;;KAsBY,kBAAA,GAAqB,WAAA,CAAY,YAAA;;;AAA7C;;;;;AAWA;;iBAAgB,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,iBAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HCLFileProps } from "./hcl-file.mjs";
|
|
2
|
+
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
|
+
import { PartialKeys } from "@stryke/types/base";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/terraform-file.d.ts
|
|
6
|
+
type TerraformFileProps = PartialKeys<HCLFileProps, "filetype">;
|
|
7
|
+
/**
|
|
8
|
+
* A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developer.hashicorp.com/terraform
|
|
11
|
+
* @see https://opentofu.org
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
declare function TerraformFile(props: TerraformFileProps): _$_alloy_js_core0.Children;
|
|
17
|
+
declare type __ΩTerraformFileProps = any[];
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TerraformFile, TerraformFileProps, __ΩTerraformFileProps };
|
|
20
|
+
//# sourceMappingURL=terraform-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraform-file.d.mts","names":[],"sources":["../../../src/hcl/components/terraform-file.tsx"],"mappings":";;;;;KAsBY,kBAAA,GAAqB,WAAA,CAAY,YAAA;;;AAA7C;;;;;AAWA;;iBAAgB,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,iBAAA,CAAA,QAAA;AAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HCLFile } from "./hcl-file.mjs";
|
|
2
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { Show, splitProps } from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/hcl/components/terraform-file.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.
|
|
8
|
+
*
|
|
9
|
+
* @see https://developer.hashicorp.com/terraform
|
|
10
|
+
* @see https://opentofu.org
|
|
11
|
+
*
|
|
12
|
+
* @param props - The properties for the source file.
|
|
13
|
+
* @returns The rendered source file component.
|
|
14
|
+
*/
|
|
15
|
+
function TerraformFile(props) {
|
|
16
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
17
|
+
return createComponent(HCLFile, mergeProps({ filetype: "tf" }, rest, { get children() {
|
|
18
|
+
return createComponent(Show, {
|
|
19
|
+
get when() {
|
|
20
|
+
return Boolean(children);
|
|
21
|
+
},
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
} }));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TerraformFile };
|
|
29
|
+
//# sourceMappingURL=terraform-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraform-file.mjs","names":[],"sources":["../../../src/hcl/components/terraform-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 { Show, splitProps } from \"@alloy-js/core\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { HCLFile, HCLFileProps } from \"./hcl-file\";\n\nexport type TerraformFileProps = PartialKeys<HCLFileProps, \"filetype\">;\n\n/**\n * A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.\n *\n * @see https://developer.hashicorp.com/terraform\n * @see https://opentofu.org\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TerraformFile(props: TerraformFileProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <HCLFile filetype=\"tf\" {...rest}>\n <Show when={Boolean(children)}>{children}</Show>\n </HCLFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiCA,SAAgB,cAAc,OAA2B;CACvD,MAAM,CAAC,cAEP,QAAO,WAAA,OAAA,CAAA,WAAA,CAAA;AACP,QAAG,gBAAsB,SAAS,WAAA,EAChC,UAAQ,MACT,EAAE,MAAC,EACH,IAAA,WAAA;AACH,SAAA,gBAAA,MAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_hcl_components_block_declaration = require('./components/block-declaration.cjs');
|
|
3
|
+
const require_hcl_components_hcl_file = require('./components/hcl-file.cjs');
|
|
4
|
+
const require_hcl_components_packer_file = require('./components/packer-file.cjs');
|
|
5
|
+
const require_hcl_components_terraform_file = require('./components/terraform-file.cjs');
|
|
6
|
+
require('./components/index.cjs');
|
|
7
|
+
|
|
8
|
+
exports.BlockDeclaration = require_hcl_components_block_declaration.BlockDeclaration;
|
|
9
|
+
exports.HCLFile = require_hcl_components_hcl_file.HCLFile;
|
|
10
|
+
exports.HCLFileHeader = require_hcl_components_hcl_file.HCLFileHeader;
|
|
11
|
+
exports.PackerFile = require_hcl_components_packer_file.PackerFile;
|
|
12
|
+
exports.TerraformFile = require_hcl_components_terraform_file.TerraformFile;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps } from "./components/block-declaration.cjs";
|
|
2
|
+
import { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps } from "./components/hcl-file.cjs";
|
|
3
|
+
import { PackerFile, PackerFileProps, __ΩPackerFileProps } from "./components/packer-file.cjs";
|
|
4
|
+
import { TerraformFile, TerraformFileProps, __ΩTerraformFileProps } from "./components/terraform-file.cjs";
|
|
5
|
+
export { BlockDeclaration, BlockDeclarationProps, HCLFile, HCLFileHeader, HCLFileProps, PackerFile, PackerFileProps, TerraformFile, TerraformFileProps, __ΩBlockDeclarationProps, __ΩHCLFileProps, __ΩPackerFileProps, __ΩTerraformFileProps };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps } from "./components/block-declaration.mjs";
|
|
2
|
+
import { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps } from "./components/hcl-file.mjs";
|
|
3
|
+
import { PackerFile, PackerFileProps, __ΩPackerFileProps } from "./components/packer-file.mjs";
|
|
4
|
+
import { TerraformFile, TerraformFileProps, __ΩTerraformFileProps } from "./components/terraform-file.mjs";
|
|
5
|
+
export { BlockDeclaration, BlockDeclarationProps, HCLFile, HCLFileHeader, HCLFileProps, PackerFile, PackerFileProps, TerraformFile, TerraformFileProps, __ΩBlockDeclarationProps, __ΩHCLFileProps, __ΩPackerFileProps, __ΩTerraformFileProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockDeclaration } from "./components/block-declaration.mjs";
|
|
2
|
+
import { HCLFile, HCLFileHeader } from "./components/hcl-file.mjs";
|
|
3
|
+
import { PackerFile } from "./components/packer-file.mjs";
|
|
4
|
+
import { TerraformFile } from "./components/terraform-file.mjs";
|
|
5
|
+
import "./components/index.mjs";
|
|
6
|
+
|
|
7
|
+
export { BlockDeclaration, HCLFile, HCLFileHeader, PackerFile, TerraformFile };
|