@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
@@ -0,0 +1,8 @@
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 as n, TsdownOptions as t };
8
+ //# sourceMappingURL=build-BOzEPSe_.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-BOzEPSe_.d.cts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,aAAA,GAAgB,QAC1B,KACE"}
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,8 @@
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 as n, TsdownOptions as t };
8
+ //# sourceMappingURL=build-t47JyYHN.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-t47JyYHN.d.mts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,aAAA,GAAgB,QAC1B,KACE"}
@@ -1,8 +1,9 @@
1
- const require_helpers_resolve_options = require('./resolve-options.cjs');
2
- const require_helpers_unplugin = require('./unplugin.cjs');
1
+ const require_resolve_options = require('../resolve-options-D2gIEZW3.cjs');
2
+ const require_unplugin = require('../unplugin-8qvZ1vSF.cjs');
3
+ require('../helpers-yB1XkvQI.cjs');
3
4
 
4
- exports.DEFAULT_TSDOWN_CONFIG = require_helpers_resolve_options.DEFAULT_TSDOWN_CONFIG;
5
- exports.createTsdownPlugin = require_helpers_unplugin.createTsdownPlugin;
6
- exports.resolveFormat = require_helpers_resolve_options.resolveFormat;
7
- exports.resolveFromFormat = require_helpers_resolve_options.resolveFromFormat;
8
- exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
5
+ exports.DEFAULT_TSDOWN_CONFIG = require_resolve_options.DEFAULT_TSDOWN_CONFIG;
6
+ exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
7
+ exports.resolveFormat = require_resolve_options.resolveFormat;
8
+ exports.resolveFromFormat = require_resolve_options.resolveFromFormat;
9
+ exports.resolveOptions = require_resolve_options.resolveOptions;
@@ -1,3 +1,6 @@
1
- import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./resolve-options.cjs";
2
- import { createTsdownPlugin } from "./unplugin.cjs";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-Ctkjvfj3.cjs";
2
+ import "../build-BOzEPSe_.cjs";
3
+ import "../plugin-C2QQwbPM.cjs";
4
+ import { t as createTsdownPlugin } from "../unplugin-C1z93_YH.cjs";
5
+ import "../index-CiBIKhMu.cjs";
3
6
  export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, resolveFormat, resolveFromFormat, resolveOptions };
@@ -1,3 +1,6 @@
1
- import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./resolve-options.mjs";
2
- import { createTsdownPlugin } from "./unplugin.mjs";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-BqY8g1Lc.mjs";
2
+ import "../build-t47JyYHN.mjs";
3
+ import "../plugin-BElgq92H.mjs";
4
+ import { t as createTsdownPlugin } from "../unplugin-CLFi0U2r.mjs";
5
+ import "../index-CW2WHUXP.mjs";
3
6
  export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, resolveFormat, resolveFromFormat, resolveOptions };
@@ -1,4 +1,5 @@
1
- import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./resolve-options.mjs";
2
- import { createTsdownPlugin } from "./unplugin.mjs";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-CSWiRNVz.mjs";
2
+ import { t as createTsdownPlugin } from "../unplugin-kYkLMXDM.mjs";
3
+ import "../helpers-C9XSjwSZ.mjs";
3
4
 
4
5
  export { DEFAULT_TSDOWN_CONFIG, createTsdownPlugin, resolveFormat, resolveFromFormat, resolveOptions };
@@ -1,128 +1,6 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_build_helpers = require('../core/src/plugin-utils/build-helpers.cjs');
3
- require('../core/src/plugin-utils/index.cjs');
4
- let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
- let __stryke_path_append = require("@stryke/path/append");
6
- let defu = require("defu");
7
- defu = require_rolldown_runtime.__toESM(defu);
8
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
9
- let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
10
- let __stryke_path_replace = require("@stryke/path/replace");
11
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
1
+ const require_resolve_options = require('../resolve-options-D2gIEZW3.cjs');
12
2
 
