@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,72 +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
- Linter: ()=>Linter,
28
- LinterType: ()=>types_namespaceObject.Linter
29
- });
30
- const types_namespaceObject = require("@rsdoctor/types");
31
- const external_rule_cjs_namespaceObject = require("./rule.cjs");
32
- const index_cjs_namespaceObject = require("./rules/index.cjs");
33
- const external_utils_cjs_namespaceObject = require("./utils.cjs");
34
- class Linter {
35
- getRules(ruleMap, extendRules, filterLevel) {
36
- const outside = extendRules.map((item)=>external_rule_cjs_namespaceObject.Rule.from(item));
37
- const rules = index_cjs_namespaceObject.rules.map((item)=>new external_rule_cjs_namespaceObject.Rule(item)).concat(outside);
38
- rules.forEach((rule)=>{
39
- const config = ruleMap[rule.title];
40
- if (null != config) rule.setOption(config);
41
- });
42
- return rules.filter((rule)=>rule.match(filterLevel));
43
- }
44
- async validate(context) {
45
- const lintResult = {
46
- errors: [],
47
- replace: []
48
- };
49
- await Promise.all(this.rules.map(async (rule)=>{
50
- const result = await rule.validate(context);
51
- lintResult.errors.push(...result.errors);
52
- lintResult.replace.push(...result.replace);
53
- }));
54
- return lintResult;
55
- }
56
- async afterValidate(context) {
57
- await Promise.all(this.rules.map((rule)=>rule.afterValidate(context)));
58
- }
59
- constructor({ rules, extends: extendRules, level } = {}){
60
- this.rules = [];
61
- this.rules = this.getRules(rules ?? {}, extendRules ?? [], (0, external_utils_cjs_namespaceObject.toSeverity)(level ?? 'Error', types_namespaceObject.Linter.Severity.Error));
62
- }
63
- }
64
- exports.Linter = __webpack_exports__.Linter;
65
- exports.LinterType = __webpack_exports__.LinterType;
66
- for(var __rspack_i in __webpack_exports__)if (-1 === [
67
- "Linter",
68
- "LinterType"
69
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
70
- Object.defineProperty(exports, '__esModule', {
71
- value: true
72
- });
@@ -1,9 +0,0 @@
1
- import { Linter as LinterType, SDK } from '@rsdoctor/types';
2
- export { LinterType };
3
- export declare class Linter<Rules extends LinterType.ExtendRuleData[]> {
4
- private rules;
5
- constructor({ rules, extends: extendRules, level, }?: LinterType.Options<Rules>);
6
- private getRules;
7
- validate(context: SDK.RuntimeContext): Promise<LinterType.ValidateResult>;
8
- afterValidate(context: LinterType.InternalRuleCheckerContextForCheckEnd): Promise<void>;
9
- }
@@ -1,36 +0,0 @@
1
- import "node:module";
2
- import { Linter } from "@rsdoctor/types";
3
- import { Rule } from "./rule.js";
4
- import { rules as index_js_rules } from "./rules/index.js";
5
- import { toSeverity } from "./utils.js";
6
- class linter_Linter {
7
- getRules(ruleMap, extendRules, filterLevel) {
8
- const outside = extendRules.map((item)=>Rule.from(item));
9
- const rules = index_js_rules.map((item)=>new Rule(item)).concat(outside);
10
- rules.forEach((rule)=>{
11
- const config = ruleMap[rule.title];
12
- if (null != config) rule.setOption(config);
13
- });
14
- return rules.filter((rule)=>rule.match(filterLevel));
15
- }
16
- async validate(context) {
17
- const lintResult = {
18
- errors: [],
19
- replace: []
20
- };
21
- await Promise.all(this.rules.map(async (rule)=>{
22
- const result = await rule.validate(context);
23
- lintResult.errors.push(...result.errors);
24
- lintResult.replace.push(...result.replace);
25
- }));
26
- return lintResult;
27
- }
28
- async afterValidate(context) {
29
- await Promise.all(this.rules.map((rule)=>rule.afterValidate(context)));
30
- }
31
- constructor({ rules, extends: extendRules, level } = {}){
32
- this.rules = [];
33
- this.rules = this.getRules(rules ?? {}, extendRules ?? [], toSeverity(level ?? 'Error', Linter.Severity.Error));
34
- }
35
- }
36
- export { Linter as LinterType, linter_Linter as Linter };
@@ -1,137 +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
- Rule: ()=>Rule,
28
- defineRule: ()=>defineRule
29
- });
30
- const types_namespaceObject = require("@rsdoctor/types");
31
- const common_namespaceObject = require("@rsdoctor/utils/common");
32
- const external_utils_cjs_namespaceObject = require("./utils.cjs");
33
- class Rule {
34
- static from(data) {
35
- return new Rule({
36
- check: data.check,
37
- onCheckEnd: data.onCheckEnd,
38
- meta: {
39
- ...data.meta,
40
- code: types_namespaceObject.Rule.RuleMessageCodeEnumerated.Extend,
41
- severity: (0, external_utils_cjs_namespaceObject.toSeverity)(data.meta.severity, types_namespaceObject.Linter.Severity.Warn)
42
- }
43
- });
44
- }
45
- get code() {
46
- return this.meta.code;
47
- }
48
- get title() {
49
- return this.meta.title;
50
- }
51
- get severity() {
52
- return this._severity;
53
- }
54
- get config() {
55
- return this._config;
56
- }
57
- get category() {
58
- return this.meta.category;
59
- }
60
- setOption(opt) {
61
- let severity;
62
- let config;
63
- if (Array.isArray(opt)) {
64
- severity = (0, external_utils_cjs_namespaceObject.toSeverity)(opt[0], this.meta.severity);
65
- config = opt[1];
66
- } else {
67
- severity = (0, external_utils_cjs_namespaceObject.toSeverity)(opt, this.meta.severity);
68
- config = void 0;
69
- }
70
- this._severity = severity;
71
- this._config = common_namespaceObject.Lodash.isPlainObject(config) ? {
72
- ...this.meta.defaultConfig,
73
- ...config
74
- } : config || this.meta.defaultConfig;
75
- }
76
- match(level) {
77
- if (level === types_namespaceObject.Linter.Severity.Ignore || this.severity === types_namespaceObject.Linter.Severity.Ignore) return false;
78
- if (level === types_namespaceObject.Linter.Severity.Error) return this.severity === types_namespaceObject.Linter.Severity.Error || this.severity === types_namespaceObject.Linter.Severity.Warn;
79
- if (level === types_namespaceObject.Linter.Severity.Warn) return this.severity === types_namespaceObject.Linter.Severity.Warn;
80
- return false;
81
- }
82
- async validate(context) {
83
- const errors = [];
84
- const replace = [];
85
- const report = (data, remove)=>{
86
- if (remove) replace.push(remove);
87
- const severity = data.severity ? (0, external_utils_cjs_namespaceObject.toSeverity)(data.severity, this.severity) : this.severity;
88
- const error = {
89
- ...data,
90
- code: this.code,
91
- severity,
92
- category: this.category,
93
- title: this.title.toUpperCase()
94
- };
95
- if (severity !== types_namespaceObject.Linter.Severity.Ignore) errors.push(error);
96
- };
97
- await this.check({
98
- ...context,
99
- ruleConfig: this.config,
100
- report
101
- });
102
- return {
103
- errors,
104
- replace
105
- };
106
- }
107
- async afterValidate({ hooks, validateResult, data }) {
108
- if (this.onCheckEnd === external_utils_cjs_namespaceObject.noop) return;
109
- await this.onCheckEnd({
110
- data: {
111
- ...data,
112
- ruleConfig: this.config
113
- },
114
- hooks,
115
- validateResult
116
- });
117
- }
118
- constructor(data){
119
- this.check = data.check;
120
- this.meta = data.meta;
121
- this.onCheckEnd = 'function' == typeof data.onCheckEnd ? data.onCheckEnd : external_utils_cjs_namespaceObject.noop;
122
- this._severity = this.meta.severity;
123
- this._config = this.meta.defaultConfig;
124
- }
125
- }
126
- function defineRule(ruleCreator) {
127
- return ruleCreator();
128
- }
129
- exports.Rule = __webpack_exports__.Rule;
130
- exports.defineRule = __webpack_exports__.defineRule;
131
- for(var __rspack_i in __webpack_exports__)if (-1 === [
132
- "Rule",
133
- "defineRule"
134
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
135
- Object.defineProperty(exports, '__esModule', {
136
- value: true
137
- });
@@ -1,27 +0,0 @@
1
- import { Linter, SDK, Rule as RuleTypes } from '@rsdoctor/types';
2
- import { LinterType } from './linter';
3
- type DefaultRuleConfig = Linter.DefaultRuleConfig;
4
- export declare class Rule<Config = DefaultRuleConfig> implements Linter.RuleMeta<Config> {
5
- static from<C>(data: Linter.ExtendRuleData<C>): Rule<C>;
6
- readonly meta: Linter.RuleMeta<Config>;
7
- private check;
8
- /**
9
- * execute when check end
10
- */
11
- private onCheckEnd;
12
- private _severity;
13
- private _config?;
14
- constructor(data: Linter.RuleData<Config>);
15
- get code(): RuleTypes.RuleMessageCode;
16
- get title(): string;
17
- get severity(): Linter.Severity;
18
- get config(): Config | undefined;
19
- get category(): "compile" | "bundle" | RuleTypes.RuleMessageCategory | "emo";
20
- setOption(opt: Linter.RuleConfigItem): void;
21
- match(level: Linter.Severity): boolean;
22
- validate(context: SDK.RuntimeContext): Promise<Linter.ValidateResult>;
23
- afterValidate({ hooks, validateResult, data, }: LinterType.InternalRuleCheckerContextForCheckEnd<Config>): Promise<void>;
24
- }
25
- export declare function defineRule<Title extends Linter.DefaultRuleTitle, T = Linter.DefaultRuleConfig>(ruleCreator: Linter.ExtendRuleConstructor<Title, T>): Linter.ExtendRuleData<T, Title>;
26
- export declare function defineRule<Title extends Linter.DefaultRuleTitle, T = Linter.DefaultRuleConfig>(ruleCreator: Linter.RuleConstructor<Title, T>): Linter.RuleData<T, Title>;
27
- export {};
@@ -1,101 +0,0 @@
1
- import "node:module";
2
- import { Linter, Rule } from "@rsdoctor/types";
3
- import { Lodash } from "@rsdoctor/utils/common";
4
- import { noop, toSeverity } from "./utils.js";
5
- class rule_Rule {
6
- static from(data) {
7
- return new rule_Rule({
8
- check: data.check,
9
- onCheckEnd: data.onCheckEnd,
10
- meta: {
11
- ...data.meta,
12
- code: Rule.RuleMessageCodeEnumerated.Extend,
13
- severity: toSeverity(data.meta.severity, Linter.Severity.Warn)
14
- }
15
- });
16
- }
17
- get code() {
18
- return this.meta.code;
19
- }
20
- get title() {
21
- return this.meta.title;
22
- }
23
- get severity() {
24
- return this._severity;
25
- }
26
- get config() {
27
- return this._config;
28
- }
29
- get category() {
30
- return this.meta.category;
31
- }
32
- setOption(opt) {
33
- let severity;
34
- let config;
35
- if (Array.isArray(opt)) {
36
- severity = toSeverity(opt[0], this.meta.severity);
37
- config = opt[1];
38
- } else {
39
- severity = toSeverity(opt, this.meta.severity);
40
- config = void 0;
41
- }
42
- this._severity = severity;
43
- this._config = Lodash.isPlainObject(config) ? {
44
- ...this.meta.defaultConfig,
45
- ...config
46
- } : config || this.meta.defaultConfig;
47
- }
48
- match(level) {
49
- if (level === Linter.Severity.Ignore || this.severity === Linter.Severity.Ignore) return false;
50
- if (level === Linter.Severity.Error) return this.severity === Linter.Severity.Error || this.severity === Linter.Severity.Warn;
51
- if (level === Linter.Severity.Warn) return this.severity === Linter.Severity.Warn;
52
- return false;
53
- }
54
- async validate(context) {
55
- const errors = [];
56
- const replace = [];
57
- const report = (data, remove)=>{
58
- if (remove) replace.push(remove);
59
- const severity = data.severity ? toSeverity(data.severity, this.severity) : this.severity;
60
- const error = {
61
- ...data,
62
- code: this.code,
63
- severity,
64
- category: this.category,
65
- title: this.title.toUpperCase()
66
- };
67
- if (severity !== Linter.Severity.Ignore) errors.push(error);
68
- };
69
- await this.check({
70
- ...context,
71
- ruleConfig: this.config,
72
- report
73
- });
74
- return {
75
- errors,
76
- replace
77
- };
78
- }
79
- async afterValidate({ hooks, validateResult, data }) {
80
- if (this.onCheckEnd === noop) return;
81
- await this.onCheckEnd({
82
- data: {
83
- ...data,
84
- ruleConfig: this.config
85
- },
86
- hooks,
87
- validateResult
88
- });
89
- }
90
- constructor(data){
91
- this.check = data.check;
92
- this.meta = data.meta;
93
- this.onCheckEnd = 'function' == typeof data.onCheckEnd ? data.onCheckEnd : noop;
94
- this._severity = this.meta.severity;
95
- this._config = this.meta.defaultConfig;
96
- }
97
- }
98
- function defineRule(ruleCreator) {
99
- return ruleCreator();
100
- }
101
- export { defineRule, rule_Rule as Rule };
@@ -1,83 +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
- rule: ()=>rule
28
- });
29
- const types_namespaceObject = require("@rsdoctor/types");
30
- const external_rule_cjs_namespaceObject = require("../../rule.cjs");
31
- const title = 'cjs-require';
32
- const CJS_REQUIRE_TYPE = 'cjs require';
33
- const NODE_MODULES_PATH_REGEXP = /[/\\]node_modules[/\\]/;
34
- function isNodeModulesPath(modulePath) {
35
- return NODE_MODULES_PATH_REGEXP.test(modulePath);
36
- }
37
- const rule = (0, external_rule_cjs_namespaceObject.defineRule)(()=>({
38
- meta: {
39
- code: 'E1008',
40
- title,
41
- category: 'bundle',
42
- severity: types_namespaceObject.Linter.Severity.Warn,
43
- defaultConfig: {
44
- ignore: []
45
- }
46
- },
47
- check ({ moduleGraph, report, ruleConfig }) {
48
- const dependencies = moduleGraph.getDependencies();
49
- for (const dep of dependencies){
50
- if (dep.typeString !== CJS_REQUIRE_TYPE) continue;
51
- const issuerPath = dep.module.path;
52
- if (isNodeModulesPath(issuerPath)) continue;
53
- const requiredModule = dep.dependency;
54
- if (ruleConfig.ignore.some((pattern)=>issuerPath.includes(pattern) || requiredModule.path.includes(pattern))) continue;
55
- const detail = {
56
- type: title,
57
- issuerModule: {
58
- id: dep.module.id,
59
- path: dep.module.path,
60
- identifier: dep.module.identifier
61
- },
62
- requiredModule: {
63
- id: requiredModule.id,
64
- path: requiredModule.path,
65
- identifier: requiredModule.identifier
66
- },
67
- request: dep.request
68
- };
69
- const message = `"${issuerPath}" uses \`require('${dep.request}')\` (CJS require) which prevents tree-shaking of the entire module "${requiredModule.path}". Consider using \`require('${dep.request}').property\` or ESM \`import\` instead.`;
70
- report({
71
- message,
72
- detail
73
- });
74
- }
75
- }
76
- }));
77
- exports.rule = __webpack_exports__.rule;
78
- for(var __rspack_i in __webpack_exports__)if (-1 === [
79
- "rule"
80
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
81
- Object.defineProperty(exports, '__esModule', {
82
- value: true
83
- });
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/types';
2
- import type { Config } from './types';
3
- export type { Config } from './types';
4
- export declare const rule: Linter.RuleData<Config, "cjs-require">;
@@ -1,50 +0,0 @@
1
- import "node:module";
2
- import { Linter } from "@rsdoctor/types";
3
- import { defineRule } from "../../rule.js";
4
- const title = 'cjs-require';
5
- const CJS_REQUIRE_TYPE = 'cjs require';
6
- const NODE_MODULES_PATH_REGEXP = /[/\\]node_modules[/\\]/;
7
- function isNodeModulesPath(modulePath) {
8
- return NODE_MODULES_PATH_REGEXP.test(modulePath);
9
- }
10
- const rule = defineRule(()=>({
11
- meta: {
12
- code: 'E1008',
13
- title: title,
14
- category: 'bundle',
15
- severity: Linter.Severity.Warn,
16
- defaultConfig: {
17
- ignore: []
18
- }
19
- },
20
- check ({ moduleGraph, report, ruleConfig }) {
21
- const dependencies = moduleGraph.getDependencies();
22
- for (const dep of dependencies){
23
- if (dep.typeString !== CJS_REQUIRE_TYPE) continue;
24
- const issuerPath = dep.module.path;
25
- if (isNodeModulesPath(issuerPath)) continue;
26
- const requiredModule = dep.dependency;
27
- if (ruleConfig.ignore.some((pattern)=>issuerPath.includes(pattern) || requiredModule.path.includes(pattern))) continue;
28
- const detail = {
29
- type: title,
30
- issuerModule: {
31
- id: dep.module.id,
32
- path: dep.module.path,
33
- identifier: dep.module.identifier
34
- },
35
- requiredModule: {
36
- id: requiredModule.id,
37
- path: requiredModule.path,
38
- identifier: requiredModule.identifier
39
- },
40
- request: dep.request
41
- };
42
- const message = `"${issuerPath}" uses \`require('${dep.request}')\` (CJS require) which prevents tree-shaking of the entire module "${requiredModule.path}". Consider using \`require('${dep.request}').property\` or ESM \`import\` instead.`;
43
- report({
44
- message,
45
- detail
46
- });
47
- }
48
- }
49
- }));
50
- export { rule };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.r = (exports1)=>{
5
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
- value: 'Module'
7
- });
8
- Object.defineProperty(exports1, '__esModule', {
9
- value: true
10
- });
11
- };
12
- })();
13
- var __webpack_exports__ = {};
14
- __webpack_require__.r(__webpack_exports__);
15
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
- Object.defineProperty(exports, '__esModule', {
17
- value: true
18
- });
@@ -1,7 +0,0 @@
1
- export interface Config {
2
- /**
3
- * Module path patterns to ignore (applied to both issuer and required module paths).
4
- * Defaults to [].
5
- */
6
- ignore: string[];
7
- }
@@ -1 +0,0 @@
1
- import "node:module";
@@ -1,74 +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
- rule: ()=>rule
28
- });
29
- const types_namespaceObject = require("@rsdoctor/types");
30
- const external_rule_cjs_namespaceObject = require("../../rule.cjs");
31
- const external_utils_cjs_namespaceObject = require("./utils.cjs");
32
- const compat_namespaceObject = require("es-toolkit/compat");
33
- const title = 'cross-chunks-package';
34
- const rule = (0, external_rule_cjs_namespaceObject.defineRule)(()=>({
35
- meta: {
36
- code: 'E1002',
37
- title,
38
- category: 'bundle',
39
- severity: types_namespaceObject.Linter.Severity.Warn,
40
- defaultConfig: {
41
- ignore: []
42
- }
43
- },
44
- check ({ packageGraph, report }) {
45
- const packages = packageGraph.getPackages().filter((pkg)=>(pkg.duplicates?.length ?? 0) > 0);
46
- for (const pkg of packages){
47
- const duplicates = pkg.duplicates;
48
- const detail = {
49
- type: title,
50
- chunks: duplicates,
51
- package: {
52
- name: pkg.name,
53
- id: pkg.id,
54
- size: pkg.getSize(),
55
- version: pkg.version
56
- }
57
- };
58
- const chunks = [];
59
- duplicates.forEach((dup)=>chunks.push(...dup.chunks.map((ck)=>ck.name)));
60
- const message = (0, external_utils_cjs_namespaceObject.getErrorMsgForDupPckChunks)((0, compat_namespaceObject.uniq)(chunks), pkg.name);
61
- report({
62
- message,
63
- detail
64
- });
65
- }
66
- }
67
- }));
68
- exports.rule = __webpack_exports__.rule;
69
- for(var __rspack_i in __webpack_exports__)if (-1 === [
70
- "rule"
71
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
72
- Object.defineProperty(exports, '__esModule', {
73
- value: true
74
- });
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/types';
2
- import { Config } from './types';
3
- export type { Config } from './types';
4
- export declare const rule: Linter.RuleData<Config, "cross-chunks-package">;
@@ -1,41 +0,0 @@
1
- import "node:module";
2
- import { Linter } from "@rsdoctor/types";
3
- import { defineRule } from "../../rule.js";
4
- import { getErrorMsgForDupPckChunks } from "./utils.js";
5
- import { uniq } from "es-toolkit/compat";
6
- const title = 'cross-chunks-package';
7
- const rule = defineRule(()=>({
8
- meta: {
9
- code: 'E1002',
10
- title: title,
11
- category: 'bundle',
12
- severity: Linter.Severity.Warn,
13
- defaultConfig: {
14
- ignore: []
15
- }
16
- },
17
- check ({ packageGraph, report }) {
18
- const packages = packageGraph.getPackages().filter((pkg)=>(pkg.duplicates?.length ?? 0) > 0);
19
- for (const pkg of packages){
20
- const duplicates = pkg.duplicates;
21
- const detail = {
22
- type: title,
23
- chunks: duplicates,
24
- package: {
25
- name: pkg.name,
26
- id: pkg.id,
27
- size: pkg.getSize(),
28
- version: pkg.version
29
- }
30
- };
31
- const chunks = [];
32
- duplicates.forEach((dup)=>chunks.push(...dup.chunks.map((ck)=>ck.name)));
33
- const message = getErrorMsgForDupPckChunks(uniq(chunks), pkg.name);
34
- report({
35
- message,
36
- detail
37
- });
38
- }
39
- }
40
- }));
41
- export { rule };