fork-ts-checker-webpack-plugin 6.4.2 → 7.0.0-alpha.11

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 (260) hide show
  1. package/README.md +25 -103
  2. package/lib/ForkTsCheckerWebpackPlugin.d.ts +11 -12
  3. package/lib/ForkTsCheckerWebpackPlugin.js +49 -49
  4. package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +6 -8
  5. package/lib/ForkTsCheckerWebpackPluginConfiguration.js +3 -4
  6. package/lib/ForkTsCheckerWebpackPluginOptions.d.ts +4 -6
  7. package/lib/ForkTsCheckerWebpackPluginOptions.json +73 -111
  8. package/lib/ForkTsCheckerWebpackPluginState.d.ts +5 -6
  9. package/lib/ForkTsCheckerWebpackPluginState.js +2 -2
  10. package/lib/{reporter/FilesChange.d.ts → files-change.d.ts} +4 -4
  11. package/lib/{reporter/FilesChange.js → files-change.js} +4 -3
  12. package/lib/{reporter/FilesMatch.d.ts → files-match.d.ts} +0 -0
  13. package/lib/{eslint-reporter/EsLintReporterOptions.js → files-match.js} +0 -0
  14. package/lib/formatter/BasicFormatter.d.ts +1 -1
  15. package/lib/formatter/BasicFormatter.js +1 -0
  16. package/lib/formatter/CodeFrameFormatter.d.ts +1 -1
  17. package/lib/formatter/CodeFrameFormatter.js +2 -1
  18. package/lib/formatter/Formatter.d.ts +1 -1
  19. package/lib/formatter/FormatterConfiguration.d.ts +3 -3
  20. package/lib/formatter/FormatterConfiguration.js +21 -2
  21. package/lib/formatter/FormatterOptions.d.ts +11 -6
  22. package/lib/formatter/WebpackFormatter.d.ts +1 -1
  23. package/lib/formatter/WebpackFormatter.js +6 -6
  24. package/lib/formatter/index.d.ts +0 -1
  25. package/lib/formatter/index.js +16 -8
  26. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +3 -3
  27. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.js +4 -0
  28. package/lib/hooks/pluginHooks.d.ts +13 -13
  29. package/lib/hooks/pluginHooks.js +1 -0
  30. package/lib/hooks/pluginPools.d.ts +4 -0
  31. package/lib/hooks/pluginPools.js +28 -0
  32. package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +3 -3
  33. package/lib/hooks/tapAfterCompileToAddDependencies.js +4 -0
  34. package/lib/hooks/tapAfterCompileToGetIssues.d.ts +3 -3
  35. package/lib/hooks/tapAfterCompileToGetIssues.js +5 -1
  36. package/lib/hooks/tapAfterEnvironmentToPatchWatching.d.ts +2 -2
  37. package/lib/hooks/tapAfterEnvironmentToPatchWatching.js +10 -1
  38. package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +3 -3
  39. package/lib/hooks/tapDoneToAsyncGetIssues.js +7 -7
  40. package/lib/hooks/tapErrorToLogMessage.d.ts +2 -2
  41. package/lib/hooks/tapErrorToLogMessage.js +5 -4
  42. package/lib/hooks/tapStartToRunWorkers.d.ts +8 -0
  43. package/lib/hooks/tapStartToRunWorkers.js +95 -0
  44. package/lib/hooks/tapStopToTerminateWorkers.d.ts +5 -0
  45. package/lib/hooks/tapStopToTerminateWorkers.js +26 -0
  46. package/lib/infrastructure-logger.d.ts +10 -0
  47. package/lib/infrastructure-logger.js +15 -0
  48. package/lib/issue/Issue.d.ts +2 -3
  49. package/lib/issue/Issue.js +2 -3
  50. package/lib/issue/IssueConfiguration.d.ts +3 -3
  51. package/lib/issue/IssueConfiguration.js +1 -0
  52. package/lib/issue/IssueLocation.d.ts +2 -2
  53. package/lib/issue/IssueLocation.js +17 -2
  54. package/lib/issue/IssueMatch.d.ts +3 -3
  55. package/lib/issue/IssueMatch.js +3 -3
  56. package/lib/issue/IssueOptions.d.ts +2 -2
  57. package/lib/issue/IssuePosition.js +1 -0
  58. package/lib/issue/IssuePredicate.d.ts +1 -1
  59. package/lib/issue/IssuePredicate.js +1 -0
  60. package/lib/issue/IssueSeverity.js +1 -0
  61. package/lib/issue/IssueWebpackError.d.ts +3 -3
  62. package/lib/issue/IssueWebpackError.js +7 -5
  63. package/lib/issue/index.js +13 -6
  64. package/lib/logger/LoggerConfiguration.d.ts +3 -3
  65. package/lib/logger/LoggerConfiguration.js +2 -1
  66. package/lib/logger/LoggerFactory.d.ts +2 -2
  67. package/lib/logger/LoggerFactory.js +2 -1
  68. package/lib/logger/LoggerOptions.d.ts +2 -2
  69. package/lib/logger/PartialLogger.d.ts +1 -1
  70. package/lib/logger/PartialLogger.js +1 -0
  71. package/lib/logger/WebpackInfrastructureLogger.d.ts +2 -2
  72. package/lib/logger/WebpackInfrastructureLogger.js +1 -0
  73. package/lib/{typescript-reporter → typescript}/TypeScriptConfigurationOverwrite.d.ts +1 -1
  74. package/lib/{typescript-reporter → typescript}/TypeScriptConfigurationOverwrite.js +0 -0
  75. package/lib/{typescript-reporter → typescript}/TypeScriptDiagnosticsOptions.d.ts +0 -0
  76. package/lib/{typescript-reporter → typescript}/TypeScriptDiagnosticsOptions.js +0 -0
  77. package/lib/{typescript-reporter → typescript}/TypeScriptReporterConfiguration.d.ts +5 -5
  78. package/lib/{typescript-reporter → typescript}/TypeScriptReporterConfiguration.js +2 -0
  79. package/lib/{typescript-reporter → typescript}/TypeScriptReporterOptions.d.ts +4 -5
  80. package/lib/{typescript-reporter → typescript}/TypeScriptReporterOptions.js +0 -0
  81. package/lib/{typescript-reporter → typescript}/TypeScriptSupport.d.ts +1 -1
  82. package/lib/{typescript-reporter → typescript}/TypeScriptSupport.js +26 -11
  83. package/lib/{typescript-reporter → typescript}/extension/TypeScriptEmbeddedExtension.d.ts +1 -1
  84. package/lib/{typescript-reporter → typescript}/extension/TypeScriptEmbeddedExtension.js +2 -1
  85. package/lib/{typescript-reporter → typescript}/extension/TypeScriptExtension.d.ts +2 -2
  86. package/lib/{typescript-reporter → typescript}/extension/TypeScriptExtension.js +0 -0
  87. package/lib/typescript/extension/vue/TypeScriptVueExtension.d.ts +4 -0
  88. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtension.js +2 -1
  89. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +1 -1
  90. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionConfiguration.js +1 -0
  91. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionOptions.d.ts +0 -0
  92. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionOptions.js +0 -0
  93. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionSupport.d.ts +1 -1
  94. package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionSupport.js +1 -0
  95. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.d.ts +0 -0
  96. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.js +0 -0
  97. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue__compiler-sfc.d.ts +0 -0
  98. package/lib/{typescript-reporter → typescript}/extension/vue/types/vue__compiler-sfc.js +0 -0
  99. package/lib/typescript/worker/get-dependencies-worker.d.ts +5 -0
  100. package/lib/typescript/worker/get-dependencies-worker.js +18 -0
  101. package/lib/typescript/worker/get-issues-worker.d.ts +5 -0
  102. package/lib/typescript/worker/get-issues-worker.js +76 -0
  103. package/lib/typescript/worker/lib/artifacts.d.ts +4 -0
  104. package/lib/typescript/worker/lib/artifacts.js +90 -0
  105. package/lib/typescript/worker/lib/config.d.ts +14 -0
  106. package/lib/typescript/worker/lib/config.js +114 -0
  107. package/lib/typescript/worker/lib/dependencies.d.ts +3 -0
  108. package/lib/typescript/worker/lib/dependencies.js +87 -0
  109. package/lib/typescript/worker/lib/diagnostics.d.ts +7 -0
  110. package/lib/typescript/worker/lib/diagnostics.js +100 -0
  111. package/lib/typescript/worker/lib/extensions.d.ts +3 -0
  112. package/lib/typescript/worker/lib/extensions.js +11 -0
  113. package/lib/{typescript-reporter/file-system/FileSystem.d.ts → typescript/worker/lib/file-system/file-system.d.ts} +2 -3
  114. package/lib/{eslint-reporter/types/eslint.js → typescript/worker/lib/file-system/file-system.js} +0 -0
  115. package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +5 -0
  116. package/lib/typescript/worker/lib/file-system/mem-file-system.js +78 -0
  117. package/lib/typescript/worker/lib/file-system/passive-file-system.d.ts +5 -0
  118. package/lib/typescript/worker/lib/file-system/passive-file-system.js +65 -0
  119. package/lib/typescript/worker/lib/file-system/real-file-system.d.ts +5 -0
  120. package/lib/typescript/worker/lib/file-system/real-file-system.js +187 -0
  121. package/lib/typescript/worker/lib/host/compiler-host.d.ts +2 -0
  122. package/lib/typescript/worker/lib/host/compiler-host.js +17 -0
  123. package/lib/typescript/worker/lib/host/watch-compiler-host.d.ts +2 -0
  124. package/lib/typescript/worker/lib/host/watch-compiler-host.js +32 -0
  125. package/lib/typescript/worker/lib/host/watch-solution-builder-host.d.ts +2 -0
  126. package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +54 -0
  127. package/lib/typescript/worker/lib/performance.d.ts +3 -0
  128. package/lib/typescript/worker/lib/performance.js +32 -0
  129. package/lib/typescript/worker/lib/program/program.d.ts +2 -0
  130. package/lib/typescript/worker/lib/program/program.js +32 -0
  131. package/lib/typescript/worker/lib/program/solution-builder.d.ts +2 -0
  132. package/lib/typescript/worker/lib/program/solution-builder.js +39 -0
  133. package/lib/typescript/worker/lib/program/watch-program.d.ts +3 -0
  134. package/lib/typescript/worker/lib/program/watch-program.js +49 -0
  135. package/lib/{typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts → typescript/worker/lib/system.d.ts} +4 -6
  136. package/lib/typescript/worker/lib/system.js +209 -0
  137. package/lib/typescript/worker/lib/tracing.d.ts +4 -0
  138. package/lib/typescript/worker/lib/tracing.js +28 -0
  139. package/lib/typescript/worker/lib/tsbuildinfo.d.ts +4 -0
  140. package/lib/typescript/worker/lib/tsbuildinfo.js +92 -0
  141. package/lib/typescript/worker/lib/typescript.d.ts +2 -0
  142. package/lib/typescript/worker/lib/typescript.js +6 -0
  143. package/lib/typescript/worker/lib/worker-config.d.ts +2 -0
  144. package/lib/typescript/worker/lib/worker-config.js +5 -0
  145. package/lib/utils/async/pool.d.ts +2 -1
  146. package/lib/utils/async/pool.js +13 -14
  147. package/lib/utils/path/relativeToContext.d.ts +2 -0
  148. package/lib/utils/path/relativeToContext.js +16 -0
  149. package/lib/{rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.d.ts → utils/rpc/error.d.ts} +2 -3
  150. package/lib/utils/rpc/error.js +12 -0
  151. package/lib/utils/rpc/expose.d.ts +1 -0
  152. package/lib/utils/rpc/expose.js +78 -0
  153. package/lib/utils/rpc/index.d.ts +5 -0
  154. package/lib/utils/rpc/index.js +12 -0
  155. package/lib/utils/rpc/types.d.ts +19 -0
  156. package/lib/{reporter/FilesMatch.js → utils/rpc/types.js} +0 -0
  157. package/lib/utils/rpc/worker.d.ts +13 -0
  158. package/lib/utils/rpc/worker.js +79 -0
  159. package/lib/utils/rpc/wrap.d.ts +4 -0
  160. package/lib/utils/rpc/wrap.js +96 -0
  161. package/lib/watch/InclusiveNodeWatchFileSystem.d.ts +5 -5
  162. package/lib/watch/InclusiveNodeWatchFileSystem.js +90 -92
  163. package/lib/watch/WatchFileSystem.d.ts +5 -22
  164. package/package.json +50 -67
  165. package/CHANGELOG.md +0 -318
  166. package/changelog.config.js +0 -36
  167. package/lib/error/OperationCanceledError.d.ts +0 -4
  168. package/lib/error/OperationCanceledError.js +0 -9
  169. package/lib/eslint-reporter/EsLintReporterConfiguration.d.ts +0 -11
  170. package/lib/eslint-reporter/EsLintReporterConfiguration.js +0 -26
  171. package/lib/eslint-reporter/EsLintReporterOptions.d.ts +0 -8
  172. package/lib/eslint-reporter/assertEsLintSupport.d.ts +0 -3
  173. package/lib/eslint-reporter/assertEsLintSupport.js +0 -30
  174. package/lib/eslint-reporter/issue/EsLintIssueFactory.d.ts +0 -4
  175. package/lib/eslint-reporter/issue/EsLintIssueFactory.js +0 -32
  176. package/lib/eslint-reporter/reporter/EsLintReporter.d.ts +0 -4
  177. package/lib/eslint-reporter/reporter/EsLintReporter.js +0 -179
  178. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.d.ts +0 -4
  179. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.js +0 -13
  180. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.d.ts +0 -1
  181. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.js +0 -11
  182. package/lib/eslint-reporter/types/eslint.d.ts +0 -37
  183. package/lib/formatter/FormatterFactory.d.ts +0 -13
  184. package/lib/formatter/FormatterFactory.js +0 -18
  185. package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +0 -6
  186. package/lib/hooks/tapStartToConnectAndRunReporter.js +0 -125
  187. package/lib/hooks/tapStopToDisconnectReporter.d.ts +0 -5
  188. package/lib/hooks/tapStopToDisconnectReporter.js +0 -29
  189. package/lib/profile/Performance.d.ts +0 -11
  190. package/lib/profile/Performance.js +0 -62
  191. package/lib/reporter/AggregatedReporter.d.ts +0 -6
  192. package/lib/reporter/AggregatedReporter.js +0 -60
  193. package/lib/reporter/Report.d.ts +0 -8
  194. package/lib/reporter/Report.js +0 -2
  195. package/lib/reporter/Reporter.d.ts +0 -6
  196. package/lib/reporter/Reporter.js +0 -2
  197. package/lib/reporter/index.d.ts +0 -7
  198. package/lib/reporter/index.js +0 -9
  199. package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +0 -10
  200. package/lib/reporter/reporter-rpc/ReporterRpcClient.js +0 -82
  201. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +0 -10
  202. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +0 -12
  203. package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +0 -9
  204. package/lib/reporter/reporter-rpc/ReporterRpcService.js +0 -74
  205. package/lib/rpc/RpcClient.d.ts +0 -10
  206. package/lib/rpc/RpcClient.js +0 -78
  207. package/lib/rpc/RpcHost.d.ts +0 -6
  208. package/lib/rpc/RpcHost.js +0 -2
  209. package/lib/rpc/RpcMessage.d.ts +0 -26
  210. package/lib/rpc/RpcMessage.js +0 -45
  211. package/lib/rpc/RpcMessageChannel.d.ts +0 -10
  212. package/lib/rpc/RpcMessageChannel.js +0 -49
  213. package/lib/rpc/RpcMessagePort.d.ts +0 -14
  214. package/lib/rpc/RpcMessagePort.js +0 -2
  215. package/lib/rpc/RpcProcedure.d.ts +0 -5
  216. package/lib/rpc/RpcProcedure.js +0 -2
  217. package/lib/rpc/RpcService.d.ts +0 -12
  218. package/lib/rpc/RpcService.js +0 -63
  219. package/lib/rpc/error/RpcMessagePortClosedError.d.ts +0 -3
  220. package/lib/rpc/error/RpcMessagePortClosedError.js +0 -5
  221. package/lib/rpc/error/RpcRemoteError.d.ts +0 -6
  222. package/lib/rpc/error/RpcRemoteError.js +0 -17
  223. package/lib/rpc/index.d.ts +0 -7
  224. package/lib/rpc/index.js +0 -9
  225. package/lib/rpc/rpc-ipc/ProcessLike.d.ts +0 -12
  226. package/lib/rpc/rpc-ipc/ProcessLike.js +0 -3
  227. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.d.ts +0 -3
  228. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.js +0 -10
  229. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +0 -5
  230. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +0 -150
  231. package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +0 -12
  232. package/lib/rpc/rpc-ipc/index.d.ts +0 -2
  233. package/lib/rpc/rpc-ipc/index.js +0 -7
  234. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +0 -4
  235. package/lib/typescript-reporter/file-system/FileSystem.js +0 -2
  236. package/lib/typescript-reporter/file-system/MemFileSystem.d.ts +0 -8
  237. package/lib/typescript-reporter/file-system/MemFileSystem.js +0 -81
  238. package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +0 -9
  239. package/lib/typescript-reporter/file-system/PassiveFileSystem.js +0 -68
  240. package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +0 -8
  241. package/lib/typescript-reporter/file-system/RealFileSystem.js +0 -179
  242. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +0 -4
  243. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +0 -45
  244. package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +0 -10
  245. package/lib/typescript-reporter/profile/TypeScriptPerformance.js +0 -33
  246. package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +0 -229
  247. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +0 -5
  248. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +0 -28
  249. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +0 -5
  250. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +0 -50
  251. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +0 -8
  252. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +0 -136
  253. package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +0 -4
  254. package/lib/typescript-reporter/reporter/TypeScriptReporter.js +0 -352
  255. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +0 -4
  256. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +0 -13
  257. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.d.ts +0 -1
  258. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +0 -11
  259. package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
  260. package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
