fork-ts-checker-webpack-plugin 7.0.0-alpha.1 → 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 (174) hide show
  1. package/README.md +17 -83
  2. package/lib/ForkTsCheckerWebpackPlugin.d.ts +15 -11
  3. package/lib/ForkTsCheckerWebpackPlugin.js +30 -38
  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 +8 -7
  9. package/lib/ForkTsCheckerWebpackPluginState.js +3 -1
  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/formatter/types/babel__code-frame.js +1 -1
  24. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +3 -3
  25. package/lib/hooks/interceptDoneToGetWebpackDevServerTap.js +1 -0
  26. package/lib/hooks/pluginHooks.d.ts +13 -13
  27. package/lib/hooks/pluginHooks.js +1 -0
  28. package/lib/hooks/pluginPools.d.ts +4 -0
  29. package/lib/hooks/pluginPools.js +28 -0
  30. package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +3 -3
  31. package/lib/hooks/tapAfterCompileToAddDependencies.js +1 -0
  32. package/lib/hooks/tapAfterCompileToGetIssues.d.ts +3 -3
  33. package/lib/hooks/tapAfterCompileToGetIssues.js +2 -1
  34. package/lib/hooks/tapAfterEnvironmentToPatchWatching.d.ts +2 -2
  35. package/lib/hooks/tapAfterEnvironmentToPatchWatching.js +4 -1
  36. package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +3 -3
  37. package/lib/hooks/tapDoneToAsyncGetIssues.js +6 -5
  38. package/lib/hooks/tapErrorToLogMessage.d.ts +2 -2
  39. package/lib/hooks/tapErrorToLogMessage.js +4 -3
  40. package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +5 -5
  41. package/lib/hooks/tapStartToConnectAndRunReporter.js +47 -22
  42. package/lib/hooks/tapStopToDisconnectReporter.d.ts +4 -4
  43. package/lib/hooks/tapStopToDisconnectReporter.js +7 -4
  44. package/lib/issue/Issue.d.ts +2 -3
  45. package/lib/issue/Issue.js +2 -3
  46. package/lib/issue/IssueConfiguration.d.ts +3 -3
  47. package/lib/issue/IssueConfiguration.js +1 -0
  48. package/lib/issue/IssueLocation.d.ts +2 -2
  49. package/lib/issue/IssueLocation.js +17 -2
  50. package/lib/issue/IssueMatch.d.ts +3 -3
  51. package/lib/issue/IssueMatch.js +3 -3
  52. package/lib/issue/IssueOptions.d.ts +2 -2
  53. package/lib/issue/IssuePosition.js +1 -0
  54. package/lib/issue/IssuePredicate.d.ts +1 -1
  55. package/lib/issue/IssuePredicate.js +1 -0
  56. package/lib/issue/IssueSeverity.js +1 -0
  57. package/lib/issue/IssueWebpackError.d.ts +3 -3
  58. package/lib/issue/IssueWebpackError.js +7 -5
  59. package/lib/issue/index.js +13 -6
  60. package/lib/logger/LoggerConfiguration.d.ts +3 -3
  61. package/lib/logger/LoggerConfiguration.js +2 -1
  62. package/lib/logger/LoggerFactory.d.ts +2 -2
  63. package/lib/logger/LoggerFactory.js +2 -1
  64. package/lib/logger/LoggerOptions.d.ts +2 -2
  65. package/lib/logger/PartialLogger.d.ts +1 -1
  66. package/lib/logger/PartialLogger.js +1 -0
  67. package/lib/logger/WebpackInfrastructureLogger.d.ts +2 -2
  68. package/lib/logger/WebpackInfrastructureLogger.js +1 -0
  69. package/lib/profile/Performance.js +1 -0
  70. package/lib/reporter/AggregatedReporter.d.ts +1 -1
  71. package/lib/reporter/AggregatedReporter.js +2 -1
  72. package/lib/reporter/FilesChange.d.ts +1 -1
  73. package/lib/reporter/FilesChange.js +2 -1
  74. package/lib/reporter/FilesMatch.d.ts +7 -0
  75. package/lib/{eslint-reporter/EsLintReporterOptions.js → reporter/FilesMatch.js} +0 -0
  76. package/lib/reporter/Report.d.ts +3 -3
  77. package/lib/reporter/Reporter.d.ts +2 -2
  78. package/lib/reporter/index.d.ts +1 -1
  79. package/lib/reporter/index.js +17 -7
  80. package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +2 -2
  81. package/lib/reporter/reporter-rpc/ReporterRpcClient.js +17 -4
  82. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +5 -5
  83. package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +3 -0
  84. package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +2 -2
  85. package/lib/reporter/reporter-rpc/ReporterRpcService.js +3 -0
  86. package/lib/rpc/RpcClient.d.ts +2 -2
  87. package/lib/rpc/RpcClient.js +2 -1
  88. package/lib/rpc/RpcMessage.d.ts +1 -1
  89. package/lib/rpc/RpcMessage.js +3 -0
  90. package/lib/rpc/RpcMessageChannel.d.ts +1 -1
  91. package/lib/rpc/RpcMessageChannel.js +1 -0
  92. package/lib/rpc/RpcService.d.ts +2 -2
  93. package/lib/rpc/RpcService.js +1 -0
  94. package/lib/rpc/error/RpcMessagePortClosedError.js +1 -0
  95. package/lib/rpc/error/RpcRemoteError.js +1 -0
  96. package/lib/rpc/index.js +17 -7
  97. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.d.ts +1 -1
  98. package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.js +1 -0
  99. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +2 -2
  100. package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +1 -0
  101. package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +1 -0
  102. package/lib/rpc/rpc-ipc/index.js +12 -5
  103. package/lib/typescript-reporter/TypeScriptConfigurationOverwrite.d.ts +1 -1
  104. package/lib/typescript-reporter/TypeScriptReporterConfiguration.d.ts +5 -5
  105. package/lib/typescript-reporter/TypeScriptReporterConfiguration.js +2 -0
  106. package/lib/typescript-reporter/TypeScriptReporterOptions.d.ts +4 -5
  107. package/lib/typescript-reporter/TypeScriptSupport.d.ts +1 -1
  108. package/lib/typescript-reporter/TypeScriptSupport.js +26 -11
  109. package/lib/typescript-reporter/extension/TypeScriptEmbeddedExtension.d.ts +1 -1
  110. package/lib/typescript-reporter/extension/TypeScriptEmbeddedExtension.js +2 -1
  111. package/lib/typescript-reporter/extension/TypeScriptExtension.d.ts +4 -4
  112. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +2 -2
  113. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.js +2 -1
  114. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +1 -1
  115. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.js +1 -0
  116. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.d.ts +1 -1
  117. package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.js +1 -0
  118. package/lib/typescript-reporter/file-system/FileSystem.d.ts +1 -1
  119. package/lib/typescript-reporter/file-system/MemFileSystem.d.ts +8 -0
  120. package/lib/typescript-reporter/file-system/MemFileSystem.js +83 -0
  121. package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +3 -3
  122. package/lib/typescript-reporter/file-system/PassiveFileSystem.js +11 -72
  123. package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +1 -1
  124. package/lib/typescript-reporter/file-system/RealFileSystem.js +2 -0
  125. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +2 -2
  126. package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +17 -5
  127. package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +2 -2
  128. package/lib/typescript-reporter/profile/TypeScriptPerformance.js +1 -0
  129. package/lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts +3 -3
  130. package/lib/typescript-reporter/reporter/ControlledCompilerHost.js +1 -0
  131. package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts +3 -1
  132. package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +50 -15
  133. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +3 -3
  134. package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +1 -0
  135. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +3 -3
  136. package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +2 -9
  137. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +7 -5
  138. package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +114 -19
  139. package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +2 -2
  140. package/lib/typescript-reporter/reporter/TypeScriptReporter.js +24 -16
  141. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +2 -2
  142. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +1 -0
  143. package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +2 -2
  144. package/lib/utils/async/pool.d.ts +1 -0
  145. package/lib/utils/async/pool.js +10 -0
  146. package/lib/utils/path/relativeToContext.d.ts +2 -0
  147. package/lib/utils/path/relativeToContext.js +16 -0
  148. package/lib/watch/InclusiveNodeWatchFileSystem.d.ts +5 -5
  149. package/lib/watch/InclusiveNodeWatchFileSystem.js +111 -90
  150. package/lib/watch/WatchFileSystem.d.ts +5 -22
  151. package/package.json +52 -54
  152. package/CHANGELOG.md +0 -318
  153. package/changelog.config.js +0 -36
  154. package/lib/eslint-reporter/EsLintReporterConfiguration.d.ts +0 -11
  155. package/lib/eslint-reporter/EsLintReporterConfiguration.js +0 -26
  156. package/lib/eslint-reporter/EsLintReporterOptions.d.ts +0 -8
  157. package/lib/eslint-reporter/assertEsLintSupport.d.ts +0 -3
  158. package/lib/eslint-reporter/assertEsLintSupport.js +0 -30
  159. package/lib/eslint-reporter/issue/EsLintIssueFactory.d.ts +0 -4
  160. package/lib/eslint-reporter/issue/EsLintIssueFactory.js +0 -32
  161. package/lib/eslint-reporter/reporter/EsLintReporter.d.ts +0 -4
  162. package/lib/eslint-reporter/reporter/EsLintReporter.js +0 -85
  163. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.d.ts +0 -4
  164. package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.js +0 -13
  165. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.d.ts +0 -1
  166. package/lib/eslint-reporter/reporter/EsLintReporterRpcService.js +0 -11
  167. package/lib/eslint-reporter/types/eslint.d.ts +0 -31
  168. package/lib/eslint-reporter/types/eslint.js +0 -2
  169. package/lib/formatter/FormatterFactory.d.ts +0 -13
  170. package/lib/formatter/FormatterFactory.js +0 -17
  171. package/lib/reporter/Dependencies.d.ts +0 -6
  172. package/lib/reporter/Dependencies.js +0 -2
  173. package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
  174. package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