13
- //#region src/helpers/resolve-options.ts
14
- const DEFAULT_TSDOWN_CONFIG = {
15
- platform: "neutral",
16
- target: "esnext",
17
- fixedExtension: true,
18
- nodeProtocol: true,
19
- clean: false
20
- };
21
- /**
22
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
23
- *
24
- * @param formats - The formats to resolve.
25
- * @returns The resolved entry options.
26
- */
27
- function resolveFormat(formats) {
28
- return (0, __stryke_convert_to_array.toArray)(formats).map((format) => {
29
- switch (format) {
30
- case "cjs": return "cjs";
31
- case "iife": return "iife";
32
- case "esm":
33
- default: return "esm";
34
- }
35
- });
36
- }
37
- /**
38
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
39
- *
40
- * @param formats - The formats to resolve.
41
- * @returns The resolved entry options.
42
- */
43
- function resolveFromFormat(formats) {
44
- return (0, __stryke_convert_to_array.toArray)(formats).map((format) => {
45
- switch (format) {
46
- case "cjs":
47
- case "commonjs": return "cjs";
48
- case "iife": return "iife";
49
- case "esm":
50
- case "es":
51
- case "module":
52
- case "umd":
53
- default: return "esm";
54
- }
55
- });
56
- }
57
- const formatMessage = (context, ...msgs) => msgs.filter(Boolean).join(" ").replace(new RegExp(`\\[${context.config.name}\\]`, "g"), "").replaceAll(/^\s+/g, "").replaceAll(/\s+$/g, "").trim();
58
- /**
59
- * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
60
- *
61
- * @param context - The build context.
62
- * @returns The resolved options.
63
- */
64
- function resolveOptions(context) {
65
- const { external, noExternal } = require_build_helpers.getDependencyConfig(context);
66
- return (0, defu.default)({
67
- 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")],
68
- external,
69
- noExternal,
70
- alias: context.alias,
71
- resolve: { alias: context.alias },
72
- 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) => {
73
- const result = Object.fromEntries(Object.entries(exports$1).map(([key, value]) => {
74
- if ((0, __stryke_type_checks_is_set_string.isSetString)(value)) return [key, value];
75
- const currentExport = {};
76
- if ((0, __stryke_type_checks_is_set_string.isSetString)(value.require)) currentExport.require = {
77
- types: (0, __stryke_path_replace.replaceExtension)(value.require, ".d.cts", { fullExtension: true }),
78
- default: value.require
79
- };
80
- if ((0, __stryke_type_checks_is_set_string.isSetString)(value.import)) currentExport.import = {
81
- types: (0, __stryke_path_replace.replaceExtension)(value.import, ".d.mts", { fullExtension: true }),
82
- default: value.import
83
- };
84
- if (!(0, __stryke_type_checks_is_set_object.isSetObject)(value.default)) {
85
- if ((0, __stryke_type_checks_is_set_object.isSetObject)(currentExport.import)) currentExport.default = currentExport.import;
86
- else if ((0, __stryke_type_checks_is_set_object.isSetObject)(currentExport.require)) currentExport.default = currentExport.require;
87
- }
88
- return [key, currentExport];
89
- }));
90
- return Object.keys(result).sort().reduce((ret, key) => {
91
- ret[key] = result[key];
92
- return ret;
93
- }, {});
94
- } }) : void 0
95
- }, context.config?.tsdown ? context.config?.tsdown : {}, context.config?.rolldown ? { inputOptions: context.config?.rolldown } : {}, {
96
- name: context.config.name,
97
- cwd: (0, __stryke_path_append.appendPath)(context.config.root, context.workspaceConfig.workspaceRoot),
98
- define: context.config.define,
99
- inputOptions: { transform: { inject: context.config.inject } },
100
- platform: context.config.platform,
101
- dts: true,
102
- outDir: (0, __stryke_path_append.appendPath)(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
103
- tsconfig: (0, __stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
104
- format: resolveFormat(context.config.output.format).filter(Boolean),
105
- mode: context.config.mode,
106
- treeshake: context.config?.tsdown ? context.config?.tsdown?.treeshake : void 0,
107
- minify: context.config.mode === "production",
108
- metafile: context.config.mode === "development",
109
- sourcemap: context.config.mode === "development",
110
- debug: context.config.mode === "development",
111
- silent: context.config.logLevel === null || context.config.mode === "production",
112
- logLevel: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
113
- customLogger: {
114
- level: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
115
- info: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs)),
116
- warn: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
117
- warnOnce: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
118
- error: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.error(formatMessage(context, ...msgs)),
119
- success: (...msgs) => (0, __stryke_type_checks_is_set_string.isSetString)(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs))
120
- }
121
- }, DEFAULT_TSDOWN_CONFIG);
122
- }
123
-
124
- //#endregion
125
- exports.DEFAULT_TSDOWN_CONFIG = DEFAULT_TSDOWN_CONFIG;
126
- exports.resolveFormat = resolveFormat;
127
- exports.resolveFromFormat = resolveFromFormat;
128
- exports.resolveOptions = resolveOptions;
3
+ exports.DEFAULT_TSDOWN_CONFIG = require_resolve_options.DEFAULT_TSDOWN_CONFIG;
4
+ exports.resolveFormat = require_resolve_options.resolveFormat;
5
+ exports.resolveFromFormat = require_resolve_options.resolveFromFormat;
6
+ exports.resolveOptions = require_resolve_options.resolveOptions;
@@ -1,30 +1,2 @@
1
- import { Context } from "../core/src/types/context.cjs";
2
- import { Format } from "@storm-software/build-tools/types";
3
- import { Format as Format$1, UserConfig } from "tsdown";
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 | 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;
28
- //#endregion
29
- export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
30
- //# sourceMappingURL=resolve-options.d.cts.map
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-Ctkjvfj3.cjs";
2
+ export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
@@ -1,31 +1,2 @@
1
- import { Context } from "../core/src/types/context.mjs";
2
- import "../core/src/types/index.mjs";
3
- import { Format, UserConfig } from "tsdown";
4
- import { Format as Format$1 } from "@storm-software/build-tools/types";
5
-
6
- //#region src/helpers/resolve-options.d.ts
7
- declare const DEFAULT_TSDOWN_CONFIG: Partial<UserConfig>;
8
- /**
9
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
10
- *
11
- * @param formats - The formats to resolve.
12
- * @returns The resolved entry options.
13
- */
14
- declare function resolveFormat(formats?: Format$1 | Format$1[]): Format[];
15
- /**
16
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
17
- *
18
- * @param formats - The formats to resolve.
19
- * @returns The resolved entry options.
20
- */
21
- declare function resolveFromFormat(formats?: Format | Format[]): Format$1[];
22
- /**
23
- * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
24
- *
25
- * @param context - The build context.
26
- * @returns The resolved options.
27
- */
28
- declare function resolveOptions(context: Context): UserConfig;
29
- //#endregion
30
- export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
31
- //# sourceMappingURL=resolve-options.d.mts.map
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-BqY8g1Lc.mjs";
2
+ export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
@@ -1,124 +1,3 @@
1
- import { getDependencyConfig } from "../core/src/plugin-utils/build-helpers.mjs";
2
- import "../core/src/plugin-utils/index.mjs";
3
- import { isSetString } from "@stryke/type-checks/is-set-string";
4
- import { appendPath } from "@stryke/path/append";
5
- import defu$1 from "defu";
6
- import { toArray } from "@stryke/convert/to-array";
7
- import { isSetObject } from "@stryke/type-checks/is-set-object";
8
- import { replaceExtension, replacePath } from "@stryke/path/replace";
9
- import { joinPaths } from "@stryke/path/join-paths";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-CSWiRNVz.mjs";
10
2
 
