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

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 (360) hide show
  1. package/dist/26.js +26163 -0
  2. package/dist/630.js +1269 -0
  3. package/dist/630.js.LICENSE.txt +7 -0
  4. package/dist/build-utils/build/chunks/assetsModules.d.ts +8 -2
  5. package/dist/build-utils/build/chunks/index.d.ts +0 -1
  6. package/dist/build-utils/build/chunks/rspack/transform.d.ts +1 -1
  7. package/dist/build-utils/build/envinfo.d.ts +13 -0
  8. package/dist/build-utils/build/file/cache.d.ts +5 -0
  9. package/dist/build-utils/build/file/index.d.ts +3 -0
  10. package/dist/build-utils/build/file/sharding.d.ts +21 -0
  11. package/dist/build-utils/build/index.d.ts +5 -0
  12. package/dist/build-utils/build/json.d.ts +3 -0
  13. package/dist/build-utils/build/loader/probeLoader.d.ts +8 -3
  14. package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +1 -1
  15. package/dist/build-utils/build/module-graph/index.d.ts +0 -1
  16. package/dist/build-utils/build/module-graph/parser.d.ts +1 -1
  17. package/dist/build-utils/build/module-graph/rspack/transform.d.ts +1 -1
  18. package/dist/build-utils/build/module-graph/utils.d.ts +1 -1
  19. package/dist/build-utils/build/process.d.ts +2 -0
  20. package/dist/build-utils/build/server.d.ts +15 -0
  21. package/dist/build-utils/build/utils/loader.d.ts +2 -2
  22. package/dist/build-utils/build/utils/parseBundle.d.ts +1 -1
  23. package/dist/build-utils/build/utils/plugin.d.ts +1 -1
  24. package/dist/build-utils/index.d.ts +10 -0
  25. package/dist/common/file.d.ts +2 -0
  26. package/dist/common/global-config.d.ts +21 -0
  27. package/dist/error/error.d.ts +35 -0
  28. package/dist/error/index.d.ts +2 -0
  29. package/dist/error/transform.d.ts +3 -0
  30. package/dist/error/utils.d.ts +4 -0
  31. package/dist/index.d.ts +5 -3
  32. package/dist/index.js +1725 -5
  33. package/dist/inner-plugins/constants.d.ts +1 -1
  34. package/dist/inner-plugins/loaders/proxy.d.ts +4 -4
  35. package/dist/inner-plugins/plugins/base.d.ts +3 -3
  36. package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
  37. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +3 -3
  38. package/dist/inner-plugins/plugins/errors.d.ts +2 -2
  39. package/dist/inner-plugins/plugins/loader.d.ts +1 -1
  40. package/dist/inner-plugins/plugins/plugins.d.ts +1 -1
  41. package/dist/inner-plugins/plugins/progress.d.ts +2 -2
  42. package/dist/inner-plugins/plugins/resolver.d.ts +1 -1
  43. package/dist/inner-plugins/plugins/rspack.d.ts +8 -3
  44. package/dist/inner-plugins/plugins/rules.d.ts +1 -1
  45. package/dist/inner-plugins/plugins/sourcemapTool.d.ts +2 -2
  46. package/dist/inner-plugins/plugins/summary.d.ts +1 -1
  47. package/dist/inner-plugins/utils/config.d.ts +2 -3
  48. package/dist/inner-plugins/utils/loader.d.ts +4 -7
  49. package/dist/inner-plugins/utils/normalize-config.d.ts +1 -1
  50. package/dist/inner-plugins/utils/openBrowser.d.ts +1 -0
  51. package/dist/inner-plugins/utils/plugin.d.ts +1 -1
  52. package/dist/inner-plugins/utils/sdk.d.ts +2 -3
  53. package/dist/logger.d.ts +9 -0
  54. package/dist/probe-loader.js +2 -0
  55. package/dist/proxy-loader.d.ts +1 -0
  56. package/dist/proxy-loader.js +48 -0
  57. package/dist/rslib-runtime.js +18 -9
  58. package/dist/{inner-plugins/constants.d.cts → rspack-plugin/constants.d.ts} +4 -1
  59. package/dist/rspack-plugin/index.d.ts +2 -0
  60. package/dist/rspack-plugin/multiple.d.ts +8 -0
  61. package/dist/rspack-plugin/plugin.d.ts +25 -0
  62. package/dist/rule-utils/document/document.d.ts +16 -0
  63. package/dist/rule-utils/document/index.d.ts +3 -0
  64. package/dist/rule-utils/document/server.d.ts +4 -0
  65. package/dist/rule-utils/document/types.d.ts +31 -0
  66. package/dist/rule-utils/index.d.ts +2 -0
  67. package/dist/rule-utils/parser/asserts.d.ts +81 -0
  68. package/dist/rule-utils/parser/index.d.ts +4 -0
  69. package/dist/rule-utils/parser/parser.d.ts +118 -0
  70. package/dist/rule-utils/parser/types.d.ts +30 -0
  71. package/dist/rule-utils/parser/utils.d.ts +30 -0
  72. package/dist/rules/linter.d.ts +1 -1
  73. package/dist/rules/rule.d.ts +2 -2
  74. package/dist/rules/rules/cjs-require/index.d.ts +1 -1
  75. package/dist/rules/rules/cross-chunks-package/index.d.ts +1 -1
  76. package/dist/rules/rules/default-import-check/index.d.ts +1 -1
  77. package/dist/rules/rules/default-import-check/utils.d.ts +2 -2
  78. package/dist/rules/rules/duplicate-package/index.d.ts +3 -3
  79. package/dist/rules/rules/duplicate-package/utils.d.ts +1 -1
  80. package/dist/rules/rules/ecma-version-check/htmlParserStub.d.ts +3 -0
  81. package/dist/rules/rules/ecma-version-check/index.d.ts +3 -2
  82. package/dist/rules/rules/ecma-version-check/types.d.ts +13 -3
  83. package/dist/rules/rules/ecma-version-check/utils.d.ts +1 -1
  84. package/dist/rules/rules/esm-resolved-to-cjs/index.d.ts +1 -1
  85. package/dist/rules/rules/index.d.ts +1 -1
  86. package/dist/rules/rules/loader-performance-optimization/index.d.ts +1 -1
  87. package/dist/rules/rules/loader-performance-optimization/types.d.ts +1 -1
  88. package/dist/rules/rules/module-mixed-chunks/index.d.ts +1 -1
  89. package/dist/rules/rules/side-effects-only-imports/index.d.ts +1 -1
  90. package/dist/rules/utils.d.ts +1 -1
  91. package/dist/sdk/index.d.ts +2 -0
  92. package/dist/sdk/multiple/controller.d.ts +12 -0
  93. package/dist/sdk/multiple/index.d.ts +2 -0
  94. package/dist/sdk/multiple/primary.d.ts +32 -0
  95. package/dist/sdk/multiple/server.d.ts +7 -0
  96. package/dist/sdk/sdk/core.d.ts +33 -0
  97. package/dist/sdk/sdk/index.d.ts +52 -0
  98. package/dist/sdk/sdk/types.d.ts +26 -0
  99. package/dist/sdk/server/apis/alerts.d.ts +5 -0
  100. package/dist/sdk/server/apis/base.d.ts +11 -0
  101. package/dist/sdk/server/apis/bundle-diff.d.ts +6 -0
  102. package/dist/sdk/server/apis/data.d.ts +6 -0
  103. package/dist/sdk/server/apis/fs.d.ts +5 -0
  104. package/dist/sdk/server/apis/graph.d.ts +12 -0
  105. package/dist/sdk/server/apis/index.d.ts +10 -0
  106. package/dist/sdk/server/apis/loader.d.ts +15 -0
  107. package/dist/sdk/server/apis/plugin.d.ts +6 -0
  108. package/dist/sdk/server/apis/project.d.ts +8 -0
  109. package/dist/sdk/server/apis/renderer.d.ts +6 -0
  110. package/dist/sdk/server/apis/resolver.d.ts +6 -0
  111. package/dist/sdk/server/client.d.ts +3 -0
  112. package/dist/sdk/server/fakeServer.d.ts +9 -0
  113. package/dist/sdk/server/index.d.ts +44 -0
  114. package/dist/sdk/server/json-body.d.ts +6 -0
  115. package/dist/sdk/server/router.d.ts +24 -0
  116. package/dist/sdk/server/security.d.ts +5 -0
  117. package/dist/sdk/server/socket/api.d.ts +15 -0
  118. package/dist/sdk/server/socket/index.d.ts +48 -0
  119. package/dist/sdk/server/utils.d.ts +6 -0
  120. package/dist/sdk/utils/base.d.ts +1 -0
  121. package/dist/sdk/utils/constant.d.ts +1 -0
  122. package/dist/sdk/utils/date.d.ts +1 -0
  123. package/dist/sdk/utils/index.d.ts +3 -0
  124. package/dist/sdk/utils/openBrowser.d.ts +4 -0
  125. package/dist/sdk/utils/upload.d.ts +2 -0
  126. package/dist/sdk.d.ts +1 -0
  127. package/dist/types/index.d.ts +0 -1
  128. package/dist/types/loader.d.ts +1 -1
  129. package/dist/types/plugin.d.ts +7 -28
  130. package/package.json +56 -80
  131. package/static/openChrome.applescript +95 -0
  132. package/dist/build-utils/build/chunks/assetsModules.cjs +0 -42
  133. package/dist/build-utils/build/chunks/assetsModules.d.cts +0 -17
  134. package/dist/build-utils/build/chunks/assetsModules.js +0 -9
  135. package/dist/build-utils/build/chunks/chunkTransform.cjs +0 -39
  136. package/dist/build-utils/build/chunks/chunkTransform.d.cts +0 -4
  137. package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -4
  138. package/dist/build-utils/build/chunks/chunkTransform.js +0 -6
  139. package/dist/build-utils/build/chunks/index.cjs +0 -72
  140. package/dist/build-utils/build/chunks/index.d.cts +0 -3
  141. package/dist/build-utils/build/chunks/index.js +0 -4
  142. package/dist/build-utils/build/chunks/rspack/transform.cjs +0 -80
  143. package/dist/build-utils/build/chunks/rspack/transform.d.cts +0 -13
  144. package/dist/build-utils/build/chunks/rspack/transform.js +0 -44
  145. package/dist/build-utils/build/index.cjs +0 -52
  146. package/dist/build-utils/build/index.d.cts +0 -5
  147. package/dist/build-utils/build/index.js +0 -7
  148. package/dist/build-utils/build/loader/index.cjs +0 -65
  149. package/dist/build-utils/build/loader/index.d.cts +0 -2
  150. package/dist/build-utils/build/loader/index.js +0 -3
  151. package/dist/build-utils/build/loader/probeLoader.cjs +0 -89
  152. package/dist/build-utils/build/loader/probeLoader.d.cts +0 -4
  153. package/dist/build-utils/build/loader/probeLoader.js +0 -44
  154. package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +0 -65
  155. package/dist/build-utils/build/loader/probeLoaderPlugin.d.cts +0 -5
  156. package/dist/build-utils/build/loader/probeLoaderPlugin.js +0 -32
  157. package/dist/build-utils/build/module-graph/index.cjs +0 -65
  158. package/dist/build-utils/build/module-graph/index.d.cts +0 -2
  159. package/dist/build-utils/build/module-graph/index.js +0 -3
  160. package/dist/build-utils/build/module-graph/parser.cjs +0 -46
  161. package/dist/build-utils/build/module-graph/parser.d.cts +0 -2
  162. package/dist/build-utils/build/module-graph/parser.js +0 -13
  163. package/dist/build-utils/build/module-graph/rspack/transform.cjs +0 -151
  164. package/dist/build-utils/build/module-graph/rspack/transform.d.cts +0 -26
  165. package/dist/build-utils/build/module-graph/rspack/transform.js +0 -109
  166. package/dist/build-utils/build/module-graph/transform.cjs +0 -39
  167. package/dist/build-utils/build/module-graph/transform.d.cts +0 -3
  168. package/dist/build-utils/build/module-graph/transform.d.ts +0 -3
  169. package/dist/build-utils/build/module-graph/transform.js +0 -6
  170. package/dist/build-utils/build/module-graph/utils.cjs +0 -95
  171. package/dist/build-utils/build/module-graph/utils.d.cts +0 -3
  172. package/dist/build-utils/build/module-graph/utils.js +0 -59
  173. package/dist/build-utils/build/utils/index.cjs +0 -72
  174. package/dist/build-utils/build/utils/index.d.cts +0 -3
  175. package/dist/build-utils/build/utils/index.js +0 -4
  176. package/dist/build-utils/build/utils/loader.cjs +0 -354
  177. package/dist/build-utils/build/utils/loader.d.cts +0 -20
  178. package/dist/build-utils/build/utils/loader.js +0 -276
  179. package/dist/build-utils/build/utils/parseBundle.cjs +0 -283
  180. package/dist/build-utils/build/utils/parseBundle.d.cts +0 -12
  181. package/dist/build-utils/build/utils/parseBundle.js +0 -240
  182. package/dist/build-utils/build/utils/plugin.cjs +0 -60
  183. package/dist/build-utils/build/utils/plugin.d.cts +0 -5
  184. package/dist/build-utils/build/utils/plugin.js +0 -21
  185. package/dist/build-utils/index.cjs +0 -36
  186. package/dist/build-utils/index.d.cts +0 -1
  187. package/dist/build-utils/index.js +0 -3
  188. package/dist/index.cjs +0 -81
  189. package/dist/index.d.cts +0 -3
  190. package/dist/inner-plugins/constants.cjs +0 -64
  191. package/dist/inner-plugins/constants.js +0 -19
  192. package/dist/inner-plugins/index.cjs +0 -65
  193. package/dist/inner-plugins/index.d.cts +0 -2
  194. package/dist/inner-plugins/index.js +0 -3
  195. package/dist/inner-plugins/loaders/proxy.cjs +0 -104
  196. package/dist/inner-plugins/loaders/proxy.d.cts +0 -7
  197. package/dist/inner-plugins/loaders/proxy.js +0 -65
  198. package/dist/inner-plugins/plugins/base.cjs +0 -53
  199. package/dist/inner-plugins/plugins/base.d.cts +0 -12
  200. package/dist/inner-plugins/plugins/base.js +0 -20
  201. package/dist/inner-plugins/plugins/bundle.cjs +0 -96
  202. package/dist/inner-plugins/plugins/bundle.d.cts +0 -15
  203. package/dist/inner-plugins/plugins/bundle.js +0 -63
  204. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +0 -141
  205. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.cts +0 -34
  206. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +0 -102
  207. package/dist/inner-plugins/plugins/errors.cjs +0 -98
  208. package/dist/inner-plugins/plugins/errors.d.cts +0 -11
  209. package/dist/inner-plugins/plugins/errors.js +0 -65
  210. package/dist/inner-plugins/plugins/index.cjs +0 -121
  211. package/dist/inner-plugins/plugins/index.d.cts +0 -10
  212. package/dist/inner-plugins/plugins/index.js +0 -11
  213. package/dist/inner-plugins/plugins/loader.cjs +0 -165
  214. package/dist/inner-plugins/plugins/loader.d.cts +0 -10
  215. package/dist/inner-plugins/plugins/loader.js +0 -120
  216. package/dist/inner-plugins/plugins/plugins.cjs +0 -73
  217. package/dist/inner-plugins/plugins/plugins.d.cts +0 -8
  218. package/dist/inner-plugins/plugins/plugins.js +0 -40
  219. package/dist/inner-plugins/plugins/progress.cjs +0 -68
  220. package/dist/inner-plugins/plugins/progress.d.cts +0 -8
  221. package/dist/inner-plugins/plugins/progress.js +0 -35
  222. package/dist/inner-plugins/plugins/resolver.cjs +0 -90
  223. package/dist/inner-plugins/plugins/resolver.d.cts +0 -12
  224. package/dist/inner-plugins/plugins/resolver.js +0 -57
  225. package/dist/inner-plugins/plugins/rspack.cjs +0 -118
  226. package/dist/inner-plugins/plugins/rspack.d.cts +0 -4
  227. package/dist/inner-plugins/plugins/rspack.js +0 -85
  228. package/dist/inner-plugins/plugins/rules.cjs +0 -97
  229. package/dist/inner-plugins/plugins/rules.d.cts +0 -8
  230. package/dist/inner-plugins/plugins/rules.js +0 -64
  231. package/dist/inner-plugins/plugins/sourcemapTool.cjs +0 -275
  232. package/dist/inner-plugins/plugins/sourcemapTool.d.cts +0 -52
  233. package/dist/inner-plugins/plugins/sourcemapTool.js +0 -230
  234. package/dist/inner-plugins/plugins/summary.cjs +0 -125
  235. package/dist/inner-plugins/plugins/summary.d.cts +0 -14
  236. package/dist/inner-plugins/plugins/summary.js +0 -92
  237. package/dist/inner-plugins/utils/circleDetect.cjs +0 -49
  238. package/dist/inner-plugins/utils/circleDetect.d.cts +0 -4
  239. package/dist/inner-plugins/utils/circleDetect.js +0 -16
  240. package/dist/inner-plugins/utils/config.cjs +0 -191
  241. package/dist/inner-plugins/utils/config.d.cts +0 -5
  242. package/dist/inner-plugins/utils/config.js +0 -142
  243. package/dist/inner-plugins/utils/index.cjs +0 -106
  244. package/dist/inner-plugins/utils/index.d.cts +0 -9
  245. package/dist/inner-plugins/utils/index.js +0 -8
  246. package/dist/inner-plugins/utils/loader.cjs +0 -218
  247. package/dist/inner-plugins/utils/loader.d.cts +0 -13
  248. package/dist/inner-plugins/utils/loader.js +0 -160
  249. package/dist/inner-plugins/utils/normalize-config.cjs +0 -122
  250. package/dist/inner-plugins/utils/normalize-config.d.cts +0 -37
  251. package/dist/inner-plugins/utils/normalize-config.js +0 -77
  252. package/dist/inner-plugins/utils/plugin-common.cjs +0 -143
  253. package/dist/inner-plugins/utils/plugin-common.d.cts +0 -11
  254. package/dist/inner-plugins/utils/plugin-common.js +0 -94
  255. package/dist/inner-plugins/utils/plugin.cjs +0 -106
  256. package/dist/inner-plugins/utils/plugin.d.cts +0 -4
  257. package/dist/inner-plugins/utils/plugin.js +0 -70
  258. package/dist/inner-plugins/utils/sdk.cjs +0 -55
  259. package/dist/inner-plugins/utils/sdk.d.cts +0 -8
  260. package/dist/inner-plugins/utils/sdk.js +0 -19
  261. package/dist/rules/index.cjs +0 -81
  262. package/dist/rules/index.d.cts +0 -3
  263. package/dist/rules/index.js +0 -4
  264. package/dist/rules/linter.cjs +0 -72
  265. package/dist/rules/linter.d.cts +0 -9
  266. package/dist/rules/linter.js +0 -36
  267. package/dist/rules/rule.cjs +0 -137
  268. package/dist/rules/rule.d.cts +0 -27
  269. package/dist/rules/rule.js +0 -101
  270. package/dist/rules/rules/cjs-require/index.cjs +0 -83
  271. package/dist/rules/rules/cjs-require/index.d.cts +0 -4
  272. package/dist/rules/rules/cjs-require/index.js +0 -50
  273. package/dist/rules/rules/cjs-require/types.cjs +0 -18
  274. package/dist/rules/rules/cjs-require/types.d.cts +0 -7
  275. package/dist/rules/rules/cjs-require/types.js +0 -1
  276. package/dist/rules/rules/cross-chunks-package/index.cjs +0 -74
  277. package/dist/rules/rules/cross-chunks-package/index.d.cts +0 -4
  278. package/dist/rules/rules/cross-chunks-package/index.js +0 -41
  279. package/dist/rules/rules/cross-chunks-package/types.cjs +0 -18
  280. package/dist/rules/rules/cross-chunks-package/types.d.cts +0 -3
  281. package/dist/rules/rules/cross-chunks-package/types.js +0 -1
  282. package/dist/rules/rules/cross-chunks-package/utils.cjs +0 -40
  283. package/dist/rules/rules/cross-chunks-package/utils.d.cts +0 -1
  284. package/dist/rules/rules/cross-chunks-package/utils.js +0 -7
  285. package/dist/rules/rules/default-import-check/index.cjs +0 -116
  286. package/dist/rules/rules/default-import-check/index.d.cts +0 -4
  287. package/dist/rules/rules/default-import-check/index.js +0 -83
  288. package/dist/rules/rules/default-import-check/types.cjs +0 -18
  289. package/dist/rules/rules/default-import-check/types.d.cts +0 -4
  290. package/dist/rules/rules/default-import-check/types.js +0 -1
  291. package/dist/rules/rules/default-import-check/utils.cjs +0 -97
  292. package/dist/rules/rules/default-import-check/utils.d.cts +0 -10
  293. package/dist/rules/rules/default-import-check/utils.js +0 -52
  294. package/dist/rules/rules/duplicate-package/index.cjs +0 -72
  295. package/dist/rules/rules/duplicate-package/index.d.cts +0 -4
  296. package/dist/rules/rules/duplicate-package/index.js +0 -39
  297. package/dist/rules/rules/duplicate-package/types.cjs +0 -60
  298. package/dist/rules/rules/duplicate-package/types.d.cts +0 -24
  299. package/dist/rules/rules/duplicate-package/types.js +0 -24
  300. package/dist/rules/rules/duplicate-package/utils.cjs +0 -84
  301. package/dist/rules/rules/duplicate-package/utils.d.cts +0 -3
  302. package/dist/rules/rules/duplicate-package/utils.js +0 -38
  303. package/dist/rules/rules/ecma-version-check/index.cjs +0 -96
  304. package/dist/rules/rules/ecma-version-check/index.d.cts +0 -4
  305. package/dist/rules/rules/ecma-version-check/index.js +0 -53
  306. package/dist/rules/rules/ecma-version-check/types.cjs +0 -18
  307. package/dist/rules/rules/ecma-version-check/types.d.cts +0 -3
  308. package/dist/rules/rules/ecma-version-check/types.js +0 -1
  309. package/dist/rules/rules/ecma-version-check/utils.cjs +0 -39
  310. package/dist/rules/rules/ecma-version-check/utils.d.cts +0 -2
  311. package/dist/rules/rules/ecma-version-check/utils.js +0 -6
  312. package/dist/rules/rules/esm-resolved-to-cjs/index.cjs +0 -237
  313. package/dist/rules/rules/esm-resolved-to-cjs/index.d.cts +0 -4
  314. package/dist/rules/rules/esm-resolved-to-cjs/index.js +0 -193
  315. package/dist/rules/rules/esm-resolved-to-cjs/types.cjs +0 -18
  316. package/dist/rules/rules/esm-resolved-to-cjs/types.d.cts +0 -8
  317. package/dist/rules/rules/esm-resolved-to-cjs/types.js +0 -1
  318. package/dist/rules/rules/index.cjs +0 -55
  319. package/dist/rules/rules/index.d.cts +0 -2
  320. package/dist/rules/rules/index.js +0 -22
  321. package/dist/rules/rules/loader-performance-optimization/index.cjs +0 -119
  322. package/dist/rules/rules/loader-performance-optimization/index.d.cts +0 -4
  323. package/dist/rules/rules/loader-performance-optimization/index.js +0 -86
  324. package/dist/rules/rules/loader-performance-optimization/types.cjs +0 -18
  325. package/dist/rules/rules/loader-performance-optimization/types.d.cts +0 -22
  326. package/dist/rules/rules/loader-performance-optimization/types.js +0 -1
  327. package/dist/rules/rules/loader-performance-optimization/utils.cjs +0 -43
  328. package/dist/rules/rules/loader-performance-optimization/utils.d.cts +0 -1
  329. package/dist/rules/rules/loader-performance-optimization/utils.js +0 -10
  330. package/dist/rules/rules/module-mixed-chunks/index.cjs +0 -85
  331. package/dist/rules/rules/module-mixed-chunks/index.d.cts +0 -4
  332. package/dist/rules/rules/module-mixed-chunks/index.js +0 -52
  333. package/dist/rules/rules/module-mixed-chunks/types.cjs +0 -18
  334. package/dist/rules/rules/module-mixed-chunks/types.d.cts +0 -3
  335. package/dist/rules/rules/module-mixed-chunks/types.js +0 -1
  336. package/dist/rules/rules/side-effects-only-imports/index.cjs +0 -114
  337. package/dist/rules/rules/side-effects-only-imports/index.d.cts +0 -4
  338. package/dist/rules/rules/side-effects-only-imports/index.js +0 -81
  339. package/dist/rules/rules/side-effects-only-imports/types.cjs +0 -18
  340. package/dist/rules/rules/side-effects-only-imports/types.d.cts +0 -9
  341. package/dist/rules/rules/side-effects-only-imports/types.js +0 -1
  342. package/dist/rules/utils.cjs +0 -46
  343. package/dist/rules/utils.d.cts +0 -3
  344. package/dist/rules/utils.js +0 -10
  345. package/dist/types/chunks.cjs +0 -18
  346. package/dist/types/chunks.d.cts +0 -6
  347. package/dist/types/chunks.d.ts +0 -6
  348. package/dist/types/chunks.js +0 -1
  349. package/dist/types/index.cjs +0 -79
  350. package/dist/types/index.d.cts +0 -4
  351. package/dist/types/index.js +0 -5
  352. package/dist/types/loader.cjs +0 -18
  353. package/dist/types/loader.d.cts +0 -19
  354. package/dist/types/loader.js +0 -1
  355. package/dist/types/plugin.cjs +0 -18
  356. package/dist/types/plugin.d.cts +0 -51
  357. package/dist/types/plugin.js +0 -1
  358. package/dist/types/rules.cjs +0 -18
  359. package/dist/types/rules.d.cts +0 -7
  360. package/dist/types/rules.js +0 -1
