powerlines 0.41.6 → 0.41.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +14 -16
  2. package/dist/{api-CY668wMZ.mjs → api-BYLuEyjx.mjs} +142 -333
  3. package/dist/api-BYLuEyjx.mjs.map +1 -0
  4. package/dist/{api-GPlMYw0d.cjs → api-Zx_hzL3g.cjs} +505 -722
  5. package/dist/astro.cjs +8 -18
  6. package/dist/astro.d.cts +1 -2
  7. package/dist/astro.d.cts.map +1 -1
  8. package/dist/astro.d.mts +1 -6
  9. package/dist/astro.d.mts.map +1 -1
  10. package/dist/astro.mjs +6 -16
  11. package/dist/astro.mjs.map +1 -1
  12. package/dist/{chunk-CbDLau6x.cjs → chunk-AIJqnxB6.cjs} +27 -1
  13. package/dist/chunk-CtajNgzt.mjs +36 -0
  14. package/dist/config.cjs +20 -4
  15. package/dist/config.d.cts +1 -2
  16. package/dist/config.d.mts +1 -3
  17. package/dist/config.mjs +11 -2
  18. package/dist/config.mjs.map +1 -0
  19. package/dist/constants.cjs +20 -20
  20. package/dist/constants.d.cts +1 -24
  21. package/dist/constants.d.mts +1 -24
  22. package/dist/constants.mjs +11 -3
  23. package/dist/constants.mjs.map +1 -0
  24. package/dist/context/index.cjs +4 -9
  25. package/dist/context/index.d.cts +56 -132
  26. package/dist/context/index.d.cts.map +1 -1
  27. package/dist/context/index.d.mts +55 -135
  28. package/dist/context/index.d.mts.map +1 -1
  29. package/dist/context/index.mjs +3 -9
  30. package/dist/esbuild.cjs +60 -17
  31. package/dist/esbuild.d.cts +5 -29
  32. package/dist/esbuild.d.cts.map +1 -1
  33. package/dist/esbuild.d.mts +5 -33
  34. package/dist/esbuild.d.mts.map +1 -1
  35. package/dist/esbuild.mjs +44 -12
  36. package/dist/esbuild.mjs.map +1 -0
  37. package/dist/farm.cjs +6 -13
  38. package/dist/farm.d.cts +2 -3
  39. package/dist/farm.d.cts.map +1 -1
  40. package/dist/farm.d.mts +2 -6
  41. package/dist/farm.d.mts.map +1 -1
  42. package/dist/farm.mjs +4 -11
  43. package/dist/farm.mjs.map +1 -1
  44. package/dist/index.cjs +7 -13
  45. package/dist/index.d.cts +263 -6
  46. package/dist/index.d.cts.map +1 -0
  47. package/dist/index.d.mts +263 -7
  48. package/dist/index.d.mts.map +1 -0
  49. package/dist/index.mjs +3 -9
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/next.cjs +7 -14
  52. package/dist/next.d.cts +0 -1
  53. package/dist/next.d.cts.map +1 -1
  54. package/dist/next.d.mts +0 -1
  55. package/dist/next.d.mts.map +1 -1
  56. package/dist/next.mjs +6 -13
  57. package/dist/next.mjs.map +1 -1
  58. package/dist/nuxt.cjs +12 -22
  59. package/dist/nuxt.d.cts +2 -3
  60. package/dist/nuxt.d.cts.map +1 -1
  61. package/dist/nuxt.d.mts +2 -7
  62. package/dist/nuxt.d.mts.map +1 -1
  63. package/dist/nuxt.mjs +8 -18
  64. package/dist/nuxt.mjs.map +1 -1
  65. package/dist/plugin-utils.cjs +20 -28
  66. package/dist/plugin-utils.d.cts +1 -267
  67. package/dist/plugin-utils.d.mts +1 -272
  68. package/dist/plugin-utils.mjs +11 -4
  69. package/dist/plugin-utils.mjs.map +1 -0
  70. package/dist/rolldown.cjs +52 -18
  71. package/dist/rolldown.d.cts +5 -29
  72. package/dist/rolldown.d.cts.map +1 -1
  73. package/dist/rolldown.d.mts +5 -32
  74. package/dist/rolldown.d.mts.map +1 -1
  75. package/dist/rolldown.mjs +36 -13
  76. package/dist/rolldown.mjs.map +1 -0
  77. package/dist/rollup.cjs +20 -48
  78. package/dist/rollup.d.cts +5 -29
  79. package/dist/rollup.d.cts.map +1 -1
  80. package/dist/rollup.d.mts +5 -32
  81. package/dist/rollup.d.mts.map +1 -1
  82. package/dist/rollup.mjs +6 -44
  83. package/dist/rollup.mjs.map +1 -1
  84. package/dist/rspack.cjs +20 -82
  85. package/dist/rspack.d.cts +4 -24
  86. package/dist/rspack.d.cts.map +1 -1
  87. package/dist/rspack.d.mts +4 -27
  88. package/dist/rspack.d.mts.map +1 -1
  89. package/dist/rspack.mjs +5 -77
  90. package/dist/rspack.mjs.map +1 -1
  91. package/dist/storage/index.cjs +2 -3
  92. package/dist/storage/index.d.cts +7 -7
  93. package/dist/storage/index.d.cts.map +1 -1
  94. package/dist/storage/index.d.mts +7 -11
  95. package/dist/storage/index.d.mts.map +1 -1
  96. package/dist/storage/index.mjs +1 -3
  97. package/dist/{tsconfig-C8M8X6U0.cjs → tsconfig-BJrUrPC_.cjs} +13 -13
  98. package/dist/{tsconfig-B92heKit.mjs → tsconfig-D9GCB2I9.mjs} +5 -5
  99. package/dist/tsconfig-D9GCB2I9.mjs.map +1 -0
  100. package/dist/tsdown.cjs +38 -187
  101. package/dist/tsdown.d.cts +2 -24
  102. package/dist/tsdown.d.cts.map +1 -1
  103. package/dist/tsdown.d.mts +4 -30
  104. package/dist/tsdown.d.mts.map +1 -1
  105. package/dist/tsdown.mjs +8 -167
  106. package/dist/tsdown.mjs.map +1 -1
  107. package/dist/tsup.cjs +29 -134
  108. package/dist/tsup.d.cts +2 -24
  109. package/dist/tsup.d.cts.map +1 -1
  110. package/dist/tsup.d.mts +2 -28
  111. package/dist/tsup.d.mts.map +1 -1
  112. package/dist/tsup.mjs +7 -122
  113. package/dist/tsup.mjs.map +1 -1
  114. package/dist/types-DerAvFjs.d.cts +4 -0
  115. package/dist/types-DerAvFjs.d.cts.map +1 -0
  116. package/dist/types-ro7jWCtL.d.mts +4 -0
  117. package/dist/types-ro7jWCtL.d.mts.map +1 -0
  118. package/dist/typescript/index.cjs +2 -1
  119. package/dist/typescript/index.d.cts +2 -2
  120. package/dist/typescript/index.d.cts.map +1 -1
  121. package/dist/typescript/index.d.mts +1 -4
  122. package/dist/typescript/index.d.mts.map +1 -1
  123. package/dist/typescript/index.mjs +1 -1
  124. package/dist/unloader.cjs +6 -13
  125. package/dist/unloader.d.cts +2 -4
  126. package/dist/unloader.d.cts.map +1 -1
  127. package/dist/unloader.d.mts +2 -7
  128. package/dist/unloader.d.mts.map +1 -1
  129. package/dist/unloader.mjs +4 -11
  130. package/dist/unloader.mjs.map +1 -1
  131. package/dist/unplugin.cjs +11 -14
  132. package/dist/unplugin.d.cts +5 -6
  133. package/dist/unplugin.d.cts.map +1 -1
  134. package/dist/unplugin.d.mts +3 -6
  135. package/dist/unplugin.d.mts.map +1 -1
  136. package/dist/unplugin.mjs +6 -10
  137. package/dist/utils.cjs +38 -22
  138. package/dist/utils.d.cts +3 -2
  139. package/dist/utils.d.mts +3 -3
  140. package/dist/utils.mjs +19 -3
  141. package/dist/utils.mjs.map +1 -0
  142. package/dist/{virtual-B1MLgqnQ.cjs → virtual-Cbvj12lU.cjs} +33 -33
  143. package/dist/{virtual-B9imjOqe.mjs → virtual-DvkJm7gK.mjs} +7 -7
  144. package/dist/virtual-DvkJm7gK.mjs.map +1 -0
  145. package/dist/vite.cjs +84 -19
  146. package/dist/vite.d.cts +5 -16
  147. package/dist/vite.d.cts.map +1 -1
  148. package/dist/vite.d.mts +5 -19
  149. package/dist/vite.d.mts.map +1 -1
  150. package/dist/vite.mjs +67 -14
  151. package/dist/vite.mjs.map +1 -0
  152. package/dist/webpack.cjs +42 -16
  153. package/dist/webpack.d.cts +5 -29
  154. package/dist/webpack.d.cts.map +1 -1
  155. package/dist/webpack.d.mts +5 -32
  156. package/dist/webpack.d.mts.map +1 -1
  157. package/dist/webpack.mjs +26 -11
  158. package/dist/webpack.mjs.map +1 -0
  159. package/package.json +17 -17
  160. package/dist/api-CY668wMZ.mjs.map +0 -1
  161. package/dist/commands-7TWNqTU1.d.cts +0 -12
  162. package/dist/commands-7TWNqTU1.d.cts.map +0 -1
  163. package/dist/commands-yacLkOi0.d.mts +0 -12
  164. package/dist/commands-yacLkOi0.d.mts.map +0 -1
  165. package/dist/config-CK756s0L.d.mts +0 -2232
  166. package/dist/config-CK756s0L.d.mts.map +0 -1
  167. package/dist/config-CiPXgwzt.d.mts +0 -39
  168. package/dist/config-CiPXgwzt.d.mts.map +0 -1
  169. package/dist/config-D4Fh2gQL.mjs +0 -87
  170. package/dist/config-D4Fh2gQL.mjs.map +0 -1
  171. package/dist/config-D86Vw7SC.cjs +0 -105
  172. package/dist/config-J74ORCFY.d.cts +0 -39
  173. package/dist/config-J74ORCFY.d.cts.map +0 -1
  174. package/dist/config-vnrrSxEB.d.cts +0 -2232
  175. package/dist/config-vnrrSxEB.d.cts.map +0 -1
  176. package/dist/constants-CZh5rsgh.cjs +0 -103
  177. package/dist/constants-cXxSHhNp.mjs +0 -32
  178. package/dist/constants-cXxSHhNp.mjs.map +0 -1
  179. package/dist/constants.d.cts.map +0 -1
  180. package/dist/constants.d.mts.map +0 -1
  181. package/dist/esbuild-B3NuCco0.cjs +0 -100
  182. package/dist/esbuild-DWiE0pYc.mjs +0 -82
  183. package/dist/esbuild-DWiE0pYc.mjs.map +0 -1
  184. package/dist/index-2JXW-b2-.d.mts +0 -82
  185. package/dist/index-2JXW-b2-.d.mts.map +0 -1
  186. package/dist/index-6BLROVtJ.d.mts +0 -261
  187. package/dist/index-6BLROVtJ.d.mts.map +0 -1
  188. package/dist/index-C7W0kmm7.d.mts +0 -171
  189. package/dist/index-C7W0kmm7.d.mts.map +0 -1
  190. package/dist/index-DJ-k0GOX.d.cts +0 -261
  191. package/dist/index-DJ-k0GOX.d.cts.map +0 -1
  192. package/dist/paths-CS8ecCnW.mjs +0 -81
  193. package/dist/paths-CS8ecCnW.mjs.map +0 -1
  194. package/dist/paths-YmyIGEVo.cjs +0 -98
  195. package/dist/plugin-B9TQt-p0.d.cts +0 -82
  196. package/dist/plugin-B9TQt-p0.d.cts.map +0 -1
  197. package/dist/plugin-BE3wmhoU.d.cts +0 -26
  198. package/dist/plugin-BE3wmhoU.d.cts.map +0 -1
  199. package/dist/plugin-CZ_PJPpQ.cjs +0 -96
  200. package/dist/plugin-C_8RhG5V.d.mts +0 -26
  201. package/dist/plugin-C_8RhG5V.d.mts.map +0 -1
  202. package/dist/plugin-E5foRD0k.mjs +0 -61
  203. package/dist/plugin-E5foRD0k.mjs.map +0 -1
  204. package/dist/plugin-utils-C3HnZJl1.mjs +0 -387
  205. package/dist/plugin-utils-C3HnZJl1.mjs.map +0 -1
  206. package/dist/plugin-utils-Ck3cx3w6.cjs +0 -531
  207. package/dist/plugin-utils.d.cts.map +0 -1
  208. package/dist/plugin-utils.d.mts.map +0 -1
  209. package/dist/resolve-options-6sXFqzEA.mjs +0 -116
  210. package/dist/resolve-options-6sXFqzEA.mjs.map +0 -1
  211. package/dist/resolve-options-BQnTgg3V.cjs +0 -105
  212. package/dist/resolve-options-D-RGs8j8.mjs +0 -117
  213. package/dist/resolve-options-D-RGs8j8.mjs.map +0 -1
  214. package/dist/resolve-options-DHL3RM8F.mjs +0 -87
  215. package/dist/resolve-options-DHL3RM8F.mjs.map +0 -1
  216. package/dist/resolve-options-lxQ2pm0W.cjs +0 -127
  217. package/dist/resolve-options-vyFhhkLp.cjs +0 -133
  218. package/dist/rolldown-CQI8ps6f.cjs +0 -83
  219. package/dist/rolldown-DsXEFXyP.mjs +0 -65
  220. package/dist/rolldown-DsXEFXyP.mjs.map +0 -1
  221. package/dist/tsconfig-B92heKit.mjs.map +0 -1
  222. package/dist/types-Bh_vLuQ0.d.mts +0 -1
  223. package/dist/utils-BbDma_5Y.cjs +0 -449
  224. package/dist/utils-DoQcX7Sk.mjs +0 -339
  225. package/dist/utils-DoQcX7Sk.mjs.map +0 -1
  226. package/dist/virtual-B9imjOqe.mjs.map +0 -1
  227. package/dist/vite-Bx1gbbj3.mjs +0 -171
  228. package/dist/vite-Bx1gbbj3.mjs.map +0 -1
  229. package/dist/vite-XV170zx6.cjs +0 -189
  230. package/dist/webpack-9G4xJBfz.cjs +0 -107
  231. package/dist/webpack-BkTkELre.mjs +0 -88
  232. package/dist/webpack-BkTkELre.mjs.map +0 -1
  233. package/dist/write-file-CpNWY8SV.d.cts +0 -171
  234. package/dist/write-file-CpNWY8SV.d.cts.map +0 -1