11
- //#region src/helpers/resolve-options.ts
12
- const DEFAULT_TSDOWN_CONFIG = {
13
- platform: "neutral",
14
- target: "esnext",
15
- fixedExtension: true,
16
- nodeProtocol: true,
17
- clean: false
18
- };
19
- /**
20
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
21
- *
22
- * @param formats - The formats to resolve.
23
- * @returns The resolved entry options.
24
- */
25
- function resolveFormat(formats) {
26
- return toArray(formats).map((format) => {
27
- switch (format) {
28
- case "cjs": return "cjs";
29
- case "iife": return "iife";
30
- case "esm":
31
- default: return "esm";
32
- }
33
- });
34
- }
35
- /**
36
- * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).
37
- *
38
- * @param formats - The formats to resolve.
39
- * @returns The resolved entry options.
40
- */
41
- function resolveFromFormat(formats) {
42
- return toArray(formats).map((format) => {
43
- switch (format) {
44
- case "cjs":
45
- case "commonjs": return "cjs";
46
- case "iife": return "iife";
47
- case "esm":
48
- case "es":
49
- case "module":
50
- case "umd":
51
- default: return "esm";
52
- }
53
- });
54
- }
55
- const formatMessage = (context, ...msgs) => msgs.filter(Boolean).join(" ").replace(new RegExp(`\\[${context.config.name}\\]`, "g"), "").replaceAll(/^\s+/g, "").replaceAll(/\s+$/g, "").trim();
56
- /**
57
- * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).
58
- *
59
- * @param context - The build context.
60
- * @returns The resolved options.
61
- */
62
- function resolveOptions(context) {
63
- const { external, noExternal } = getDependencyConfig(context);
64
- return defu$1({
65
- 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")],
66
- external,
67
- noExternal,
68
- alias: context.alias,
69
- resolve: { alias: context.alias },
70
- exports: context.config?.tsdown && context.config.tsdown?.exports ? defu$1(isSetObject(context.config.tsdown?.exports) ? context.config.tsdown?.exports : {}, { customExports: (exports) => {
71
- const result = Object.fromEntries(Object.entries(exports).map(([key, value]) => {
72
- if (isSetString(value)) return [key, value];
73
- const currentExport = {};
74
- if (isSetString(value.require)) currentExport.require = {
75
- types: replaceExtension(value.require, ".d.cts", { fullExtension: true }),
76
- default: value.require
77
- };
78
- if (isSetString(value.import)) currentExport.import = {
79
- types: replaceExtension(value.import, ".d.mts", { fullExtension: true }),
80
- default: value.import
81
- };
82
- if (!isSetObject(value.default)) {
83
- if (isSetObject(currentExport.import)) currentExport.default = currentExport.import;
84
- else if (isSetObject(currentExport.require)) currentExport.default = currentExport.require;
85
- }
86
- return [key, currentExport];
87
- }));
88
- return Object.keys(result).sort().reduce((ret, key) => {
89
- ret[key] = result[key];
90
- return ret;
91
- }, {});
92
- } }) : void 0
93
- }, context.config?.tsdown ? context.config?.tsdown : {}, context.config?.rolldown ? { inputOptions: context.config?.rolldown } : {}, {
94
- name: context.config.name,
95
- cwd: appendPath(context.config.root, context.workspaceConfig.workspaceRoot),
96
- define: context.config.define,
97
- inputOptions: { transform: { inject: context.config.inject } },
98
- platform: context.config.platform,
99
- dts: true,
100
- outDir: appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
101
- tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
102
- format: resolveFormat(context.config.output.format).filter(Boolean),
103
- mode: context.config.mode,
104
- treeshake: context.config?.tsdown ? context.config?.tsdown?.treeshake : void 0,
105
- minify: context.config.mode === "production",
106
- metafile: context.config.mode === "development",
107
- sourcemap: context.config.mode === "development",
108
- debug: context.config.mode === "development",
109
- silent: context.config.logLevel === null || context.config.mode === "production",
110
- logLevel: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
111
- customLogger: {
112
- level: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
113
- info: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs)),
114
- warn: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
115
- warnOnce: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.warn(formatMessage(context, ...msgs)),
116
- error: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.error(formatMessage(context, ...msgs)),
117
- success: (...msgs) => isSetString(formatMessage(context, ...msgs).replace(/\s+/g, "")) && context.debug(formatMessage(context, ...msgs))
118
- }
119
- }, DEFAULT_TSDOWN_CONFIG);
120
- }
121
-
122
- //#endregion
123
- export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
124
- //# sourceMappingURL=resolve-options.mjs.map
3
+ export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
@@ -1,12 +1,3 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_plugin = require('../core/src/lib/unplugin/plugin.cjs');
3
- require('../core/src/lib/unplugin/index.cjs');
4
- let unplugin = require("unplugin");
1
+ const require_unplugin = require('../unplugin-8qvZ1vSF.cjs');
5
2
 
