powerlines 0.40.4 → 0.40.6

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 (131) hide show
  1. package/dist/{api-XX-usBTN.cjs → api-ueEGTUrK.cjs} +1 -1
  2. package/dist/{api-BaHkkIMl.mjs → api-uwZyIenK.mjs} +2 -2
  3. package/dist/{api-BaHkkIMl.mjs.map → api-uwZyIenK.mjs.map} +1 -1
  4. package/dist/astro.cjs +2 -2
  5. package/dist/astro.d.cts +1 -1
  6. package/dist/astro.d.mts +5 -5
  7. package/dist/astro.mjs +2 -2
  8. package/dist/{config-BNcBL0tI.d.cts → config-B3Xvipn4.d.cts} +13 -8
  9. package/dist/config-B3Xvipn4.d.cts.map +1 -0
  10. package/dist/{config-jcYnkMvq.d.mts → config-BLihpN3D.d.mts} +13 -8
  11. package/dist/config-BLihpN3D.d.mts.map +1 -0
  12. package/dist/{config-Bu97tgeF.d.cts → config-C60sAYU4.d.cts} +2 -2
  13. package/dist/{config-Bu97tgeF.d.cts.map → config-C60sAYU4.d.cts.map} +1 -1
  14. package/dist/{config-D2cqq84p.d.mts → config-CzpJjE2i.d.mts} +2 -2
  15. package/dist/{config-D2cqq84p.d.mts.map → config-CzpJjE2i.d.mts.map} +1 -1
  16. package/dist/config.d.cts +1 -1
  17. package/dist/config.d.mts +2 -2
  18. package/dist/context/index.cjs +1 -1
  19. package/dist/context/index.d.cts +1 -1
  20. package/dist/context/index.d.mts +4 -4
  21. package/dist/context/index.mjs +1 -1
  22. package/dist/{esbuild-aZZE7sY8.mjs → esbuild-96YIeiTP.mjs} +2 -2
  23. package/dist/esbuild-96YIeiTP.mjs.map +1 -0
  24. package/dist/{esbuild-osvOb1W1.cjs → esbuild-CEXj4fF-.cjs} +1 -1
  25. package/dist/esbuild.cjs +2 -2
  26. package/dist/esbuild.d.cts +2 -2
  27. package/dist/esbuild.d.cts.map +1 -1
  28. package/dist/esbuild.d.mts +5 -5
  29. package/dist/esbuild.mjs +2 -2
  30. package/dist/farm.cjs +1 -1
  31. package/dist/farm.d.cts +1 -1
  32. package/dist/farm.d.mts +4 -4
  33. package/dist/farm.mjs +1 -1
  34. package/dist/{index-DP6juTGE.d.mts → index-Ct46ECR2.d.mts} +3 -3
  35. package/dist/index-Ct46ECR2.d.mts.map +1 -0
  36. package/dist/{index-4WNH8dg3.d.mts → index-DQR_ke3L.d.mts} +2 -2
  37. package/dist/{index-4WNH8dg3.d.mts.map → index-DQR_ke3L.d.mts.map} +1 -1
  38. package/dist/{index-BjLkEvse.d.mts → index-DT3dtimM.d.mts} +2 -2
  39. package/dist/{index-BjLkEvse.d.mts.map → index-DT3dtimM.d.mts.map} +1 -1
  40. package/dist/{index-Cie2X8UH.d.cts → index-Dv0-yJZY.d.cts} +2 -2
  41. package/dist/{index-Cie2X8UH.d.cts.map → index-Dv0-yJZY.d.cts.map} +1 -1
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.d.cts +6 -6
  44. package/dist/index.d.mts +6 -6
  45. package/dist/index.mjs +1 -1
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/next.cjs +2 -2
  48. package/dist/next.mjs +2 -2
  49. package/dist/nuxt.cjs +3 -3
  50. package/dist/nuxt.d.cts +1 -1
  51. package/dist/nuxt.d.mts +4 -4
  52. package/dist/nuxt.mjs +3 -3
  53. package/dist/{plugin-CO_BQ0th.d.cts → plugin-CiMsERtX.d.mts} +2 -2
  54. package/dist/{plugin-CO_BQ0th.d.cts.map → plugin-CiMsERtX.d.mts.map} +1 -1
  55. package/dist/{plugin-CvPFipli.d.cts → plugin-D6FK1hDg.d.cts} +2 -2
  56. package/dist/{plugin-CvPFipli.d.cts.map → plugin-D6FK1hDg.d.cts.map} +1 -1
  57. package/dist/{plugin-xJ2LIFca.d.mts → plugin-DtbGNmRb.d.cts} +2 -2
  58. package/dist/{plugin-xJ2LIFca.d.mts.map → plugin-DtbGNmRb.d.cts.map} +1 -1
  59. package/dist/plugin-utils.d.cts +1 -1
  60. package/dist/plugin-utils.d.mts +5 -5
  61. package/dist/{rolldown-Bn7LucRb.cjs → rolldown-HK_tcIYk.cjs} +1 -1
  62. package/dist/{rolldown-DW7PjwCw.mjs → rolldown-hfbpeP_b.mjs} +2 -2
  63. package/dist/rolldown-hfbpeP_b.mjs.map +1 -0
  64. package/dist/rolldown.cjs +2 -2
  65. package/dist/rolldown.d.cts +2 -2
  66. package/dist/rolldown.d.cts.map +1 -1
  67. package/dist/rolldown.d.mts +5 -5
  68. package/dist/rolldown.mjs +2 -2
  69. package/dist/rollup.cjs +1 -1
  70. package/dist/rollup.d.cts +2 -2
  71. package/dist/rollup.d.cts.map +1 -1
  72. package/dist/rollup.d.mts +5 -5
  73. package/dist/rollup.mjs +1 -1
  74. package/dist/rollup.mjs.map +1 -1
  75. package/dist/rspack.cjs +1 -1
  76. package/dist/rspack.d.cts +1 -1
  77. package/dist/rspack.d.mts +4 -4
  78. package/dist/rspack.mjs +1 -1
  79. package/dist/storage/index.d.cts +1 -1
  80. package/dist/storage/index.d.mts +4 -4
  81. package/dist/tsdown.cjs +2 -2
  82. package/dist/tsdown.d.cts +2 -2
  83. package/dist/tsdown.d.cts.map +1 -1
  84. package/dist/tsdown.d.mts +5 -5
  85. package/dist/tsdown.mjs +2 -2
  86. package/dist/tsdown.mjs.map +1 -1
  87. package/dist/tsup.cjs +2 -2
  88. package/dist/tsup.d.cts +2 -2
  89. package/dist/tsup.d.cts.map +1 -1
  90. package/dist/tsup.d.mts +5 -5
  91. package/dist/tsup.mjs +2 -2
  92. package/dist/tsup.mjs.map +1 -1
  93. package/dist/typescript/index.d.cts +1 -1
  94. package/dist/typescript/index.d.mts +4 -4
  95. package/dist/unloader.cjs +1 -1
  96. package/dist/unloader.d.cts +1 -1
  97. package/dist/unloader.d.mts +4 -4
  98. package/dist/unloader.mjs +1 -1
  99. package/dist/unplugin.cjs +1 -1
  100. package/dist/unplugin.d.cts +2 -2
  101. package/dist/unplugin.d.mts +4 -4
  102. package/dist/unplugin.mjs +1 -1
  103. package/dist/utils-DoQcX7Sk.mjs.map +1 -1
  104. package/dist/utils.d.cts +1 -1
  105. package/dist/utils.d.mts +2 -2
  106. package/dist/{vite-BqvfCVtZ.cjs → vite-C5ugBozl.cjs} +1 -1
  107. package/dist/{vite-D-iV7jRu.mjs → vite-CDaAk_01.mjs} +2 -2
  108. package/dist/vite-CDaAk_01.mjs.map +1 -0
  109. package/dist/vite.cjs +2 -2
  110. package/dist/vite.d.cts +3 -3
  111. package/dist/vite.d.cts.map +1 -1
  112. package/dist/vite.d.mts +6 -6
  113. package/dist/vite.mjs +2 -2
  114. package/dist/{webpack-D8CVT5MS.cjs → webpack-BoO5jxta.cjs} +1 -1
  115. package/dist/{webpack-HfqSdyWi.mjs → webpack-DFfpI4x6.mjs} +2 -2
  116. package/dist/{webpack-HfqSdyWi.mjs.map → webpack-DFfpI4x6.mjs.map} +1 -1
  117. package/dist/webpack.cjs +2 -2
  118. package/dist/webpack.d.cts +2 -2
  119. package/dist/webpack.d.cts.map +1 -1
  120. package/dist/webpack.d.mts +5 -5
  121. package/dist/webpack.mjs +2 -2
  122. package/dist/{write-file-DKA8GehT.d.cts → write-file-BXi3LP7l.d.cts} +3 -3
  123. package/dist/write-file-BXi3LP7l.d.cts.map +1 -0
  124. package/package.json +12 -12
  125. package/dist/config-BNcBL0tI.d.cts.map +0 -1
  126. package/dist/config-jcYnkMvq.d.mts.map +0 -1
  127. package/dist/esbuild-aZZE7sY8.mjs.map +0 -1
  128. package/dist/index-DP6juTGE.d.mts.map +0 -1
  129. package/dist/rolldown-DW7PjwCw.mjs.map +0 -1
  130. package/dist/vite-D-iV7jRu.mjs.map +0 -1
  131. package/dist/write-file-DKA8GehT.d.cts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolldown-hfbpeP_b.mjs","names":["createRolldownPlugin","build","createRolldownPlugin","plugin","defu"],"sources":["../../plugin-rolldown/src/helpers/unplugin.ts","../../plugin-rolldown/src/index.ts","../src/rolldown.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 { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { RolldownPluginContext } from \"../types/plugin\";\n\nexport function createRolldownPlugin(context: RolldownPluginContext) {\n return createEsbuildPlugin(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/types/plugin\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rolldown as build } from \"rolldown\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createRolldownPlugin } from \"./helpers/unplugin\";\nimport {\n RolldownPluginContext,\n RolldownPluginOptions,\n RolldownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rolldown?: RolldownPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RolldownPluginContext = RolldownPluginContext\n>(\n options: RolldownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rolldown\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rolldown: {\n ...options\n }\n } as Partial<RolldownPluginResolvedConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRolldownPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\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 { resolveOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport {\n RolldownPluginContext,\n RolldownPluginUserConfig\n} from \"@powerlines/plugin-rolldown/types/plugin\";\nimport { defu } from \"defu\";\nimport type { InputOptions } from \"rolldown\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport {\n default as plugin,\n default as rolldown\n} from \"@powerlines/plugin-rolldown\";\n\n/**\n * A Rolldown plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n * import powerlines from \"powerlines/rollup\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nexport const unplugin = createRolldownPlugin<Partial<RolldownPluginUserConfig>>(\n createUnpluginFactory<RolldownPluginContext>(\"rolldown\", (api, plugin) => {\n return {\n ...plugin,\n rolldown: {\n async options(options: InputOptions) {\n const merged = defu(await api.context.getEnvironment(), this);\n\n return defu(\n resolveOptions(merged),\n options,\n api.callHook(\n \"rolldown:options\",\n { environment: merged },\n options\n ) ?? {}\n );\n }\n }\n };\n })\n);\n\nexport { unplugin as \"module.exports\" };\n\nexport default unplugin;\n"],"mappings":";;;;;;;;AAsBA,SAAgBA,uBAAqB,SAAgC;AACnE,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC;;;;;;;;ACmBzD,MAAa,UAGX,UAAiC,EAAE,KACd;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,UAAU,EACR,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMC,SACnB,KACE,EACE,SAAS,CAACC,uBAAqB,KAAK,CAAC,EACtC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;AChCf,MAAa,WAAW,qBACtB,sBAA6C,aAAa,KAAK,aAAW;AACxE,QAAO;EACL,GAAGC;EACH,UAAU,EACR,MAAM,QAAQ,SAAuB;GACnC,MAAM,SAASC,OAAK,MAAM,IAAI,QAAQ,gBAAgB,EAAE,KAAK;AAE7D,UAAOA,OACL,eAAe,OAAO,EACtB,SACA,IAAI,SACF,oBACA,EAAE,aAAa,QAAQ,EACvB,QACD,IAAI,EAAE,CACR;KAEJ;EACF;EACD,CACH;AAID,uBAAe"}
