@bemedev/dev-utils 1.1.0 → 1.2.0

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 (265) hide show
  1. package/README.md +34 -0
  2. package/lib/_virtual/_rolldown/runtime.cjs +1 -1
  3. package/lib/build-tests/addTarball.cjs +5 -1
  4. package/lib/build-tests/addTarball.cjs.map +1 -1
  5. package/lib/build-tests/addTarball.d.ts +3 -0
  6. package/lib/build-tests/addTarball.js +5 -1
  7. package/lib/build-tests/addTarball.js.map +1 -1
  8. package/lib/build-tests/buildPackageJson.cjs +17 -9
  9. package/lib/build-tests/buildPackageJson.cjs.map +1 -1
  10. package/lib/build-tests/buildPackageJson.d.ts +5 -0
  11. package/lib/build-tests/buildPackageJson.js +17 -9
  12. package/lib/build-tests/buildPackageJson.js.map +1 -1
  13. package/lib/build-tests/cleanup.cjs +3 -0
  14. package/lib/build-tests/cleanup.cjs.map +1 -1
  15. package/lib/build-tests/cleanup.d.ts +3 -0
  16. package/lib/build-tests/cleanup.js +3 -0
  17. package/lib/build-tests/cleanup.js.map +1 -1
  18. package/lib/build-tests/cli/cli.cjs +6 -0
  19. package/lib/build-tests/cli/cli.cjs.map +1 -1
  20. package/lib/build-tests/cli/cli.d.ts +6 -0
  21. package/lib/build-tests/cli/cli.js +6 -0
  22. package/lib/build-tests/cli/cli.js.map +1 -1
  23. package/lib/build-tests/cli/index.cjs.map +1 -1
  24. package/lib/build-tests/cli/post.cjs +3 -0
  25. package/lib/build-tests/cli/post.cjs.map +1 -1
  26. package/lib/build-tests/cli/post.d.ts +3 -0
  27. package/lib/build-tests/cli/post.js +3 -0
  28. package/lib/build-tests/cli/post.js.map +1 -1
  29. package/lib/build-tests/cli/pre.cjs +3 -0
  30. package/lib/build-tests/cli/pre.cjs.map +1 -1
  31. package/lib/build-tests/cli/pre.d.ts +3 -0
  32. package/lib/build-tests/cli/pre.js +3 -0
  33. package/lib/build-tests/cli/pre.js.map +1 -1
  34. package/lib/build-tests/cli/test.cjs +3 -0
  35. package/lib/build-tests/cli/test.cjs.map +1 -1
  36. package/lib/build-tests/cli/test.d.ts +3 -0
  37. package/lib/build-tests/cli/test.js +3 -0
  38. package/lib/build-tests/cli/test.js.map +1 -1
  39. package/lib/build-tests/constants.cjs +42 -0
  40. package/lib/build-tests/constants.cjs.map +1 -1
  41. package/lib/build-tests/constants.d.ts +42 -0
  42. package/lib/build-tests/constants.js +42 -0
  43. package/lib/build-tests/constants.js.map +1 -1
  44. package/lib/build-tests/getRelativePath.cjs +7 -0
  45. package/lib/build-tests/getRelativePath.cjs.map +1 -1
  46. package/lib/build-tests/getRelativePath.d.ts +7 -0
  47. package/lib/build-tests/getRelativePath.js +7 -0
  48. package/lib/build-tests/getRelativePath.js.map +1 -1
  49. package/lib/build-tests/getTypescriptOutdir.cjs +5 -0
  50. package/lib/build-tests/getTypescriptOutdir.cjs.map +1 -1
  51. package/lib/build-tests/getTypescriptOutdir.d.ts +5 -0
  52. package/lib/build-tests/getTypescriptOutdir.js +5 -0
  53. package/lib/build-tests/getTypescriptOutdir.js.map +1 -1
  54. package/lib/build-tests/import.cjs +9 -0
  55. package/lib/build-tests/import.cjs.map +1 -1
  56. package/lib/build-tests/import.d.ts +9 -0
  57. package/lib/build-tests/import.js +9 -0
  58. package/lib/build-tests/import.js.map +1 -1
  59. package/lib/build-tests/imports/create.cjs +7 -0
  60. package/lib/build-tests/imports/create.cjs.map +1 -1
  61. package/lib/build-tests/imports/create.d.ts +13 -0
  62. package/lib/build-tests/imports/create.js +7 -0
  63. package/lib/build-tests/imports/create.js.map +1 -1
  64. package/lib/build-tests/imports/helper.cjs +9 -0
  65. package/lib/build-tests/imports/helper.cjs.map +1 -1
  66. package/lib/build-tests/imports/helper.d.ts +12 -0
  67. package/lib/build-tests/imports/helper.js +9 -0
  68. package/lib/build-tests/imports/helper.js.map +1 -1
  69. package/lib/build-tests/pack.cjs +7 -1
  70. package/lib/build-tests/pack.cjs.map +1 -1
  71. package/lib/build-tests/pack.d.ts +5 -0
  72. package/lib/build-tests/pack.js +7 -1
  73. package/lib/build-tests/pack.js.map +1 -1
  74. package/lib/plugins/index.cjs +3 -0
  75. package/lib/plugins/index.d.ts +1 -0
  76. package/lib/plugins/index.js +2 -0
  77. package/lib/plugins/suppressWarnings.cjs +37 -0
  78. package/lib/plugins/suppressWarnings.cjs.map +1 -0
  79. package/lib/plugins/suppressWarnings.d.ts +12 -0
  80. package/lib/plugins/suppressWarnings.js +36 -0
  81. package/lib/plugins/suppressWarnings.js.map +1 -0
  82. package/lib/rolldown-config/config.cjs +13 -5
  83. package/lib/rolldown-config/config.cjs.map +1 -1
  84. package/lib/rolldown-config/config.d.ts +7 -0
  85. package/lib/rolldown-config/config.js +13 -5
  86. package/lib/rolldown-config/config.js.map +1 -1
  87. package/lib/rolldown-config/constants.cjs +15 -0
  88. package/lib/rolldown-config/constants.cjs.map +1 -1
  89. package/lib/rolldown-config/constants.d.ts +15 -0
  90. package/lib/rolldown-config/constants.js +15 -0
  91. package/lib/rolldown-config/constants.js.map +1 -1
  92. package/lib/rolldown-config/helpers.cjs +16 -1
  93. package/lib/rolldown-config/helpers.cjs.map +1 -1
  94. package/lib/rolldown-config/helpers.d.ts +14 -0
  95. package/lib/rolldown-config/helpers.js +16 -1
  96. package/lib/rolldown-config/helpers.js.map +1 -1
  97. package/lib/rolldown-config/input.cjs +8 -0
  98. package/lib/rolldown-config/input.cjs.map +1 -1
  99. package/lib/rolldown-config/input.d.ts +8 -0
  100. package/lib/rolldown-config/input.js +8 -0
  101. package/lib/rolldown-config/input.js.map +1 -1
  102. package/lib/rolldown-config/output.cjs +8 -0
  103. package/lib/rolldown-config/output.cjs.map +1 -1
  104. package/lib/rolldown-config/output.d.ts +8 -0
  105. package/lib/rolldown-config/output.js +8 -0
  106. package/lib/rolldown-config/output.js.map +1 -1
  107. package/lib/rolldown-config/plugins/circulars.cjs +4 -4
  108. package/lib/rolldown-config/plugins/circulars.cjs.map +1 -1
  109. package/lib/rolldown-config/plugins/circulars.d.ts +7 -4
  110. package/lib/rolldown-config/plugins/circulars.js +4 -4
  111. package/lib/rolldown-config/plugins/circulars.js.map +1 -1
  112. package/lib/rolldown-config/plugins/clean.cjs +10 -1
  113. package/lib/rolldown-config/plugins/clean.cjs.map +1 -1
  114. package/lib/rolldown-config/plugins/clean.d.ts +10 -0
  115. package/lib/rolldown-config/plugins/clean.js +10 -1
  116. package/lib/rolldown-config/plugins/clean.js.map +1 -1
  117. package/lib/rolldown-config/plugins/externals.cjs +4 -3
  118. package/lib/rolldown-config/plugins/externals.cjs.map +1 -1
  119. package/lib/rolldown-config/plugins/externals.d.ts +7 -3
  120. package/lib/rolldown-config/plugins/externals.js +4 -3
  121. package/lib/rolldown-config/plugins/externals.js.map +1 -1
  122. package/lib/rolldown-config/plugins/index.cjs +6 -0
  123. package/lib/rolldown-config/plugins/index.cjs.map +1 -1
  124. package/lib/rolldown-config/plugins/index.d.ts +6 -0
  125. package/lib/rolldown-config/plugins/index.js +6 -0
  126. package/lib/rolldown-config/plugins/index.js.map +1 -1
  127. package/lib/rolldown-config/plugins/typescript.cjs +7 -0
  128. package/lib/rolldown-config/plugins/typescript.cjs.map +1 -1
  129. package/lib/rolldown-config/plugins/typescript.config.cjs +15 -0
  130. package/lib/rolldown-config/plugins/typescript.config.cjs.map +1 -1
  131. package/lib/rolldown-config/plugins/typescript.config.d.ts +15 -0
  132. package/lib/rolldown-config/plugins/typescript.config.js +15 -0
  133. package/lib/rolldown-config/plugins/typescript.config.js.map +1 -1
  134. package/lib/rolldown-config/plugins/typescript.d.ts +10 -0
  135. package/lib/rolldown-config/plugins/typescript.fast.cjs +9 -1
  136. package/lib/rolldown-config/plugins/typescript.fast.cjs.map +1 -1
  137. package/lib/rolldown-config/plugins/typescript.fast.d.ts +10 -0
  138. package/lib/rolldown-config/plugins/typescript.fast.js +9 -1
  139. package/lib/rolldown-config/plugins/typescript.fast.js.map +1 -1
  140. package/lib/rolldown-config/plugins/typescript.js +7 -0
  141. package/lib/rolldown-config/plugins/typescript.js.map +1 -1
  142. package/lib/rolldown-config/types.d.ts +18 -0
  143. package/lib/utils/array.cjs +7 -0
  144. package/lib/utils/array.cjs.map +1 -1
  145. package/lib/utils/array.d.ts +8 -0
  146. package/lib/utils/array.js +7 -0
  147. package/lib/utils/array.js.map +1 -1
  148. package/lib/utils/bemedev/globals/types.d.ts +20 -0
  149. package/lib/utils/bemedev/globals/utils/expandFn.cjs +11 -0
  150. package/lib/utils/bemedev/globals/utils/expandFn.cjs.map +1 -1
  151. package/lib/utils/bemedev/globals/utils/expandFn.d.ts +11 -0
  152. package/lib/utils/bemedev/globals/utils/expandFn.js +11 -0
  153. package/lib/utils/bemedev/globals/utils/expandFn.js.map +1 -1
  154. package/lib/utils/identity.cjs +9 -0
  155. package/lib/utils/identity.cjs.map +1 -1
  156. package/lib/utils/identity.d.ts +9 -0
  157. package/lib/utils/identity.js +9 -0
  158. package/lib/utils/identity.js.map +1 -1
  159. package/lib/utils/sleep.cjs +7 -0
  160. package/lib/utils/sleep.cjs.map +1 -1
  161. package/lib/utils/sleep.d.ts +7 -0
  162. package/lib/utils/sleep.js +7 -0
  163. package/lib/utils/sleep.js.map +1 -1
  164. package/lib/utils/types.d.ts +9 -0
  165. package/lib/vitest-exclude/constants.cjs +3 -0
  166. package/lib/vitest-exclude/constants.cjs.map +1 -1
  167. package/lib/vitest-exclude/constants.d.ts +3 -0
  168. package/lib/vitest-exclude/constants.js +3 -0
  169. package/lib/vitest-exclude/constants.js.map +1 -1
  170. package/lib/vitest-exclude/types.d.ts +11 -0
  171. package/lib/vitest-exclude/vitest.cjs +25 -12
  172. package/lib/vitest-exclude/vitest.cjs.map +1 -1
  173. package/lib/vitest-exclude/vitest.d.ts +9 -8
  174. package/lib/vitest-exclude/vitest.js +25 -12
  175. package/lib/vitest-exclude/vitest.js.map +1 -1
  176. package/lib/vitest-exclude/vitest.utils.cjs +30 -0
  177. package/lib/vitest-exclude/vitest.utils.cjs.map +1 -1
  178. package/lib/vitest-exclude/vitest.utils.d.ts +30 -0
  179. package/lib/vitest-exclude/vitest.utils.js +30 -0
  180. package/lib/vitest-exclude/vitest.utils.js.map +1 -1
  181. package/lib/vitest-extended/acceptation.cjs +11 -2
  182. package/lib/vitest-extended/acceptation.cjs.map +1 -1
  183. package/lib/vitest-extended/acceptation.d.ts +9 -1
  184. package/lib/vitest-extended/acceptation.js +11 -2
  185. package/lib/vitest-extended/acceptation.js.map +1 -1
  186. package/lib/vitest-extended/createTests.cjs +34 -27
  187. package/lib/vitest-extended/createTests.cjs.map +1 -1
  188. package/lib/vitest-extended/createTests.d.ts +20 -37
  189. package/lib/vitest-extended/createTests.js +34 -27
  190. package/lib/vitest-extended/createTests.js.map +1 -1
  191. package/lib/vitest-extended/createTests.types.d.ts +13 -2
  192. package/lib/vitest-extended/done.cjs +18 -15
  193. package/lib/vitest-extended/done.cjs.map +1 -1
  194. package/lib/vitest-extended/done.d.ts +6 -5
  195. package/lib/vitest-extended/done.js +18 -15
  196. package/lib/vitest-extended/done.js.map +1 -1
  197. package/lib/vitest-extended/each/error.cjs +12 -0
  198. package/lib/vitest-extended/each/error.cjs.map +1 -1
  199. package/lib/vitest-extended/each/error.d.ts +12 -0
  200. package/lib/vitest-extended/each/error.js +12 -0
  201. package/lib/vitest-extended/each/error.js.map +1 -1
  202. package/lib/vitest-extended/each/error.types.d.ts +17 -0
  203. package/lib/vitest-extended/each/pass.cjs +9 -20
  204. package/lib/vitest-extended/each/pass.cjs.map +1 -1
  205. package/lib/vitest-extended/each/pass.d.ts +9 -20
  206. package/lib/vitest-extended/each/pass.js +9 -20
  207. package/lib/vitest-extended/each/pass.js.map +1 -1
  208. package/lib/vitest-extended/each/pass.types.d.ts +24 -0
  209. package/lib/vitest-extended/fakeWaiter.cjs +7 -0
  210. package/lib/vitest-extended/fakeWaiter.cjs.map +1 -1
  211. package/lib/vitest-extended/fakeWaiter.d.ts +32 -0
  212. package/lib/vitest-extended/fakeWaiter.js +7 -0
  213. package/lib/vitest-extended/fakeWaiter.js.map +1 -1
  214. package/lib/vitest-extended/fixtures/coverage.cjs +11 -0
  215. package/lib/vitest-extended/fixtures/coverage.cjs.map +1 -1
  216. package/lib/vitest-extended/fixtures/coverage.js +11 -0
  217. package/lib/vitest-extended/fixtures/coverage.js.map +1 -1
  218. package/lib/vitest-extended/fixtures/partialCall.cjs +9 -4
  219. package/lib/vitest-extended/fixtures/partialCall.cjs.map +1 -1
  220. package/lib/vitest-extended/fixtures/partialCall.js +9 -4
  221. package/lib/vitest-extended/fixtures/partialCall.js.map +1 -1
  222. package/lib/vitest-extended/fixtures/toUpper.cjs +18 -0
  223. package/lib/vitest-extended/fixtures/toUpper.cjs.map +1 -1
  224. package/lib/vitest-extended/fixtures/toUpper.js +18 -0
  225. package/lib/vitest-extended/fixtures/toUpper.js.map +1 -1
  226. package/lib/vitest-extended/fixtures/vitest.cjs +3 -0
  227. package/lib/vitest-extended/fixtures/vitest.cjs.map +1 -1
  228. package/lib/vitest-extended/fixtures/vitest.js +3 -0
  229. package/lib/vitest-extended/fixtures/vitest.js.map +1 -1
  230. package/lib/vitest-extended/fixtures/zod.cjs +22 -0
  231. package/lib/vitest-extended/fixtures/zod.cjs.map +1 -1
  232. package/lib/vitest-extended/fixtures/zod.js +22 -0
  233. package/lib/vitest-extended/fixtures/zod.js.map +1 -1
  234. package/lib/vitest-extended/identity.cjs +18 -0
  235. package/lib/vitest-extended/identity.cjs.map +1 -1
  236. package/lib/vitest-extended/identity.d.ts +18 -0
  237. package/lib/vitest-extended/identity.js +18 -0
  238. package/lib/vitest-extended/identity.js.map +1 -1
  239. package/lib/vitest-extended/isDefined.cjs +9 -0
  240. package/lib/vitest-extended/isDefined.cjs.map +1 -1
  241. package/lib/vitest-extended/isDefined.d.ts +9 -0
  242. package/lib/vitest-extended/isDefined.js +9 -0
  243. package/lib/vitest-extended/isDefined.js.map +1 -1
  244. package/lib/vitest-extended/isFunction.cjs +7 -0
  245. package/lib/vitest-extended/isFunction.cjs.map +1 -1
  246. package/lib/vitest-extended/isFunction.d.ts +7 -0
  247. package/lib/vitest-extended/isFunction.js +7 -0
  248. package/lib/vitest-extended/isFunction.js.map +1 -1
  249. package/lib/vitest-extended/project.cjs +7 -0
  250. package/lib/vitest-extended/project.cjs.map +1 -1
  251. package/lib/vitest-extended/project.d.ts +7 -0
  252. package/lib/vitest-extended/project.js +7 -0
  253. package/lib/vitest-extended/project.js.map +1 -1
  254. package/lib/vitest-extended/toArray.cjs +6 -0
  255. package/lib/vitest-extended/toArray.cjs.map +1 -1
  256. package/lib/vitest-extended/toArray.d.ts +6 -0
  257. package/lib/vitest-extended/toArray.js +6 -0
  258. package/lib/vitest-extended/toArray.js.map +1 -1
  259. package/lib/vitest-extended/toStringFlat.cjs +8 -0
  260. package/lib/vitest-extended/toStringFlat.cjs.map +1 -1
  261. package/lib/vitest-extended/toStringFlat.d.ts +8 -0
  262. package/lib/vitest-extended/toStringFlat.js +8 -0
  263. package/lib/vitest-extended/toStringFlat.js.map +1 -1
  264. package/lib/vitest-extended/types.d.ts +64 -0
  265. package/package.json +14 -9
@@ -0,0 +1,36 @@
1
+ //#region src/plugins/suppressWarnings.ts
2
+ /**
3
+ * Vite plugin to filter out noisy terminal stdout/stderr warnings emitted
4
+ * by Nitro, SSR workers, or third-party dependencies during dev.
5
+ *
6
+ * @param patterns - Array of type {@linkcode string} or type
7
+ * {@linkcode RegExp} patterns to match against `stderr` chunks to
8
+ * suppress.
9
+ *
10
+ * @returns A Vite plugin object of type {@linkcode Plugin}.
11
+ */
12
+ function suppressWarnings(...patterns) {
13
+ let isInitialized = false;
14
+ const shouldSuppress = (chunk) => {
15
+ const str = typeof chunk === "string" ? chunk : chunk?.toString?.() || "";
16
+ return patterns.some((pattern) => typeof pattern === "string" ? str.includes(pattern) : pattern.test(str));
17
+ };
18
+ const initFilter = () => {
19
+ if (isInitialized) return;
20
+ isInitialized = true;
21
+ const origStderrWrite = process.stderr.write.bind(process.stderr);
22
+ process.stderr.write = ((chunk, ...args) => {
23
+ if (shouldSuppress(chunk)) return true;
24
+ return origStderrWrite(chunk, ...args);
25
+ });
26
+ };
27
+ initFilter();
28
+ return {
29
+ name: "suppress-logs-plugin",
30
+ apply: "serve"
31
+ };
32
+ }
33
+ //#endregion
34
+ export { suppressWarnings };
35
+
36
+ //# sourceMappingURL=suppressWarnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suppressWarnings.js","names":[],"sources":["../../src/plugins/suppressWarnings.ts"],"sourcesContent":["import { type Plugin } from 'vitest/config';\n\n/**\n * Vite plugin to filter out noisy terminal stdout/stderr warnings emitted\n * by Nitro, SSR workers, or third-party dependencies during dev.\n *\n * @param patterns - Array of type {@linkcode string} or type\n * {@linkcode RegExp} patterns to match against `stderr` chunks to\n * suppress.\n *\n * @returns A Vite plugin object of type {@linkcode Plugin}.\n */\nexport function suppressWarnings(\n ...patterns: Array<string | RegExp>\n): Plugin {\n let isInitialized = false;\n\n const shouldSuppress = (chunk: unknown): boolean => {\n const str =\n typeof chunk === 'string'\n ? chunk\n : (chunk as any)?.toString?.() || '';\n return patterns.some(pattern =>\n typeof pattern === 'string'\n ? str.includes(pattern)\n : pattern.test(str),\n );\n };\n\n const initFilter = () => {\n if (isInitialized) return;\n isInitialized = true;\n\n const origStderrWrite = process.stderr.write.bind(process.stderr);\n process.stderr.write = ((chunk: any, ...args: any[]) => {\n if (shouldSuppress(chunk)) return true;\n return (origStderrWrite as any)(chunk, ...args);\n }) as any;\n };\n\n // Initialize immediately on plugin registration\n initFilter();\n\n return {\n name: 'suppress-logs-plugin',\n apply: 'serve', // Runs only during dev\n };\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,iBACd,GAAG,UACK;CACR,IAAI,gBAAgB;CAEpB,MAAM,kBAAkB,UAA4B;EAClD,MAAM,MACJ,OAAO,UAAU,WACb,QACC,OAAe,WAAW,KAAK;EACtC,OAAO,SAAS,MAAK,YACnB,OAAO,YAAY,WACf,IAAI,SAAS,OAAO,IACpB,QAAQ,KAAK,GAAG,CACtB;CACF;CAEA,MAAM,mBAAmB;EACvB,IAAI,eAAe;EACnB,gBAAgB;EAEhB,MAAM,kBAAkB,QAAQ,OAAO,MAAM,KAAK,QAAQ,MAAM;EAChE,QAAQ,OAAO,UAAU,OAAY,GAAG,SAAgB;GACtD,IAAI,eAAe,KAAK,GAAG,OAAO;GAClC,OAAQ,gBAAwB,OAAO,GAAG,IAAI;EAChD;CACF;CAGA,WAAW;CAEX,OAAO;EACL,MAAM;EACN,OAAO;CACT;AACF"}
@@ -7,6 +7,13 @@ const require_rolldown_config_plugins_index = require("./plugins/index.cjs");
7
7
  let rolldown = require("rolldown");
8
8
  let rolldown_plugins = require("rolldown/plugins");
9
9
  //#region src/rolldown-config/config.ts
10
+ /**
11
+ * Generates Rolldown configuration using default or customized options.
12
+ *
13
+ * @param additionals - Optional build configuration parameters of type {@linkcode Params}.
14
+ *
15
+ * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.
16
+ */
10
17
  const defineConfig = (additionals) => {
11
18
  return defineConfig.default(additionals);
12
19
  };
@@ -57,13 +64,14 @@ defineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {
57
64
  const input = require_rolldown_config_input.buildInput();
58
65
  const external = rest.externals;
59
66
  const output = require_rolldown_config_output.buildOutput(dir, sourcemap);
67
+ const plugins = producePlugins({
68
+ dir,
69
+ sourcemap,
70
+ ...rest
71
+ });
60
72
  return (0, rolldown.defineConfig)({
61
73
  input,
62
- plugins: producePlugins({
63
- dir,
64
- sourcemap,
65
- ...rest
66
- }),
74
+ plugins,
67
75
  external,
68
76
  output,
69
77
  platform: "node"
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","esmExternalRequirePlugin","buildOutput","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({\n include,\n exclude,\n declarationMap,\n dir,\n });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({\n input,\n plugins,\n external,\n output,\n platform: 'node',\n });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;;AAWA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAUA,8BAAAA,WAAW,GAAGC,oBAAAA,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAUC,kCAAAA,gBAAgB,OAAOD,oBAAAA,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACEE,sCAAAA,gBAAgB,WAAW;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,iBAAiBA,sCAAAA,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACEA,sCAAAA,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAaA,sCAAAA,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAOA,sCAAAA,gBAAgB,KAAK;IAC1B;IACA;IACA;IACA;GACF,CAAC;EACH;EACA,KAAKC,iBAAAA;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQJ,8BAAAA,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAASK,+BAAAA,YAAY,KAAK,SAAS;CAIzC,QAAA,GAAA,SAAA,aAAA,CAAqB;EACnB;EACA,SAJc,eAAe;GAAE;GAAK;GAAW,GAAG;EAAK,CAIjD;EACN;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAeC,kCAAAA,sBAAsB,OACzCL,oBAAAA,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAYA,oBAAAA,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChDK,kCAAAA,qBACF;CAEA,MAAM,aAAaJ,kCAAAA,gBAAgB,OACjCD,oBAAAA,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","esmExternalRequirePlugin","buildOutput","_defineConfig","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\n/**\n * Generates Rolldown configuration using default or customized options.\n *\n * @param additionals - Optional build configuration parameters of type {@linkcode Params}.\n *\n * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.\n */\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({\n include,\n exclude,\n declarationMap,\n dir,\n });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({\n input,\n plugins,\n external,\n output,\n platform: 'node',\n });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAUA,8BAAAA,WAAW,GAAGC,oBAAAA,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAUC,kCAAAA,gBAAgB,OAAOD,oBAAAA,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACEE,sCAAAA,gBAAgB,WAAW;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,iBAAiBA,sCAAAA,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACEA,sCAAAA,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAaA,sCAAAA,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAOA,sCAAAA,gBAAgB,KAAK;IAC1B;IACA;IACA;IACA;GACF,CAAC;EACH;EACA,KAAKC,iBAAAA;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQJ,8BAAAA,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAASK,+BAAAA,YAAY,KAAK,SAAS;CAEzC,MAAM,UAAU,eAAe;EAAE;EAAK;EAAW,GAAG;CAAK,CAAC;CAE1D,QAAA,GAAOC,SAAAA,aAAAA,CAAc;EACnB;EACA;EACA;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAeC,kCAAAA,sBAAsB,OACzCN,oBAAAA,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAYA,oBAAAA,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChDM,kCAAAA,qBACF;CAEA,MAAM,aAAaL,kCAAAA,gBAAgB,OACjCD,oBAAAA,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
@@ -1,2 +1,9 @@
1
1
  import type { Config_F } from './types';
2
+ /**
3
+ * Generates Rolldown configuration using default or customized options.
4
+ *
5
+ * @param additionals - Optional build configuration parameters of type {@linkcode Params}.
6
+ *
7
+ * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.
8
+ */
2
9
  export declare const defineConfig: Config_F;
@@ -6,6 +6,13 @@ import { PLUGIN_BUILDERS } from "./plugins/index.js";
6
6
  import { defineConfig as defineConfig$1 } from "rolldown";
7
7
  import { esmExternalRequirePlugin } from "rolldown/plugins";
8
8
  //#region src/rolldown-config/config.ts
9
+ /**
10
+ * Generates Rolldown configuration using default or customized options.
11
+ *
12
+ * @param additionals - Optional build configuration parameters of type {@linkcode Params}.
13
+ *
14
+ * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.
15
+ */
9
16
  const defineConfig = (additionals) => {
10
17
  return defineConfig.default(additionals);
11
18
  };
@@ -56,13 +63,14 @@ defineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {
56
63
  const input = buildInput();
57
64
  const external = rest.externals;
58
65
  const output = buildOutput(dir, sourcemap);
66
+ const plugins = producePlugins({
67
+ dir,
68
+ sourcemap,
69
+ ...rest
70
+ });
59
71
  return defineConfig$1({
60
72
  input,
61
- plugins: producePlugins({
62
- dir,
63
- sourcemap,
64
- ...rest
65
- }),
73
+ plugins,
66
74
  external,
67
75
  output,
68
76
  platform: "node"
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["_defineConfig"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({\n include,\n exclude,\n declarationMap,\n dir,\n });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({\n input,\n plugins,\n external,\n output,\n platform: 'node',\n });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;AAWA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAU,WAAW,GAAG,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAU,gBAAgB,OAAO,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACE,gBAAgB,WAAW;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,iBAAiB,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACE,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAa,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAO,gBAAgB,KAAK;IAC1B;IACA;IACA;IACA;GACF,CAAC;EACH;EACA,KAAK;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQ,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAAS,YAAY,KAAK,SAAS;CAIzC,OAAOA,eAAc;EACnB;EACA,SAJc,eAAe;GAAE;GAAK;GAAW,GAAG;EAAK,CAIjD;EACN;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAe,sBAAsB,OACzC,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAY,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChD,qBACF;CAEA,MAAM,aAAa,gBAAgB,OACjC,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"config.js","names":["_defineConfig"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\n/**\n * Generates Rolldown configuration using default or customized options.\n *\n * @param additionals - Optional build configuration parameters of type {@linkcode Params}.\n *\n * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.\n */\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({\n include,\n exclude,\n declarationMap,\n dir,\n });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({\n input,\n plugins,\n external,\n output,\n platform: 'node',\n });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAU,WAAW,GAAG,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAU,gBAAgB,OAAO,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACE,gBAAgB,WAAW;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,iBAAiB,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACE,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAa,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAO,gBAAgB,KAAK;IAC1B;IACA;IACA;IACA;GACF,CAAC;EACH;EACA,KAAK;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQ,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAAS,YAAY,KAAK,SAAS;CAEzC,MAAM,UAAU,eAAe;EAAE;EAAK;EAAW,GAAG;CAAK,CAAC;CAE1D,OAAOA,eAAc;EACnB;EACA;EACA;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAe,sBAAsB,OACzC,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAY,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChD,qBACF;CAEA,MAAM,aAAa,gBAAgB,OACjC,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
@@ -1,5 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/rolldown-config/constants.ts
3
+ /**
4
+ * Default exclude glob patterns for bundling and type generation.
5
+ */
3
6
  const DEFAULT_EXCLUDE = [
4
7
  "**/node_modules/**/*",
5
8
  "**/__tests__/**/*",
@@ -9,14 +12,26 @@ const DEFAULT_EXCLUDE = [
9
12
  "**/fixtures.ts",
10
13
  "src/fixtures/**/*.ts"
11
14
  ];
15
+ /**
16
+ * Default patterns for type files that may contain circular references.
17
+ */
12
18
  const DEFAULT_CIRCULAR_DEPS = [
13
19
  "**/types.ts",
14
20
  "**/type.ts",
15
21
  "**/*.types.ts",
16
22
  "**/*.type.ts"
17
23
  ];
24
+ /**
25
+ * Combined default exclusions and circular dependency file patterns.
26
+ */
18
27
  const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);
28
+ /**
29
+ * Default output directory name.
30
+ */
19
31
  const DEFAULT_DIR = "lib";
32
+ /**
33
+ * Rolldown log warning codes.
34
+ */
20
35
  const WARNING_CODES = {
21
36
  EMPTY_BUNDLE: "EMPTY_BUNDLE",
22
37
  CIRCULAR_DEPENDENCY: "CIRCULAR_DEPENDENCY"
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["export const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\nexport const DEFAULT_DIR = 'lib';\n\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";;AAAA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;AACF;AAEA,MAAa,SAAS,gBAAgB,OAAO,qBAAqB;AAElE,MAAa,cAAc;AAE3B,MAAa,gBAAgB;CAC3B,cAAc;CACd,qBAAqB;AACvB"}
1
+ {"version":3,"file":"constants.cjs","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["/**\n * Default exclude glob patterns for bundling and type generation.\n */\nexport const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\n/**\n * Default patterns for type files that may contain circular references.\n */\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\n/**\n * Combined default exclusions and circular dependency file patterns.\n */\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\n/**\n * Default output directory name.\n */\nexport const DEFAULT_DIR = 'lib';\n\n/**\n * Rolldown log warning codes.\n */\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";;;;;AAGA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;AAKA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;AACF;;;;AAKA,MAAa,SAAS,gBAAgB,OAAO,qBAAqB;;;;AAKlE,MAAa,cAAc;;;;AAK3B,MAAa,gBAAgB;CAC3B,cAAc;CACd,qBAAqB;AACvB"}
@@ -1,7 +1,22 @@
1
+ /**
2
+ * Default exclude glob patterns for bundling and type generation.
3
+ */
1
4
  export declare const DEFAULT_EXCLUDE: string[];
5
+ /**
6
+ * Default patterns for type files that may contain circular references.
7
+ */
2
8
  export declare const DEFAULT_CIRCULAR_DEPS: string[];
9
+ /**
10
+ * Combined default exclusions and circular dependency file patterns.
11
+ */
3
12
  export declare const IGNORE: string[];
13
+ /**
14
+ * Default output directory name.
15
+ */
4
16
  export declare const DEFAULT_DIR = "lib";
17
+ /**
18
+ * Rolldown log warning codes.
19
+ */
5
20
  export declare const WARNING_CODES: {
6
21
  EMPTY_BUNDLE: string;
7
22
  CIRCULAR_DEPENDENCY: string;
@@ -1,4 +1,7 @@
1
1
  //#region src/rolldown-config/constants.ts
2
+ /**
3
+ * Default exclude glob patterns for bundling and type generation.
4
+ */
2
5
  const DEFAULT_EXCLUDE = [
3
6
  "**/node_modules/**/*",
4
7
  "**/__tests__/**/*",
@@ -8,14 +11,26 @@ const DEFAULT_EXCLUDE = [
8
11
  "**/fixtures.ts",
9
12
  "src/fixtures/**/*.ts"
10
13
  ];
14
+ /**
15
+ * Default patterns for type files that may contain circular references.
16
+ */
11
17
  const DEFAULT_CIRCULAR_DEPS = [
12
18
  "**/types.ts",
13
19
  "**/type.ts",
14
20
  "**/*.types.ts",
15
21
  "**/*.type.ts"
16
22
  ];
23
+ /**
24
+ * Combined default exclusions and circular dependency file patterns.
25
+ */
17
26
  const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);
27
+ /**
28
+ * Default output directory name.
29
+ */
18
30
  const DEFAULT_DIR = "lib";
31
+ /**
32
+ * Rolldown log warning codes.
33
+ */
19
34
  const WARNING_CODES = {
20
35
  EMPTY_BUNDLE: "EMPTY_BUNDLE",
21
36
  CIRCULAR_DEPENDENCY: "CIRCULAR_DEPENDENCY"
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["export const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\nexport const DEFAULT_DIR = 'lib';\n\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";AAAA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;AACF;AAEA,MAAa,SAAS,gBAAgB,OAAO,qBAAqB;AAElE,MAAa,cAAc;AAE3B,MAAa,gBAAgB;CAC3B,cAAc;CACd,qBAAqB;AACvB"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["/**\n * Default exclude glob patterns for bundling and type generation.\n */\nexport const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\n/**\n * Default patterns for type files that may contain circular references.\n */\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\n/**\n * Combined default exclusions and circular dependency file patterns.\n */\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\n/**\n * Default output directory name.\n */\nexport const DEFAULT_DIR = 'lib';\n\n/**\n * Rolldown log warning codes.\n */\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";;;;AAGA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;AAKA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;AACF;;;;AAKA,MAAa,SAAS,gBAAgB,OAAO,qBAAqB;;;;AAKlE,MAAa,cAAc;;;;AAK3B,MAAa,gBAAgB;CAC3B,cAAc;CACd,qBAAqB;AACvB"}
@@ -2,12 +2,27 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let fs = require("fs");
3
3
  let path = require("path");
4
4
  //#region src/rolldown-config/helpers.ts
5
+ /**
6
+ * Strips the extension from a file path.
7
+ *
8
+ * @param file - File path string.
9
+ *
10
+ * @returns File path without file extension.
11
+ */
5
12
  const withoutExtension = (file) => {
6
13
  return file.slice(0, file.length - (0, path.extname)(file).length);
7
14
  };
15
+ /**
16
+ * Removes compiled JavaScript and sourcemap files for specified sources.
17
+ *
18
+ * @param files - Set of source file paths.
19
+ * @param dir - Target output directory.
20
+ * @param sourcemap - Whether sourcemap files should also be deleted.
21
+ */
8
22
  const cleanupJS = (files, dir, sourcemap) => {
9
23
  for (const file of files) {
10
- const rel = (0, path.relative)("src", withoutExtension(file));
24
+ const withoutExt = withoutExtension(file);
25
+ const rel = (0, path.relative)("src", withoutExt);
11
26
  const baseOut = (0, path.resolve)(process.cwd(), dir, rel);
12
27
  console.warn(`Cleaning up ${baseOut}`);
13
28
  (0, fs.rmSync)(`${baseOut}.js`, { force: true });
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.cjs","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;;AAGA,MAAa,oBAAoB,SAAiB;CAChD,OAAO,KAAK,MAAM,GAAG,KAAK,UAAA,GAAA,KAAA,QAAA,CAAiB,IAAI,CAAC,CAAC,MAAM;AACzD;AAEA,MAAa,aACX,OACA,KACA,cACG;CACH,KAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,OAAA,GAAA,KAAA,SAAA,CAAe,OADF,iBAAiB,IACC,CAAC;EACtC,MAAM,WAAA,GAAA,KAAA,QAAA,CAAkB,QAAQ,IAAI,GAAG,KAAK,GAAG;EAG/C,QAAQ,KAAK,eAAe,SAAS;EAErC,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;EACvC,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,OAAO,EAAE,OAAO,KAAK,CAAC;EACxC,IAAI,WAAW;GACb,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;GAC3C,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,WAAW,EAAE,OAAO,KAAK,CAAC;EAC9C;EAEA,MAAM,WAAW;GAAC;GAAM;GAAO;GAAU;EAAS,CAAC,CAAC,KAClD,QAAO,GAAG,QAAQ,GAAG,KACvB;EAEA,MAAM,aAAa,KAAK,UAAU,UAAU,MAAM,CAAC;EAEnD,QAAQ,KAAK,aAAa;EAC1B,QAAQ,IAAI,aAAa;EACzB,QAAQ,KAAK,UAAU;EACvB,QAAQ,IAAI,aAAa;CAE3B;AACF"}
1
+ {"version":3,"file":"helpers.cjs","names":["extname","relative","resolve"],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\n/**\n * Strips the extension from a file path.\n *\n * @param file - File path string.\n *\n * @returns File path without file extension.\n */\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\n/**\n * Removes compiled JavaScript and sourcemap files for specified sources.\n *\n * @param files - Set of source file paths.\n * @param dir - Target output directory.\n * @param sourcemap - Whether sourcemap files should also be deleted.\n */\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,oBAAoB,SAAiB;CAChD,OAAO,KAAK,MAAM,GAAG,KAAK,UAAA,GAASA,KAAAA,QAAAA,CAAQ,IAAI,CAAC,CAAC,MAAM;AACzD;;;;;;;;AASA,MAAa,aACX,OACA,KACA,cACG;CACH,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,aAAa,iBAAiB,IAAI;EACxC,MAAM,OAAA,GAAMC,KAAAA,SAAAA,CAAS,OAAO,UAAU;EACtC,MAAM,WAAA,GAAUC,KAAAA,QAAAA,CAAQ,QAAQ,IAAI,GAAG,KAAK,GAAG;EAG/C,QAAQ,KAAK,eAAe,SAAS;EAErC,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;EACvC,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,OAAO,EAAE,OAAO,KAAK,CAAC;EACxC,IAAI,WAAW;GACb,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;GAC3C,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,WAAW,EAAE,OAAO,KAAK,CAAC;EAC9C;EAEA,MAAM,WAAW;GAAC;GAAM;GAAO;GAAU;EAAS,CAAC,CAAC,KAClD,QAAO,GAAG,QAAQ,GAAG,KACvB;EAEA,MAAM,aAAa,KAAK,UAAU,UAAU,MAAM,CAAC;EAEnD,QAAQ,KAAK,aAAa;EAC1B,QAAQ,IAAI,aAAa;EACzB,QAAQ,KAAK,UAAU;EACvB,QAAQ,IAAI,aAAa;CAE3B;AACF"}
@@ -1,2 +1,16 @@
1
+ /**
2
+ * Strips the extension from a file path.
3
+ *
4
+ * @param file - File path string.
5
+ *
6
+ * @returns File path without file extension.
7
+ */
1
8
  export declare const withoutExtension: (file: string) => string;
9
+ /**
10
+ * Removes compiled JavaScript and sourcemap files for specified sources.
11
+ *
12
+ * @param files - Set of source file paths.
13
+ * @param dir - Target output directory.
14
+ * @param sourcemap - Whether sourcemap files should also be deleted.
15
+ */
2
16
  export declare const cleanupJS: (files: Set<string>, dir: string, sourcemap: boolean) => void;
@@ -1,12 +1,27 @@
1
1
  import { rmSync } from "fs";
2
2
  import { extname, relative, resolve } from "path";
3
3
  //#region src/rolldown-config/helpers.ts
4
+ /**
5
+ * Strips the extension from a file path.
6
+ *
7
+ * @param file - File path string.
8
+ *
9
+ * @returns File path without file extension.
10
+ */
4
11
  const withoutExtension = (file) => {
5
12
  return file.slice(0, file.length - extname(file).length);
6
13
  };
14
+ /**
15
+ * Removes compiled JavaScript and sourcemap files for specified sources.
16
+ *
17
+ * @param files - Set of source file paths.
18
+ * @param dir - Target output directory.
19
+ * @param sourcemap - Whether sourcemap files should also be deleted.
20
+ */
7
21
  const cleanupJS = (files, dir, sourcemap) => {
8
22
  for (const file of files) {
9
- const rel = relative("src", withoutExtension(file));
23
+ const withoutExt = withoutExtension(file);
24
+ const rel = relative("src", withoutExt);
10
25
  const baseOut = resolve(process.cwd(), dir, rel);
11
26
  console.warn(`Cleaning up ${baseOut}`);
12
27
  rmSync(`${baseOut}.js`, { force: true });
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;AAGA,MAAa,oBAAoB,SAAiB;CAChD,OAAO,KAAK,MAAM,GAAG,KAAK,SAAS,QAAQ,IAAI,CAAC,CAAC,MAAM;AACzD;AAEA,MAAa,aACX,OACA,KACA,cACG;CACH,KAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,MAAM,SAAS,OADF,iBAAiB,IACC,CAAC;EACtC,MAAM,UAAU,QAAQ,QAAQ,IAAI,GAAG,KAAK,GAAG;EAG/C,QAAQ,KAAK,eAAe,SAAS;EAErC,OAAO,GAAG,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;EACvC,OAAO,GAAG,QAAQ,OAAO,EAAE,OAAO,KAAK,CAAC;EACxC,IAAI,WAAW;GACb,OAAO,GAAG,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;GAC3C,OAAO,GAAG,QAAQ,WAAW,EAAE,OAAO,KAAK,CAAC;EAC9C;EAEA,MAAM,WAAW;GAAC;GAAM;GAAO;GAAU;EAAS,CAAC,CAAC,KAClD,QAAO,GAAG,QAAQ,GAAG,KACvB;EAEA,MAAM,aAAa,KAAK,UAAU,UAAU,MAAM,CAAC;EAEnD,QAAQ,KAAK,aAAa;EAC1B,QAAQ,IAAI,aAAa;EACzB,QAAQ,KAAK,UAAU;EACvB,QAAQ,IAAI,aAAa;CAE3B;AACF"}
1
+ {"version":3,"file":"helpers.js","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\n/**\n * Strips the extension from a file path.\n *\n * @param file - File path string.\n *\n * @returns File path without file extension.\n */\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\n/**\n * Removes compiled JavaScript and sourcemap files for specified sources.\n *\n * @param files - Set of source file paths.\n * @param dir - Target output directory.\n * @param sourcemap - Whether sourcemap files should also be deleted.\n */\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,oBAAoB,SAAiB;CAChD,OAAO,KAAK,MAAM,GAAG,KAAK,SAAS,QAAQ,IAAI,CAAC,CAAC,MAAM;AACzD;;;;;;;;AASA,MAAa,aACX,OACA,KACA,cACG;CACH,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,aAAa,iBAAiB,IAAI;EACxC,MAAM,MAAM,SAAS,OAAO,UAAU;EACtC,MAAM,UAAU,QAAQ,QAAQ,IAAI,GAAG,KAAK,GAAG;EAG/C,QAAQ,KAAK,eAAe,SAAS;EAErC,OAAO,GAAG,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;EACvC,OAAO,GAAG,QAAQ,OAAO,EAAE,OAAO,KAAK,CAAC;EACxC,IAAI,WAAW;GACb,OAAO,GAAG,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;GAC3C,OAAO,GAAG,QAAQ,WAAW,EAAE,OAAO,KAAK,CAAC;EAC9C;EAEA,MAAM,WAAW;GAAC;GAAM;GAAO;GAAU;EAAS,CAAC,CAAC,KAClD,QAAO,GAAG,QAAQ,GAAG,KACvB;EAEA,MAAM,aAAa,KAAK,UAAU,UAAU,MAAM,CAAC;EAEnD,QAAQ,KAAK,aAAa;EAC1B,QAAQ,IAAI,aAAa;EACzB,QAAQ,KAAK,UAAU;EACvB,QAAQ,IAAI,aAAa;CAE3B;AACF"}
@@ -3,6 +3,14 @@ const require_rolldown_config_constants = require("./constants.cjs");
3
3
  let path = require("path");
4
4
  let glob = require("glob");
5
5
  //#region src/rolldown-config/input.ts
6
+ /**
7
+ * Builds entry points record for Rolldown from all
8
+ * `src/[**]/*.ts]` files.
9
+ *
10
+ * @param ignores - Additional glob patterns to exclude from entry points.
11
+ *
12
+ * @returns An object mapping relative module names to absolute source paths.
13
+ */
6
14
  const buildInput = (...ignores) => Object.fromEntries((0, glob.globSync)("src/**/*.ts", { ignore: require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(ignores) }).map((file) => {
7
15
  return [(0, path.relative)("src", file.slice(0, file.length - (0, path.extname)(file).length)), `${process.cwd()}/${file}`];
8
16
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"input.cjs","names":["DEFAULT_EXCLUDE"],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import { extname, relative } from 'node:path';\n\nimport { globSync } from 'glob';\n\nimport { DEFAULT_EXCLUDE } from './constants';\nimport type { BuildInput_F } from './types';\n\nexport const buildInput: BuildInput_F = (...ignores) =>\n Object.fromEntries(\n globSync('src/**/*.ts', {\n ignore: DEFAULT_EXCLUDE.concat(ignores),\n }).map(file => {\n const key = relative(\n 'src',\n file.slice(0, file.length - extname(file).length),\n );\n const value = `${process.cwd()}/${file}`;\n\n return [key, value];\n }),\n );\n"],"mappings":";;;;;AAOA,MAAa,cAA4B,GAAG,YAC1C,OAAO,aAAA,GAAA,KAAA,SAAA,CACI,eAAe,EACtB,QAAQA,kCAAAA,gBAAgB,OAAO,OAAO,EACxC,CAAC,CAAC,CAAC,KAAI,SAAQ;CAOb,OAAO,EAAA,GAAA,KAAA,SAAA,CALL,OACA,KAAK,MAAM,GAAG,KAAK,UAAA,GAAA,KAAA,QAAA,CAAiB,IAAI,CAAC,CAAC,MAAM,CAIxC,GAAG,GAFI,QAAQ,IAAI,EAAE,GAAG,MAEhB;AACpB,CAAC,CACH"}
1
+ {"version":3,"file":"input.cjs","names":["globSync","DEFAULT_EXCLUDE","relative","extname"],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import { extname, relative } from 'node:path';\n\nimport { globSync } from 'glob';\n\nimport { DEFAULT_EXCLUDE } from './constants';\nimport type { BuildInput_F } from './types';\n\n/**\n * Builds entry points record for Rolldown from all\n * `src/[**]/*.ts]` files.\n *\n * @param ignores - Additional glob patterns to exclude from entry points.\n *\n * @returns An object mapping relative module names to absolute source paths.\n */\nexport const buildInput: BuildInput_F = (...ignores) =>\n Object.fromEntries(\n globSync('src/**/*.ts', {\n ignore: DEFAULT_EXCLUDE.concat(ignores),\n }).map(file => {\n const key = relative(\n 'src',\n file.slice(0, file.length - extname(file).length),\n );\n const value = `${process.cwd()}/${file}`;\n\n return [key, value];\n }),\n );\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,cAA4B,GAAG,YAC1C,OAAO,aAAA,GACLA,KAAAA,SAAAA,CAAS,eAAe,EACtB,QAAQC,kCAAAA,gBAAgB,OAAO,OAAO,EACxC,CAAC,CAAC,CAAC,KAAI,SAAQ;CAOb,OAAO,EAAA,GANKC,KAAAA,SAAAA,CACV,OACA,KAAK,MAAM,GAAG,KAAK,UAAA,GAASC,KAAAA,QAAAA,CAAQ,IAAI,CAAC,CAAC,MAAM,CAIxC,GAAG,GAFI,QAAQ,IAAI,EAAE,GAAG,MAEhB;AACpB,CAAC,CACH"}
@@ -1,2 +1,10 @@
1
1
  import type { BuildInput_F } from './types';
2
+ /**
3
+ * Builds entry points record for Rolldown from all
4
+ * `src/[**]/*.ts]` files.
5
+ *
6
+ * @param ignores - Additional glob patterns to exclude from entry points.
7
+ *
8
+ * @returns An object mapping relative module names to absolute source paths.
9
+ */
2
10
  export declare const buildInput: BuildInput_F;
@@ -2,6 +2,14 @@ import { DEFAULT_EXCLUDE } from "./constants.js";
2
2
  import { extname, relative } from "path";
3
3
  import { globSync } from "glob";
4
4
  //#region src/rolldown-config/input.ts
5
+ /**
6
+ * Builds entry points record for Rolldown from all
7
+ * `src/[**]/*.ts]` files.
8
+ *
9
+ * @param ignores - Additional glob patterns to exclude from entry points.
10
+ *
11
+ * @returns An object mapping relative module names to absolute source paths.
12
+ */
5
13
  const buildInput = (...ignores) => Object.fromEntries(globSync("src/**/*.ts", { ignore: DEFAULT_EXCLUDE.concat(ignores) }).map((file) => {
6
14
  return [relative("src", file.slice(0, file.length - extname(file).length)), `${process.cwd()}/${file}`];
7
15
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":[],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import { extname, relative } from 'node:path';\n\nimport { globSync } from 'glob';\n\nimport { DEFAULT_EXCLUDE } from './constants';\nimport type { BuildInput_F } from './types';\n\nexport const buildInput: BuildInput_F = (...ignores) =>\n Object.fromEntries(\n globSync('src/**/*.ts', {\n ignore: DEFAULT_EXCLUDE.concat(ignores),\n }).map(file => {\n const key = relative(\n 'src',\n file.slice(0, file.length - extname(file).length),\n );\n const value = `${process.cwd()}/${file}`;\n\n return [key, value];\n }),\n );\n"],"mappings":";;;;AAOA,MAAa,cAA4B,GAAG,YAC1C,OAAO,YACL,SAAS,eAAe,EACtB,QAAQ,gBAAgB,OAAO,OAAO,EACxC,CAAC,CAAC,CAAC,KAAI,SAAQ;CAOb,OAAO,CANK,SACV,OACA,KAAK,MAAM,GAAG,KAAK,SAAS,QAAQ,IAAI,CAAC,CAAC,MAAM,CAIxC,GAAG,GAFI,QAAQ,IAAI,EAAE,GAAG,MAEhB;AACpB,CAAC,CACH"}
1
+ {"version":3,"file":"input.js","names":[],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import { extname, relative } from 'node:path';\n\nimport { globSync } from 'glob';\n\nimport { DEFAULT_EXCLUDE } from './constants';\nimport type { BuildInput_F } from './types';\n\n/**\n * Builds entry points record for Rolldown from all\n * `src/[**]/*.ts]` files.\n *\n * @param ignores - Additional glob patterns to exclude from entry points.\n *\n * @returns An object mapping relative module names to absolute source paths.\n */\nexport const buildInput: BuildInput_F = (...ignores) =>\n Object.fromEntries(\n globSync('src/**/*.ts', {\n ignore: DEFAULT_EXCLUDE.concat(ignores),\n }).map(file => {\n const key = relative(\n 'src',\n file.slice(0, file.length - extname(file).length),\n );\n const value = `${process.cwd()}/${file}`;\n\n return [key, value];\n }),\n );\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,cAA4B,GAAG,YAC1C,OAAO,YACL,SAAS,eAAe,EACtB,QAAQ,gBAAgB,OAAO,OAAO,EACxC,CAAC,CAAC,CAAC,KAAI,SAAQ;CAOb,OAAO,CANK,SACV,OACA,KAAK,MAAM,GAAG,KAAK,SAAS,QAAQ,IAAI,CAAC,CAAC,MAAM,CAIxC,GAAG,GAFI,QAAQ,IAAI,EAAE,GAAG,MAEhB;AACpB,CAAC,CACH"}
@@ -2,6 +2,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./constants.cjs");
3
3
  const require_rolldown_config_plugins_typescript_config = require("./plugins/typescript.config.cjs");
4
4
  //#region src/rolldown-config/output.ts
5
+ /**
6
+ * Builds ES and CJS output configurations for Rolldown.
7
+ *
8
+ * @param dir - Target output directory name, defaults to {@linkcode DEFAULT_DIR}.
9
+ * @param sourcemap - Whether to generate source maps.
10
+ *
11
+ * @returns Array of output configurations of type {@linkcode OutputOptions}.
12
+ */
5
13
  const buildOutput = (dir = "lib", sourcemap) => {
6
14
  const outDir = require_rolldown_config_plugins_typescript_config.getConfig(process.cwd()).options.outDir ?? dir ?? "lib";
7
15
  return [{
@@ -1 +1 @@
1
- {"version":3,"file":"output.cjs","names":["getConfig"],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\nimport { getConfig } from './plugins/typescript.config';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n const config = getConfig(process.cwd());\n const outDir = config.options.outDir ?? dir ?? DEFAULT_DIR;\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;;AAKA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CAEpE,MAAM,SADSA,kDAAAA,UAAU,QAAQ,IAAI,CACjB,CAAC,CAAC,QAAQ,UAAU,OAAA;CACxC,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
1
+ {"version":3,"file":"output.cjs","names":["getConfig"],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\nimport { getConfig } from './plugins/typescript.config';\n\n/**\n * Builds ES and CJS output configurations for Rolldown.\n *\n * @param dir - Target output directory name, defaults to {@linkcode DEFAULT_DIR}.\n * @param sourcemap - Whether to generate source maps.\n *\n * @returns Array of output configurations of type {@linkcode OutputOptions}.\n */\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n const config = getConfig(process.cwd());\n const outDir = config.options.outDir ?? dir ?? DEFAULT_DIR;\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CAEpE,MAAM,SADSA,kDAAAA,UAAU,QAAQ,IAAI,CACjB,CAAC,CAAC,QAAQ,UAAU,OAAA;CACxC,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Builds ES and CJS output configurations for Rolldown.
3
+ *
4
+ * @param dir - Target output directory name, defaults to {@linkcode DEFAULT_DIR}.
5
+ * @param sourcemap - Whether to generate source maps.
6
+ *
7
+ * @returns Array of output configurations of type {@linkcode OutputOptions}.
8
+ */
1
9
  export declare const buildOutput: (dir: string | undefined, sourcemap: boolean) => [{
2
10
  readonly format: "es";
3
11
  readonly sourcemap: boolean;
@@ -1,6 +1,14 @@
1
1
  import "./constants.js";
2
2
  import { getConfig } from "./plugins/typescript.config.js";
3
3
  //#region src/rolldown-config/output.ts
4
+ /**
5
+ * Builds ES and CJS output configurations for Rolldown.
6
+ *
7
+ * @param dir - Target output directory name, defaults to {@linkcode DEFAULT_DIR}.
8
+ * @param sourcemap - Whether to generate source maps.
9
+ *
10
+ * @returns Array of output configurations of type {@linkcode OutputOptions}.
11
+ */
4
12
  const buildOutput = (dir = "lib", sourcemap) => {
5
13
  const outDir = getConfig(process.cwd()).options.outDir ?? dir ?? "lib";
6
14
  return [{
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\nimport { getConfig } from './plugins/typescript.config';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n const config = getConfig(process.cwd());\n const outDir = config.options.outDir ?? dir ?? DEFAULT_DIR;\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;AAKA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CAEpE,MAAM,SADS,UAAU,QAAQ,IAAI,CACjB,CAAC,CAAC,QAAQ,UAAU,OAAA;CACxC,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
1
+ {"version":3,"file":"output.js","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\nimport { getConfig } from './plugins/typescript.config';\n\n/**\n * Builds ES and CJS output configurations for Rolldown.\n *\n * @param dir - Target output directory name, defaults to {@linkcode DEFAULT_DIR}.\n * @param sourcemap - Whether to generate source maps.\n *\n * @returns Array of output configurations of type {@linkcode OutputOptions}.\n */\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n const config = getConfig(process.cwd());\n const outDir = config.options.outDir ?? dir ?? DEFAULT_DIR;\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CAEpE,MAAM,SADS,UAAU,QAAQ,IAAI,CACjB,CAAC,CAAC,QAAQ,UAAU,OAAA;CACxC,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
@@ -7,11 +7,11 @@ let glob = require("glob");
7
7
  let rollup_plugin_circular_dependencies = require("rollup-plugin-circular-dependencies");
8
8
  //#region src/rolldown-config/plugins/circulars.ts
9
9
  /**
10
- * Creates a configured circular dependencies plugin instance
10
+ * Creates a configured circular dependencies plugin instance with suppression for known patterns.
11
11
  *
12
- * @param options - Configuration options for circular dependencies
13
- * detection
14
- * @returns Rolldown plugin
12
+ * @param options - Configuration options of type {@linkcode CircularDependenciesOptions}.
13
+ *
14
+ * @returns Rolldown plugin option of type {@linkcode RolldownPluginOption}.
15
15
  */
16
16
  function circulars(options = {}) {
17
17
  const all = (0, rollup_plugin_circular_dependencies.circularDependencies)(options);
@@ -1 +1 @@
1
- {"version":3,"file":"circulars.cjs","names":["toArray","withoutExtension","WARNING_CODES"],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { circularDependencies } from 'rollup-plugin-circular-dependencies';\n\nimport { toArray } from '#utils';\n\nimport { WARNING_CODES } from '../constants';\nimport { withoutExtension } from '../helpers';\n\nexport type CircularDependenciesOptions = Parameters<\n typeof circularDependencies\n>[0] & { exclude?: string | string[] };\n\n/**\n * Creates a configured circular dependencies plugin instance\n *\n * @param options - Configuration options for circular dependencies\n * detection\n * @returns Rolldown plugin\n */\nexport function circulars(\n options: CircularDependenciesOptions = {},\n): RolldownPluginOption {\n const all = circularDependencies(options);\n const exclude = toArray(options.exclude);\n\n const CIRCULAR_CHUNKS = exclude\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n return {\n ...all,\n name: 'better circular-dependencies',\n onLog: {\n handler: (_, { code, names }) => {\n if (\n code === WARNING_CODES.CIRCULAR_DEPENDENCY &&\n names?.every(name => CIRCULAR_CHUNKS.includes(name))\n ) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log(\n '[bemedev] Skipping circular dependency warnings for:',\n );\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n console.log();\n return false;\n }\n\n return;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAgB,UACd,UAAuC,CAAC,GAClB;CACtB,MAAM,OAAA,GAAA,oCAAA,qBAAA,CAA2B,OAAO;CAGxC,MAAM,kBAFUA,oBAAAA,QAAQ,QAAQ,OAEF,CAAC,CAC5B,KAAI,OAAA,GAAA,KAAA,SAAA,CAAc,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAIC,gCAAAA,gBAAgB,CAAC,CACrB,KAAI,UAAA,GAAA,KAAA,SAAA,CAAiB,OAAO,IAAI,CAAC;CAEpC,OAAO;EACL,GAAG;EACH,MAAM;EACN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,IACE,SAASC,kCAAAA,cAAc,uBACvB,OAAO,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,GACnD;IACA,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IACN,sDACF;IACA,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI;IACZ,OAAO;GACT;EAGF,EACF;CACF;AACF"}
1
+ {"version":3,"file":"circulars.cjs","names":["circularDependencies","toArray","globSync","withoutExtension","relative","WARNING_CODES"],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { circularDependencies } from 'rollup-plugin-circular-dependencies';\n\nimport { toArray } from '#utils';\n\nimport { WARNING_CODES } from '../constants';\nimport { withoutExtension } from '../helpers';\n\n/**\n * Options for the circular dependencies plugin.\n */\nexport type CircularDependenciesOptions = Parameters<\n typeof circularDependencies\n>[0] & { exclude?: string | string[] };\n\n/**\n * Creates a configured circular dependencies plugin instance with suppression for known patterns.\n *\n * @param options - Configuration options of type {@linkcode CircularDependenciesOptions}.\n *\n * @returns Rolldown plugin option of type {@linkcode RolldownPluginOption}.\n */\nexport function circulars(\n options: CircularDependenciesOptions = {},\n): RolldownPluginOption {\n const all = circularDependencies(options);\n const exclude = toArray(options.exclude);\n\n const CIRCULAR_CHUNKS = exclude\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n return {\n ...all,\n name: 'better circular-dependencies',\n onLog: {\n handler: (_, { code, names }) => {\n if (\n code === WARNING_CODES.CIRCULAR_DEPENDENCY &&\n names?.every(name => CIRCULAR_CHUNKS.includes(name))\n ) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log(\n '[bemedev] Skipping circular dependency warnings for:',\n );\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n console.log();\n return false;\n }\n\n return;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,SAAgB,UACd,UAAuC,CAAC,GAClB;CACtB,MAAM,OAAA,GAAMA,oCAAAA,qBAAAA,CAAqB,OAAO;CAGxC,MAAM,kBAFUC,oBAAAA,QAAQ,QAAQ,OAEF,CAAC,CAC5B,KAAI,OAAA,GAAKC,KAAAA,SAAAA,CAAS,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAIC,gCAAAA,gBAAgB,CAAC,CACrB,KAAI,UAAA,GAAQC,KAAAA,SAAAA,CAAS,OAAO,IAAI,CAAC;CAEpC,OAAO;EACL,GAAG;EACH,MAAM;EACN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,IACE,SAASC,kCAAAA,cAAc,uBACvB,OAAO,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,GACnD;IACA,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IACN,sDACF;IACA,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI;IACZ,OAAO;GACT;EAGF,EACF;CACF;AACF"}
@@ -1,13 +1,16 @@
1
1
  import type { RolldownPluginOption } from 'rolldown';
2
2
  import { circularDependencies } from 'rollup-plugin-circular-dependencies';
3
+ /**
4
+ * Options for the circular dependencies plugin.
5
+ */
3
6
  export type CircularDependenciesOptions = Parameters<typeof circularDependencies>[0] & {
4
7
  exclude?: string | string[];
5
8
  };
6
9
  /**
7
- * Creates a configured circular dependencies plugin instance
10
+ * Creates a configured circular dependencies plugin instance with suppression for known patterns.
11
+ *
12
+ * @param options - Configuration options of type {@linkcode CircularDependenciesOptions}.
8
13
  *
9
- * @param options - Configuration options for circular dependencies
10
- * detection
11
- * @returns Rolldown plugin
14
+ * @returns Rolldown plugin option of type {@linkcode RolldownPluginOption}.
12
15
  */
13
16
  export declare function circulars(options?: CircularDependenciesOptions): RolldownPluginOption;
@@ -6,11 +6,11 @@ import { globSync } from "glob";
6
6
  import { circularDependencies } from "rollup-plugin-circular-dependencies";
7
7
  //#region src/rolldown-config/plugins/circulars.ts
8
8
  /**
9
- * Creates a configured circular dependencies plugin instance
9
+ * Creates a configured circular dependencies plugin instance with suppression for known patterns.
10
10
  *
11
- * @param options - Configuration options for circular dependencies
12
- * detection
13
- * @returns Rolldown plugin
11
+ * @param options - Configuration options of type {@linkcode CircularDependenciesOptions}.
12
+ *
13
+ * @returns Rolldown plugin option of type {@linkcode RolldownPluginOption}.
14
14
  */
15
15
  function circulars(options = {}) {
16
16
  const all = circularDependencies(options);
@@ -1 +1 @@
1
- {"version":3,"file":"circulars.js","names":[],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { circularDependencies } from 'rollup-plugin-circular-dependencies';\n\nimport { toArray } from '#utils';\n\nimport { WARNING_CODES } from '../constants';\nimport { withoutExtension } from '../helpers';\n\nexport type CircularDependenciesOptions = Parameters<\n typeof circularDependencies\n>[0] & { exclude?: string | string[] };\n\n/**\n * Creates a configured circular dependencies plugin instance\n *\n * @param options - Configuration options for circular dependencies\n * detection\n * @returns Rolldown plugin\n */\nexport function circulars(\n options: CircularDependenciesOptions = {},\n): RolldownPluginOption {\n const all = circularDependencies(options);\n const exclude = toArray(options.exclude);\n\n const CIRCULAR_CHUNKS = exclude\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n return {\n ...all,\n name: 'better circular-dependencies',\n onLog: {\n handler: (_, { code, names }) => {\n if (\n code === WARNING_CODES.CIRCULAR_DEPENDENCY &&\n names?.every(name => CIRCULAR_CHUNKS.includes(name))\n ) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log(\n '[bemedev] Skipping circular dependency warnings for:',\n );\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n console.log();\n return false;\n }\n\n return;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAgB,UACd,UAAuC,CAAC,GAClB;CACtB,MAAM,MAAM,qBAAqB,OAAO;CAGxC,MAAM,kBAFU,QAAQ,QAAQ,OAEF,CAAC,CAC5B,KAAI,MAAK,SAAS,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAI,gBAAgB,CAAC,CACrB,KAAI,SAAQ,SAAS,OAAO,IAAI,CAAC;CAEpC,OAAO;EACL,GAAG;EACH,MAAM;EACN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,IACE,SAAS,cAAc,uBACvB,OAAO,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,GACnD;IACA,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IACN,sDACF;IACA,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI;IACZ,OAAO;GACT;EAGF,EACF;CACF;AACF"}
1
+ {"version":3,"file":"circulars.js","names":[],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { circularDependencies } from 'rollup-plugin-circular-dependencies';\n\nimport { toArray } from '#utils';\n\nimport { WARNING_CODES } from '../constants';\nimport { withoutExtension } from '../helpers';\n\n/**\n * Options for the circular dependencies plugin.\n */\nexport type CircularDependenciesOptions = Parameters<\n typeof circularDependencies\n>[0] & { exclude?: string | string[] };\n\n/**\n * Creates a configured circular dependencies plugin instance with suppression for known patterns.\n *\n * @param options - Configuration options of type {@linkcode CircularDependenciesOptions}.\n *\n * @returns Rolldown plugin option of type {@linkcode RolldownPluginOption}.\n */\nexport function circulars(\n options: CircularDependenciesOptions = {},\n): RolldownPluginOption {\n const all = circularDependencies(options);\n const exclude = toArray(options.exclude);\n\n const CIRCULAR_CHUNKS = exclude\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n return {\n ...all,\n name: 'better circular-dependencies',\n onLog: {\n handler: (_, { code, names }) => {\n if (\n code === WARNING_CODES.CIRCULAR_DEPENDENCY &&\n names?.every(name => CIRCULAR_CHUNKS.includes(name))\n ) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log(\n '[bemedev] Skipping circular dependency warnings for:',\n );\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n console.log();\n return false;\n }\n\n return;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAgB,UACd,UAAuC,CAAC,GAClB;CACtB,MAAM,MAAM,qBAAqB,OAAO;CAGxC,MAAM,kBAFU,QAAQ,QAAQ,OAEF,CAAC,CAC5B,KAAI,MAAK,SAAS,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAI,gBAAgB,CAAC,CACrB,KAAI,SAAQ,SAAS,OAAO,IAAI,CAAC;CAEpC,OAAO;EACL,GAAG;EACH,MAAM;EACN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,IACE,SAAS,cAAc,uBACvB,OAAO,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,GACnD;IACA,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IACN,sDACF;IACA,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI;IACZ,OAAO;GACT;EAGF,EACF;CACF;AACF"}