@powerlines/plugin-tsdown 0.1.251 → 0.1.253

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 (165) hide show
  1. package/dist/build-BOzEPSe_.d.cts +8 -0
  2. package/dist/build-BOzEPSe_.d.cts.map +1 -0
  3. package/dist/build-DJTI0ZMx.cjs +0 -0
  4. package/dist/build-XTM4L3VY.mjs +1 -0
  5. package/dist/build-t47JyYHN.d.mts +8 -0
  6. package/dist/build-t47JyYHN.d.mts.map +1 -0
  7. package/dist/helpers/index.cjs +8 -7
  8. package/dist/helpers/index.d.cts +5 -2
  9. package/dist/helpers/index.d.mts +5 -2
  10. package/dist/helpers/index.mjs +3 -2
  11. package/dist/helpers/resolve-options.cjs +5 -127
  12. package/dist/helpers/resolve-options.d.cts +2 -30
  13. package/dist/helpers/resolve-options.d.mts +2 -31
  14. package/dist/helpers/resolve-options.mjs +2 -123
  15. package/dist/helpers/unplugin.cjs +2 -11
  16. package/dist/helpers/unplugin.d.cts +4 -8
  17. package/dist/helpers/unplugin.d.mts +4 -8
  18. package/dist/helpers/unplugin.mjs +2 -11
  19. package/dist/helpers-C9XSjwSZ.mjs +1 -0
  20. package/dist/helpers-yB1XkvQI.cjs +0 -0
  21. package/dist/index-B_e8BwCm.d.cts +1 -0
  22. package/dist/index-CW2WHUXP.d.mts +1 -0
  23. package/dist/index-Cc7fCJU9.d.mts +1 -0
  24. package/dist/index-CiBIKhMu.d.cts +1 -0
  25. package/dist/index.cjs +16 -14
  26. package/dist/index.d.cts +7 -5
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts +7 -8
  29. package/dist/index.d.mts.map +1 -1
  30. package/dist/index.mjs +9 -6
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/plugin-BElgq92H.d.mts +19 -0
  33. package/dist/plugin-BElgq92H.d.mts.map +1 -0
  34. package/dist/plugin-C2QQwbPM.d.cts +19 -0
  35. package/dist/plugin-C2QQwbPM.d.cts.map +1 -0
  36. package/dist/plugin-D3B5E_Hg.mjs +1 -0
  37. package/dist/plugin-D5qyQPqC.cjs +0 -0
  38. package/dist/resolve-options-BqY8g1Lc.d.mts +30 -0
  39. package/dist/resolve-options-BqY8g1Lc.d.mts.map +1 -0
  40. package/dist/resolve-options-CSWiRNVz.mjs +123 -0
  41. package/dist/resolve-options-CSWiRNVz.mjs.map +1 -0
  42. package/dist/resolve-options-Ctkjvfj3.d.cts +30 -0
  43. package/dist/resolve-options-Ctkjvfj3.d.cts.map +1 -0
  44. package/dist/resolve-options-D2gIEZW3.cjs +179 -0
  45. package/dist/types/build.cjs +1 -0
  46. package/dist/types/build.d.cts +2 -8
  47. package/dist/types/build.d.mts +2 -8
  48. package/dist/types/build.mjs +2 -0
  49. package/dist/types/index.cjs +3 -0
  50. package/dist/types/index.d.cts +3 -2
  51. package/dist/types/index.d.mts +3 -2
  52. package/dist/types/index.mjs +4 -0
  53. package/dist/types/plugin.cjs +1 -0
  54. package/dist/types/plugin.d.cts +3 -20
  55. package/dist/types/plugin.d.mts +3 -21
  56. package/dist/types/plugin.mjs +2 -0
  57. package/dist/types-D208vOSb.cjs +0 -0
  58. package/dist/types-Dv2cgIDx.mjs +1 -0
  59. package/dist/unplugin-8qvZ1vSF.cjs +16 -0
  60. package/dist/unplugin-C1z93_YH.d.cts +8 -0
  61. package/dist/unplugin-C1z93_YH.d.cts.map +1 -0
  62. package/dist/unplugin-CLFi0U2r.d.mts +8 -0
  63. package/dist/unplugin-CLFi0U2r.d.mts.map +1 -0
  64. package/dist/unplugin-kYkLMXDM.mjs +11 -0
  65. package/dist/unplugin-kYkLMXDM.mjs.map +1 -0
  66. package/package.json +4 -4
  67. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  68. package/dist/core/src/lib/logger.cjs +0 -41
  69. package/dist/core/src/lib/logger.mjs +0 -40
  70. package/dist/core/src/lib/logger.mjs.map +0 -1
  71. package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
  72. package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
  73. package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
  74. package/dist/core/src/lib/unplugin/index.cjs +0 -3
  75. package/dist/core/src/lib/unplugin/index.mjs +0 -5
  76. package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
  77. package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
  78. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
  79. package/dist/core/src/lib/unplugin/plugin.cjs +0 -71
  80. package/dist/core/src/lib/unplugin/plugin.mjs +0 -71
  81. package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
  82. package/dist/core/src/lib/utilities/format.cjs +0 -29
  83. package/dist/core/src/lib/utilities/format.mjs +0 -29
  84. package/dist/core/src/lib/utilities/format.mjs.map +0 -1
  85. package/dist/core/src/lib/utilities/source-file.cjs +0 -22
  86. package/dist/core/src/lib/utilities/source-file.mjs +0 -21
  87. package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
  88. package/dist/core/src/plugin-utils/build-helpers.cjs +0 -35
  89. package/dist/core/src/plugin-utils/build-helpers.mjs +0 -35
  90. package/dist/core/src/plugin-utils/build-helpers.mjs.map +0 -1
  91. package/dist/core/src/plugin-utils/context-helpers.cjs +0 -2
  92. package/dist/core/src/plugin-utils/context-helpers.mjs +0 -4
  93. package/dist/core/src/plugin-utils/extend.cjs +0 -3
  94. package/dist/core/src/plugin-utils/extend.mjs +0 -5
  95. package/dist/core/src/plugin-utils/format-package-json.cjs +0 -19
  96. package/dist/core/src/plugin-utils/format-package-json.mjs +0 -19
  97. package/dist/core/src/plugin-utils/format-package-json.mjs.map +0 -1
  98. package/dist/core/src/plugin-utils/get-config-path.cjs +0 -1
  99. package/dist/core/src/plugin-utils/get-config-path.mjs +0 -3
  100. package/dist/core/src/plugin-utils/helpers.cjs +0 -51
  101. package/dist/core/src/plugin-utils/helpers.mjs +0 -48
  102. package/dist/core/src/plugin-utils/helpers.mjs.map +0 -1
  103. package/dist/core/src/plugin-utils/index.cjs +0 -8
  104. package/dist/core/src/plugin-utils/index.mjs +0 -10
  105. package/dist/core/src/plugin-utils/merge.cjs +0 -47
  106. package/dist/core/src/plugin-utils/merge.mjs +0 -47
  107. package/dist/core/src/plugin-utils/merge.mjs.map +0 -1
  108. package/dist/core/src/plugin-utils/paths.cjs +0 -2
  109. package/dist/core/src/plugin-utils/paths.mjs +0 -4
  110. package/dist/core/src/types/api.d.cts +0 -103
  111. package/dist/core/src/types/api.d.cts.map +0 -1
  112. package/dist/core/src/types/api.d.mts +0 -103
  113. package/dist/core/src/types/api.d.mts.map +0 -1
  114. package/dist/core/src/types/commands.cjs +0 -16
  115. package/dist/core/src/types/commands.d.cts +0 -9
  116. package/dist/core/src/types/commands.d.cts.map +0 -1
  117. package/dist/core/src/types/commands.d.mts +0 -10
  118. package/dist/core/src/types/commands.d.mts.map +0 -1
  119. package/dist/core/src/types/commands.mjs +0 -16
  120. package/dist/core/src/types/commands.mjs.map +0 -1
  121. package/dist/core/src/types/config.d.cts +0 -551
  122. package/dist/core/src/types/config.d.cts.map +0 -1
  123. package/dist/core/src/types/config.d.mts +0 -551
  124. package/dist/core/src/types/config.d.mts.map +0 -1
  125. package/dist/core/src/types/context.d.cts +0 -511
  126. package/dist/core/src/types/context.d.cts.map +0 -1
  127. package/dist/core/src/types/context.d.mts +0 -511
  128. package/dist/core/src/types/context.d.mts.map +0 -1
  129. package/dist/core/src/types/fs.d.cts +0 -487
  130. package/dist/core/src/types/fs.d.cts.map +0 -1
  131. package/dist/core/src/types/fs.d.mts +0 -487
  132. package/dist/core/src/types/fs.d.mts.map +0 -1
  133. package/dist/core/src/types/hooks.d.cts +0 -99
  134. package/dist/core/src/types/hooks.d.cts.map +0 -1
  135. package/dist/core/src/types/hooks.d.mts +0 -99
  136. package/dist/core/src/types/hooks.d.mts.map +0 -1
  137. package/dist/core/src/types/index.d.mts +0 -9
  138. package/dist/core/src/types/plugin.cjs +0 -31
  139. package/dist/core/src/types/plugin.d.cts +0 -204
  140. package/dist/core/src/types/plugin.d.cts.map +0 -1
  141. package/dist/core/src/types/plugin.d.mts +0 -204
  142. package/dist/core/src/types/plugin.d.mts.map +0 -1
  143. package/dist/core/src/types/plugin.mjs +0 -33
  144. package/dist/core/src/types/plugin.mjs.map +0 -1
  145. package/dist/core/src/types/tsconfig.d.cts +0 -70
  146. package/dist/core/src/types/tsconfig.d.cts.map +0 -1
  147. package/dist/core/src/types/tsconfig.d.mts +0 -70
  148. package/dist/core/src/types/tsconfig.d.mts.map +0 -1
  149. package/dist/core/src/types/unplugin.cjs +0 -22
  150. package/dist/core/src/types/unplugin.d.cts +0 -24
  151. package/dist/core/src/types/unplugin.d.cts.map +0 -1
  152. package/dist/core/src/types/unplugin.d.mts +0 -25
  153. package/dist/core/src/types/unplugin.d.mts.map +0 -1
  154. package/dist/core/src/types/unplugin.mjs +0 -22
  155. package/dist/core/src/types/unplugin.mjs.map +0 -1
  156. package/dist/helpers/resolve-options.d.cts.map +0 -1
  157. package/dist/helpers/resolve-options.d.mts.map +0 -1
  158. package/dist/helpers/resolve-options.mjs.map +0 -1
  159. package/dist/helpers/unplugin.d.cts.map +0 -1
  160. package/dist/helpers/unplugin.d.mts.map +0 -1
  161. package/dist/helpers/unplugin.mjs.map +0 -1
  162. package/dist/types/build.d.cts.map +0 -1
  163. package/dist/types/build.d.mts.map +0 -1
  164. package/dist/types/plugin.d.cts.map +0 -1
  165. package/dist/types/plugin.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["defu"],"sources":["../src/index.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 { formatPackageJson } from \"@powerlines/core/plugin-utils/format-package-json\";\nimport { Plugin } from \"@powerlines/core/types\";\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\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"],"mappings":";;;;;;;;;;;AAoCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;AAE9C,SAAM,MACJA,OACE;IACE,QAAQ;IACR,SAAS,CAAC,mBAAmB,KAAK,CAAC;IACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,kBAAkB,KAAK;;EAEhC;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { formatPackageJson } from \"@powerlines/core/plugin-utils/format-package-json\";\nimport { Plugin } from \"@powerlines/core/types\";\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\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"],"mappings":";;;;;;;;;;;;;;AAoCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;AAE9C,SAAM,MACJ,KACE;IACE,QAAQ;IACR,SAAS,CAAC,mBAAmB,KAAK,CAAC;IACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,kBAAkB,KAAK;;EAEhC;;AAGH,kBAAe"}
