fork-ts-checker-webpack-plugin 6.3.5 → 7.0.0-alpha.10

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 (170) hide show
  1. package/README.md +25 -103
  2. package/lib/ForkTsCheckerWebpackPlugin.d.ts +11 -12
  3. package/lib/ForkTsCheckerWebpackPlugin.js +29 -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 +4 -4
  9. package/lib/ForkTsCheckerWebpackPluginState.js +1 -0
  10. package/lib/error/OperationCanceledError.js +1 -0
  11. package/lib/formatter/BasicFormatter.d.ts +1 -1
  12. package/lib/formatter/BasicFormatter.js +1 -0
  13. package/lib/formatter/CodeFrameFormatter.d.ts +1 -1
  14. package/lib/formatter/CodeFrameFormatter.js +2 -1
  15. package/lib/formatter/Formatter.d.ts +1 -1
  16. package/lib/formatter/FormatterConfiguration.d.ts +3 -3
  17. package/lib/formatter/FormatterConfiguration.js +21 -2
  18. package/lib/formatter/FormatterOptions.d.ts +11 -6
  19. package/lib/formatter/WebpackFormatter.d.ts +1 -1
  20. package/lib/formatter/WebpackFormatter.js +6 -6
  21. package/lib/formatter/index.d.ts +0 -1
  22. package/lib/formatter/index.js +16 -8
  23. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +3 -3
  24. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.js +1 -0
  25. package/lib/hooks/pluginHooks.d.ts +13 -13
  26. package/lib/hooks/pluginHooks.js +1 -0
  27. package/lib/hooks/pluginPools.d.ts +4 -0
  28. package/lib/hooks/pluginPools.js +28 -0
  29. package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +3 -3
  30. package/lib/hooks/tapAfterCompileToAddDependencies.js +1 -0
  31. package/lib/hooks/tapAfterCompileToGetIssues.d.ts +3 -3
  32. package/lib/hooks/tapAfterCompileToGetIssues.js +2 -1
  33. package/lib/hooks/tapAfterEnvironmentToPatchWatching.d.ts +2 -2
  34. package/lib/hooks/tapAfterEnvironmentToPatchWatching.js +4 -1
  35. package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +3 -3
  36. package/lib/hooks/tapDoneToAsyncGetIssues.js +3 -2
  37. package/lib/hooks/tapErrorToLogMessage.d.ts +2 -2
  38. package/lib/hooks/tapErrorToLogMessage.js +4 -3
  39. package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +4 -4
  40. package/lib/hooks/tapStartToConnectAndRunReporter.js +16 -11
  41. package/lib/hooks/tapStopToDisconnectReporter.d.ts +3 -3
  42. package/lib/hooks/tapStopToDisconnectReporter.js +1 -0
  43. package/lib/issue/Issue.d.ts +2 -3
  44. package/lib/issue/Issue.js +2 -3
  45. package/lib/issue/IssueConfiguration.d.ts +3 -3
  46. package/lib/issue/IssueConfiguration.js +1 -0
  47. package/lib/issue/IssueLocation.d.ts +2 -2
  48. package/lib/issue/IssueLocation.js +17 -2
  49. package/lib/issue/IssueMatch.d.ts +3 -3
  50. package/lib/issue/IssueMatch.js +3 -3
  51. package/lib/issue/IssueOptions.d.ts +2 -2
  52. package/lib/issue/IssuePosition.js +1 -0
  53. package/lib/issue/IssuePredicate.d.ts +1 -1
  54. package/lib/issue/IssuePredicate.js +1 -0
  55. package/lib/issue/IssueSeverity.js +1 -0
  56. package/lib/issue/IssueWebpackError.d.ts +3 -3
  57. package/lib/issue/IssueWebpackError.js +7 -5
  58. package/lib/issue/index.js +13 -6
  59. package/lib/logger/LoggerConfiguration.d.ts +3 -3
  60. package/lib/logger/LoggerConfiguration.js +2 -1
  61. package/lib/logger/LoggerFactory.d.ts +2 -2
  62. package/lib/logger/LoggerFactory.js +2 -1
  63. package/lib/logger/LoggerOptions.d.ts +2 -2
  64. package/lib/logger/PartialLogger.d.ts +1 -1
  65. package/lib/logger/PartialLogger.js +1 -0
  66. package/lib/logger/WebpackInfrastructureLogger.d.ts +2 -2
  67. package/lib/logger/WebpackInfrastructureLogger.js +1 -0
  68. package/lib/profile/Performance.js +1 -0
  69. package/lib/reporter/AggregatedReporter.d.ts +1 -1
  70. package/lib/reporter/AggregatedReporter.js +5 -4
  71. package/lib/reporter/FilesChange.d.ts +1 -1
  72. package/lib/reporter/FilesChange.js +2 -1
  73. package/lib/reporter/Report.d.ts +2 -2
  74. package/lib/reporter/Reporter.d.ts +3 -3
  75. package/lib/reporter/index.js +17 -7
  76. package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +2 -2
  77. package/lib/reporter/reporter-rpc/ReporterRpcClient.js +7 -4
  78. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +8 -5
  79. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +3 -0
  80. package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +2 -2
  81. package/lib/reporter/reporter-rpc/ReporterRpcService.js +5 -2
  82. package/lib/rpc/RpcClient.d.ts +2 -2
  83. package/lib/rpc/RpcClient.js +2 -1
  84. package/lib/rpc/RpcMessage.d.ts +1 -1
  85. package/lib/rpc/RpcMessage.js +3 -0
  86. package/lib/rpc/RpcMessageChannel.d.ts +1 -1
  87. package/lib/rpc/RpcMessageChannel.js +1 -0
  88. package/lib/rpc/RpcService.d.ts +2 -2
  89. package/lib/rpc/RpcService.js +1 -0
  90. package/lib/rpc/error/RpcMessagePortClosedError.js +1 -0
  91. package/lib/rpc/error/RpcRemoteError.js +1 -0
  92. package/lib/rpc/index.js +17 -7
  93. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.d.ts +1 -1
  94. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.js +1 -0
  95. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +2 -2
  96. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +1 -0
  97. package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +1 -0
  98. package/lib/rpc/rpc-ipc/index.js +12 -5
  99. package/lib/typescript-reporter/TypeScriptConfigurationOverwrite.d.ts +1 -1
  100. package/lib/typescript-reporter/TypeScriptReporterConfiguration.d.ts +5 -5
  101. package/lib/typescript-reporter/TypeScriptReporterConfiguration.js +2 -0
  102. package/lib/typescript-reporter/TypeScriptReporterOptions.d.ts +4 -5
  103. package/lib/typescript-reporter/TypeScriptSupport.d.ts +1 -1
  104. package/lib/typescript-reporter/TypeScriptSupport.js +26 -11
  105. package/lib/typescript-reporter/extension/TypeScriptEmbeddedExtension.d.ts +1 -1
  106. package/lib/typescript-reporter/extension/TypeScriptEmbeddedExtension.js +2 -1
  107. package/lib/typescript-reporter/extension/TypeScriptExtension.d.ts +2 -2
  108. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +2 -2
  109. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.js +4 -3
  110. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +1 -1
  111. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.js +1 -0
  112. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.d.ts +1 -1
  113. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.js +1 -0
  114. package/lib/typescript-reporter/extension/vue/types/vue__compiler-sfc.d.ts +0 -1
  115. package/lib/typescript-reporter/file-system/FileSystem.d.ts +1 -1
  116. package/lib/typescript-reporter/file-system/MemFileSystem.d.ts +1 -1
  117. package/lib/typescript-reporter/file-system/MemFileSystem.js +2 -0
  118. package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +1 -1
  119. package/lib/typescript-reporter/file-system/PassiveFileSystem.js +1 -0
  120. package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +1 -1
  121. package/lib/typescript-reporter/file-system/RealFileSystem.js +2 -0
  122. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +1 -1
  123. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +17 -5
  124. package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +1 -1
  125. package/lib/typescript-reporter/profile/TypeScriptPerformance.js +1 -0
  126. package/lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts +5 -0
  127. package/lib/typescript-reporter/reporter/ControlledCompilerHost.js +14 -0
  128. package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts +1 -1
  129. package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +7 -18
  130. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +2 -2
  131. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +1 -0
  132. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +2 -2
  133. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +1 -0
  134. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +2 -2
  135. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +8 -2
  136. package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +2 -2
  137. package/lib/typescript-reporter/reporter/TypeScriptReporter.js +42 -18
  138. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +2 -2
  139. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +1 -0
  140. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +2 -2
  141. package/lib/utils/async/pool.d.ts +1 -0
  142. package/lib/utils/async/pool.js +10 -0
  143. package/lib/utils/path/relativeToContext.d.ts +2 -0
  144. package/lib/utils/path/relativeToContext.js +16 -0
  145. package/lib/watch/InclusiveNodeWatchFileSystem.d.ts +5 -5
  146. package/lib/watch/InclusiveNodeWatchFileSystem.js +90 -92
  147. package/lib/watch/WatchFileSystem.d.ts +5 -22
  148. package/package.json +50 -67
  149. package/CHANGELOG.md +0 -318
  150. package/changelog.config.js +0 -36
  151. package/lib/eslint-reporter/EsLintReporterConfiguration.d.ts +0 -11
  152. package/lib/eslint-reporter/EsLintReporterConfiguration.js +0 -26
  153. package/lib/eslint-reporter/EsLintReporterOptions.d.ts +0 -8
  154. package/lib/eslint-reporter/EsLintReporterOptions.js +0 -2
  155. package/lib/eslint-reporter/assertEsLintSupport.d.ts +0 -3
  156. package/lib/eslint-reporter/assertEsLintSupport.js +0 -30
  157. package/lib/eslint-reporter/issue/EsLintIssueFactory.d.ts +0 -4
  158. package/lib/eslint-reporter/issue/EsLintIssueFactory.js +0 -32
  159. package/lib/eslint-reporter/reporter/EsLintReporter.d.ts +0 -4
  160. package/lib/eslint-reporter/reporter/EsLintReporter.js +0 -133
  161. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.d.ts +0 -4
  162. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.js +0 -13
  163. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.d.ts +0 -1
  164. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.js +0 -11
  165. package/lib/eslint-reporter/types/eslint.d.ts +0 -31
  166. package/lib/eslint-reporter/types/eslint.js +0 -2
  167. package/lib/formatter/FormatterFactory.d.ts +0 -13
  168. package/lib/formatter/FormatterFactory.js +0 -18
  169. package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
  170. package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
