@rsdoctor/core 2.0.0-alpha.0 → 2.0.0-alpha.1

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 (393) hide show
  1. package/dist/build-utils/build/chunks/assetsModules.d.ts +1 -1
  2. package/dist/build-utils/build/chunks/assetsModules.js +1 -1
  3. package/dist/build-utils/build/chunks/index.d.ts +0 -1
  4. package/dist/build-utils/build/chunks/index.js +0 -1
  5. package/dist/build-utils/build/chunks/rspack/transform.d.ts +1 -1
  6. package/dist/build-utils/build/chunks/rspack/transform.js +1 -1
  7. package/dist/build-utils/build/envinfo.d.ts +13 -0
  8. package/dist/build-utils/build/envinfo.js +60 -0
  9. package/dist/build-utils/build/file/cache.d.ts +5 -0
  10. package/dist/build-utils/build/file/cache.js +24 -0
  11. package/dist/build-utils/build/file/index.d.ts +3 -0
  12. package/dist/build-utils/build/file/index.js +5 -0
  13. package/dist/build-utils/build/file/sharding.d.ts +21 -0
  14. package/dist/build-utils/build/file/sharding.js +38 -0
  15. package/dist/build-utils/build/index.d.ts +5 -0
  16. package/dist/build-utils/build/index.js +11 -6
  17. package/dist/build-utils/build/json.d.ts +3 -0
  18. package/dist/build-utils/build/json.js +67 -0
  19. package/dist/build-utils/build/loader/probeLoader.d.ts +2 -2
  20. package/dist/build-utils/build/loader/probeLoader.js +4 -4
  21. package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +1 -1
  22. package/dist/build-utils/build/loader/probeLoaderPlugin.js +1 -1
  23. package/dist/build-utils/build/module-graph/index.d.ts +0 -1
  24. package/dist/build-utils/build/module-graph/index.js +0 -1
  25. package/dist/build-utils/build/module-graph/parser.d.ts +1 -1
  26. package/dist/build-utils/build/module-graph/parser.js +1 -1
  27. package/dist/build-utils/build/module-graph/rspack/transform.d.ts +1 -1
  28. package/dist/build-utils/build/module-graph/rspack/transform.js +6 -4
  29. package/dist/build-utils/build/module-graph/utils.d.ts +1 -1
  30. package/dist/build-utils/build/module-graph/utils.js +5 -4
  31. package/dist/build-utils/build/process.d.ts +2 -0
  32. package/dist/build-utils/build/process.js +18 -0
  33. package/dist/build-utils/build/server.d.ts +15 -0
  34. package/dist/build-utils/build/server.js +107 -0
  35. package/dist/build-utils/build/utils/loader.d.ts +2 -2
  36. package/dist/build-utils/build/utils/loader.js +10 -19
  37. package/dist/build-utils/build/utils/parseBundle.d.ts +1 -1
  38. package/dist/build-utils/build/utils/parseBundle.js +6 -8
  39. package/dist/build-utils/build/utils/plugin.d.ts +1 -1
  40. package/dist/build-utils/index.d.ts +10 -0
  41. package/dist/build-utils/index.js +12 -2
  42. package/dist/collection.d.ts +1 -0
  43. package/dist/collection.js +2 -0
  44. package/dist/common/file.d.ts +2 -0
  45. package/dist/common/file.js +8 -0
  46. package/dist/common/global-config.d.ts +21 -0
  47. package/dist/common/global-config.js +33 -0
  48. package/dist/common/index.d.ts +4 -0
  49. package/dist/common/index.js +6 -0
  50. package/dist/common-browser.d.ts +1 -0
  51. package/dist/common-browser.js +2 -0
  52. package/dist/error/error.d.ts +35 -0
  53. package/dist/error/error.js +143 -0
  54. package/dist/error/index.d.ts +2 -0
  55. package/dist/error/index.js +3 -0
  56. package/dist/error/transform.d.ts +3 -0
  57. package/dist/error/transform.js +138 -0
  58. package/dist/error/utils.d.ts +4 -0
  59. package/dist/error/utils.js +23 -0
  60. package/dist/graph/index.d.ts +1 -0
  61. package/dist/graph/index.js +2 -0
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.js +4 -2
  64. package/dist/inner-plugins/loaders/proxy.d.ts +4 -4
  65. package/dist/inner-plugins/plugins/base.d.ts +1 -1
  66. package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
  67. package/dist/inner-plugins/plugins/bundle.js +3 -3
  68. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +3 -3
  69. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +11 -39
  70. package/dist/inner-plugins/plugins/errors.d.ts +2 -2
  71. package/dist/inner-plugins/plugins/errors.js +3 -3
  72. package/dist/inner-plugins/plugins/loader.d.ts +1 -1
  73. package/dist/inner-plugins/plugins/loader.js +7 -19
  74. package/dist/inner-plugins/plugins/plugins.d.ts +1 -1
  75. package/dist/inner-plugins/plugins/plugins.js +2 -2
  76. package/dist/inner-plugins/plugins/progress.d.ts +2 -2
  77. package/dist/inner-plugins/plugins/progress.js +2 -2
  78. package/dist/inner-plugins/plugins/resolver.d.ts +1 -1
  79. package/dist/inner-plugins/plugins/resolver.js +2 -2
  80. package/dist/inner-plugins/plugins/rspack.d.ts +8 -3
  81. package/dist/inner-plugins/plugins/rspack.js +18 -4
  82. package/dist/inner-plugins/plugins/rules.d.ts +1 -1
  83. package/dist/inner-plugins/plugins/rules.js +3 -3
  84. package/dist/inner-plugins/plugins/sourcemapTool.d.ts +2 -2
  85. package/dist/inner-plugins/plugins/sourcemapTool.js +2 -2
  86. package/dist/inner-plugins/plugins/summary.d.ts +1 -1
  87. package/dist/inner-plugins/plugins/summary.js +3 -3
  88. package/dist/inner-plugins/utils/config.d.ts +2 -3
  89. package/dist/inner-plugins/utils/config.js +16 -17
  90. package/dist/inner-plugins/utils/loader.d.ts +4 -7
  91. package/dist/inner-plugins/utils/loader.js +8 -34
  92. package/dist/inner-plugins/utils/normalize-config.d.ts +1 -1
  93. package/dist/inner-plugins/utils/openBrowser.d.ts +1 -0
  94. package/dist/inner-plugins/utils/openBrowser.js +55 -0
  95. package/dist/inner-plugins/utils/plugin-common.js +4 -4
  96. package/dist/inner-plugins/utils/plugin.d.ts +1 -1
  97. package/dist/inner-plugins/utils/plugin.js +1 -1
  98. package/dist/inner-plugins/utils/sdk.d.ts +2 -3
  99. package/dist/inner-plugins/utils/sdk.js +2 -2
  100. package/dist/logger.d.ts +9 -0
  101. package/dist/logger.js +51 -0
  102. package/dist/{inner-plugins/constants.d.cts → rspack-plugin/constants.d.ts} +3 -0
  103. package/dist/rspack-plugin/constants.js +23 -0
  104. package/dist/rspack-plugin/index.d.ts +2 -0
  105. package/dist/rspack-plugin/index.js +3 -0
  106. package/dist/rspack-plugin/multiple.d.ts +8 -0
  107. package/dist/rspack-plugin/multiple.js +39 -0
  108. package/dist/rspack-plugin/plugin.d.ts +25 -0
  109. package/dist/rspack-plugin/plugin.js +133 -0
  110. package/dist/rule-utils/document/document.d.ts +16 -0
  111. package/dist/rule-utils/document/document.js +46 -0
  112. package/dist/rule-utils/document/index.d.ts +3 -0
  113. package/dist/rule-utils/document/index.js +4 -0
  114. package/dist/rule-utils/document/server.d.ts +4 -0
  115. package/dist/rule-utils/document/server.js +13 -0
  116. package/dist/rule-utils/document/types.d.ts +31 -0
  117. package/dist/rule-utils/index.d.ts +2 -0
  118. package/dist/rule-utils/index.js +3 -0
  119. package/dist/rule-utils/parser/asserts.d.ts +81 -0
  120. package/dist/rule-utils/parser/asserts.js +105 -0
  121. package/dist/rule-utils/parser/index.d.ts +4 -0
  122. package/dist/rule-utils/parser/index.js +5 -0
  123. package/dist/rule-utils/parser/parser.d.ts +118 -0
  124. package/dist/rule-utils/parser/parser.js +24 -0
  125. package/dist/rule-utils/parser/types.d.ts +30 -0
  126. package/dist/rule-utils/parser/types.js +8 -0
  127. package/dist/rule-utils/parser/utils.d.ts +30 -0
  128. package/dist/rule-utils/parser/utils.js +106 -0
  129. package/dist/rules/linter.d.ts +1 -1
  130. package/dist/rules/linter.js +1 -1
  131. package/dist/rules/rule.d.ts +2 -2
  132. package/dist/rules/rule.js +2 -2
  133. package/dist/rules/rules/cjs-require/index.d.ts +1 -1
  134. package/dist/rules/rules/cjs-require/index.js +1 -1
  135. package/dist/rules/rules/cross-chunks-package/index.d.ts +1 -1
  136. package/dist/rules/rules/cross-chunks-package/index.js +2 -2
  137. package/dist/rules/rules/default-import-check/index.d.ts +1 -1
  138. package/dist/rules/rules/default-import-check/index.js +2 -2
  139. package/dist/rules/rules/default-import-check/utils.d.ts +2 -2
  140. package/dist/rules/rules/default-import-check/utils.js +2 -2
  141. package/dist/rules/rules/duplicate-package/index.d.ts +3 -3
  142. package/dist/rules/rules/duplicate-package/index.js +3 -3
  143. package/dist/rules/rules/duplicate-package/utils.d.ts +1 -1
  144. package/dist/rules/rules/ecma-version-check/index.d.ts +3 -2
  145. package/dist/rules/rules/ecma-version-check/index.js +1 -1
  146. package/dist/rules/rules/ecma-version-check/types.d.ts +1 -2
  147. package/dist/rules/rules/ecma-version-check/utils.d.ts +1 -1
  148. package/dist/rules/rules/esm-resolved-to-cjs/index.d.ts +1 -1
  149. package/dist/rules/rules/esm-resolved-to-cjs/index.js +1 -1
  150. package/dist/rules/rules/index.d.ts +1 -1
  151. package/dist/rules/rules/loader-performance-optimization/index.d.ts +1 -1
  152. package/dist/rules/rules/loader-performance-optimization/index.js +2 -2
  153. package/dist/rules/rules/loader-performance-optimization/types.d.ts +1 -1
  154. package/dist/rules/rules/module-mixed-chunks/index.d.ts +1 -1
  155. package/dist/rules/rules/module-mixed-chunks/index.js +1 -1
  156. package/dist/rules/rules/side-effects-only-imports/index.d.ts +1 -1
  157. package/dist/rules/rules/side-effects-only-imports/index.js +1 -1
  158. package/dist/rules/utils.d.ts +1 -1
  159. package/dist/rules/utils.js +1 -1
  160. package/dist/sdk/index.d.ts +2 -0
  161. package/dist/sdk/index.js +3 -0
  162. package/dist/sdk/multiple/controller.d.ts +12 -0
  163. package/dist/sdk/multiple/controller.js +42 -0
  164. package/dist/sdk/multiple/index.d.ts +2 -0
  165. package/dist/sdk/multiple/index.js +3 -0
  166. package/dist/sdk/multiple/primary.d.ts +32 -0
  167. package/dist/sdk/multiple/primary.js +64 -0
  168. package/dist/sdk/multiple/server.d.ts +7 -0
  169. package/dist/sdk/multiple/server.js +14 -0
  170. package/dist/sdk/sdk/core.d.ts +33 -0
  171. package/dist/sdk/sdk/core.js +163 -0
  172. package/dist/sdk/sdk/index.d.ts +52 -0
  173. package/dist/sdk/sdk/index.js +435 -0
  174. package/dist/sdk/sdk/types.d.ts +26 -0
  175. package/dist/sdk/sdk/types.js +1 -0
  176. package/dist/sdk/server/apis/alerts.d.ts +5 -0
  177. package/dist/sdk/server/apis/alerts.js +30 -0
  178. package/dist/sdk/server/apis/base.d.ts +11 -0
  179. package/dist/sdk/server/apis/base.js +22 -0
  180. package/dist/sdk/server/apis/bundle-diff.d.ts +6 -0
  181. package/dist/sdk/server/apis/bundle-diff.js +51 -0
  182. package/dist/sdk/server/apis/data.d.ts +6 -0
  183. package/dist/sdk/server/apis/data.js +44 -0
  184. package/dist/sdk/server/apis/fs.d.ts +5 -0
  185. package/dist/sdk/server/apis/fs.js +28 -0
  186. package/dist/sdk/server/apis/graph.d.ts +12 -0
  187. package/dist/sdk/server/apis/graph.js +116 -0
  188. package/dist/sdk/server/apis/index.d.ts +10 -0
  189. package/dist/sdk/server/apis/index.js +11 -0
  190. package/dist/sdk/server/apis/loader.d.ts +15 -0
  191. package/dist/sdk/server/apis/loader.js +120 -0
  192. package/dist/sdk/server/apis/plugin.d.ts +6 -0
  193. package/dist/sdk/server/apis/plugin.js +39 -0
  194. package/dist/sdk/server/apis/project.d.ts +8 -0
  195. package/dist/sdk/server/apis/project.js +59 -0
  196. package/dist/sdk/server/apis/renderer.d.ts +6 -0
  197. package/dist/sdk/server/apis/renderer.js +33 -0
  198. package/dist/sdk/server/apis/resolver.d.ts +6 -0
  199. package/dist/sdk/server/apis/resolver.js +38 -0
  200. package/dist/sdk/server/client.d.ts +3 -0
  201. package/dist/sdk/server/client.js +8 -0
  202. package/dist/sdk/server/fakeServer.d.ts +9 -0
  203. package/dist/sdk/server/fakeServer.js +12 -0
  204. package/dist/sdk/server/index.d.ts +44 -0
  205. package/dist/sdk/server/index.js +292 -0
  206. package/dist/sdk/server/json-body.d.ts +6 -0
  207. package/dist/sdk/server/json-body.js +150 -0
  208. package/dist/sdk/server/router.d.ts +24 -0
  209. package/dist/sdk/server/router.js +83 -0
  210. package/dist/sdk/server/security.d.ts +5 -0
  211. package/dist/sdk/server/security.js +47 -0
  212. package/dist/sdk/server/socket/api.d.ts +15 -0
  213. package/dist/sdk/server/socket/api.js +22 -0
  214. package/dist/sdk/server/socket/index.d.ts +48 -0
  215. package/dist/sdk/server/socket/index.js +166 -0
  216. package/dist/sdk/server/utils.d.ts +6 -0
  217. package/dist/sdk/server/utils.js +19 -0
  218. package/dist/sdk/utils/base.d.ts +1 -0
  219. package/dist/sdk/utils/base.js +22 -0
  220. package/dist/sdk/utils/constant.d.ts +1 -0
  221. package/dist/sdk/utils/constant.js +4 -0
  222. package/dist/sdk/utils/index.d.ts +3 -0
  223. package/dist/sdk/utils/index.js +4 -0
  224. package/dist/sdk/utils/openBrowser.d.ts +4 -0
  225. package/dist/sdk/utils/openBrowser.js +53 -0
  226. package/dist/sdk/utils/upload.d.ts +2 -0
  227. package/dist/sdk/utils/upload.js +6 -0
  228. package/dist/sdk.d.ts +1 -0
  229. package/dist/sdk.js +2 -0
  230. package/dist/types/index.d.ts +0 -1
  231. package/dist/types/index.js +0 -1
  232. package/dist/types/loader.d.ts +1 -1
  233. package/dist/types/plugin.d.ts +7 -28
  234. package/package.json +127 -58
  235. package/static/openChrome.applescript +95 -0
  236. package/dist/build-utils/build/chunks/assetsModules.cjs +0 -42
  237. package/dist/build-utils/build/chunks/assetsModules.d.cts +0 -17
  238. package/dist/build-utils/build/chunks/chunkTransform.cjs +0 -39
  239. package/dist/build-utils/build/chunks/chunkTransform.d.cts +0 -4
  240. package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -4
  241. package/dist/build-utils/build/chunks/chunkTransform.js +0 -6
  242. package/dist/build-utils/build/chunks/index.cjs +0 -72
  243. package/dist/build-utils/build/chunks/index.d.cts +0 -3
  244. package/dist/build-utils/build/chunks/rspack/transform.cjs +0 -80
  245. package/dist/build-utils/build/chunks/rspack/transform.d.cts +0 -13
  246. package/dist/build-utils/build/index.cjs +0 -52
  247. package/dist/build-utils/build/index.d.cts +0 -5
  248. package/dist/build-utils/build/loader/index.cjs +0 -65
  249. package/dist/build-utils/build/loader/index.d.cts +0 -2
  250. package/dist/build-utils/build/loader/probeLoader.cjs +0 -89
  251. package/dist/build-utils/build/loader/probeLoader.d.cts +0 -4
  252. package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +0 -65
  253. package/dist/build-utils/build/loader/probeLoaderPlugin.d.cts +0 -5
  254. package/dist/build-utils/build/module-graph/index.cjs +0 -65
  255. package/dist/build-utils/build/module-graph/index.d.cts +0 -2
  256. package/dist/build-utils/build/module-graph/parser.cjs +0 -46
  257. package/dist/build-utils/build/module-graph/parser.d.cts +0 -2
  258. package/dist/build-utils/build/module-graph/rspack/transform.cjs +0 -151
  259. package/dist/build-utils/build/module-graph/rspack/transform.d.cts +0 -26
  260. package/dist/build-utils/build/module-graph/transform.cjs +0 -39
  261. package/dist/build-utils/build/module-graph/transform.d.cts +0 -3
  262. package/dist/build-utils/build/module-graph/transform.d.ts +0 -3
  263. package/dist/build-utils/build/module-graph/transform.js +0 -6
  264. package/dist/build-utils/build/module-graph/utils.cjs +0 -95
  265. package/dist/build-utils/build/module-graph/utils.d.cts +0 -3
  266. package/dist/build-utils/build/utils/index.cjs +0 -72
  267. package/dist/build-utils/build/utils/index.d.cts +0 -3
  268. package/dist/build-utils/build/utils/loader.cjs +0 -354
  269. package/dist/build-utils/build/utils/loader.d.cts +0 -20
  270. package/dist/build-utils/build/utils/parseBundle.cjs +0 -283
  271. package/dist/build-utils/build/utils/parseBundle.d.cts +0 -12
  272. package/dist/build-utils/build/utils/plugin.cjs +0 -60
  273. package/dist/build-utils/build/utils/plugin.d.cts +0 -5
  274. package/dist/build-utils/index.cjs +0 -36
  275. package/dist/build-utils/index.d.cts +0 -1
  276. package/dist/index.cjs +0 -81
  277. package/dist/index.d.cts +0 -3
  278. package/dist/inner-plugins/constants.cjs +0 -64
  279. package/dist/inner-plugins/index.cjs +0 -65
  280. package/dist/inner-plugins/index.d.cts +0 -2
  281. package/dist/inner-plugins/loaders/proxy.cjs +0 -104
  282. package/dist/inner-plugins/loaders/proxy.d.cts +0 -7
  283. package/dist/inner-plugins/plugins/base.cjs +0 -53
  284. package/dist/inner-plugins/plugins/base.d.cts +0 -12
  285. package/dist/inner-plugins/plugins/bundle.cjs +0 -96
  286. package/dist/inner-plugins/plugins/bundle.d.cts +0 -15
  287. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +0 -141
  288. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.cts +0 -34
  289. package/dist/inner-plugins/plugins/errors.cjs +0 -98
  290. package/dist/inner-plugins/plugins/errors.d.cts +0 -11
  291. package/dist/inner-plugins/plugins/index.cjs +0 -121
  292. package/dist/inner-plugins/plugins/index.d.cts +0 -10
  293. package/dist/inner-plugins/plugins/loader.cjs +0 -165
  294. package/dist/inner-plugins/plugins/loader.d.cts +0 -10
  295. package/dist/inner-plugins/plugins/plugins.cjs +0 -73
  296. package/dist/inner-plugins/plugins/plugins.d.cts +0 -8
  297. package/dist/inner-plugins/plugins/progress.cjs +0 -68
  298. package/dist/inner-plugins/plugins/progress.d.cts +0 -8
  299. package/dist/inner-plugins/plugins/resolver.cjs +0 -90
  300. package/dist/inner-plugins/plugins/resolver.d.cts +0 -12
  301. package/dist/inner-plugins/plugins/rspack.cjs +0 -118
  302. package/dist/inner-plugins/plugins/rspack.d.cts +0 -4
  303. package/dist/inner-plugins/plugins/rules.cjs +0 -97
  304. package/dist/inner-plugins/plugins/rules.d.cts +0 -8
  305. package/dist/inner-plugins/plugins/sourcemapTool.cjs +0 -275
  306. package/dist/inner-plugins/plugins/sourcemapTool.d.cts +0 -52
  307. package/dist/inner-plugins/plugins/summary.cjs +0 -125
  308. package/dist/inner-plugins/plugins/summary.d.cts +0 -14
  309. package/dist/inner-plugins/utils/circleDetect.cjs +0 -49
  310. package/dist/inner-plugins/utils/circleDetect.d.cts +0 -4
  311. package/dist/inner-plugins/utils/config.cjs +0 -191
  312. package/dist/inner-plugins/utils/config.d.cts +0 -5
  313. package/dist/inner-plugins/utils/index.cjs +0 -106
  314. package/dist/inner-plugins/utils/index.d.cts +0 -9
  315. package/dist/inner-plugins/utils/loader.cjs +0 -218
  316. package/dist/inner-plugins/utils/loader.d.cts +0 -13
  317. package/dist/inner-plugins/utils/normalize-config.cjs +0 -122
  318. package/dist/inner-plugins/utils/normalize-config.d.cts +0 -37
  319. package/dist/inner-plugins/utils/plugin-common.cjs +0 -143
  320. package/dist/inner-plugins/utils/plugin-common.d.cts +0 -11
  321. package/dist/inner-plugins/utils/plugin.cjs +0 -106
  322. package/dist/inner-plugins/utils/plugin.d.cts +0 -4
  323. package/dist/inner-plugins/utils/sdk.cjs +0 -55
  324. package/dist/inner-plugins/utils/sdk.d.cts +0 -8
  325. package/dist/rslib-runtime.js +0 -19
  326. package/dist/rules/index.cjs +0 -81
  327. package/dist/rules/index.d.cts +0 -3
  328. package/dist/rules/linter.cjs +0 -72
  329. package/dist/rules/linter.d.cts +0 -9
  330. package/dist/rules/rule.cjs +0 -137
  331. package/dist/rules/rule.d.cts +0 -27
  332. package/dist/rules/rules/cjs-require/index.cjs +0 -83
  333. package/dist/rules/rules/cjs-require/index.d.cts +0 -4
  334. package/dist/rules/rules/cjs-require/types.cjs +0 -18
  335. package/dist/rules/rules/cjs-require/types.d.cts +0 -7
  336. package/dist/rules/rules/cross-chunks-package/index.cjs +0 -74
  337. package/dist/rules/rules/cross-chunks-package/index.d.cts +0 -4
  338. package/dist/rules/rules/cross-chunks-package/types.cjs +0 -18
  339. package/dist/rules/rules/cross-chunks-package/types.d.cts +0 -3
  340. package/dist/rules/rules/cross-chunks-package/utils.cjs +0 -40
  341. package/dist/rules/rules/cross-chunks-package/utils.d.cts +0 -1
  342. package/dist/rules/rules/default-import-check/index.cjs +0 -116
  343. package/dist/rules/rules/default-import-check/index.d.cts +0 -4
  344. package/dist/rules/rules/default-import-check/types.cjs +0 -18
  345. package/dist/rules/rules/default-import-check/types.d.cts +0 -4
  346. package/dist/rules/rules/default-import-check/utils.cjs +0 -97
  347. package/dist/rules/rules/default-import-check/utils.d.cts +0 -10
  348. package/dist/rules/rules/duplicate-package/index.cjs +0 -72
  349. package/dist/rules/rules/duplicate-package/index.d.cts +0 -4
  350. package/dist/rules/rules/duplicate-package/types.cjs +0 -60
  351. package/dist/rules/rules/duplicate-package/types.d.cts +0 -24
  352. package/dist/rules/rules/duplicate-package/utils.cjs +0 -84
  353. package/dist/rules/rules/duplicate-package/utils.d.cts +0 -3
  354. package/dist/rules/rules/ecma-version-check/index.cjs +0 -96
  355. package/dist/rules/rules/ecma-version-check/index.d.cts +0 -4
  356. package/dist/rules/rules/ecma-version-check/types.cjs +0 -18
  357. package/dist/rules/rules/ecma-version-check/types.d.cts +0 -3
  358. package/dist/rules/rules/ecma-version-check/utils.cjs +0 -39
  359. package/dist/rules/rules/ecma-version-check/utils.d.cts +0 -2
  360. package/dist/rules/rules/esm-resolved-to-cjs/index.cjs +0 -237
  361. package/dist/rules/rules/esm-resolved-to-cjs/index.d.cts +0 -4
  362. package/dist/rules/rules/esm-resolved-to-cjs/types.cjs +0 -18
  363. package/dist/rules/rules/esm-resolved-to-cjs/types.d.cts +0 -8
  364. package/dist/rules/rules/index.cjs +0 -55
  365. package/dist/rules/rules/index.d.cts +0 -2
  366. package/dist/rules/rules/loader-performance-optimization/index.cjs +0 -119
  367. package/dist/rules/rules/loader-performance-optimization/index.d.cts +0 -4
  368. package/dist/rules/rules/loader-performance-optimization/types.cjs +0 -18
  369. package/dist/rules/rules/loader-performance-optimization/types.d.cts +0 -22
  370. package/dist/rules/rules/loader-performance-optimization/utils.cjs +0 -43
  371. package/dist/rules/rules/loader-performance-optimization/utils.d.cts +0 -1
  372. package/dist/rules/rules/module-mixed-chunks/index.cjs +0 -85
  373. package/dist/rules/rules/module-mixed-chunks/index.d.cts +0 -4
  374. package/dist/rules/rules/module-mixed-chunks/types.cjs +0 -18
  375. package/dist/rules/rules/module-mixed-chunks/types.d.cts +0 -3
  376. package/dist/rules/rules/side-effects-only-imports/index.cjs +0 -114
  377. package/dist/rules/rules/side-effects-only-imports/index.d.cts +0 -4
  378. package/dist/rules/rules/side-effects-only-imports/types.cjs +0 -18
  379. package/dist/rules/rules/side-effects-only-imports/types.d.cts +0 -9
  380. package/dist/rules/utils.cjs +0 -46
  381. package/dist/rules/utils.d.cts +0 -3
  382. package/dist/types/chunks.cjs +0 -18
  383. package/dist/types/chunks.d.cts +0 -6
  384. package/dist/types/chunks.d.ts +0 -6
  385. package/dist/types/index.cjs +0 -79
  386. package/dist/types/index.d.cts +0 -4
  387. package/dist/types/loader.cjs +0 -18
  388. package/dist/types/loader.d.cts +0 -19
  389. package/dist/types/plugin.cjs +0 -18
  390. package/dist/types/plugin.d.cts +0 -51
  391. package/dist/types/rules.cjs +0 -18
  392. package/dist/types/rules.d.cts +0 -7
  393. /package/dist/{types/chunks.js → rule-utils/document/types.js} +0 -0
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- default: ()=>proxy,
28
- pitch: ()=>pitch,
29
- raw: ()=>raw
30
- });
31
- const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
32
- const external_utils_index_cjs_namespaceObject = require("../utils/index.cjs");
33
- const loaderModule = function(...args) {
34
- if ((0, external_utils_index_cjs_namespaceObject.shouldSkipLoader)(this)) return void this.callback(null, ...args);
35
- this.cacheable(false);
36
- const mod = (0, external_utils_index_cjs_namespaceObject.getOriginLoaderModule)(this);
37
- if (mod.default) {
38
- if (false === mod.raw && Buffer.isBuffer(args[0])) args[0] = args[0].toString();
39
- let start = 0;
40
- let startHRTime = [
41
- 0,
42
- 0
43
- ];
44
- const trap = index_cjs_namespaceObject.Utils.createLoaderContextTrap.call(this, (err, res, sourceMap)=>{
45
- (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, false, args[0].toString(), err, res, sourceMap);
46
- });
47
- start = Date.now();
48
- startHRTime = process.hrtime();
49
- try {
50
- const result = mod.default.apply(trap, args);
51
- if (result) {
52
- if (!(result instanceof Promise)) (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, true, args[0].toString(), null, result);
53
- }
54
- return result || '';
55
- } catch (error) {
56
- (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, true, args[0].toString(), error, null);
57
- throw error;
58
- }
59
- }
60
- this.callback(null, ...args);
61
- };
62
- const pitch = function() {
63
- if ((0, external_utils_index_cjs_namespaceObject.shouldSkipLoader)(this)) return;
64
- this.cacheable(false);
65
- const mod = (0, external_utils_index_cjs_namespaceObject.getOriginLoaderModule)(this);
66
- if (mod.pitch && 'function' == typeof mod.pitch) {
67
- let start = 0;
68
- let startHRTime = [
69
- 0,
70
- 0
71
- ];
72
- const trap = index_cjs_namespaceObject.Utils.createLoaderContextTrap.call(this, (err, res)=>{
73
- (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, false, err ? 'Loader Pitch Async Error' : '', err, res);
74
- });
75
- start = Date.now();
76
- startHRTime = process.hrtime();
77
- try {
78
- const res = mod.pitch.apply(trap, arguments);
79
- if (res) {
80
- if (!(res instanceof Promise)) (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, true, '', null, res);
81
- }
82
- return res;
83
- } catch (error) {
84
- (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, true, 'Loader Pitch Sync Error', error, null);
85
- throw error;
86
- }
87
- }
88
- };
89
- loaderModule.raw = true;
90
- loaderModule.pitch = pitch;
91
- const raw = true;
92
- const proxy = loaderModule;
93
- exports["default"] = __webpack_exports__["default"];
94
- exports.pitch = __webpack_exports__.pitch;
95
- exports.raw = __webpack_exports__.raw;
96
- for(var __rspack_i in __webpack_exports__)if (-1 === [
97
- "default",
98
- "pitch",
99
- "raw"
100
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
101
- Object.defineProperty(exports, '__esModule', {
102
- value: true
103
- });
104
- module.exports = loaderModule;
@@ -1,7 +0,0 @@
1
- import type { Plugin as PluginType } from '@rsdoctor/types';
2
- import { Plugin } from '@rsdoctor/types';
3
- import type { ProxyLoaderOptions } from '../../types';
4
- declare const loaderModule: Plugin.LoaderDefinition<ProxyLoaderOptions, {}>;
5
- export declare const pitch: (this: PluginType.LoaderContext<ProxyLoaderOptions>) => string | void | Buffer<ArrayBufferLike> | Promise<string | Buffer<ArrayBufferLike>>;
6
- export declare const raw = true;
7
- export default loaderModule;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- InternalBasePlugin: ()=>InternalBasePlugin
28
- });
29
- const external_constants_cjs_namespaceObject = require("../constants.cjs");
30
- class InternalBasePlugin {
31
- get options() {
32
- return this.scheduler.options;
33
- }
34
- get sdk() {
35
- return this.scheduler.sdk;
36
- }
37
- get tapPostOptions() {
38
- return (0, external_constants_cjs_namespaceObject.internalPluginTapPostOptions)(this.name);
39
- }
40
- get tapPreOptions() {
41
- return (0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)(this.name);
42
- }
43
- constructor(scheduler){
44
- this.scheduler = scheduler;
45
- }
46
- }
47
- exports.InternalBasePlugin = __webpack_exports__.InternalBasePlugin;
48
- for(var __rspack_i in __webpack_exports__)if (-1 === [
49
- "InternalBasePlugin"
50
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
51
- Object.defineProperty(exports, '__esModule', {
52
- value: true
53
- });
@@ -1,12 +0,0 @@
1
- import type { Linter, Plugin, SDK } from '@rsdoctor/types';
2
- import type { InternalPlugin, RsdoctorPluginInstance } from '../../types';
3
- export declare abstract class InternalBasePlugin<T extends Plugin.BaseCompiler> implements InternalPlugin<T, Linter.ExtendRuleData[]> {
4
- readonly scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>;
5
- abstract name: string;
6
- constructor(scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>);
7
- abstract apply(compiler: T): void;
8
- get options(): Plugin.RsdoctorPluginOptionsNormalized<Linter.ExtendRuleData<any, string>[]>;
9
- get sdk(): SDK.RsdoctorBuilderSDKInstance;
10
- get tapPostOptions(): import("tapable").Tap;
11
- get tapPreOptions(): import("tapable").Tap;
12
- }
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- InternalBundlePlugin: ()=>InternalBundlePlugin
28
- });
29
- const types_namespaceObject = require("@rsdoctor/types");
30
- const external_base_cjs_namespaceObject = require("./base.cjs");
31
- const graph_namespaceObject = require("@rsdoctor/graph");
32
- const logger_namespaceObject = require("@rsdoctor/utils/logger");
33
- class InternalBundlePlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
34
- apply(compiler) {
35
- (0, logger_namespaceObject.time)('InternalBundlePlugin.apply');
36
- try {
37
- this.scheduler.ensureModulesChunksGraphApplied(compiler);
38
- this.changeDevtoolModuleFilename(compiler);
39
- compiler.hooks.compilation.tap(this.tapPostOptions, this.thisCompilation);
40
- compiler.hooks.done.tapPromise(this.tapPreOptions, this.done.bind(this));
41
- } finally{
42
- (0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.apply');
43
- }
44
- }
45
- changeDevtoolModuleFilename(compiler) {
46
- const devtool = compiler.options.devtool;
47
- if (devtool) {
48
- if (!compiler.options.output) compiler.options.output = {};
49
- compiler.options.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]';
50
- logger_namespaceObject.logger.warn("output.devtoolModuleFilenameTemplate has been changed to [absolute-resource-path], this is for bundle analysis.");
51
- if ('string' == typeof devtool && devtool.includes('source-map')) compiler.options.output.devtoolFallbackModuleFilenameTemplate = ()=>'[absolute-resource-path]';
52
- }
53
- }
54
- ensureAssetContent(name) {
55
- const asset = this.map.get(name);
56
- if (asset) return asset;
57
- const v = {
58
- content: ''
59
- };
60
- this.map.set(name, v);
61
- return v;
62
- }
63
- constructor(...args){
64
- super(...args), this.name = 'bundle', this.map = new Map(), this.thisCompilation = (compilation)=>{
65
- (0, logger_namespaceObject.time)('InternalBundlePlugin.thisCompilation');
66
- try {
67
- if (compilation.hooks.processAssets) compilation.hooks.afterProcessAssets.tap(this.tapPostOptions, (assets)=>{
68
- Object.keys(assets).forEach((file)=>{
69
- const v = this.ensureAssetContent(file);
70
- v.content = assets[file].source().toString();
71
- });
72
- });
73
- } finally{
74
- (0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.thisCompilation');
75
- }
76
- }, this.done = async ()=>{
77
- (0, logger_namespaceObject.time)('InternalBundlePlugin.done');
78
- try {
79
- if (this.scheduler.chunkGraph) graph_namespaceObject.Chunks.assetsContents(this.map, this.scheduler.chunkGraph, this.scheduler.options?.supports);
80
- this.sdk.addClientRoutes([
81
- types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.ModuleGraph,
82
- types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.BundleSize
83
- ]);
84
- } finally{
85
- (0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.done');
86
- }
87
- };
88
- }
89
- }
90
- exports.InternalBundlePlugin = __webpack_exports__.InternalBundlePlugin;
91
- for(var __rspack_i in __webpack_exports__)if (-1 === [
92
- "InternalBundlePlugin"
93
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
94
- Object.defineProperty(exports, '__esModule', {
95
- value: true
96
- });
@@ -1,15 +0,0 @@
1
- import { Plugin } from '@rsdoctor/types';
2
- import { InternalBasePlugin } from './base';
3
- export declare class InternalBundlePlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
4
- readonly name = "bundle";
5
- map: Map<string, {
6
- content: string;
7
- }>;
8
- apply(compiler: T): void;
9
- changeDevtoolModuleFilename(compiler: Plugin.BaseCompiler): void;
10
- ensureAssetContent(name: string): {
11
- content: string;
12
- };
13
- thisCompilation: (compilation: Plugin.BaseCompilation) => void;
14
- done: () => Promise<void>;
15
- }
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- calculateNamespaceAndRegex: ()=>calculateNamespaceAndRegex,
28
- ensureDevtools: ()=>ensureDevtools,
29
- ensureModulesChunksGraphFn: ()=>ensureModulesChunksGraphFn
30
- });
31
- const build_namespaceObject = require("@rsdoctor/utils/build");
32
- const logger_namespaceObject = require("@rsdoctor/utils/logger");
33
- const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
34
- const external_constants_cjs_namespaceObject = require("../constants.cjs");
35
- const external_rspack_cjs_namespaceObject = require("./rspack.cjs");
36
- const external_sourcemapTool_cjs_namespaceObject = require("./sourcemapTool.cjs");
37
- let hasConsole = false;
38
- const ensureModulesChunksGraphFn = (compiler, _this)=>{
39
- if (_this._modulesGraphApplied) return;
40
- _this._modulesGraphApplied = true;
41
- const RsdoctorRspackPlugin = compiler.webpack.experiments?.RsdoctorPlugin;
42
- if (RsdoctorRspackPlugin) (0, external_rspack_cjs_namespaceObject.applyRspackNativePlugin)(compiler, _this, RsdoctorRspackPlugin);
43
- if (!_this._realSourcePathCache) _this._realSourcePathCache = new Map();
44
- compiler.hooks.done.tapPromise((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('moduleGraph'), async (_stats)=>{
45
- await doneHandler(_stats, _this, compiler);
46
- });
47
- compiler.hooks.compilation.tap({
48
- ...external_constants_cjs_namespaceObject.pluginTapPostOptions,
49
- name: 'RsdoctorSourceMapCollector'
50
- }, (compilation)=>{
51
- if (compilation.hooks.processAssets) compilation.hooks.processAssets.tapPromise({
52
- name: 'RsdoctorSourceMapCollector',
53
- stage: 2400
54
- }, async ()=>{
55
- if (!ensureDevtools(compiler)) return;
56
- const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
57
- await (0, external_sourcemapTool_cjs_namespaceObject.handleAfterEmitAssets)(compilation, _this, sourceMapFilenameRegex, namespace);
58
- });
59
- });
60
- };
61
- async function doneHandler(_stats, _this, compiler) {
62
- const stats = _stats;
63
- const getStatsJson = (()=>{
64
- let cached = null;
65
- return ()=>{
66
- if (cached) return cached;
67
- cached = stats.toJson({
68
- all: false,
69
- chunks: true,
70
- modules: true,
71
- chunkModules: true,
72
- assets: true,
73
- ids: true,
74
- hash: true,
75
- errors: true,
76
- warnings: true,
77
- nestedModules: true,
78
- cachedModules: true,
79
- orphanModules: true,
80
- runtimeModules: true,
81
- optimizationBailout: true
82
- });
83
- return cached;
84
- };
85
- })();
86
- logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[Before Generate ModuleGraph]')}`);
87
- if (!_this.chunkGraph?.getChunks().length) _this.chunkGraph = index_cjs_namespaceObject.Chunks.chunkTransform(new Map(), getStatsJson());
88
- if (!_this.modulesGraph.getModules().length) _this.modulesGraph = await index_cjs_namespaceObject.ModuleGraph.getModuleGraphByStats(stats.compilation, getStatsJson(), process.cwd(), _this.chunkGraph, _this.options.features);
89
- logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After Generate ModuleGraph]')}`);
90
- const shouldParseBundle = false !== _this.options.supports.parseBundle;
91
- await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets, _this.assetsWithoutSourceMap);
92
- logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After Transform ModuleGraph]'`);
93
- logger_namespaceObject.logger.debug('reportModuleGraph start');
94
- if (_this.modulesGraph) await _this.sdk.reportModuleGraph(_this.modulesGraph);
95
- logger_namespaceObject.logger.debug('reportModuleGraph done');
96
- logger_namespaceObject.logger.debug('reportChunkGraph start');
97
- await _this.sdk.reportChunkGraph(_this.chunkGraph);
98
- logger_namespaceObject.logger.debug('reportChunkGraph done');
99
- if (_this.options.supports.generateTileGraph) logger_namespaceObject.logger.warn(logger_namespaceObject.chalk.yellow('The option generateTileGraph is deprecated. Treemap (i.e. Tile Graph) is now supported by default.'));
100
- logger_namespaceObject.logger.debug('doneHandler done');
101
- }
102
- const ensureDevtools = (compiler)=>{
103
- const devtool = compiler.options.devtool;
104
- if ('string' == typeof devtool && /eval/i.test(devtool)) {
105
- if (!hasConsole) logger_namespaceObject.logger.warn('SourceMap with eval is not supported. Please use other sourcemap options.');
106
- hasConsole = true;
107
- return false;
108
- }
109
- return true;
110
- };
111
- async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets, assetsWithoutSourceMap) {
112
- if (!moduleGraph) return;
113
- try {
114
- await index_cjs_namespaceObject.Chunks.getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle, assetsWithoutSourceMap);
115
- } catch {}
116
- }
117
- function escapeRegExp(str) {
118
- return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
119
- }
120
- function calculateNamespaceAndRegex(compiler) {
121
- let namespace = compiler.options.output.devtoolNamespace || compiler.options.output.library?.name || '[^/]+/';
122
- if (Array.isArray(namespace)) namespace = namespace[0];
123
- else if ('object' == typeof namespace && 'name' in namespace) namespace = namespace.name;
124
- const safeNamespace = escapeRegExp(namespace);
125
- const sourceMapFilenameRegex = new RegExp(`(?:webpack://)?(?:${safeNamespace})?([^?]*)`);
126
- return {
127
- namespace: namespace,
128
- sourceMapFilenameRegex
129
- };
130
- }
131
- exports.calculateNamespaceAndRegex = __webpack_exports__.calculateNamespaceAndRegex;
132
- exports.ensureDevtools = __webpack_exports__.ensureDevtools;
133
- exports.ensureModulesChunksGraphFn = __webpack_exports__.ensureModulesChunksGraphFn;
134
- for(var __rspack_i in __webpack_exports__)if (-1 === [
135
- "calculateNamespaceAndRegex",
136
- "ensureDevtools",
137
- "ensureModulesChunksGraphFn"
138
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
139
- Object.defineProperty(exports, '__esModule', {
140
- value: true
141
- });
@@ -1,34 +0,0 @@
1
- import { RsdoctorPluginInstance } from '../../types';
2
- import { Linter, Plugin } from '@rsdoctor/types';
3
- /**
4
- * Represents a mapping item from a source map.
5
- */
6
- export interface MappingItem {
7
- source: string | null;
8
- generatedLine: number;
9
- generatedColumn: number;
10
- originalLine: number | null;
11
- originalColumn: number | null;
12
- name: string | null;
13
- }
14
- /**
15
- * Main function to generate ModuleGraph and ChunkGraph from Rspack native data
16
- * or stats fallback, and collect source maps.
17
- */
18
- export declare const ensureModulesChunksGraphFn: (compiler: Plugin.BaseCompiler, _this: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData[]>) => void;
19
- /**
20
- * Checks if source map processing is enabled and supported by the current compiler configuration.
21
- * Warns if eval-based source maps are used (unsupported).
22
- * @param compiler - The Rspack compiler instance.
23
- * @returns true if source maps are enabled and supported, false otherwise.
24
- */
25
- export declare const ensureDevtools: (compiler: Plugin.BaseCompiler) => boolean;
26
- /**
27
- * Calculates namespace and source map filename regex for source map resolution.
28
- * @param compiler - The Rspack compiler instance.
29
- * @returns An object containing namespace and sourceMapFilenameRegex.
30
- */
31
- export declare function calculateNamespaceAndRegex(compiler: Plugin.BaseCompiler): {
32
- namespace: string;
33
- sourceMapFilenameRegex: RegExp;
34
- };
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- InternalErrorReporterPlugin: ()=>InternalErrorReporterPlugin
28
- });
29
- const types_namespaceObject = require("@rsdoctor/types");
30
- const external_base_cjs_namespaceObject = require("./base.cjs");
31
- const error_namespaceObject = require("@rsdoctor/utils/error");
32
- const logger_namespaceObject = require("@rsdoctor/utils/logger");
33
- class InternalErrorReporterPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
34
- apply(compiler) {
35
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.apply');
36
- try {
37
- compiler.hooks.done.tapPromise(this.tapPreOptions, this.done);
38
- } finally{
39
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.apply');
40
- }
41
- }
42
- handleBundlerError(err, category, level) {
43
- return error_namespaceObject.DevToolError.from(err, {
44
- category,
45
- code: types_namespaceObject.Rule.RuleMessageCodeEnumerated.Overlay,
46
- controller: {
47
- noStack: false
48
- },
49
- detail: {
50
- stack: 'stack' in err ? err.stack : err.message
51
- },
52
- level
53
- });
54
- }
55
- async reportWarnings(warnings) {
56
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportWarnings');
57
- try {
58
- const arr = warnings.map((warning)=>this.handleBundlerError(warning, types_namespaceObject.Rule.RuleMessageCategory.Compile, 'Warn'));
59
- this.sdk.reportError(arr);
60
- } finally{
61
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportWarnings');
62
- }
63
- }
64
- async reportErrors(errors) {
65
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportErrors');
66
- try {
67
- const arr = errors.map((err)=>this.handleBundlerError(err, types_namespaceObject.Rule.RuleMessageCategory.Bundle, 'Error'));
68
- this.sdk.reportError(arr);
69
- } finally{
70
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportErrors');
71
- }
72
- }
73
- constructor(...args){
74
- super(...args), this.name = 'error-reporter', this.done = async (stats)=>{
75
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.done');
76
- try {
77
- const tasks = [];
78
- const statsData = stats.toJson({
79
- all: false,
80
- errors: true,
81
- warnings: true
82
- });
83
- if (stats.hasErrors()) tasks.push(this.reportErrors(statsData.errors || []));
84
- if (stats.hasWarnings()) tasks.push(this.reportWarnings(statsData.warnings || []));
85
- await Promise.all(tasks);
86
- } finally{
87
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.done');
88
- }
89
- };
90
- }
91
- }
92
- exports.InternalErrorReporterPlugin = __webpack_exports__.InternalErrorReporterPlugin;
93
- for(var __rspack_i in __webpack_exports__)if (-1 === [
94
- "InternalErrorReporterPlugin"
95
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
96
- Object.defineProperty(exports, '__esModule', {
97
- value: true
98
- });
@@ -1,11 +0,0 @@
1
- import { Rule, Err, Plugin } from '@rsdoctor/types';
2
- import { InternalBasePlugin } from './base';
3
- import { DevToolError } from '@rsdoctor/utils/error';
4
- export declare class InternalErrorReporterPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
5
- readonly name = "error-reporter";
6
- apply(compiler: T): void;
7
- done: (stats: Plugin.BaseStats) => Promise<void>;
8
- handleBundlerError(err: Plugin.BuildError, category: Rule.RuleMessageCategory, level: keyof typeof Err.ErrorLevel): DevToolError;
9
- reportWarnings(warnings: Plugin.BuildError[]): Promise<void>;
10
- reportErrors(errors: Plugin.BuildWarning[]): Promise<void>;
11
- }