@@ -0,0 +1,19 @@
1
+ import { t as TsdownOptions } from "./build-t47JyYHN.mjs";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type TsdownPluginOptions = Partial<TsdownOptions>;
6
+ interface TsdownPluginUserConfig extends UserConfig {
7
+ tsdown?: TsdownPluginOptions;
8
+ }
9
+ interface TsdownPluginResolvedConfig extends ResolvedConfig {
10
+ tsdown: TsdownOptions;
11
+ }
12
+ type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = TsdownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
+ declare type __ΩTsdownPluginOptions = any[];
14
+ declare type __ΩTsdownPluginUserConfig = any[];
15
+ declare type __ΩTsdownPluginResolvedConfig = any[];
16
+ declare type __ΩTsdownPluginContext = any[];
17
+ //#endregion
18
+ export { __ΩTsdownPluginContext as a, __ΩTsdownPluginUserConfig as c, TsdownPluginUserConfig as i, TsdownPluginOptions as n, __ΩTsdownPluginOptions as o, TsdownPluginResolvedConfig as r, __ΩTsdownPluginResolvedConfig as s, TsdownPluginContext as t };
19
+ //# sourceMappingURL=plugin-BElgq92H.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-BElgq92H.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,mBAAA,GAAsB,QAAQ;UAEzB,sBAAA,SAA+B;EAFpC,MAAA,CAAA,EAGD,mBAHoB;AAE/B;AAIiB,UAAA,0BAAA,SAAmC,cAAA,CAAA;EAIxC,MAAA,EAHF,aAGE;;AAER,KAFQ,mBAER,CAAA,wBADsB,0BACtB,GAAA,0BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,sCAAA,GAAA,EAAA;AAAd,yCAAA,GAAA,EAAA;AAAa,6CAAA,GAAA,EAAA"}
@@ -0,0 +1,19 @@
1
+ import { t as TsdownOptions } from "./build-BOzEPSe_.cjs";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type TsdownPluginOptions = Partial<TsdownOptions>;
6
+ interface TsdownPluginUserConfig extends UserConfig {
7
+ tsdown?: TsdownPluginOptions;
8
+ }
9
+ interface TsdownPluginResolvedConfig extends ResolvedConfig {
10
+ tsdown: TsdownOptions;
11
+ }
12
+ type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = TsdownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
+ declare type __ΩTsdownPluginOptions = any[];
14
+ declare type __ΩTsdownPluginUserConfig = any[];
15
+ declare type __ΩTsdownPluginResolvedConfig = any[];
16
+ declare type __ΩTsdownPluginContext = any[];
17
+ //#endregion
18
+ export { __ΩTsdownPluginContext as a, __ΩTsdownPluginUserConfig as c, TsdownPluginUserConfig as i, TsdownPluginOptions as n, __ΩTsdownPluginOptions as o, TsdownPluginResolvedConfig as r, __ΩTsdownPluginResolvedConfig as s, TsdownPluginContext as t };
19
+ //# sourceMappingURL=plugin-C2QQwbPM.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-C2QQwbPM.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,mBAAA,GAAsB,QAAQ;UAEzB,sBAAA,SAA+B;EAFpC,MAAA,CAAA,EAGD,mBAHoB;AAE/B;AAIiB,UAAA,0BAAA,SAAmC,cAAA,CAAA;EAIxC,MAAA,EAHF,aAGE;;AAER,KAFQ,mBAER,CAAA,wBADsB,0BACtB,GAAA,0BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,sCAAA,GAAA,EAAA;AAAd,yCAAA,GAAA,EAAA;AAAa,6CAAA,GAAA,EAAA"}
@@ -0,0 +1 @@
1
+ export { };
File without changes
@@ -0,0 +1,30 @@
1
+ import { Format, UserConfig } from "tsdown";
2
+ import { Context } from "@powerlines/core/types";
3
+ import { Format as Format$1 } from "@storm-software/build-tools/types";
4
+
5
+ //#region src/helpers/resolve-options.d.ts
6
+ declare const DEFAULT_TSDOWN_CONFIG: Partial<UserConfig>;
7
+ /**
8
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
9
+ *
10
+ * @param formats - The formats to resolve.
11
+ * @returns The resolved entry options.
12
+ */
13
+ declare function resolveFormat(formats?: Format$1 | Format$1[]): Format[];
14
+ /**
15
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
16
+ *
17
+ * @param formats - The formats to resolve.
18
+ * @returns The resolved entry options.
19
+ */
20
+ declare function resolveFromFormat(formats?: Format | Format[]): Format$1[];
21
+ /**
22
+ * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
23
+ *
24
+ * @param context - The build context.
25
+ * @returns The resolved options.
26
+ */
27
+ declare function resolveOptions(context: Context): UserConfig;
28
+ //#endregion
29
+ export { resolveOptions as i, resolveFormat as n, resolveFromFormat as r, DEFAULT_TSDOWN_CONFIG as t };
30
+ //# sourceMappingURL=resolve-options-BqY8g1Lc.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-BqY8g1Lc.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;cAgCa,uBAAuB,QAAQ;;AAA5C;AAcA;;;;AAAwE,iBAAxD,aAAA,CAAwD,OAAA,CAAA,EAAhC,QAAgC,GAAvB,QAAuB,EAAA,CAAA,EAAZ,MAAY,EAAA;AAoBxE;;;;;AAmCA;iBAnCgB,iBAAA,WACJ,SAAe,WACxB;;;;;;;iBAiCa,cAAA,UAAwB,UAAU"}
@@ -0,0 +1,123 @@
1
+ import defu from "defu";
2
+ import { getDependencyConfig } from "@powerlines/core/plugin-utils";
3
+ import { toArray } from "@stryke/convert/to-array";
4
+ import { appendPath } from "@stryke/path/append";
5
+ import { joinPaths } from "@stryke/path/join-paths";
6
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
7
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
8
+ import { isSetString } from "@stryke/type-checks/is-set-string";
9
+
10
+ //#region src/helpers/resolve-options.ts
11
+ const DEFAULT_TSDOWN_CONFIG = {
12
+ platform: "neutral",
13
+ target: "esnext",
14
+ fixedExtension: true,
15
+ nodeProtocol: true,
16
+ clean: false
17
+ };
18
+ /**
19
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
20
+ *
21
+ * @param formats - The formats to resolve.
22
+ * @returns The resolved entry options.
23
+ */
24
+ function resolveFormat(formats) {
25
+ return toArray(formats).map((format) => {
26
+ switch (format) {
27
+ case "cjs": return "cjs";
28
+ case "iife": return "iife";
29
+ case "esm":
30
+ default: return "esm";
31
+ }
32
+ });
33
+ }
34
+ /**
35
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
36
+ *
37
+ * @param formats - The formats to resolve.
38
+ * @returns The resolved entry options.
39
+ */
40
+ function resolveFromFormat(formats) {
41
+ return toArray(formats).map((format) => {
42
+ switch (format) {
43
+ case "cjs":
44
+ case "commonjs": return "cjs";
45
+ case "iife": return "iife";
46
+ case "esm":
47
+ case "es":
48
+ case "module":
49
+ case "umd":
50
+ default: return "esm";
51
+ }
52
+ });
53
+ }
54
+ const formatMessage = (context, ...msgs) => msgs.filter(Boolean).join(" ").replace(new RegExp(`\\[${context.config.name}\\]`, "g"), "").replaceAll(/^\s+/g, "").replaceAll(/\s+$/g, "").trim();
55
+ /**
56
+ * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
57
+ *
58
+ * @param context - The build context.
59
+ * @returns The resolved options.
60
+ */
61
+ function resolveOptions(context) {
62
+ const { external, noExternal } = getDependencyConfig(context);
63
+ return defu({
64
+ entry: context.entry.filter((entry) => entry?.file).length > 0 ? Object.fromEntries(context.entry.filter((entry) => entry?.file).map((entry) => [entry.output || replaceExtension(replacePath(replacePath(entry.file, joinPaths(context.config.root, "src")), context.entryPath)), entry.file])) : [joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "src", "**/*.ts"), joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "src", "**/*.tsx")],
65
+ external,
66
+ noExternal,
67
+ alias: context.alias,
68
+ resolve: { alias: context.alias },
69
+ exports: context.config?.tsdown && context.config.tsdown?.exports ? defu(isSetObject(context.config.tsdown?.exports) ? context.config.tsdown?.exports : {}, { customExports: (exports) => {
70
+ const result = Object.fromEntries(Object.entries(exports).map(([key, value]) => {
71
+ if (isSetString(value)) return [key, value];
72
+ const currentExport = {};
73
+ if (isSetString(value.require)) currentExport.require = {
74
+ types: replaceExtension(value.require, ".d.cts", { fullExtension: true }),
75
+ default: value.require
76
+ };
77
+ if (isSetString(value.import)) currentExport.import = {
78
+ types: replaceExtension(value.import, ".d.mts", { fullExtension: true }),
79
+ default: value.import
80
+ };
81
+ if (!isSetObject(value.default)) {
82
+ if (isSetObject(currentExport.import)) currentExport.default = currentExport.import;
83
+ else if (isSetObject(currentExport.require)) currentExport.default = currentExport.require;
84
+ }
85
+ return [key, currentExport];
86
+ }));
87
+ return Object.keys(result).sort().reduce((ret, key) => {
88
+ ret[key] = result[key];
89
+ return ret;
90
+ }, {});
91
+ } }) : void 0
92
+ }, context.config?.tsdown ? context.config?.tsdown : {}, context.config?.rolldown ? { inputOptions: context.config?.rolldown } : {}, {
93
+ name: context.config.name,
94
+ cwd: appendPath(context.config.root, context.workspaceConfig.workspaceRoot),
95
+ define: context.config.define,
96
+ inputOptions: { transform: { inject: context.config.inject } },
97
+ platform: context.config.platform,
98
+ dts: true,
99
+ outDir: appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
100
+ tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
101
+ format: resolveFormat(context.config.output.format).filter(Boolean),
102
+ mode: context.config.mode,
103
+ treeshake: context.config?.tsdown ? context.config?.tsdown?.treeshake : void 0,
104
+ minify: context.config.mode === "production",
105
+ metafile: context.config.mode === "development",
106
+ sourcemap: context.config.mode === "development",
107
+ debug: context.config.mode === "development",
108
+ silent: context.config.logLevel === null || context.config.mode === "production",
109
+ logLevel: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
110
+ customLogger: {
111
+ level: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
112
+ info: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs)),
113
+ warn: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
114
+ warnOnce: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
115
+ error: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.error(formatMessage(context, ...msgs)),
116
+ success: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs))
117
+ }
118
+ }, DEFAULT_TSDOWN_CONFIG);
119
+ }
120
+
121
+ //#endregion
122
+ export { resolveOptions as i, resolveFormat as n, resolveFromFormat as r, DEFAULT_TSDOWN_CONFIG as t };
123
+ //# sourceMappingURL=resolve-options-CSWiRNVz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-CSWiRNVz.mjs","names":["DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions>"],"sources":["../src/helpers/resolve-options.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 { getDependencyConfig } from \"@powerlines/core/plugin-utils\";\nimport { Context } from \"@powerlines/core/types\";\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"],"mappings":"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"}
@@ -0,0 +1,30 @@
1
+ import { Context } from "@powerlines/core/types";
2
+ import { Format } from "@storm-software/build-tools/types";
3
+ import { Format as Format$1, UserConfig as UserConfig$1 } from "tsdown";
4
+
5
+ //#region src/helpers/resolve-options.d.ts
6
+ declare const DEFAULT_TSDOWN_CONFIG: Partial<UserConfig$1>;
7
+ /**
8
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
9
+ *
10
+ * @param formats - The formats to resolve.
11
+ * @returns The resolved entry options.
12
+ */
13
+ declare function resolveFormat(formats?: Format | Format[]): Format$1[];
14
+ /**
15
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
16
+ *
17
+ * @param formats - The formats to resolve.
18
+ * @returns The resolved entry options.
19
+ */
20
+ declare function resolveFromFormat(formats?: Format$1 | Format$1[]): Format[];
21
+ /**
22
+ * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
23
+ *
24
+ * @param context - The build context.
25
+ * @returns The resolved options.
26
+ */
27
+ declare function resolveOptions(context: Context): UserConfig$1;
28
+ //#endregion
29
+ export { resolveOptions as i, resolveFormat as n, resolveFromFormat as r, DEFAULT_TSDOWN_CONFIG as t };
30
+ //# sourceMappingURL=resolve-options-Ctkjvfj3.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-Ctkjvfj3.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;cAgCa,uBAAuB,QAAQ;;AAA5C;AAcA;;;;AAAwE,iBAAxD,aAAA,CAAwD,OAAA,CAAA,EAAhC,MAAgC,GAAvB,MAAuB,EAAA,CAAA,EAAZ,QAAY,EAAA;AAoBxE;;;;;AAmCA;iBAnCgB,iBAAA,WACJ,WAAe,aACxB;;;;;;;iBAiCa,cAAA,UAAwB,UAAU"}
@@ -0,0 +1,179 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+ let defu = require("defu");
29
+ defu = __toESM(defu);
30
+ let __powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
31
+ let __stryke_convert_to_array = require("@stryke/convert/to-array");
32
+ let __stryke_path_append = require("@stryke/path/append");
33
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
34
+ let __stryke_path_replace = require("@stryke/path/replace");
35
+ let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
36
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
37
+
38
+ //#region src/helpers/resolve-options.ts
39
+ const DEFAULT_TSDOWN_CONFIG = {
40
+ platform: "neutral",
41
+ target: "esnext",
42
+ fixedExtension: true,
43
+ nodeProtocol: true,
44
+ clean: false
45
+ };
46
+ /**
47
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
48
+ *
49
+ * @param formats - The formats to resolve.
50
+ * @returns The resolved entry options.
51
+ */
52
+ function resolveFormat(formats) {
53
+ return (0, __stryke_convert_to_array.toArray)(formats).map((format) => {
54
+ switch (format) {
55
+ case "cjs": return "cjs";
56
+ case "iife": return "iife";
57
+ case "esm":
58
+ default: return "esm";
59
+ }
60
+ });
61
+ }
62
+ /**
63
+ * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
64
+ *
65
+ * @param formats - The formats to resolve.
66
+ * @returns The resolved entry options.
67
+ */
68
+ function resolveFromFormat(formats) {
69
+ return (0, __stryke_convert_to_array.toArray)(formats).map((format) => {
70
+ switch (format) {
71
+ case "cjs":
72
+ case "commonjs": return "cjs";
73
+ case "iife": return "iife";
74
+ case "esm":
75
+ case "es":
76
+ case "module":
77
+ case "umd":
78
+ default: return "esm";
79
+ }
80
+ });
81
+ }
82
+ const formatMessage = (context, ...msgs) => msgs.filter(Boolean).join(" ").replace(new RegExp(`\\[${context.config.name}\\]`, "g"), "").replaceAll(/^\s+/g, "").replaceAll(/\s+$/g, "").trim();
83
+ /**
84
+ * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
85
+ *
86
+ * @param context - The build context.
87
+ * @returns The resolved options.
88
+ */
89
+ function resolveOptions(context) {
90
+ const { external, noExternal } = (0, __powerlines_core_plugin_utils.getDependencyConfig)(context);
91
+ return (0, defu.default)({
92
+ entry: context.entry.filter((entry) => entry?.file).length > 0 ? Object.fromEntries(context.entry.filter((entry) => entry?.file).map((entry) => [entry.output || (0, __stryke_path_replace.replaceExtension)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)(entry.file, (0, __stryke_path_join_paths.joinPaths)(context.config.root, "src")), context.entryPath)), entry.file])) : [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, "src", "**/*.ts"), (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, "src", "**/*.tsx")],
93
+ external,
94
+ noExternal,
95
+ alias: context.alias,
96
+ resolve: { alias: context.alias },
97
+ exports: context.config?.tsdown && context.config.tsdown?.exports ? (0, defu.default)((0, __stryke_type_checks_is_set_object.isSetObject)(context.config.tsdown?.exports) ? context.config.tsdown?.exports : {}, { customExports: (exports$1) => {
98
+ const result = Object.fromEntries(Object.entries(exports$1).map(([key, value]) => {
99
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(value)) return [key, value];
100
+ const currentExport = {};
101
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(value.require)) currentExport.require = {
102
+ types: (0, __stryke_path_replace.replaceExtension)(value.require, ".d.cts", { fullExtension: true }),
103
+ default: value.require
104
+ };
105
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(value.import)) currentExport.import = {
106
+ types: (0, __stryke_path_replace.replaceExtension)(value.import, ".d.mts", { fullExtension: true }),
107
+ default: value.import
108
+ };
109
+ if (!(0, __stryke_type_checks_is_set_object.isSetObject)(value.default)) {
110
+ if ((0, __stryke_type_checks_is_set_object.isSetObject)(currentExport.import)) currentExport.default = currentExport.import;
111
+ else if ((0, __stryke_type_checks_is_set_object.isSetObject)(currentExport.require)) currentExport.default = currentExport.require;
112
+ }
113
+ return [key, currentExport];
114
+ }));
115
+ return Object.keys(result).sort().reduce((ret, key) => {
116
+ ret[key] = result[key];
117
+ return ret;
118
+ }, {});
119
+ } }) : void 0
120
+ }, context.config?.tsdown ? context.config?.tsdown : {}, context.config?.rolldown ? { inputOptions: context.config?.rolldown } : {}, {
121
+ name: context.config.name,
122
+ cwd: (0, __stryke_path_append.appendPath)(context.config.root, context.workspaceConfig.workspaceRoot),
123
+ define: context.config.define,
124
+ inputOptions: { transform: { inject: context.config.inject } },
125
+ platform: context.config.platform,
126
+ dts: true,
127
+ outDir: (0, __stryke_path_append.appendPath)(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
128
+ tsconfig: (0, __stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
129
+ format: resolveFormat(context.config.output.format).filter(Boolean),
130
+ mode: context.config.mode,
131
+ treeshake: context.config?.tsdown ? context.config?.tsdown?.treeshake : void 0,
132
+ minify: context.config.mode === "production",
133
+ metafile: context.config.mode === "development",
134
+ sourcemap: context.config.mode === "development",
135
+ debug: context.config.mode === "development",
136
+ silent: context.config.logLevel === null || context.config.mode === "production",
137
+ logLevel: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
138
+ customLogger: {
139
+ level: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
140
+ info: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs)),
141
+ warn: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
142
+ warnOnce: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
143
+ error: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.error(formatMessage(context, ...msgs)),
144
+ success: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs))
145
+ }
146
+ }, DEFAULT_TSDOWN_CONFIG);
147
+ }
148
+
149
+ //#endregion
150
+ Object.defineProperty(exports, 'DEFAULT_TSDOWN_CONFIG', {
151
+ enumerable: true,
152
+ get: function () {
153
+ return DEFAULT_TSDOWN_CONFIG;
154
+ }
155
+ });
156
+ Object.defineProperty(exports, '__toESM', {
157
+ enumerable: true,
158
+ get: function () {
159
+ return __toESM;
160
+ }
161
+ });
162
+ Object.defineProperty(exports, 'resolveFormat', {
163
+ enumerable: true,
164
+ get: function () {
165
+ return resolveFormat;
166
+ }
167
+ });
168
+ Object.defineProperty(exports, 'resolveFromFormat', {
169
+ enumerable: true,
170
+ get: function () {
171
+ return resolveFromFormat;
172
+ }
173
+ });
174
+ Object.defineProperty(exports, 'resolveOptions', {
175
+ enumerable: true,
176
+ get: function () {
177
+ return resolveOptions;
178
+ }
179
+ });
@@ -0,0 +1 @@
1
+ require('../build-DJTI0ZMx.cjs');
@@ -1,8 +1,2 @@
1
- import { UserConfig } from "tsdown";
2
-
3
- //#region src/types/build.d.ts
4
- type TsdownOptions = Partial<Omit<UserConfig, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">>;
5
- declare type __ΩTsdownOptions = any[];
6
- //#endregion
7
- export { TsdownOptions, __ΩTsdownOptions };
8
- //# sourceMappingURL=build.d.cts.map
1
+ import { n as __ΩTsdownOptions, t as TsdownOptions } from "../build-BOzEPSe_.cjs";
2
+ export { TsdownOptions, __ΩTsdownOptions };
@@ -1,8 +1,2 @@
1
- import { UserConfig } from "tsdown";
2
-
3
- //#region src/types/build.d.ts
4
- type TsdownOptions = Partial<Omit<UserConfig, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">>;
5
- declare type __ΩTsdownOptions = any[];
6
- //#endregion
7
- export { TsdownOptions, __ΩTsdownOptions };
8
- //# sourceMappingURL=build.d.mts.map
1
+ import { n as __ΩTsdownOptions, t as TsdownOptions } from "../build-t47JyYHN.mjs";
2
+ export { TsdownOptions, __ΩTsdownOptions };
@@ -1 +1,3 @@
1
+ import "../build-XTM4L3VY.mjs";
2
+
1
3
  export { };
