@powerlines/plugin-env 0.14.26 → 0.15.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.
Files changed (80) hide show
  1. package/dist/components/docs.cjs +6 -6
  2. package/dist/components/docs.mjs +3 -3
  3. package/dist/components/env.cjs +153 -40
  4. package/dist/components/env.d.cts +2 -2
  5. package/dist/components/env.d.mts +2 -2
  6. package/dist/components/env.mjs +128 -15
  7. package/dist/helpers/create-reflection-resource.d.cts +2 -2
  8. package/dist/helpers/create-reflection-resource.d.mts +2 -2
  9. package/dist/index.d.cts +1 -1
  10. package/dist/index.d.mts +1 -1
  11. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
  12. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
  13. package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
  14. package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
  15. package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
  16. package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
  17. package/dist/plugin-alloy/src/core/contexts/context.cjs +50 -1
  18. package/dist/plugin-alloy/src/core/contexts/context.mjs +46 -2
  19. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  20. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  21. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
  22. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
  23. package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
  24. package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
  25. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +115 -0
  26. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +114 -0
  27. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +39 -0
  28. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +38 -0
  29. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +18 -0
  30. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
  31. package/dist/plugin-alloy/src/types/components.d.cts +19 -0
  32. package/dist/plugin-alloy/src/types/components.d.mts +19 -1
  33. package/dist/plugin-alloy/src/types/index.d.mts +1 -1
  34. package/dist/plugin-alloy/src/types/plugin.d.cts +2 -2
  35. package/dist/plugin-alloy/src/types/plugin.d.mts +2 -2
  36. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
  37. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
  38. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
  39. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
  40. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
  41. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
  42. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
  43. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
  44. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
  45. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
  46. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +193 -0
  47. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
  48. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
  49. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +190 -0
  50. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
  51. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +11 -0
  52. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +12 -0
  53. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
  54. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
  55. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
  56. package/dist/plugin-automd/src/types/plugin.d.mts +2 -2
  57. package/dist/plugin-babel/src/types/plugin.d.cts +2 -2
  58. package/dist/plugin-babel/src/types/plugin.d.mts +2 -2
  59. package/dist/powerlines/src/api.d.mts +2 -2
  60. package/dist/powerlines/src/index.d.mts +4 -4
  61. package/dist/powerlines/src/internal/helpers/hooks.d.mts +3 -3
  62. package/dist/powerlines/src/lib/build/esbuild.mjs +1 -1
  63. package/dist/powerlines/src/lib/entry.mjs +1 -1
  64. package/dist/powerlines/src/types/api.d.mts +2 -2
  65. package/dist/powerlines/src/types/babel.d.cts +1 -1
  66. package/dist/powerlines/src/types/babel.d.mts +1 -1
  67. package/dist/powerlines/src/types/commands.d.cts +1 -1
  68. package/dist/powerlines/src/types/commands.d.mts +1 -1
  69. package/dist/powerlines/src/types/config.d.cts +5 -5
  70. package/dist/powerlines/src/types/config.d.mts +5 -5
  71. package/dist/powerlines/src/types/context.d.cts +1 -1
  72. package/dist/powerlines/src/types/context.d.mts +2 -2
  73. package/dist/powerlines/src/types/fs.d.cts +1 -1
  74. package/dist/powerlines/src/types/index.d.mts +5 -5
  75. package/dist/powerlines/src/types/plugin.d.cts +3 -3
  76. package/dist/powerlines/src/types/plugin.d.mts +3 -3
  77. package/dist/powerlines/src/types/resolved.d.cts +1 -1
  78. package/dist/powerlines/src/types/resolved.d.mts +1 -1
  79. package/dist/powerlines/src/types/unplugin.d.mts +2 -2
  80. package/package.json +8 -8
