@powerlines/plugin-env 0.15.122 → 0.15.124

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 (219) hide show
  1. package/dist/babel/plugin.cjs +11 -11
  2. package/dist/babel/plugin.d.cts +2 -2
  3. package/dist/babel/plugin.d.mts +2 -3
  4. package/dist/babel/plugin.mjs +5 -5
  5. package/dist/components/docs.cjs +6 -6
  6. package/dist/components/docs.d.cts +1 -1
  7. package/dist/components/docs.d.mts +1 -1
  8. package/dist/components/docs.mjs +3 -3
  9. package/dist/components/env.cjs +40 -40
  10. package/dist/components/env.d.cts +2 -2
  11. package/dist/components/env.d.mts +2 -2
  12. package/dist/components/env.mjs +11 -11
  13. package/dist/helpers/automd-generator.cjs +2 -2
  14. package/dist/helpers/automd-generator.d.cts +1 -1
  15. package/dist/helpers/automd-generator.d.mts +1 -1
  16. package/dist/helpers/automd-generator.mjs +1 -1
  17. package/dist/helpers/load.cjs +7 -7
  18. package/dist/helpers/load.mjs +8 -8
  19. package/dist/helpers/persistence.cjs +23 -23
  20. package/dist/helpers/persistence.d.cts +1 -1
  21. package/dist/helpers/persistence.d.mts +1 -1
  22. package/dist/helpers/persistence.mjs +5 -5
  23. package/dist/helpers/reflect.cjs +5 -5
  24. package/dist/helpers/reflect.mjs +1 -1
  25. package/dist/helpers/source-file-env.cjs +1 -1
  26. package/dist/helpers/source-file-env.mjs +1 -1
  27. package/dist/index.cjs +13 -10
  28. package/dist/index.d.cts +1 -1
  29. package/dist/index.d.mts +1 -1
  30. package/dist/index.mjs +12 -12
  31. package/dist/types/plugin.cjs +19 -18
  32. package/dist/types/plugin.d.cts +5 -6
  33. package/dist/types/plugin.d.mts +4 -6
  34. package/dist/types/plugin.mjs +4 -4
  35. package/package.json +7 -7
  36. package/dist/deepkit/schemas/reflection.cjs +0 -5426
  37. package/dist/deepkit/schemas/reflection.d.cts +0 -1560
  38. package/dist/deepkit/schemas/reflection.d.mts +0 -1560
  39. package/dist/deepkit/schemas/reflection.mjs +0 -5423
  40. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  41. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  42. package/dist/deepkit/src/capnp.cjs +0 -1692
  43. package/dist/deepkit/src/capnp.mjs +0 -1690
  44. package/dist/deepkit/src/esbuild-plugin.cjs +0 -99
  45. package/dist/deepkit/src/esbuild-plugin.mjs +0 -98
  46. package/dist/deepkit/src/reflect-type.cjs +0 -40
  47. package/dist/deepkit/src/reflect-type.mjs +0 -38
  48. package/dist/deepkit/src/resolve-reflections.cjs +0 -23
  49. package/dist/deepkit/src/resolve-reflections.mjs +0 -22
  50. package/dist/deepkit/src/transformer.cjs +0 -92
  51. package/dist/deepkit/src/transformer.mjs +0 -89
  52. package/dist/deepkit/src/transpile.cjs +0 -39
  53. package/dist/deepkit/src/transpile.mjs +0 -37
  54. package/dist/deepkit/src/types.cjs +0 -22
  55. package/dist/deepkit/src/types.d.cts +0 -10
  56. package/dist/deepkit/src/types.d.mts +0 -10
  57. package/dist/deepkit/src/types.mjs +0 -21
  58. package/dist/deepkit/src/utilities.cjs +0 -184
  59. package/dist/deepkit/src/utilities.mjs +0 -183
  60. package/dist/plugin-alloy/src/core/components/output.cjs +0 -43
  61. package/dist/plugin-alloy/src/core/components/output.mjs +0 -42
  62. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  63. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  64. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  65. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  66. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  67. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  68. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -134
  69. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -126
  70. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  71. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  72. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -110
  73. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -101
  74. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -23
  75. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -22
  76. package/dist/plugin-alloy/src/index.cjs +0 -105
  77. package/dist/plugin-alloy/src/index.mjs +0 -103
  78. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
  79. package/dist/plugin-alloy/src/markdown/components/markdown-file.d.cts +0 -8
  80. package/dist/plugin-alloy/src/markdown/components/markdown-file.d.mts +0 -8
  81. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
  82. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
  83. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
  84. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -72
  85. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -71
  86. package/dist/plugin-alloy/src/types/components.cjs +0 -22
  87. package/dist/plugin-alloy/src/types/components.d.cts +0 -20
  88. package/dist/plugin-alloy/src/types/components.d.mts +0 -21
  89. package/dist/plugin-alloy/src/types/components.mjs +0 -21
  90. package/dist/plugin-alloy/src/types/index.d.cts +0 -2
  91. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  92. package/dist/plugin-alloy/src/types/plugin.cjs +0 -53
  93. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
  94. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
  95. package/dist/plugin-alloy/src/types/plugin.mjs +0 -50
  96. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -62
  97. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -26
  98. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  99. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -61
  100. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -131
  101. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -129
  102. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -451
  103. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -37
  104. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -37
  105. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -442
  106. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -216
  107. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -16
  108. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -16
  109. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -213
  110. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -72
  111. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -12
  112. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
  113. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -71
  114. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  115. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  116. package/dist/plugin-automd/src/index.cjs +0 -127
  117. package/dist/plugin-automd/src/index.mjs +0 -124
  118. package/dist/plugin-automd/src/types/plugin.cjs +0 -47
  119. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  120. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  121. package/dist/plugin-automd/src/types/plugin.mjs +0 -47
  122. package/dist/plugin-automd/src/types/toc.cjs +0 -26
  123. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  124. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  125. package/dist/plugin-automd/src/types/toc.mjs +0 -25
  126. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -74
  127. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -70
  128. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -71
  129. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -69
  130. package/dist/plugin-babel/src/helpers/filters.cjs +0 -158
  131. package/dist/plugin-babel/src/helpers/filters.mjs +0 -154
  132. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  133. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  134. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -200
  135. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -192
  136. package/dist/plugin-babel/src/helpers/options.cjs +0 -73
  137. package/dist/plugin-babel/src/helpers/options.mjs +0 -70
  138. package/dist/plugin-babel/src/index.cjs +0 -125
  139. package/dist/plugin-babel/src/index.mjs +0 -123
  140. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  141. package/dist/plugin-babel/src/types/plugin.cjs +0 -42
  142. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  143. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  144. package/dist/plugin-babel/src/types/plugin.mjs +0 -39
  145. package/dist/powerlines/src/internal/helpers/hooks.cjs +0 -136
  146. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  147. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  148. package/dist/powerlines/src/internal/helpers/hooks.mjs +0 -134
  149. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -142
  150. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -140
  151. package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
  152. package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
  153. package/dist/powerlines/src/lib/entry.cjs +0 -195
  154. package/dist/powerlines/src/lib/entry.mjs +0 -194
  155. package/dist/powerlines/src/lib/logger.cjs +0 -108
  156. package/dist/powerlines/src/lib/logger.mjs +0 -106
  157. package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -41
  158. package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -40
  159. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -98
  160. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -97
  161. package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -139
  162. package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -138
  163. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -74
  164. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -72
  165. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -69
  166. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -68
  167. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -68
  168. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -66
  169. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -46
  170. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -45
  171. package/dist/powerlines/src/types/api.cjs +0 -62
  172. package/dist/powerlines/src/types/api.d.cts +0 -104
  173. package/dist/powerlines/src/types/api.d.mts +0 -104
  174. package/dist/powerlines/src/types/api.mjs +0 -62
  175. package/dist/powerlines/src/types/babel.cjs +0 -156
  176. package/dist/powerlines/src/types/babel.d.cts +0 -23
  177. package/dist/powerlines/src/types/babel.d.mts +0 -23
  178. package/dist/powerlines/src/types/babel.mjs +0 -147
  179. package/dist/powerlines/src/types/build.cjs +0 -127
  180. package/dist/powerlines/src/types/build.d.cts +0 -185
  181. package/dist/powerlines/src/types/build.d.mts +0 -185
  182. package/dist/powerlines/src/types/build.mjs +0 -121
  183. package/dist/powerlines/src/types/commands.cjs +0 -16
  184. package/dist/powerlines/src/types/commands.d.cts +0 -8
  185. package/dist/powerlines/src/types/commands.d.mts +0 -9
  186. package/dist/powerlines/src/types/commands.mjs +0 -15
  187. package/dist/powerlines/src/types/config.cjs +0 -420
  188. package/dist/powerlines/src/types/config.d.cts +0 -435
  189. package/dist/powerlines/src/types/config.d.mts +0 -436
  190. package/dist/powerlines/src/types/config.mjs +0 -397
  191. package/dist/powerlines/src/types/context.cjs +0 -388
  192. package/dist/powerlines/src/types/context.d.cts +0 -514
  193. package/dist/powerlines/src/types/context.d.mts +0 -514
  194. package/dist/powerlines/src/types/context.mjs +0 -371
  195. package/dist/powerlines/src/types/fs.cjs +0 -78
  196. package/dist/powerlines/src/types/fs.d.cts +0 -486
  197. package/dist/powerlines/src/types/fs.d.mts +0 -486
  198. package/dist/powerlines/src/types/fs.mjs +0 -75
  199. package/dist/powerlines/src/types/hooks.cjs +0 -71
  200. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  201. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  202. package/dist/powerlines/src/types/hooks.mjs +0 -68
  203. package/dist/powerlines/src/types/index.cjs +0 -11
  204. package/dist/powerlines/src/types/index.d.mts +0 -12
  205. package/dist/powerlines/src/types/index.mjs +0 -13
  206. package/dist/powerlines/src/types/plugin.cjs +0 -184
  207. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  208. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  209. package/dist/powerlines/src/types/plugin.mjs +0 -178
  210. package/dist/powerlines/src/types/resolved.cjs +0 -149
  211. package/dist/powerlines/src/types/resolved.d.cts +0 -94
  212. package/dist/powerlines/src/types/resolved.d.mts +0 -94
  213. package/dist/powerlines/src/types/resolved.mjs +0 -144
  214. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  215. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  216. package/dist/powerlines/src/types/unplugin.cjs +0 -64
  217. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  218. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
  219. package/dist/powerlines/src/types/unplugin.mjs +0 -62