6
- //#region src/helpers/unplugin.ts
7
- function createTsdownPlugin(context) {
8
- return (0, unplugin.createRolldownPlugin)(require_plugin.createUnplugin(context))({});
9
- }
10
-
11
- //#endregion
12
- exports.createTsdownPlugin = createTsdownPlugin;
3
+ exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
@@ -1,8 +1,4 @@
1
- import { TsdownPluginContext } from "../types/plugin.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 };
8
- //# sourceMappingURL=unplugin.d.cts.map
1
+ import "../build-BOzEPSe_.cjs";
2
+ import "../plugin-C2QQwbPM.cjs";
3
+ import { t as createTsdownPlugin } from "../unplugin-C1z93_YH.cjs";
4
+ export { createTsdownPlugin };
@@ -1,8 +1,4 @@
1
- import { TsdownPluginContext } from "../types/plugin.mjs";
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 };
8
- //# sourceMappingURL=unplugin.d.mts.map
1
+ import "../build-t47JyYHN.mjs";
2
+ import "../plugin-BElgq92H.mjs";
3
+ import { t as createTsdownPlugin } from "../unplugin-CLFi0U2r.mjs";
4
+ export { createTsdownPlugin };
@@ -1,12 +1,3 @@
1
- import { createUnplugin } from "../core/src/lib/unplugin/plugin.mjs";
2
- import "../core/src/lib/unplugin/index.mjs";
3
- import { createRolldownPlugin } from "unplugin";
1
+ import { t as createTsdownPlugin } from "../unplugin-kYkLMXDM.mjs";
4
2
 