@@ -0,0 +1,3 @@
1
+ require('../build-DJTI0ZMx.cjs');
2
+ require('../plugin-D5qyQPqC.cjs');
3
+ require('../types-D208vOSb.cjs');
@@ -1,3 +1,4 @@
1
- import { TsdownOptions, __ΩTsdownOptions } from "./build.cjs";
2
- import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./plugin.cjs";
1
+ import { n as __ΩTsdownOptions, t as TsdownOptions } from "../build-BOzEPSe_.cjs";
2
+ import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-C2QQwbPM.cjs";
3
+ import "../index-B_e8BwCm.cjs";
3
4
  export { TsdownOptions, TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownOptions, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
@@ -1,3 +1,4 @@
1
- import { TsdownOptions, __ΩTsdownOptions } from "./build.mjs";
2
- import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./plugin.mjs";
1
+ import { n as __ΩTsdownOptions, t as TsdownOptions } from "../build-t47JyYHN.mjs";
2
+ import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-BElgq92H.mjs";
3
+ import "../index-Cc7fCJU9.mjs";
3
4
  export { TsdownOptions, TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownOptions, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
@@ -1 +1,5 @@
1
+ import "../build-XTM4L3VY.mjs";
2
+ import "../plugin-D3B5E_Hg.mjs";
3
+ import "../types-Dv2cgIDx.mjs";
4
+
1
5
  export { };
@@ -0,0 +1 @@
1
+ require('../plugin-D5qyQPqC.cjs');
@@ -1,20 +1,3 @@
1
- import { PluginContext } from "../core/src/types/context.cjs";
2
- import { ResolvedConfig, UserConfig } from "../core/src/types/config.cjs";
3
- import { TsdownOptions } from "./build.cjs";
4
-
5
- //#region src/types/plugin.d.ts
6
- type TsdownPluginOptions = Partial<TsdownOptions>;
7
- interface TsdownPluginUserConfig extends UserConfig {
8
- tsdown?: TsdownPluginOptions;
9
- }
10
- interface TsdownPluginResolvedConfig extends ResolvedConfig {
11
- tsdown: TsdownOptions;
12
- }
13
- type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = TsdownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
14
- declare type __ΩTsdownPluginOptions = any[];
15
- declare type __ΩTsdownPluginUserConfig = any[];
16
- declare type __ΩTsdownPluginResolvedConfig = any[];
17
- declare type __ΩTsdownPluginContext = any[];
18
- //#endregion
19
- export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
20
- //# sourceMappingURL=plugin.d.cts.map
1
+ import "../build-BOzEPSe_.cjs";
2
+ import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-C2QQwbPM.cjs";
3
+ export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
@@ -1,21 +1,3 @@
1
- import { PluginContext } from "../core/src/types/context.mjs";
2
- import { ResolvedConfig, UserConfig } from "../core/src/types/config.mjs";
3
- import "../core/src/types/index.mjs";
4
- import { TsdownOptions } from "./build.mjs";
5
-
6
- //#region src/types/plugin.d.ts
7
- type TsdownPluginOptions = Partial<TsdownOptions>;
8
- interface TsdownPluginUserConfig extends UserConfig {
9
- tsdown?: TsdownPluginOptions;
10
- }
11
- interface TsdownPluginResolvedConfig extends ResolvedConfig {
12
- tsdown: TsdownOptions;
13
- }
14
- type TsdownPluginContext<TResolvedConfig extends TsdownPluginResolvedConfig = TsdownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
15
- declare type __ΩTsdownPluginOptions = any[];
16
- declare type __ΩTsdownPluginUserConfig = any[];
17
- declare type __ΩTsdownPluginResolvedConfig = any[];
18
- declare type __ΩTsdownPluginContext = any[];
19
- //#endregion
20
- export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
21
- //# sourceMappingURL=plugin.d.mts.map
1
+ import "../build-t47JyYHN.mjs";
2
+ import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-BElgq92H.mjs";
3
+ export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
@@ -1 +1,3 @@
1
+ import "../plugin-D3B5E_Hg.mjs";
2
+
1
3
  export { };
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,16 @@
1
+ const require_resolve_options = require('./resolve-options-D2gIEZW3.cjs');
2
+ let __powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
3
+ let unplugin = require("unplugin");
4
+
5
+ //#region src/helpers/unplugin.ts
6
+ function createTsdownPlugin(context) {
7
+ return (0, unplugin.createRolldownPlugin)((0, __powerlines_core_lib_unplugin.createUnplugin)(context))({});
8
+ }
9
+
10
+ //#endregion
11
+ Object.defineProperty(exports, 'createTsdownPlugin', {
12
+ enumerable: true,
13
+ get: function () {
14
+ return createTsdownPlugin;
15
+ }
16
+ });
@@ -0,0 +1,8 @@
1
+ import { t as TsdownPluginContext } from "./plugin-C2QQwbPM.cjs";
2
+ import * as rolldown0 from "rolldown";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createTsdownPlugin(context: TsdownPluginContext): rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
6
+ //#endregion
7
+ export { createTsdownPlugin as t };
8
+ //# sourceMappingURL=unplugin-C1z93_YH.d.cts.map