package/dist/rolldown.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./api-XX-usBTN.cjs');
2
+ require('./api-ueEGTUrK.cjs');
3
3
  require('./tsconfig-C8M8X6U0.cjs');
4
4
  require('./plugin-utils-Ck3cx3w6.cjs');
5
5
  require('./plugin-CZ_PJPpQ.cjs');
@@ -10,7 +10,7 @@ require('./utils-BbDma_5Y.cjs');
10
10
  require('./virtual-B1MLgqnQ.cjs');
11
11
  require('./resolve-options-vyFhhkLp.cjs');
12
12
  require('./resolve-options-lxQ2pm0W.cjs');
13
- const require_rolldown = require('./rolldown-Bn7LucRb.cjs');
13
+ const require_rolldown = require('./rolldown-HK_tcIYk.cjs');
14
14
 
15
15
  exports.default = require_rolldown.rolldown_default;
16
16
  exports["module.exports"] = require_rolldown.unplugin;
@@ -1,4 +1,4 @@
1
- import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-BNcBL0tI.cjs";
1
+ import { Et as PluginContext, N as UserConfig, Qn as Plugin, j as ResolvedConfig } from "./config-B3Xvipn4.cjs";
2
2
  import * as rolldown0 from "rolldown";
3
3
  import { RolldownOptions } from "rolldown";