@@ -0,0 +1,64 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_context = require('../contexts/context.cjs');
3
+ require('../contexts/index.cjs');
4
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let __alloy_js_core = require("@alloy-js/core");
6
+ let __stryke_path_append = require("@stryke/path/append");
7
+ let defu = require("defu");
8
+ defu = require_rolldown_runtime.__toESM(defu);
9
+
10
+ //#region ../plugin-alloy/src/core/components/source-file.tsx
11
+ /**
12
+ * A base component representing a Powerlines generated source file.
13
+ *
14
+ * @param props - The properties for the source file.
15
+ * @returns The rendered source file component.
16
+ */
17
+ function SourceFile(props) {
18
+ const [{ children, meta, path, header, storage, filetype, reference }] = (0, __alloy_js_core.splitProps)(props, [
19
+ "children",
20
+ "meta",
21
+ "path",
22
+ "header",
23
+ "storage",
24
+ "filetype",
25
+ "reference"
26
+ ]);
27
+ const metadata = require_context.useMeta();
28
+ const parentDirectory = (0, __alloy_js_core.useContext)(__alloy_js_core.SourceDirectoryContext);
29
+ const sourceFile = {
30
+ path: (0, __stryke_path_append.appendPath)(path, parentDirectory.path),
31
+ filetype,
32
+ reference
33
+ };
34
+ parentDirectory?.addContent(sourceFile);
35
+ const printOptions = (0, __alloy_js_core.useFormatOptions)({
36
+ printWidth: props.printWidth,
37
+ tabWidth: props.tabWidth,
38
+ useTabs: props.useTabs,
39
+ insertFinalNewLine: props.insertFinalNewLine
40
+ });
41
+ const nodeContext = (0, __alloy_js_core.getContext)();
42
+ nodeContext.meta = (0, defu.default)({
43
+ sourceFile,
44
+ printOptions
45
+ }, meta ?? {});
46
+ metadata[sourceFile.path] = {
47
+ storage,
48
+ ...meta ?? {}
49
+ };
50
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.SourceFileContext.Provider, {
51
+ value: sourceFile,
52
+ get children() {
53
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
54
+ when: header !== void 0,
55
+ get children() {
56
+ return [header, (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
57
+ }
58
+ }), children];
59
+ }
60
+ });
61
+ }
62
+
63
+ //#endregion
64
+ exports.SourceFile = SourceFile;
@@ -0,0 +1,23 @@
1
+ import { StoragePreset } from "../../../../powerlines/src/types/fs.cjs";
2
+ import { ComponentProps } from "../../types/components.cjs";
3
+ import { SourceFileProps } from "@alloy-js/core";
4
+
5
+ //#region ../plugin-alloy/src/core/components/source-file.d.ts
6
+ type SourceFileProps$1 = SourceFileProps & ComponentProps & {
7
+ /**
8
+ * The storage preset for the output files.
9
+ *
10
+ * @remarks
11
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
12
+ */
13
+ storage?: StoragePreset;
14
+ /**
15
+ * The metadata associated with the source file.
16
+ *
17
+ * @remarks
18
+ * The values stored in the metadata will be available in the rendering context.
19
+ */
20
+ meta?: Record<string, any>;
21
+ };
22
+ //#endregion
23
+ export { SourceFileProps$1 as SourceFileProps };
@@ -0,0 +1,23 @@
1
+ import { StoragePreset } from "../../../../powerlines/src/types/fs.mjs";
2
+ import { ComponentProps } from "../../types/components.mjs";
3
+ import { SourceFileProps } from "@alloy-js/core";
4
+
5
+ //#region ../plugin-alloy/src/core/components/source-file.d.ts
6
+ type SourceFileProps$1 = SourceFileProps & ComponentProps & {
7
+ /**
8
+ * The storage preset for the output files.
9
+ *
10
+ * @remarks
11
+ * If not specified, the output mode will be determined by the provided `output.mode` value.
12
+ */
13
+ storage?: StoragePreset;
14
+ /**
15
+ * The metadata associated with the source file.
16
+ *
17
+ * @remarks
18
+ * The values stored in the metadata will be available in the rendering context.
19
+ */
20
+ meta?: Record<string, any>;
21
+ };
22
+ //#endregion
23
+ export { SourceFileProps$1 as SourceFileProps };
@@ -0,0 +1,62 @@
1
+ import { useMeta } from "../contexts/context.mjs";
2
+ import "../contexts/index.mjs";
3
+ import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
+ import { Show, SourceDirectoryContext, SourceFileContext, getContext, splitProps, useContext, useFormatOptions } from "@alloy-js/core";
5
+ import { appendPath } from "@stryke/path/append";
6
+ import defu from "defu";
7
+
8
+ //#region ../plugin-alloy/src/core/components/source-file.tsx
9
+ /**
10
+ * A base component representing a Powerlines generated source file.
11
+ *
12
+ * @param props - The properties for the source file.
13
+ * @returns The rendered source file component.
14
+ */
15
+ function SourceFile(props) {
16
+ const [{ children, meta, path, header, storage, filetype, reference }] = splitProps(props, [
17
+ "children",
18
+ "meta",
19
+ "path",
20
+ "header",
21
+ "storage",
22
+ "filetype",
23
+ "reference"
24
+ ]);
25
+ const metadata = useMeta();
26
+ const parentDirectory = useContext(SourceDirectoryContext);
27
+ const sourceFile = {
28
+ path: appendPath(path, parentDirectory.path),
29
+ filetype,
30
+ reference
31
+ };
32
+ parentDirectory?.addContent(sourceFile);
33
+ const printOptions = useFormatOptions({
34
+ printWidth: props.printWidth,
35
+ tabWidth: props.tabWidth,
36
+ useTabs: props.useTabs,
37
+ insertFinalNewLine: props.insertFinalNewLine
38
+ });
39
+ const nodeContext = getContext();
40
+ nodeContext.meta = defu({
41
+ sourceFile,
42
+ printOptions
43
+ }, meta ?? {});
44
+ metadata[sourceFile.path] = {
45
+ storage,
46
+ ...meta ?? {}
47
+ };
48
+ return createComponent(SourceFileContext.Provider, {
49
+ value: sourceFile,
50
+ get children() {
51
+ return [createComponent(Show, {
52
+ when: header !== void 0,
53
+ get children() {
54
+ return [header, createIntrinsic("hbr", {})];
55
+ }
56
+ }), children];
57
+ }
58
+ });
59
+ }
60
+
61
+ //#endregion
62
+ export { SourceFile };
@@ -6,6 +6,55 @@ let __alloy_js_core = require("@alloy-js/core");
6
6
  * The Powerlines context used in template rendering.