@@ -1,5 +1,5 @@
1
- import webpack from 'webpack';
2
- import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
3
- import { ReporterRpcClient } from '../reporter';
4
- declare function tapStopToDisconnectReporter(compiler: webpack.Compiler, reporter: ReporterRpcClient, state: ForkTsCheckerWebpackPluginState): void;
1
+ import type webpack from 'webpack';
2
+ import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
3
+ import type { ReporterRpcClient } from '../reporter';
4
+ declare function tapStopToDisconnectReporter(compiler: webpack.Compiler, issuesReporter: ReporterRpcClient, dependenciesReporter: ReporterRpcClient, state: ForkTsCheckerWebpackPluginState): void;
5
5
  export { tapStopToDisconnectReporter };
@@ -9,18 +9,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function tapStopToDisconnectReporter(compiler, reporter, state) {
12
+ exports.tapStopToDisconnectReporter = void 0;
13
+ function tapStopToDisconnectReporter(compiler, issuesReporter, dependenciesReporter, state) {
13
14
  compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
14
- reporter.disconnect();
15
+ issuesReporter.disconnect();
16
+ dependenciesReporter.disconnect();
15
17
  });
16
18
  compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', () => __awaiter(this, void 0, void 0, function* () {
17
19
  if (!state.watching) {
18
- yield reporter.disconnect();
20
+ yield Promise.all([issuesReporter.disconnect(), dependenciesReporter.disconnect()]);
19
21
  }