@@ -12,12 +12,13 @@ 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
18
  const IssueWebpackError_1 = require("../issue/IssueWebpackError");
19
19
  const isPending_1 = __importDefault(require("../utils/async/isPending"));
20
20
  const wait_1 = __importDefault(require("../utils/async/wait"));
21
+ const pluginHooks_1 = require("./pluginHooks");
21
22
  function tapDoneToAsyncGetIssues(compiler, configuration, state) {
22
23
  const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
23
24
  compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', (stats) => __awaiter(this, void 0, void 0, function* () {
@@ -78,7 +79,7 @@ function tapDoneToAsyncGetIssues(compiler, configuration, state) {
78
79
  state.webpackDevServerDoneTap.fn(stats);
79
80
  }
80
81
  if (stats.startTime) {
81
- configuration.logger.infrastructure.info(`Time: ${Math.round(Date.now() - stats.startTime).toString()} ms`);
82
+ configuration.logger.infrastructure.log(`Time: ${Math.round(Date.now() - stats.startTime).toString()} ms`);
82
83
  }
83
84
  }));
84
85
  }
@@ -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,9 +3,10 @@ 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 RpcIpcMessagePortClosedError_1 = require("../rpc/rpc-ipc/error/RpcIpcMessagePortClosedError");
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) => {
@@ -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
  });