@@ -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,65 +0,0 @@
1
- import "node:module";
2
- import { Utils } from "../../build-utils/build/index.js";
3
- import { getOriginLoaderModule, reportLoader, shouldSkipLoader } from "../utils/index.js";
4
- const loaderModule = function(...args) {
5
- if (shouldSkipLoader(this)) return void this.callback(null, ...args);
6
- this.cacheable(false);
7
- const mod = getOriginLoaderModule(this);
8
- if (mod.default) {
9
- if (false === mod.raw && Buffer.isBuffer(args[0])) args[0] = args[0].toString();
10
- let start = 0;
11
- let startHRTime = [
12
- 0,
13
- 0
14
- ];
15
- const trap = Utils.createLoaderContextTrap.call(this, (err, res, sourceMap)=>{
16
- reportLoader(this, start, startHRTime, false, false, args[0].toString(), err, res, sourceMap);
17
- });
18
- start = Date.now();
19
- startHRTime = process.hrtime();
20
- try {
21
- const result = mod.default.apply(trap, args);
22
- if (result) {
23
- if (!(result instanceof Promise)) reportLoader(this, start, startHRTime, false, true, args[0].toString(), null, result);
24
- }
25
- return result || '';
26
- } catch (error) {
27
- reportLoader(this, start, startHRTime, false, true, args[0].toString(), error, null);
28
- throw error;
29
- }
30
- }
31
- this.callback(null, ...args);
32
- };
33
- const pitch = function() {
34
- if (shouldSkipLoader(this)) return;
35
- this.cacheable(false);
36
- const mod = getOriginLoaderModule(this);
37
- if (mod.pitch && 'function' == typeof mod.pitch) {
38
- let start = 0;
39
- let startHRTime = [
40
- 0,
41
- 0
42
- ];
43
- const trap = Utils.createLoaderContextTrap.call(this, (err, res)=>{
44
- reportLoader(this, start, startHRTime, true, false, err ? 'Loader Pitch Async Error' : '', err, res);
45
- });
46
- start = Date.now();
47
- startHRTime = process.hrtime();
48
- try {
49
- const res = mod.pitch.apply(trap, arguments);
50
- if (res) {
51
- if (!(res instanceof Promise)) reportLoader(this, start, startHRTime, true, true, '', null, res);
52
- }
53
- return res;
54
- } catch (error) {
55
- reportLoader(this, start, startHRTime, true, true, 'Loader Pitch Sync Error', error, null);
56
- throw error;
57
- }
58
- }
59
- };
60
- loaderModule.raw = true;
61
- loaderModule.pitch = pitch;
62
- const raw = true;
63
- const proxy = loaderModule;
64
- export default proxy;
65
- export { pitch, raw };
@@ -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,20 +0,0 @@
1
- import "node:module";
2
- import { internalPluginTapPostOptions, internalPluginTapPreOptions } from "../constants.js";
3
- class InternalBasePlugin {
4
- get options() {
5
- return this.scheduler.options;
6
- }
7
- get sdk() {
8
- return this.scheduler.sdk;
9
- }
10
- get tapPostOptions() {
11
- return internalPluginTapPostOptions(this.name);
12
- }
13
- get tapPreOptions() {
14
- return internalPluginTapPreOptions(this.name);
15
- }
16
- constructor(scheduler){
17
- this.scheduler = scheduler;
18
- }
19
- }
20
- export { InternalBasePlugin };
@@ -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,63 +0,0 @@
1
- import "node:module";
2
- import { Manifest } from "@rsdoctor/types";
3
- import { InternalBasePlugin } from "./base.js";
4
- import { Chunks } from "@rsdoctor/graph";
5
- import { logger, time, timeEnd } from "@rsdoctor/utils/logger";
6
- class InternalBundlePlugin extends InternalBasePlugin {
7
- apply(compiler) {
8
- time('InternalBundlePlugin.apply');
9
- try {
10
- this.scheduler.ensureModulesChunksGraphApplied(compiler);
11
- this.changeDevtoolModuleFilename(compiler);
12
- compiler.hooks.compilation.tap(this.tapPostOptions, this.thisCompilation);
13
- compiler.hooks.done.tapPromise(this.tapPreOptions, this.done.bind(this));
14
- } finally{
15
- timeEnd('InternalBundlePlugin.apply');
16
- }
17
- }
18
- changeDevtoolModuleFilename(compiler) {
19
- const devtool = compiler.options.devtool;
20
- if (devtool) {
21
- if (!compiler.options.output) compiler.options.output = {};
22
- compiler.options.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]';
23
- logger.warn("output.devtoolModuleFilenameTemplate has been changed to [absolute-resource-path], this is for bundle analysis.");
24
- if ('string' == typeof devtool && devtool.includes('source-map')) compiler.options.output.devtoolFallbackModuleFilenameTemplate = ()=>'[absolute-resource-path]';
25
- }
26
- }
27
- ensureAssetContent(name) {
28
- const asset = this.map.get(name);
29
- if (asset) return asset;
30
- const v = {
31
- content: ''
32
- };
33
- this.map.set(name, v);
34
- return v;
35
- }
36
- constructor(...args){
37
- super(...args), this.name = 'bundle', this.map = new Map(), this.thisCompilation = (compilation)=>{
38
- time('InternalBundlePlugin.thisCompilation');
39
- try {
40
- if (compilation.hooks.processAssets) compilation.hooks.afterProcessAssets.tap(this.tapPostOptions, (assets)=>{
41
- Object.keys(assets).forEach((file)=>{
42
- const v = this.ensureAssetContent(file);
43
- v.content = assets[file].source().toString();
44
- });
45
- });
46
- } finally{
47
- timeEnd('InternalBundlePlugin.thisCompilation');
48
- }
49
- }, this.done = async ()=>{
50
- time('InternalBundlePlugin.done');
51
- try {
52
- if (this.scheduler.chunkGraph) Chunks.assetsContents(this.map, this.scheduler.chunkGraph, this.scheduler.options?.supports);
53
- this.sdk.addClientRoutes([
54
- Manifest.RsdoctorManifestClientRoutes.ModuleGraph,
55
- Manifest.RsdoctorManifestClientRoutes.BundleSize
56
- ]);
57
- } finally{
58
- timeEnd('InternalBundlePlugin.done');
59
- }
60
- };
61
- }
62
- }
63
- export { InternalBundlePlugin };
@@ -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
- };