@powerlines/plugin-nodejs 0.1.0 → 0.1.2

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 (200) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/components/env.cjs +188 -2
  3. package/dist/components/env.d.cts +9 -2
  4. package/dist/components/env.d.mts +9 -2
  5. package/dist/components/env.mjs +185 -1
  6. package/dist/components/index.cjs +2 -3
  7. package/dist/components/index.d.cts +1 -3
  8. package/dist/components/index.d.mts +1 -3
  9. package/dist/components/index.mjs +1 -2
  10. package/dist/deepkit/schemas/reflection.cjs +3940 -0
  11. package/dist/{plugin-D7kBf19k.d.cts → deepkit/schemas/reflection.d.cts} +1 -1078
  12. package/dist/{plugin-JL1BtFku.d.mts → deepkit/schemas/reflection.d.mts} +59 -1136
  13. package/dist/deepkit/schemas/reflection.mjs +3938 -0
  14. package/dist/deepkit/schemas/reflection2.cjs +4112 -0
  15. package/dist/deepkit/schemas/reflection2.mjs +4110 -0
  16. package/dist/deepkit/src/capnp.cjs +913 -0
  17. package/dist/deepkit/src/capnp.mjs +911 -0
  18. package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
  19. package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
  20. package/dist/deepkit/src/reflect-type.cjs +22 -0
  21. package/dist/deepkit/src/reflect-type.mjs +20 -0
  22. package/dist/deepkit/src/resolve-reflections.cjs +16 -0
  23. package/dist/deepkit/src/resolve-reflections.mjs +15 -0
  24. package/dist/deepkit/src/transformer.cjs +52 -0
  25. package/dist/deepkit/src/transformer.mjs +49 -0
  26. package/dist/deepkit/src/transpile.cjs +29 -0
  27. package/dist/deepkit/src/transpile.mjs +27 -0
  28. package/dist/deepkit/src/types.d.cts +10 -0
  29. package/dist/deepkit/src/types.d.mts +10 -0
  30. package/dist/deepkit/src/utilities.cjs +66 -0
  31. package/dist/deepkit/src/utilities.mjs +65 -0
  32. package/dist/index.cjs +14 -813
  33. package/dist/index.d.cts +5 -5
  34. package/dist/index.d.mts +5 -5
  35. package/dist/index.mjs +11 -803
  36. package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
  37. package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
  38. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
  39. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
  40. package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
  41. package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
  42. package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
  43. package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
  44. package/dist/plugin-alloy/src/core/contexts/context.cjs +60 -0
  45. package/dist/plugin-alloy/src/core/contexts/context.mjs +54 -0
  46. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  47. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  48. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
  49. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
  50. package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
  51. package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
  52. package/dist/plugin-alloy/src/index.cjs +99 -0
  53. package/dist/plugin-alloy/src/index.mjs +97 -0
  54. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +7 -0
  55. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +9 -0
  56. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +5 -0
  57. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +7 -0
  58. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +17 -0
  59. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
  60. package/dist/plugin-alloy/src/types/components.d.cts +23 -0
  61. package/dist/plugin-alloy/src/types/components.d.mts +24 -0
  62. package/dist/plugin-alloy/src/types/index.d.cts +2 -0
  63. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  64. package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
  65. package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
  66. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
  67. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +26 -0
  68. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
  69. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
  70. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
  71. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
  72. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
  73. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +28 -0
  74. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
  75. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
  76. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
  77. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +15 -0
  78. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
  79. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
  80. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
  81. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +4 -0
  82. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +4 -0
  83. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
  84. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
  85. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
  86. package/dist/plugin-automd/src/index.cjs +101 -0
  87. package/dist/plugin-automd/src/index.mjs +98 -0
  88. package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
  89. package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
  90. package/dist/plugin-automd/src/types/toc.d.cts +33 -0
  91. package/dist/plugin-automd/src/types/toc.d.mts +33 -0
  92. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
  93. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
  94. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
  95. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
  96. package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
  97. package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
  98. package/dist/plugin-babel/src/helpers/index.cjs +5 -0
  99. package/dist/plugin-babel/src/helpers/index.mjs +7 -0
  100. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
  101. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
  102. package/dist/plugin-babel/src/helpers/options.cjs +50 -0
  103. package/dist/plugin-babel/src/helpers/options.mjs +47 -0
  104. package/dist/plugin-babel/src/index.cjs +91 -0
  105. package/dist/plugin-babel/src/index.mjs +89 -0
  106. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  107. package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
  108. package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
  109. package/dist/plugin-env/src/babel/index.cjs +1 -0
  110. package/dist/plugin-env/src/babel/index.mjs +3 -0
  111. package/dist/plugin-env/src/babel/plugin.cjs +121 -0
  112. package/dist/plugin-env/src/babel/plugin.mjs +119 -0
  113. package/dist/plugin-env/src/components/docs.cjs +9 -0
  114. package/dist/plugin-env/src/components/docs.mjs +11 -0
  115. package/dist/plugin-env/src/components/env.cjs +575 -0
  116. package/dist/plugin-env/src/components/env.d.cts +11 -0
  117. package/dist/plugin-env/src/components/env.d.mts +11 -0
  118. package/dist/plugin-env/src/components/env.mjs +572 -0
  119. package/dist/plugin-env/src/components/index.cjs +2 -0
  120. package/dist/plugin-env/src/components/index.mjs +4 -0
  121. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
  122. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
  123. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
  124. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
  125. package/dist/plugin-env/src/helpers/index.cjs +6 -0
  126. package/dist/plugin-env/src/helpers/index.mjs +8 -0
  127. package/dist/plugin-env/src/helpers/load.cjs +83 -0
  128. package/dist/plugin-env/src/helpers/load.mjs +80 -0
  129. package/dist/plugin-env/src/helpers/persistence.cjs +199 -0
  130. package/dist/plugin-env/src/helpers/persistence.mjs +188 -0
  131. package/dist/plugin-env/src/helpers/reflect.cjs +111 -0
  132. package/dist/plugin-env/src/helpers/reflect.mjs +103 -0
  133. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
  134. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
  135. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
  136. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
  137. package/dist/plugin-env/src/index.cjs +175 -0
  138. package/dist/plugin-env/src/index.mjs +173 -0
  139. package/dist/plugin-env/src/types/plugin.d.cts +152 -0
  140. package/dist/plugin-env/src/types/plugin.d.mts +153 -0
  141. package/dist/plugin-env/src/types/runtime.d.cts +792 -0
  142. package/dist/plugin-env/src/types/runtime.d.mts +792 -0
  143. package/dist/powerlines/src/lib/build/esbuild.cjs +102 -0
  144. package/dist/powerlines/src/lib/build/esbuild.mjs +100 -0
  145. package/dist/powerlines/src/lib/entry.cjs +12 -0
  146. package/dist/powerlines/src/lib/entry.mjs +14 -0
  147. package/dist/powerlines/src/lib/logger.cjs +41 -0
  148. package/dist/powerlines/src/lib/logger.mjs +39 -0
  149. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +38 -0
  150. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +35 -0
  151. package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -0
  152. package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -0
  153. package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -0
  154. package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -0
  155. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  156. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
  157. package/dist/powerlines/src/types/babel.d.cts +22 -0
  158. package/dist/powerlines/src/types/babel.d.mts +22 -0
  159. package/dist/powerlines/src/types/build.d.cts +145 -0
  160. package/dist/powerlines/src/types/build.d.mts +145 -0
  161. package/dist/powerlines/src/types/commands.d.cts +8 -0
  162. package/dist/powerlines/src/types/commands.d.mts +9 -0
  163. package/dist/powerlines/src/types/config.d.cts +387 -0
  164. package/dist/powerlines/src/types/config.d.mts +388 -0
  165. package/dist/powerlines/src/types/context.d.cts +414 -0
  166. package/dist/powerlines/src/types/context.d.mts +416 -0
  167. package/dist/powerlines/src/types/fs.d.cts +486 -0
  168. package/dist/powerlines/src/types/fs.d.mts +486 -0
  169. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  170. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  171. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  172. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  173. package/dist/powerlines/src/types/resolved.d.mts +82 -0
  174. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  175. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  176. package/dist/types/index.cjs +0 -2
  177. package/dist/types/index.d.cts +1 -3
  178. package/dist/types/index.d.mts +1 -3
  179. package/dist/types/index.mjs +0 -3
  180. package/dist/types/plugin.cjs +0 -1
  181. package/dist/types/plugin.d.cts +22 -2
  182. package/dist/types/plugin.d.mts +22 -2
  183. package/dist/types/plugin.mjs +0 -2
  184. package/package.json +6 -6
  185. package/dist/components-BWLXb7a2.cjs +0 -0
  186. package/dist/components-CXZYcH4q.d.mts +0 -1816
  187. package/dist/components-kh0CpIG2.mjs +0 -1
  188. package/dist/env-CAhIy_H3.cjs +0 -11713
  189. package/dist/env-CUyFiniR.d.cts +0 -107
  190. package/dist/env-IF4XhMjG.mjs +0 -11570
  191. package/dist/env-sRb-Y8mJ.d.mts +0 -89
  192. package/dist/index-CUbWeWHc.d.mts +0 -1
  193. package/dist/index-D6CnpA_r.d.cts +0 -1
  194. package/dist/index-DL0uimUT.d.mts +0 -1
  195. package/dist/index-DWPDThxu.d.cts +0 -1
  196. package/dist/plugin-ifZVa20V.mjs +0 -1
  197. package/dist/plugin-pBKbb5K9.cjs +0 -0
  198. package/dist/resolved-zsx09G03.d.cts +0 -1795
  199. package/dist/types-U3zd8PTP.mjs +0 -1
  200. package/dist/types-o3zWarRp.cjs +0 -0