4
4
 
@@ -17,7 +17,7 @@ type RolldownPluginContext<TResolvedConfig extends RolldownPluginResolvedConfig
17
17
  //#endregion
18
18
  //#region ../plugin-rolldown/src/index.d.ts
19
19
  declare module "@powerlines/core" {
20
- interface BaseConfig {
20
+ interface Config {
21
21
  rolldown?: RolldownPluginOptions;
22
22
  }
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rolldown.d.cts","names":[],"sources":["../../plugin-rolldown/src/types/build.ts","../../plugin-rolldown/src/types/plugin.ts","../../plugin-rolldown/src/index.ts","../src/rolldown.ts"],"sourcesContent":[],"mappings":";;;;;KAoBY,iBAAA,GAAkB,KAC5B;;;KCAU,qBAAA,GAAwB,QAAQ;UAE3B,wBAAA,SAAiC;YACtC;ADJZ;UCOiB,4BAAA,SAAqC;YAC1C;;AAPA,KAUA,qBAVqB,CAAA,wBAWP,4BAXiB,GAYvC,4BAZuC,CAAA,GAavC,aAbuC,CAazB,eAbyB,CAAA;;;;EDD/B,UAAA,UAAe,CAAA;eEeZ;;;ADdf;AAEA;AAIA;AAIY,cCWC,MDXD,EAAqB,CAAA,iBCYd,qBDZc,GCYU,qBDZV,CAAA,CAAA,OAAA,CAAA,ECctB,qBDdsB,EAAA,GCe9B,MDf8B,CCevB,QDfuB,CAAA;;;;;;ADXjC;;;;ACCA;AAEA;AAIA;AAIA;;;;;AAGiB,cEcJ,QFdI,EAAA,CAAA,OAAA,EEcI,OFdJ,CEcI,wBFdJ,CAAA,EAAA,GEcI,SAAA,CAAA,MFdJ,CAAA,GAAA,CAAA,GEcI,SAAA,CAAA,MFdJ,CAAA,GAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"rolldown.d.cts","names":[],"sources":["../../plugin-rolldown/src/types/build.ts","../../plugin-rolldown/src/types/plugin.ts","../../plugin-rolldown/src/index.ts","../src/rolldown.ts"],"sourcesContent":[],"mappings":";;;;;KAoBY,iBAAA,GAAkB,KAC5B;;;KCAU,qBAAA,GAAwB,QAAQ;UAE3B,wBAAA,SAAiC;YACtC;ADJZ;UCOiB,4BAAA,SAAqC;YAC1C;;AAPA,KAUA,qBAVqB,CAAA,wBAWP,4BAXiB,GAYvC,4BAZuC,CAAA,GAavC,aAbuC,CAazB,eAbyB,CAAA;;;;EDD/B,UAAA,MAAA,CAAA;eEeG;;;ADdf;AAEA;AAIA;AAIY,cCWC,MDXD,EAAqB,CAAA,iBCYd,qBDZc,GCYU,qBDZV,CAAA,CAAA,OAAA,CAAA,ECctB,qBDdsB,EAAA,GCe9B,MDf8B,CCevB,QDfuB,CAAA;;;;;;ADXjC;;;;ACCA;AAEA;AAIA;AAIA;;;;;AAGiB,cEcJ,QFdI,EAAA,CAAA,OAAA,EEcI,OFdJ,CEcI,wBFdJ,CAAA,EAAA,GEcI,SAAA,CAAA,MFdJ,CAAA,GAAA,CAAA,GEcI,SAAA,CAAA,MFdJ,CAAA,GAAA,CAAA,EAAA"}
@@ -1,7 +1,7 @@
1
- import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-jcYnkMvq.mjs";
2
- import "./config-D2cqq84p.mjs";
3
- import "./index-DP6juTGE.mjs";
4
- import "./index-BjLkEvse.mjs";
1
+ import { Et as PluginContext, N as UserConfig, Qn as Plugin, j as ResolvedConfig } from "./config-BLihpN3D.mjs";
2
+ import "./config-CzpJjE2i.mjs";
3
+ import "./index-Ct46ECR2.mjs";
4
+ import "./index-DT3dtimM.mjs";
5
5
  import * as rolldown0 from "rolldown";
6
6
  import { RolldownOptions } from "rolldown";
7
7
 
@@ -20,7 +20,7 @@ type RolldownPluginContext<TResolvedConfig extends RolldownPluginResolvedConfig
20
20
  //#endregion
21
21
  //#region ../plugin-rolldown/src/index.d.ts
22
22
  declare module "@powerlines/core" {
23
- interface BaseConfig {
23
+ interface Config {
24
24
  rolldown?: RolldownPluginOptions;
25
25
  }
26
26
  }
package/dist/rolldown.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./api-BaHkkIMl.mjs";
1
+ import "./api-uwZyIenK.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -9,6 +9,6 @@ import "./utils-DoQcX7Sk.mjs";
9
9
  import "./virtual-B9imjOqe.mjs";
10
10
  import "./resolve-options-6sXFqzEA.mjs";
11
11
  import "./resolve-options-D-RGs8j8.mjs";
12
- import { n as unplugin, r as src_default, t as rolldown_default } from "./rolldown-DW7PjwCw.mjs";
12
+ import { n as unplugin, r as src_default, t as rolldown_default } from "./rolldown-hfbpeP_b.mjs";
13
13
 
14
14
  export { rolldown_default as default, unplugin as "module.exports", unplugin, src_default as plugin, src_default as rolldown };
package/dist/rollup.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-XX-usBTN.cjs');
3
+ const require_api = require('./api-ueEGTUrK.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
package/dist/rollup.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-BNcBL0tI.cjs";
1
+ import { Et as PluginContext, N as UserConfig, Qn as Plugin, j as ResolvedConfig } from "./config-B3Xvipn4.cjs";
2
2
  import * as rollup0 from "rollup";
3
3
  import { RollupOptions } from "rollup";
4
4
 
@@ -17,7 +17,7 @@ type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = Ro
17
17
  //#endregion
18
18
  //#region ../plugin-rollup/src/index.d.ts
19
19
  declare module "@powerlines/core" {
20
- interface BaseConfig {
20
+ interface Config {
21
21
  rollup?: RollupPluginOptions;
22
22
  }
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.d.cts","names":[],"sources":["../../plugin-rollup/src/types/build.ts","../../plugin-rollup/src/types/plugin.ts","../../plugin-rollup/src/index.ts","../src/rollup.ts"],"sourcesContent":[],"mappings":";;;;;KAoBY,eAAA,GAAgB,KAC1B;;;KCAU,mBAAA,GAAsB,QAAQ;UAEzB,sBAAA,SAA+B;UACtC;ADJV;UCOiB,0BAAA,SAAmC;UAC1C;;AAPE,KAUA,mBAVmB,CAAA,wBAWL,0BAXe,GAYrC,0BAZqC,CAAA,GAarC,aAbqC,CAavB,eAbuB,CAAA;;;;EDD7B,UAAA,UAAa,CAAA;aEeZ;;;ADdb;AAEA;AAIA;AAIY,cCWC,MDXkB,EAAA,CAAA,iBCYZ,mBDZY,GCYU,mBDZV,CAAA,CAAA,OAAA,CAAA,ECcpB,mBDdoB,EAAA,GCe5B,MDf4B,CCerB,QDfqB,CAAA;;;;;;ADX/B;;;;ACCA;AAEA;AAIA;AAIA;;;;;;cEYa,oBAAQ,QAAA,4BAAA,OAAA,CAAA,cAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"rollup.d.cts","names":[],"sources":["../../plugin-rollup/src/types/build.ts","../../plugin-rollup/src/types/plugin.ts","../../plugin-rollup/src/index.ts","../src/rollup.ts"],"sourcesContent":[],"mappings":";;;;;KAoBY,eAAA,GAAgB,KAC1B;;;KCAU,mBAAA,GAAsB,QAAQ;UAEzB,sBAAA,SAA+B;UACtC;ADJV;UCOiB,0BAAA,SAAmC;UAC1C;;AAPE,KAUA,mBAVmB,CAAA,wBAWL,0BAXe,GAYrC,0BAZqC,CAAA,GAarC,aAbqC,CAavB,eAbuB,CAAA;;;;EDD7B,UAAA,MAAA,CAAA;aEeC;;;ADdb;AAEA;AAIA;AAIY,cCWC,MDXkB,EAAA,CAAA,iBCYZ,mBDZY,GCYU,mBDZV,CAAA,CAAA,OAAA,CAAA,ECcpB,mBDdoB,EAAA,GCe5B,MDf4B,CCerB,QDfqB,CAAA;;;;;;ADX/B;;;;ACCA;AAEA;AAIA;AAIA;;;;;;cEYa,oBAAQ,QAAA,4BAAA,OAAA,CAAA,cAAA,OAAA,CAAA"}
package/dist/rollup.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-jcYnkMvq.mjs";
2
- import "./config-D2cqq84p.mjs";
3
- import "./index-DP6juTGE.mjs";
4
- import "./index-BjLkEvse.mjs";
1
+ import { Et as PluginContext, N as UserConfig, Qn as Plugin, j as ResolvedConfig } from "./config-BLihpN3D.mjs";
2
+ import "./config-CzpJjE2i.mjs";
3
+ import "./index-Ct46ECR2.mjs";
4
+ import "./index-DT3dtimM.mjs";
5
5
  import * as rollup0 from "rollup";
6
6
  import { RollupOptions } from "rollup";
7
7
 
@@ -20,7 +20,7 @@ type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = Ro
20
20
  //#endregion
21
21
  //#region ../plugin-rollup/src/index.d.ts
22
22
  declare module "@powerlines/core" {
23
- interface BaseConfig {
23
+ interface Config {
24
24
  rollup?: RollupPluginOptions;
25
25
  }
26
26
  }
package/dist/rollup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-BaHkkIMl.mjs";
1
+ import { a as createUnpluginFactory, o as createUnplugin } from "./api-uwZyIenK.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.mjs","names":["createRollupPlugin","build","createRollupPlugin"],"sources":["../../plugin-rollup/src/helpers/unplugin.ts","../../plugin-rollup/src/index.ts","../src/rollup.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 { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { RollupPluginContext } from \"../types/plugin\";\n\nexport function createRollupPlugin(context: RollupPluginContext) {\n return createEsbuildPlugin(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 { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRollupPlugin } from \"./helpers/unplugin\";\nimport {\n RollupPluginContext,\n RollupPluginOptions,\n RollupPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n rollup?: RollupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RollupPluginContext = RollupPluginContext\n>(\n options: RollupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rollup\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rollup: {\n ...options\n }\n } as Partial<RollupPluginUserConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRollupPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\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 { RollupPluginUserConfig } from \"@powerlines/plugin-rollup/types/plugin\";\nimport { createRollupPlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport {\n default as plugin,\n default as rollup\n} from \"@powerlines/plugin-rollup\";\n\n/**\n * A Rollup plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n *\n * import powerlines from \"powerlines/rollup\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nexport const unplugin = createRollupPlugin<Partial<RollupPluginUserConfig>>(\n createUnpluginFactory(\"rollup\")\n);\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,SAAgBA,qBAAmB,SAA8B;AAC/D,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC;;;;;;;;ACmBzD,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMC,OACnB,KACE,EACE,SAAS,CAACC,qBAAmB,KAAK,CAAC,EACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;;ACrCf,MAAa,WAAW,mBACtB,sBAAsB,SAAS,CAChC;AAED,qBAAe"}
1
+ {"version":3,"file":"rollup.mjs","names":["createRollupPlugin","build","createRollupPlugin"],"sources":["../../plugin-rollup/src/helpers/unplugin.ts","../../plugin-rollup/src/index.ts","../src/rollup.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 { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { RollupPluginContext } from \"../types/plugin\";\n\nexport function createRollupPlugin(context: RollupPluginContext) {\n return createEsbuildPlugin(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 { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRollupPlugin } from \"./helpers/unplugin\";\nimport {\n RollupPluginContext,\n RollupPluginOptions,\n RollupPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rollup?: RollupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RollupPluginContext = RollupPluginContext\n>(\n options: RollupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rollup\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rollup: {\n ...options\n }\n } as Partial<RollupPluginUserConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRollupPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\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 { RollupPluginUserConfig } from \"@powerlines/plugin-rollup/types/plugin\";\nimport { createRollupPlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport {\n default as plugin,\n default as rollup\n} from \"@powerlines/plugin-rollup\";\n\n/**\n * A Rollup plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n *\n * import powerlines from \"powerlines/rollup\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nexport const unplugin = createRollupPlugin<Partial<RollupPluginUserConfig>>(\n createUnpluginFactory(\"rollup\")\n);\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,SAAgBA,qBAAmB,SAA8B;AAC/D,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC;;;;;;;;ACmBzD,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMC,OACnB,KACE,EACE,SAAS,CAACC,qBAAmB,KAAK,CAAC,EACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;;ACrCf,MAAa,WAAW,mBACtB,sBAAsB,SAAS,CAChC;AAED,qBAAe"}
package/dist/rspack.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-XX-usBTN.cjs');
3
+ const require_api = require('./api-ueEGTUrK.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
package/dist/rspack.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-BNcBL0tI.cjs";
1
+ import { Et as PluginContext, N as UserConfig, Qn as Plugin, j as ResolvedConfig } from "./config-B3Xvipn4.cjs";
2
2
  import * as unplugin0 from "unplugin";
3
3
  import { Configuration } from "@rspack/core";
4
4
 
package/dist/rspack.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-jcYnkMvq.mjs";
2
- import "./config-D2cqq84p.mjs";
3
- import "./index-DP6juTGE.mjs";
4
- import "./index-BjLkEvse.mjs";
1
+ import { Et as PluginContext, N as UserConfig, Qn as Plugin, j as ResolvedConfig } from "./config-BLihpN3D.mjs";
2
+ import "./config-CzpJjE2i.mjs";
3
+ import "./index-Ct46ECR2.mjs";
4
+ import "./index-DT3dtimM.mjs";
5
5
  import * as unplugin0 from "unplugin";
6
6
  import { Configuration } from "@rspack/core";
7
7
 
package/dist/rspack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-BaHkkIMl.mjs";
1
+ import { a as createUnpluginFactory, o as createUnplugin } from "./api-uwZyIenK.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -1,4 +1,4 @@
1
- import { Ir as StorageAdapter, Rr as StoragePreset, _t as Context } from "../config-BNcBL0tI.cjs";
1
+ import { Br as StoragePreset, Rr as StorageAdapter, _t as Context } from "../config-B3Xvipn4.cjs";
2
2
  import { MaybePromise } from "@stryke/types/base";
3
3
  import { writeFile, writeFileSync } from "@stryke/fs/write-file";
4
4
 
@@ -1,7 +1,7 @@
1
- import { Ir as StorageAdapter, Rr as StoragePreset, _t as Context } from "../config-jcYnkMvq.mjs";
2
- import "../config-D2cqq84p.mjs";
3
- import "../index-DP6juTGE.mjs";
4
- import "../index-BjLkEvse.mjs";
1
+ import { Br as StoragePreset, Rr as StorageAdapter, _t as Context } from "../config-BLihpN3D.mjs";
2
+ import "../config-CzpJjE2i.mjs";
3
+ import "../index-Ct46ECR2.mjs";
4
+ import "../index-DT3dtimM.mjs";
5
5
  import "../types-Bh_vLuQ0.mjs";
6
6
  import { writeFile, writeFileSync } from "@stryke/fs/write-file";
7
7
  import { MaybePromise } from "@stryke/types/base";
package/dist/tsdown.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-XX-usBTN.cjs');
3
+ const require_api = require('./api-ueEGTUrK.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  const require_plugin_utils = require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
@@ -11,7 +11,7 @@ require('./utils-BbDma_5Y.cjs');
11
11
  require('./virtual-B1MLgqnQ.cjs');
12
12
  require('./resolve-options-vyFhhkLp.cjs');
13
13
  require('./resolve-options-lxQ2pm0W.cjs');
14
- const require_rolldown = require('./rolldown-Bn7LucRb.cjs');
14
+ const require_rolldown = require('./rolldown-HK_tcIYk.cjs');
15
15
  let __stryke_convert_to_array = require("@stryke/convert/to-array");
16
16
  let __stryke_path_append = require("@stryke/path/append");
17
17
  let __stryke_path_join_paths = require("@stryke/path/join-paths");
package/dist/tsdown.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Et as PluginContext, Zn as Plugin, j as ResolvedConfig } from "./config-BNcBL0tI.cjs";
1
+ import { Et as PluginContext, Qn as Plugin, j as ResolvedConfig } from "./config-B3Xvipn4.cjs";
2
2
  import { UserConfig } from "tsdown/config";
3
3
  import { UserConfig as UserConfig$1 } from "tsdown";
4
4
 
@@ -14,7 +14,7 @@ type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = Ts
14
14
  //#endregion
15
15
  //#region ../plugin-tsdown/src/index.d.ts
16
16
  declare module "@powerlines/core" {
17
- interface BaseConfig {
17
+ interface Config {
18
18
  tsdown?: TsdownPluginOptions;
19
19
  }
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.d.cts","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;ADCtC,UCKa,0BAAA,SAAmC,cDLhD,CAAA;EADF,MAAA,ECOQ,aDPR;;AADiC,KCWvB,mBDXuB,CAAA,wBCYT,0BDZS,GCa/B,0BDb+B,CAAA,GCc/B,aDd+B,CCcjB,eDdiB,CAAA;;;;EAAvB,UAAA,UAAa,CAAA;IAErB,MAAA,CAAA,EEaS,mBFbT;EADF;;;;;cEqBW,0BACM,sBAAsB,+BAE9B,wBACR,OAAO;;;;;;AF1BV;;;;;;;;ACCA;AAMA;AAIA;;;;;;;;;ACAwB;AAAA,iBCyBR,QAAA,CDzBQ,OAAA,CAAA,ECyBU,UDzBV,CAAA,ECyB4B,UDzB5B"}
1
+ {"version":3,"file":"tsdown.d.cts","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;ADCtC,UCKa,0BAAA,SAAmC,cDLhD,CAAA;EADF,MAAA,ECOQ,aDPR;;AADiC,KCWvB,mBDXuB,CAAA,wBCYT,0BDZS,GCa/B,0BDb+B,CAAA,GCc/B,aDd+B,CCcjB,eDdiB,CAAA;;;;EAAvB,UAAA,MAAa,CAAA;IAErB,MAAA,CAAA,EEaS,mBFbT;EADF;;;;;cEqBW,0BACM,sBAAsB,+BAE9B,wBACR,OAAO;;;;;;AF1BV;;;;;;;;ACCA;AAMA;AAIA;;;;;;;;;ACA6B;AAAA,iBCyBb,QAAA,CDzBa,OAAA,CAAA,ECyBK,UDzBL,CAAA,ECyBuB,UDzBvB"}
package/dist/tsdown.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { Et as PluginContext, Zn as Plugin, j as ResolvedConfig } from "./config-jcYnkMvq.mjs";
2
- import "./config-D2cqq84p.mjs";
3
- import "./index-DP6juTGE.mjs";
4
- import "./index-BjLkEvse.mjs";
1
+ import { Et as PluginContext, Qn as Plugin, j as ResolvedConfig } from "./config-BLihpN3D.mjs";
2
+ import "./config-CzpJjE2i.mjs";
3
+ import "./index-Ct46ECR2.mjs";
4
+ import "./index-DT3dtimM.mjs";
5
5
  import { UserConfig } from "tsdown";
6
6
  import { Format } from "@storm-software/build-tools/types";
7
7
  import { UserConfig as UserConfig$1 } from "tsdown/config";
@@ -18,7 +18,7 @@ type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = Ts
18
18
  //#endregion
19
19
  //#region ../plugin-tsdown/src/index.d.ts
20
20
  declare module "@powerlines/core" {
21
- interface BaseConfig {
21
+ interface Config {
22
22
  tsdown?: TsdownPluginOptions;
23
23
  }
24
24
  }
package/dist/tsdown.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { o as createUnplugin } from "./api-BaHkkIMl.mjs";
1
+ import { o as createUnplugin } from "./api-uwZyIenK.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import { r as formatPackageJson, w as getDependencyConfig } from "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -9,7 +9,7 @@ import "./utils-DoQcX7Sk.mjs";
9
9
  import "./virtual-B9imjOqe.mjs";
10
10
  import "./resolve-options-6sXFqzEA.mjs";
11
11
  import "./resolve-options-D-RGs8j8.mjs";
12
- import { t as rolldown_default } from "./rolldown-DW7PjwCw.mjs";
12
+ import { t as rolldown_default } from "./rolldown-hfbpeP_b.mjs";
13
13
  import { toArray } from "@stryke/convert/to-array";
14
14
  import { appendPath } from "@stryke/path/append";
15
15
  import { joinPaths } from "@stryke/path/join-paths";
@@ -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: true,\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 * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\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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AAE;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;;AAGH,qBAAe"}
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: true,\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":";;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAaA,wBAA+C;CAC1D,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,cAAc;CACd,OAAO;CACR;;;;;;;AAQD,SAAgB,cAAc,SAA6C;AACzE,QAAO,QAAQ,QAAQ,CAAC,KAAI,WAAU;AACpC,UAAQ,QAAR;GACE,KAAK,MACH,QAAO;GACT,KAAK,OACH,QAAO;GACT,KAAK;GACL,QACE,QAAO;;GAEX;;;;;;;;AASJ,SAAgB,kBACd,SACU;AACV,QAAO,QAAQ,QAAQ,CAAC,KAAI,W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1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-XX-usBTN.cjs');
3
+ const require_api = require('./api-ueEGTUrK.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
@@ -10,7 +10,7 @@ require('./config-D86Vw7SC.cjs');
10
10
  require('./utils-BbDma_5Y.cjs');
11
11
  require('./virtual-B1MLgqnQ.cjs');
12
12
  const require_resolve_options = require('./resolve-options-BQnTgg3V.cjs');
13
- const require_esbuild = require('./esbuild-osvOb1W1.cjs');
13
+ const require_esbuild = require('./esbuild-CEXj4fF-.cjs');
14
14
  let __stryke_convert_to_array = require("@stryke/convert/to-array");
15
15
  let __stryke_helpers_omit = require("@stryke/helpers/omit");
16
16
  let __stryke_path_append = require("@stryke/path/append");
package/dist/tsup.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Et as PluginContext, Zn as Plugin, j as ResolvedConfig } from "./config-BNcBL0tI.cjs";
1
+ import { Et as PluginContext, Qn as Plugin, j as ResolvedConfig } from "./config-B3Xvipn4.cjs";
2
2
  import { Options } from "tsup";
3
3
  import { BuildOptions } from "@storm-software/tsup/types";
4
4
 
@@ -14,7 +14,7 @@ type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPl
14
14
  //#endregion
15
15
  //#region ../plugin-tsup/src/index.d.ts
16
16
  declare module "@powerlines/core" {
17
- interface BaseConfig {
17
+ interface Config {
18
18
  tsup?: TsupPluginOptions;
19
19
  }
20
20
  }
@@ -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,UAAW,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":["../../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"}
package/dist/tsup.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { Et as PluginContext, Zn as Plugin, j as ResolvedConfig } from "./config-jcYnkMvq.mjs";
2
- import "./config-D2cqq84p.mjs";
3
- import "./index-DP6juTGE.mjs";
4
- import "./index-BjLkEvse.mjs";
1
+ import { Et as PluginContext, Qn as Plugin, j as ResolvedConfig } from "./config-BLihpN3D.mjs";
2
+ import "./config-CzpJjE2i.mjs";
3
+ import "./index-Ct46ECR2.mjs";
4
+ import "./index-DT3dtimM.mjs";
5
5
  import { resolveOptions } from "@storm-software/tsup";
6
6
  import { Options } from "tsup";
7
7
  import { BuildOptions as BuildOptions$1 } from "@storm-software/tsup/types";
@@ -18,7 +18,7 @@ type TsupPluginContext<TResolvedConfig extends TsupPluginResolvedConfig = TsupPl
18
18
  //#endregion
19
19
  //#region ../plugin-tsup/src/index.d.ts
20
20
  declare module "@powerlines/core" {
21
- interface BaseConfig {
21
+ interface Config {
22
22
  tsup?: TsupPluginOptions;
23
23
  }
24
24
  }
package/dist/tsup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { o as createUnplugin } from "./api-BaHkkIMl.mjs";
1
+ import { o as createUnplugin } from "./api-uwZyIenK.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -8,7 +8,7 @@ import "./config-D4Fh2gQL.mjs";
8
8
  import "./utils-DoQcX7Sk.mjs";
9
9
  import "./virtual-B9imjOqe.mjs";
10
10
  import { n as resolveEntry } from "./resolve-options-DHL3RM8F.mjs";
11
- import { t as esbuild_default } from "./esbuild-aZZE7sY8.mjs";
11
+ import { t as esbuild_default } from "./esbuild-96YIeiTP.mjs";
12
12
  import { toArray } from "@stryke/convert/to-array";
13
13
  import { omit } from "@stryke/helpers/omit";
14
14
  import { appendPath } from "@stryke/path/append";
package/dist/tsup.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tsup.mjs","names":["DEFAULT_TSUP_CONFIG: Partial<TsupOptions>","resolveEntry","resolveEsbuildEntry","resolveOptions","resolveOptionsBase","resolveOptions","esbuild"],"sources":["../../plugin-tsup/src/helpers/resolve-options.ts","../../plugin-tsup/src/helpers/unplugin.ts","../../plugin-tsup/src/index.ts","../src/tsup.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, ResolvedEntryTypeDefinition } from \"@powerlines/core\";\nimport { resolveEntry as resolveEsbuildEntry } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { resolveOptions as resolveOptionsBase } from \"@storm-software/tsup\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport { Options } from \"tsup\";\nimport { TsupOptions, TsupPluginResolvedConfig } from \"../types\";\n\nexport const DEFAULT_TSUP_CONFIG: Partial<TsupOptions> = {\n ...DEFAULT_BUILD_OPTIONS,\n target: \"esnext\",\n config: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[]\n): Entry {\n return resolveEsbuildEntry(context, entryPoints) as Entry;\n}\n\ntype TsupEsbuildOptionsHandler = NonNullable<Options[\"esbuildOptions\"]>;\ntype TsupEsbuildOptionsArgs = Parameters<TsupEsbuildOptionsHandler>;\ntype TsupEsbuildOptions = TsupEsbuildOptionsArgs[0];\ntype TsupEsbuildContext = TsupEsbuildOptionsArgs[1];\n\ninterface TsupResolvedBuildConfig extends Options {\n esbuildOptions?: TsupEsbuildOptionsHandler;\n workspaceConfig?: {\n workspaceRoot: string;\n };\n}\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(\n context: Context\n): Parameters<typeof resolveOptionsBase>[0] {\n const result = defu(\n {\n entry: Object.fromEntries(\n Object.entries(resolveEntry(context, context.entry)).map(\n ([key, value]) => [key, appendPath(value, context.config.root)]\n )\n ),\n esbuildOptions: ((\n options: TsupEsbuildOptions,\n ctx: TsupEsbuildContext\n ) => {\n if ((context.config as TsupPluginResolvedConfig).tsup?.esbuildOptions) {\n (context.config as TsupPluginResolvedConfig).tsup?.esbuildOptions?.(\n options,\n ctx\n );\n }\n\n options.alias = {\n ...context.alias,\n ...context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.paths[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n ...options.alias\n };\n }) as TsupResolvedBuildConfig[\"esbuildOptions\"],\n noExternal: context.builtins\n },\n (context.config as TsupPluginResolvedConfig).tsup\n ? (context.config as TsupPluginResolvedConfig).tsup\n : {},\n {\n name: context.config.name,\n root: context.config.root,\n projectRoot: context.config.root,\n assets: context.config.output.assets as (string | AssetGlob)[],\n resolveExtensions: context.config.resolve.extensions,\n outputPath: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n dts:\n (context.config as TsupPluginResolvedConfig).tsup &&\n !(context.config as TsupPluginResolvedConfig).tsup?.experimentalDts\n ? {\n compilerOptions: context.tsconfig.tsconfigJson.compilerOptions\n }\n : undefined,\n format: context.config.output.format,\n mode: context.config.mode,\n treeshake: (context.config as TsupPluginResolvedConfig).tsup\n ? (context.config as TsupPluginResolvedConfig).tsup?.treeshake\n : undefined,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel === null ||\n context.config.logLevel === \"trace\" ||\n context.config.mode === \"development\",\n workspaceConfig: { workspaceRoot: context.workspaceConfig.workspaceRoot }\n },\n DEFAULT_TSUP_CONFIG\n );\n\n result.format = getUnique(toArray(result.format));\n return result;\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 { createEsbuildPlugin } from \"unplugin\";\nimport { TsupPluginContext } from \"../types/plugin\";\n\nexport function createTsupPlugin(context: TsupPluginContext) {\n return createEsbuildPlugin(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 {\n build,\n resolveOptions as resolveOptionsBase\n} from \"@storm-software/tsup\";\nimport defu from \"defu\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createTsupPlugin } from \"./helpers/unplugin\";\nimport {\n TsupPluginContext,\n TsupPluginOptions,\n TsupPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n tsup?: TsupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to use Tsup to build the project.\n */\nexport const plugin = <TContext extends TsupPluginContext = TsupPluginContext>(\n options: TsupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsup\",\n config() {\n this.debug(\n \"Providing default configuration for the Powerlines `tsup` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n tsup: {\n ...options\n }\n } as Partial<TsupPluginResolvedConfig>;\n },\n async build() {\n return build(\n await resolveOptionsBase(\n defu(resolveOptions(this), {\n esbuildPlugins: [createTsupPlugin(this)]\n })\n )\n );\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 { omit } from \"@stryke/helpers/omit\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type { Options } from \"tsup\";\nimport esbuild from \"./esbuild\";\n\nexport { default as plugin, default as tsup } from \"@powerlines/plugin-tsup\";\n\n/**\n * A Tsup configuration function that integrates Powerlines into the build process.\n *\n * @see https://tsup.egoist.dev/#/config\n *\n * @example\n * ```ts\n * // tsup.config.ts\n * import withPowerlines from \"powerlines/tsup\";\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 Tsup options to merge with the Powerlines configuration.\n * @returns The merged Tsup configuration options.\n */\nexport function unplugin(options: Options = {}): Options {\n return {\n ...options,\n esbuildPlugins: [\n esbuild({\n output: {\n outputPath: options.outDir,\n format: options.format\n },\n esbuild: {\n ...omit(options, [\n \"plugins\",\n \"banner\",\n \"footer\",\n \"outExtension\",\n \"outDir\",\n \"format\",\n \"minify\",\n \"pure\",\n \"inject\"\n ]),\n minify: Boolean(options.minify),\n pure: Array.isArray(options.pure)\n ? options.pure\n : isString(options.pure)\n ? [options.pure]\n : []\n }\n })\n ]\n };\n}\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAaA,sBAA4C;CACvD,GAAG;CACH,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,WAAW;CACX,QAAQ,EAAE;CACX;;;;;;;;AASD,SAAgBC,eACd,SACA,aACO;AACP,QAAOC,aAAoB,SAAS,YAAY;;;;;;;;AAqBlD,SAAgBC,iBACd,SAC0C;CAC1C,MAAM,SAAS,KACb;EACE,OAAO,OAAO,YACZ,OAAO,QAAQF,eAAa,SAAS,QAAQ,MAAM,CAAC,CAAC,KAClD,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,OAAO,QAAQ,OAAO,KAAK,CAAC,CAChE,CACF;EACD,kBACE,SACA,QACG;AACH,OAAK,QAAQ,OAAoC,MAAM,eACrD,CAAC,QAAQ,OAAoC,MAAM,iBACjD,SACA,IACD;AAGH,WAAQ,QAAQ;IACd,GAAG,QAAQ;IACX,GAAG,QAAQ,SAAS,QACjB,KAAK,OAAO;KACX,MAAM,OAAO,QAAQ,GAAG,MAAM;AAC9B,SAAI,KACF,KAAI,MAAM;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QAAQ;AACZ,UAAO,MACL,MAAMG,eACJ,KAAKC,iBAAe,KAAK,EAAE,EACzB,gBAAgB,CAAC,iBAAiB,KAAK,CAAC,EACzC,CAAC,CACH,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3Bf,SAAgB,SAAS,UAAmB,EAAE,EAAW;AACvD,QAAO;EACL,GAAG;EACH,gBAAgB,CACdC,gBAAQ;GACN,QAAQ;IACN,YAAY,QAAQ;IACpB,QAAQ,QAAQ;IACjB;GACD,SAAS;IACP,GAAG,KAAK,SAAS;KACf;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAAC;IACF,QAAQ,QAAQ,QAAQ,OAAO;IAC/B,MAAM,MAAM,QAAQ,QAAQ,KAAK,GAC7B,QAAQ,OACR,SAAS,QAAQ,KAAK,GACpB,CAAC,QAAQ,KAAK,GACd,EAAE;IACT;GACF,CAAC,CACH;EACF;;AAGH,mBAAe"}
1
+ {"version":3,"file":"tsup.mjs","names":["DEFAULT_TSUP_CONFIG: Partial<TsupOptions>","resolveEntry","resolveEsbuildEntry","resolveOptions","resolveOptionsBase","resolveOptions","esbuild"],"sources":["../../plugin-tsup/src/helpers/resolve-options.ts","../../plugin-tsup/src/helpers/unplugin.ts","../../plugin-tsup/src/index.ts","../src/tsup.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, ResolvedEntryTypeDefinition } from \"@powerlines/core\";\nimport { resolveEntry as resolveEsbuildEntry } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { resolveOptions as resolveOptionsBase } from \"@storm-software/tsup\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport { Options } from \"tsup\";\nimport { TsupOptions, TsupPluginResolvedConfig } from \"../types\";\n\nexport const DEFAULT_TSUP_CONFIG: Partial<TsupOptions> = {\n ...DEFAULT_BUILD_OPTIONS,\n target: \"esnext\",\n config: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[]\n): Entry {\n return resolveEsbuildEntry(context, entryPoints) as Entry;\n}\n\ntype TsupEsbuildOptionsHandler = NonNullable<Options[\"esbuildOptions\"]>;\ntype TsupEsbuildOptionsArgs = Parameters<TsupEsbuildOptionsHandler>;\ntype TsupEsbuildOptions = TsupEsbuildOptionsArgs[0];\ntype TsupEsbuildContext = TsupEsbuildOptionsArgs[1];\n\ninterface TsupResolvedBuildConfig extends Options {\n esbuildOptions?: TsupEsbuildOptionsHandler;\n workspaceConfig?: {\n workspaceRoot: string;\n };\n}\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(\n context: Context\n): Parameters<typeof resolveOptionsBase>[0] {\n const result = defu(\n {\n entry: Object.fromEntries(\n Object.entries(resolveEntry(context, context.entry)).map(\n ([key, value]) => [key, appendPath(value, context.config.root)]\n )\n ),\n esbuildOptions: ((\n options: TsupEsbuildOptions,\n ctx: TsupEsbuildContext\n ) => {\n if ((context.config as TsupPluginResolvedConfig).tsup?.esbuildOptions) {\n (context.config as TsupPluginResolvedConfig).tsup?.esbuildOptions?.(\n options,\n ctx\n );\n }\n\n options.alias = {\n ...context.alias,\n ...context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.paths[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n ...options.alias\n };\n }) as TsupResolvedBuildConfig[\"esbuildOptions\"],\n noExternal: context.builtins\n },\n (context.config as TsupPluginResolvedConfig).tsup\n ? (context.config as TsupPluginResolvedConfig).tsup\n : {},\n {\n name: context.config.name,\n root: context.config.root,\n projectRoot: context.config.root,\n assets: context.config.output.assets as (string | AssetGlob)[],\n resolveExtensions: context.config.resolve.extensions,\n outputPath: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n dts:\n (context.config as TsupPluginResolvedConfig).tsup &&\n !(context.config as TsupPluginResolvedConfig).tsup?.experimentalDts\n ? {\n compilerOptions: context.tsconfig.tsconfigJson.compilerOptions\n }\n : undefined,\n format: context.config.output.format,\n mode: context.config.mode,\n treeshake: (context.config as TsupPluginResolvedConfig).tsup\n ? (context.config as TsupPluginResolvedConfig).tsup?.treeshake\n : undefined,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel === null ||\n context.config.logLevel === \"trace\" ||\n context.config.mode === \"development\",\n workspaceConfig: { workspaceRoot: context.workspaceConfig.workspaceRoot }\n },\n DEFAULT_TSUP_CONFIG\n );\n\n result.format = getUnique(toArray(result.format));\n return result;\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 { createEsbuildPlugin } from \"unplugin\";\nimport { TsupPluginContext } from \"../types/plugin\";\n\nexport function createTsupPlugin(context: TsupPluginContext) {\n return createEsbuildPlugin(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 {\n build,\n resolveOptions as resolveOptionsBase\n} from \"@storm-software/tsup\";\nimport defu from \"defu\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createTsupPlugin } from \"./helpers/unplugin\";\nimport {\n TsupPluginContext,\n TsupPluginOptions,\n TsupPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n tsup?: TsupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to use Tsup to build the project.\n */\nexport const plugin = <TContext extends TsupPluginContext = TsupPluginContext>(\n options: TsupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsup\",\n config() {\n this.debug(\n \"Providing default configuration for the Powerlines `tsup` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n tsup: {\n ...options\n }\n } as Partial<TsupPluginResolvedConfig>;\n },\n async build() {\n return build(\n await resolveOptionsBase(\n defu(resolveOptions(this), {\n esbuildPlugins: [createTsupPlugin(this)]\n })\n )\n );\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 { omit } from \"@stryke/helpers/omit\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type { Options } from \"tsup\";\nimport esbuild from \"./esbuild\";\n\nexport { default as plugin, default as tsup } from \"@powerlines/plugin-tsup\";\n\n/**\n * A Tsup configuration function that integrates Powerlines into the build process.\n *\n * @see https://tsup.egoist.dev/#/config\n *\n * @example\n * ```ts\n * // tsup.config.ts\n * import withPowerlines from \"powerlines/tsup\";\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 Tsup options to merge with the Powerlines configuration.\n * @returns The merged Tsup configuration options.\n */\nexport function unplugin(options: Options = {}): Options {\n return {\n ...options,\n esbuildPlugins: [\n esbuild({\n output: {\n outputPath: options.outDir,\n format: options.format\n },\n esbuild: {\n ...omit(options, [\n \"plugins\",\n \"banner\",\n \"footer\",\n \"outExtension\",\n \"outDir\",\n \"format\",\n \"minify\",\n \"pure\",\n \"inject\"\n ]),\n minify: Boolean(options.minify),\n pure: Array.isArray(options.pure)\n ? options.pure\n : isString(options.pure)\n ? [options.pure]\n :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