@@ -1,127 +0,0 @@
1
- const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_resolve_options = require('./resolve-options-vyFhhkLp.cjs');
3
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
4
- let __stryke_path_append = require("@stryke/path/append");
5
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
6
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
7
- let defu = require("defu");
8
- defu = require_chunk.__toESM(defu);
9
- let node_fs = require("node:fs");
10
- let __rollup_plugin_babel = require("@rollup/plugin-babel");
11
- let __rollup_plugin_inject = require("@rollup/plugin-inject");
12
- __rollup_plugin_inject = require_chunk.__toESM(__rollup_plugin_inject);
13
- let __rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
14
- __rollup_plugin_node_resolve = require_chunk.__toESM(__rollup_plugin_node_resolve);
15
- let __rollup_plugin_replace = require("@rollup/plugin-replace");
16
- __rollup_plugin_replace = require_chunk.__toESM(__rollup_plugin_replace);
17
- let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
18
- rollup_plugin_typescript2 = require_chunk.__toESM(rollup_plugin_typescript2);
19
- let rolldown_experimental = require("rolldown/experimental");
20
-
21
- //#region ../plugin-rolldown/src/helpers/resolve-options.ts
22
- /**
23
- * Resolves the options for [rolldown](https://rolldown.rs).
24
- *
25
- * @param context - The build context.
26
- * @returns The resolved options.
27
- */
28
- function resolveOptions(context) {
29
- return (0, defu.default)({
30
- input: (0, node_fs.globSync)((0, __stryke_convert_to_array.toArray)(context.entry).map((entry) => (0, __stryke_type_checks_is_string.isString)(entry) ? entry : entry.file)).flat(),
31
- external: (source) => {
32
- if (context.config.resolve.external && (0, __stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
33
- if (context.config.resolve.noExternal && (0, __stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
34
- if (context.builtins.includes(source)) return context.config.projectType !== "application";
35
- return !context.config.resolve.skipNodeModulesBundle;
36
- },
37
- plugins: [
38
- (0, rollup_plugin_typescript2.default)({
39
- check: false,
40
- tsconfig: context.tsconfig.tsconfigFilePath
41
- }),
42
- context.config.define && Object.keys(context.config.define).length > 0 && (0, __rollup_plugin_replace.default)({
43
- sourceMap: context.config.mode === "development",
44
- preventAssignment: true,
45
- ...context.config.define ?? {}
46
- }),
47
- context.config.inject && Object.keys(context.config.inject).length > 0 && (0, __rollup_plugin_inject.default)({
48
- sourceMap: context.config.mode === "development",
49
- ...context.config.inject
50
- }),
51
- (0, rolldown_experimental.viteAliasPlugin)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
52
- if (!ret.find((e) => e.find === id)) ret.push({
53
- find: id,
54
- replacement: path
55
- });
56
- else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
57
- return ret;
58
- }, []) }),
59
- context.config.babel && (0, __rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
60
- caller: {
61
- name: "powerlines",
62
- supportsStaticESM: true
63
- },
64
- cwd: context.config.root,
65
- babelrc: false,
66
- extensions: [
67
- ".js",
68
- ".jsx",
69
- ".ts",
70
- ".tsx"
71
- ],
72
- babelHelpers: "bundled",
73
- skipPreflightCheck: true,
74
- exclude: /node_modules/
75
- })),
76
- (0, __rollup_plugin_node_resolve.default)({
77
- moduleDirectories: ["node_modules"],
78
- preferBuiltins: true
79
- }),
80
- require_resolve_options.dtsBundlePlugin
81
- ]
82
- }, context.config?.rolldown ? context.config?.rolldown : {}, context.config?.rollup ? context.config?.rollup : {}, {
83
- resolve: {
84
- alias: context.alias,
85
- mainFields: context.config.resolve.mainFields,
86
- conditions: context.config.resolve.conditions,
87
- define: context.config.define,
88
- extensions: context.config.resolve.extensions
89
- },
90
- transform: {
91
- define: context.config.define,
92
- inject: context.config.inject
93
- },
94
- platform: context.config.platform,
95
- tsconfig: (0, __stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
96
- cache: !context.config.skipCache ? (0, __stryke_path_join_paths.joinPaths)(context.cachePath, "rolldown") : false,
97
- logLevel: context.config.logLevel,
98
- onLog(level, log) {
99
- if (log.message?.trim()) context.log(level === "info" ? "debug" : level, log.message?.trim() ?? "");
100
- },
101
- minify: context.config.mode === "production",
102
- output: [{
103
- dir: context.config.output.buildPath,
104
- format: "es",
105
- preserveModules: true,
106
- sourcemap: context.config.mode === "development"
107
- }, {
108
- dir: context.config.output.buildPath,
109
- format: "cjs",
110
- preserveModules: true,
111
- sourcemap: context.config.mode === "development"
112
- }]
113
- }, {
114
- keepNames: true,
115
- treeshake: true,
116
- shimMissingExports: true,
117
- transform: { target: "esnext" }
118
- });
119
- }
120
-
121
- //#endregion
122
- Object.defineProperty(exports, 'resolveOptions', {
123
- enumerable: true,
124
- get: function () {
125
- return resolveOptions;
126
- }
127
- });
@@ -1,133 +0,0 @@
1
- const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
3
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
4
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
5
- let defu = require("defu");
6
- defu = require_chunk.__toESM(defu);
7
- let node_fs = require("node:fs");
8
- let __rollup_plugin_alias = require("@rollup/plugin-alias");
9
- __rollup_plugin_alias = require_chunk.__toESM(__rollup_plugin_alias);
10
- let __rollup_plugin_babel = require("@rollup/plugin-babel");
11
- let __rollup_plugin_inject = require("@rollup/plugin-inject");
12
- __rollup_plugin_inject = require_chunk.__toESM(__rollup_plugin_inject);
13
- let __rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
14
- __rollup_plugin_node_resolve = require_chunk.__toESM(__rollup_plugin_node_resolve);
15
- let __rollup_plugin_replace = require("@rollup/plugin-replace");
16
- __rollup_plugin_replace = require_chunk.__toESM(__rollup_plugin_replace);
17
- let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
18
- rollup_plugin_typescript2 = require_chunk.__toESM(rollup_plugin_typescript2);
19
-
20
- //#region ../plugin-rollup/src/helpers/resolve-options.ts
21
- /**
22
- * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
23
- *
24
- * @remarks
25
- * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
26
- */
27
- const dtsBundlePlugin = {
28
- name: "powerlines:dts-bundle",
29
- async generateBundle(_opts, bundle) {
30
- for (const [, file] of Object.entries(bundle)) {
31
- if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) continue;
32
- const dtsFileName = file.fileName.replace(/(?:\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, ".d.ts");
33
- const relativeSourceDtsName = JSON.stringify(`./${file.facadeModuleId.replace(/\.[cm]?[jt]sx?$/, "")}`);
34
- this.emitFile({
35
- type: "asset",
36
- fileName: dtsFileName,
37
- source: file.exports.includes("default") ? `export * from ${relativeSourceDtsName};\nexport { default } from ${relativeSourceDtsName};\n` : `export * from ${relativeSourceDtsName};\n`
38
- });
39
- }
40
- }
41
- };
42
- /**
43
- * Resolves the options for [rollup](https://rollupjs.org).
44
- *
45
- * @param context - The build context.
46
- * @returns The resolved options.
47
- */
48
- function resolveOptions(context) {
49
- return (0, defu.default)({
50
- input: (0, node_fs.globSync)((0, __stryke_convert_to_array.toArray)(context.entry).map((entry) => (0, __stryke_type_checks_is_string.isString)(entry) ? entry : entry.file)).flat(),
51
- external: (source) => {
52
- if (context.config.resolve.external && (0, __stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
53
- if (context.config.resolve.noExternal && (0, __stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
54
- if (context.builtins.includes(source)) return context.config.projectType !== "application";
55
- return !context.config.resolve.skipNodeModulesBundle;
56
- },
57
- plugins: [
58
- (0, rollup_plugin_typescript2.default)({
59
- check: false,
60
- tsconfig: context.tsconfig.tsconfigFilePath
61
- }),
62
- context.config.define && Object.keys(context.config.define).length > 0 && (0, __rollup_plugin_replace.default)({
63
- sourceMap: context.config.mode === "development",
64
- preventAssignment: true,
65
- ...context.config.define ?? {}
66
- }),
67
- context.config.inject && Object.keys(context.config.inject).length > 0 && (0, __rollup_plugin_inject.default)({
68
- sourceMap: context.config.mode === "development",
69
- ...context.config.inject
70
- }),
71
- (0, __rollup_plugin_alias.default)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
72
- if (!ret.find((e) => e.find === id)) ret.push({
73
- find: id,
74
- replacement: path
75
- });
76
- else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
77
- return ret;
78
- }, []) }),
79
- context.config.babel && (0, __rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
80
- caller: {
81
- name: "powerlines",
82
- supportsStaticESM: true
83
- },
84
- cwd: context.config.root,
85
- babelrc: false,
86
- extensions: [
87
- ".js",
88
- ".jsx",
89
- ".ts",
90
- ".tsx"
91
- ],
92
- babelHelpers: "bundled",
93
- skipPreflightCheck: true,
94
- exclude: /node_modules/
95
- })),
96
- (0, __rollup_plugin_node_resolve.default)({
97
- moduleDirectories: ["node_modules"],
98
- preferBuiltins: true
99
- }),
100
- dtsBundlePlugin
101
- ].filter(Boolean)
102
- }, context.config?.rollup ? context.config?.rollup : {}, {
103
- cache: !context.config.skipCache ? (0, __stryke_path_join_paths.joinPaths)(context.cachePath, "rollup") : false,
104
- logLevel: context.config.logLevel,
105
- output: [{
106
- dir: context.config.output.buildPath,
107
- format: "es",
108
- entryFileNames: "[name].js",
109
- preserveModules: true,
110
- sourcemap: context.config.mode === "development"
111
- }, {
112
- dir: context.config.output.buildPath,
113
- format: "cjs",
114
- entryFileNames: "[name].cjs",
115
- preserveModules: true,
116
- sourcemap: context.config.mode === "development"
117
- }]
118
- });
119
- }
120
-
121
- //#endregion
122
- Object.defineProperty(exports, 'dtsBundlePlugin', {
123
- enumerable: true,
124
- get: function () {
125
- return dtsBundlePlugin;
126
- }
127
- });
128
- Object.defineProperty(exports, 'resolveOptions', {
129
- enumerable: true,
130
- get: function () {
131
- return resolveOptions;
132
- }
133
- });
@@ -1,83 +0,0 @@
1
- const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_api = require('./api-GPlMYw0d.cjs');
3
- const require_resolve_options = require('./resolve-options-lxQ2pm0W.cjs');
4
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
5
- let defu = require("defu");
6
- defu = require_chunk.__toESM(defu);
7
- let unplugin = require("unplugin");
8
- let rolldown = require("rolldown");
9
-
10
- //#region ../plugin-rolldown/src/helpers/unplugin.ts
11
- function createRolldownPlugin$1(context) {
12
- return (0, unplugin.createEsbuildPlugin)(require_api.createUnplugin(context))({});
13
- }
14
-
15
- //#endregion
16
- //#region ../plugin-rolldown/src/index.ts
17
- /**
18
- * A Powerlines plugin to assist in developing other Powerlines plugins.
19
- */
20
- const plugin = (options = {}) => {
21
- return {
22
- name: "rolldown",
23
- config() {
24
- return {
25
- output: { format: ["cjs", "esm"] },
26
- rolldown: { ...options }
27
- };
28
- },
29
- async build() {
30
- const result = await (0, rolldown.rolldown)((0, defu.default)({ plugins: [createRolldownPlugin$1(this)] }, require_resolve_options.resolveOptions(this)));
31
- await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.output.format).map(async (format) => result.write({ format })));
32
- }
33
- };
34
- };
35
- var src_default = plugin;
36
-
37
- //#endregion
38
- //#region src/rolldown.ts
39
- /**
40
- * A Rolldown plugin that will invoke the Powerlines API hooks during the build process.
41
- *
42
- * @see https://rollupjs.org/guide/en/#plugins-overview
43
- *
44
- * @example
45
- * ```ts
46
- * // rollup.config.ts
47
- * import powerlines from "powerlines/rollup";
48
- *
49
- * export default defineConfig({
50
- * plugins: [powerlines({ name: "example-app", ... })],
51
- * })
52
- * ```
53
- */
54
- const unplugin$1 = (0, unplugin.createRolldownPlugin)(require_api.createUnpluginFactory("rolldown", (api, plugin$1) => {
55
- return {
56
- ...plugin$1,
57
- rolldown: { async options(options) {
58
- const merged = (0, defu.defu)(await api.context.getEnvironment(), this);
59
- return (0, defu.defu)(require_resolve_options.resolveOptions(merged), options, api.callHook("rolldown:options", { environment: merged }, options) ?? {});
60
- } }
61
- };
62
- }));
63
- var rolldown_default = unplugin$1;
64
-
65
- //#endregion
66
- Object.defineProperty(exports, 'rolldown_default', {
67
- enumerable: true,
68
- get: function () {
69
- return rolldown_default;
70
- }
71
- });
72
- Object.defineProperty(exports, 'src_default', {
73
- enumerable: true,
74
- get: function () {
75
- return src_default;
76
- }
77
- });
78
- Object.defineProperty(exports, 'unplugin', {
79
- enumerable: true,
80
- get: function () {
81
- return unplugin$1;
82
- }
83
- });
@@ -1,65 +0,0 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-CY668wMZ.mjs";
2
- import { t as resolveOptions } from "./resolve-options-D-RGs8j8.mjs";
3
- import { toArray } from "@stryke/convert/to-array";
4
- import defu, { defu as defu$1 } from "defu";
5
- import { createEsbuildPlugin, createRolldownPlugin } from "unplugin";
6
- import { rolldown } from "rolldown";
7
-
8
- //#region ../plugin-rolldown/src/helpers/unplugin.ts
9
- function createRolldownPlugin$1(context) {
10
- return createEsbuildPlugin(createUnplugin(context))({});
11
- }
12
-
13
- //#endregion
14
- //#region ../plugin-rolldown/src/index.ts
15
- /**
16
- * A Powerlines plugin to assist in developing other Powerlines plugins.
17
- */
18
- const plugin = (options = {}) => {
19
- return {
20
- name: "rolldown",
21
- config() {
22
- return {
23
- output: { format: ["cjs", "esm"] },
24
- rolldown: { ...options }
25
- };
26
- },
27
- async build() {
28
- const result = await rolldown(defu({ plugins: [createRolldownPlugin$1(this)] }, resolveOptions(this)));
29
- await Promise.all(toArray(this.config.output.format).map(async (format) => result.write({ format })));
30
- }
31
- };
32
- };
33
- var src_default = plugin;
34
-
35
- //#endregion
36
- //#region src/rolldown.ts
37
- /**
38
- * A Rolldown plugin that will invoke the Powerlines API hooks during the build process.
39
- *
40
- * @see https://rollupjs.org/guide/en/#plugins-overview
41
- *
42
- * @example
43
- * ```ts
44
- * // rollup.config.ts
45
- * import powerlines from "powerlines/rollup";
46
- *
47
- * export default defineConfig({
48
- * plugins: [powerlines({ name: "example-app", ... })],
49
- * })
50
- * ```
51
- */
52
- const unplugin = createRolldownPlugin(createUnpluginFactory("rolldown", (api, plugin$1) => {
53
- return {
54
- ...plugin$1,
55
- rolldown: { async options(options) {
56
- const merged = defu$1(await api.context.getEnvironment(), this);
57
- return defu$1(resolveOptions(merged), options, api.callHook("rolldown:options", { environment: merged }, options) ?? {});
58
- } }
59
- };
60
- }));
61
- var rolldown_default = unplugin;
62
-
63
- //#endregion
64
- export { unplugin as n, src_default as r, rolldown_default as t };
65
- //# sourceMappingURL=rolldown-DsXEFXyP.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rolldown-DsXEFXyP.mjs","names":["createRolldownPlugin","build","createRolldownPlugin","plugin","defu"],"sources":["../../plugin-rolldown/src/helpers/unplugin.ts","../../plugin-rolldown/src/index.ts","../src/rolldown.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { RolldownPluginContext } from \"../types/plugin\";\n\nexport function createRolldownPlugin(context: RolldownPluginContext) {\n return createEsbuildPlugin(createUnplugin(context))({});\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Plugin } from \"@powerlines/core/types/plugin\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rolldown as build } from \"rolldown\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createRolldownPlugin } from \"./helpers/unplugin\";\nimport {\n RolldownPluginContext,\n RolldownPluginOptions,\n RolldownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rolldown?: RolldownPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RolldownPluginContext = RolldownPluginContext\n>(\n options: RolldownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rolldown\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rolldown: {\n ...options\n }\n } as Partial<RolldownPluginResolvedConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRolldownPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\n }\n };\n};\n\nexport default plugin;\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { resolveOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport {\n RolldownPluginContext,\n RolldownPluginUserConfig\n} from \"@powerlines/plugin-rolldown/types/plugin\";\nimport { defu } from \"defu\";\nimport type { InputOptions } from \"rolldown\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport {\n default as plugin,\n default as rolldown\n} from \"@powerlines/plugin-rolldown\";\n\n/**\n * A Rolldown plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://rollupjs.org/guide/en/#plugins-overview\n *\n * @example\n * ```ts\n * // rollup.config.ts\n * import powerlines from \"powerlines/rollup\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * })\n * ```\n */\nexport const unplugin = createRolldownPlugin<Partial<RolldownPluginUserConfig>>(\n createUnpluginFactory<RolldownPluginContext>(\"rolldown\", (api, plugin) => {\n return {\n ...plugin,\n rolldown: {\n async options(options: InputOptions) {\n const merged = defu(await api.context.getEnvironment(), this);\n\n return defu(\n resolveOptions(merged),\n options,\n api.callHook(\n \"rolldown:options\",\n { environment: merged },\n options\n ) ?? {}\n );\n }\n }\n };\n })\n);\n\nexport { unplugin as \"module.exports\" };\n\nexport default unplugin;\n"],"mappings":";;;;;;;;AAsBA,SAAgBA,uBAAqB,SAAgC;AACnE,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC;;;;;;;;ACmBzD,MAAa,UAGX,UAAiC,EAAE,KACd;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,UAAU,EACR,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMC,SACnB,KACE,EACE,SAAS,CAACC,uBAAqB,KAAK,CAAC,EACtC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;AChCf,MAAa,WAAW,qBACtB,sBAA6C,aAAa,KAAK,aAAW;AACxE,QAAO;EACL,GAAGC;EACH,UAAU,EACR,MAAM,QAAQ,SAAuB;GACnC,MAAM,SAASC,OAAK,MAAM,IAAI,QAAQ,gBAAgB,EAAE,KAAK;AAE7D,UAAOA,OACL,eAAe,OAAO,EACtB,SACA,IAAI,SACF,oBACA,EAAE,aAAa,QAAQ,EACvB,QACD,IAAI,EAAE,CACR;KAEJ;EACF;EACD,CACH;AAID,uBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig-B92heKit.mjs","names":["#context","tsconfigFilePath: string | undefined"],"sources":["../src/typescript/ts-morph.ts","../src/typescript/tsconfig.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 type { Context } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport {\n CompilerOptions,\n FileSystemHost,\n InMemoryFileSystemHost,\n Project,\n ProjectOptions,\n RuntimeDirEntry\n} from \"ts-morph\";\n\nexport class VirtualFileSystemHost\n extends InMemoryFileSystemHost\n implements FileSystemHost\n{\n #context: Context;\n\n public constructor(context: Context) {\n super();\n\n this.#context = context;\n }\n\n public override deleteSync(path: string) {\n this.#context.fs.removeSync(path);\n }\n\n public override readDirSync(dirPath: string): RuntimeDirEntry[] {\n if (!this.#context.fs.isDirectorySync(dirPath)) {\n return [];\n }\n\n return this.#context.fs.listSync(dirPath).reduce((ret, entry) => {\n const fullPath = this.#context.fs.resolveSync(entry);\n if (fullPath) {\n ret.push({\n name: entry,\n isDirectory: this.#context.fs.isDirectorySync(fullPath),\n isFile: this.#context.fs.isFileSync(fullPath),\n isSymlink: false\n });\n }\n\n return ret;\n }, [] as RuntimeDirEntry[]);\n }\n\n public override async readFile(filePath: string) {\n if (!this.#context.fs.isFileSync(filePath)) {\n return \"\";\n }\n\n return (await this.#context.fs.read(filePath))!;\n }\n\n public override readFileSync(filePath: string) {\n if (!this.#context.fs.isFileSync(filePath)) {\n return \"\";\n }\n\n return this.#context.fs.readSync(filePath)!;\n }\n\n public override async writeFile(filePath: string, fileText: string) {\n return this.#context.fs.write(filePath, fileText);\n }\n\n public override writeFileSync(filePath: string, fileText: string) {\n this.#context.fs.writeSync(filePath, fileText);\n }\n\n public override async mkdir(dirPath: string) {\n await this.#context.fs.mkdir(dirPath);\n }\n\n public override mkdirSync(dirPath: string) {\n this.#context.fs.mkdirSync(dirPath);\n }\n\n public override async move(srcPath: string, destPath: string) {\n await this.#context.fs.move(srcPath, destPath);\n }\n\n public override moveSync(srcPath: string, destPath: string) {\n this.#context.fs.moveSync(srcPath, destPath);\n }\n\n public override async copy(srcPath: string, destPath: string) {\n await this.#context.fs.copy(srcPath, destPath);\n }\n\n public override copySync(srcPath: string, destPath: string) {\n this.#context.fs.copySync(srcPath, destPath);\n }\n\n public override async fileExists(filePath: string) {\n return this.#context.fs.isFile(filePath);\n }\n\n public override fileExistsSync(filePath: string) {\n return this.#context.fs.isFileSync(filePath);\n }\n\n public override async directoryExists(dirPath: string) {\n return this.#context.fs.isDirectory(dirPath);\n }\n\n public override directoryExistsSync(dirPath: string): boolean {\n return this.#context.fs.isDirectorySync(dirPath);\n }\n\n public override realpathSync(path: string) {\n return this.#context.fs.resolveSync(path) || path;\n }\n\n public override getCurrentDirectory() {\n return this.#context.workspaceConfig.workspaceRoot;\n }\n\n public override async glob(\n patterns: ReadonlyArray<string>\n ): Promise<string[]> {\n return this.#context.fs.glob(patterns as string[]);\n }\n\n public override globSync(patterns: ReadonlyArray<string>): string[] {\n return this.#context.fs.globSync(patterns as string[]);\n }\n}\n\n/**\n * Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing\n *\n * @param context - The Powerlines context\n * @returns A ts-morph {@link Project} instance\n */\nexport function createProgram(\n context: Context,\n override: Partial<ProjectOptions>\n): Project {\n context.debug(\n `Creating ts-morph Project instance with configuration from: ${\n context.tsconfig.tsconfigFilePath\n }.`\n );\n\n const project = new Project(\n defu(override ?? {}, {\n skipAddingFilesFromTsConfig: false,\n tsConfigFilePath: context.tsconfig.tsconfigFilePath,\n fileSystem: new VirtualFileSystemHost(context),\n compilerOptions: defu(context.tsconfig.options ?? {}, {\n lib: [\"lib.esnext.full.d.ts\"]\n }) as CompilerOptions\n })\n );\n\n return project;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ParsedTypeScriptConfig, TSConfig } from \"@powerlines/core\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFileSync } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { FilterPattern } from \"@stryke/types/file\";\nimport { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport ts from \"typescript\";\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function getTsconfigFilePath(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string\n): string {\n let tsconfigFilePath: string | undefined;\n if (tsconfig) {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n } else {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n \"tsconfig.app.json\"\n );\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n \"tsconfig.lib.json\"\n );\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n \"tsconfig.json\"\n );\n }\n }\n }\n\n if (!tsconfigFilePath) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file for the project at ${\n projectRoot\n }.`\n );\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function tryTsconfigFilePath(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig: string\n): string | undefined {\n let tsconfigFilePath = tsconfig;\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, projectRoot);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(\n tsconfig,\n appendPath(projectRoot, workspaceRoot)\n );\n if (!existsSync(tsconfigFilePath)) {\n return undefined;\n }\n }\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[],\n extensions: string[] = [\".ts\", \".tsx\", \".d.ts\"]\n): string | RegExp | null | undefined {\n return types.find(\n type =>\n tsconfigType?.toString().toLowerCase() ===\n type?.toString().toLowerCase() ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}` ||\n `./${tsconfigType?.toString().toLowerCase()}` ===\n type?.toString().toLowerCase() ||\n extensions.some(\n ext =>\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n type?.toString().toLowerCase() ||\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n `./${type?.toString().toLowerCase()}` ||\n `${type?.toString().toLowerCase()}${ext}` ===\n `./${tsconfigType?.toString().toLowerCase()}` ||\n tsconfigType?.toString().toLowerCase() ===\n `${type?.toString().toLowerCase()}${ext}` ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}${ext}` ||\n type?.toString().toLowerCase() ===\n `./${tsconfigType?.toString().toLowerCase()}${ext}`\n )\n );\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findIncludeMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): string | RegExp | null | undefined {\n return findMatch(tsconfigType, types, [\n \".ts\",\n \".tsx\",\n \".d.ts\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".mts\",\n \".cts\",\n \"/*.ts\",\n \"/*.tsx\",\n \"/*.d.ts\",\n \"/*.js\",\n \"/*.jsx\",\n \"/*.mjs\",\n \"/*.cjs\",\n \"/*.mts\",\n \"/*.cts\",\n \"/**/*.ts\",\n \"/**/*.tsx\",\n \"/**/*.d.ts\",\n \"/**/*.js\",\n \"/**/*.jsx\",\n \"/**/*.mjs\",\n \"/**/*.cjs\",\n \"/**/*.mts\",\n \"/**/*.cts\"\n ]);\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isMatchFound(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): boolean {\n return findMatch(tsconfigType, types) !== undefined;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isIncludeMatchFound(\n tsconfigType: FilterPattern,\n types: FilterPattern[]\n): boolean {\n return (\n findIncludeMatch(\n tsconfigType as string | RegExp | null,\n types as (string | RegExp | null)[]\n ) !== undefined\n );\n}\n\n/**\n * Get the parsed TypeScript configuration.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @param tsconfigRaw - The raw tsconfig.json content.\n * @param originalTsconfigJson - The original tsconfig.json content.\n * @param host - The TypeScript parse config host.\n * @returns The resolved TypeScript configuration.\n */\nexport function getParsedTypeScriptConfig(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string,\n tsconfigRaw: TSConfig = {},\n originalTsconfigJson?: TSConfig,\n host: ts.ParseConfigHost = ts.sys\n): ParsedTypeScriptConfig {\n const tsconfigFilePath = getTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n const tsconfigJson = readJsonFileSync<TSConfig>(tsconfigFilePath);\n if (!tsconfigJson) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file at ${joinPaths(\n projectRoot,\n tsconfig ?? \"tsconfig.json\"\n )}`\n );\n }\n\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n defu(tsconfigRaw ?? {}, tsconfigJson),\n host,\n appendPath(projectRoot, workspaceRoot)\n );\n if (parsedCommandLine.errors.length > 0) {\n const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:\n${parsedCommandLine.errors\n .map(\n error =>\n `- ${\n (error.category !== undefined && error.code\n ? `[${error.category}-${error.code}]: `\n : \"\") + error.messageText.toString()\n }`\n )\n .join(\"\\n\")}\n `;\n\n throw new Error(errorMessage);\n }\n\n return {\n ...parsedCommandLine,\n originalTsconfigJson: (originalTsconfigJson ??\n tsconfigJson) as TsConfigJson,\n tsconfigJson,\n tsconfigFilePath\n };\n}\n"],"mappings":";;;;;;;;;AA6BA,IAAa,wBAAb,cACU,uBAEV;CACE;CAEA,AAAO,YAAY,SAAkB;AACnC,SAAO;AAEP,QAAKA,UAAW;;CAGlB,AAAgB,WAAW,MAAc;AACvC,QAAKA,QAAS,GAAG,WAAW,KAAK;;CAGnC,AAAgB,YAAY,SAAoC;AAC9D,MAAI,CAAC,MAAKA,QAAS,GAAG,gBAAgB,QAAQ,CAC5C,QAAO,EAAE;AAGX,SAAO,MAAKA,QAAS,GAAG,SAAS,QAAQ,CAAC,QAAQ,KAAK,UAAU;GAC/D,MAAM,WAAW,MAAKA,QAAS,GAAG,YAAY,MAAM;AACpD,OAAI,SACF,KAAI,KAAK;IACP,MAAM;IACN,aAAa,MAAKA,QAAS,GAAG,gBAAgB,SAAS;IACvD,QAAQ,MAAKA,QAAS,GAAG,WAAW,SAAS;IAC7C,WAAW;IACZ,CAAC;AAGJ,UAAO;KACN,EAAE,CAAsB;;CAG7B,MAAsB,SAAS,UAAkB;AAC/C,MAAI,CAAC,MAAKA,QAAS,GAAG,WAAW,SAAS,CACxC,QAAO;AAGT,SAAQ,MAAM,MAAKA,QAAS,GAAG,KAAK,SAAS;;CAG/C,AAAgB,aAAa,UAAkB;AAC7C,MAAI,CAAC,MAAKA,QAAS,GAAG,WAAW,SAAS,CACxC,QAAO;AAGT,SAAO,MAAKA,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