@powerlines/plugin-alloy 0.26.18 → 0.26.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/infrastructure-file.cjs +9 -14
- package/dist/core/components/infrastructure-file.mjs +9 -14
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/output.cjs +10 -17
- package/dist/core/components/output.mjs +10 -17
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +4 -6
- package/dist/core/components/single-line-comment.mjs +4 -6
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +6 -10
- package/dist/core/components/source-file.mjs +6 -10
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +4 -6
- package/dist/core/components/spacing.mjs +4 -6
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/hcl/components/block-declaration.cjs +8 -12
- package/dist/hcl/components/block-declaration.mjs +8 -12
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.cjs +21 -35
- package/dist/hcl/components/hcl-file.mjs +22 -36
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/packer-file.cjs +8 -8
- package/dist/hcl/components/packer-file.mjs +8 -8
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.cjs +8 -8
- package/dist/hcl/components/terraform-file.mjs +8 -8
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/helpers/capnp.cjs +1 -1
- package/dist/helpers/capnp.mjs +1 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/index.cjs +7 -12
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -11
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +7 -9
- package/dist/markdown/components/front-matter.mjs +7 -9
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +44 -76
- package/dist/markdown/components/markdown-file.mjs +44 -76
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +28 -49
- package/dist/markdown/components/markdown-table.mjs +28 -49
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +3 -3
- package/dist/render.mjs +4 -4
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +20 -30
- package/dist/typescript/components/builtin-file.mjs +20 -30
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +100 -165
- package/dist/typescript/components/class-declaration.mjs +100 -165
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +6 -2
- package/dist/typescript/components/dynamic-import-statement.mjs +6 -2
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +8 -11
- package/dist/typescript/components/entry-file.mjs +8 -11
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +74 -127
- package/dist/typescript/components/interface-declaration.mjs +74 -127
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +50 -84
- package/dist/typescript/components/object-declaration.mjs +50 -84
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +3 -3
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +108 -241
- package/dist/typescript/components/tsdoc-reflection.mjs +108 -241
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +168 -265
- package/dist/typescript/components/tsdoc.mjs +168 -265
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +15 -20
- package/dist/typescript/components/type-declaration.mjs +15 -20
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +29 -55
- package/dist/typescript/components/type-parameters.mjs +29 -55
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +74 -135
- package/dist/typescript/components/typescript-file.mjs +74 -135
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +3 -5
- package/dist/typescript/contexts/lexical-scope.mjs +3 -5
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +3 -5
- package/dist/typescript/contexts/member-scope.mjs +3 -5
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +47 -92
- package/dist/yaml/components/yaml-file.mjs +47 -92
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -2,13 +2,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_contexts_context = require('../contexts/context.cjs');
|
|
4
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
5
|
let _alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
8
7
|
let _stryke_path_append = require("@stryke/path/append");
|
|
9
8
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
10
9
|
let defu = require("defu");
|
|
11
10
|
defu = require_runtime.__toESM(defu);
|
|
11
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
12
12
|
|
|
13
13
|
//#region src/core/components/infrastructure-file.tsx
|
|
14
14
|
/**
|
|
@@ -28,20 +28,15 @@ function InfrastructureFile(props) {
|
|
|
28
28
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
29
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
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.
|
|
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
32
|
});
|
|
33
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return path.value;
|
|
39
|
-
},
|
|
40
|
-
get meta() {
|
|
41
|
-
return (0, defu.default)({ kind: "infrastructure" }, meta ?? {});
|
|
42
|
-
},
|
|
33
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_source_file.SourceFile, {
|
|
34
|
+
...rest,
|
|
35
|
+
filetype: filetype.value,
|
|
36
|
+
path: path.value,
|
|
37
|
+
meta: (0, defu.default)({ kind: "infrastructure" }, meta ?? {}),
|
|
43
38
|
children
|
|
44
|
-
})
|
|
39
|
+
});
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { usePowerlinesSafe } from "../contexts/context.mjs";
|
|
2
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
3
|
import { computed, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { findFileExtensionSafe, hasFileExtension } from "@stryke/path/file-path-fns";
|
|
6
5
|
import { appendExtension, appendPath } from "@stryke/path/append";
|
|
7
6
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
8
7
|
import defu from "defu";
|
|
8
|
+
import { jsx } from "@alloy-js/core/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/core/components/infrastructure-file.tsx
|
|
11
11
|
/**
|
|
@@ -25,20 +25,15 @@ function InfrastructureFile(props) {
|
|
|
25
25
|
const context = usePowerlinesSafe();
|
|
26
26
|
const filetype = computed(() => _filetype || extension?.replace(/^\.*/, "") || (hasFileExtension(id) ? findFileExtensionSafe(id) : ""));
|
|
27
27
|
const path = computed(() => {
|
|
28
|
-
return appendExtension(replaceExtension(context ? appendPath(id, replacePath(context.infrastructurePath, context.
|
|
28
|
+
return appendExtension(replaceExtension(context ? appendPath(id, replacePath(context.infrastructurePath, context.config.cwd)) : id), filetype.value);
|
|
29
29
|
});
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return path.value;
|
|
36
|
-
},
|
|
37
|
-
get meta() {
|
|
38
|
-
return defu({ kind: "infrastructure" }, meta ?? {});
|
|
39
|
-
},
|
|
30
|
+
return /* @__PURE__ */ jsx(SourceFile, {
|
|
31
|
+
...rest,
|
|
32
|
+
filetype: filetype.value,
|
|
33
|
+
path: path.value,
|
|
34
|
+
meta: defu({ kind: "infrastructure" }, meta ?? {}),
|
|
40
35
|
children
|
|
41
|
-
})
|
|
36
|
+
});
|
|
42
37
|
}
|
|
43
38
|
|
|
44
39
|
//#endregion
|
|
@@ -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(
|
|
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":";;;;;;;;;;;;;;;;AAkDA,SAAgB,mBAAmB,OAAgC;CACjE,MAAM,CAAC,EAAE,UAAU,MAAM,IAAI,WAAW,UAAU,aAAa,QAC7D,WAAW,OAAO;EAAC;EAAY;EAAQ;EAAM;EAAa;EAAW,CAAC;CAExE,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eAEb,aACA,WAAW,QAAQ,QAAQ,GAAG,KAC7B,iBAAiB,GAAG,GAAG,sBAAsB,GAAG,GAAG,IACvD;CACD,MAAM,OAAO,eAAe;AAQ1B,SAAO,gBAAgB,iBAPT,UACV,WACE,IACA,YAAY,QAAQ,oBAAoB,QAAQ,OAAO,IAAI,CAC5D,GACD,GAE0C,EAAE,SAAS,MAAM;GAC/D;AAEF,QACE,oBAAC,YAAD;EACE,GAAI;EACJ,UAAU,SAAS;EACnB,MAAM,KAAK;EACX,MAAM,KACJ,EACE,MAAM,kBACP,EACD,QAAQ,EAAE,CACX;EACA;EACU"}
|
|
@@ -3,8 +3,8 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
const require_core_contexts_context = require('../contexts/context.cjs');
|
|
4
4
|
const require_core_contexts_meta = require('../contexts/meta.cjs');
|
|
5
5
|
require('../contexts/index.cjs');
|
|
6
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
6
|
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
8
|
|
|
9
9
|
//#region src/core/components/output.tsx
|
|
10
10
|
/**
|
|
@@ -17,23 +17,16 @@ function Output(props) {
|
|
|
17
17
|
"meta"
|
|
18
18
|
]);
|
|
19
19
|
const contextRef = (0, _alloy_js_core.computed)(() => context);
|
|
20
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
20
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_contexts_meta.MetaContext.Provider, {
|
|
21
21
|
value: meta,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return contextRef.value.workspaceConfig.workspaceRoot;
|
|
31
|
-
},
|
|
32
|
-
children
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
22
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_contexts_context.PowerlinesContext.Provider, {
|
|
23
|
+
value: contextRef.value,
|
|
24
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Output, {
|
|
25
|
+
...rest,
|
|
26
|
+
basePath: contextRef.value.config.cwd,
|
|
27
|
+
children
|
|
28
|
+
})
|
|
29
|
+
})
|
|
37
30
|
});
|
|
38
31
|
}
|
|
39
32
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PowerlinesContext } from "../contexts/context.mjs";
|
|
2
2
|
import { MetaContext } from "../contexts/meta.mjs";
|
|
3
3
|
import "../contexts/index.mjs";
|
|
4
|
-
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
4
|
import { Output as Output$1, computed, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { jsx } from "@alloy-js/core/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/core/components/output.tsx
|
|
8
8
|
/**
|
|
@@ -15,23 +15,16 @@ function Output(props) {
|
|
|
15
15
|
"meta"
|
|
16
16
|
]);
|
|
17
17
|
const contextRef = computed(() => context);
|
|
18
|
-
return
|
|
18
|
+
return /* @__PURE__ */ jsx(MetaContext.Provider, {
|
|
19
19
|
value: meta,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return contextRef.value.workspaceConfig.workspaceRoot;
|
|
29
|
-
},
|
|
30
|
-
children
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
20
|
+
children: /* @__PURE__ */ jsx(PowerlinesContext.Provider, {
|
|
21
|
+
value: contextRef.value,
|
|
22
|
+
children: /* @__PURE__ */ jsx(Output$1, {
|
|
23
|
+
...rest,
|
|
24
|
+
basePath: contextRef.value.config.cwd,
|
|
25
|
+
children
|
|
26
|
+
})
|
|
27
|
+
})
|
|
35
28
|
});
|
|
36
29
|
}
|
|
37
30
|
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"output.mjs","names":["OutputExternal"],"sources":["../../../src/core/components/output.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { OutputProps as OutputPropsExternal } from \"@alloy-js/core\";\nimport { computed, Output as OutputExternal, splitProps } from \"@alloy-js/core\";\nimport type { PluginContext } from \"@powerlines/core\";\nimport { MetaContext, MetaItem } from \"../contexts\";\nimport { PowerlinesContext } from \"../contexts/context\";\n\nexport interface OutputProps<\n TContext extends PluginContext = PluginContext\n> extends Omit<OutputPropsExternal, \"basePath\"> {\n /**\n * The current Powerlines process context.\n */\n context: TContext;\n\n /**\n * The file metadata collected during rendering.\n */\n meta?: Record<string, MetaItem>;\n}\n\n/**\n * Output component for rendering the Powerlines plugin's output files via templates.\n */\nexport function Output<TContext extends PluginContext = PluginContext>(\n props: OutputProps<TContext>\n) {\n const [{ children, context, meta = {} }, rest] = splitProps(props, [\n \"children\",\n \"context\",\n \"meta\"\n ]);\n\n const contextRef = computed(() => context);\n\n return (\n <MetaContext.Provider value={meta}>\n <PowerlinesContext.Provider value={contextRef.value}>\n <OutputExternal {...rest} basePath={contextRef.value.config.cwd}>\n {children}\n </OutputExternal>\n </PowerlinesContext.Provider>\n </MetaContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,OACd,OACA;CACA,MAAM,CAAC,EAAE,UAAU,SAAS,OAAO,EAAE,IAAI,QAAQ,WAAW,OAAO;EACjE;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAa,eAAe,QAAQ;AAE1C,QACE,oBAAC,YAAY,UAAb;EAAsB,OAAO;YAC3B,oBAAC,kBAAkB,UAAnB;GAA4B,OAAO,WAAW;aAC5C,oBAACA,UAAD;IAAgB,GAAI;IAAM,UAAU,WAAW,MAAM,OAAO;IACzD;IACc;GACU;EACR"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/single-line-comment.tsx
|
|
7
7
|
/**
|
|
@@ -11,12 +11,10 @@ let _alloy_js_core = require("@alloy-js/core");
|
|
|
11
11
|
function SingleLineComment(props) {
|
|
12
12
|
const { variant = "double-slash", children } = props;
|
|
13
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.
|
|
14
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [commentStart, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)("align", {
|
|
15
15
|
string: commentStart,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
})];
|
|
16
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""]
|
|
17
|
+
})] });
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { Prose } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/core/components/single-line-comment.tsx
|
|
5
5
|
/**
|
|
@@ -9,12 +9,10 @@ import { Prose } from "@alloy-js/core";
|
|
|
9
9
|
function SingleLineComment(props) {
|
|
10
10
|
const { variant = "double-slash", children } = props;
|
|
11
11
|
const commentStart = variant === "slash-star" ? "/* " : variant === "slash-star-star" ? "/** " : variant === "triple-slash" ? "/// " : variant === "markdown" ? "<!-- " : variant === "yaml" || variant === "hcl" ? "# " : "// ";
|
|
12
|
-
return [commentStart,
|
|
12
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [commentStart, /* @__PURE__ */ jsxs("align", {
|
|
13
13
|
string: commentStart,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
})];
|
|
14
|
+
children: [/* @__PURE__ */ jsx(Prose, { children }), variant === "slash-star" || variant === "slash-star-star" ? " */ " : variant === "markdown" ? " -->" : ""]
|
|
15
|
+
})] });
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
//#endregion
|
|
@@ -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":";;;;;;;;
|
|
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":";;;;;;;;AA2CA,SAAgB,kBAAkB,OAA+B;CAC/D,MAAM,EAAE,UAAU,gBAAgB,aAAa;CAE/C,MAAM,eACJ,YAAY,eACR,QACA,YAAY,oBACV,SACA,YAAY,iBACV,SACA,YAAY,aACV,UACA,YAAY,UAAU,YAAY,QAChC,OACA;AAEd,QACE,4CACG,cACD,qBAAC,SAAD;EAAO,QAAQ;YAAf,CACE,oBAAC,OAAD,EAAQ,UAAiB,GAExB,YAAY,gBAAgB,YAAY,oBACrC,SACA,YAAY,aACV,SACA,GACA;IACP"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_contexts_meta = require('../contexts/meta.cjs');
|
|
4
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
6
5
|
let _stryke_path_append = require("@stryke/path/append");
|
|
7
6
|
let defu = require("defu");
|
|
8
7
|
defu = require_runtime.__toESM(defu);
|
|
8
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
9
9
|
|
|
10
10
|
//#region src/core/components/source-file.tsx
|
|
11
11
|
/**
|
|
@@ -47,16 +47,12 @@ function SourceFile(props) {
|
|
|
47
47
|
storage,
|
|
48
48
|
...meta ?? {}
|
|
49
49
|
};
|
|
50
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
50
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.SourceFileContext.Provider, {
|
|
51
51
|
value: sourceFile,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return [header, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
57
|
-
}
|
|
58
|
-
}), children];
|
|
59
|
-
}
|
|
52
|
+
children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
|
|
53
|
+
when: header !== void 0,
|
|
54
|
+
children: [header, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
|
|
55
|
+
}), children]
|
|
60
56
|
});
|
|
61
57
|
}
|
|
62
58
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMeta } from "../contexts/meta.mjs";
|
|
2
|
-
import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { Show, SourceDirectoryContext, SourceFileContext, getContext, splitProps, useContext, useFormatOptions } from "@alloy-js/core";
|
|
4
3
|
import { appendPath } from "@stryke/path/append";
|
|
5
4
|
import defu from "defu";
|
|
5
|
+
import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/core/components/source-file.tsx
|
|
8
8
|
/**
|
|
@@ -44,16 +44,12 @@ function SourceFile(props) {
|
|
|
44
44
|
storage,
|
|
45
45
|
...meta ?? {}
|
|
46
46
|
};
|
|
47
|
-
return
|
|
47
|
+
return /* @__PURE__ */ jsxs(SourceFileContext.Provider, {
|
|
48
48
|
value: sourceFile,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return [header, createIntrinsic("hbr", {})];
|
|
54
|
-
}
|
|
55
|
-
}), children];
|
|
56
|
-
}
|
|
49
|
+
children: [/* @__PURE__ */ jsxs(Show, {
|
|
50
|
+
when: header !== void 0,
|
|
51
|
+
children: [header, /* @__PURE__ */ jsx("hbr", {})]
|
|
52
|
+
}), children]
|
|
57
53
|
});
|
|
58
54
|
}
|
|
59
55
|
|
|
@@ -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":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/core/components/source-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n getContext,\n Show,\n SourceDirectoryContext,\n SourceFileContext,\n SourceFileProps as SourceFilePropsExternal,\n splitProps,\n useContext,\n useFormatOptions\n} from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport type { StoragePreset } from \"powerlines\";\nimport { ComponentProps } from \"../../types/components\";\nimport { useMeta } from \"../contexts/meta\";\n\nexport type SourceFileProps = SourceFilePropsExternal &\n ComponentProps & {\n /**\n * The storage preset for the output files.\n *\n * @remarks\n * If not specified, the output mode will be determined by the provided `output.mode` value.\n */\n storage?: StoragePreset;\n\n /**\n * The metadata associated with the source file.\n *\n * @remarks\n * The values stored in the metadata will be available in the rendering context.\n */\n meta?: Record<string, any>;\n };\n\n/**\n * A base component representing a Powerlines generated source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function SourceFile(props: SourceFileProps) {\n const [{ children, meta, path, header, storage, filetype, reference }] =\n splitProps(props, [\n \"children\",\n \"meta\",\n \"path\",\n \"header\",\n \"storage\",\n \"filetype\",\n \"reference\"\n ]);\n\n const metadata = useMeta();\n const parentDirectory = useContext(SourceDirectoryContext)!;\n\n const sourceFile: SourceFileContext = {\n path: appendPath(path, parentDirectory.path),\n filetype,\n reference\n };\n parentDirectory?.addContent(sourceFile);\n\n const printOptions = useFormatOptions({\n printWidth: props.printWidth,\n tabWidth: props.tabWidth,\n useTabs: props.useTabs,\n insertFinalNewLine: props.insertFinalNewLine\n });\n\n const nodeContext = getContext()!;\n nodeContext.meta = defu(\n {\n sourceFile,\n printOptions\n },\n meta ?? {}\n );\n\n if (metadata) {\n metadata[sourceFile.path] = {\n storage,\n ...(meta ?? {})\n };\n }\n\n return (\n <SourceFileContext.Provider value={sourceFile}>\n <Show when={header !== undefined}>\n {header}\n <hbr />\n </Show>\n {children}\n </SourceFileContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA2DA,SAAgB,WAAW,OAAwB;CACjD,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,QAAQ,SAAS,UAAU,eACxD,WAAW,OAAO;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEJ,MAAM,WAAW,SAAS;CAC1B,MAAM,kBAAkB,WAAW,uBAAuB;CAE1D,MAAM,aAAgC;EACpC,MAAM,WAAW,MAAM,gBAAgB,KAAK;EAC5C;EACA;EACD;AACD,kBAAiB,WAAW,WAAW;CAEvC,MAAM,eAAe,iBAAiB;EACpC,YAAY,MAAM;EAClB,UAAU,MAAM;EAChB,SAAS,MAAM;EACf,oBAAoB,MAAM;EAC3B,CAAC;CAEF,MAAM,cAAc,YAAY;AAChC,aAAY,OAAO,KACjB;EACE;EACA;EACD,EACD,QAAQ,EAAE,CACX;AAED,KAAI,SACF,UAAS,WAAW,QAAQ;EAC1B;EACA,GAAI,QAAQ,EAAE;EACf;AAGH,QACE,qBAAC,kBAAkB,UAAnB;EAA4B,OAAO;YAAnC,CACE,qBAAC,MAAD;GAAM,MAAM,WAAW;aAAvB,CACG,QACD,oBAAC,OAAD,EAAO,EACF;MACN,SAC0B"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/spacing.tsx
|
|
7
7
|
/**
|
|
8
8
|
* A simple component that renders two horizontal breaks to create vertical spacing between elements.
|
|
9
9
|
*/
|
|
10
10
|
function Spacing({ scale = 1 }) {
|
|
11
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
children: (_) => [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
|
|
11
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
|
|
12
|
+
each: Array.from({ length: scale }),
|
|
13
|
+
children: (_) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
|
|
16
14
|
});
|
|
17
15
|
}
|
|
18
16
|
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { For } from "@alloy-js/core";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/core/components/spacing.tsx
|
|
5
5
|
/**
|
|
6
6
|
* A simple component that renders two horizontal breaks to create vertical spacing between elements.
|
|
7
7
|
*/
|
|
8
8
|
function Spacing({ scale = 1 }) {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
children: (_) => [createIntrinsic("hbr", {}), createIntrinsic("hbr", {})]
|
|
9
|
+
return /* @__PURE__ */ jsx(For, {
|
|
10
|
+
each: Array.from({ length: scale }),
|
|
11
|
+
children: (_) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hbr", {}), /* @__PURE__ */ jsx("hbr", {})] })
|
|
14
12
|
});
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -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":";;;;;;;AAmCA,SAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"spacing.mjs","names":[],"sources":["../../../src/core/components/spacing.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\n\nexport interface SpacingProps {\n /**\n * A scale factor that determines the amount of vertical space to be added.\n *\n * @remarks\n * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.\n *\n * @defaultValue 1\n */\n scale?: number;\n}\n\n/**\n * A simple component that renders two horizontal breaks to create vertical spacing between elements.\n */\nexport function Spacing({ scale = 1 }: SpacingProps) {\n return (\n <For each={Array.from({ length: scale })}>\n {_ => (\n <>\n <hbr />\n <hbr />\n </>\n )}\n </For>\n );\n}\n"],"mappings":";;;;;;;AAmCA,SAAgB,QAAQ,EAAE,QAAQ,KAAmB;AACnD,QACE,oBAAC,KAAD;EAAK,MAAM,MAAM,KAAK,EAAE,QAAQ,OAAO,CAAC;aACrC,MACC,4CACE,oBAAC,OAAD,EAAO,GACP,oBAAC,OAAD,EAAO,EACN;EAED"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_helpers_code = require('../../core/helpers/code.cjs');
|
|
4
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
6
|
|
|
7
7
|
//#region src/hcl/components/block-declaration.tsx
|
|
8
8
|
/**
|
|
@@ -16,18 +16,14 @@ let _alloy_js_core = require("@alloy-js/core");
|
|
|
16
16
|
*/
|
|
17
17
|
function BlockDeclaration(props) {
|
|
18
18
|
const { children, type, label } = props;
|
|
19
|
-
return [
|
|
20
|
-
|
|
21
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
children
|
|
27
|
-
});
|
|
28
|
-
} }),
|
|
19
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
20
|
+
require_core_helpers_code.code`${type} ${Array.isArray(label) ? label.join(" ") : label} {`,
|
|
21
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Prose, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
22
|
+
when: Boolean(children),
|
|
23
|
+
children
|
|
24
|
+
}) }),
|
|
29
25
|
require_core_helpers_code.code`} `
|
|
30
|
-
];
|
|
26
|
+
] });
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code as code$1 } from "../../core/helpers/code.mjs";
|
|
2
|
-
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { Prose, Show } from "@alloy-js/core";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/hcl/components/block-declaration.tsx
|
|
6
6
|
/**
|
|
@@ -14,18 +14,14 @@ import { Prose, Show } from "@alloy-js/core";
|
|
|
14
14
|
*/
|
|
15
15
|
function BlockDeclaration(props) {
|
|
16
16
|
const { children, type, label } = props;
|
|
17
|
-
return [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
children
|
|
25
|
-
});
|
|
26
|
-
} }),
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
code$1`${type} ${Array.isArray(label) ? label.join(" ") : label} {`,
|
|
19
|
+
/* @__PURE__ */ jsx(Prose, { children: /* @__PURE__ */ jsx(Show, {
|
|
20
|
+
when: Boolean(children),
|
|
21
|
+
children
|
|
22
|
+
}) }),
|
|
27
23
|
code$1`} `
|
|
28
|
-
];
|
|
24
|
+
] });
|
|
29
25
|
}
|
|
30
26
|
|
|
31
27
|
//#endregion
|
|
@@ -1 +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,
|
|
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,EAAE,UAAU,MAAM,UAAU;AAElC,QACE;EACG,MAAI,GAAG,KAAK,GAAG,MAAM,QAAQ,MAAM,GAAG,MAAM,KAAK,IAAI,GAAG,MAAM;EAC/D,oBAAC,OAAD,YACE,oBAAC,MAAD;GAAM,MAAM,QAAQ,SAAS;GAAG;GAAgB,GAC1C;EACP,MAAI;EACJ"}
|
|
@@ -3,9 +3,9 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
4
4
|
const require_core_components_infrastructure_file = require('../../core/components/infrastructure-file.cjs');
|
|
5
5
|
const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
|
|
6
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
6
7
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
8
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
9
9
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
10
|
let powerlines_utils = require("powerlines/utils");
|
|
11
11
|
|
|
@@ -25,23 +25,17 @@ function HCLFile(props) {
|
|
|
25
25
|
"id"
|
|
26
26
|
]);
|
|
27
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.
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_infrastructure_file.InfrastructureFile, {
|
|
29
|
+
header: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(HCLFileHeader, { children: header }),
|
|
30
|
+
...rest,
|
|
31
31
|
id,
|
|
32
|
-
|
|
33
|
-
return filetype.value;
|
|
34
|
-
},
|
|
32
|
+
filetype: filetype.value,
|
|
35
33
|
storage: storage || "fs",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}));
|
|
34
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
35
|
+
when: Boolean(children),
|
|
36
|
+
children
|
|
37
|
+
})
|
|
38
|
+
});
|
|
45
39
|
}
|
|
46
40
|
/**
|
|
47
41
|
* Renders the header for a Powerlines HCL source file.
|
|
@@ -52,30 +46,22 @@ function HCLFile(props) {
|
|
|
52
46
|
function HCLFileHeader(props) {
|
|
53
47
|
const [{ children }] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
54
48
|
const context = require_core_contexts_context.usePowerlines();
|
|
55
|
-
return [
|
|
56
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
get children() {
|
|
61
|
-
return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
62
|
-
}
|
|
49
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
51
|
+
when: Boolean(children),
|
|
52
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
|
|
63
53
|
}),
|
|
64
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
54
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
65
55
|
variant: "hcl",
|
|
66
|
-
|
|
67
|
-
return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
|
|
68
|
-
}
|
|
56
|
+
children: `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`
|
|
69
57
|
}),
|
|
70
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
71
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
58
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
|
|
59
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
|
|
72
60
|
variant: "hcl",
|
|
73
|
-
|
|
74
|
-
return (0, powerlines_utils.getFileHeaderWarning)(context);
|
|
75
|
-
}
|
|
61
|
+
children: (0, powerlines_utils.getFileHeaderWarning)(context)
|
|
76
62
|
}),
|
|
77
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
78
|
-
];
|
|
63
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
|
|
64
|
+
] });
|
|
79
65
|
}
|
|
80
66
|
|
|
81
67
|
//#endregion
|