@@ -1,127 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_toc = require('./types/toc.cjs');
3
- const require_plugin = require('./types/plugin.cjs');
4
- const require_plugin$1 = require('../../powerlines/src/types/plugin.cjs');
5
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
6
- let defu = require("defu");
7
- defu = require_rolldown_runtime.__toESM(defu);
8
- let __stryke_path_replace = require("@stryke/path/replace");
9
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
10
- let __stryke_path_append = require("@stryke/path/append");
11
- let __stryke_path_is_type = require("@stryke/path/is-type");
12
- let c12 = require("c12");
13
- let automd = require("automd");
14
- let __stryke_fs_is_file = require("@stryke/fs/is-file");
15
- let __stryke_fs_list_files = require("@stryke/fs/list-files");
16
- let markdown_toc = require("markdown-toc");
17
- markdown_toc = require_rolldown_runtime.__toESM(markdown_toc);
18
-
19
- //#region ../plugin-automd/src/index.ts
20
- function __assignType(fn, args) {
21
- fn.__type = args;
22
- return fn;
23
- }
24
- /**
25
- * AutoMD Plugin
26
- *
27
- * @remarks
28
- * A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
29
- *
30
- * @see https://automd.unjs.io/
31
- *
32
- * @param options - The plugin options.
33
- * @returns A Powerlines plugin instance.
34
- */
35
- const plugin = __assignType((options = {}) => {
36
- return {
37
- name: "automd",
38
- config: __assignType(async function config() {
39
- const config$1 = await (0, automd.loadConfig)((0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.projectRoot), options);
40
- if (!config$1.prefix || !Array.isArray(config$1.prefix)) config$1.prefix = (0, __stryke_convert_to_array.toArray)(config$1.prefix ?? []);
41
- if (!config$1.prefix.includes("automd")) config$1.prefix.push("automd");
42
- if (!config$1.prefix.includes("powerlines")) config$1.prefix.push("powerlines");
43
- return { automd: (0, defu.default)(config$1 ?? {}, {
44
- configFile: options.configFile,
45
- allowIssues: true,
46
- dir: this.config.projectRoot,
47
- watch: false,
48
- input: "README.md",
49
- toc: {
50
- maxDepth: 6,
51
- bullets: "-"
52
- }
53
- }) };
54
- }, ["config", "P\"/!"]),
55
- async configResolved() {
56
- 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);
57
- if (this.config.automd.configFile) {
58
- const { config } = await (c12.loadConfig.Ω = [["!"]], (0, c12.loadConfig)({
59
- cwd: this.config.automd.dir,
60
- configFile: this.config.automd.configFile,
61
- defaults: {
62
- ignore: [
63
- "**/node_modules",
64
- "**/dist",
65
- "**/.*"
66
- ],
67
- dir: this.config.automd.dir
68
- }
69
- }));
70
- this.config.automd = (0, automd.resolveConfig)((0, defu.default)(this.config.automd, {
71
- ...config,
72
- prefix: (0, __stryke_convert_to_array.toArray)(config.prefix ?? [])
73
- }));
74
- }
75
- this.config.automd.input = (await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.automd.input).map(__assignType(async (input) => {
76
- 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 });
77
- return (0, __stryke_path_is_type.isAbsolutePath)(input) ? input : (0, __stryke_path_append.appendPath)(input, this.config.projectRoot);
78
- }, [
79
- "input",
80
- "",
81
- "P\"2!\"/\""
82
- ])))).flat();
83
- 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);
84
- this.config.automd.generators ??= {};
85
- if (this.config.automd.toc !== false) this.config.automd.generators.toc ??= {
86
- name: "toc",
87
- generate: __assignType((ctx) => {
88
- const opts = this.config.automd.toc ?? {};
89
- return { contents: (0, markdown_toc.default)(ctx.block.md, {
90
- ...opts,
91
- maxdepth: opts.maxDepth,
92
- first1: opts.firstH1
93
- }).content };
94
- }, [
95
- "ctx",
96
- "",
97
- "P!2!!/\""
98
- ])
99
- };
100
- },
101
- async docs() {
102
- await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.automd.input).map(__assignType(async (input) => {
103
- const contents = await this.fs.read(input);
104
- if (contents) {
105
- const result = await (0, automd.transform)(contents, this.config.automd);
106
- 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.`);
107
- 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);
108
- }
109
- }, [
110
- "input",
111
- "",
112
- "P\"2!\"/\""
113
- ])));
114
- }
115
- };
116
- }, [
117
- () => require_plugin.__ΩAutoMDPluginOptions,
118
- "options",
119
- () => ({}),
120
- () => require_plugin$1.__ΩPlugin,
121
- "",
122
- "Pn!2\">#\"o$\"/%"
123
- ]);
124
- var src_default = plugin;
125
-
126
- //#endregion
127
- exports.default = src_default;
@@ -1,124 +0,0 @@
1
- import { __ΩTOCOptions } from "./types/toc.mjs";
2
- import { __ΩAutoMDPluginOptions } from "./types/plugin.mjs";
3
- import { __ΩPlugin } from "../../powerlines/src/types/plugin.mjs";
4
- import { joinPaths } from "@stryke/path/join-paths";
5
- import defu$1 from "defu";
6
- import { replacePath } from "@stryke/path/replace";
7
- import { toArray } from "@stryke/convert/to-array";
8
- import { appendPath } from "@stryke/path/append";
9
- import { isAbsolutePath } from "@stryke/path/is-type";
10
- import { loadConfig } from "c12";
11
- import { loadConfig as loadConfig$1, resolveConfig, transform } from "automd";
12
- import { isDirectory } from "@stryke/fs/is-file";
13
- import { listFiles } from "@stryke/fs/list-files";
14
- import toc from "markdown-toc";
15
-
16
- //#region ../plugin-automd/src/index.ts
17
- function __assignType(fn, args) {
18
- fn.__type = args;
19
- return fn;
20
- }
21
- /**
22
- * AutoMD Plugin
23
- *
24
- * @remarks
25
- * A Powerlines plugin to use the AutoMD markdown transformer during the prepare task.
26
- *
27
- * @see https://automd.unjs.io/
28
- *
29
- * @param options - The plugin options.
30
- * @returns A Powerlines plugin instance.
31
- */
32
- const plugin = __assignType((options = {}) => {
33
- return {
34
- name: "automd",
35
- config: __assignType(async function config() {
36
- const config$1 = await loadConfig$1(joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot), options);
37
- if (!config$1.prefix || !Array.isArray(config$1.prefix)) config$1.prefix = toArray(config$1.prefix ?? []);
38
- if (!config$1.prefix.includes("automd")) config$1.prefix.push("automd");
39
- if (!config$1.prefix.includes("powerlines")) config$1.prefix.push("powerlines");
40
- return { automd: defu$1(config$1 ?? {}, {
41
- configFile: options.configFile,
42
- allowIssues: true,
43
- dir: this.config.projectRoot,
44
- watch: false,
45
- input: "README.md",
46
- toc: {
47
- maxDepth: 6,
48
- bullets: "-"
49
- }
50
- }) };
51
- }, ["config", "P\"/!"]),
52
- async configResolved() {
53
- 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);
54
- if (this.config.automd.configFile) {
55
- const { config } = await (loadConfig.Ω = [["!"]], loadConfig({
56
- cwd: this.config.automd.dir,
57
- configFile: this.config.automd.configFile,
58
- defaults: {
59
- ignore: [
60
- "**/node_modules",
61
- "**/dist",
62
- "**/.*"
63
- ],
64
- dir: this.config.automd.dir
65
- }
66
- }));
67
- this.config.automd = resolveConfig(defu$1(this.config.automd, {
68
- ...config,
69
- prefix: toArray(config.prefix ?? [])
70
- }));
71
- }
72
- this.config.automd.input = (await Promise.all(toArray(this.config.automd.input).map(__assignType(async (input) => {
73
- if (input.includes("*")) return listFiles(isAbsolutePath(input) ? input : appendPath(input, this.config.projectRoot), { ignore: this.config.automd.ignore });
74
- return isAbsolutePath(input) ? input : appendPath(input, this.config.projectRoot);
75
- }, [
76
- "input",
77
- "",
78
- "P\"2!\"/\""
79
- ])))).flat();
80
- if (this.config.automd.output && !isAbsolutePath(this.config.automd.output)) this.config.automd.output = appendPath(this.config.automd.output, this.config.projectRoot);
81
- this.config.automd.generators ??= {};
82
- if (this.config.automd.toc !== false) this.config.automd.generators.toc ??= {
83
- name: "toc",
84
- generate: __assignType((ctx) => {
85
- const opts = this.config.automd.toc ?? {};
86
- return { contents: toc(ctx.block.md, {
87
- ...opts,
88
- maxdepth: opts.maxDepth,
89
- first1: opts.firstH1
90
- }).content };
91
- }, [
92
- "ctx",
93
- "",
94
- "P!2!!/\""
95
- ])
96
- };
97
- },
98
- async docs() {
99
- await Promise.all(toArray(this.config.automd.input).map(__assignType(async (input) => {
100
- const contents = await this.fs.read(input);
101
- if (contents) {
102
- const result = await transform(contents, this.config.automd);
103
- 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.`);
104
- 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);
105
- }
106
- }, [
107
- "input",
108
- "",
109
- "P\"2!\"/\""
110
- ])));
111
- }
112
- };
113
- }, [
114
- () => __ΩAutoMDPluginOptions,
115
- "options",
116
- () => ({}),
117
- () => __ΩPlugin,
118
- "",
119
- "Pn!2\">#\"o$\"/%"
120
- ]);
121
- var src_default = plugin;
122
-
123
- //#endregion
124
- export { src_default as default };
@@ -1,47 +0,0 @@
1
- const require_toc = require('./toc.cjs');
2
-
3
- //#region ../plugin-automd/src/types/plugin.ts
4
- const __ΩOmit = [
5
- "T",
6
- "K",
7
- () => __ΩPick,
8
- () => __ΩExclude,
9
- "Omit",
10
- "b!b\"e!!e!!ge!\"o$#o##w%y"
11
- ];
12
- const __ΩPick = [
13
- "T",
14
- "K",
15
- "Pick",
16
- "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
17
- ];
18
- const __ΩExclude = [
19
- "T",
20
- "U",
21
- "Exclude",
22
- "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
23
- ];
24
- const __ΩAutoMDPluginOptions = [
25
- () => __ΩOmit,
26
- "dir",
27
- "watch",
28
- "onWatch",
29
- "prefix",
30
- "configFile",
31
- "Path to the AutoMD configuration file.",
32
- "allowIssues",
33
- true,
34
- "An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.",
35
- "prefix",
36
- "[\"automd\", \"powerlines\", \"\\{framework\\}\"]",
37
- "Alternate prefix strings to use for finding generators",
38
- false,
39
- () => require_toc.__ΩTOCOptions,
40
- "toc",
41
- "Table of Contents generator options",
42
- "AutoMDPluginOptions",
43
- "P!P.\".#.$.%Jo!#P&4&8?')4(8>)?*P&&FJ4+8>,?-P..n/J408?1MKw2y"
44
- ];
45
-
46
- //#endregion
47
- exports.__ΩAutoMDPluginOptions = __ΩAutoMDPluginOptions;
@@ -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,47 +0,0 @@
1
- import { __ΩTOCOptions } from "./toc.mjs";
2
-
3
- //#region ../plugin-automd/src/types/plugin.ts
4
- const __ΩOmit = [
5
- "T",
6
- "K",
7
- () => __ΩPick,
8
- () => __ΩExclude,
9
- "Omit",
10
- "b!b\"e!!e!!ge!\"o$#o##w%y"
11
- ];
12
- const __ΩPick = [
13
- "T",
14
- "K",
15
- "Pick",
16
- "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
17
- ];
18
- const __ΩExclude = [
19
- "T",
20
- "U",
21
- "Exclude",
22
- "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
23
- ];
24
- const __ΩAutoMDPluginOptions = [
25
- () => __ΩOmit,
26
- "dir",
27
- "watch",
28
- "onWatch",
29
- "prefix",
30
- "configFile",
31
- "Path to the AutoMD configuration file.",
32
- "allowIssues",
33
- true,
34
- "An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.",
35
- "prefix",
36
- "[\"automd\", \"powerlines\", \"\\{framework\\}\"]",
37
- "Alternate prefix strings to use for finding generators",
38
- false,
39
- () => __ΩTOCOptions,
40
- "toc",
41
- "Table of Contents generator options",
42
- "AutoMDPluginOptions",
43
- "P!P.\".#.$.%Jo!#P&4&8?')4(8>)?*P&&FJ4+8>,?-P..n/J408?1MKw2y"
44
- ];
45
-
46
- //#endregion
47
- export { __ΩAutoMDPluginOptions };
@@ -1,26 +0,0 @@
1
-
2
- //#region ../plugin-automd/src/types/toc.ts
3
- const __ΩTOCOptions = [
4
- "str",
5
- "",
6
- "slugify",
7
- "A slugify function to generate slugs for the headings.",
8
- "maxDepth",
9
- 6,
10
- "The maximum depth of headings to include in the TOC.",
11
- "firstH1",
12
- "Whether to include the first H1 heading in the TOC.",
13
- "bullets",
14
- "-",
15
- "The bullet character to use for list items in the TOC.",
16
- "prefix",
17
- "A prefix to add to each heading in the TOC.",
18
- "level",
19
- "filter",
20
- "A filter function to determine which headings to include in the TOC.",
21
- "TOCOptions",
22
- "PP&2!&/\"4#8?$'4%8>&?')4(8?)&4*8>+?,&4-8?.P&2!'2/)/\"408?1Mw2y"
23
- ];
24
-
25
- //#endregion
26
- exports.__ΩTOCOptions = __Ω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,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,25 +0,0 @@
1
- //#region ../plugin-automd/src/types/toc.ts
2
- const __ΩTOCOptions = [
3
- "str",
4
- "",
5
- "slugify",
6
- "A slugify function to generate slugs for the headings.",
7
- "maxDepth",
8
- 6,
9
- "The maximum depth of headings to include in the TOC.",
10
- "firstH1",
11
- "Whether to include the first H1 heading in the TOC.",
12
- "bullets",
13
- "-",
14
- "The bullet character to use for list items in the TOC.",
15
- "prefix",
16
- "A prefix to add to each heading in the TOC.",
17
- "level",
18
- "filter",
19
- "A filter function to determine which headings to include in the TOC.",
20
- "TOCOptions",
21
- "PP&2!&/\"4#8?$'4%8>&?')4(8?)&4*8>+?,&4-8?.P&2!'2/)/\"408?1Mw2y"
22
- ];
23
-
24
- //#endregion
25
- export { __ΩTOCOptions };
@@ -1,74 +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
- let __babel_parser = require("@babel/parser");
5
-
6
- //#region ../plugin-babel/src/helpers/ast-utils.ts
7
- const __ΩRequired = [
8
- "T",
9
- "Required",
10
- "l+e#!e\"!fRb!Pde\"!gN##w\"y"
11
- ];
12
- const __ΩPick = [
13
- "T",
14
- "K",
15
- "Pick",
16
- "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
17
- ];
18
- /**
19
- * Parse the given code into an AST.
20
- *
21
- * @param code - The code to parse.
22
- * @param opts - The options for parsing.
23
- * @returns The parsed AST.
24
- */
25
- function parseAst(code, opts = {}) {
26
- return (0, __babel_parser.parse)(code, {
27
- plugins: ["typescript"],
28
- sourceType: "module",
29
- allowImportExportEverywhere: true,
30
- allowAwaitOutsideFunction: true,
31
- ...opts
32
- });
33
- }
34
- parseAst.__type = [
35
- "code",
36
- "ParserOptions",
37
- "opts",
38
- () => ({}),
39
- "ParseResult",
40
- "parseAst",
41
- "Parse the given code into an AST.",
42
- "P&2!\"w\"2#>$\"w%/&?'"
43
- ];
44
- let generate = __babel_generator.default;
45
- if ("default" in generate) generate = generate.default;
46
- const __ΩGenerateFromAstOptions = [
47
- "GeneratorOptions",
48
- () => __ΩRequired,
49
- () => __ΩPick,
50
- "sourceFileName",
51
- "filename",
52
- "GenerateFromAstOptions",
53
- "P\"w!\"w!P.$.%Jo##o\"\"Kw&y"
54
- ];
55
- function generateFromAst(ast, opts) {
56
- return generate(ast, opts ? {
57
- importAttributesKeyword: "with",
58
- sourceMaps: true,
59
- ...opts
60
- } : void 0);
61
- }
62
- generateFromAst.__type = [
63
- "ast",
64
- () => __ΩGenerateFromAstOptions,
65
- "opts",
66
- "GeneratorResult",
67
- "generateFromAst",
68
- "P!2!n\"2#8\"w$/%"
69
- ];
70
-
71
- //#endregion
72
- exports.__ΩGenerateFromAstOptions = __ΩGenerateFromAstOptions;
73
- exports.generateFromAst = generateFromAst;
74
- exports.parseAst = parseAst;