@powerlines/plugin-date 0.12.260 → 0.12.261

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 (184) hide show
  1. package/dist/components/date-fns.cjs +3 -2
  2. package/dist/components/date-fns.mjs +1 -1
  3. package/dist/components/dayjs.cjs +3 -2
  4. package/dist/components/dayjs.mjs +1 -1
  5. package/dist/components/luxon.cjs +3 -2
  6. package/dist/components/luxon.mjs +1 -1
  7. package/dist/components/moment.cjs +3 -2
  8. package/dist/components/moment.mjs +1 -1
  9. package/dist/index.cjs +3 -2
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.mts +1 -1
  12. package/dist/index.mjs +2 -2
  13. package/dist/types/plugin.d.cts +1 -1
  14. package/dist/types/plugin.d.mts +1 -1
  15. package/package.json +4 -4
  16. package/dist/deepkit/schemas/reflection.cjs +0 -3998
  17. package/dist/deepkit/schemas/reflection.d.cts +0 -1560
  18. package/dist/deepkit/schemas/reflection.d.mts +0 -1560
  19. package/dist/deepkit/schemas/reflection.mjs +0 -3996
  20. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  21. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  22. package/dist/deepkit/src/capnp.cjs +0 -913
  23. package/dist/deepkit/src/capnp.mjs +0 -911
  24. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  25. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  26. package/dist/deepkit/src/reflect-type.cjs +0 -22
  27. package/dist/deepkit/src/reflect-type.mjs +0 -20
  28. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  29. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  30. package/dist/deepkit/src/transformer.cjs +0 -52
  31. package/dist/deepkit/src/transformer.mjs +0 -49
  32. package/dist/deepkit/src/transpile.cjs +0 -29
  33. package/dist/deepkit/src/transpile.mjs +0 -27
  34. package/dist/deepkit/src/types.d.cts +0 -10
  35. package/dist/deepkit/src/types.d.mts +0 -10
  36. package/dist/deepkit/src/utilities.cjs +0 -67
  37. package/dist/deepkit/src/utilities.mjs +0 -66
  38. package/dist/plugin-alloy/src/core/components/output.cjs +0 -36
  39. package/dist/plugin-alloy/src/core/components/output.mjs +0 -35
  40. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -20
  41. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -19
  42. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -60
  43. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -58
  44. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -38
  45. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -34
  46. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  47. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  48. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  49. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  50. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  51. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  52. package/dist/plugin-alloy/src/index.cjs +0 -102
  53. package/dist/plugin-alloy/src/index.mjs +0 -100
  54. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -89
  55. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -88
  56. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -33
  57. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -32
  58. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -18
  59. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  60. package/dist/plugin-alloy/src/types/components.d.mts +0 -3
  61. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  62. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
  63. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
  64. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -52
  65. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -51
  66. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -78
  67. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -76
  68. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -364
  69. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -355
  70. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -157
  71. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -154
  72. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -57
  73. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -56
  74. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -94
  75. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -93
  76. package/dist/plugin-automd/src/index.cjs +0 -101
  77. package/dist/plugin-automd/src/index.mjs +0 -98
  78. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  79. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  80. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  81. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  82. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  83. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  84. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  85. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  86. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  87. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  88. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  89. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  90. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  91. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  92. package/dist/plugin-babel/src/helpers/options.cjs +0 -49
  93. package/dist/plugin-babel/src/helpers/options.mjs +0 -46
  94. package/dist/plugin-babel/src/index.cjs +0 -85
  95. package/dist/plugin-babel/src/index.mjs +0 -83
  96. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  97. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  98. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  99. package/dist/plugin-env/src/babel/index.cjs +0 -1
  100. package/dist/plugin-env/src/babel/index.mjs +0 -3
  101. package/dist/plugin-env/src/babel/plugin.cjs +0 -70
  102. package/dist/plugin-env/src/babel/plugin.mjs +0 -69
  103. package/dist/plugin-env/src/components/docs.cjs +0 -60
  104. package/dist/plugin-env/src/components/docs.mjs +0 -59
  105. package/dist/plugin-env/src/components/env.cjs +0 -497
  106. package/dist/plugin-env/src/components/env.mjs +0 -494
  107. package/dist/plugin-env/src/components/index.cjs +0 -2
  108. package/dist/plugin-env/src/components/index.mjs +0 -4
  109. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  110. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  111. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  112. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  113. package/dist/plugin-env/src/helpers/docs-helper.cjs +0 -16
  114. package/dist/plugin-env/src/helpers/docs-helper.mjs +0 -15
  115. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  116. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  117. package/dist/plugin-env/src/helpers/load.cjs +0 -84
  118. package/dist/plugin-env/src/helpers/load.mjs +0 -81
  119. package/dist/plugin-env/src/helpers/persistence.cjs +0 -201
  120. package/dist/plugin-env/src/helpers/persistence.mjs +0 -190
  121. package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
  122. package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
  123. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  124. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  125. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  126. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  127. package/dist/plugin-env/src/index.cjs +0 -174
  128. package/dist/plugin-env/src/index.mjs +0 -172
  129. package/dist/plugin-env/src/types/plugin.d.cts +0 -148
  130. package/dist/plugin-env/src/types/plugin.d.mts +0 -150
  131. package/dist/plugin-env/src/types/runtime.d.cts +0 -789
  132. package/dist/plugin-env/src/types/runtime.d.mts +0 -789
  133. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  134. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  135. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -93
  136. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -91
  137. package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
  138. package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
  139. package/dist/powerlines/src/lib/entry.cjs +0 -11
  140. package/dist/powerlines/src/lib/entry.mjs +0 -13
  141. package/dist/powerlines/src/lib/logger.cjs +0 -41
  142. package/dist/powerlines/src/lib/logger.mjs +0 -39
  143. package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -3
  144. package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -5
  145. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -66
  146. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -65
  147. package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -46
  148. package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -45
  149. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -42
  150. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -40
  151. package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -22
  152. package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -21
  153. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -50
  154. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -49
  155. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -5
  156. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -5
  157. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  158. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  159. package/dist/powerlines/src/types/api.d.cts +0 -104
  160. package/dist/powerlines/src/types/api.d.mts +0 -104
  161. package/dist/powerlines/src/types/babel.d.cts +0 -22
  162. package/dist/powerlines/src/types/babel.d.mts +0 -22
  163. package/dist/powerlines/src/types/build.cjs +0 -21
  164. package/dist/powerlines/src/types/build.d.cts +0 -185
  165. package/dist/powerlines/src/types/build.d.mts +0 -185
  166. package/dist/powerlines/src/types/build.mjs +0 -21
  167. package/dist/powerlines/src/types/commands.d.cts +0 -8
  168. package/dist/powerlines/src/types/commands.d.mts +0 -9
  169. package/dist/powerlines/src/types/config.d.cts +0 -435
  170. package/dist/powerlines/src/types/config.d.mts +0 -436
  171. package/dist/powerlines/src/types/context.d.cts +0 -514
  172. package/dist/powerlines/src/types/context.d.mts +0 -514
  173. package/dist/powerlines/src/types/fs.d.cts +0 -486
  174. package/dist/powerlines/src/types/fs.d.mts +0 -486
  175. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  176. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  177. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  178. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  179. package/dist/powerlines/src/types/resolved.d.cts +0 -94
  180. package/dist/powerlines/src/types/resolved.d.mts +0 -94
  181. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  182. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  183. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  184. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
