fork-ts-checker-webpack-plugin 7.0.0-alpha.1 → 7.0.0-alpha.13

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 (319) hide show
  1. package/README.md +20 -85
  2. package/lib/files-change.d.ts +17 -0
  3. package/lib/files-change.js +47 -0
  4. package/lib/files-match.d.ts +7 -0
  5. package/lib/{ForkTsCheckerWebpackPluginOptions.js → files-match.js} +0 -0
  6. package/lib/formatter/{BasicFormatter.d.ts → basic-formatter.d.ts} +1 -1
  7. package/lib/formatter/{BasicFormatter.js → basic-formatter.js} +1 -0
  8. package/lib/formatter/{CodeFrameFormatter.d.ts → code-frame-formatter.d.ts} +1 -1
  9. package/lib/formatter/{CodeFrameFormatter.js → code-frame-formatter.js} +4 -3
  10. package/lib/formatter/formatter-config.d.ts +5 -0
  11. package/lib/formatter/formatter-config.js +26 -0
  12. package/lib/formatter/formatter-options.d.ts +12 -0
  13. package/lib/{eslint-reporter/EsLintReporterOptions.js → formatter/formatter-options.js} +0 -0
  14. package/lib/formatter/{Formatter.d.ts → formatter.d.ts} +1 -1
  15. package/lib/{eslint-reporter/types/eslint.js → formatter/formatter.js} +0 -0
  16. package/lib/formatter/index.d.ts +6 -7
  17. package/lib/formatter/index.js +16 -8
  18. package/lib/formatter/types/babel__code-frame.js +1 -1
  19. package/lib/formatter/{WebpackFormatter.d.ts → webpack-formatter.d.ts} +1 -1
  20. package/lib/formatter/{WebpackFormatter.js → webpack-formatter.js} +6 -6
  21. package/lib/hooks/intercept-done-to-get-dev-server-tap.d.ts +5 -0
  22. package/lib/hooks/intercept-done-to-get-dev-server-tap.js +18 -0
  23. package/lib/hooks/tap-after-compile-to-add-dependencies.d.ts +5 -0
  24. package/lib/hooks/{tapAfterCompileToAddDependencies.js → tap-after-compile-to-add-dependencies.js} +5 -1
  25. package/lib/hooks/tap-after-compile-to-get-issues.d.ts +5 -0
  26. package/lib/hooks/{tapAfterCompileToGetIssues.js → tap-after-compile-to-get-issues.js} +10 -6
  27. package/lib/hooks/{tapAfterEnvironmentToPatchWatching.d.ts → tap-after-environment-to-patch-watching.d.ts} +2 -2
  28. package/lib/hooks/tap-after-environment-to-patch-watching.js +22 -0
  29. package/lib/hooks/tap-done-to-async-get-issues.d.ts +5 -0
  30. package/lib/hooks/{tapDoneToAsyncGetIssues.js → tap-done-to-async-get-issues.js} +21 -21
  31. package/lib/hooks/tap-error-to-log-message.d.ts +4 -0
  32. package/lib/hooks/{tapErrorToLogMessage.js → tap-error-to-log-message.js} +10 -9
  33. package/lib/hooks/tap-start-to-run-workers.d.ts +8 -0
  34. package/lib/hooks/tap-start-to-run-workers.js +95 -0
  35. package/lib/hooks/tap-stop-to-terminate-workers.d.ts +5 -0
  36. package/lib/hooks/tap-stop-to-terminate-workers.js +26 -0
  37. package/lib/index.d.ts +1 -1
  38. package/lib/index.js +2 -2
  39. package/lib/infrastructure-logger.d.ts +9 -0
  40. package/lib/infrastructure-logger.js +15 -0
  41. package/lib/issue/index.d.ts +3 -3
  42. package/lib/issue/index.js +13 -6
  43. package/lib/issue/issue-config.d.ts +8 -0
  44. package/lib/issue/{IssueConfiguration.js → issue-config.js} +9 -8
  45. package/lib/issue/{IssueLocation.d.ts → issue-location.d.ts} +2 -2
  46. package/lib/issue/issue-location.js +36 -0
  47. package/lib/issue/issue-match.d.ts +5 -0
  48. package/lib/issue/{IssueMatch.js → issue-match.js} +5 -5
  49. package/lib/issue/{IssueOptions.d.ts → issue-options.d.ts} +2 -2
  50. package/lib/{formatter/Formatter.js → issue/issue-options.js} +0 -0
  51. package/lib/issue/{IssuePosition.d.ts → issue-position.d.ts} +0 -0
  52. package/lib/issue/{IssuePosition.js → issue-position.js} +1 -0
  53. package/lib/issue/{IssuePredicate.d.ts → issue-predicate.d.ts} +1 -1
  54. package/lib/issue/{IssuePredicate.js → issue-predicate.js} +1 -0
  55. package/lib/issue/{IssueSeverity.d.ts → issue-severity.d.ts} +0 -0
  56. package/lib/issue/{IssueSeverity.js → issue-severity.js} +1 -0
  57. package/lib/issue/{IssueWebpackError.d.ts → issue-webpack-error.d.ts} +3 -3
  58. package/lib/issue/{IssueWebpackError.js → issue-webpack-error.js} +8 -6
  59. package/lib/issue/{Issue.d.ts → issue.d.ts} +2 -3
  60. package/lib/issue/{Issue.js → issue.js} +6 -7
  61. package/lib/{logger/Logger.d.ts → logger.d.ts} +1 -2
  62. package/lib/{formatter/FormatterOptions.js → logger.js} +0 -0
  63. package/lib/plugin-config.d.ts +16 -0
  64. package/lib/plugin-config.js +17 -0
  65. package/lib/plugin-hooks.d.ts +20 -0
  66. package/lib/{hooks/pluginHooks.js → plugin-hooks.js} +8 -7
  67. package/lib/plugin-options.d.ts +13 -0
  68. package/lib/{issue/IssueOptions.js → plugin-options.js} +0 -0
  69. package/lib/plugin-options.json +223 -0
  70. package/lib/plugin-pools.d.ts +4 -0
  71. package/lib/plugin-pools.js +28 -0
  72. package/lib/plugin-state.d.ts +14 -0
  73. package/lib/{ForkTsCheckerWebpackPluginState.js → plugin-state.js} +4 -3
  74. package/lib/plugin.d.ts +28 -0
  75. package/lib/plugin.js +82 -0
  76. package/lib/rpc/expose-rpc.d.ts +1 -0
  77. package/lib/rpc/expose-rpc.js +78 -0
  78. package/lib/rpc/index.d.ts +5 -7
  79. package/lib/rpc/index.js +10 -7
  80. package/lib/rpc/{rpc-ipc/error/RpcIpcMessagePortClosedError.d.ts → rpc-error.d.ts} +2 -3
  81. package/lib/rpc/rpc-error.js +12 -0
  82. package/lib/rpc/rpc-worker.d.ts +13 -0
  83. package/lib/rpc/rpc-worker.js +79 -0
  84. package/lib/rpc/types.d.ts +19 -0
  85. package/lib/{logger/Logger.js → rpc/types.js} +0 -0
  86. package/lib/rpc/wrap-rpc.d.ts +4 -0
  87. package/lib/rpc/wrap-rpc.js +96 -0
  88. package/lib/{typescript-reporter/extension/TypeScriptEmbeddedExtension.d.ts → typescript/extension/type-script-embedded-extension.d.ts} +1 -1
  89. package/lib/{typescript-reporter/extension/TypeScriptEmbeddedExtension.js → typescript/extension/type-script-embedded-extension.js} +2 -1
  90. package/lib/{typescript-reporter/extension/TypeScriptExtension.d.ts → typescript/extension/type-script-extension.d.ts} +4 -4
  91. package/lib/{logger/LoggerOptions.js → typescript/extension/type-script-extension.js} +0 -0
  92. package/lib/typescript/extension/vue/type-script-vue-extension-config.d.ts +7 -0
  93. package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.js → typescript/extension/vue/type-script-vue-extension-config.js} +3 -2
  94. package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtensionOptions.d.ts → typescript/extension/vue/type-script-vue-extension-options.d.ts} +0 -0
  95. package/lib/{reporter/Dependencies.js → typescript/extension/vue/type-script-vue-extension-options.js} +0 -0
  96. package/lib/typescript/extension/vue/type-script-vue-extension-support.d.ts +3 -0
  97. package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.js → typescript/extension/vue/type-script-vue-extension-support.js} +3 -2
  98. package/lib/typescript/extension/vue/type-script-vue-extension.d.ts +4 -0
  99. package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtension.js → typescript/extension/vue/type-script-vue-extension.js} +5 -4
  100. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.d.ts +0 -0
  101. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.js +0 -0
  102. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue__compiler-sfc.d.ts +0 -0
  103. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue__compiler-sfc.js +0 -0
  104. package/lib/{typescript-reporter/TypeScriptConfigurationOverwrite.d.ts → typescript/type-script-config-overwrite.d.ts} +3 -3
  105. package/lib/{reporter/Report.js → typescript/type-script-config-overwrite.js} +0 -0
  106. package/lib/{typescript-reporter/TypeScriptDiagnosticsOptions.d.ts → typescript/type-script-diagnostics-options.d.ts} +0 -0
  107. package/lib/{reporter/Reporter.js → typescript/type-script-diagnostics-options.js} +0 -0
  108. package/lib/typescript/type-script-support.d.ts +3 -0
  109. package/lib/typescript/type-script-support.js +67 -0
  110. package/lib/typescript/type-script-worker-config.d.ts +22 -0
  111. package/lib/{typescript-reporter/TypeScriptReporterConfiguration.js → typescript/type-script-worker-config.js} +6 -4
  112. package/lib/typescript/type-script-worker-options.d.ts +18 -0
  113. package/lib/{rpc/RpcHost.js → typescript/type-script-worker-options.js} +0 -0
  114. package/lib/typescript/worker/get-dependencies-worker.d.ts +5 -0
  115. package/lib/typescript/worker/get-dependencies-worker.js +18 -0
  116. package/lib/typescript/worker/get-issues-worker.d.ts +5 -0
  117. package/lib/typescript/worker/get-issues-worker.js +76 -0
  118. package/lib/typescript/worker/lib/artifacts.d.ts +4 -0
  119. package/lib/typescript/worker/lib/artifacts.js +90 -0
  120. package/lib/typescript/worker/lib/config.d.ts +14 -0
  121. package/lib/typescript/worker/lib/config.js +111 -0
  122. package/lib/typescript/worker/lib/dependencies.d.ts +3 -0
  123. package/lib/typescript/worker/lib/dependencies.js +87 -0
  124. package/lib/typescript/worker/lib/diagnostics.d.ts +7 -0
  125. package/lib/typescript/worker/lib/diagnostics.js +100 -0
  126. package/lib/typescript/worker/lib/extensions.d.ts +3 -0
  127. package/lib/typescript/worker/lib/extensions.js +11 -0
  128. package/lib/{typescript-reporter/file-system/FileSystem.d.ts → typescript/worker/lib/file-system/file-system.d.ts} +2 -3
  129. package/lib/{rpc/RpcMessagePort.js → typescript/worker/lib/file-system/file-system.js} +0 -0
  130. package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +5 -0
  131. package/lib/typescript/worker/lib/file-system/mem-file-system.js +78 -0
  132. package/lib/typescript/worker/lib/file-system/passive-file-system.d.ts +5 -0
  133. package/lib/typescript/worker/lib/file-system/passive-file-system.js +65 -0
  134. package/lib/typescript/worker/lib/file-system/real-file-system.d.ts +5 -0
  135. package/lib/typescript/worker/lib/file-system/real-file-system.js +187 -0
  136. package/lib/typescript/worker/lib/host/compiler-host.d.ts +2 -0
  137. package/lib/typescript/worker/lib/host/compiler-host.js +17 -0
  138. package/lib/typescript/worker/lib/host/watch-compiler-host.d.ts +2 -0
  139. package/lib/typescript/worker/lib/host/watch-compiler-host.js +32 -0
  140. package/lib/typescript/worker/lib/host/watch-solution-builder-host.d.ts +2 -0
  141. package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +54 -0
  142. package/lib/typescript/worker/lib/performance.d.ts +3 -0
  143. package/lib/typescript/worker/lib/performance.js +32 -0
  144. package/lib/typescript/worker/lib/program/program.d.ts +2 -0
  145. package/lib/typescript/worker/lib/program/program.js +32 -0
  146. package/lib/typescript/worker/lib/program/solution-builder.d.ts +2 -0
  147. package/lib/typescript/worker/lib/program/solution-builder.js +39 -0
  148. package/lib/typescript/worker/lib/program/watch-program.d.ts +3 -0
  149. package/lib/typescript/worker/lib/program/watch-program.js +49 -0
  150. package/lib/{typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts → typescript/worker/lib/system.d.ts} +6 -6
  151. package/lib/typescript/worker/lib/system.js +206 -0
  152. package/lib/typescript/worker/lib/tracing.d.ts +4 -0
  153. package/lib/typescript/worker/lib/tracing.js +28 -0
  154. package/lib/typescript/worker/lib/tsbuildinfo.d.ts +4 -0
  155. package/lib/typescript/worker/lib/tsbuildinfo.js +92 -0
  156. package/lib/typescript/worker/lib/typescript.d.ts +2 -0
  157. package/lib/typescript/worker/lib/typescript.js +6 -0
  158. package/lib/typescript/worker/lib/worker-config.d.ts +2 -0
  159. package/lib/typescript/worker/lib/worker-config.js +5 -0
  160. package/lib/utils/async/{isPending.d.ts → is-pending.d.ts} +1 -1
  161. package/lib/utils/async/{isPending.js → is-pending.js} +2 -1
  162. package/lib/utils/async/pool.d.ts +2 -1
  163. package/lib/utils/async/pool.js +13 -14
  164. package/lib/utils/async/wait.d.ts +1 -1
  165. package/lib/utils/async/wait.js +2 -1
  166. package/lib/utils/path/{forwardSlash.d.ts → forward-slash.d.ts} +1 -1
  167. package/lib/utils/path/{forwardSlash.js → forward-slash.js} +2 -1
  168. package/lib/utils/path/relative-to-context.d.ts +2 -0
  169. package/lib/utils/path/relative-to-context.js +16 -0
  170. package/lib/watch/inclusive-node-watch-file-system.d.ts +15 -0
  171. package/lib/watch/inclusive-node-watch-file-system.js +165 -0
  172. package/lib/watch/watch-file-system.d.ts +16 -0
  173. package/lib/{rpc/RpcProcedure.js → watch/watch-file-system.js} +0 -0
  174. package/package.json +52 -54
  175. package/CHANGELOG.md +0 -318
  176. package/changelog.config.js +0 -36
  177. package/lib/ForkTsCheckerWebpackPlugin.d.ts +0 -24
  178. package/lib/ForkTsCheckerWebpackPlugin.js +0 -72
  179. package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +0 -17
  180. package/lib/ForkTsCheckerWebpackPluginConfiguration.js +0 -18
  181. package/lib/ForkTsCheckerWebpackPluginOptions.d.ts +0 -14
  182. package/lib/ForkTsCheckerWebpackPluginOptions.json +0 -297
  183. package/lib/ForkTsCheckerWebpackPluginState.d.ts +0 -14
  184. package/lib/error/OperationCanceledError.d.ts +0 -4
  185. package/lib/error/OperationCanceledError.js +0 -9
  186. package/lib/eslint-reporter/EsLintReporterConfiguration.d.ts +0 -11
  187. package/lib/eslint-reporter/EsLintReporterConfiguration.js +0 -26
  188. package/lib/eslint-reporter/EsLintReporterOptions.d.ts +0 -8
  189. package/lib/eslint-reporter/assertEsLintSupport.d.ts +0 -3
  190. package/lib/eslint-reporter/assertEsLintSupport.js +0 -30
  191. package/lib/eslint-reporter/issue/EsLintIssueFactory.d.ts +0 -4
  192. package/lib/eslint-reporter/issue/EsLintIssueFactory.js +0 -32
  193. package/lib/eslint-reporter/reporter/EsLintReporter.d.ts +0 -4
  194. package/lib/eslint-reporter/reporter/EsLintReporter.js +0 -85
  195. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.d.ts +0 -4
  196. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.js +0 -13
  197. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.d.ts +0 -1
  198. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.js +0 -11
  199. package/lib/eslint-reporter/types/eslint.d.ts +0 -31
  200. package/lib/formatter/FormatterConfiguration.d.ts +0 -5
  201. package/lib/formatter/FormatterConfiguration.js +0 -7
  202. package/lib/formatter/FormatterFactory.d.ts +0 -13
  203. package/lib/formatter/FormatterFactory.js +0 -17
  204. package/lib/formatter/FormatterOptions.d.ts +0 -7
  205. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +0 -5
  206. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.js +0 -16
  207. package/lib/hooks/pluginHooks.d.ts +0 -20
  208. package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +0 -5
  209. package/lib/hooks/tapAfterCompileToGetIssues.d.ts +0 -5
  210. package/lib/hooks/tapAfterEnvironmentToPatchWatching.js +0 -13
  211. package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +0 -5
  212. package/lib/hooks/tapErrorToLogMessage.d.ts +0 -4
  213. package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +0 -6
  214. package/lib/hooks/tapStartToConnectAndRunReporter.js +0 -105
  215. package/lib/hooks/tapStopToDisconnectReporter.d.ts +0 -5
  216. package/lib/hooks/tapStopToDisconnectReporter.js +0 -27
  217. package/lib/issue/IssueConfiguration.d.ts +0 -8
  218. package/lib/issue/IssueLocation.js +0 -21
  219. package/lib/issue/IssueMatch.d.ts +0 -5
  220. package/lib/logger/LoggerConfiguration.d.ts +0 -10
  221. package/lib/logger/LoggerConfiguration.js +0 -11
  222. package/lib/logger/LoggerFactory.d.ts +0 -5
  223. package/lib/logger/LoggerFactory.js +0 -20
  224. package/lib/logger/LoggerOptions.d.ts +0 -8
  225. package/lib/logger/PartialLogger.d.ts +0 -4
  226. package/lib/logger/PartialLogger.js +0 -10
  227. package/lib/logger/WebpackInfrastructureLogger.d.ts +0 -4
  228. package/lib/logger/WebpackInfrastructureLogger.js +0 -12
  229. package/lib/profile/Performance.d.ts +0 -11
  230. package/lib/profile/Performance.js +0 -62
  231. package/lib/reporter/AggregatedReporter.d.ts +0 -6
  232. package/lib/reporter/AggregatedReporter.js +0 -60
  233. package/lib/reporter/Dependencies.d.ts +0 -6
  234. package/lib/reporter/FilesChange.d.ts +0 -16
  235. package/lib/reporter/FilesChange.js +0 -39
  236. package/lib/reporter/Report.d.ts +0 -8
  237. package/lib/reporter/Reporter.d.ts +0 -6
  238. package/lib/reporter/index.d.ts +0 -7
  239. package/lib/reporter/index.js +0 -9
  240. package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +0 -10
  241. package/lib/reporter/reporter-rpc/ReporterRpcClient.js +0 -72
  242. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +0 -13
  243. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +0 -12
  244. package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +0 -9
  245. package/lib/reporter/reporter-rpc/ReporterRpcService.js +0 -74
  246. package/lib/rpc/RpcClient.d.ts +0 -10
  247. package/lib/rpc/RpcClient.js +0 -78
  248. package/lib/rpc/RpcHost.d.ts +0 -6
  249. package/lib/rpc/RpcMessage.d.ts +0 -26
  250. package/lib/rpc/RpcMessage.js +0 -45
  251. package/lib/rpc/RpcMessageChannel.d.ts +0 -10
  252. package/lib/rpc/RpcMessageChannel.js +0 -49
  253. package/lib/rpc/RpcMessagePort.d.ts +0 -14
  254. package/lib/rpc/RpcProcedure.d.ts +0 -5
  255. package/lib/rpc/RpcService.d.ts +0 -12
  256. package/lib/rpc/RpcService.js +0 -63
  257. package/lib/rpc/error/RpcMessagePortClosedError.d.ts +0 -3
  258. package/lib/rpc/error/RpcMessagePortClosedError.js +0 -5
  259. package/lib/rpc/error/RpcRemoteError.d.ts +0 -6
  260. package/lib/rpc/error/RpcRemoteError.js +0 -17
  261. package/lib/rpc/rpc-ipc/ProcessLike.d.ts +0 -12
  262. package/lib/rpc/rpc-ipc/ProcessLike.js +0 -3
  263. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.d.ts +0 -3
  264. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.js +0 -10
  265. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +0 -5
  266. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +0 -150
  267. package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +0 -12
  268. package/lib/rpc/rpc-ipc/index.d.ts +0 -2
  269. package/lib/rpc/rpc-ipc/index.js +0 -7
  270. package/lib/typescript-reporter/TypeScriptConfigurationOverwrite.js +0 -2
  271. package/lib/typescript-reporter/TypeScriptDiagnosticsOptions.js +0 -2
  272. package/lib/typescript-reporter/TypeScriptReporterConfiguration.d.ts +0 -22
  273. package/lib/typescript-reporter/TypeScriptReporterOptions.d.ts +0 -19
  274. package/lib/typescript-reporter/TypeScriptReporterOptions.js +0 -2
  275. package/lib/typescript-reporter/TypeScriptSupport.d.ts +0 -3
  276. package/lib/typescript-reporter/TypeScriptSupport.js +0 -52
  277. package/lib/typescript-reporter/extension/TypeScriptExtension.js +0 -2
  278. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +0 -4
  279. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +0 -7
  280. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionOptions.js +0 -2
  281. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.d.ts +0 -3
  282. package/lib/typescript-reporter/file-system/FileSystem.js +0 -2
  283. package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +0 -9
  284. package/lib/typescript-reporter/file-system/PassiveFileSystem.js +0 -130
  285. package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +0 -8
  286. package/lib/typescript-reporter/file-system/RealFileSystem.js +0 -179
  287. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +0 -4
  288. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +0 -45
  289. package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +0 -10
  290. package/lib/typescript-reporter/profile/TypeScriptPerformance.js +0 -33
  291. package/lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts +0 -5
  292. package/lib/typescript-reporter/reporter/ControlledCompilerHost.js +0 -13
  293. package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +0 -183
  294. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +0 -5
  295. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +0 -28
  296. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +0 -5
  297. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +0 -58
  298. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +0 -6
  299. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +0 -47
  300. package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +0 -4
  301. package/lib/typescript-reporter/reporter/TypeScriptReporter.js +0 -368
  302. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +0 -4
  303. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +0 -13
  304. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.d.ts +0 -1
  305. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +0 -11
  306. package/lib/utils/array/flatten.d.ts +0 -2
  307. package/lib/utils/array/flatten.js +0 -6
  308. package/lib/utils/array/intersect.d.ts +0 -2
  309. package/lib/utils/array/intersect.js +0 -6
  310. package/lib/utils/array/substract.d.ts +0 -2
  311. package/lib/utils/array/substract.js +0 -6
  312. package/lib/utils/array/unique.d.ts +0 -2
  313. package/lib/utils/array/unique.js +0 -6
  314. package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
  315. package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
  316. package/lib/watch/InclusiveNodeWatchFileSystem.d.ts +0 -15
  317. package/lib/watch/InclusiveNodeWatchFileSystem.js +0 -112
  318. package/lib/watch/WatchFileSystem.d.ts +0 -33
  319. package/lib/watch/WatchFileSystem.js +0 -2