@@ -1,5 +1,5 @@
1
- import webpack from 'webpack';
2
- import { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
- import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
+ import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
4
4
  declare function tapAfterCompileToGetIssues(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
5
5
  export { tapAfterCompileToGetIssues };
@@ -9,10 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const pluginHooks_1 = require("./pluginHooks");
12
+ exports.tapAfterCompileToGetIssues = void 0;
13
+ const infrastructure_logger_1 = require("../infrastructure-logger");
13
14
  const IssueWebpackError_1 = require("../issue/IssueWebpackError");
15
+ const pluginHooks_1 = require("./pluginHooks");
14
16
  function tapAfterCompileToGetIssues(compiler, configuration, state) {
15
17
  const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
18
+ const { debug } = infrastructure_logger_1.getInfrastructureLogger(compiler);
16
19
  compiler.hooks.afterCompile.tapPromise('ForkTsCheckerWebpackPlugin', (compilation) => __awaiter(this, void 0, void 0, function* () {
17
20
  if (compilation.compiler !== compiler) {
18
21
  // run only for the compiler that the plugin was registered for
@@ -26,6 +29,7 @@ function tapAfterCompileToGetIssues(compiler, configuration, state) {
26
29
  hooks.error.call(error, compilation);
27
30
  return;
28
31
  }
32
+ debug('Got issues from getIssuesWorker.', issues === null || issues === void 0 ? void 0 : issues.length);
29
33
  if (!issues) {
30
34
  // some error has been thrown or it was canceled
31
35
  return;
@@ -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 '../ForkTsCheckerWebpackPluginState';
3
3
  declare function tapAfterEnvironmentToPatchWatching(compiler: webpack.Compiler, state: ForkTsCheckerWebpackPluginState): void;
4
4
  export { tapAfterEnvironmentToPatchWatching };
@@ -1,12 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tapAfterEnvironmentToPatchWatching = void 0;
4
+ const infrastructure_logger_1 = require("../infrastructure-logger");
3
5
  const InclusiveNodeWatchFileSystem_1 = require("../watch/InclusiveNodeWatchFileSystem");
4
6
  function tapAfterEnvironmentToPatchWatching(compiler, state) {
7
+ const { debug } = infrastructure_logger_1.getInfrastructureLogger(compiler);
5
8
  compiler.hooks.afterEnvironment.tap('ForkTsCheckerWebpackPlugin', () => {
6
9
  const watchFileSystem = compiler.watchFileSystem;
7
10
  if (watchFileSystem) {
11
+ debug("Overwriting webpack's watch file system.");
8
12
  // wrap original watch file system
9
- compiler.watchFileSystem = new InclusiveNodeWatchFileSystem_1.InclusiveNodeWatchFileSystem(watchFileSystem, compiler, state);
13
+ compiler.watchFileSystem = new InclusiveNodeWatchFileSystem_1.InclusiveNodeWatchFileSystem(
14
+ // we use some internals here
15
+ watchFileSystem, compiler, state);
16
+ }
17
+ else {
18
+ debug('No watch file system found - plugin may not work correctly.');
10
19
  }
11
20
  });
12
21
  }
@@ -1,5 +1,5 @@
1
- import webpack from 'webpack';
2
- import { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
- import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
+ import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
4
4
  declare function tapDoneToAsyncGetIssues(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
5
5
  export { tapDoneToAsyncGetIssues };
@@ -12,20 +12,22 @@ 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
17
  const WebpackFormatter_1 = require("../formatter/WebpackFormatter");
18
+ const infrastructure_logger_1 = require("../infrastructure-logger");
18
19
  const IssueWebpackError_1 = require("../issue/IssueWebpackError");
19
20
  const isPending_1 = __importDefault(require("../utils/async/isPending"));
20
21
  const wait_1 = __importDefault(require("../utils/async/wait"));
22
+ const pluginHooks_1 = require("./pluginHooks");
21
23
  function tapDoneToAsyncGetIssues(compiler, configuration, state) {
22
24
  const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(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.issuesReportPromise;
29
31
  const issuesPromise = state.issuesPromise;
30
32
  let issues;
31
33
  try {
@@ -38,6 +40,7 @@ function tapDoneToAsyncGetIssues(compiler, configuration, state) {
38
40
  yield wait_1.default(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,10 +50,6 @@ 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.issuesReportPromise) {
51
- // there is a newer report - ignore this one
52
- return;
53
- }
54
53
  // filter list of issues by provided issue predicate
55
54
  issues = issues.filter(configuration.issue.predicate);
56
55
  // modify list of issues in the plugin hooks
@@ -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
  }
@@ -1,4 +1,4 @@
1
- import webpack from 'webpack';
2
- import { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
3
  declare function tapErrorToLogMessage(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration): void;
4
4
  export { tapErrorToLogMessage };
@@ -3,14 +3,15 @@ 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"));
8
+ const rpc_1 = require("../utils/rpc");
9
+ const pluginHooks_1 = require("./pluginHooks");
9
10
  function tapErrorToLogMessage(compiler, configuration) {
10
11
  const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
11
12
  hooks.error.tap('ForkTsCheckerWebpackPlugin', (error) => {
12
13
  configuration.logger.issues.error(String(error));
13
- if (error instanceof RpcIpcMessagePortClosedError_1.RpcIpcMessagePortClosedError) {
14
+ if (error instanceof rpc_1.RpcExitError) {
14
15
  if (error.signal === 'SIGINT') {
15
16
  configuration.logger.issues.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 " +
@@ -19,7 +20,7 @@ function tapErrorToLogMessage(compiler, configuration) {
19
20
  else {
20
21
  configuration.logger.issues.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 { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
+ import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
4
+ import type { GetDependenciesWorker } from '../typescript/worker/get-dependencies-worker';
5
+ import type { GetIssuesWorker } from '../typescript/worker/get-issues-worker';
6
+ import type { RpcWorker } from '../utils/rpc';
7
+ declare function tapStartToRunWorkers(compiler: webpack.Compiler, getIssuesWorker: RpcWorker<GetIssuesWorker>, getDependenciesWorker: RpcWorker<GetDependenciesWorker>, config: ForkTsCheckerWebpackPluginConfiguration, 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 interceptDoneToGetWebpackDevServerTap_1 = require("./interceptDoneToGetWebpackDevServerTap");
16
+ const pluginHooks_1 = require("./pluginHooks");
17
+ const pluginPools_1 = require("./pluginPools");
18
+ const tapAfterCompileToGetIssues_1 = require("./tapAfterCompileToGetIssues");
19
+ const tapDoneToAsyncGetIssues_1 = require("./tapDoneToAsyncGetIssues");
20
+ function tapStartToRunWorkers(compiler, getIssuesWorker, getDependenciesWorker, config, state) {
21
+ const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(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
+ tapAfterCompileToGetIssues_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
+ tapDoneToAsyncGetIssues_1.tapDoneToAsyncGetIssues(compiler, config, state);
38
+ interceptDoneToGetWebpackDevServerTap_1.interceptDoneToGetWebpackDevServerTap(compiler, config, state);
39
+ }
40
+ else {
41
+ debug('Initializing plugin for watch run (not async).');
42
+ tapAfterCompileToGetIssues_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.getFilesChange(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 = pluginPools_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 = pluginPools_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 '../ForkTsCheckerWebpackPluginState';
3
+ import type { RpcWorker } from '../utils/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;
@@ -0,0 +1,10 @@
1
+ import type webpack from 'webpack';
2
+ 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;
10
+ export {};
@@ -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,7 +1,6 @@
1
- import { IssueSeverity } from './IssueSeverity';
2
- import { IssueLocation } from './IssueLocation';
1
+ import type { IssueLocation } from './IssueLocation';
2
+ import type { IssueSeverity } from './IssueSeverity';
3
3
  interface Issue {
4
- origin: string;
5
4
  severity: IssueSeverity;
6
5
  code: string;
7
6
  message: string;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const IssueSeverity_1 = require("./IssueSeverity");
3
+ exports.deduplicateAndSortIssues = exports.isIssue = void 0;
4
4
  const IssueLocation_1 = require("./IssueLocation");
5
+ const IssueSeverity_1 = require("./IssueSeverity");
5
6
  function isIssue(value) {
6
7
  return (!!value &&
7
8
  typeof value === 'object' &&
8
- !!value.origin &&
9
9
  IssueSeverity_1.isIssueSeverity(value.severity) &&
10
10
  !!value.code &&
11
11
  !!value.message);
@@ -25,7 +25,6 @@ function compareStrings(stringA, stringB) {
25
25
  }
26
26
  function compareIssues(issueA, issueB) {
27
27
  return (IssueSeverity_1.compareIssueSeverities(issueA.severity, issueB.severity) ||
28
- compareStrings(issueA.origin, issueB.origin) ||
29
28
  compareStrings(issueA.file, issueB.file) ||
30
29
  IssueLocation_1.compareIssueLocations(issueA.location, issueB.location) ||
31
30
  compareStrings(issueA.code, issueB.code) ||
@@ -1,6 +1,6 @@
1
- import webpack from 'webpack';
2
- import { IssuePredicate } from './IssuePredicate';
3
- import { IssueOptions } from './IssueOptions';
1
+ import type webpack from 'webpack';
2
+ import type { IssueOptions } from './IssueOptions';
3
+ import type { IssuePredicate } from './IssuePredicate';
4
4
  interface IssueConfiguration {
5
5
  predicate: IssuePredicate;
6
6
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createIssueConfiguration = void 0;
3
4
  const IssueMatch_1 = require("./IssueMatch");
4
5
  const IssuePredicate_1 = require("./IssuePredicate");
5
6
  function createIssuePredicateFromOption(context, option) {
@@ -1,8 +1,8 @@
1
- import { IssuePosition } from './IssuePosition';
1
+ import type { IssuePosition } from './IssuePosition';
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 };
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatIssueLocation = exports.compareIssueLocations = void 0;
3
4
  const IssuePosition_1 = require("./IssuePosition");
4
5
  function compareIssueLocations(locationA, locationB) {
5
6
  if (locationA === locationB) {
@@ -15,7 +16,21 @@ function compareIssueLocations(locationA, locationB) {
15
16
  IssuePosition_1.compareIssuePositions(locationA.end, locationB.end));
16
17
  }
17
18
  exports.compareIssueLocations = compareIssueLocations;
18
- function formatIssueLocation(location) {
19
- return `${location.start.line}:${location.start.column}`;
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
+ }
20
35
  }
21
36
  exports.formatIssueLocation = formatIssueLocation;
@@ -1,5 +1,5 @@
1
- import { Issue } from './index';
2
- import { IssuePredicate } from './IssuePredicate';
3
- declare type IssueMatch = Partial<Pick<Issue, 'origin' | 'severity' | 'code' | 'file'>>;
1
+ import type { IssuePredicate } from './IssuePredicate';
2
+ import type { Issue } from './index';
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 };
@@ -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 minimatch_1 = __importDefault(require("minimatch"));
8
9
  const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
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
16
  (!match.file || minimatch_1.default(forwardSlash_1.default(path_1.default.relative(context, issue.file)), match.file)));
17
- return matchesOrigin && matchesSeverity && matchesCode && matchesFile;
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 './IssueMatch';
2
+ import type { IssuePredicate } from './IssuePredicate';
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");
6
+ exports.IssueWebpackError = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const webpack_1 = __importDefault(require("webpack"));
9
+ const relativeToContext_1 = require("../utils/path/relativeToContext");
7
10
  const IssueLocation_1 = require("./IssueLocation");
8
- const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
9
- class IssueWebpackError extends Error {
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 = relativeToContext_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(IssueLocation_1.formatIssueLocation(issue.location))}`;
21
23
  }
22
24
  }
23
25
  Error.captureStackTrace(this, this.constructor);
@@ -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("./IssueSeverity"), exports);
15
+ __exportStar(require("./IssueLocation"), exports);
@@ -1,6 +1,6 @@
1
- import LoggerOptions from './LoggerOptions';
2
- import Logger from './Logger';
3
- import webpack from 'webpack';
1
+ import type webpack from 'webpack';
2
+ import type Logger from './Logger';
3
+ import type LoggerOptions from './LoggerOptions';
4
4
  interface LoggerConfiguration {
5
5
  infrastructure: Logger;
6
6
  issues: Logger;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLoggerConfiguration = void 0;
3
4
  const LoggerFactory_1 = require("./LoggerFactory");
4
5
  function createLoggerConfiguration(compiler, options) {
5
6
  return {
6
- infrastructure: LoggerFactory_1.createLogger((options && options.infrastructure) || 'silent', compiler),
7
+ infrastructure: LoggerFactory_1.createLogger((options && options.infrastructure) || 'webpack-infrastructure', compiler),
7
8
  issues: LoggerFactory_1.createLogger((options && options.issues) || 'console', compiler),
8
9
  devServer: (options === null || options === void 0 ? void 0 : options.devServer) !== false,
9
10
  };
@@ -1,5 +1,5 @@
1
- import webpack from 'webpack';
2
- import Logger from './Logger';
1
+ import type webpack from 'webpack';
2
+ import type Logger from './Logger';
3
3
  declare type LoggerType = 'console' | 'webpack-infrastructure' | 'silent';
4
4
  declare function createLogger(type: LoggerType | Logger, compiler: webpack.Compiler): Logger;
5
5
  export { createLogger, LoggerType };
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const WebpackInfrastructureLogger_1 = require("./WebpackInfrastructureLogger");
3
+ exports.createLogger = void 0;
4
4
  const PartialLogger_1 = require("./PartialLogger");
5
+ const WebpackInfrastructureLogger_1 = require("./WebpackInfrastructureLogger");
5
6
  function createLogger(type, compiler) {
6
7
  if (typeof type !== 'string') {
7
8
  return type;
@@ -1,5 +1,5 @@
1
- import { LoggerType } from './LoggerFactory';
2
- import Logger from './Logger';
1
+ import type Logger from './Logger';
2
+ import type { LoggerType } from './LoggerFactory';
3
3
  declare type LoggerOptions = {
4
4
  infrastructure?: LoggerType | Logger;
5
5
  issues?: LoggerType | Logger;