@powerlines/plugin-date 0.12.151 → 0.12.152

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