7
7
  */
8
8
  const PowerlinesContext = (0, __alloy_js_core.createNamedContext)("powerlines");
9
+ /**
10
+ * Hook to access the Powerlines Context.
11
+ *
12
+ * @returns The Context.
13
+ */
14
+ function usePowerlinesContext() {
15
+ return (0, __alloy_js_core.useContext)(PowerlinesContext);
16
+ }
17
+ /**
18
+ * Hook to safely access the {@link PluginContext | Powerlines context}.
19
+ *
20
+ * @returns The Powerlines context or undefined if not set.
21
+ */
22
+ function usePowerlinesSafe() {
23
+ return usePowerlinesContext()?.ref?.value;
24
+ }
25
+ /**
26
+ * Hook to access the {@link PluginContext | Powerlines context}.
27
+ *
28
+ * @returns The Powerlines context.
29
+ */
30
+ function usePowerlines() {
31
+ const powerlines = usePowerlinesSafe();
32
+ if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
33
+ return powerlines;
34
+ }
35
+ /**
36
+ * Hook to safely access the render context's metadata.
37
+ *
38
+ * @returns The Powerlines context or undefined if not set.
39
+ */
40
+ function useMetaSafe() {
41
+ return usePowerlinesContext()?.meta?.value;
42
+ }
43
+ /**
44
+ * Hook to access the render context's metadata.
45
+ *
46
+ * @returns The Powerlines context.
47
+ */
48
+ function useMeta() {
49
+ const meta = useMetaSafe();
50
+ if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
51
+ return meta;
52
+ }
9
53
 
10
54
  //#endregion
11
- exports.PowerlinesContext = PowerlinesContext;
55
+ exports.PowerlinesContext = PowerlinesContext;
56
+ exports.useMeta = useMeta;
57
+ exports.useMetaSafe = useMetaSafe;
58
+ exports.usePowerlines = usePowerlines;
59
+ exports.usePowerlinesContext = usePowerlinesContext;
60
+ exports.usePowerlinesSafe = usePowerlinesSafe;
@@ -1,10 +1,54 @@
1
- import { createNamedContext } from "@alloy-js/core";
1
+ import { createNamedContext, useContext } from "@alloy-js/core";
2
2
 
3
3
  //#region ../plugin-alloy/src/core/contexts/context.ts
4
4
  /**
5
5
  * The Powerlines context used in template rendering.
6
6
  */
7
7
  const PowerlinesContext = createNamedContext("powerlines");