@@ -12,32 +12,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.tapDoneToAsyncGetIssues = void 0;
15
16
  const chalk_1 = __importDefault(require("chalk"));
16
- const pluginHooks_1 = require("./pluginHooks");
17
- const WebpackFormatter_1 = require("../formatter/WebpackFormatter");
18
- const IssueWebpackError_1 = require("../issue/IssueWebpackError");
19
- const isPending_1 = __importDefault(require("../utils/async/isPending"));
20
- const wait_1 = __importDefault(require("../utils/async/wait"));
21
- function tapDoneToAsyncGetIssues(compiler, configuration, state) {
22
- const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
17
+ const webpack_formatter_1 = require("../formatter/webpack-formatter");
18
+ const infrastructure_logger_1 = require("../infrastructure-logger");
19
+ const issue_webpack_error_1 = require("../issue/issue-webpack-error");
20
+ const plugin_hooks_1 = require("../plugin-hooks");
21
+ const is_pending_1 = require("../utils/async/is-pending");
22
+ const wait_1 = require("../utils/async/wait");
23
+ function tapDoneToAsyncGetIssues(compiler, config, state) {
24
+ const hooks = plugin_hooks_1.getPluginHooks(compiler);
25
+ const { log, debug } = infrastructure_logger_1.getInfrastructureLogger(compiler);
23
26
  compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', (stats) => __awaiter(this, void 0, void 0, function* () {
24
27
  if (stats.compilation.compiler !== compiler) {
25
28
  // run only for the compiler that the plugin was registered for
26
29
  return;
27
30
  }
28
- const reportPromise = state.reportPromise;
29
31
  const issuesPromise = state.issuesPromise;
30
32
  let issues;
31
33
  try {
32
- if (yield isPending_1.default(issuesPromise)) {
34
+ if (yield is_pending_1.isPending(issuesPromise)) {
33
35
  hooks.waiting.call(stats.compilation);
34
- configuration.logger.issues.log(chalk_1.default.blue('Issues checking in progress...'));
36
+ config.logger.log(chalk_1.default.cyan('Issues checking in progress...'));
35
37
  }
36
38
  else {
37
39
  // wait 10ms to log issues after webpack stats
38
- yield wait_1.default(10);
40
+ yield wait_1.wait(10);
39
41
  }
40
42
  issues = yield issuesPromise;
43
+ debug('Got issues from getIssuesWorker.', issues === null || issues === void 0 ? void 0 : issues.length);
41
44
  }
42
45
  catch (error) {
43
46
  hooks.error.call(error, stats.compilation);
@@ -47,27 +50,23 @@ function tapDoneToAsyncGetIssues(compiler, configuration, state) {
47
50
  // some error has been thrown or it was canceled
48
51
  return;
49
52
  }
50
- if (reportPromise !== state.reportPromise) {
51
- // there is a newer report - ignore this one
52
- return;
53
- }
54
53
  // filter list of issues by provided issue predicate
55
- issues = issues.filter(configuration.issue.predicate);
54
+ issues = issues.filter(config.issue.predicate);
56
55
  // modify list of issues in the plugin hooks
57
56
  issues = hooks.issues.call(issues, stats.compilation);
58
- const formatter = WebpackFormatter_1.createWebpackFormatter(configuration.formatter);
57
+ const formatter = webpack_formatter_1.createWebpackFormatter(config.formatter);
59
58
  if (issues.length) {
60
59
  // follow webpack's approach - one process.write to stderr with all errors and warnings
61
- configuration.logger.issues.error(issues.map((issue) => formatter(issue)).join('\n'));
60
+ config.logger.error(issues.map((issue) => formatter(issue)).join('\n'));
62
61
  }
63
62
  else {
64
- configuration.logger.issues.log(chalk_1.default.green('No issues found.'));
63
+ config.logger.log(chalk_1.default.green('No issues found.'));
65
64
  }
66
65
  // report issues to webpack-dev-server, if it's listening
67
66
  // skip reporting if there are no issues, to avoid an extra hot reload
68
67
  if (issues.length && state.webpackDevServerDoneTap) {
69
68
  issues.forEach((issue) => {
70
- const error = new IssueWebpackError_1.IssueWebpackError(configuration.formatter(issue), issue);
69
+ const error = new issue_webpack_error_1.IssueWebpackError(config.formatter(issue), issue);
71
70
  if (issue.severity === 'warning') {
72
71
  stats.compilation.warnings.push(error);
73
72
  }
@@ -75,10 +74,11 @@ function tapDoneToAsyncGetIssues(compiler, configuration, state) {
75
74
  stats.compilation.errors.push(error);
76
75
  }
77
76
  });
77
+ debug('Sending issues to the webpack-dev-server.');
78
78
  state.webpackDevServerDoneTap.fn(stats);
79
79
  }
80
80
  if (stats.startTime) {
81
- configuration.logger.infrastructure.info(`Time: ${Math.round(Date.now() - stats.startTime).toString()} ms`);
81
+ log(`Time: ${Math.round(Date.now() - stats.startTime).toString()} ms`);
82
82
  }
83
83
  }));
84
84
  }