@@ -0,0 +1,97 @@
1
+ import { Output as Output$1 } from "./core/components/output.mjs";
2
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
3
+ import { renderAsync, traverseOutput } from "@alloy-js/core";
4
+ import alloy from "@alloy-js/rollup-plugin";
5
+ import { StormJSON } from "@stryke/json/storm-json";
6
+
7
+ //#region ../plugin-alloy/src/index.tsx
8
+ /**
9
+ * Alloy-js plugin for Powerlines.
10
+ *
11
+ * @param options - The Alloy-js plugin user configuration options.
12
+ * @returns A Powerlines plugin that integrates Alloy-js transformations.
13
+ */
14
+ const plugin = (options = {}) => {
15
+ return [{
16
+ name: "alloy:config",
17
+ config() {
18
+ return {
19
+ alloy: {
20
+ typescript: true,
21
+ ...options
22
+ },
23
+ build: {
24
+ inputOptions: { transform: { jsx: {
25
+ runtime: "classic",
26
+ pragma: "Alloy.createElement",
27
+ importSource: "@alloy-js/core"
28
+ } } },
29
+ plugins: [alloy()],
30
+ external: [
31
+ "@alloy-js/core",
32
+ "@alloy-js/typescript",
33
+ "@alloy-js/json",
34
+ "@alloy-js/markdown"
35
+ ]
36
+ }
37
+ };
38
+ },
39
+ async configResolved() {
40
+ if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@alloy-js/core") {
41
+ this.tsconfig.tsconfigJson.compilerOptions ??= {};
42
+ if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
43
+ if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
44
+ await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
45
+ }
46
+ this.dependencies["@alloy-js/core"] = "^0.22.0";
47
+ if (this.config.alloy?.typescript !== false) this.dependencies["@alloy-js/typescript"] = "^0.22.0";
48
+ if (this.config.alloy?.json === true) this.dependencies["@alloy-js/json"] = "^0.22.0";
49
+ if (this.config.alloy?.markdown === true) this.dependencies["@alloy-js/markdown"] = "^0.22.0";
50
+ }
51
+ }, {
52
+ name: "alloy:update-context",
53
+ configResolved: {
54
+ order: "pre",
55
+ async handler() {
56
+ this.render = async (children) => {
57
+ const _self$ = this;
58
+ const meta = {};
59
+ await traverseOutput(await renderAsync(createComponent(Output$1, {
60
+ context: _self$,
61
+ meta,
62
+ get basePath() {
63
+ return _self$.workspaceConfig.workspaceRoot;
64
+ },
65
+ children
66
+ })), {
67
+ visitDirectory: (directory) => {
68
+ if (this.fs.existsSync(directory.path)) return;
69
+ this.fs.mkdirSync(directory.path);
70
+ },
71
+ visitFile: (file) => {
72
+ if ("contents" in file) {
73
+ const metadata = meta[file.path] ?? {};
74
+ if (metadata.kind === "builtin") {
75
+ if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
76
+ this.emitBuiltinSync(file.contents, metadata.id, file.path, {
77
+ skipFormat: metadata.skipFormat,
78
+ storage: metadata.storage
79
+ });
80
+ } else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
81
+ skipFormat: metadata.skipFormat,
82
+ storage: metadata.storage,
83
+ ...metadata.typeDefinition ?? {}
84
+ });
85
+ else this.emitSync(file.contents, file.path, metadata);
86
+ } else this.fs.copySync(file.sourcePath, file.path);
87
+ }
88
+ });
89
+ };
90
+ }
91
+ }
92
+ }];
93
+ };
94
+ var src_default = plugin;
95
+
96
+ //#endregion
97
+ export { src_default as default };
@@ -0,0 +1,7 @@
1
+ require('../../core/contexts/context.cjs');
2
+ require('../../core/components/single-line-comment.cjs');
3
+ require('../../core/components/source-file.cjs');
4
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
6
+ let __alloy_js_core = require("@alloy-js/core");
7
+ require("@alloy-js/markdown");
@@ -0,0 +1,9 @@
1
+ import "../../core/contexts/context.mjs";
2
+ import "../../core/components/single-line-comment.mjs";
3
+ import "../../core/components/source-file.mjs";
4
+ import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { titleCase } from "@stryke/string-format/title-case";
6
+ import { Show, code, splitProps } from "@alloy-js/core";
7
+ import "@alloy-js/markdown";
8
+
9
+ export { };
@@ -0,0 +1,5 @@
1
+ require('../contexts/markdown-table.cjs');
2
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
4
+ let __alloy_js_core = require("@alloy-js/core");
5
+ let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
@@ -0,0 +1,7 @@
1
+ import "../contexts/markdown-table.mjs";
2
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
3
+ import { titleCase } from "@stryke/string-format/title-case";
4
+ import { Prose, Show, code, computed, splitProps } from "@alloy-js/core";
5
+ import { isUndefined } from "@stryke/type-checks/is-undefined";
6
+
7
+ export { };
@@ -0,0 +1,17 @@
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/markdown/contexts/markdown-table.ts
5
+ /**
6
+ * The Powerlines context used in template rendering.
7
+ */
8
+ const MarkdownTableColumnContext = (0, __alloy_js_core.createNamedContext)("markdown-table-column", {});
9
+ /**
10
+ * The Powerlines context used in template rendering.
11
+ */
12
+ const MarkdownTableContext = (0, __alloy_js_core.createContext)({
13
+ columns: [],
14
+ data: []
15
+ });
16
+
17
+ //#endregion
@@ -0,0 +1,17 @@
1
+ import { createContext, createNamedContext, useContext } from "@alloy-js/core";
2
+
3
+ //#region ../plugin-alloy/src/markdown/contexts/markdown-table.ts
4
+ /**
5
+ * The Powerlines context used in template rendering.
6
+ */
7
+ const MarkdownTableColumnContext = createNamedContext("markdown-table-column", {});
8
+ /**
9
+ * The Powerlines context used in template rendering.
10
+ */
11
+ const MarkdownTableContext = createContext({
12
+ columns: [],
13
+ data: []
14
+ });
15
+
16
+ //#endregion
17
+ export { };
@@ -0,0 +1,23 @@
1
+ import { Children } from "@alloy-js/core";
2
+ import "@alloy-js/typescript";
3
+
4
+ //#region ../plugin-alloy/src/types/components.d.ts
5
+
6
+ /**
7
+ * A type that represents the props of a component that can have children.
8
+ */
9
+ interface ComponentProps {
10
+ children?: Children;
11
+ }
12
+ interface TypescriptFileImportItem {
13
+ name: string;
14
+ default?: boolean;
15
+ alias?: string;
16
+ type?: boolean;
17
+ }
18
+ type TypescriptFileImportList = Record<string, null | Array<TypescriptFileImportItem | string>>;
19
+ type TypescriptFileImports = TypescriptFileImportList & {
20
+ $builtins?: TypescriptFileImportList;
21
+ };
22
+ //#endregion
23
+ export { ComponentProps, TypescriptFileImportItem, TypescriptFileImportList, TypescriptFileImports };
@@ -0,0 +1,24 @@
1
+ import "../../../powerlines/src/types/resolved.mjs";
2
+ import { Children } from "@alloy-js/core";
3
+ import { SourceFileContext as SourceFileContext$1 } from "@alloy-js/typescript";
4
+
5
+ //#region ../plugin-alloy/src/types/components.d.ts
6
+
7
+ /**
8
+ * A type that represents the props of a component that can have children.
9
+ */
10
+ interface ComponentProps {
11
+ children?: Children;
12
+ }
13
+ interface TypescriptFileImportItem {
14
+ name: string;
15
+ default?: boolean;
16
+ alias?: string;
17
+ type?: boolean;
18
+ }
19
+ type TypescriptFileImportList = Record<string, null | Array<TypescriptFileImportItem | string>>;
20
+ type TypescriptFileImports = TypescriptFileImportList & {
21
+ $builtins?: TypescriptFileImportList;
22
+ };
23
+ //#endregion
24
+ export { ComponentProps, TypescriptFileImportItem, TypescriptFileImportList, TypescriptFileImports };
@@ -0,0 +1,2 @@
1
+ import { ComponentProps, TypescriptFileImportItem, TypescriptFileImportList, TypescriptFileImports } from "./components.cjs";
2
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.cjs";
@@ -0,0 +1,2 @@
1
+ import { ComponentProps, TypescriptFileImportItem, TypescriptFileImportList, TypescriptFileImports } from "./components.mjs";
2
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.mjs";
@@ -0,0 +1,37 @@
1
+ import { PluginContext } from "../../../powerlines/src/types/context.cjs";
2
+ import { UserConfig } from "../../../powerlines/src/types/config.cjs";
3
+ import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
4
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
5
+
6
+ //#region ../plugin-alloy/src/types/plugin.d.ts
7
+ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
8
+ /**
9
+ * If true, the Alloy framework is used to generate Typescript output files.
10
+ *
11
+ * @defaultValue true
12
+ */
13
+ typescript?: boolean;
14
+ /**
15
+ * If true, the Alloy framework is used to generate JSON output files.
16
+ *
17
+ * @defaultValue false
18
+ */
19
+ json?: boolean;
20
+ /**
21
+ * If true, the Alloy framework is used to generate Markdown output files.
22
+ *
23
+ * @defaultValue false
24
+ */
25
+ markdown?: boolean;
26
+ };
27
+ type AlloyPluginUserConfig = UserConfig & {
28
+ alloy?: AlloyPluginOptions;
29
+ };
30
+ type AlloyPluginResolvedConfig = ResolvedConfig & {
31
+ alloy: AlloyPluginOptions;
32
+ };
33
+ type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
34
+ render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
35
+ };
36
+ //#endregion
37
+ export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
@@ -0,0 +1,37 @@
1
+ import { PluginContext } from "../../../powerlines/src/types/context.mjs";
2
+ import { UserConfig } from "../../../powerlines/src/types/config.mjs";
3
+ import { ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
4
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
5
+
6
+ //#region ../plugin-alloy/src/types/plugin.d.ts
7
+ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
8
+ /**
9
+ * If true, the Alloy framework is used to generate Typescript output files.
10
+ *
11
+ * @defaultValue true
12
+ */
13
+ typescript?: boolean;
14
+ /**
15
+ * If true, the Alloy framework is used to generate JSON output files.
16
+ *
17
+ * @defaultValue false
18
+ */
19
+ json?: boolean;
20
+ /**
21
+ * If true, the Alloy framework is used to generate Markdown output files.
22
+ *
23
+ * @defaultValue false
24
+ */
25
+ markdown?: boolean;
26
+ };
27
+ type AlloyPluginUserConfig = UserConfig & {
28
+ alloy?: AlloyPluginOptions;
29
+ };
30
+ type AlloyPluginResolvedConfig = ResolvedConfig & {
31
+ alloy: AlloyPluginOptions;
32
+ };
33
+ type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
34
+ render: <TContext extends AlloyPluginContext>(this: TContext, children: Children) => Promise<void>;
35
+ };
36
+ //#endregion
37
+ export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
@@ -0,0 +1,57 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_context = require('../../core/contexts/context.cjs');
3
+ const require_tsdoc = require('./tsdoc.cjs');
4
+ const require_typescript_file = require('./typescript-file.cjs');
5
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
+ let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
7
+ let __alloy_js_core = require("@alloy-js/core");
8
+ let __stryke_path_replace = require("@stryke/path/replace");
9
+ let __stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
10
+
11
+ //#region ../plugin-alloy/src/typescript/components/builtin-file.tsx
12
+ /**
13
+ * A base component representing a Powerlines generated Typescript source file.
14
+ *
15
+ * @param props - The properties for the source file.
16
+ * @returns The rendered source file component.
17
+ */
18
+ function BuiltinFile(props) {
19
+ const [{ children, imports, id, description, tsx }, rest] = (0, __alloy_js_core.splitProps)(props, [
20
+ "children",
21
+ "imports",
22
+ "id",
23
+ "description",
24
+ "tsx"
25
+ ]);
26
+ const context = require_context.usePowerlines();
27
+ const path = (0, __alloy_js_core.computed)(() => (0, __stryke_path_replace.replacePath)(`${!(0, __stryke_type_checks_is_set.isSet)(tsx) ? id : (0, __stryke_path_replace.replaceExtension)(id)}${(0, __stryke_path_file_path_fns.hasFileExtension)(id) && !(0, __stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context.builtinsPath));
28
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)({
29
+ get header() {
30
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_file.TypescriptFileHeader, {
31
+ get header() {
32
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDocModule, {
33
+ name: id,
34
+ children: description
35
+ });
36
+ },
37
+ get children() {
38
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_file.TypescriptFileHeaderImports, { imports });
39
+ }
40
+ });
41
+ },
42
+ get meta() {
43
+ return {
44
+ kind: "builtin",
45
+ id: (0, __stryke_path_replace.replaceExtension)(id)
46
+ };
47
+ }
48
+ }, rest, {
49
+ get path() {
50
+ return path.value;
51
+ },
52
+ children
53
+ }));
54
+ }
55
+
56
+ //#endregion
57
+ exports.BuiltinFile = BuiltinFile;
@@ -0,0 +1,26 @@
1
+ import { TSDocModuleProps } from "./tsdoc.cjs";
2
+ import { TypescriptFileProps } from "./typescript-file.cjs";
3
+ import "@alloy-js/core";
4
+
5
+ //#region ../plugin-alloy/src/typescript/components/builtin-file.d.ts
6
+ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
7
+ /**
8
+ * The runtime module identifier.
9
+ *
10
+ * @remarks
11
+ * This value will be included after the \`storm:\` prefix in the import statement.
12
+ */
13
+ id: string;
14
+ /**
15
+ * The description for the builtin module.
16
+ */
17
+ description?: string;
18
+ /**
19
+ * Whether the file is a TSX file.
20
+ *
21
+ * @defaultValue false
22
+ */
23
+ tsx?: boolean;
24
+ };
25
+ //#endregion
26
+ export { BuiltinFileProps };
@@ -0,0 +1,26 @@
1
+ import { TSDocModuleProps } from "./tsdoc.mjs";
2
+ import { TypescriptFileProps } from "./typescript-file.mjs";
3
+ import "@alloy-js/core";
4
+
5
+ //#region ../plugin-alloy/src/typescript/components/builtin-file.d.ts
6
+ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
7
+ /**
8
+ * The runtime module identifier.
9
+ *
10
+ * @remarks
11
+ * This value will be included after the \`storm:\` prefix in the import statement.
12
+ */
13
+ id: string;
14
+ /**
15
+ * The description for the builtin module.
16
+ */
17
+ description?: string;
18
+ /**
19
+ * Whether the file is a TSX file.
20
+ *
21
+ * @defaultValue false
22
+ */
23
+ tsx?: boolean;
24
+ };
25
+ //#endregion
26
+ export { BuiltinFileProps };
@@ -0,0 +1,56 @@
1
+ import { usePowerlines } from "../../core/contexts/context.mjs";
2
+ import { TSDocModule } from "./tsdoc.mjs";
3
+ import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
4
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { hasFileExtension } from "@stryke/path/file-path-fns";
6
+ import { computed, splitProps } from "@alloy-js/core";
7
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
8
+ import { isSet } from "@stryke/type-checks/is-set";
9
+
10
+ //#region ../plugin-alloy/src/typescript/components/builtin-file.tsx
11
+ /**
12
+ * A base component representing a Powerlines generated Typescript source file.
13
+ *
14
+ * @param props - The properties for the source file.
15
+ * @returns The rendered source file component.
16
+ */
17
+ function BuiltinFile(props) {
18
+ const [{ children, imports, id, description, tsx }, rest] = splitProps(props, [
19
+ "children",
20
+ "imports",
21
+ "id",
22
+ "description",
23
+ "tsx"
24
+ ]);
25
+ const context = usePowerlines();
26
+ const path = computed(() => replacePath(`${!isSet(tsx) ? id : replaceExtension(id)}${hasFileExtension(id) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context.builtinsPath));
27
+ return createComponent(TypescriptFile, mergeProps({
28
+ get header() {
29
+ return createComponent(TypescriptFileHeader, {
30
+ get header() {
31
+ return createComponent(TSDocModule, {
32
+ name: id,
33
+ children: description
34
+ });
35
+ },
36
+ get children() {
37
+ return createComponent(TypescriptFileHeaderImports, { imports });
38
+ }
39
+ });
40
+ },
41
+ get meta() {
42
+ return {
43
+ kind: "builtin",
44
+ id: replaceExtension(id)
45
+ };
46
+ }
47
+ }, rest, {
48
+ get path() {
49
+ return path.value;
50
+ },
51
+ children
52
+ }));
53
+ }
54
+
55
+ //#endregion
56
+ export { BuiltinFile };
@@ -0,0 +1,126 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_tsdoc = require('./tsdoc.cjs');
3
+ const require_reflection = require('../../core/contexts/reflection.cjs');
4
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
6
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
7
+ let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
8
+ let __alloy_js_core = require("@alloy-js/core");
9
+ let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
10
+
11
+ //#region ../plugin-alloy/src/typescript/components/tsdoc-reflection.tsx
12
+ /**
13
+ * Generates a TypeScript interface property for the given reflection class.
14
+ */
15
+ function TSDocReflectionClass(props) {
16
+ const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
17
+ const reflectionClass = require_reflection.useReflectionClass();
18
+ const title = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getTitle() || (0, __stryke_string_format_title_case.titleCase)(reflectionClass.reflection.getName()));
19
+ const alias = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getAlias());
20
+ const domain = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getDomain());
21
+ const permission = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getPermission());
22
+ const readonly = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isReadonly());
23
+ const internal = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isInternal());
24
+ const ignore = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isIgnored());
25
+ const hidden = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isHidden());
26
+ if (!reflectionClass.reflection.getName()) return null;
27
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDoc, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
28
+ get heading() {
29
+ return reflectionClass.reflection.getDescription();
30
+ },
31
+ get children() {
32
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
33
+ get when() {
34
+ return (0, __stryke_type_checks_is_set_string.isSetString)(title.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(alias.value) && alias.value.length > 0 || !(0, __stryke_type_checks_is_undefined.isUndefined)(permission.value) && permission.value.length > 0 || (0, __stryke_type_checks_is_set_string.isSetString)(domain.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(readonly.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(internal.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(ignore.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(hidden.value);
35
+ },
36
+ get children() {
37
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDocAttributesTags, {
38
+ get title() {
39
+ return title.value;
40
+ },
41
+ get alias() {
42
+ return alias.value;
43
+ },
44
+ get domain() {
45
+ return domain.value;
46
+ },
47
+ get permission() {
48
+ return permission.value;
49
+ },
50
+ get readonly() {
51
+ return readonly.value;
52
+ },
53
+ get internal() {
54
+ return internal.value;
55
+ },
56
+ get ignore() {
57
+ return ignore.value;
58
+ },
59
+ get hidden() {
60
+ return hidden.value;
61
+ }
62
+ });
63
+ }
64
+ }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
65
+ get when() {
66
+ return (0, __alloy_js_core_jsx_runtime.memo)(() => !!Boolean(children))() && (0, __alloy_js_core.childrenArray)(() => children).length > 0;
67
+ },
68
+ get children() {
69
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.List, { get children() {
70
+ return (0, __alloy_js_core.childrenArray)(() => children);
71
+ } });
72
+ }
73
+ })];
74
+ }
75
+ }));
76
+ }
77
+ /**
78
+ * Generates a TypeScript interface property for the given reflection class.
79
+ */
80
+ function TSDocReflectionProperty(props) {
81
+ const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
82
+ const context = require_reflection.useReflectionProperty();
83
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDoc, (0, __alloy_js_core_jsx_runtime.mergeProps)({ get heading() {
84
+ return context.getDescription();
85
+ } }, rest, { get children() {
86
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDocAttributesTags, {
87
+ get title() {
88
+ return context.getTitle();
89
+ },
90
+ get alias() {
91
+ return context.getAlias();
92
+ },
93
+ get domain() {
94
+ return context.getDomain();
95
+ },
96
+ get permission() {
97
+ return context.getPermission();
98
+ },
99
+ get readonly() {
100
+ return context.isReadonly();
101
+ },
102
+ get internal() {
103
+ return context.isInternal();
104
+ },
105
+ get ignore() {
106
+ return context.isIgnored();
107
+ },
108
+ get hidden() {
109
+ return context.isHidden();
110
+ }
111
+ }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
112
+ get when() {
113
+ return (0, __alloy_js_core_jsx_runtime.memo)(() => !!Boolean(children))() && (0, __alloy_js_core.childrenArray)(() => children).length > 0;
114
+ },
115
+ get children() {
116
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.List, { get children() {
117
+ return (0, __alloy_js_core.childrenArray)(() => children);
118
+ } });
119
+ }
120
+ })];
121
+ } }));
122
+ }
123
+
124
+ //#endregion
125
+ exports.TSDocReflectionClass = TSDocReflectionClass;
126
+ exports.TSDocReflectionProperty = TSDocReflectionProperty;