@powerlines/plugin-date 0.12.260 → 0.12.262

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,57 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- const require_reflection = require('../../core/contexts/reflection.cjs');
3
- const require_tsdoc_reflection = require('./tsdoc-reflection.cjs');
4
- let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
5
- let __alloy_js_core = require("@alloy-js/core");
6
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
- let __alloy_js_typescript = require("@alloy-js/typescript");
9
- let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
10
-
11
- //#region ../plugin-alloy/src/typescript/components/typescript-interface.tsx
12
- /**
13
- * Generates a TypeScript interface for the given reflection class.
14
- */
15
- function TypeScriptInterface(props) {
16
- const [{ name, reflection, doc }, rest] = (0, __alloy_js_core.splitProps)(props, [
17
- "name",
18
- "reflection",
19
- "doc"
20
- ]);
21
- const interfaceName = (0, __alloy_js_core.computed)(() => (0, __stryke_string_format_pascal_case.pascalCase)(((0, __stryke_type_checks_is_string.isString)(name) ? name : name.toString()) || reflection.getName()));
22
- const properties = reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1);
23
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_reflection.ReflectionClassContext.Provider, {
24
- value: { reflection },
25
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc_reflection.TSDocReflectionClass, { heading: doc }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.InterfaceDeclaration, {
26
- export: true,
27
- name: interfaceName.value,
28
- ...rest,
29
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
30
- each: properties,
31
- doubleHardline: true,
32
- semicolon: true,
33
- children: (prop) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TypescriptInterfaceProperty, { property: prop })
34
- })
35
- })]
36
- });
37
- }
38
- /**
39
- * Generates a TypeScript interface property for the given reflection class.
40
- */
41
- function TypescriptInterfaceProperty(props) {
42
- const [{ property }, rest] = (0, __alloy_js_core.splitProps)(props, ["property"]);
43
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_reflection.ReflectionPropertyContext.Provider, {
44
- value: property,
45
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc_reflection.TSDocReflectionProperty, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.InterfaceMember, {
46
- name: property.getNameAsString(),
47
- readonly: property.isReadonly(),
48
- optional: property.isOptional(),
49
- nullish: property.isNullable(),
50
- type: (0, __powerlines_deepkit_vendor_type.stringifyType)(property.getType()),
51
- ...rest
52
- })]
53
- });
54
- }
55
-
56
- //#endregion
57
- exports.TypeScriptInterface = TypeScriptInterface;
@@ -1,56 +0,0 @@
1
- import { ReflectionClassContext, ReflectionPropertyContext } from "../../core/contexts/reflection.mjs";
2
- import { TSDocReflectionClass, TSDocReflectionProperty } from "./tsdoc-reflection.mjs";
3
- import { stringifyType } from "@powerlines/deepkit/vendor/type";
4
- import { For, computed, splitProps } from "@alloy-js/core";
5
- import { isString } from "@stryke/type-checks/is-string";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { InterfaceDeclaration, InterfaceMember } from "@alloy-js/typescript";
8
- import { pascalCase } from "@stryke/string-format/pascal-case";
9
-
10
- //#region ../plugin-alloy/src/typescript/components/typescript-interface.tsx
11
- /**
12
- * Generates a TypeScript interface for the given reflection class.
13
- */
14
- function TypeScriptInterface(props) {
15
- const [{ name, reflection, doc }, rest] = splitProps(props, [
16
- "name",
17
- "reflection",
18
- "doc"
19
- ]);
20
- const interfaceName = computed(() => pascalCase((isString(name) ? name : name.toString()) || reflection.getName()));
21
- const properties = reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1);
22
- return /* @__PURE__ */ jsxs(ReflectionClassContext.Provider, {
23
- value: { reflection },
24
- children: [/* @__PURE__ */ jsx(TSDocReflectionClass, { heading: doc }), /* @__PURE__ */ jsx(InterfaceDeclaration, {
25
- export: true,
26
- name: interfaceName.value,
27
- ...rest,
28
- children: /* @__PURE__ */ jsx(For, {
29
- each: properties,
30
- doubleHardline: true,
31
- semicolon: true,
32
- children: (prop) => /* @__PURE__ */ jsx(TypescriptInterfaceProperty, { property: prop })
33
- })
34
- })]
35
- });
36
- }
37
- /**
38
- * Generates a TypeScript interface property for the given reflection class.
39
- */
40
- function TypescriptInterfaceProperty(props) {
41
- const [{ property }, rest] = splitProps(props, ["property"]);
42
- return /* @__PURE__ */ jsxs(ReflectionPropertyContext.Provider, {
43
- value: property,
44
- children: [/* @__PURE__ */ jsx(TSDocReflectionProperty, {}), /* @__PURE__ */ jsx(InterfaceMember, {
45
- name: property.getNameAsString(),
46
- readonly: property.isReadonly(),
47
- optional: property.isOptional(),
48
- nullish: property.isNullable(),
49
- type: stringifyType(property.getType()),
50
- ...rest
51
- })]
52
- });
53
- }
54
-
55
- //#endregion
56
- export { TypeScriptInterface };
@@ -1,94 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- const require_utilities = require('../../../../deepkit/src/utilities.cjs');
3
- const require_reflection = require('../../core/contexts/reflection.cjs');
4
- const require_tsdoc_reflection = require('./tsdoc-reflection.cjs');
5
- let __alloy_js_core = require("@alloy-js/core");
6
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
- let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
9
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
10
- let __alloy_js_typescript = require("@alloy-js/typescript");
11
- let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
12
-
13
- //#region ../plugin-alloy/src/typescript/components/typescript-object.tsx
14
- /**
15
- * Generates a TypeScript object for the given reflection class.
16
- */
17
- function TypescriptObject(props) {
18
- if (!props.reflection?.value) return null;
19
- const objectName = (0, __alloy_js_core.computed)(() => (0, __stryke_string_format_camel_case.camelCase)(((0, __stryke_type_checks_is_string.isString)(props.name) ? props.name : props.name.toString()) || props.reflection.value.getName()));
20
- const objectType = (0, __alloy_js_core.computed)(() => props.type || (0, __stryke_string_format_pascal_case.pascalCase)(props.reflection.value.getName()));
21
- const properties = (0, __alloy_js_core.computed)(() => props.reflection.value.getProperties().filter((item) => !item.isIgnored() && !(0, __stryke_type_checks_is_undefined.isUndefined)(props.defaultValue?.value?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
22
- if ((0, __stryke_type_checks_is_undefined.isUndefined)(ret) && !(0, __stryke_type_checks_is_undefined.isUndefined)(props.defaultValue?.value?.[alias])) return props.defaultValue?.value?.[alias];
23
- return ret;
24
- }, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1));
25
- const TypeSymbolSlot = (0, __alloy_js_core.createSymbolSlot)();
26
- const ValueTypeSymbolSlot = (0, __alloy_js_core.createSymbolSlot)();
27
- const sym = (0, __alloy_js_typescript.createValueSymbol)(props.name, {
28
- refkeys: props.refkey,
29
- default: props.default,
30
- export: props.export,
31
- metadata: props.metadata,
32
- tsFlags: props.nullish ? __alloy_js_typescript.TSSymbolFlags.Nullish : __alloy_js_typescript.TSSymbolFlags.None,
33
- type: props.type ? TypeSymbolSlot.firstSymbol : void 0,
34
- namePolicy: (0, __alloy_js_typescript.useTSNamePolicy)().for("variable")
35
- });
36
- if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
37
- const keyword = props.var ? "var" : props.let ? "let" : "const";
38
- const type = props.type ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_typescript.TypeRefContext, { children: [": ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TypeSymbolSlot, { children: props.type })] }) : void 0;
39
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
40
- when: !!props.reflection.value,
41
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_reflection.ReflectionClassContext.Provider, {
42
- value: {
43
- reflection: props.reflection.value,
44
- override: {
45
- name: objectName.value,
46
- type: objectType.value,
47
- defaultValue: props.defaultValue?.value
48
- }
49
- },
50
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
51
- when: !!objectName.value && !!objectType.value,
52
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc_reflection.TSDocReflectionClass, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Declaration, {
53
- symbol: sym,
54
- children: [
55
- props.export ? "export " : "",
56
- props.default ? "default " : "",
57
- keyword,
58
- " ",
59
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Name, {}),
60
- type,
61
- " =",
62
- " ",
63
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueTypeSymbolSlot, { children: props.initializer ?? props.children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ObjectExpression, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
64
- each: properties.value ?? [],
65
- comma: true,
66
- doubleHardline: true,
67
- children: (prop) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TypescriptObjectProperty, { property: prop })
68
- }) }) })
69
- ]
70
- })]
71
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})]
72
- })
73
- });
74
- }
75
- /**
76
- * Generates a TypeScript object property for the given reflection class.
77
- */
78
- function TypescriptObjectProperty(props) {
79
- const [{ property }] = (0, __alloy_js_core.splitProps)(props, ["property"]);
80
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_reflection.ReflectionPropertyContext.Provider, {
81
- value: property,
82
- children: [
83
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc_reflection.TSDocReflectionProperty, {}),
84
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ObjectProperty, {
85
- name: property.getNameAsString(),
86
- value: require_utilities.stringifyDefaultValue(property)
87
- }),
88
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
89
- ]
90
- });
91
- }
92
-
93
- //#endregion
94
- exports.TypescriptObject = TypescriptObject;
@@ -1,93 +0,0 @@
1
- import { stringifyDefaultValue } from "../../../../deepkit/src/utilities.mjs";
2
- import { ReflectionClassContext, ReflectionPropertyContext } from "../../core/contexts/reflection.mjs";
3
- import { TSDocReflectionClass, TSDocReflectionProperty } from "./tsdoc-reflection.mjs";
4
- import { Declaration, For, Name, Show, computed, createSymbolSlot, splitProps } from "@alloy-js/core";
5
- import { isString } from "@stryke/type-checks/is-string";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { isUndefined } from "@stryke/type-checks/is-undefined";
8
- import { camelCase } from "@stryke/string-format/camel-case";
9
- import { ObjectExpression, ObjectProperty, TSSymbolFlags, TypeRefContext, createValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
10
- import { pascalCase } from "@stryke/string-format/pascal-case";
11
-
12
- //#region ../plugin-alloy/src/typescript/components/typescript-object.tsx
13
- /**
14
- * Generates a TypeScript object for the given reflection class.
15
- */
16
- function TypescriptObject(props) {
17
- if (!props.reflection?.value) return null;
18
- const objectName = computed(() => camelCase((isString(props.name) ? props.name : props.name.toString()) || props.reflection.value.getName()));
19
- const objectType = computed(() => props.type || pascalCase(props.reflection.value.getName()));
20
- const properties = computed(() => props.reflection.value.getProperties().filter((item) => !item.isIgnored() && !isUndefined(props.defaultValue?.value?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
21
- if (isUndefined(ret) && !isUndefined(props.defaultValue?.value?.[alias])) return props.defaultValue?.value?.[alias];
22
- return ret;
23
- }, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1));
24
- const TypeSymbolSlot = createSymbolSlot();
25
- const ValueTypeSymbolSlot = createSymbolSlot();
26
- const sym = createValueSymbol(props.name, {
27
- refkeys: props.refkey,
28
- default: props.default,
29
- export: props.export,
30
- metadata: props.metadata,
31
- tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,
32
- type: props.type ? TypeSymbolSlot.firstSymbol : void 0,
33
- namePolicy: useTSNamePolicy().for("variable")
34
- });
35
- if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
36
- const keyword = props.var ? "var" : props.let ? "let" : "const";
37
- const type = props.type ? /* @__PURE__ */ jsxs(TypeRefContext, { children: [": ", /* @__PURE__ */ jsx(TypeSymbolSlot, { children: props.type })] }) : void 0;
38
- return /* @__PURE__ */ jsx(Show, {
39
- when: !!props.reflection.value,
40
- children: /* @__PURE__ */ jsxs(ReflectionClassContext.Provider, {
41
- value: {
42
- reflection: props.reflection.value,
43
- override: {
44
- name: objectName.value,
45
- type: objectType.value,
46
- defaultValue: props.defaultValue?.value
47
- }
48
- },
49
- children: [/* @__PURE__ */ jsxs(Show, {
50
- when: !!objectName.value && !!objectType.value,
51
- children: [/* @__PURE__ */ jsx(TSDocReflectionClass, {}), /* @__PURE__ */ jsxs(Declaration, {
52
- symbol: sym,
53
- children: [
54
- props.export ? "export " : "",
55
- props.default ? "default " : "",
56
- keyword,
57
- " ",
58
- /* @__PURE__ */ jsx(Name, {}),
59
- type,
60
- " =",
61
- " ",
62
- /* @__PURE__ */ jsx(ValueTypeSymbolSlot, { children: props.initializer ?? props.children ?? /* @__PURE__ */ jsx(ObjectExpression, { children: /* @__PURE__ */ jsx(For, {
63
- each: properties.value ?? [],
64
- comma: true,
65
- doubleHardline: true,
66
- children: (prop) => /* @__PURE__ */ jsx(TypescriptObjectProperty, { property: prop })
67
- }) }) })
68
- ]
69
- })]
70
- }), /* @__PURE__ */ jsx("hbr", {})]
71
- })
72
- });
73
- }
74
- /**
75
- * Generates a TypeScript object property for the given reflection class.
76
- */
77
- function TypescriptObjectProperty(props) {
78
- const [{ property }] = splitProps(props, ["property"]);
79
- return /* @__PURE__ */ jsxs(ReflectionPropertyContext.Provider, {
80
- value: property,
81
- children: [
82
- /* @__PURE__ */ jsx(TSDocReflectionProperty, {}),
83
- /* @__PURE__ */ jsx(ObjectProperty, {
84
- name: property.getNameAsString(),
85
- value: stringifyDefaultValue(property)
86
- }),
87
- /* @__PURE__ */ jsx("hbr", {})
88
- ]
89
- });
90
- }
91
-
92
- //#endregion
93
- export { TypescriptObject };
@@ -1,101 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- let defu = require("defu");
3
- defu = require_rolldown_runtime.__toESM(defu);
4
- let __stryke_path_replace = require("@stryke/path/replace");
5
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
6
- let __stryke_fs_is_file = require("@stryke/fs/is-file");
7
- let __stryke_fs_list_files = require("@stryke/fs/list-files");
8
- let __stryke_path_append = require("@stryke/path/append");
9
- let __stryke_path_is_type = require("@stryke/path/is-type");
10
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
11
- let automd = require("automd");
12
- let c12 = require("c12");
13
- let markdown_toc = require("markdown-toc");
14
- markdown_toc = require_rolldown_runtime.__toESM(markdown_toc);
15
-
16
- //#region ../plugin-automd/src/index.ts
17
- /**
18
- * AutoMD Plugin
19
- *
20
- * @remarks
21
- * A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
22
- *
23
- * @see https://automd.unjs.io/
24
- *
25
- * @param options - The plugin options.
26
- * @returns A Powerlines plugin instance.
27
- */
28
- const plugin = (options = {}) => {
29
- return {
30
- name: "automd",
31
- async config() {
32
- const config = await (0, automd.loadConfig)((0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.projectRoot), options);
33
- if (!config.prefix || !Array.isArray(config.prefix)) config.prefix = (0, __stryke_convert_to_array.toArray)(config.prefix ?? []);
34
- if (!config.prefix.includes("automd")) config.prefix.push("automd");
35
- if (!config.prefix.includes("powerlines")) config.prefix.push("powerlines");
36
- return { automd: (0, defu.default)(config ?? {}, {
37
- configFile: options.configFile,
38
- allowIssues: true,
39
- dir: this.config.projectRoot,
40
- watch: false,
41
- input: "README.md",
42
- toc: {
43
- maxDepth: 6,
44
- bullets: "-"
45
- }
46
- }) };
47
- },
48
- async configResolved() {
49
- if (this.config.framework && !(0, __stryke_convert_to_array.toArray)(this.config.automd.prefix).includes(this.config.framework)) this.config.automd.prefix = (0, __stryke_convert_to_array.toArray)(this.config.automd.prefix).concat(this.config.framework);
50
- if (this.config.automd.configFile) {
51
- const { config } = await (0, c12.loadConfig)({
52
- cwd: this.config.automd.dir,
53
- configFile: this.config.automd.configFile,
54
- defaults: {
55
- ignore: [
56
- "**/node_modules",
57
- "**/dist",
58
- "**/.*"
59
- ],
60
- dir: this.config.automd.dir
61
- }
62
- });
63
- this.config.automd = (0, automd.resolveConfig)((0, defu.default)(this.config.automd, {
64
- ...config,
65
- prefix: (0, __stryke_convert_to_array.toArray)(config.prefix ?? [])
66
- }));
67
- }
68
- this.config.automd.input = (await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.automd.input).map(async (input) => {
69
- if (input.includes("*")) return (0, __stryke_fs_list_files.listFiles)((0, __stryke_path_is_type.isAbsolutePath)(input) ? input : (0, __stryke_path_append.appendPath)(input, this.config.projectRoot), { ignore: this.config.automd.ignore });
70
- return (0, __stryke_path_is_type.isAbsolutePath)(input) ? input : (0, __stryke_path_append.appendPath)(input, this.config.projectRoot);
71
- }))).flat();
72
- if (this.config.automd.output && !(0, __stryke_path_is_type.isAbsolutePath)(this.config.automd.output)) this.config.automd.output = (0, __stryke_path_append.appendPath)(this.config.automd.output, this.config.projectRoot);
73
- this.config.automd.generators ??= {};
74
- if (this.config.automd.toc !== false) this.config.automd.generators.toc ??= {
75
- name: "toc",
76
- generate: (ctx) => {
77
- const opts = this.config.automd.toc ?? {};
78
- return { contents: (0, markdown_toc.default)(ctx.block.md, {
79
- ...opts,
80
- maxdepth: opts.maxDepth,
81
- first1: opts.firstH1
82
- }).content };
83
- }
84
- };
85
- },
86
- async docs() {
87
- await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.automd.input).map(async (input) => {
88
- const contents = await this.fs.read(input);
89
- if (contents) {
90
- const result = await (0, automd.transform)(contents, this.config.automd);
91
- if (result.hasIssues && this.config.automd.allowIssues === false) throw new Error(`AutoMD found issues in file "${input}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);
92
- if (result.hasChanged) await this.fs.write((0, __stryke_path_append.appendPath)(this.config.automd.output ? (0, __stryke_fs_is_file.isDirectory)(this.config.automd.output) ? (0, __stryke_path_replace.replacePath)(input, this.config.automd.output) : this.config.automd.output : input, this.config.projectRoot), result.contents);
93
- }
94
- }));
95
- }
96
- };
97
- };
98
- var src_default = plugin;
99
-
100
- //#endregion
101
- exports.default = src_default;
@@ -1,98 +0,0 @@
1
- import defu from "defu";
2
- import { replacePath } from "@stryke/path/replace";
3
- import { toArray } from "@stryke/convert/to-array";
4
- import { isDirectory } from "@stryke/fs/is-file";
5
- import { listFiles } from "@stryke/fs/list-files";
6
- import { appendPath } from "@stryke/path/append";
7
- import { isAbsolutePath } from "@stryke/path/is-type";
8
- import { joinPaths } from "@stryke/path/join-paths";
9
- import { loadConfig, resolveConfig, transform } from "automd";
10
- import { loadConfig as loadConfig$1 } from "c12";
11
- import toc from "markdown-toc";
12
-
13
- //#region ../plugin-automd/src/index.ts
14
- /**
15
- * AutoMD Plugin
16
- *
17
- * @remarks
18
- * A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
19
- *
20
- * @see https://automd.unjs.io/
21
- *
22
- * @param options - The plugin options.
23
- * @returns A Powerlines plugin instance.
24
- */
25
- const plugin = (options = {}) => {
26
- return {
27
- name: "automd",
28
- async config() {
29
- const config = await loadConfig(joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot), options);
30
- if (!config.prefix || !Array.isArray(config.prefix)) config.prefix = toArray(config.prefix ?? []);
31
- if (!config.prefix.includes("automd")) config.prefix.push("automd");
32
- if (!config.prefix.includes("powerlines")) config.prefix.push("powerlines");
33
- return { automd: defu(config ?? {}, {
34
- configFile: options.configFile,
35
- allowIssues: true,
36
- dir: this.config.projectRoot,
37
- watch: false,
38
- input: "README.md",
39
- toc: {
40
- maxDepth: 6,
41
- bullets: "-"
42
- }
43
- }) };
44
- },
45
- async configResolved() {
46
- if (this.config.framework && !toArray(this.config.automd.prefix).includes(this.config.framework)) this.config.automd.prefix = toArray(this.config.automd.prefix).concat(this.config.framework);
47
- if (this.config.automd.configFile) {
48
- const { config } = await loadConfig$1({
49
- cwd: this.config.automd.dir,
50
- configFile: this.config.automd.configFile,
51
- defaults: {
52
- ignore: [
53
- "**/node_modules",
54
- "**/dist",
55
- "**/.*"
56
- ],
57
- dir: this.config.automd.dir
58
- }
59
- });
60
- this.config.automd = resolveConfig(defu(this.config.automd, {
61
- ...config,
62
- prefix: toArray(config.prefix ?? [])
63
- }));
64
- }
65
- this.config.automd.input = (await Promise.all(toArray(this.config.automd.input).map(async (input) => {
66
- if (input.includes("*")) return listFiles(isAbsolutePath(input) ? input : appendPath(input, this.config.projectRoot), { ignore: this.config.automd.ignore });
67
- return isAbsolutePath(input) ? input : appendPath(input, this.config.projectRoot);
68
- }))).flat();
69
- if (this.config.automd.output && !isAbsolutePath(this.config.automd.output)) this.config.automd.output = appendPath(this.config.automd.output, this.config.projectRoot);
70
- this.config.automd.generators ??= {};
71
- if (this.config.automd.toc !== false) this.config.automd.generators.toc ??= {
72
- name: "toc",
73
- generate: (ctx) => {
74
- const opts = this.config.automd.toc ?? {};
75
- return { contents: toc(ctx.block.md, {
76
- ...opts,
77
- maxdepth: opts.maxDepth,
78
- first1: opts.firstH1
79
- }).content };
80
- }
81
- };
82
- },
83
- async docs() {
84
- await Promise.all(toArray(this.config.automd.input).map(async (input) => {
85
- const contents = await this.fs.read(input);
86
- if (contents) {
87
- const result = await transform(contents, this.config.automd);
88
- if (result.hasIssues && this.config.automd.allowIssues === false) throw new Error(`AutoMD found issues in file "${input}". Please resolve the issues or set \`allowIssues\` to true in the plugin configuration to ignore them.`);
89
- if (result.hasChanged) await this.fs.write(appendPath(this.config.automd.output ? isDirectory(this.config.automd.output) ? replacePath(input, this.config.automd.output) : this.config.automd.output : input, this.config.projectRoot), result.contents);
90
- }
91
- }));
92
- }
93
- };
94
- };
95
- var src_default = plugin;
96
-
97
- //#endregion
98
- export { src_default as default };
@@ -1,38 +0,0 @@
1
- import { TOCOptions } from "./toc.cjs";
2
- import { Config } from "automd";
3
-
4
- //#region ../plugin-automd/src/types/plugin.d.ts
5
-
6
- type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
7
- /**
8
- * Path to the AutoMD configuration file.
9
- *
10
- * @remarks
11
- * If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
12
- */
13
- configFile?: string;
14
- /**
15
- * An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
16
- *
17
- * @defaultValue true
18
- */
19
- allowIssues?: boolean;
20
- /**
21
- * Alternate prefix strings to use for finding generators
22
- *
23
- * @remarks
24
- * By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
25
- *
26
- * @defaultValue ["automd", "powerlines", "\{framework\}"]
27
- */
28
- prefix?: string | string[];
29
- /**
30
- * Table of Contents generator options
31
- *
32
- * @remarks
33
- * If set to `false`, the built-in Table of Contents generator will be disabled.
34
- */
35
- toc?: false | TOCOptions;
36
- };
37
- //#endregion
38
- export { AutoMDPluginOptions };
@@ -1,40 +0,0 @@
1
- import "../../../powerlines/src/types/config.mjs";
2
- import "../../../powerlines/src/types/resolved.mjs";
3
- import "../../../powerlines/src/types/context.mjs";
4
- import { TOCOptions } from "./toc.mjs";
5
- import { Config } from "automd";
6
-
7
- //#region ../plugin-automd/src/types/plugin.d.ts
8
- type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
9
- /**
10
- * Path to the AutoMD configuration file.
11
- *
12
- * @remarks
13
- * If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
14
- */
15
- configFile?: string;
16
- /**
17
- * An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
18
- *
19
- * @defaultValue true
20
- */
21
- allowIssues?: boolean;
22
- /**
23
- * Alternate prefix strings to use for finding generators
24
- *
25
- * @remarks
26
- * By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
27
- *
28
- * @defaultValue ["automd", "powerlines", "\{framework\}"]
29
- */
30
- prefix?: string | string[];
31
- /**
32
- * Table of Contents generator options
33
- *
34
- * @remarks
35
- * If set to `false`, the built-in Table of Contents generator will be disabled.
36
- */
37
- toc?: false | TOCOptions;
38
- };
39
- //#endregion
40
- export { AutoMDPluginOptions };
@@ -1,33 +0,0 @@
1
- //#region ../plugin-automd/src/types/toc.d.ts
2
- interface TOCOptions {
3
- /**
4
- * A slugify function to generate slugs for the headings.
5
- */
6
- slugify?: (str: string) => string;
7
- /**
8
- * The maximum depth of headings to include in the TOC.
9
- *
10
- * @defaultValue 6
11
- */
12
- maxDepth?: number;
13
- /**
14
- * Whether to include the first H1 heading in the TOC.
15
- */
16
- firstH1?: boolean;
17
- /**
18
- * The bullet character to use for list items in the TOC.
19
- *
20
- * @defaultValue "-"
21
- */
22
- bullets?: string;
23
- /**
24
- * A prefix to add to each heading in the TOC.
25
- */
26
- prefix?: string;
27
- /**
28
- * A filter function to determine which headings to include in the TOC.
29
- */
30
- filter?: (str: string, level: number) => boolean;
31
- }
32
- //#endregion
33
- export { TOCOptions };
@@ -1,33 +0,0 @@
1
- //#region ../plugin-automd/src/types/toc.d.ts
2
- interface TOCOptions {
3
- /**
4
- * A slugify function to generate slugs for the headings.
5
- */
6
- slugify?: (str: string) => string;
7
- /**
8
- * The maximum depth of headings to include in the TOC.
9
- *
10
- * @defaultValue 6
11
- */
12
- maxDepth?: number;
13
- /**
14
- * Whether to include the first H1 heading in the TOC.
15
- */
16
- firstH1?: boolean;
17
- /**
18
- * The bullet character to use for list items in the TOC.
19
- *
20
- * @defaultValue "-"
21
- */
22
- bullets?: string;
23
- /**
24
- * A prefix to add to each heading in the TOC.
25
- */
26
- prefix?: string;
27
- /**
28
- * A filter function to determine which headings to include in the TOC.
29
- */
30
- filter?: (str: string, level: number) => boolean;
31
- }
32
- //#endregion
33
- export { TOCOptions };
@@ -1,10 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __babel_generator = require("@babel/generator");
3
- __babel_generator = require_rolldown_runtime.__toESM(__babel_generator);
4
- require("@babel/parser");
5
-
6
- //#region ../plugin-babel/src/helpers/ast-utils.ts
7
- let generate = __babel_generator.default;
8
- if ("default" in generate) generate = generate.default;
9
-
10
- //#endregion