5
- //#region src/helpers/unplugin.ts
6
- function createTsdownPlugin(context) {
7
- return createRolldownPlugin(createUnplugin(context))({});
8
- }
9
-
10
- //#endregion
11
- export { createTsdownPlugin };
12
- //# sourceMappingURL=unplugin.mjs.map
3
+ export { createTsdownPlugin };
@@ -0,0 +1 @@
1
+ export { };
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.cjs CHANGED
@@ -1,11 +1,13 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_format_package_json = require('./core/src/plugin-utils/format-package-json.cjs');
4
- const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
5
- const require_helpers_unplugin = require('./helpers/unplugin.cjs');
6
- require('./helpers/index.cjs');
2
+ const require_resolve_options = require('./resolve-options-D2gIEZW3.cjs');
3
+ const require_unplugin = require('./unplugin-8qvZ1vSF.cjs');
4
+ require('./helpers-yB1XkvQI.cjs');
5
+ require('./build-DJTI0ZMx.cjs');
6
+ require('./plugin-D5qyQPqC.cjs');
7
+ require('./types-D208vOSb.cjs');
8
+ let __powerlines_core_plugin_utils_format_package_json = require("@powerlines/core/plugin-utils/format-package-json");
7
9
  let defu = require("defu");
8
- defu = require_rolldown_runtime.__toESM(defu);
10
+ defu = require_resolve_options.__toESM(defu);
9
11
  let tsdown = require("tsdown");
10
12
 
11
13
  //#region src/index.ts
@@ -26,19 +28,19 @@ const plugin = (options = {}) => {
26
28
  this.trace("Starting Tsdown build process...");
27
29
  await (0, tsdown.build)((0, defu.default)({
28
30
  config: false,
29
- plugins: [require_helpers_unplugin.createTsdownPlugin(this)]
30
- }, require_helpers_resolve_options.resolveOptions(this)));
31
- await require_format_package_json.formatPackageJson(this);
31
+ plugins: [require_unplugin.createTsdownPlugin(this)]
32
+ }, require_resolve_options.resolveOptions(this)));
33
+ await (0, __powerlines_core_plugin_utils_format_package_json.formatPackageJson)(this);
32
34
  }
33
35
  };
34
36
  };
35
37
  var src_default = plugin;
36
38
 
37
39
  //#endregion
38
- exports.DEFAULT_TSDOWN_CONFIG = require_helpers_resolve_options.DEFAULT_TSDOWN_CONFIG;
39
- exports.createTsdownPlugin = require_helpers_unplugin.createTsdownPlugin;
40
+ exports.DEFAULT_TSDOWN_CONFIG = require_resolve_options.DEFAULT_TSDOWN_CONFIG;
41
+ exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
40
42
  exports.default = src_default;
41
43
  exports.plugin = plugin;