20
22
  }));
21
23
  compiler.hooks.failed.tap('ForkTsCheckerWebpackPlugin', () => {
22
24
  if (!state.watching) {
23
- reporter.disconnect();
25
+ issuesReporter.disconnect();
26
+ dependenciesReporter.disconnect();
24
27
  }
25
28
  });
26
29
  }
@@ -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
  /**
@@ -23,7 +24,7 @@ function createAggregatedReporter(reporter) {
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
  });
@@ -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) {
@@ -0,0 +1,7 @@
1
+ interface FilesMatch {
2
+ files: string[];
3
+ dirs: string[];
4
+ excluded: string[];
5
+ extensions: string[];
6
+ }
7
+ export { FilesMatch };
@@ -1,7 +1,7 @@
1
- import { Dependencies } from './Dependencies';
2
- import { Issue } from '../issue';
1
+ import type { Issue } from '../issue';
2
+ import type { FilesMatch } from './FilesMatch';
3
3
  interface Report {
4
- getDependencies(): Promise<Dependencies>;
4
+ getDependencies(): Promise<FilesMatch>;
5
5
  getIssues(): Promise<Issue[]>;
6
6
  close(): Promise<void>;
7
7
  }
@@ -1,5 +1,5 @@
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
4
  getReport(change: FilesChange, watching: boolean): Promise<Report>;
5
5
  }
@@ -2,6 +2,6 @@ export * from './Report';
2
2
  export * from './Reporter';
3
3
  export * from './AggregatedReporter';
4
4
  export * from './FilesChange';
5
- export * from './Dependencies';
5
+ export * from './FilesMatch';
6
6
  export * from './reporter-rpc/ReporterRpcClient';
7
7
  export * from './reporter-rpc/ReporterRpcService';
@@ -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>;
@@ -12,9 +12,12 @@ 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.composeReporterRpcClients = exports.createReporterRpcClient = void 0;
15
16
  const rpc_1 = require("../../rpc");
16
- const ReporterRpcProcedure_1 = require("./ReporterRpcProcedure");
17
17
  const flatten_1 = __importDefault(require("../../utils/array/flatten"));
18
+ const ReporterRpcProcedure_1 = require("./ReporterRpcProcedure");
19
+ // suppressing because it will be removed anyway
20
+ // eslint-disable-next-line @typescript-eslint/ban-types
18
21
  function createReporterRpcClient(channel, configuration) {
19
22
  const rpcClient = rpc_1.createRpcClient(channel.clientPort);
20
23
  return {
@@ -24,8 +27,17 @@ function createReporterRpcClient(channel, configuration) {
24
27
  yield channel.open();
25
28
  }
26
29
  if (!rpcClient.isConnected()) {
27
- yield rpcClient.connect();
28
- yield rpcClient.dispatchCall(ReporterRpcProcedure_1.configure, configuration);
30
+ try {
31
+ yield rpcClient.connect();
32
+ yield rpcClient.dispatchCall(ReporterRpcProcedure_1.configure, configuration);
33
+ }
34
+ catch (error) {
35
+ // connect or configure was not successful -
36
+ // close the reporter and re-throw an error
37
+ yield rpcClient.disconnect();
38
+ yield channel.close();
39
+ throw error;
40
+ }
29
41
  }
30
42
  }),
31
43
  disconnect: () => __awaiter(this, void 0, void 0, function* () {
@@ -62,8 +74,9 @@ function composeReporterRpcClients(clients) {
62
74
  getDependencies: () => Promise.all(reports.map((report) => report.getDependencies())).then((dependencies) => dependencies.reduce((mergedDependencies, singleDependencies) => ({
63
75
  files: Array.from(new Set([...mergedDependencies.files, ...singleDependencies.files])),
64
76
  dirs: Array.from(new Set([...mergedDependencies.dirs, ...singleDependencies.dirs])),
77
+ excluded: Array.from(new Set([...mergedDependencies.excluded, ...singleDependencies.excluded])),
65
78
  extensions: Array.from(new Set([...mergedDependencies.extensions, ...singleDependencies.extensions])),
66
- }), { files: [], dirs: [], extensions: [] })),
79
+ }), { files: [], dirs: [], excluded: [], extensions: [] })),
67
80
  getIssues: () => Promise.all(reports.map((report) => report.getIssues())).then((issues) => flatten_1.default(issues)),
68
81
  close: () => Promise.all(reports.map((report) => report.close())).then(() => undefined),
69
82
  })),
@@ -1,13 +1,13 @@
1
- import { RpcProcedure } from '../../rpc';
2
- import { FilesChange } from '../FilesChange';
3
- import { Issue } from '../../issue';
4
- import { Dependencies } from '../Dependencies';
1
+ import type { Issue } from '../../issue';
2
+ import type { RpcProcedure } from '../../rpc';
3
+ import type { FilesChange } from '../FilesChange';
4
+ import type { FilesMatch } from '../FilesMatch';
5
5
  declare const configure: RpcProcedure<object, void>;
6
6
  declare const getReport: RpcProcedure<{
7
7
  change: FilesChange;
8
8
  watching: boolean;
9
9
  }, void>;
10
- declare const getDependencies: RpcProcedure<void, Dependencies>;
10
+ declare const getDependencies: RpcProcedure<void, FilesMatch>;
11
11
  declare const getIssues: RpcProcedure<void, Issue[]>;
12
12
  declare const closeReport: RpcProcedure<void, void>;
13
13
  export { configure, getReport, getDependencies, getIssues, closeReport };
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.closeReport = exports.getIssues = exports.getDependencies = exports.getReport = exports.configure = void 0;
4
+ // suppressing because it will be removed anyway
5
+ // eslint-disable-next-line @typescript-eslint/ban-types
3
6
  const configure = 'configure';
4
7
  exports.configure = configure;
5
8
  const getReport = 'getReport';
@@ -1,5 +1,5 @@
1
- import { Reporter } from '../Reporter';
2
- import { RpcMessagePort } from '../../rpc';
1
+ import type { RpcMessagePort } from '../../rpc';
2
+ import type { Reporter } from '../Reporter';
3
3
  interface ReporterRpcService {
4
4
  isOpen: () => boolean;
5
5
  open: () => Promise<void>;
@@ -9,8 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.registerReporterRpcService = void 0;
12
13
  const rpc_1 = require("../../rpc");
13
14
  const ReporterRpcProcedure_1 = require("./ReporterRpcProcedure");
15
+ // suppressing because it will be removed anyway
16
+ // eslint-disable-next-line @typescript-eslint/ban-types
14
17
  function registerReporterRpcService(servicePort, reporterFactory) {
15
18
  const rpcService = rpc_1.createRpcService(servicePort);
16
19
  let reporterRegistered = false;
@@ -1,5 +1,5 @@
1
- import { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
2
- import { RpcMessagePort } from './RpcMessagePort';
1
+ import type { RpcMessagePort } from './RpcMessagePort';
2
+ import type { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
3
3
  interface RpcClient {
4
4
  readonly isConnected: () => boolean;
5
5
  readonly connect: () => Promise<void>;
@@ -9,8 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const RpcMessage_1 = require("./RpcMessage");
12
+ exports.createRpcClient = void 0;
13
13
  const RpcRemoteError_1 = require("./error/RpcRemoteError");
14
+ const RpcMessage_1 = require("./RpcMessage");
14
15
  /* eslint-enable @typescript-eslint/no-explicit-any */
15
16
  function createRpcClient(port) {
16
17
  let callIndex = 0;
@@ -1,4 +1,4 @@
1
- import { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
1
+ import type { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
2
2
  interface RpcMessage<TType extends string = string, TProcedure extends RpcProcedure = RpcProcedure, TPayload = unknown> {
3
3
  rpc: true;
4
4
  type: TType;