@@ -1,60 +0,0 @@
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 = require("@alloy-js/core");
5
- let defu = require("defu");
6
- defu = require_rolldown_runtime.__toESM(defu);
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
- let __stryke_path_append = require("@stryke/path/append");
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.useMetaSafe();
28
- const parentDirectory = (0, __alloy_js_core.useContext)(__alloy_js_core.SourceDirectoryContext);
29
- const sourceFile = {
30
- path: (0, __stryke_path_append.appendPath)(path, parentDirectory.path),
31
- filetype,
32
- reference
33
- };
34
- parentDirectory?.addContent(sourceFile);
35
- const printOptions = (0, __alloy_js_core.useFormatOptions)({
36
- printWidth: props.printWidth,
37
- tabWidth: props.tabWidth,
38
- useTabs: props.useTabs,
39
- insertFinalNewLine: props.insertFinalNewLine
40
- });
41
- const nodeContext = (0, __alloy_js_core.getContext)();
42
- nodeContext.meta = (0, defu.default)({
43
- sourceFile,
44
- printOptions
45
- }, meta ?? {});
46
- if (metadata) metadata[sourceFile.path] = {
47
- storage,
48
- ...meta ?? {}
49
- };
50
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.SourceFileContext.Provider, {
51
- value: sourceFile,
52
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
53
- when: header !== void 0,
54
- children: [header, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
55
- }), children]
56
- });
57
- }
58
-
59
- //#endregion
60
- exports.SourceFile = SourceFile;
@@ -1,58 +0,0 @@
1
- import { useMetaSafe } from "../contexts/context.mjs";
2
- import "../contexts/index.mjs";
3
- import { Show, SourceDirectoryContext, SourceFileContext, getContext, splitProps, useContext, useFormatOptions } from "@alloy-js/core";
4
- import defu from "defu";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import { appendPath } from "@stryke/path/append";
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 = useMetaSafe();
26
- const parentDirectory = useContext(SourceDirectoryContext);
27
- const sourceFile = {
28
- path: appendPath(path, parentDirectory.path),
29
- filetype,
30
- reference
31
- };
32
- parentDirectory?.addContent(sourceFile);
33
- const printOptions = useFormatOptions({
34
- printWidth: props.printWidth,
35
- tabWidth: props.tabWidth,
36
- useTabs: props.useTabs,
37
- insertFinalNewLine: props.insertFinalNewLine
38
- });
39
- const nodeContext = getContext();
40
- nodeContext.meta = defu({
41
- sourceFile,
42
- printOptions
43
- }, meta ?? {});
44
- if (metadata) metadata[sourceFile.path] = {
45
- storage,
46
- ...meta ?? {}
47
- };
48
- return /* @__PURE__ */ jsxs(SourceFileContext.Provider, {
49
- value: sourceFile,
50
- children: [/* @__PURE__ */ jsxs(Show, {
51
- when: header !== void 0,
52
- children: [header, /* @__PURE__ */ jsx("hbr", {})]
53
- }), children]
54
- });
55
- }
56
-
57
- //#endregion
58
- export { SourceFile };
@@ -1,38 +0,0 @@
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/context.ts
5
- /**
6
- * The Powerlines context used in template rendering.
7
- */
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()?.value;
24
- }
25
- /**
26
- * Hook to safely access the render context's metadata.
27
- *
28
- * @returns The Powerlines context or undefined if not set.
29
- */
30
- function useMetaSafe() {
31
- return usePowerlinesContext()?.meta;
32
- }
33
-
34
- //#endregion
35
- exports.PowerlinesContext = PowerlinesContext;
36
- exports.useMetaSafe = useMetaSafe;
37
- exports.usePowerlinesContext = usePowerlinesContext;
38
- exports.usePowerlinesSafe = usePowerlinesSafe;
@@ -1,34 +0,0 @@
1
- import { createNamedContext, useContext } from "@alloy-js/core";
2
-
3
- //#region ../plugin-alloy/src/core/contexts/context.ts
4
- /**
5
- * The Powerlines context used in template rendering.
6
- */
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()?.value;
23
- }
24
- /**
25
- * Hook to safely access the render context's metadata.
26
- *
27
- * @returns The Powerlines context or undefined if not set.
28
- */
29
- function useMetaSafe() {
30
- return usePowerlinesContext()?.meta;
31
- }
32
-
33
- //#endregion
34
- export { PowerlinesContext, useMetaSafe, usePowerlinesContext, usePowerlinesSafe };
@@ -1,2 +0,0 @@
1
- const require_context = require('./context.cjs');
2
- const require_reflection = require('./reflection.cjs');
@@ -1,4 +0,0 @@
1
- import { PowerlinesContext, useMetaSafe, usePowerlinesContext, usePowerlinesSafe } from "./context.mjs";
2
- import { ReflectionClassContext, ReflectionPropertyContext, useReflectionClass, useReflectionProperty } from "./reflection.mjs";
3
-
4
- export { };
@@ -1,46 +0,0 @@
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;
@@ -1,42 +0,0 @@
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 };
@@ -1,16 +0,0 @@
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;
@@ -1,15 +0,0 @@
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 };
@@ -1,102 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('../../plugin-babel/src/index.cjs');
3
- const require_output = require('./core/components/output.cjs');
4
- let __alloy_js_babel_preset = require("@alloy-js/babel-preset");
5
- __alloy_js_babel_preset = require_rolldown_runtime.__toESM(__alloy_js_babel_preset);
6
- let __alloy_js_core = require("@alloy-js/core");
7
- let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
8
- let __stryke_json_storm_json = require("@stryke/json/storm-json");
9
- let react_jsx_runtime = require("react/jsx-runtime");
10
-
11
- //#region ../plugin-alloy/src/index.tsx
12
- /**
13
- * Alloy-js plugin for Powerlines.
14
- *
15
- * @param options - The Alloy-js plugin user configuration options.
16
- * @returns A Powerlines plugin that integrates Alloy-js transformations.
17
- */
18
- const plugin = (options = {}) => {
19
- return [
20
- require_index.default(),
21
- {
22
- name: "alloy:config",
23
- config() {
24
- this.debug("Updating configuration options to support Alloy-js builds.");
25
- return {
26
- alloy: {
27
- typescript: true,
28
- ...options
29
- },
30
- transform: { babel: { presets: [[
31
- (0, __alloy_js_babel_preset.default)({ addSourceInfo: this.config.mode === "development" }),
32
- {},
33
- (_, id) => /^(?:m|c)?tsx?$/.test((0, __stryke_path_file_path_fns.findFileExtensionSafe)(id, { fullExtension: true }))
34
- ]] } },
35
- build: {
36
- inputOptions: { transform: { jsx: "preserve" } },
37
- external: [
38
- "@alloy-js/core",
39
- "@alloy-js/typescript",
40
- "@alloy-js/json",
41
- "@alloy-js/markdown"
42
- ]
43
- }
44
- };
45
- },
46
- async configResolved() {
47
- this.debug("Ensuring TypeScript configuration is set up for Alloy-js.");
48
- if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@alloy-js/core") {
49
- this.tsconfig.tsconfigJson.compilerOptions ??= {};
50
- if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
51
- if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
52
- await this.fs.write(this.tsconfig.tsconfigFilePath, __stryke_json_storm_json.StormJSON.stringify(this.tsconfig.tsconfigJson));
53
- }
54
- }
55
- },
56
- {
57
- name: "alloy:create-render",
58
- configResolved: {
59
- order: "pre",
60
- async handler() {
61
- this.debug("Attaching the `render` method to the context object.");
62
- this.render = async (children) => {
63
- const meta = {};
64
- await (0, __alloy_js_core.traverseOutput)(await (0, __alloy_js_core.renderAsync)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_output.Output, {
65
- context: this,
66
- meta,
67
- basePath: this.workspaceConfig.workspaceRoot,
68
- children
69
- })), {
70
- visitDirectory: (directory) => {
71
- if (this.fs.existsSync(directory.path)) return;
72
- this.fs.mkdirSync(directory.path);
73
- },
74
- visitFile: (file) => {
75
- if ("contents" in file) {
76
- const metadata = meta[file.path] ?? {};
77
- if (metadata.kind === "builtin") {
78
- if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
79
- this.emitBuiltinSync(file.contents, metadata.id, {
80
- skipFormat: metadata.skipFormat,
81
- storage: metadata.storage,
82
- extension: (0, __stryke_path_file_path_fns.findFileExtension)(file.path)
83
- });
84
- } else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
85
- skipFormat: metadata.skipFormat,
86
- storage: metadata.storage,
87
- ...metadata.typeDefinition ?? {}
88
- });
89
- else this.emitSync(file.contents, file.path, metadata);
90
- } else this.fs.copySync(file.sourcePath, file.path);
91
- }
92
- });
93
- };
94
- }
95
- }
96
- }
97
- ];
98
- };
99
- var src_default$1 = plugin;
100
-
101
- //#endregion
102
- exports.default = src_default$1;
@@ -1,100 +0,0 @@
1
- import src_default from "../../plugin-babel/src/index.mjs";
2
- import { Output as Output$1 } from "./core/components/output.mjs";
3
- import alloyPreset from "@alloy-js/babel-preset";
4
- import { renderAsync, traverseOutput } from "@alloy-js/core";
5
- import { findFileExtension, findFileExtensionSafe } from "@stryke/path/file-path-fns";
6
- import { StormJSON } from "@stryke/json/storm-json";
7
- import { jsx } from "react/jsx-runtime";
8
-
9
- //#region ../plugin-alloy/src/index.tsx
10
- /**
11
- * Alloy-js plugin for Powerlines.
12
- *
13
- * @param options - The Alloy-js plugin user configuration options.
14
- * @returns A Powerlines plugin that integrates Alloy-js transformations.
15
- */
16
- const plugin = (options = {}) => {
17
- return [
18
- src_default(),
19
- {
20
- name: "alloy:config",
21
- config() {
22
- this.debug("Updating configuration options to support Alloy-js builds.");
23
- return {
24
- alloy: {
25
- typescript: true,
26
- ...options
27
- },
28
- transform: { babel: { presets: [[
29
- alloyPreset({ addSourceInfo: this.config.mode === "development" }),
30
- {},
31
- (_, id) => /^(?:m|c)?tsx?$/.test(findFileExtensionSafe(id, { fullExtension: true }))
32
- ]] } },
33
- build: {
34
- inputOptions: { transform: { jsx: "preserve" } },
35
- external: [
36
- "@alloy-js/core",
37
- "@alloy-js/typescript",
38
- "@alloy-js/json",
39
- "@alloy-js/markdown"
40
- ]
41
- }
42
- };
43
- },
44
- async configResolved() {
45
- this.debug("Ensuring TypeScript configuration is set up for Alloy-js.");
46
- if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@alloy-js/core") {
47
- this.tsconfig.tsconfigJson.compilerOptions ??= {};
48
- if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
49
- if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
50
- await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
51
- }
52
- }
53
- },
54
- {
55
- name: "alloy:create-render",
56
- configResolved: {
57
- order: "pre",
58
- async handler() {
59
- this.debug("Attaching the `render` method to the context object.");
60
- this.render = async (children) => {
61
- const meta = {};
62
- await traverseOutput(await renderAsync(/* @__PURE__ */ jsx(Output$1, {
63
- context: this,
64
- meta,
65
- basePath: this.workspaceConfig.workspaceRoot,
66
- children
67
- })), {
68
- visitDirectory: (directory) => {
69
- if (this.fs.existsSync(directory.path)) return;
70
- this.fs.mkdirSync(directory.path);
71
- },
72
- visitFile: (file) => {
73
- if ("contents" in file) {
74
- const metadata = meta[file.path] ?? {};
75
- if (metadata.kind === "builtin") {
76
- if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
77
- this.emitBuiltinSync(file.contents, metadata.id, {
78
- skipFormat: metadata.skipFormat,
79
- storage: metadata.storage,
80
- extension: findFileExtension(file.path)
81
- });
82
- } else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
83
- skipFormat: metadata.skipFormat,
84
- storage: metadata.storage,
85
- ...metadata.typeDefinition ?? {}
86
- });
87
- else this.emitSync(file.contents, file.path, metadata);
88
- } else this.fs.copySync(file.sourcePath, file.path);
89
- }
90
- });
91
- };
92
- }
93
- }
94
- }
95
- ];
96
- };
97
- var src_default$1 = plugin;
98
-
99
- //#endregion
100
- export { src_default$1 as default };
@@ -1,89 +0,0 @@
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 = require("@alloy-js/core");
6
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
7
- let react_jsx_runtime = require("react/jsx-runtime");
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 /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_source_file.SourceFile, {
20
- header: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownFileHeader, {}),
21
- ...rest,
22
- filetype: "md",
23
- reference: __alloy_js_markdown.Link,
24
- storage,
25
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
26
- when: Boolean(children),
27
- children
28
- })
29
- });
30
- }
31
- /**
32
- * Renders the header for a Powerlines Typescript source file.
33
- *
34
- * @param props - The properties for the source file header.
35
- * @returns The rendered source file header.
36
- */
37
- function MarkdownFileHeader(props) {
38
- const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = (0, __alloy_js_core.splitProps)(props, [
39
- "children",
40
- "disableEslint",
41
- "disableBiome",
42
- "disablePrettier"
43
- ]);
44
- const context = require_context.usePowerlinesSafe();
45
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
46
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
47
- when: Boolean(disableEslint),
48
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
49
- variant: "markdown",
50
- children: "eslint-disable"
51
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
52
- }),
53
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
54
- when: Boolean(disablePrettier),
55
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
56
- variant: "markdown",
57
- children: "prettier-ignore"
58
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
59
- }),
60
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
61
- when: Boolean(disableBiome),
62
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
63
- variant: "markdown",
64
- children: "biome-ignore lint: disable"
65
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
66
- }),
67
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
68
- when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
69
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
70
- }),
71
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
72
- when: Boolean(children),
73
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})] })
74
- }),
75
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
76
- variant: "markdown",
77
- children: `Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`
78
- }),
79
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
80
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
81
- variant: "markdown",
82
- children: __alloy_js_core.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
83
- }),
84
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
85
- ] });
86
- }
87
-
88
- //#endregion
89
- exports.MarkdownFile = MarkdownFile;