fork-ts-checker-webpack-plugin 7.0.0-alpha.9 → 7.2.0

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