8
+ /**
9
+ * Hook to access the Powerlines Context.
10
+ *
11
+ * @returns The Context.
12
+ */
13
+ function usePowerlinesContext() {
14
+ return useContext(PowerlinesContext);
15
+ }
16
+ /**
17
+ * Hook to safely access the {@link PluginContext | Powerlines context}.
18
+ *
19
+ * @returns The Powerlines context or undefined if not set.
20
+ */
21
+ function usePowerlinesSafe() {
22
+ return usePowerlinesContext()?.ref?.value;
23
+ }
24
+ /**
25
+ * Hook to access the {@link PluginContext | Powerlines context}.
26
+ *
27
+ * @returns The Powerlines context.
28
+ */
29
+ function usePowerlines() {
30
+ const powerlines = usePowerlinesSafe();
31
+ if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
32
+ return powerlines;
33
+ }
34
+ /**
35
+ * Hook to safely access the render context's metadata.
36
+ *
37
+ * @returns The Powerlines context or undefined if not set.
38
+ */
39
+ function useMetaSafe() {
40
+ return usePowerlinesContext()?.meta?.value;
41
+ }
42
+ /**
43
+ * Hook to access the render context's metadata.
44
+ *
45
+ * @returns The Powerlines context.
46
+ */
47
+ function useMeta() {
48
+ const meta = useMetaSafe();
49
+ if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
50
+ return meta;
51
+ }
8
52
 
9
53
  //#endregion