@@ -0,0 +1,4 @@
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
+ declare function tapErrorToLogMessage(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig): void;
4
+ export { tapErrorToLogMessage };
@@ -3,23 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const pluginHooks_1 = require("./pluginHooks");
7
- const RpcIpcMessagePortClosedError_1 = require("../rpc/rpc-ipc/error/RpcIpcMessagePortClosedError");
6
+ exports.tapErrorToLogMessage = void 0;
8
7
  const chalk_1 = __importDefault(require("chalk"));
9
- function tapErrorToLogMessage(compiler, configuration) {
10
- const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
8
+ const plugin_hooks_1 = require("../plugin-hooks");
9
+ const rpc_1 = require("../rpc");
10
+ function tapErrorToLogMessage(compiler, config) {
11
+ const hooks = plugin_hooks_1.getPluginHooks(compiler);
11
12
  hooks.error.tap('ForkTsCheckerWebpackPlugin', (error) => {
12
- configuration.logger.issues.error(String(error));
13
- if (error instanceof RpcIpcMessagePortClosedError_1.RpcIpcMessagePortClosedError) {
13
+ config.logger.error(String(error));
14
+ if (error instanceof rpc_1.RpcExitError) {
14
15
  if (error.signal === 'SIGINT') {
15
- configuration.logger.issues.error(chalk_1.default.red('Issues checking service interrupted - If running in a docker container, this may be caused ' +
16
+ config.logger.error(chalk_1.default.red('Issues checking service interrupted - If running in a docker container, this may be caused ' +
16
17
  "by the container running out of memory. If so, try increasing the container's memory limit " +
17
18
  'or lowering the `memoryLimit` value in the ForkTsCheckerWebpackPlugin configuration.'));
18
19
  }
19
20
  else {
20
- configuration.logger.issues.error(chalk_1.default.red('Issues checking service aborted - probably out of memory. ' +
21
+ config.logger.error(chalk_1.default.red('Issues checking service aborted - probably out of memory. ' +
21
22
  'Check the `memoryLimit` option in the ForkTsCheckerWebpackPlugin configuration.\n' +
22
- "If increasing the memory doesn't solve the issue, it's most probably a bug in the TypeScript or EsLint."));
23
+ "If increasing the memory doesn't solve the issue, it's most probably a bug in the TypeScript."));
23
24
  }
24
25
  }
25
26
  });
@@ -0,0 +1,8 @@
1
+ import type * as webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
+ import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
4
+ import type { RpcWorker } from '../rpc';
5
+ import type { GetDependenciesWorker } from '../typescript/worker/get-dependencies-worker';
6
+ import type { GetIssuesWorker } from '../typescript/worker/get-issues-worker';
7
+ declare function tapStartToRunWorkers(compiler: webpack.Compiler, getIssuesWorker: RpcWorker<GetIssuesWorker>, getDependenciesWorker: RpcWorker<GetDependenciesWorker>, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
8
+ export { tapStartToRunWorkers };
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.tapStartToRunWorkers = void 0;
13
+ const files_change_1 = require("../files-change");
14
+ const infrastructure_logger_1 = require("../infrastructure-logger");
15
+ const plugin_hooks_1 = require("../plugin-hooks");
16
+ const plugin_pools_1 = require("../plugin-pools");
17
+ const intercept_done_to_get_dev_server_tap_1 = require("./intercept-done-to-get-dev-server-tap");
18
+ const tap_after_compile_to_get_issues_1 = require("./tap-after-compile-to-get-issues");
19
+ const tap_done_to_async_get_issues_1 = require("./tap-done-to-async-get-issues");
20
+ function tapStartToRunWorkers(compiler, getIssuesWorker, getDependenciesWorker, config, state) {
21
+ const hooks = plugin_hooks_1.getPluginHooks(compiler);
22
+ const { log, debug } = infrastructure_logger_1.getInfrastructureLogger(compiler);
23
+ compiler.hooks.run.tap('ForkTsCheckerWebpackPlugin', () => {
24
+ if (!state.initialized) {
25
+ debug('Initializing plugin for single run (not async).');
26
+ state.initialized = true;
27
+ state.watching = false;
28
+ tap_after_compile_to_get_issues_1.tapAfterCompileToGetIssues(compiler, config, state);
29
+ }
30
+ });
31
+ compiler.hooks.watchRun.tap('ForkTsCheckerWebpackPlugin', () => __awaiter(this, void 0, void 0, function* () {
32
+ if (!state.initialized) {
33
+ state.initialized = true;
34
+ state.watching = true;
35
+ if (config.async) {
36
+ debug('Initializing plugin for watch run (async).');
37
+ tap_done_to_async_get_issues_1.tapDoneToAsyncGetIssues(compiler, config, state);
38
+ intercept_done_to_get_dev_server_tap_1.interceptDoneToGetDevServerTap(compiler, config, state);
39
+ }
40
+ else {
41
+ debug('Initializing plugin for watch run (not async).');
42
+ tap_after_compile_to_get_issues_1.tapAfterCompileToGetIssues(compiler, config, state);
43
+ }
44
+ }
45
+ }));
46
+ compiler.hooks.compilation.tap('ForkTsCheckerWebpackPlugin', (compilation) => __awaiter(this, void 0, void 0, function* () {
47
+ if (compilation.compiler !== compiler) {
48
+ // run only for the compiler that the plugin was registered for
49
+ return;
50
+ }
51
+ const iteration = ++state.iteration;
52
+ let change = {};
53
+ if (state.watching) {
54
+ change = files_change_1.consumeFilesChange(compiler);
55
+ log([
56
+ 'Calling reporter service for incremental check.',
57
+ ` Changed files: ${JSON.stringify(change.changedFiles)}`,
58
+ ` Deleted files: ${JSON.stringify(change.deletedFiles)}`,
59
+ ].join('\n'));
60
+ }
61
+ else {
62
+ log('Calling reporter service for single check.');
63
+ }
64
+ change = yield hooks.start.promise(change, compilation);
65
+ debug(`Submitting the getIssuesWorker to the pool, iteration ${iteration}.`);
66
+ state.issuesPromise = plugin_pools_1.issuesPool.submit(() => __awaiter(this, void 0, void 0, function* () {
67
+ try {
68
+ debug(`Running the getIssuesWorker, iteration ${iteration}.`);
69
+ return yield getIssuesWorker(change, state.watching);
70
+ }
71
+ catch (error) {
72
+ hooks.error.call(error, compilation);
73
+ return undefined;
74
+ }
75
+ finally {
76
+ debug(`The getIssuesWorker finished its job, iteration ${iteration}.`);
77
+ }
78
+ }));
79
+ debug(`Submitting the getDependenciesWorker to the pool, iteration ${iteration}.`);
80
+ state.dependenciesPromise = plugin_pools_1.dependenciesPool.submit(() => __awaiter(this, void 0, void 0, function* () {
81
+ try {
82
+ debug(`Running the getDependenciesWorker, iteration ${iteration}.`);
83
+ return yield getDependenciesWorker(change);
84
+ }
85
+ catch (error) {
86
+ hooks.error.call(error, compilation);
87
+ return undefined;
88
+ }
89
+ finally {
90
+ debug(`The getDependenciesWorker finished its job, iteration ${iteration}.`);
91
+ }
92
+ }));
93
+ }));
94
+ }
95
+ exports.tapStartToRunWorkers = tapStartToRunWorkers;
@@ -0,0 +1,5 @@
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
3
+ import type { RpcWorker } from '../rpc';
4
+ declare function tapStopToTerminateWorkers(compiler: webpack.Compiler, getIssuesWorker: RpcWorker, getDependenciesWorker: RpcWorker, state: ForkTsCheckerWebpackPluginState): void;
5
+ export { tapStopToTerminateWorkers };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tapStopToTerminateWorkers = void 0;
4
+ const infrastructure_logger_1 = require("../infrastructure-logger");
5
+ function tapStopToTerminateWorkers(compiler, getIssuesWorker, getDependenciesWorker, state) {
6
+ const { debug } = infrastructure_logger_1.getInfrastructureLogger(compiler);
7
+ const terminateWorkers = () => {
8
+ debug('Compiler is going to close - terminating workers...');
9
+ getIssuesWorker.terminate();
10
+ getDependenciesWorker.terminate();
11
+ };
12
+ compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
13
+ terminateWorkers();
14
+ });
15
+ compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', () => {
16
+ if (!state.watching) {
17
+ terminateWorkers();
18
+ }
19
+ });
20
+ compiler.hooks.failed.tap('ForkTsCheckerWebpackPlugin', () => {
21
+ if (!state.watching) {
22
+ terminateWorkers();
23
+ }
24
+ });
25
+ }
26
+ exports.tapStopToTerminateWorkers = tapStopToTerminateWorkers;
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { ForkTsCheckerWebpackPlugin } from './ForkTsCheckerWebpackPlugin';
1
+ import { ForkTsCheckerWebpackPlugin } from './plugin';
2
2
  export = ForkTsCheckerWebpackPlugin;
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const ForkTsCheckerWebpackPlugin_1 = require("./ForkTsCheckerWebpackPlugin");
3
- module.exports = ForkTsCheckerWebpackPlugin_1.ForkTsCheckerWebpackPlugin;
2
+ const plugin_1 = require("./plugin");
3
+ module.exports = plugin_1.ForkTsCheckerWebpackPlugin;
@@ -0,0 +1,9 @@
1
+ import type webpack from 'webpack';
2
+ export interface InfrastructureLogger {
3
+ log(...args: unknown[]): void;
4
+ debug(...args: unknown[]): void;
5
+ error(...args: unknown[]): void;
6
+ warn(...args: unknown[]): void;
7
+ info(...args: unknown[]): void;
8
+ }
9
+ export declare function getInfrastructureLogger(compiler: webpack.Compiler): InfrastructureLogger;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getInfrastructureLogger = void 0;
4
+ function getInfrastructureLogger(compiler) {
5
+ const logger = compiler.getInfrastructureLogger('ForkTsCheckerWebpackPlugin');
6
+ console.log(compiler.infrastructureLogger);
7
+ return {
8
+ log: logger.log.bind(logger),
9
+ debug: logger.debug.bind(logger),
10
+ error: logger.error.bind(logger),
11
+ warn: logger.warn.bind(logger),
12
+ info: logger.info.bind(logger),
13
+ };
14
+ }
15
+ exports.getInfrastructureLogger = getInfrastructureLogger;
@@ -1,3 +1,3 @@
1
- export * from './Issue';
2
- export * from './IssueSeverity';
3
- export * from './IssueLocation';
1
+ export * from './issue';
2
+ export * from './issue-severity';
3
+ export * from './issue-location';
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
5
12
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./Issue"));
7
- __export(require("./IssueSeverity"));
8
- __export(require("./IssueLocation"));
13
+ __exportStar(require("./issue"), exports);
14
+ __exportStar(require("./issue-severity"), exports);
15
+ __exportStar(require("./issue-location"), exports);
@@ -0,0 +1,8 @@
1
+ import type webpack from 'webpack';
2
+ import type { IssueOptions } from './issue-options';
3
+ import type { IssuePredicate } from './issue-predicate';
4
+ interface IssueConfig {
5
+ predicate: IssuePredicate;
6
+ }
7
+ declare function createIssueConfig(compiler: webpack.Compiler, options: IssueOptions | undefined): IssueConfig;
8
+ export { IssueConfig, createIssueConfig };
@@ -1,28 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const IssueMatch_1 = require("./IssueMatch");
4
- const IssuePredicate_1 = require("./IssuePredicate");
3
+ exports.createIssueConfig = void 0;
4
+ const issue_match_1 = require("./issue-match");
5
+ const issue_predicate_1 = require("./issue-predicate");
5
6
  function createIssuePredicateFromOption(context, option) {
6
7
  if (Array.isArray(option)) {
7
- return IssuePredicate_1.composeIssuePredicates(option.map((option) => typeof option === 'function' ? option : IssueMatch_1.createIssuePredicateFromIssueMatch(context, option)));
8
+ return issue_predicate_1.composeIssuePredicates(option.map((option) => typeof option === 'function' ? option : issue_match_1.createIssuePredicateFromIssueMatch(context, option)));
8
9
  }
9
10
  return typeof option === 'function'
10
11
  ? option
11
- : IssueMatch_1.createIssuePredicateFromIssueMatch(context, option);
12
+ : issue_match_1.createIssuePredicateFromIssueMatch(context, option);
12
13
  }
13
- function createIssueConfiguration(compiler, options) {
14
+ function createIssueConfig(compiler, options) {
14
15
  const context = compiler.options.context || process.cwd();
15
16
  if (!options) {
16
17
  options = {};
17
18
  }
18
19
  const include = options.include
19
20
  ? createIssuePredicateFromOption(context, options.include)
20
- : IssuePredicate_1.createTrivialIssuePredicate(true);
21
+ : issue_predicate_1.createTrivialIssuePredicate(true);
21
22
  const exclude = options.exclude
22
23
  ? createIssuePredicateFromOption(context, options.exclude)
23
- : IssuePredicate_1.createTrivialIssuePredicate(false);
24
+ : issue_predicate_1.createTrivialIssuePredicate(false);
24
25
  return {
25
26
  predicate: (issue) => include(issue) && !exclude(issue),
26
27
  };
27
28
  }
28
- exports.createIssueConfiguration = createIssueConfiguration;
29
+ exports.createIssueConfig = createIssueConfig;
@@ -1,8 +1,8 @@
1
- import { IssuePosition } from './IssuePosition';
1
+ import type { IssuePosition } from './issue-position';
2
2
  interface IssueLocation {
3
3
  start: IssuePosition;
4
4
  end: IssuePosition;
5
5
  }
6
6
  declare function compareIssueLocations(locationA?: IssueLocation, locationB?: IssueLocation): number;
7
- declare function formatIssueLocation(location: IssueLocation): string;
7
+ declare function formatIssueLocation({ start, end }: IssueLocation): string;
8
8
  export { IssueLocation, compareIssueLocations, formatIssueLocation };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatIssueLocation = exports.compareIssueLocations = void 0;
4
+ const issue_position_1 = require("./issue-position");
5
+ function compareIssueLocations(locationA, locationB) {
6
+ if (locationA === locationB) {
7
+ return 0;
8
+ }
9
+ if (!locationA) {
10
+ return -1;
11
+ }
12
+ if (!locationB) {
13
+ return 1;
14
+ }
15
+ return (issue_position_1.compareIssuePositions(locationA.start, locationB.start) ||
16
+ issue_position_1.compareIssuePositions(locationA.end, locationB.end));
17
+ }
18
+ exports.compareIssueLocations = compareIssueLocations;
19
+ function formatIssueLocation({ start, end }) {
20
+ if (!end.line || start.line === end.line) {
21
+ // the same line
22
+ if (!end.column || start.column === end.column) {
23
+ // the same column
24
+ return `${start.line}:${start.column}`;
25
+ }
26
+ else {
27
+ // different column
28
+ return `${start.line}:${start.column}-${end.column}`;
29
+ }
30
+ }
31
+ else {
32
+ // different lines
33
+ return `${start.line}:${start.column}-${end.line}:${end.column}`;
34
+ }
35
+ }
36
+ exports.formatIssueLocation = formatIssueLocation;
@@ -0,0 +1,5 @@
1
+ import type { IssuePredicate } from './issue-predicate';
2
+ import type { Issue } from './index';
3
+ declare type IssueMatch = Partial<Pick<Issue, 'severity' | 'code' | 'file'>>;
4
+ declare function createIssuePredicateFromIssueMatch(context: string, match: IssueMatch): IssuePredicate;
5
+ export { IssueMatch, createIssuePredicateFromIssueMatch };
@@ -3,18 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const minimatch_1 = __importDefault(require("minimatch"));
6
+ exports.createIssuePredicateFromIssueMatch = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
8
+ const minimatch_1 = __importDefault(require("minimatch"));
9
+ const forward_slash_1 = require("../utils/path/forward-slash");
9
10
  function createIssuePredicateFromIssueMatch(context, match) {
10
11
  return (issue) => {
11
- const matchesOrigin = !match.origin || match.origin === issue.origin;
12
12
  const matchesSeverity = !match.severity || match.severity === issue.severity;
13
13
  const matchesCode = !match.code || match.code === issue.code;
14
14
  const matchesFile = !issue.file ||
15
15
  (!!issue.file &&
16
- (!match.file || minimatch_1.default(forwardSlash_1.default(path_1.default.relative(context, issue.file)), match.file)));
17
- return matchesOrigin && matchesSeverity && matchesCode && matchesFile;
16
+ (!match.file || minimatch_1.default(forward_slash_1.forwardSlash(path_1.default.relative(context, issue.file)), match.file)));
17
+ return matchesSeverity && matchesCode && matchesFile;
18
18
  };
19
19
  }
20
20
  exports.createIssuePredicateFromIssueMatch = createIssuePredicateFromIssueMatch;
@@ -1,5 +1,5 @@
1
- import { IssueMatch } from './IssueMatch';
2
- import { IssuePredicate } from './IssuePredicate';
1
+ import type { IssueMatch } from './issue-match';
2
+ import type { IssuePredicate } from './issue-predicate';
3
3
  declare type IssuePredicateOption = IssuePredicate | IssueMatch | (IssuePredicate | IssueMatch)[];
4
4
  interface IssueOptions {
5
5
  include?: IssuePredicateOption;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compareIssuePositions = void 0;
3
4
  function compareIssuePositions(positionA, positionB) {
4
5
  if (positionA === positionB) {
5
6
  return 0;
@@ -1,4 +1,4 @@
1
- import { Issue } from './index';
1
+ import type { Issue } from './index';
2
2
  declare type IssuePredicate = (issue: Issue) => boolean;
3
3
  declare function createTrivialIssuePredicate(result: boolean): IssuePredicate;
4
4
  declare function composeIssuePredicates(predicates: IssuePredicate[]): IssuePredicate;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.composeIssuePredicates = exports.createTrivialIssuePredicate = void 0;
3
4
  function createTrivialIssuePredicate(result) {
4
5
  return () => result;
5
6
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compareIssueSeverities = exports.isIssueSeverity = void 0;
3
4
  function isIssueSeverity(value) {
4
5
  return ['error', 'warning'].includes(value);
5
6
  }
@@ -1,8 +1,8 @@
1
- import { Issue } from './Issue';
2
- declare class IssueWebpackError extends Error {
1
+ import webpack from 'webpack';
2
+ import type { Issue } from './issue';
3
+ declare class IssueWebpackError extends webpack.WebpackError {
3
4
  readonly issue: Issue;
4
5
  readonly hideStack = true;
5
- readonly file: string | undefined;
6
6
  constructor(message: string, issue: Issue);
7
7
  }
8
8
  export { IssueWebpackError };
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = require("path");
7
- const IssueLocation_1 = require("./IssueLocation");
8
- const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
9
- class IssueWebpackError extends Error {
6
+ exports.IssueWebpackError = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const webpack_1 = __importDefault(require("webpack"));
9
+ const relative_to_context_1 = require("../utils/path/relative-to-context");
10
+ const issue_location_1 = require("./issue-location");
11
+ class IssueWebpackError extends webpack_1.default.WebpackError {
10
12
  constructor(message, issue) {
11
13
  super(message);
12
14
  this.issue = issue;
@@ -15,9 +17,9 @@ class IssueWebpackError extends Error {
15
17
  // should be a NormalModule instance.
16
18
  // to avoid such a dependency, we do a workaround - error.file will contain formatted location instead
17
19
  if (issue.file) {
18
- this.file = forwardSlash_1.default(path_1.relative(process.cwd(), issue.file));
20
+ this.file = relative_to_context_1.relativeToContext(issue.file, process.cwd());
19
21
  if (issue.location) {
20
- this.file += `:${IssueLocation_1.formatIssueLocation(issue.location)}`;
22
+ this.file += ` ${chalk_1.default.green.bold(issue_location_1.formatIssueLocation(issue.location))}`;
21
23
  }
22
24
  }
23
25
  Error.captureStackTrace(this, this.constructor);
@@ -1,7 +1,6 @@
1
- import { IssueSeverity } from './IssueSeverity';
2
- import { IssueLocation } from './IssueLocation';
1
+ import type { IssueLocation } from './issue-location';
2
+ import type { IssueSeverity } from './issue-severity';
3
3
  interface Issue {
4
- origin: string;
5
4
  severity: IssueSeverity;
6
5
  code: string;
7
6
  message: string;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const IssueSeverity_1 = require("./IssueSeverity");
4
- const IssueLocation_1 = require("./IssueLocation");
3
+ exports.deduplicateAndSortIssues = exports.isIssue = void 0;
4
+ const issue_location_1 = require("./issue-location");
5
+ const issue_severity_1 = require("./issue-severity");
5
6
  function isIssue(value) {
6
7
  return (!!value &&
7
8
  typeof value === 'object' &&
8
- !!value.origin &&
9
- IssueSeverity_1.isIssueSeverity(value.severity) &&
9
+ issue_severity_1.isIssueSeverity(value.severity) &&
10
10
  !!value.code &&
11
11
  !!value.message);
12
12
  }
@@ -24,10 +24,9 @@ function compareStrings(stringA, stringB) {
24
24
  return stringA.toString().localeCompare(stringB.toString());
25
25
  }
26
26
  function compareIssues(issueA, issueB) {
27
- return (IssueSeverity_1.compareIssueSeverities(issueA.severity, issueB.severity) ||
28
- compareStrings(issueA.origin, issueB.origin) ||
27
+ return (issue_severity_1.compareIssueSeverities(issueA.severity, issueB.severity) ||
29
28
  compareStrings(issueA.file, issueB.file) ||
30
- IssueLocation_1.compareIssueLocations(issueA.location, issueB.location) ||
29
+ issue_location_1.compareIssueLocations(issueA.location, issueB.location) ||
31
30
  compareStrings(issueA.code, issueB.code) ||
32
31
  compareStrings(issueA.message, issueB.message) ||
33
32
  0 /* EqualTo */);
@@ -1,6 +1,5 @@
1
1
  interface Logger {
2
- info: (message: string) => void;
3
2
  log: (message: string) => void;
4
3
  error: (message: string) => void;
5
4
  }
6
- export default Logger;
5
+ export { Logger };
File without changes