@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,355 +0,0 @@
1
- import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
- import { stringifyDefaultValue } from "../../../../deepkit/src/utilities.mjs";
3
- import { For, List, Prose, Show, childrenArray, splitProps } from "@alloy-js/core";
4
- import { isSetString } from "@stryke/type-checks/is-set-string";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { isUndefined } from "@stryke/type-checks/is-undefined";
7
-
8
- //#region ../plugin-alloy/src/typescript/components/tsdoc.tsx
9
- /**
10
- * Generates a TypeScript interface for the given reflection class.
11
- */
12
- function TSDoc(props) {
13
- const [{ children, heading }] = splitProps(props, ["children", "heading"]);
14
- return /* @__PURE__ */ jsxs(Fragment, { children: [
15
- "/**",
16
- /* @__PURE__ */ jsxs("align", {
17
- string: " * ",
18
- children: [
19
- /* @__PURE__ */ jsx("hbr", {}),
20
- /* @__PURE__ */ jsxs(Show, {
21
- when: !isUndefined(heading),
22
- children: [
23
- heading,
24
- /* @__PURE__ */ jsx("hbr", {}),
25
- /* @__PURE__ */ jsx(Show, {
26
- when: !isUndefined(children) && childrenArray(() => children).length > 0,
27
- children: /* @__PURE__ */ jsx("hbr", {})
28
- })
29
- ]
30
- }),
31
- /* @__PURE__ */ jsx(Show, {
32
- when: !isUndefined(children) && childrenArray(() => children).length > 0,
33
- children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
34
- })
35
- ]
36
- }),
37
- /* @__PURE__ */ jsx("hbr", {}),
38
- ` */`,
39
- /* @__PURE__ */ jsx("hbr", {})
40
- ] });
41
- }
42
- /**
43
- * Create a TSDoc `@<props.tag>` tag.
44
- */
45
- function TSDocTag(props) {
46
- const [{ children, tag }] = splitProps(props, ["children", "tag"]);
47
- return /* @__PURE__ */ jsxs(Fragment, { children: [
48
- `@${tag} `,
49
- /* @__PURE__ */ jsx(Show, {
50
- when: Boolean(children),
51
- children: /* @__PURE__ */ jsx("align", {
52
- width: 2,
53
- children: /* @__PURE__ */ jsx(Prose, { children })
54
- })
55
- }),
56
- /* @__PURE__ */ jsx("hbr", {})
57
- ] });
58
- }
59
- /**
60
- * Create a TSDoc `@title` tag.
61
- */
62
- function TSDocTitle(props) {
63
- const [{ children }, rest] = splitProps(props, ["children"]);
64
- return /* @__PURE__ */ jsx(TSDocTag, {
65
- ...rest,
66
- tag: "title",
67
- children
68
- });
69
- }
70
- /**
71
- * Create a TSDoc `@domain` tag.
72
- */
73
- function TSDocDomain(props) {
74
- const [{ children }, rest] = splitProps(props, ["children"]);
75
- return /* @__PURE__ */ jsx(TSDocTag, {
76
- ...rest,
77
- tag: "domain",
78
- children
79
- });
80
- }
81
- /**
82
- * Create a TSDoc `@alias` tag.
83
- */
84
- function TSDocAlias(props) {
85
- const [{ children }, rest] = splitProps(props, ["children"]);
86
- return /* @__PURE__ */ jsx(TSDocTag, {
87
- ...rest,
88
- tag: "alias",
89
- children
90
- });
91
- }
92
- /**
93
- * Create a TSDoc `@permission` tag.
94
- */
95
- function TSDocPermission(props) {
96
- const [{ children }, rest] = splitProps(props, ["children"]);
97
- return /* @__PURE__ */ jsx(TSDocTag, {
98
- ...rest,
99
- tag: "permission",
100
- children
101
- });
102
- }
103
- /**
104
- * Create a TSDoc `@defaultValue` tag.
105
- */
106
- function TSDocDefaultValue(props) {
107
- const [{ type, defaultValue }] = splitProps(props, ["type", "defaultValue"]);
108
- return /* @__PURE__ */ jsxs(Fragment, { children: [
109
- "@defaultValue ",
110
- /* @__PURE__ */ jsx(Show, {
111
- when: !isUndefined(defaultValue),
112
- children: /* @__PURE__ */ jsx("align", {
113
- width: 2,
114
- children: /* @__PURE__ */ jsx(Prose, { children: stringifyDefaultValue(type, defaultValue) })
115
- })
116
- }),
117
- /* @__PURE__ */ jsx("hbr", {})
118
- ] });
119
- }
120
- /**
121
- * Create a TSDoc `@remarks` tag.
122
- */
123
- function TSDocRemarks(props) {
124
- return /* @__PURE__ */ jsxs(Fragment, { children: [
125
- "@remarks ",
126
- /* @__PURE__ */ jsx("hbr", {}),
127
- /* @__PURE__ */ jsx(List, {
128
- hardline: true,
129
- children: childrenArray(() => props.children)
130
- })
131
- ] });
132
- }
133
- /**
134
- * Create a TSDoc `@see` tag.
135
- */
136
- function TSDocLink(props) {
137
- return /* @__PURE__ */ jsx(TSDocTag, {
138
- ...props,
139
- tag: "see"
140
- });
141
- }
142
- /**
143
- * Create a TSDoc `@example` tag.
144
- */
145
- function TSDocExample(props) {
146
- const [{ tsx, fenced = true, language, children }] = splitProps(props, [
147
- "tsx",
148
- "fenced",
149
- "language",
150
- "children"
151
- ]);
152
- return /* @__PURE__ */ jsxs(Fragment, { children: [
153
- "@example ",
154
- /* @__PURE__ */ jsx("hbr", {}),
155
- /* @__PURE__ */ jsxs(Show, {
156
- when: fenced,
157
- children: [
158
- "```",
159
- language || (tsx ? "tsx" : "ts"),
160
- /* @__PURE__ */ jsx("hbr", {})
161
- ]
162
- }),
163
- children,
164
- /* @__PURE__ */ jsxs(Show, {
165
- when: fenced,
166
- children: [/* @__PURE__ */ jsx("hbr", {}), "```"]
167
- })
168
- ] });
169
- }
170
- /**
171
- * Create a TSDoc `@readonly` tag.
172
- */
173
- function TSDocReadonly() {
174
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "readonly" });
175
- }
176
- /**
177
- * Create a TSDoc `@internal` tag.
178
- */
179
- function TSDocInternal() {
180
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "internal" });
181
- }
182
- /**
183
- * Create a TSDoc `@ignore` tag.
184
- */
185
- function TSDocIgnore() {
186
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "ignore" });
187
- }
188
- /**
189
- * Create a TSDoc `@hidden` tag.
190
- */
191
- function TSDocHidden() {
192
- return /* @__PURE__ */ jsx(TSDocTag, { tag: "hidden" });
193
- }
194
- /**
195
- * Generates a TypeScript interface property for the given reflection class.
196
- */
197
- function TSDocAttributesTags(props) {
198
- const [{ type, title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
199
- "type",
200
- "title",
201
- "alias",
202
- "permission",
203
- "domain",
204
- "readonly",
205
- "internal",
206
- "ignore",
207
- "hidden",
208
- "defaultValue"
209
- ]);
210
- return /* @__PURE__ */ jsxs(Fragment, { children: [
211
- /* @__PURE__ */ jsx(Show, {
212
- when: isSetString(title?.trim()),
213
- children: /* @__PURE__ */ jsx(TSDocTitle, { children: title })
214
- }),
215
- /* @__PURE__ */ jsx(Show, {
216
- when: !isUndefined(alias) && alias.length > 0 && alias.some((a) => isSetString(a?.trim())),
217
- children: /* @__PURE__ */ jsx(For, {
218
- each: alias?.filter((a) => isSetString(a?.trim())) ?? [],
219
- children: (alias$1) => /* @__PURE__ */ jsx(TSDocAlias, { children: alias$1 })
220
- })
221
- }),
222
- /* @__PURE__ */ jsx(Show, {
223
- when: isSetString(domain?.trim()),
224
- children: /* @__PURE__ */ jsx(TSDocDomain, { children: domain })
225
- }),
226
- /* @__PURE__ */ jsx(Show, {
227
- when: !isUndefined(permission) && permission.length > 0 && permission.some((p) => isSetString(p?.trim())),
228
- children: /* @__PURE__ */ jsx(For, {
229
- each: permission?.filter((p) => isSetString(p?.trim())) ?? [],
230
- children: (permission$1) => /* @__PURE__ */ jsx(TSDocPermission, { children: permission$1 })
231
- })
232
- }),
233
- /* @__PURE__ */ jsx(Show, {
234
- when: readonly === true,
235
- children: /* @__PURE__ */ jsx(TSDocReadonly, {})
236
- }),
237
- /* @__PURE__ */ jsx(Show, {
238
- when: internal === true,
239
- children: /* @__PURE__ */ jsx(TSDocInternal, {})
240
- }),
241
- /* @__PURE__ */ jsx(Show, {
242
- when: ignore === true,
243
- children: /* @__PURE__ */ jsx(TSDocIgnore, {})
244
- }),
245
- /* @__PURE__ */ jsx(Show, {
246
- when: hidden === true,
247
- children: /* @__PURE__ */ jsx(TSDocHidden, {})
248
- }),
249
- /* @__PURE__ */ jsx(Show, {
250
- when: !isUndefined(type) && !isUndefined(defaultValue),
251
- children: /* @__PURE__ */ jsx(TSDocDefaultValue, {
252
- type,
253
- defaultValue
254
- })
255
- })
256
- ] });
257
- }
258
- /**
259
- * Create a TSDoc parameter set off with `@param`.
260
- */
261
- function TSDocParam(props) {
262
- return /* @__PURE__ */ jsxs(Fragment, { children: [
263
- "@param ",
264
- /* @__PURE__ */ jsx(TSDocParamName, {
265
- name: props.name,
266
- optional: props.optional,
267
- defaultValue: props.defaultValue
268
- }),
269
- /* @__PURE__ */ jsx(TSDocParamDescription, { children: props.children })
270
- ] });
271
- }
272
- function TSDocParamName(props) {
273
- return /* @__PURE__ */ jsxs(Fragment, { children: [
274
- /* @__PURE__ */ jsx(Show, {
275
- when: props.optional,
276
- children: "["
277
- }),
278
- props.name,
279
- /* @__PURE__ */ jsxs(Show, {
280
- when: Boolean(props.defaultValue),
281
- children: ["=", props.defaultValue]
282
- }),
283
- /* @__PURE__ */ jsx(Show, {
284
- when: props.optional,
285
- children: "]"
286
- })
287
- ] });
288
- }
289
- function TSDocParamDescription(props) {
290
- return /* @__PURE__ */ jsxs(Show, {
291
- when: Boolean(props.children),
292
- children: [" - ", /* @__PURE__ */ jsx("align", {
293
- width: 2,
294
- children: /* @__PURE__ */ jsx(Prose, { children: props.children })
295
- })]
296
- });
297
- }
298
- /**
299
- * Create a TSDoc `@returns` tag.
300
- */
301
- function TSDocReturns(props) {
302
- return /* @__PURE__ */ jsx(TSDocTag, {
303
- ...props,
304
- tag: "returns"
305
- });
306
- }
307
- /**
308
- * Create a TSDoc `@throws` tag.
309
- */
310
- function TSDocThrows(props) {
311
- return /* @__PURE__ */ jsx(TSDocTag, {
312
- ...props,
313
- tag: "throws"
314
- });
315
- }
316
- /**
317
- * Generates a TSDoc `@module` tag for the given module name.
318
- */
319
- function TSDocModule(props) {
320
- const [{ children, name, prefix }] = splitProps(props, [
321
- "children",
322
- "name",
323
- "prefix"
324
- ]);
325
- const context = usePowerlinesSafe();
326
- return /* @__PURE__ */ jsxs(Fragment, { children: [
327
- "/**",
328
- /* @__PURE__ */ jsxs("align", {
329
- string: " * ",
330
- children: [
331
- /* @__PURE__ */ jsx("hbr", {}),
332
- /* @__PURE__ */ jsxs(Show, {
333
- when: Boolean(children),
334
- children: [
335
- /* @__PURE__ */ jsx(List, {
336
- hardline: true,
337
- children: childrenArray(() => children)
338
- }),
339
- /* @__PURE__ */ jsx("hbr", {}),
340
- /* @__PURE__ */ jsx("hbr", {})
341
- ]
342
- }),
343
- "@module ",
344
- prefix || context?.config?.framework || "powerlines",
345
- ":",
346
- name
347
- ]
348
- }),
349
- /* @__PURE__ */ jsx("hbr", {}),
350
- ` */`
351
- ] });
352
- }
353
-
354
- //#endregion
355
- export { TSDoc, TSDocAttributesTags, TSDocExample, TSDocLink, TSDocModule, TSDocParam, TSDocRemarks, TSDocReturns, TSDocThrows };
@@ -1,157 +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 __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
8
- let react_jsx_runtime = require("react/jsx-runtime");
9
- let __stryke_path_append = require("@stryke/path/append");
10
- let __alloy_js_typescript = require("@alloy-js/typescript");
11
- let __stryke_type_checks_is_boolean = require("@stryke/type-checks/is-boolean");
12
-
13
- //#region ../plugin-alloy/src/typescript/components/typescript-file.tsx
14
- /**
15
- * A base component representing a Powerlines generated Typescript source file.
16
- *
17
- * @param props - The properties for the source file.
18
- * @returns The rendered source file component.
19
- */
20
- function TypescriptFile(props) {
21
- const [{ children, path, imports, builtinImports, tsx, header, hashbang }, rest] = (0, __alloy_js_core.splitProps)(props, [
22
- "children",
23
- "path",
24
- "imports",
25
- "builtinImports",
26
- "tsx",
27
- "header",
28
- "hashbang"
29
- ]);
30
- const directoryContext = (0, __alloy_js_core.useContext)(__alloy_js_core.SourceDirectoryContext);
31
- const sdData = (0, __alloy_js_typescript.getSourceDirectoryData)(directoryContext);
32
- const modulePath = (0, __stryke_path_append.appendPath)(path, directoryContext.path);
33
- const scope = new __alloy_js_typescript.TSModuleScope(modulePath, (0, __alloy_js_core.useScope)());
34
- sdData.modules.add(scope);
35
- const pkg = (0, __alloy_js_core.useContext)(__alloy_js_typescript.PackageContext);
36
- if (pkg) pkg.scope.addModule(scope);
37
- if (props.export) {
38
- if (pkg) if ((0, __stryke_type_checks_is_boolean.isBoolean)(props.export)) pkg.scope.addExport(modulePath, scope);
39
- else pkg.scope.addExport(props.export, scope);
40
- }
41
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.SourceFileContext.Provider, {
42
- value: { scope },
43
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Scope, {
44
- value: scope,
45
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_source_file.SourceFile, {
46
- ...rest,
47
- path: modulePath,
48
- header: header ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TypescriptFileHeader, {
49
- hashbang,
50
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TypescriptFileHeaderImports, {
51
- imports,
52
- builtinImports,
53
- scope
54
- })
55
- }),
56
- filetype: tsx ? "tsx" : "typescript",
57
- children
58
- })
59
- })
60
- });
61
- }
62
- /**
63
- * Renders the header for a Powerlines Typescript source file.
64
- *
65
- * @param props - The properties for the source file header.
66
- * @returns The rendered source file header.
67
- */
68
- function TypescriptFileHeader(props) {
69
- const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
70
- const context = require_context.usePowerlinesSafe();
71
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
72
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
73
- when: Boolean(hashbang),
74
- children: [hashbang === true ? __alloy_js_core.code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
75
- }),
76
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
77
- when: Boolean(header),
78
- children: [header, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
79
- }),
80
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
81
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
82
- when: Boolean(disableEslint),
83
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
84
- variant: "slash-star",
85
- children: "eslint-disable"
86
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
87
- }),
88
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
89
- when: Boolean(disablePrettier),
90
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, {
91
- variant: "slash-star",
92
- children: "prettier-ignore"
93
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
94
- }),
95
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
96
- when: Boolean(disableBiome),
97
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, { children: "biome-ignore lint: disable" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
98
- }),
99
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
100
- when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
101
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
102
- }),
103
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
104
- when: Boolean(children),
105
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})] })
106
- }),
107
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, { children: `Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}` }),
108
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
109
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_single_line_comment.SingleLineComment, { children: __alloy_js_core.code`NOTE: Do not edit this file manually - it will be overwritten automatically` }),
110
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
111
- ] });
112
- }
113
- /**
114
- * Renders the header for a Powerlines Typescript source file.
115
- *
116
- * @param props - The properties for the source file header.
117
- * @returns The rendered source file header.
118
- */
119
- function TypescriptFileHeaderImports(props) {
120
- const { imports, builtinImports } = props;
121
- const context = require_context.usePowerlinesSafe();
122
- const sourceFile = (0, __alloy_js_typescript.useSourceFile)();
123
- const scope = props.scope ?? sourceFile.scope;
124
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
125
- when: scope.importedModules.size > 0 || !!imports && Object.keys(imports).length > 0 || !!builtinImports && Object.keys(builtinImports).length > 0,
126
- children: [
127
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
128
- when: !!imports && Object.keys(imports).length > 0,
129
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
130
- each: Object.entries(imports ?? {}),
131
- hardline: true,
132
- children: ([module$1, importItem]) => {
133
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: __alloy_js_core.code`import ${importItem === null ? "" : (0, __stryke_type_checks_is_string.isString)(importItem) ? importItem : ` ${importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module$1}";` });
134
- }
135
- })
136
- }),
137
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
138
- when: builtinImports && Object.keys(builtinImports).length > 0,
139
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
140
- each: Object.entries(builtinImports ?? {}),
141
- hardline: true,
142
- children: ([module$1, importItem]) => __alloy_js_core.code`import ${importItem === null ? "" : (0, __stryke_type_checks_is_string.isString)(importItem) ? importItem : ` ${importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module$1.includes(":") ? module$1 : `${context?.config?.framework || "powerlines"}:${module$1}`}";`
143
- })
144
- }),
145
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
146
- when: scope.importedModules.size > 0,
147
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ImportStatements, { records: scope.importedModules })
148
- }),
149
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
150
- ]
151
- });
152
- }
153
-
154
- //#endregion
155
- exports.TypescriptFile = TypescriptFile;
156
- exports.TypescriptFileHeader = TypescriptFileHeader;
157
- exports.TypescriptFileHeaderImports = TypescriptFileHeaderImports;
@@ -1,154 +0,0 @@
1
- import { usePowerlinesSafe } 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 { For, Scope, Show, SourceDirectoryContext, code, splitProps, useContext, useScope } from "@alloy-js/core";
5
- import { titleCase } from "@stryke/string-format/title-case";
6
- import { isString } from "@stryke/type-checks/is-string";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { appendPath } from "@stryke/path/append";
9
- import { ImportStatements, PackageContext, SourceFileContext as SourceFileContext$1, TSModuleScope, getSourceDirectoryData, useSourceFile } from "@alloy-js/typescript";
10
- import { isBoolean } from "@stryke/type-checks/is-boolean";
11
-
12
- //#region ../plugin-alloy/src/typescript/components/typescript-file.tsx
13
- /**
14
- * A base component representing a Powerlines generated Typescript source file.
15
- *
16
- * @param props - The properties for the source file.
17
- * @returns The rendered source file component.
18
- */
19
- function TypescriptFile(props) {
20
- const [{ children, path, imports, builtinImports, tsx, header, hashbang }, rest] = splitProps(props, [
21
- "children",
22
- "path",
23
- "imports",
24
- "builtinImports",
25
- "tsx",
26
- "header",
27
- "hashbang"
28
- ]);
29
- const directoryContext = useContext(SourceDirectoryContext);
30
- const sdData = getSourceDirectoryData(directoryContext);
31
- const modulePath = appendPath(path, directoryContext.path);
32
- const scope = new TSModuleScope(modulePath, useScope());
33
- sdData.modules.add(scope);
34
- const pkg = useContext(PackageContext);
35
- if (pkg) pkg.scope.addModule(scope);
36
- if (props.export) {
37
- if (pkg) if (isBoolean(props.export)) pkg.scope.addExport(modulePath, scope);
38
- else pkg.scope.addExport(props.export, scope);
39
- }
40
- return /* @__PURE__ */ jsx(SourceFileContext$1.Provider, {
41
- value: { scope },
42
- children: /* @__PURE__ */ jsx(Scope, {
43
- value: scope,
44
- children: /* @__PURE__ */ jsx(SourceFile, {
45
- ...rest,
46
- path: modulePath,
47
- header: header ?? /* @__PURE__ */ jsx(TypescriptFileHeader, {
48
- hashbang,
49
- children: /* @__PURE__ */ jsx(TypescriptFileHeaderImports, {
50
- imports,
51
- builtinImports,
52
- scope
53
- })
54
- }),
55
- filetype: tsx ? "tsx" : "typescript",
56
- children
57
- })
58
- })
59
- });
60
- }
61
- /**
62
- * Renders the header for a Powerlines Typescript source file.
63
- *
64
- * @param props - The properties for the source file header.
65
- * @returns The rendered source file header.
66
- */
67
- function TypescriptFileHeader(props) {
68
- const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
69
- const context = usePowerlinesSafe();
70
- return /* @__PURE__ */ jsxs(Fragment, { children: [
71
- /* @__PURE__ */ jsxs(Show, {
72
- when: Boolean(hashbang),
73
- children: [hashbang === true ? code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang, /* @__PURE__ */ jsx("hbr", {})]
74
- }),
75
- /* @__PURE__ */ jsxs(Show, {
76
- when: Boolean(header),
77
- children: [header, /* @__PURE__ */ jsx("hbr", {})]
78
- }),
79
- /* @__PURE__ */ jsx("hbr", {}),
80
- /* @__PURE__ */ jsxs(Show, {
81
- when: Boolean(disableEslint),
82
- children: [/* @__PURE__ */ jsx(SingleLineComment, {
83
- variant: "slash-star",
84
- children: "eslint-disable"
85
- }), /* @__PURE__ */ jsx("hbr", {})]
86
- }),
87
- /* @__PURE__ */ jsxs(Show, {
88
- when: Boolean(disablePrettier),
89
- children: [/* @__PURE__ */ jsx(SingleLineComment, {
90
- variant: "slash-star",
91
- children: "prettier-ignore"
92
- }), /* @__PURE__ */ jsx("hbr", {})]
93
- }),
94
- /* @__PURE__ */ jsxs(Show, {
95
- when: Boolean(disableBiome),
96
- children: [/* @__PURE__ */ jsx(SingleLineComment, { children: "biome-ignore lint: disable" }), /* @__PURE__ */ jsx("hbr", {})]
97
- }),
98
- /* @__PURE__ */ jsx(Show, {
99
- when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
100
- children: /* @__PURE__ */ jsx("hbr", {})
101
- }),
102
- /* @__PURE__ */ jsx(Show, {
103
- when: Boolean(children),
104
- children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
105
- }),
106
- /* @__PURE__ */ jsx(SingleLineComment, { children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}` }),
107
- /* @__PURE__ */ jsx("hbr", {}),
108
- /* @__PURE__ */ jsx(SingleLineComment, { children: code`NOTE: Do not edit this file manually - it will be overwritten automatically` }),
109
- /* @__PURE__ */ jsx("hbr", {})
110
- ] });
111
- }
112
- /**
113
- * Renders the header for a Powerlines Typescript source file.
114
- *
115
- * @param props - The properties for the source file header.
116
- * @returns The rendered source file header.
117
- */
118
- function TypescriptFileHeaderImports(props) {
119
- const { imports, builtinImports } = props;
120
- const context = usePowerlinesSafe();
121
- const sourceFile = useSourceFile();
122
- const scope = props.scope ?? sourceFile.scope;
123
- return /* @__PURE__ */ jsxs(Show, {
124
- when: scope.importedModules.size > 0 || !!imports && Object.keys(imports).length > 0 || !!builtinImports && Object.keys(builtinImports).length > 0,
125
- children: [
126
- /* @__PURE__ */ jsx(Show, {
127
- when: !!imports && Object.keys(imports).length > 0,
128
- children: /* @__PURE__ */ jsx(For, {
129
- each: Object.entries(imports ?? {}),
130
- hardline: true,
131
- children: ([module, importItem]) => {
132
- return /* @__PURE__ */ jsx(Fragment, { children: code`import ${importItem === null ? "" : isString(importItem) ? importItem : ` ${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module}";` });
133
- }
134
- })
135
- }),
136
- /* @__PURE__ */ jsx(Show, {
137
- when: builtinImports && Object.keys(builtinImports).length > 0,
138
- children: /* @__PURE__ */ jsx(For, {
139
- each: Object.entries(builtinImports ?? {}),
140
- hardline: true,
141
- children: ([module, importItem]) => code`import ${importItem === null ? "" : isString(importItem) ? importItem : ` ${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
142
- })
143
- }),
144
- /* @__PURE__ */ jsx(Show, {
145
- when: scope.importedModules.size > 0,
146
- children: /* @__PURE__ */ jsx(ImportStatements, { records: scope.importedModules })
147
- }),
148
- /* @__PURE__ */ jsx("hbr", {})
149
- ]
150
- });
151
- }
152
-
153
- //#endregion
154
- export { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports };