powerlines 0.41.6 → 0.41.8

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 (234) hide show
  1. package/README.md +14 -16
  2. package/dist/{api-CY668wMZ.mjs → api-BYLuEyjx.mjs} +142 -333
  3. package/dist/api-BYLuEyjx.mjs.map +1 -0
  4. package/dist/{api-GPlMYw0d.cjs → api-Zx_hzL3g.cjs} +505 -722
  5. package/dist/astro.cjs +8 -18
  6. package/dist/astro.d.cts +1 -2
  7. package/dist/astro.d.cts.map +1 -1
  8. package/dist/astro.d.mts +1 -6
  9. package/dist/astro.d.mts.map +1 -1
  10. package/dist/astro.mjs +6 -16
  11. package/dist/astro.mjs.map +1 -1
  12. package/dist/{chunk-CbDLau6x.cjs → chunk-AIJqnxB6.cjs} +27 -1
  13. package/dist/chunk-CtajNgzt.mjs +36 -0
  14. package/dist/config.cjs +20 -4
  15. package/dist/config.d.cts +1 -2
  16. package/dist/config.d.mts +1 -3
  17. package/dist/config.mjs +11 -2
  18. package/dist/config.mjs.map +1 -0
  19. package/dist/constants.cjs +20 -20
  20. package/dist/constants.d.cts +1 -24
  21. package/dist/constants.d.mts +1 -24
  22. package/dist/constants.mjs +11 -3
  23. package/dist/constants.mjs.map +1 -0
  24. package/dist/context/index.cjs +4 -9
  25. package/dist/context/index.d.cts +56 -132
  26. package/dist/context/index.d.cts.map +1 -1
  27. package/dist/context/index.d.mts +55 -135
  28. package/dist/context/index.d.mts.map +1 -1
  29. package/dist/context/index.mjs +3 -9
  30. package/dist/esbuild.cjs +60 -17
  31. package/dist/esbuild.d.cts +5 -29
  32. package/dist/esbuild.d.cts.map +1 -1
  33. package/dist/esbuild.d.mts +5 -33
  34. package/dist/esbuild.d.mts.map +1 -1
  35. package/dist/esbuild.mjs +44 -12
  36. package/dist/esbuild.mjs.map +1 -0
  37. package/dist/farm.cjs +6 -13
  38. package/dist/farm.d.cts +2 -3
  39. package/dist/farm.d.cts.map +1 -1
  40. package/dist/farm.d.mts +2 -6
  41. package/dist/farm.d.mts.map +1 -1
  42. package/dist/farm.mjs +4 -11
  43. package/dist/farm.mjs.map +1 -1
  44. package/dist/index.cjs +7 -13
  45. package/dist/index.d.cts +263 -6
  46. package/dist/index.d.cts.map +1 -0
  47. package/dist/index.d.mts +263 -7
  48. package/dist/index.d.mts.map +1 -0
  49. package/dist/index.mjs +3 -9
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/next.cjs +7 -14
  52. package/dist/next.d.cts +0 -1
  53. package/dist/next.d.cts.map +1 -1
  54. package/dist/next.d.mts +0 -1
  55. package/dist/next.d.mts.map +1 -1
  56. package/dist/next.mjs +6 -13
  57. package/dist/next.mjs.map +1 -1
  58. package/dist/nuxt.cjs +12 -22
  59. package/dist/nuxt.d.cts +2 -3
  60. package/dist/nuxt.d.cts.map +1 -1
  61. package/dist/nuxt.d.mts +2 -7
  62. package/dist/nuxt.d.mts.map +1 -1
  63. package/dist/nuxt.mjs +8 -18
  64. package/dist/nuxt.mjs.map +1 -1
  65. package/dist/plugin-utils.cjs +20 -28
  66. package/dist/plugin-utils.d.cts +1 -267
  67. package/dist/plugin-utils.d.mts +1 -272
  68. package/dist/plugin-utils.mjs +11 -4
  69. package/dist/plugin-utils.mjs.map +1 -0
  70. package/dist/rolldown.cjs +52 -18
  71. package/dist/rolldown.d.cts +5 -29
  72. package/dist/rolldown.d.cts.map +1 -1
  73. package/dist/rolldown.d.mts +5 -32
  74. package/dist/rolldown.d.mts.map +1 -1
  75. package/dist/rolldown.mjs +36 -13
  76. package/dist/rolldown.mjs.map +1 -0
  77. package/dist/rollup.cjs +20 -48
  78. package/dist/rollup.d.cts +5 -29
  79. package/dist/rollup.d.cts.map +1 -1
  80. package/dist/rollup.d.mts +5 -32
  81. package/dist/rollup.d.mts.map +1 -1
  82. package/dist/rollup.mjs +6 -44
  83. package/dist/rollup.mjs.map +1 -1
  84. package/dist/rspack.cjs +20 -82
  85. package/dist/rspack.d.cts +4 -24
  86. package/dist/rspack.d.cts.map +1 -1
  87. package/dist/rspack.d.mts +4 -27
  88. package/dist/rspack.d.mts.map +1 -1
  89. package/dist/rspack.mjs +5 -77
  90. package/dist/rspack.mjs.map +1 -1
  91. package/dist/storage/index.cjs +2 -3
  92. package/dist/storage/index.d.cts +7 -7
  93. package/dist/storage/index.d.cts.map +1 -1
  94. package/dist/storage/index.d.mts +7 -11
  95. package/dist/storage/index.d.mts.map +1 -1
  96. package/dist/storage/index.mjs +1 -3
  97. package/dist/{tsconfig-C8M8X6U0.cjs → tsconfig-BJrUrPC_.cjs} +13 -13
  98. package/dist/{tsconfig-B92heKit.mjs → tsconfig-D9GCB2I9.mjs} +5 -5
  99. package/dist/tsconfig-D9GCB2I9.mjs.map +1 -0
  100. package/dist/tsdown.cjs +38 -187
  101. package/dist/tsdown.d.cts +2 -24
  102. package/dist/tsdown.d.cts.map +1 -1
  103. package/dist/tsdown.d.mts +4 -30
  104. package/dist/tsdown.d.mts.map +1 -1
  105. package/dist/tsdown.mjs +8 -167
  106. package/dist/tsdown.mjs.map +1 -1
  107. package/dist/tsup.cjs +29 -134
  108. package/dist/tsup.d.cts +2 -24
  109. package/dist/tsup.d.cts.map +1 -1
  110. package/dist/tsup.d.mts +2 -28
  111. package/dist/tsup.d.mts.map +1 -1
  112. package/dist/tsup.mjs +7 -122
  113. package/dist/tsup.mjs.map +1 -1
  114. package/dist/types-DerAvFjs.d.cts +4 -0
  115. package/dist/types-DerAvFjs.d.cts.map +1 -0
  116. package/dist/types-ro7jWCtL.d.mts +4 -0
  117. package/dist/types-ro7jWCtL.d.mts.map +1 -0
  118. package/dist/typescript/index.cjs +2 -1
  119. package/dist/typescript/index.d.cts +2 -2
  120. package/dist/typescript/index.d.cts.map +1 -1
  121. package/dist/typescript/index.d.mts +1 -4
  122. package/dist/typescript/index.d.mts.map +1 -1
  123. package/dist/typescript/index.mjs +1 -1
  124. package/dist/unloader.cjs +6 -13
  125. package/dist/unloader.d.cts +2 -4
  126. package/dist/unloader.d.cts.map +1 -1
  127. package/dist/unloader.d.mts +2 -7
  128. package/dist/unloader.d.mts.map +1 -1
  129. package/dist/unloader.mjs +4 -11
  130. package/dist/unloader.mjs.map +1 -1
  131. package/dist/unplugin.cjs +11 -14
  132. package/dist/unplugin.d.cts +5 -6
  133. package/dist/unplugin.d.cts.map +1 -1
  134. package/dist/unplugin.d.mts +3 -6
  135. package/dist/unplugin.d.mts.map +1 -1
  136. package/dist/unplugin.mjs +6 -10
  137. package/dist/utils.cjs +38 -22
  138. package/dist/utils.d.cts +3 -2
  139. package/dist/utils.d.mts +3 -3
  140. package/dist/utils.mjs +19 -3
  141. package/dist/utils.mjs.map +1 -0
  142. package/dist/{virtual-B1MLgqnQ.cjs → virtual-Cbvj12lU.cjs} +33 -33
  143. package/dist/{virtual-B9imjOqe.mjs → virtual-DvkJm7gK.mjs} +7 -7
  144. package/dist/virtual-DvkJm7gK.mjs.map +1 -0
  145. package/dist/vite.cjs +84 -19
  146. package/dist/vite.d.cts +5 -16
  147. package/dist/vite.d.cts.map +1 -1
  148. package/dist/vite.d.mts +5 -19
  149. package/dist/vite.d.mts.map +1 -1
  150. package/dist/vite.mjs +67 -14
  151. package/dist/vite.mjs.map +1 -0
  152. package/dist/webpack.cjs +42 -16
  153. package/dist/webpack.d.cts +5 -29
  154. package/dist/webpack.d.cts.map +1 -1
  155. package/dist/webpack.d.mts +5 -32
  156. package/dist/webpack.d.mts.map +1 -1
  157. package/dist/webpack.mjs +26 -11
  158. package/dist/webpack.mjs.map +1 -0
  159. package/package.json +17 -17
  160. package/dist/api-CY668wMZ.mjs.map +0 -1
  161. package/dist/commands-7TWNqTU1.d.cts +0 -12
  162. package/dist/commands-7TWNqTU1.d.cts.map +0 -1
  163. package/dist/commands-yacLkOi0.d.mts +0 -12
  164. package/dist/commands-yacLkOi0.d.mts.map +0 -1
  165. package/dist/config-CK756s0L.d.mts +0 -2232
  166. package/dist/config-CK756s0L.d.mts.map +0 -1
  167. package/dist/config-CiPXgwzt.d.mts +0 -39
  168. package/dist/config-CiPXgwzt.d.mts.map +0 -1
  169. package/dist/config-D4Fh2gQL.mjs +0 -87
  170. package/dist/config-D4Fh2gQL.mjs.map +0 -1
  171. package/dist/config-D86Vw7SC.cjs +0 -105
  172. package/dist/config-J74ORCFY.d.cts +0 -39
  173. package/dist/config-J74ORCFY.d.cts.map +0 -1
  174. package/dist/config-vnrrSxEB.d.cts +0 -2232
  175. package/dist/config-vnrrSxEB.d.cts.map +0 -1
  176. package/dist/constants-CZh5rsgh.cjs +0 -103
  177. package/dist/constants-cXxSHhNp.mjs +0 -32
  178. package/dist/constants-cXxSHhNp.mjs.map +0 -1
  179. package/dist/constants.d.cts.map +0 -1
  180. package/dist/constants.d.mts.map +0 -1
  181. package/dist/esbuild-B3NuCco0.cjs +0 -100
  182. package/dist/esbuild-DWiE0pYc.mjs +0 -82
  183. package/dist/esbuild-DWiE0pYc.mjs.map +0 -1
  184. package/dist/index-2JXW-b2-.d.mts +0 -82
  185. package/dist/index-2JXW-b2-.d.mts.map +0 -1
  186. package/dist/index-6BLROVtJ.d.mts +0 -261
  187. package/dist/index-6BLROVtJ.d.mts.map +0 -1
  188. package/dist/index-C7W0kmm7.d.mts +0 -171
  189. package/dist/index-C7W0kmm7.d.mts.map +0 -1
  190. package/dist/index-DJ-k0GOX.d.cts +0 -261
  191. package/dist/index-DJ-k0GOX.d.cts.map +0 -1
  192. package/dist/paths-CS8ecCnW.mjs +0 -81
  193. package/dist/paths-CS8ecCnW.mjs.map +0 -1
  194. package/dist/paths-YmyIGEVo.cjs +0 -98
  195. package/dist/plugin-B9TQt-p0.d.cts +0 -82
  196. package/dist/plugin-B9TQt-p0.d.cts.map +0 -1
  197. package/dist/plugin-BE3wmhoU.d.cts +0 -26
  198. package/dist/plugin-BE3wmhoU.d.cts.map +0 -1
  199. package/dist/plugin-CZ_PJPpQ.cjs +0 -96
  200. package/dist/plugin-C_8RhG5V.d.mts +0 -26
  201. package/dist/plugin-C_8RhG5V.d.mts.map +0 -1
  202. package/dist/plugin-E5foRD0k.mjs +0 -61
  203. package/dist/plugin-E5foRD0k.mjs.map +0 -1
  204. package/dist/plugin-utils-C3HnZJl1.mjs +0 -387
  205. package/dist/plugin-utils-C3HnZJl1.mjs.map +0 -1
  206. package/dist/plugin-utils-Ck3cx3w6.cjs +0 -531
  207. package/dist/plugin-utils.d.cts.map +0 -1
  208. package/dist/plugin-utils.d.mts.map +0 -1
  209. package/dist/resolve-options-6sXFqzEA.mjs +0 -116
  210. package/dist/resolve-options-6sXFqzEA.mjs.map +0 -1
  211. package/dist/resolve-options-BQnTgg3V.cjs +0 -105
  212. package/dist/resolve-options-D-RGs8j8.mjs +0 -117
  213. package/dist/resolve-options-D-RGs8j8.mjs.map +0 -1
  214. package/dist/resolve-options-DHL3RM8F.mjs +0 -87
  215. package/dist/resolve-options-DHL3RM8F.mjs.map +0 -1
  216. package/dist/resolve-options-lxQ2pm0W.cjs +0 -127
  217. package/dist/resolve-options-vyFhhkLp.cjs +0 -133
  218. package/dist/rolldown-CQI8ps6f.cjs +0 -83
  219. package/dist/rolldown-DsXEFXyP.mjs +0 -65
  220. package/dist/rolldown-DsXEFXyP.mjs.map +0 -1
  221. package/dist/tsconfig-B92heKit.mjs.map +0 -1
  222. package/dist/types-Bh_vLuQ0.d.mts +0 -1
  223. package/dist/utils-BbDma_5Y.cjs +0 -449
  224. package/dist/utils-DoQcX7Sk.mjs +0 -339
  225. package/dist/utils-DoQcX7Sk.mjs.map +0 -1
  226. package/dist/virtual-B9imjOqe.mjs.map +0 -1
  227. package/dist/vite-Bx1gbbj3.mjs +0 -171
  228. package/dist/vite-Bx1gbbj3.mjs.map +0 -1
  229. package/dist/vite-XV170zx6.cjs +0 -189
  230. package/dist/webpack-9G4xJBfz.cjs +0 -107
  231. package/dist/webpack-BkTkELre.mjs +0 -88
  232. package/dist/webpack-BkTkELre.mjs.map +0 -1
  233. package/dist/write-file-CpNWY8SV.d.cts +0 -171
  234. package/dist/write-file-CpNWY8SV.d.cts.map +0 -1
package/dist/tsdown.d.mts CHANGED
@@ -1,32 +1,6 @@
1
- import { Et as PluginContext, er as Plugin, j as ResolvedConfig } from "./config-CK756s0L.mjs";
2
- import "./config-CiPXgwzt.mjs";
3
- import "./index-C7W0kmm7.mjs";
4
- import "./index-2JXW-b2-.mjs";
5
- import { UserConfig } from "tsdown";
6
- import { Format } from "@storm-software/build-tools/types";
7
- import { UserConfig as UserConfig$1 } from "tsdown/config";
1
+ import plugin, { default as tsdown } from "@powerlines/plugin-tsdown";
2
+ import { UserConfig } from "tsdown/config";
8
3
 
9
- //#region ../plugin-tsdown/src/types/build.d.ts
10
- type TsdownOptions = Partial<Omit<UserConfig, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">>;
11
- //#endregion
12
- //#region ../plugin-tsdown/src/types/plugin.d.ts
13
- type TsdownPluginOptions = Partial<TsdownOptions>;
14
- interface TsdownPluginResolvedConfig extends ResolvedConfig {
15
- tsdown: TsdownOptions;
16
- }
17
- type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = TsdownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
18
- //#endregion
19
- //#region ../plugin-tsdown/src/index.d.ts
20
- declare module "@powerlines/core" {
21
- interface Config {
22
- tsdown?: TsdownPluginOptions;
23
- }
24
- }
25
- /**
26
- * A Powerlines plugin to use Tsdown to build the project.
27
- */
28
- declare const plugin: <TContext extends TsdownPluginContext = TsdownPluginContext>(options?: TsdownPluginOptions) => Plugin<TContext>;
29
- //#endregion
30
4
  //#region src/tsdown.d.ts
31
5
  /**
32
6
  * A Tsdown configuration function that integrates Powerlines into the build process.
@@ -51,7 +25,7 @@ declare const plugin: <TContext extends TsdownPluginContext = TsdownPluginContex
51
25
  * @param options - The Tsdown options to merge with the Powerlines configuration.
52
26
  * @returns The merged Tsdown configuration options.
53
27
  */
54
- declare function unplugin(options?: UserConfig$1): UserConfig$1;
28
+ declare function unplugin(options?: UserConfig): UserConfig;
55
29
  //#endregion
56
- export { unplugin as default, unplugin as "module.exports", unplugin, plugin, plugin as tsdown };
30
+ export { unplugin as default, unplugin as "module.exports", unplugin, plugin, tsdown };
57
31
  //# sourceMappingURL=tsdown.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.d.mts","names":[],"sources":["../../plugin-tsdown/src/types/build.ts","../../plugin-tsdown/src/types/plugin.ts","../../plugin-tsdown/src/index.ts","../src/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAoBY,aAAA,GAAgB,QAC1B,KACE;;;KCDQ,mBAAA,GAAsB,QAAQ;UAMzB,0BAAA,SAAmC;UAC1C;;ADRE,KCWA,mBDXa,CAAA,wBCYC,0BDZD,GCarB,0BDbqB,CAAA,GCcrB,aDdqB,CCcP,eDdO,CAAA;;;;;aEeZ;;;AFfb;;;AAA4B,cEsBf,MFtBe,EAAA,CAAA,iBEuBT,mBFvBS,GEuBa,mBFvBb,CAAA,CAAA,OAAA,CAAA,EEyBjB,mBFzBiB,EAAA,GE0BzB,MF1ByB,CE0BlB,QF1BkB,CAAA;;;;;;;;;;AAA5B;;;;;;;;ACCA;AAMA;AAIA;;;;;;iBEyBgB,QAAA,WAAkB,eAAkB"}
1
+ {"version":3,"file":"tsdown.d.mts","names":[],"sources":["../src/tsdown.ts"],"mappings":";;;;;;AAwDA;;;;;;;;;;;;;;;;;;;;;iBAAgB,QAAA,CAAS,OAAA,GAAS,UAAA,GAAkB,UAAA"}
package/dist/tsdown.mjs CHANGED
@@ -1,171 +1,13 @@
1
- import { o as createUnplugin } from "./api-CY668wMZ.mjs";
2
- import "./tsconfig-B92heKit.mjs";
3
- import { r as formatPackageJson, w as getDependencyConfig } from "./plugin-utils-C3HnZJl1.mjs";
4
- import "./plugin-E5foRD0k.mjs";
5
- import "./paths-CS8ecCnW.mjs";
6
- import "./constants-cXxSHhNp.mjs";
7
- import "./config-D4Fh2gQL.mjs";
8
- import "./utils-DoQcX7Sk.mjs";
9
- import "./virtual-B9imjOqe.mjs";
10
- import "./resolve-options-6sXFqzEA.mjs";
11
- import "./resolve-options-D-RGs8j8.mjs";
12
- import { t as rolldown_default } from "./rolldown-DsXEFXyP.mjs";
1
+ import "./api-BYLuEyjx.mjs";
2
+ import "./tsconfig-D9GCB2I9.mjs";
3
+ import "./virtual-DvkJm7gK.mjs";
4
+ import unplugin$1 from "./rolldown.mjs";
13
5
  import { toArray } from "@stryke/convert/to-array";
14
- import { appendPath } from "@stryke/path/append";
15
- import { joinPaths } from "@stryke/path/join-paths";
16
- import { replaceExtension, replacePath } from "@stryke/path/replace";
17
6
  import { isFunction } from "@stryke/type-checks/is-function";
18
- import { isSetObject } from "@stryke/type-checks/is-set-object";
19
7
  import { isSetString } from "@stryke/type-checks/is-set-string";
20
- import defu from "defu";
21
- import { createRolldownPlugin } from "unplugin";
22
- import { build } from "tsdown";
8
+ import { resolveFromFormat } from "@powerlines/plugin-tsdown/helpers/resolve-options";
9
+ import plugin, { default as tsdown } from "@powerlines/plugin-tsdown";
23
10
 
24
- //#region ../plugin-tsdown/src/helpers/resolve-options.ts
25
- const DEFAULT_TSDOWN_CONFIG = {
26
- platform: "neutral",
27
- target: "esnext",
28
- fixedExtension: true,
29
- nodeProtocol: true,
30
- clean: false
31
- };
32
- /**
33
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
34
- *
35
- * @param formats - The formats to resolve.
36
- * @returns The resolved entry options.
37
- */
38
- function resolveFormat(formats) {
39
- return toArray(formats).map((format) => {
40
- switch (format) {
41
- case "cjs": return "cjs";
42
- case "iife": return "iife";
43
- case "esm":
44
- default: return "esm";
45
- }
46
- });
47
- }
48
- /**
49
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
50
- *
51
- * @param formats - The formats to resolve.
52
- * @returns The resolved entry options.
53
- */
54
- function resolveFromFormat(formats) {
55
- return toArray(formats).map((format) => {
56
- switch (format) {
57
- case "cjs":
58
- case "commonjs": return "cjs";
59
- case "iife": return "iife";
60
- case "esm":
61
- case "es":
62
- case "module":
63
- case "umd":
64
- default: return "esm";
65
- }
66
- });
67
- }
68
- const formatMessage = (context, ...msgs) => msgs.filter(Boolean).join(" ").replace(new RegExp(`\\[${context.config.name}\\]`, "g"), "").replaceAll(/^\s+/g, "").replaceAll(/\s+$/g, "").trim();
69
- /**
70
- * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
71
- *
72
- * @param context - The build context.
73
- * @returns The resolved options.
74
- */
75
- function resolveOptions(context) {
76
- const { external, noExternal } = getDependencyConfig(context);
77
- return defu({
78
- entry: context.entry.filter((entry) => entry?.file).length > 0 ? Object.fromEntries(context.entry.filter((entry) => entry?.file).map((entry) => [entry.output || replaceExtension(replacePath(replacePath(entry.file, joinPaths(context.config.root, "src")), context.entryPath)), entry.file])) : [joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "src", "**/*.ts"), joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "src", "**/*.tsx")],
79
- external,
80
- noExternal,
81
- alias: context.alias,
82
- resolve: { alias: context.alias },
83
- exports: context.config?.tsdown && context.config.tsdown?.exports ? defu(isSetObject(context.config.tsdown?.exports) ? context.config.tsdown?.exports : {}, { customExports: (exports) => {
84
- const result = Object.fromEntries(Object.entries(exports).map(([key, value]) => {
85
- if (isSetString(value)) return [key, value];
86
- const currentExport = {};
87
- if (isSetString(value.require)) currentExport.require = {
88
- types: replaceExtension(value.require, ".d.cts", { fullExtension: true }),
89
- default: value.require
90
- };
91
- if (isSetString(value.import)) currentExport.import = {
92
- types: replaceExtension(value.import, ".d.mts", { fullExtension: true }),
93
- default: value.import
94
- };
95
- if (!isSetObject(value.default)) {
96
- if (isSetObject(currentExport.import)) currentExport.default = currentExport.import;
97
- else if (isSetObject(currentExport.require)) currentExport.default = currentExport.require;
98
- }
99
- return [key, currentExport];
100
- }));
101
- return Object.keys(result).sort().reduce((ret, key) => {
102
- ret[key] = result[key];
103
- return ret;
104
- }, {});
105
- } }) : void 0
106
- }, context.config?.tsdown ? context.config?.tsdown : {}, context.config?.rolldown ? { inputOptions: context.config?.rolldown } : {}, {
107
- name: context.config.name,
108
- cwd: appendPath(context.config.root, context.workspaceConfig.workspaceRoot),
109
- define: context.config.define,
110
- inputOptions: { transform: { inject: context.config.inject } },
111
- platform: context.config.platform,
112
- dts: context.config.output.dts,
113
- outDir: appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
114
- tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
115
- format: resolveFormat(context.config.output.format).filter(Boolean),
116
- mode: context.config.mode,
117
- treeshake: context.config?.tsdown ? context.config?.tsdown?.treeshake : void 0,
118
- minify: context.config.mode === "production",
119
- metafile: context.config.mode === "development",
120
- sourcemap: context.config.mode === "development",
121
- debug: context.config.mode === "development",
122
- silent: context.config.logLevel === null || context.config.mode === "production",
123
- logLevel: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
124
- customLogger: {
125
- level: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
126
- info: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs)),
127
- warn: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
128
- warnOnce: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
129
- error: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.error(formatMessage(context, ...msgs)),
130
- success: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs))
131
- }
132
- }, DEFAULT_TSDOWN_CONFIG);
133
- }
134
-
135
- //#endregion
136
- //#region ../plugin-tsdown/src/helpers/unplugin.ts
137
- function createTsdownPlugin(context) {
138
- return createRolldownPlugin(createUnplugin(context))({});
139
- }
140
-
141
- //#endregion
142
- //#region ../plugin-tsdown/src/index.ts
143
- /**
144
- * A Powerlines plugin to use Tsdown to build the project.
145
- */
146
- const plugin = (options = {}) => {
147
- return {
148
- name: "tsdown",
149
- config() {
150
- this.trace("Providing default configuration for the Powerlines `tsdown` build plugin.");
151
- return {
152
- output: { format: ["cjs", "esm"] },
153
- tsdown: { ...options }
154
- };
155
- },
156
- async build() {
157
- this.trace("Starting Tsdown build process...");
158
- await build(defu({
159
- config: false,
160
- plugins: [createTsdownPlugin(this)]
161
- }, resolveOptions(this)));
162
- await formatPackageJson(this);
163
- }
164
- };
165
- };
166
- var src_default = plugin;
167
-
168
- //#endregion
169
11
  //#region src/tsdown.ts
170
12
  /**
171
13
  * A Tsdown configuration function that integrates Powerlines into the build process.
@@ -194,7 +36,7 @@ function unplugin(options = {}) {
194
36
  return {
195
37
  ...options,
196
38
  entry: options.entry,
197
- plugins: [rolldown_default({
39
+ plugins: [unplugin$1({
198
40
  name: options.name,
199
41
  root: options.cwd ?? process.cwd(),
200
42
  output: {
@@ -234,8 +76,7 @@ function unplugin(options = {}) {
234
76
  })]
235
77
  };
236
78
  }
237
- var tsdown_default = unplugin;
238
79
 
239
80
  //#endregion
240
- export { tsdown_default as default, unplugin as "module.exports", unplugin, src_default as plugin, src_default as tsdown };
81
+ export { unplugin as default, unplugin as "module.exports", unplugin, plugin, tsdown };
241
82
  //# sourceMappingURL=tsdown.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.mjs","names":["DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions>","rolldown"],"sources":["../../plugin-tsdown/src/helpers/resolve-options.ts","../../plugin-tsdown/src/helpers/unplugin.ts","../../plugin-tsdown/src/index.ts","../src/tsdown.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core\";\nimport { getDependencyConfig } from \"@powerlines/core/plugin-utils\";\nimport { RolldownPluginResolvedConfig } from \"@powerlines/plugin-rolldown/types/plugin\";\nimport type { Format } from \"@storm-software/build-tools/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { UserConfig as BuildOptions, Format as TsdownFormat } from \"tsdown\";\nimport { TsdownPluginResolvedConfig } from \"../types/plugin\";\n\nexport const DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions> = {\n platform: \"neutral\",\n target: \"esnext\",\n fixedExtension: true,\n nodeProtocol: true,\n clean: false\n} as const;\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFormat(formats?: Format | Format[]): TsdownFormat[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n default:\n return \"esm\";\n }\n });\n}\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFromFormat(\n formats?: TsdownFormat | TsdownFormat[]\n): Format[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n case \"commonjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n case \"es\":\n case \"module\":\n case \"umd\":\n default:\n return \"esm\";\n }\n });\n}\n\nconst formatMessage = (context: Context, ...msgs: any[]) =>\n msgs\n .filter(Boolean)\n .join(\" \")\n .replace(new RegExp(`\\\\[${context.config.name}\\\\]`, \"g\"), \"\")\n .replaceAll(/^\\s+/g, \"\")\n .replaceAll(/\\s+$/g, \"\")\n .trim();\n\n/**\n * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n const { external, noExternal } = getDependencyConfig(context);\n\n return defu(\n {\n entry:\n context.entry.filter(entry => entry?.file).length > 0\n ? Object.fromEntries(\n context.entry\n .filter(entry => entry?.file)\n .map(entry => [\n entry.output ||\n replaceExtension(\n replacePath(\n replacePath(\n entry.file,\n joinPaths(context.config.root, \"src\")\n ),\n context.entryPath\n )\n ),\n entry.file\n ])\n )\n : [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\",\n \"**/*.ts\"\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\",\n \"**/*.tsx\"\n )\n ],\n external,\n noExternal,\n alias: context.alias,\n resolve: {\n alias: context.alias\n },\n exports:\n (context.config as TsdownPluginResolvedConfig)?.tsdown &&\n (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n ? defu(\n isSetObject(\n (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n )\n ? (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n : {},\n {\n customExports: (exports: Record<string, any>) => {\n const result = Object.fromEntries(\n Object.entries(exports).map(([key, value]) => {\n if (isSetString(value)) {\n return [key, value];\n }\n\n const currentExport = {} as Record<string, any>;\n if (isSetString(value.require)) {\n currentExport.require = {\n types: replaceExtension(value.require, \".d.cts\", {\n fullExtension: true\n }),\n default: value.require\n };\n }\n\n if (isSetString(value.import)) {\n currentExport.import = {\n types: replaceExtension(value.import, \".d.mts\", {\n fullExtension: true\n }),\n default: value.import\n };\n }\n\n if (!isSetObject(value.default)) {\n if (isSetObject(currentExport.import)) {\n currentExport.default = currentExport.import;\n } else if (isSetObject(currentExport.require)) {\n currentExport.default = currentExport.require;\n }\n }\n\n return [key, currentExport];\n })\n );\n\n return Object.keys(result)\n .sort()\n .reduce(\n (ret, key) => {\n ret[key] = result[key];\n return ret;\n },\n {} as Record<string, any>\n );\n }\n }\n )\n : undefined\n },\n (context.config as TsdownPluginResolvedConfig)?.tsdown\n ? (context.config as TsdownPluginResolvedConfig)?.tsdown\n : {},\n (context.config as RolldownPluginResolvedConfig)?.rolldown\n ? {\n inputOptions: (context.config as RolldownPluginResolvedConfig)\n ?.rolldown\n }\n : {},\n {\n name: context.config.name,\n cwd: appendPath(\n context.config.root,\n context.workspaceConfig.workspaceRoot\n ),\n define: context.config.define,\n inputOptions: {\n transform: {\n inject: context.config.inject\n }\n },\n platform: context.config.platform,\n dts: context.config.output.dts,\n outDir: appendPath(\n context.config.output.buildPath,\n context.workspaceConfig.workspaceRoot\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n format: resolveFormat(context.config.output.format).filter(Boolean),\n mode: context.config.mode,\n treeshake: (context.config as TsdownPluginResolvedConfig)?.tsdown\n ? (context.config as TsdownPluginResolvedConfig)?.tsdown?.treeshake\n : undefined,\n minify: context.config.mode === \"production\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n debug: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n logLevel:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n customLogger: {\n level:\n context.config.logLevel === \"trace\"\n ? \"debug\"\n : context.config.logLevel,\n info: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.debug(formatMessage(context, ...msgs)),\n warn: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n warnOnce: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n error: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.error(formatMessage(context, ...msgs)),\n success: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.debug(formatMessage(context, ...msgs))\n }\n },\n DEFAULT_TSDOWN_CONFIG\n ) as BuildOptions;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\nexport function createTsdownPlugin(context: TsdownPluginContext) {\n return createRolldownPlugin(createUnplugin(context))({});\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Plugin } from \"@powerlines/core\";\nimport { formatPackageJson } from \"@powerlines/core/plugin-utils/format-package-json\";\nimport defu from \"defu\";\nimport { build } from \"tsdown\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createTsdownPlugin } from \"./helpers/unplugin\";\nimport {\n TsdownPluginContext,\n TsdownPluginOptions,\n TsdownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport type * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n tsdown?: TsdownPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to use Tsdown to build the project.\n */\nexport const plugin = <\n TContext extends TsdownPluginContext = TsdownPluginContext\n>(\n options: TsdownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsdown\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `tsdown` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n tsdown: {\n ...options\n }\n } as Partial<TsdownPluginResolvedConfig>;\n },\n async build() {\n this.trace(\"Starting Tsdown build process...\");\n\n await build(\n defu(\n {\n config: false,\n plugins: [createTsdownPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await formatPackageJson(this);\n }\n };\n};\n\nexport default plugin;\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { RolldownOptions } from \"@powerlines/plugin-rolldown/types/build\";\nimport { resolveFromFormat } from \"@powerlines/plugin-tsdown/helpers/resolve-options\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ModuleFormat } from \"rolldown\";\nimport type { UserConfig } from \"tsdown/config\";\nimport rolldown from \"./rolldown\";\nimport { OutputConfig, ResolveConfig } from \"./types\";\n\nexport {\n default as plugin,\n default as tsdown\n} from \"@powerlines/plugin-tsdown\";\n\n/**\n * A Tsdown configuration function that integrates Powerlines into the build process.\n *\n * @see https://github.com/rolldown/tsdown\n *\n * @example\n * ```ts\n * // tsdown.config.ts\n * import withPowerlines from \"powerlines/tsdown\";\n *\n * export default withPowerlines({\n * entry: [\"src/index.ts\"],\n * format: [\"cjs\", \"esm\"],\n * dts: true,\n * sourcemap: true,\n * clean: true,\n * });\n *\n * ```\n *\n * @param options - The Tsdown options to merge with the Powerlines configuration.\n * @returns The merged Tsdown configuration options.\n */\nexport function unplugin(options: UserConfig = {}): UserConfig {\n return {\n ...options,\n entry: options.entry,\n plugins: [\n rolldown({\n name: options.name,\n root: options.cwd ?? process.cwd(),\n output: {\n outputPath: options.outDir,\n format: resolveFromFormat(\n options.format as ModuleFormat | ModuleFormat[]\n ),\n assets: toArray(options.copy)\n .map(copy => {\n if (!copy) {\n return undefined;\n }\n\n if (isSetString(copy)) {\n return copy;\n }\n\n if (isFunction(copy)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based copy options are not supported in Powerlines.\"\n );\n\n return undefined;\n }\n\n return {\n input: copy.from,\n output: copy.to\n };\n })\n .filter(Boolean) as OutputConfig[\"assets\"]\n },\n resolve: {\n external: options.external\n ? (toArray(options.external)\n .map(external => {\n if (isFunction(external)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based external options are not supported in Powerlines.\"\n );\n\n return undefined;\n }\n\n return external;\n })\n .filter(Boolean) as ResolveConfig[\"external\"])\n : undefined,\n noExternal: options.noExternal\n ? (toArray(options.noExternal)\n .map(noExternal => {\n if (isFunction(noExternal)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based noExternal options are not supported in Powerlines.\"\n );\n\n return undefined;\n }\n\n return noExternal;\n })\n .filter(Boolean) as ResolveConfig[\"noExternal\"])\n : undefined\n },\n rolldown: options.inputOptions as RolldownOptions,\n tsconfig: isSetString(options.tsconfig) ? options.tsconfig : undefined\n })\n ]\n };\n}\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":"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"}
1
+ {"version":3,"file":"tsdown.mjs","names":["rolldown"],"sources":["../src/tsdown.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { RolldownOptions } from \"@powerlines/plugin-rolldown/types/build\";\nimport { resolveFromFormat } from \"@powerlines/plugin-tsdown/helpers/resolve-options\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ModuleFormat } from \"rolldown\";\nimport type { UserConfig } from \"tsdown/config\";\nimport rolldown from \"./rolldown\";\nimport { OutputConfig, ResolveConfig } from \"./types\";\n\nexport {\n default as plugin,\n default as tsdown\n} from \"@powerlines/plugin-tsdown\";\n\n/**\n * A Tsdown configuration function that integrates Powerlines into the build process.\n *\n * @see https://github.com/rolldown/tsdown\n *\n * @example\n * ```ts\n * // tsdown.config.ts\n * import withPowerlines from \"powerlines/tsdown\";\n *\n * export default withPowerlines({\n * entry: [\"src/index.ts\"],\n * format: [\"cjs\", \"esm\"],\n * dts: true,\n * sourcemap: true,\n * clean: true,\n * });\n *\n * ```\n *\n * @param options - The Tsdown options to merge with the Powerlines configuration.\n * @returns The merged Tsdown configuration options.\n */\nexport function unplugin(options: UserConfig = {}): UserConfig {\n return {\n ...options,\n entry: options.entry,\n plugins: [\n rolldown({\n name: options.name,\n root: options.cwd ?? process.cwd(),\n output: {\n outputPath: options.outDir,\n format: resolveFromFormat(\n options.format as ModuleFormat | ModuleFormat[]\n ),\n assets: toArray(options.copy)\n .map(copy => {\n if (!copy) {\n return undefined;\n }\n\n if (isSetString(copy)) {\n return copy;\n }\n\n if (isFunction(copy)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based copy options are not supported in Powerlines.\"\n );\n\n return undefined;\n }\n\n return {\n input: copy.from,\n output: copy.to\n };\n })\n .filter(Boolean) as OutputConfig[\"assets\"]\n },\n resolve: {\n external: options.external\n ? (toArray(options.external)\n .map(external => {\n if (isFunction(external)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based external options are not supported in Powerlines.\"\n );\n\n return undefined;\n }\n\n return external;\n })\n .filter(Boolean) as ResolveConfig[\"external\"])\n : undefined,\n noExternal: options.noExternal\n ? (toArray(options.noExternal)\n .map(noExternal => {\n if (isFunction(noExternal)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Function-based noExternal options are not supported in Powerlines.\"\n );\n\n return undefined;\n }\n\n return noExternal;\n })\n .filter(Boolean) as ResolveConfig[\"noExternal\"])\n : undefined\n },\n rolldown: options.inputOptions as RolldownOptions,\n tsconfig: isSetString(options.tsconfig) ? options.tsconfig : undefined\n })\n ]\n };\n}\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,SAAS,UAAsB,EAAE,EAAc;AAC7D,QAAO;EACL,GAAG;EACH,OAAO,QAAQ;EACf,SAAS,CACPA,WAAS;GACP,MAAM,QAAQ;GACd,MAAM,QAAQ,OAAO,QAAQ,KAAK;GAClC,QAAQ;IACN,YAAY,QAAQ;IACpB,QAAQ,kBACN,QAAQ,OACT;IACD,QAAQ,QAAQ,QAAQ,KAAK,CAC1B,KAAI,SAAQ;AACX,SAAI,CAAC,KACH;AAGF,SAAI,YAAY,KAAK,CACnB,QAAO;AAGT,SAAI,WAAW,KAAK,EAAE;AAEpB,cAAQ,KACN,+DACD;AAED;;AAGF,YAAO;MACL,OAAO,KAAK;MACZ,QAAQ,KAAK;MACd;MACD,CACD,OAAO,QAAQ;IACnB;GACD,SAAS;IACP,UAAU,QAAQ,WACb,QAAQ,QAAQ,SAAS,CACvB,KAAI,aAAY;AACf,SAAI,WAAW,SAAS,EAAE;AAExB,cAAQ,KACN,mEACD;AAED;;AAGF,YAAO;MACP,CACD,OAAO,QAAQ,GAClB;IACJ,YAAY,QAAQ,aACf,QAAQ,QAAQ,WAAW,CACzB,KAAI,eAAc;AACjB,SAAI,WAAW,WAAW,EAAE;AAE1B,cAAQ,KACN,qEACD;AAED;;AAGF,YAAO;MACP,CACD,OAAO,QAAQ,GAClB;IACL;GACD,UAAU,QAAQ;GAClB,UAAU,YAAY,QAAQ,SAAS,GAAG,QAAQ,WAAW;GAC9D,CAAC,CACH;EACF"}
package/dist/tsup.cjs CHANGED
@@ -1,128 +1,14 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-GPlMYw0d.cjs');
4
- require('./tsconfig-C8M8X6U0.cjs');
5
- require('./plugin-utils-Ck3cx3w6.cjs');
6
- require('./plugin-CZ_PJPpQ.cjs');
7
- require('./paths-YmyIGEVo.cjs');
8
- require('./constants-CZh5rsgh.cjs');
9
- require('./config-D86Vw7SC.cjs');
10
- require('./utils-BbDma_5Y.cjs');
11
- require('./virtual-B1MLgqnQ.cjs');
12
- const require_resolve_options = require('./resolve-options-BQnTgg3V.cjs');
13
- const require_esbuild = require('./esbuild-B3NuCco0.cjs');
14
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
15
- let __stryke_helpers_omit = require("@stryke/helpers/omit");
16
- let __stryke_path_append = require("@stryke/path/append");
17
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
18
- let defu = require("defu");
19
- defu = require_chunk.__toESM(defu);
20
- let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
21
- let unplugin = require("unplugin");
22
- let __storm_software_tsup = require("@storm-software/tsup");
23
- let __storm_software_tsup_constants = require("@storm-software/tsup/constants");
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_chunk = require('./chunk-AIJqnxB6.cjs');
3
+ require('./api-Zx_hzL3g.cjs');
4
+ require('./tsconfig-BJrUrPC_.cjs');
5
+ require('./virtual-Cbvj12lU.cjs');
6
+ const require_esbuild = require('./esbuild.cjs');
7
+ let _stryke_helpers_omit = require("@stryke/helpers/omit");
8
+ let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
9
+ let _powerlines_plugin_tsup = require("@powerlines/plugin-tsup");
10
+ _powerlines_plugin_tsup = require_chunk.__toESM(_powerlines_plugin_tsup);
24
11
 
25
- //#region ../plugin-tsup/src/helpers/resolve-options.ts
26
- const DEFAULT_TSUP_CONFIG = {
27
- ...__storm_software_tsup_constants.DEFAULT_BUILD_OPTIONS,
28
- target: "esnext",
29
- config: false,
30
- minify: true,
31
- sourcemap: false,
32
- cjsInterop: true,
33
- bundle: true,
34
- dts: true,
35
- shims: true,
36
- silent: true,
37
- treeshake: true,
38
- keepNames: true,
39
- splitting: true,
40
- banner: {}
41
- };
42
- /**
43
- * Resolves the entry options for [tsup](https://github.com/egoist/tsup).
44
- *
45
- * @param context - The build context.
46
- * @param entryPoints - The entry points to resolve.
47
- * @returns The resolved entry options.
48
- */
49
- function resolveEntry$1(context, entryPoints) {
50
- return require_resolve_options.resolveEntry(context, entryPoints);
51
- }
52
- /**
53
- * Resolves the options for [tsup](https://github.com/egoist/tsup).
54
- *
55
- * @param context - The build context.
56
- * @returns The resolved options.
57
- */
58
- function resolveOptions(context) {
59
- const result = (0, defu.default)({
60
- entry: Object.fromEntries(Object.entries(resolveEntry$1(context, context.entry)).map(([key, value]) => [key, (0, __stryke_path_append.appendPath)(value, context.config.root)])),
61
- esbuildOptions: ((options, ctx) => {
62
- if (context.config.tsup?.esbuildOptions) context.config.tsup?.esbuildOptions?.(options, ctx);
63
- options.alias = {
64
- ...context.alias,
65
- ...context.builtins.reduce((ret, id) => {
66
- const path = context.fs.paths[id];
67
- if (path) ret[id] = path;
68
- return ret;
69
- }, {}),
70
- ...options.alias
71
- };
72
- }),
73
- noExternal: context.builtins
74
- }, context.config.tsup ? context.config.tsup : {}, {
75
- name: context.config.name,
76
- root: context.config.root,
77
- projectRoot: context.config.root,
78
- assets: context.config.output.assets,
79
- resolveExtensions: context.config.resolve.extensions,
80
- outputPath: context.config.output.buildPath,
81
- tsconfig: context.tsconfig.tsconfigFilePath,
82
- dts: context.config.tsup && !context.config.tsup?.experimentalDts ? { compilerOptions: context.tsconfig.tsconfigJson.compilerOptions } : void 0,
83
- format: context.config.output.format,
84
- mode: context.config.mode,
85
- treeshake: context.config.tsup ? context.config.tsup?.treeshake : void 0,
86
- minify: context.config.mode !== "development",
87
- metafile: context.config.mode === "development",
88
- sourcemap: context.config.mode === "development",
89
- silent: context.config.logLevel === null || context.config.mode === "production",
90
- verbose: context.config.logLevel === null || context.config.logLevel === "trace" || context.config.mode === "development",
91
- workspaceConfig: { workspaceRoot: context.workspaceConfig.workspaceRoot }
92
- }, DEFAULT_TSUP_CONFIG);
93
- result.format = (0, __stryke_helpers_get_unique.getUnique)((0, __stryke_convert_to_array.toArray)(result.format));
94
- return result;
95
- }
96
-
97
- //#endregion
98
- //#region ../plugin-tsup/src/helpers/unplugin.ts
99
- function createTsupPlugin(context) {
100
- return (0, unplugin.createEsbuildPlugin)(require_api.createUnplugin(context))({});
101
- }
102
-
103
- //#endregion
104
- //#region ../plugin-tsup/src/index.ts
105
- /**
106
- * A Powerlines plugin to use Tsup to build the project.
107
- */
108
- const plugin = (options = {}) => {
109
- return {
110
- name: "tsup",
111
- config() {
112
- this.debug("Providing default configuration for the Powerlines `tsup` build plugin.");
113
- return {
114
- output: { format: ["cjs", "esm"] },
115
- tsup: { ...options }
116
- };
117
- },
118
- async build() {
119
- return (0, __storm_software_tsup.build)(await (0, __storm_software_tsup.resolveOptions)((0, defu.default)(resolveOptions(this), { esbuildPlugins: [createTsupPlugin(this)] })));
120
- }
121
- };
122
- };
123
- var src_default = plugin;
124
-
125
- //#endregion
126
12
  //#region src/tsup.ts
127
13
  /**
128
14
  * A Tsup configuration function that integrates Powerlines into the build process.
@@ -147,16 +33,16 @@ var src_default = plugin;
147
33
  * @param options - The Tsup options to merge with the Powerlines configuration.
148
34
  * @returns The merged Tsup configuration options.
149
35
  */
150
- function unplugin$1(options = {}) {
36
+ function unplugin(options = {}) {
151
37
  return {
152
38
  ...options,
153
- esbuildPlugins: [require_esbuild.esbuild_default({
39
+ esbuildPlugins: [require_esbuild.default({
154
40
  output: {
155
41
  outputPath: options.outDir,
156
42
  format: options.format
157
43
  },
158
44
  esbuild: {
159
- ...(0, __stryke_helpers_omit.omit)(options, [
45
+ ...(0, _stryke_helpers_omit.omit)(options, [
160
46
  "plugins",
161
47
  "banner",
162
48
  "footer",
@@ -168,16 +54,25 @@ function unplugin$1(options = {}) {
168
54
  "inject"
169
55
  ]),
170
56
  minify: Boolean(options.minify),
171
- pure: Array.isArray(options.pure) ? options.pure : (0, __stryke_type_checks_is_string.isString)(options.pure) ? [options.pure] : []
57
+ pure: Array.isArray(options.pure) ? options.pure : (0, _stryke_type_checks_is_string.isString)(options.pure) ? [options.pure] : []
172
58
  }
173
59
  })]
174
60
  };
175
61
  }
176
- var tsup_default = unplugin$1;
177
62
 
178
63
  //#endregion
179
- exports.default = tsup_default;
180
- exports["module.exports"] = unplugin$1;
181
- exports.unplugin = unplugin$1;
182
- exports.plugin = src_default;
183
- exports.tsup = src_default;
64
+ exports.default = unplugin;
65
+ exports["module.exports"] = unplugin;
66
+ exports.unplugin = unplugin;
67
+ Object.defineProperty(exports, 'plugin', {
68
+ enumerable: true,
69
+ get: function () {
70
+ return _powerlines_plugin_tsup.default;
71
+ }
72
+ });
73
+ Object.defineProperty(exports, 'tsup', {
74
+ enumerable: true,
75
+ get: function () {
76
+ return _powerlines_plugin_tsup.default;
77
+ }
78
+ });
package/dist/tsup.d.cts CHANGED
@@ -1,28 +1,6 @@
1
- import { Et as PluginContext, er as Plugin, j as ResolvedConfig } from "./config-vnrrSxEB.cjs";
2
1
  import { Options } from "tsup";
3
- import { BuildOptions } from "@storm-software/tsup/types";
2
+ import plugin, { default as tsup } from "@powerlines/plugin-tsup";
4
3
 
5
- //#region ../plugin-tsup/src/types/build.d.ts
6
- type TsupOptions = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">>;
7
- //#endregion
8
- //#region ../plugin-tsup/src/types/plugin.d.ts
9
- type TsupPluginOptions = Partial<TsupOptions>;
10
- interface TsupPluginResolvedConfig extends ResolvedConfig {
11
- tsup: TsupOptions;
12
- }
13
- type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
14
- //#endregion
15
- //#region ../plugin-tsup/src/index.d.ts
16
- declare module "@powerlines/core" {
17
- interface Config {
18
- tsup?: TsupPluginOptions;
19
- }
20
- }
21
- /**
22
- * A Powerlines plugin to use Tsup to build the project.
23
- */
24
- declare const plugin: <TContext extends TsupPluginContext = TsupPluginContext>(options?: TsupPluginOptions) => Plugin<TContext>;
25
- //#endregion
26
4
  //#region src/tsup.d.ts
27
5
  /**
28
6
  * A Tsup configuration function that integrates Powerlines into the build process.
@@ -49,5 +27,5 @@ declare const plugin: <TContext extends TsupPluginContext = TsupPluginContext>(o
49
27
  */
50
28
  declare function unplugin(options?: Options): Options;
51
29
  //#endregion
52
- export { unplugin as default, unplugin as "module.exports", unplugin, plugin, plugin as tsup };
30
+ export { unplugin as default, unplugin as "module.exports", unplugin, plugin, tsup };
53
31
  //# sourceMappingURL=tsup.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsup.d.cts","names":[],"sources":["../../plugin-tsup/src/types/build.ts","../../plugin-tsup/src/types/plugin.ts","../../plugin-tsup/src/index.ts","../src/tsup.ts"],"sourcesContent":[],"mappings":";;;;;KAoBY,WAAA,GAAc,QACxB,KACE;;;KCDQ,iBAAA,GAAoB,QAAQ;ADCpC,UCKa,wBAAA,SAAiC,cDL9C,CAAA;EADF,IAAA,ECOM,WDPN;;AAD+B,KCWrB,iBDXqB,CAAA,wBCYP,wBDZO,GCYoB,wBDZpB,CAAA,GCa7B,aDb6B,CCaf,eDbe,CAAA;;;;EAArB,UAAA,MAAW,CAAA;IAEnB,IAAA,CAAA,EEeO,iBFfP;EADF;;;;;cEuBW,0BAA2B,oBAAoB,6BACjD,sBACR,OAAO;;;;;;AF1BV;;;;;;;;ACCA;AAMA;AAIA;;;;;;;;;ACEwB;AAAA,iBCeR,QAAA,CDfQ,OAAA,CAAA,ECeU,ODfV,CAAA,ECeyB,ODfzB"}
1
+ {"version":3,"file":"tsup.d.cts","names":[],"sources":["../src/tsup.ts"],"mappings":";;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;iBAAgB,QAAA,CAAS,OAAA,GAAS,OAAA,GAAe,OAAA"}
package/dist/tsup.d.mts CHANGED
@@ -1,32 +1,6 @@
1
- import { Et as PluginContext, er as Plugin, j as ResolvedConfig } from "./config-CK756s0L.mjs";
2
- import "./config-CiPXgwzt.mjs";
3
- import "./index-C7W0kmm7.mjs";
4
- import "./index-2JXW-b2-.mjs";
5
- import { resolveOptions } from "@storm-software/tsup";
1
+ import plugin, { default as tsup } from "@powerlines/plugin-tsup";
6
2
  import { Options } from "tsup";
7
- import { BuildOptions as BuildOptions$1 } from "@storm-software/tsup/types";
8
3
 
9
- //#region ../plugin-tsup/src/types/build.d.ts
10
- type TsupOptions = Partial<Omit<BuildOptions$1, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">>;
11
- //#endregion
12
- //#region ../plugin-tsup/src/types/plugin.d.ts
13
- type TsupPluginOptions = Partial<TsupOptions>;
14
- interface TsupPluginResolvedConfig extends ResolvedConfig {
15
- tsup: TsupOptions;
16
- }
17
- type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
18
- //#endregion
19
- //#region ../plugin-tsup/src/index.d.ts
20
- declare module "@powerlines/core" {
21
- interface Config {
22
- tsup?: TsupPluginOptions;
23
- }
24
- }
25
- /**
26
- * A Powerlines plugin to use Tsup to build the project.
27
- */
28
- declare const plugin: <TContext extends TsupPluginContext = TsupPluginContext>(options?: TsupPluginOptions) => Plugin<TContext>;
29
- //#endregion
30
4
  //#region src/tsup.d.ts
31
5
  /**
32
6
  * A Tsup configuration function that integrates Powerlines into the build process.
@@ -53,5 +27,5 @@ declare const plugin: <TContext extends TsupPluginContext = TsupPluginContext>(o
53
27
  */
54
28
  declare function unplugin(options?: Options): Options;
55
29
  //#endregion
56
- export { unplugin as default, unplugin as "module.exports", unplugin, plugin, plugin as tsup };
30
+ export { unplugin as default, unplugin as "module.exports", unplugin, plugin, tsup };
57
31
  //# sourceMappingURL=tsup.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsup.d.mts","names":[],"sources":["../../plugin-tsup/src/types/build.ts","../../plugin-tsup/src/types/plugin.ts","../../plugin-tsup/src/index.ts","../src/tsup.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAoBY,WAAA,GAAc,QACxB,KACE;;;KCDQ,iBAAA,GAAoB,QAAQ;UAMvB,wBAAA,SAAiC;QAC1C;;ADRI,KCWA,iBDXW,CAAA,wBCYG,wBDZH,GCY8B,wBDZ9B,CAAA,GCanB,aDbmB,CCaL,eDbK,CAAA;;;;;WEiBZ;;;AFjBX;;;AAA0B,cEwBb,MFxBa,EAAA,CAAA,iBEwBc,iBFxBd,GEwBkC,iBFxBlC,CAAA,CAAA,OAAA,CAAA,EEyBf,iBFzBe,EAAA,GE0BvB,MF1BuB,CE0BhB,QF1BgB,CAAA;;;;;;;;;;AAA1B;;;;;;;;ACCA;AAMA;AAIA;;;;;;iBEiBgB,QAAA,WAAkB,UAAe"}
1
+ {"version":3,"file":"tsup.d.mts","names":[],"sources":["../src/tsup.ts"],"mappings":";;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;iBAAgB,QAAA,CAAS,OAAA,GAAS,OAAA,GAAe,OAAA"}