10
- export { PowerlinesContext };
54
+ export { PowerlinesContext, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
@@ -0,0 +1,2 @@
1
+ const require_context = require('./context.cjs');
2
+ const require_reflection = require('./reflection.cjs');
@@ -0,0 +1,4 @@
1
+ import { PowerlinesContext, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.mjs";
2
+ import { ReflectionClassContext, ReflectionPropertyContext, useReflectionClass, useReflectionProperty } from "./reflection.mjs";
3
+
4
+ export { };
@@ -0,0 +1,46 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ let __alloy_js_core = require("@alloy-js/core");
3
+
4
+ //#region ../plugin-alloy/src/core/contexts/reflection.ts
5
+ /**
6
+ * The reflection class context used in template rendering.
7
+ */
8
+ const ReflectionClassContext = (0, __alloy_js_core.createContext)();
9
+ /**
10
+ * Hook to access the Reflection context.
11
+ *
12
+ * @returns A reactive version of the current reflection.
13
+ */
14
+ function useReflectionClass() {
15
+ const context = (0, __alloy_js_core.useContext)(ReflectionClassContext);
16
+ if (!context) throw new Error("Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
17
+ return context;
18
+ }
19
+ /**
20
+ * The reflection property context used in template rendering.
21
+ */
22
+ const ReflectionPropertyContext = (0, __alloy_js_core.createNamedContext)("reflection-property");
23
+ /**
24
+ * Hook to access the Reflection Property context.
25
+ *
26
+ * @returns A reactive version of the current reflection.
27
+ */
28
+ function useReflectionProperty() {
29
+ const context = (0, __alloy_js_core.useContext)(ReflectionPropertyContext);
30
+ if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
31
+ return context;
32
+ }
33
+ /**
34
+ * The reflection method context used in template rendering.
35
+ */
36
+ const ReflectionMethodContext = (0, __alloy_js_core.createNamedContext)("reflection-method");
37
+ /**
38
+ * The reflection parameter context used in template rendering.
39
+ */
40
+ const ReflectionParameterContext = (0, __alloy_js_core.createNamedContext)("reflection-parameter");
41
+
42
+ //#endregion
43
+ exports.ReflectionClassContext = ReflectionClassContext;
44
+ exports.ReflectionPropertyContext = ReflectionPropertyContext;
45
+ exports.useReflectionClass = useReflectionClass;
46
+ exports.useReflectionProperty = useReflectionProperty;
@@ -0,0 +1,42 @@
1
+ import { createContext, createNamedContext, useContext } from "@alloy-js/core";
2
+
3
+ //#region ../plugin-alloy/src/core/contexts/reflection.ts
4
+ /**
5
+ * The reflection class context used in template rendering.
6
+ */
7
+ const ReflectionClassContext = createContext();
8
+ /**
9
+ * Hook to access the Reflection context.
10
+ *
11
+ * @returns A reactive version of the current reflection.
12
+ */
13
+ function useReflectionClass() {
14
+ const context = useContext(ReflectionClassContext);
15
+ if (!context) throw new Error("Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
16
+ return context;
17
+ }
18
+ /**
19
+ * The reflection property context used in template rendering.
20
+ */
21
+ const ReflectionPropertyContext = createNamedContext("reflection-property");
22
+ /**
23
+ * Hook to access the Reflection Property context.
24
+ *
25
+ * @returns A reactive version of the current reflection.
26
+ */
27
+ function useReflectionProperty() {
28
+ const context = useContext(ReflectionPropertyContext);
29
+ if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
30
+ return context;
31
+ }
32
+ /**
33
+ * The reflection method context used in template rendering.
34
+ */
35
+ const ReflectionMethodContext = createNamedContext("reflection-method");
36
+ /**
37
+ * The reflection parameter context used in template rendering.
38
+ */
39
+ const ReflectionParameterContext = createNamedContext("reflection-parameter");
40
+
41
+ //#endregion
42
+ export { ReflectionClassContext, ReflectionPropertyContext, useReflectionClass, useReflectionProperty };
@@ -0,0 +1,16 @@
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
+ let __alloy_js_core = require("@alloy-js/core");
3
+
4
+ //#region ../plugin-alloy/src/helpers/refkey.ts
5
+ /**
6
+ * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.
7
+ *
8
+ * @remarks
9
+ * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`
10
+ */
11
+ function refkey(...args) {
12
+ return (0, __alloy_js_core.refkey)("powerlines", ...args);
13
+ }
14
+
15
+ //#endregion
16
+ exports.refkey = refkey;
@@ -0,0 +1,15 @@
1
+ import { refkey } from "@alloy-js/core";
2
+
3
+ //#region ../plugin-alloy/src/helpers/refkey.ts
4
+ /**
5
+ * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.
6
+ *
7
+ * @remarks
8
+ * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`
9
+ */
10
+ function refkey$1(...args) {
11
+ return refkey("powerlines", ...args);
12
+ }
13
+
14
+ //#endregion
15
+ export { refkey$1 as refkey };
@@ -0,0 +1,115 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_context = require('../../core/contexts/context.cjs');
3
+ const require_single_line_comment = require('../../core/components/single-line-comment.cjs');
4
+ const require_source_file = require('../../core/components/source-file.cjs');
5
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
+ let __alloy_js_core = require("@alloy-js/core");
7
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
8
+ let __alloy_js_markdown = require("@alloy-js/markdown");
9
+
10
+ //#region ../plugin-alloy/src/markdown/components/markdown-file.tsx
11
+ /**
12
+ * A base component representing a Powerlines generated markdown source file.
13
+ *
14
+ * @param props - The properties for the source file.
15
+ * @returns The rendered source file component.
16
+ */
17
+ function MarkdownFile(props) {
18
+ const [{ children, storage }, rest] = (0, __alloy_js_core.splitProps)(props, ["children", "storage"]);
19
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_source_file.SourceFile, (0, __alloy_js_core_jsx_runtime.mergeProps)({ get header() {
20
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(MarkdownFileHeader, {});
21
+ } }, rest, {
22
+ filetype: "md",
23
+ reference: __alloy_js_markdown.Link,
24
+ storage,
25
+ get children() {
26
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
27
+ get when() {
28
+ return Boolean(children);
29
+ },
30
+ children
31
+ });
32
+ }
33
+ }));
34
+ }
35
+ /**
36
+ * Renders the header for a Powerlines Typescript source file.
37
+ *
38
+ * @param props - The properties for the source file header.
39
+ * @returns The rendered source file header.
40
+ */
41
+ function MarkdownFileHeader(props) {
42
+ const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = (0, __alloy_js_core.splitProps)(props, [
43
+ "children",
44
+ "disableEslint",
45
+ "disableBiome",
46
+ "disablePrettier"
47
+ ]);
48
+ const context = require_context.usePowerlines();
49
+ return [
50
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
51
+ get when() {
52
+ return Boolean(disableEslint);
53
+ },
54
+ get children() {
55
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_single_line_comment.SingleLineComment, {
56
+ variant: "markdown",
57
+ children: "eslint-disable"
58
+ }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
59
+ }
60
+ }),
61
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
62
+ get when() {
63
+ return Boolean(disablePrettier);
64
+ },
65
+ get children() {
66
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_single_line_comment.SingleLineComment, {
67
+ variant: "markdown",
68
+ children: "prettier-ignore"
69
+ }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
70
+ }
71
+ }),
72
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
73
+ get when() {
74
+ return Boolean(disableBiome);
75
+ },
76
+ get children() {
77
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_single_line_comment.SingleLineComment, {
78
+ variant: "markdown",
79
+ children: "biome-ignore lint: disable"
80
+ }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
81
+ }
82
+ }),
83
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
84
+ get when() {
85
+ return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
86
+ },
87
+ get children() {
88
+ return (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
89
+ }
90
+ }),
91
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
92
+ get when() {
93
+ return Boolean(children);
94
+ },
95
+ get children() {
96
+ return [children, (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
97
+ }
98
+ }),
99
+ (0, __alloy_js_core_jsx_runtime.createComponent)(require_single_line_comment.SingleLineComment, {
100
+ variant: "markdown",
101
+ get children() {
102
+ return __alloy_js_core.code`Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config.framework) || "Powerlines"}`;
103
+ }
104
+ }),
105
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
106
+ (0, __alloy_js_core_jsx_runtime.createComponent)(require_single_line_comment.SingleLineComment, {
107
+ variant: "markdown",
108
+ children: __alloy_js_core.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
109
+ }),
110
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
111
+ ];
112
+ }
113
+
114
+ //#endregion
115
+ exports.MarkdownFile = MarkdownFile;
@@ -0,0 +1,114 @@
1
+ import { usePowerlines } from "../../core/contexts/context.mjs";
2
+ import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
3
+ import { SourceFile } from "../../core/components/source-file.mjs";
4
+ import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { Show, code, splitProps } from "@alloy-js/core";
6
+ import { titleCase } from "@stryke/string-format/title-case";
7
+ import { Link } from "@alloy-js/markdown";
8
+
9
+ //#region ../plugin-alloy/src/markdown/components/markdown-file.tsx
10
+ /**
11
+ * A base component representing a Powerlines generated markdown source file.
12
+ *
13
+ * @param props - The properties for the source file.
14
+ * @returns The rendered source file component.
15
+ */
16
+ function MarkdownFile(props) {
17
+ const [{ children, storage }, rest] = splitProps(props, ["children", "storage"]);
18
+ return createComponent(SourceFile, mergeProps({ get header() {
19
+ return createComponent(MarkdownFileHeader, {});
20
+ } }, rest, {
21
+ filetype: "md",
22
+ reference: Link,
23
+ storage,
24
+ get children() {
25
+ return createComponent(Show, {
26
+ get when() {
27
+ return Boolean(children);
28
+ },
29
+ children
30
+ });
31
+ }
32
+ }));
33
+ }
34
+ /**
35
+ * Renders the header for a Powerlines Typescript source file.
36
+ *
37
+ * @param props - The properties for the source file header.
38
+ * @returns The rendered source file header.
39
+ */
40
+ function MarkdownFileHeader(props) {
41
+ const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = splitProps(props, [
42
+ "children",
43
+ "disableEslint",
44
+ "disableBiome",
45
+ "disablePrettier"
46
+ ]);
47
+ const context = usePowerlines();
48
+ return [
49
+ createComponent(Show, {
50
+ get when() {
51
+ return Boolean(disableEslint);
52
+ },
53
+ get children() {
54
+ return [createComponent(SingleLineComment, {
55
+ variant: "markdown",
56
+ children: "eslint-disable"
57
+ }), createIntrinsic("hbr", {})];
58
+ }
59
+ }),
60
+ createComponent(Show, {
61
+ get when() {
62
+ return Boolean(disablePrettier);
63
+ },
64
+ get children() {
65
+ return [createComponent(SingleLineComment, {
66
+ variant: "markdown",
67
+ children: "prettier-ignore"
68
+ }), createIntrinsic("hbr", {})];
69
+ }
70
+ }),
71
+ createComponent(Show, {
72
+ get when() {
73
+ return Boolean(disableBiome);
74
+ },
75
+ get children() {
76
+ return [createComponent(SingleLineComment, {
77
+ variant: "markdown",
78
+ children: "biome-ignore lint: disable"
79
+ }), createIntrinsic("hbr", {})];
80
+ }
81
+ }),
82
+ createComponent(Show, {
83
+ get when() {
84
+ return Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome);
85
+ },
86
+ get children() {
87
+ return createIntrinsic("hbr", {});
88
+ }
89
+ }),
90
+ createComponent(Show, {
91
+ get when() {
92
+ return Boolean(children);
93
+ },
94
+ get children() {
95
+ return [children, createIntrinsic("hbr", {})];
96
+ }
97
+ }),
98
+ createComponent(SingleLineComment, {
99
+ variant: "markdown",
100
+ get children() {
101
+ return code`Generated by ${titleCase(context?.config.framework) || "Powerlines"}`;
102
+ }
103
+ }),
104
+ createIntrinsic("hbr", {}),
105
+ createComponent(SingleLineComment, {
106
+ variant: "markdown",
107
+ children: code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
108
+ }),
109
+ createIntrinsic("hbr", {})
110
+ ];
111
+ }
112
+
113
+ //#endregion
114
+ export { MarkdownFile };