42
- exports.resolveFormat = require_helpers_resolve_options.resolveFormat;
43
- exports.resolveFromFormat = require_helpers_resolve_options.resolveFromFormat;
44
- exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
44
+ exports.resolveFormat = require_resolve_options.resolveFormat;
45
+ exports.resolveFromFormat = require_resolve_options.resolveFromFormat;
46
+ exports.resolveOptions = require_resolve_options.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,8 +1,10 @@
1
- import { Plugin } from "./core/src/types/plugin.cjs";
2
- import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./helpers/resolve-options.cjs";
3
- import { TsdownOptions, __ΩTsdownOptions } from "./types/build.cjs";
4
- import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./types/plugin.cjs";
5
- import { createTsdownPlugin } from "./helpers/unplugin.cjs";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "./resolve-options-Ctkjvfj3.cjs";
2
+ import { n as __ΩTsdownOptions, t as TsdownOptions } from "./build-BOzEPSe_.cjs";
3
+ 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";
4
+ import { t as createTsdownPlugin } from "./unplugin-C1z93_YH.cjs";
5
+ import "./index-CiBIKhMu.cjs";
6
+ import "./index-B_e8BwCm.cjs";
7
+ import { Plugin } from "@powerlines/core/types";
6
8
 
7
9
  //#region src/index.d.ts
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAoCa,cAAA,MAqCZ,EAAA,CAAA,iBApCkB,mBAoClB,GApCwC,mBAoCxC,CAAA,CAAA,OAAA,CAAA,EAlCU,mBAkCV,EAAA,GAjCE,MAiCF,CAjCS,QAiCT,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAoCa,0BACM,sBAAsB,+BAE9B,wBACR,OAAO"}
package/dist/index.d.mts CHANGED
@@ -1,11 +1,10 @@
1
- import { Plugin } from "./core/src/types/plugin.mjs";
2
- import "./core/src/types/index.mjs";
3
- import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./helpers/resolve-options.mjs";
4
- import { TsdownOptions, __ΩTsdownOptions } from "./types/build.mjs";
5
- import { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig } from "./types/plugin.mjs";
6
- import { createTsdownPlugin } from "./helpers/unplugin.mjs";
7
- import "./helpers/index.mjs";
8
- import "./types/index.mjs";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "./resolve-options-BqY8g1Lc.mjs";
2
+ import { n as __ΩTsdownOptions, t as TsdownOptions } from "./build-t47JyYHN.mjs";
3
+ 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";
4
+ import { t as createTsdownPlugin } from "./unplugin-CLFi0U2r.mjs";
5
+ import "./index-CW2WHUXP.mjs";
6
+ import "./index-Cc7fCJU9.mjs";
7
+ import { Plugin } from "@powerlines/core/types";
9
8
 
10
9
  //#region src/index.d.ts
11
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAoCa,0BACM,sBAAsB,+BAE9B,wBACR,OAAO"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAoCa,0BACM,sBAAsB,+BAE9B,wBACR,OAAO"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,11 @@
1
- import { formatPackageJson } from "./core/src/plugin-utils/format-package-json.mjs";
2
- import { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions } from "./helpers/resolve-options.mjs";
3
- import { createTsdownPlugin } from "./helpers/unplugin.mjs";
4
- import "./helpers/index.mjs";
5
- import defu$1 from "defu";
1
+ import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "./resolve-options-CSWiRNVz.mjs";
2
+ import { t as createTsdownPlugin } from "./unplugin-kYkLMXDM.mjs";
3
+ import "./helpers-C9XSjwSZ.mjs";
4
+ import "./build-XTM4L3VY.mjs";
5
+ import "./plugin-D3B5E_Hg.mjs";
6
+ import "./types-Dv2cgIDx.mjs";
7
+ import { formatPackageJson } from "@powerlines/core/plugin-utils/format-package-json";
8
+ import defu from "defu";
6
9
  import { build } from "tsdown";
7
10
 
8
11
  //#region src/index.ts
@@ -21,7 +24,7 @@ const plugin = (options = {}) => {
21
24
  },
22
25
  async build() {
23
26
  this.trace("Starting Tsdown build process...");
24
- await build(defu$1({
27
+ await build(defu({
25
28
  config: false,
26
29
  plugins: [createTsdownPlugin(this)]
27
30
  }, resolveOptions(this)));