@@ -1,6 +1,6 @@
1
- import webpack from 'webpack';
2
- import { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
- import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
4
- import { ReporterRpcClient } from '../reporter';
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
3
+ import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
4
+ import type { ReporterRpcClient } from '../reporter';
5
5
  declare function tapStartToConnectAndRunReporter(compiler: webpack.Compiler, issuesReporter: ReporterRpcClient, dependenciesReporter: ReporterRpcClient, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
6
6
  export { tapStartToConnectAndRunReporter };
@@ -9,13 +9,14 @@ 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");
13
- const reporter_1 = require("../reporter");
12
+ exports.tapStartToConnectAndRunReporter = void 0;
14
13
  const OperationCanceledError_1 = require("../error/OperationCanceledError");
15
- const tapDoneToAsyncGetIssues_1 = require("./tapDoneToAsyncGetIssues");
16
- const tapAfterCompileToGetIssues_1 = require("./tapAfterCompileToGetIssues");
14
+ const reporter_1 = require("../reporter");
17
15
  const interceptDoneToGetWebpackDevServerTap_1 = require("./interceptDoneToGetWebpackDevServerTap");
18
- const ForkTsCheckerWebpackPlugin_1 = require("../ForkTsCheckerWebpackPlugin");
16
+ const pluginHooks_1 = require("./pluginHooks");
17
+ const pluginPools_1 = require("./pluginPools");
18
+ const tapAfterCompileToGetIssues_1 = require("./tapAfterCompileToGetIssues");
19
+ const tapDoneToAsyncGetIssues_1 = require("./tapDoneToAsyncGetIssues");
19
20
  function tapStartToConnectAndRunReporter(compiler, issuesReporter, dependenciesReporter, configuration, state) {
20
21
  const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
21
22
  compiler.hooks.run.tap('ForkTsCheckerWebpackPlugin', () => {
@@ -46,14 +47,14 @@ function tapStartToConnectAndRunReporter(compiler, issuesReporter, dependenciesR
46
47
  let change = {};
47
48
  if (state.watching) {
48
49
  change = reporter_1.getFilesChange(compiler);
49
- configuration.logger.infrastructure.info([
50
+ configuration.logger.infrastructure.log([
50
51
  'Calling reporter service for incremental check.',
51
52
  ` Changed files: ${JSON.stringify(change.changedFiles)}`,
52
53
  ` Deleted files: ${JSON.stringify(change.deletedFiles)}`,
53
54
  ].join('\n'));
54
55
  }
55
56
  else {
56
- configuration.logger.infrastructure.info('Calling reporter service for single check.');
57
+ configuration.logger.infrastructure.log('Calling reporter service for single check.');
57
58
  }
58
59
  let resolveDependencies;
59
60
  let rejectDependencies;
@@ -70,14 +71,16 @@ function tapStartToConnectAndRunReporter(compiler, issuesReporter, dependenciesR
70
71
  const previousIssuesReportPromise = state.issuesReportPromise;
71
72
  const previousDependenciesReportPromise = state.dependenciesReportPromise;
72
73
  change = yield hooks.start.promise(change, compilation);
73
- state.issuesReportPromise = ForkTsCheckerWebpackPlugin_1.ForkTsCheckerWebpackPlugin.issuesPool.submit((done) => new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
74
+ state.issuesReportPromise = pluginPools_1.issuesPool.submit((done) =>
75
+ // eslint-disable-next-line no-async-promise-executor
76
+ new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
74
77
  try {
75
78
  yield issuesReporter.connect();
76
79
  const previousReport = yield previousIssuesReportPromise;
77
80
  if (previousReport) {
78
81
  yield previousReport.close();
79
82
  }
80
- const report = yield issuesReporter.getReport(change);
83
+ const report = yield issuesReporter.getReport(change, state.watching);
81
84
  resolve(report);
82
85
  report.getIssues().then(resolveIssues).catch(rejectIssues).finally(done);
83
86
  }
@@ -93,14 +96,16 @@ function tapStartToConnectAndRunReporter(compiler, issuesReporter, dependenciesR
93
96
  done();
94
97
  }
95
98
  })));
96
- state.dependenciesReportPromise = ForkTsCheckerWebpackPlugin_1.ForkTsCheckerWebpackPlugin.dependenciesPool.submit((done) => new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
99
+ state.dependenciesReportPromise = pluginPools_1.dependenciesPool.submit((done) =>
100
+ // eslint-disable-next-line no-async-promise-executor
101
+ new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
97
102
  try {
98
103
  yield dependenciesReporter.connect();
99
104
  const previousReport = yield previousDependenciesReportPromise;
100
105
  if (previousReport) {
101
106
  yield previousReport.close();
102
107
  }
103
- const report = yield dependenciesReporter.getReport(change);
108
+ const report = yield dependenciesReporter.getReport(change, state.watching);
104
109
  resolve(report);
105
110
  report
106
111
  .getDependencies()
@@ -1,5 +1,5 @@
1
- import webpack from 'webpack';
2
- import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
3
- import { ReporterRpcClient } from '../reporter';
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
3
+ import type { ReporterRpcClient } from '../reporter';
4
4
  declare function tapStopToDisconnectReporter(compiler: webpack.Compiler, issuesReporter: ReporterRpcClient, dependenciesReporter: ReporterRpcClient, state: ForkTsCheckerWebpackPluginState): void;
5
5
  export { tapStopToDisconnectReporter };
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.tapStopToDisconnectReporter = void 0;
12
13
  function tapStopToDisconnectReporter(compiler, issuesReporter, dependenciesReporter, state) {
13
14
  compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
14
15
  issuesReporter.disconnect();
@@ -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;
@@ -1,4 +1,4 @@
1
- import Logger from './Logger';
1
+ import type Logger from './Logger';
2
2
  declare type LoggerMethods = 'info' | 'log' | 'error';
3
3
  declare function createPartialLogger(methods: LoggerMethods[], logger: Logger): Logger;
4
4
  export { createPartialLogger };
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPartialLogger = void 0;
3
4
  function createPartialLogger(methods, logger) {
4
5
  return {
5
6
  info: (message) => (methods.includes('info') ? logger.info(message) : undefined),
@@ -1,4 +1,4 @@
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 function createWebpackInfrastructureLogger(compiler: webpack.Compiler): Logger | undefined;
4
4
  export { createWebpackInfrastructureLogger };
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createWebpackInfrastructureLogger = void 0;
3
4
  function isInfrastructureLoggerProvider(candidate) {
4
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
6
  return !!candidate.getInfrastructureLogger;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPerformance = void 0;
3
4
  const perf_hooks_1 = require("perf_hooks");
4
5
  function createPerformance() {
5
6
  let enabled = false;
@@ -1,4 +1,4 @@
1
- import { Reporter } from './Reporter';
1
+ import type { Reporter } from './Reporter';
2
2
  /**
3
3
  * This higher order reporter aggregates too frequent getReport requests to avoid unnecessary computation.
4
4
  */
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.createAggregatedReporter = void 0;
12
13
  const OperationCanceledError_1 = require("../error/OperationCanceledError");
13
14
  const FilesChange_1 = require("./FilesChange");
14
15
  /**
@@ -18,17 +19,17 @@ function createAggregatedReporter(reporter) {
18
19
  let pendingPromise;
19
20
  let queuedIndex = 0;
20
21
  let queuedChanges = [];
21
- const aggregatedReporter = Object.assign(Object.assign({}, reporter), { getReport: (change) => __awaiter(this, void 0, void 0, function* () {
22
+ const aggregatedReporter = Object.assign(Object.assign({}, reporter), { getReport: (change, watching) => __awaiter(this, void 0, void 0, function* () {
22
23
  if (!pendingPromise) {
23
24
  let resolvePending;
24
25
  pendingPromise = new Promise((resolve) => {
25
26
  resolvePending = () => {
26
- resolve();
27
+ resolve(undefined);
27
28
  pendingPromise = undefined;
28
29
  };
29
30
  });
30
31
  return reporter
31
- .getReport(change)
32
+ .getReport(change, watching)
32
33
  .then((report) => (Object.assign(Object.assign({}, report), { close() {
33
34
  return __awaiter(this, void 0, void 0, function* () {
34
35
  yield report.close();
@@ -47,7 +48,7 @@ function createAggregatedReporter(reporter) {
47
48
  if (queuedIndex === currentIndex) {
48
49
  const change = FilesChange_1.aggregateFilesChanges(queuedChanges);
49
50
  queuedChanges = [];
50
- return aggregatedReporter.getReport(change);
51
+ return aggregatedReporter.getReport(change, watching);
51
52
  }
52
53
  else {
53
54
  throw new OperationCanceledError_1.OperationCanceledError('getReport canceled - new report requested.');
@@ -1,4 +1,4 @@
1
- import { Compiler } from 'webpack';
1
+ import type { Compiler } from 'webpack';
2
2
  interface FilesChange {
3
3
  changedFiles?: string[];
4
4
  deletedFiles?: string[];
@@ -3,11 +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
+ exports.aggregateFilesChanges = exports.clearFilesChange = exports.updateFilesChange = exports.getFilesChange = void 0;
6
7
  const substract_1 = __importDefault(require("../utils/array/substract"));
7
8
  const unique_1 = __importDefault(require("../utils/array/unique"));
8
9
  const compilerFilesChangeMap = new WeakMap();
9
10
  function getFilesChange(compiler) {
10
- return compilerFilesChangeMap.get(compiler) || {};
11
+ return compilerFilesChangeMap.get(compiler) || { changedFiles: [], deletedFiles: [] };
11
12
  }
12
13
  exports.getFilesChange = getFilesChange;
13
14
  function updateFilesChange(compiler, change) {
@@ -1,5 +1,5 @@
1
- import { FilesMatch } from './FilesMatch';
2
- import { Issue } from '../issue';
1
+ import type { Issue } from '../issue';
2
+ import type { FilesMatch } from './FilesMatch';
3
3
  interface Report {
4
4
  getDependencies(): Promise<FilesMatch>;
5
5
  getIssues(): Promise<Issue[]>;
@@ -1,6 +1,6 @@
1
- import { FilesChange } from './FilesChange';
2
- import { Report } from './Report';
1
+ import type { FilesChange } from './FilesChange';
2
+ import type { Report } from './Report';
3
3
  interface Reporter {
4
- getReport(change: FilesChange): Promise<Report>;
4
+ getReport(change: FilesChange, watching: boolean): Promise<Report>;
5
5
  }
6
6
  export { Reporter };
@@ -1,9 +1,19 @@
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("./AggregatedReporter"));
7
- __export(require("./FilesChange"));
8
- __export(require("./reporter-rpc/ReporterRpcClient"));
9
- __export(require("./reporter-rpc/ReporterRpcService"));
13
+ __exportStar(require("./Report"), exports);
14
+ __exportStar(require("./Reporter"), exports);
15
+ __exportStar(require("./AggregatedReporter"), exports);
16
+ __exportStar(require("./FilesChange"), exports);
17
+ __exportStar(require("./FilesMatch"), exports);
18
+ __exportStar(require("./reporter-rpc/ReporterRpcClient"), exports);
19
+ __exportStar(require("./reporter-rpc/ReporterRpcService"), exports);
@@ -1,5 +1,5 @@
1
- import { Reporter } from '../Reporter';
2
- import { RpcMessageChannel } from '../../rpc';
1
+ import type { RpcMessageChannel } from '../../rpc';
2
+ import type { Reporter } from '../Reporter';
3
3
  interface ReporterRpcClient extends Reporter {
4
4
  isConnected: () => boolean;
5
5
  connect: () => Promise<void>;