fork-ts-checker-webpack-plugin 7.0.0-alpha.7 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -49
- package/lib/files-change.d.ts +17 -0
- package/lib/{reporter/FilesChange.js → files-change.js} +20 -13
- package/lib/{reporter/FilesMatch.d.ts → files-match.d.ts} +1 -0
- package/lib/{ForkTsCheckerWebpackPluginOptions.js → files-match.js} +0 -0
- package/lib/formatter/{BasicFormatter.d.ts → basic-formatter.d.ts} +1 -1
- package/lib/formatter/{BasicFormatter.js → basic-formatter.js} +0 -0
- package/lib/formatter/{CodeFrameFormatter.d.ts → code-frame-formatter.d.ts} +1 -1
- package/lib/formatter/{CodeFrameFormatter.js → code-frame-formatter.js} +4 -4
- package/lib/formatter/formatter-config.d.ts +5 -0
- package/lib/formatter/{FormatterConfiguration.js → formatter-config.js} +8 -8
- package/lib/formatter/{FormatterOptions.d.ts → formatter-options.d.ts} +2 -2
- package/lib/formatter/{Formatter.js → formatter-options.js} +0 -0
- package/lib/formatter/{Formatter.d.ts → formatter.d.ts} +1 -1
- package/lib/formatter/{FormatterOptions.js → formatter.js} +0 -0
- package/lib/formatter/index.d.ts +6 -6
- package/lib/formatter/index.js +6 -6
- package/lib/formatter/stats-formatter.d.ts +3 -0
- package/lib/formatter/stats-formatter.js +28 -0
- package/lib/formatter/{WebpackFormatter.d.ts → webpack-formatter.d.ts} +1 -1
- package/lib/formatter/{WebpackFormatter.js → webpack-formatter.js} +3 -3
- package/lib/hooks/intercept-done-to-get-dev-server-tap.d.ts +5 -0
- package/lib/hooks/intercept-done-to-get-dev-server-tap.js +18 -0
- package/lib/hooks/tap-after-compile-to-add-dependencies.d.ts +5 -0
- package/lib/hooks/{tapAfterCompileToAddDependencies.js → tap-after-compile-to-add-dependencies.js} +4 -1
- package/lib/hooks/tap-after-compile-to-get-issues.d.ts +5 -0
- package/lib/hooks/{tapAfterCompileToGetIssues.js → tap-after-compile-to-get-issues.js} +9 -6
- package/lib/hooks/{tapAfterEnvironmentToPatchWatching.d.ts → tap-after-environment-to-patch-watching.d.ts} +2 -2
- package/lib/hooks/{tapAfterEnvironmentToPatchWatching.js → tap-after-environment-to-patch-watching.js} +8 -2
- package/lib/hooks/tap-done-to-async-get-issues.d.ts +5 -0
- package/lib/hooks/{tapDoneToAsyncGetIssues.js → tap-done-to-async-get-issues.js} +22 -23
- package/lib/hooks/tap-error-to-log-message.d.ts +4 -0
- package/lib/hooks/{tapErrorToLogMessage.js → tap-error-to-log-message.js} +8 -8
- package/lib/hooks/tap-start-to-run-workers.d.ts +8 -0
- package/lib/hooks/tap-start-to-run-workers.js +95 -0
- package/lib/hooks/tap-stop-to-terminate-workers.d.ts +5 -0
- package/lib/hooks/tap-stop-to-terminate-workers.js +26 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/infrastructure-logger.d.ts +9 -0
- package/lib/infrastructure-logger.js +14 -0
- package/lib/issue/index.d.ts +3 -3
- package/lib/issue/index.js +3 -3
- package/lib/issue/issue-config.d.ts +8 -0
- package/lib/issue/issue-config.js +29 -0
- package/lib/issue/{IssueLocation.d.ts → issue-location.d.ts} +1 -1
- package/lib/issue/{IssueLocation.js → issue-location.js} +3 -3
- package/lib/issue/{IssueMatch.d.ts → issue-match.d.ts} +2 -2
- package/lib/issue/{IssueMatch.js → issue-match.js} +3 -3
- package/lib/issue/{IssueOptions.d.ts → issue-options.d.ts} +2 -2
- package/lib/issue/{IssueOptions.js → issue-options.js} +0 -0
- package/lib/issue/{IssuePosition.d.ts → issue-position.d.ts} +0 -0
- package/lib/issue/{IssuePosition.js → issue-position.js} +0 -0
- package/lib/issue/{IssuePredicate.d.ts → issue-predicate.d.ts} +1 -1
- package/lib/issue/{IssuePredicate.js → issue-predicate.js} +0 -0
- package/lib/issue/{IssueSeverity.d.ts → issue-severity.d.ts} +0 -0
- package/lib/issue/{IssueSeverity.js → issue-severity.js} +0 -0
- package/lib/issue/{IssueWebpackError.d.ts → issue-webpack-error.d.ts} +1 -1
- package/lib/issue/{IssueWebpackError.js → issue-webpack-error.js} +5 -5
- package/lib/issue/{Issue.d.ts → issue.d.ts} +2 -2
- package/lib/issue/{Issue.js → issue.js} +5 -5
- package/lib/{logger/Logger.d.ts → logger.d.ts} +1 -2
- package/lib/{logger/Logger.js → logger.js} +0 -0
- package/lib/plugin-config.d.ts +16 -0
- package/lib/plugin-config.js +17 -0
- package/lib/{hooks/pluginHooks.d.ts → plugin-hooks.d.ts} +9 -9
- package/lib/{hooks/pluginHooks.js → plugin-hooks.js} +8 -8
- package/lib/plugin-options.d.ts +13 -0
- package/lib/{logger/LoggerOptions.js → plugin-options.js} +0 -0
- package/lib/plugin-options.json +224 -0
- package/lib/plugin-pools.d.ts +4 -0
- package/lib/plugin-pools.js +28 -0
- package/lib/plugin-state.d.ts +14 -0
- package/lib/{ForkTsCheckerWebpackPluginState.js → plugin-state.js} +4 -4
- package/lib/{ForkTsCheckerWebpackPlugin.d.ts → plugin.d.ts} +12 -8
- package/lib/plugin.js +82 -0
- package/lib/rpc/expose-rpc.d.ts +1 -0
- package/lib/rpc/expose-rpc.js +78 -0
- package/lib/rpc/index.d.ts +5 -7
- package/lib/rpc/index.js +10 -17
- package/lib/rpc/{rpc-ipc/error/RpcIpcMessagePortClosedError.d.ts → rpc-error.d.ts} +2 -3
- package/lib/rpc/rpc-error.js +12 -0
- package/lib/rpc/rpc-worker.d.ts +13 -0
- package/lib/rpc/rpc-worker.js +79 -0
- package/lib/rpc/types.d.ts +19 -0
- package/lib/{reporter/FilesMatch.js → rpc/types.js} +0 -0
- package/lib/rpc/wrap-rpc.d.ts +4 -0
- package/lib/rpc/wrap-rpc.js +96 -0
- package/lib/{typescript-reporter/extension/TypeScriptEmbeddedExtension.d.ts → typescript/extension/type-script-embedded-extension.d.ts} +1 -1
- package/lib/{typescript-reporter/extension/TypeScriptEmbeddedExtension.js → typescript/extension/type-script-embedded-extension.js} +3 -3
- package/lib/{typescript-reporter/extension/TypeScriptExtension.d.ts → typescript/extension/type-script-extension.d.ts} +3 -3
- package/lib/{reporter/Report.js → typescript/extension/type-script-extension.js} +0 -0
- package/lib/typescript/extension/vue/type-script-vue-extension-config.d.ts +7 -0
- package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.js → typescript/extension/vue/type-script-vue-extension-config.js} +3 -3
- package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtensionOptions.d.ts → typescript/extension/vue/type-script-vue-extension-options.d.ts} +0 -0
- package/lib/{reporter/Reporter.js → typescript/extension/vue/type-script-vue-extension-options.js} +0 -0
- package/lib/typescript/extension/vue/type-script-vue-extension-support.d.ts +3 -0
- package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.js → typescript/extension/vue/type-script-vue-extension-support.js} +3 -3
- package/lib/typescript/extension/vue/type-script-vue-extension.d.ts +4 -0
- package/lib/{typescript-reporter/extension/vue/TypeScriptVueExtension.js → typescript/extension/vue/type-script-vue-extension.js} +4 -4
- package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.d.ts +0 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.js +0 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/types/vue__compiler-sfc.d.ts +0 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/types/vue__compiler-sfc.js +0 -0
- package/lib/{typescript-reporter/TypeScriptConfigurationOverwrite.d.ts → typescript/type-script-config-overwrite.d.ts} +2 -2
- package/lib/{rpc/RpcHost.js → typescript/type-script-config-overwrite.js} +0 -0
- package/lib/{typescript-reporter/TypeScriptDiagnosticsOptions.d.ts → typescript/type-script-diagnostics-options.d.ts} +0 -0
- package/lib/{rpc/RpcMessagePort.js → typescript/type-script-diagnostics-options.js} +0 -0
- package/lib/typescript/type-script-support.d.ts +3 -0
- package/lib/{typescript-reporter/TypeScriptSupport.js → typescript/type-script-support.js} +15 -9
- package/lib/typescript/type-script-worker-config.d.ts +22 -0
- package/lib/typescript/type-script-worker-config.js +21 -0
- package/lib/typescript/type-script-worker-options.d.ts +18 -0
- package/lib/{rpc/RpcProcedure.js → typescript/type-script-worker-options.js} +0 -0
- package/lib/typescript/worker/get-dependencies-worker.d.ts +5 -0
- package/lib/typescript/worker/get-dependencies-worker.js +18 -0
- package/lib/typescript/worker/get-issues-worker.d.ts +5 -0
- package/lib/typescript/worker/get-issues-worker.js +75 -0
- package/lib/typescript/worker/lib/artifacts.d.ts +4 -0
- package/lib/typescript/worker/lib/artifacts.js +90 -0
- package/lib/typescript/worker/lib/config.d.ts +13 -0
- package/lib/typescript/worker/lib/config.js +131 -0
- package/lib/typescript/worker/lib/dependencies.d.ts +3 -0
- package/lib/typescript/worker/lib/dependencies.js +87 -0
- package/lib/typescript/worker/lib/diagnostics.d.ts +7 -0
- package/lib/typescript/worker/lib/diagnostics.js +100 -0
- package/lib/typescript/worker/lib/emit.d.ts +2 -0
- package/lib/typescript/worker/lib/emit.js +13 -0
- package/lib/typescript/worker/lib/extensions.d.ts +3 -0
- package/lib/typescript/worker/lib/extensions.js +11 -0
- package/lib/{typescript-reporter/file-system/FileSystem.d.ts → typescript/worker/lib/file-system/file-system.d.ts} +2 -3
- package/lib/{typescript-reporter/TypeScriptConfigurationOverwrite.js → typescript/worker/lib/file-system/file-system.js} +0 -0
- package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +78 -0
- package/lib/typescript/worker/lib/file-system/passive-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/passive-file-system.js +65 -0
- package/lib/typescript/worker/lib/file-system/real-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/real-file-system.js +187 -0
- package/lib/typescript/worker/lib/host/compiler-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/compiler-host.js +17 -0
- package/lib/typescript/worker/lib/host/watch-compiler-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/watch-compiler-host.js +32 -0
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +54 -0
- package/lib/typescript/worker/lib/performance.d.ts +3 -0
- package/lib/typescript/worker/lib/performance.js +32 -0
- package/lib/typescript/worker/lib/program/program.d.ts +2 -0
- package/lib/typescript/worker/lib/program/program.js +34 -0
- package/lib/typescript/worker/lib/program/solution-builder.d.ts +2 -0
- package/lib/typescript/worker/lib/program/solution-builder.js +39 -0
- package/lib/typescript/worker/lib/program/watch-program.d.ts +3 -0
- package/lib/typescript/worker/lib/program/watch-program.js +51 -0
- package/lib/{typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts → typescript/worker/lib/system.d.ts} +5 -7
- package/lib/typescript/worker/lib/system.js +222 -0
- package/lib/typescript/worker/lib/tracing.d.ts +4 -0
- package/lib/typescript/worker/lib/tracing.js +28 -0
- package/lib/typescript/worker/lib/tsbuildinfo.d.ts +4 -0
- package/lib/typescript/worker/lib/tsbuildinfo.js +92 -0
- package/lib/typescript/worker/lib/typescript.d.ts +2 -0
- package/lib/typescript/worker/lib/typescript.js +6 -0
- package/lib/typescript/worker/lib/worker-config.d.ts +2 -0
- package/lib/typescript/worker/lib/worker-config.js +5 -0
- package/lib/utils/async/{isPending.d.ts → is-pending.d.ts} +1 -1
- package/lib/utils/async/{isPending.js → is-pending.js} +2 -1
- package/lib/utils/async/pool.d.ts +1 -1
- package/lib/utils/async/pool.js +3 -14
- package/lib/utils/async/wait.d.ts +1 -1
- package/lib/utils/async/wait.js +2 -1
- package/lib/utils/path/{forwardSlash.d.ts → forward-slash.d.ts} +1 -1
- package/lib/utils/path/{forwardSlash.js → forward-slash.js} +2 -1
- package/lib/utils/path/{relativeToContext.d.ts → relative-to-context.d.ts} +0 -0
- package/lib/utils/path/{relativeToContext.js → relative-to-context.js} +2 -2
- package/lib/watch/{InclusiveNodeWatchFileSystem.d.ts → inclusive-node-watch-file-system.d.ts} +7 -7
- package/lib/watch/{InclusiveNodeWatchFileSystem.js → inclusive-node-watch-file-system.js} +54 -21
- package/lib/watch/{WatchFileSystem.d.ts → watch-file-system.d.ts} +3 -3
- package/lib/{typescript-reporter/TypeScriptDiagnosticsOptions.js → watch/watch-file-system.js} +0 -0
- package/package.json +41 -35
- package/lib/ForkTsCheckerWebpackPlugin.js +0 -67
- package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +0 -15
- package/lib/ForkTsCheckerWebpackPluginConfiguration.js +0 -17
- package/lib/ForkTsCheckerWebpackPluginOptions.d.ts +0 -12
- package/lib/ForkTsCheckerWebpackPluginOptions.json +0 -255
- package/lib/ForkTsCheckerWebpackPluginState.d.ts +0 -14
- package/lib/error/OperationCanceledError.d.ts +0 -4
- package/lib/error/OperationCanceledError.js +0 -10
- package/lib/formatter/FormatterConfiguration.d.ts +0 -5
- package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +0 -5
- package/lib/hooks/interceptDoneToGetWebpackDevServerTap.js +0 -17
- package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +0 -5
- package/lib/hooks/tapAfterCompileToGetIssues.d.ts +0 -5
- package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +0 -5
- package/lib/hooks/tapErrorToLogMessage.d.ts +0 -4
- package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +0 -6
- package/lib/hooks/tapStartToConnectAndRunReporter.js +0 -108
- package/lib/hooks/tapStopToDisconnectReporter.d.ts +0 -5
- package/lib/hooks/tapStopToDisconnectReporter.js +0 -28
- package/lib/issue/IssueConfiguration.d.ts +0 -8
- package/lib/issue/IssueConfiguration.js +0 -29
- package/lib/logger/LoggerConfiguration.d.ts +0 -10
- package/lib/logger/LoggerConfiguration.js +0 -12
- package/lib/logger/LoggerFactory.d.ts +0 -5
- package/lib/logger/LoggerFactory.js +0 -21
- package/lib/logger/LoggerOptions.d.ts +0 -8
- package/lib/logger/PartialLogger.d.ts +0 -4
- package/lib/logger/PartialLogger.js +0 -11
- package/lib/logger/WebpackInfrastructureLogger.d.ts +0 -4
- package/lib/logger/WebpackInfrastructureLogger.js +0 -13
- package/lib/profile/Performance.d.ts +0 -11
- package/lib/profile/Performance.js +0 -63
- package/lib/reporter/AggregatedReporter.d.ts +0 -6
- package/lib/reporter/AggregatedReporter.js +0 -61
- package/lib/reporter/FilesChange.d.ts +0 -16
- package/lib/reporter/Report.d.ts +0 -8
- package/lib/reporter/Reporter.d.ts +0 -6
- package/lib/reporter/index.d.ts +0 -7
- package/lib/reporter/index.js +0 -19
- package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +0 -10
- package/lib/reporter/reporter-rpc/ReporterRpcClient.js +0 -75
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +0 -13
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +0 -15
- package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +0 -9
- package/lib/reporter/reporter-rpc/ReporterRpcService.js +0 -77
- package/lib/rpc/RpcClient.d.ts +0 -10
- package/lib/rpc/RpcClient.js +0 -79
- package/lib/rpc/RpcHost.d.ts +0 -6
- package/lib/rpc/RpcMessage.d.ts +0 -26
- package/lib/rpc/RpcMessage.js +0 -48
- package/lib/rpc/RpcMessageChannel.d.ts +0 -10
- package/lib/rpc/RpcMessageChannel.js +0 -50
- package/lib/rpc/RpcMessagePort.d.ts +0 -14
- package/lib/rpc/RpcProcedure.d.ts +0 -5
- package/lib/rpc/RpcService.d.ts +0 -12
- package/lib/rpc/RpcService.js +0 -64
- package/lib/rpc/error/RpcMessagePortClosedError.d.ts +0 -3
- package/lib/rpc/error/RpcMessagePortClosedError.js +0 -6
- package/lib/rpc/error/RpcRemoteError.d.ts +0 -6
- package/lib/rpc/error/RpcRemoteError.js +0 -18
- package/lib/rpc/rpc-ipc/ProcessLike.d.ts +0 -12
- package/lib/rpc/rpc-ipc/ProcessLike.js +0 -3
- package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.d.ts +0 -3
- package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.js +0 -11
- package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +0 -5
- package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +0 -151
- package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +0 -13
- package/lib/rpc/rpc-ipc/index.d.ts +0 -2
- package/lib/rpc/rpc-ipc/index.js +0 -14
- package/lib/typescript-reporter/TypeScriptReporterConfiguration.d.ts +0 -22
- package/lib/typescript-reporter/TypeScriptReporterConfiguration.js +0 -31
- package/lib/typescript-reporter/TypeScriptReporterOptions.d.ts +0 -19
- package/lib/typescript-reporter/TypeScriptReporterOptions.js +0 -2
- package/lib/typescript-reporter/TypeScriptSupport.d.ts +0 -3
- package/lib/typescript-reporter/extension/TypeScriptExtension.js +0 -2
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +0 -4
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +0 -7
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionOptions.js +0 -2
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.d.ts +0 -3
- package/lib/typescript-reporter/file-system/FileSystem.js +0 -2
- package/lib/typescript-reporter/file-system/MemFileSystem.d.ts +0 -8
- package/lib/typescript-reporter/file-system/MemFileSystem.js +0 -82
- package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +0 -9
- package/lib/typescript-reporter/file-system/PassiveFileSystem.js +0 -69
- package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +0 -8
- package/lib/typescript-reporter/file-system/RealFileSystem.js +0 -180
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +0 -4
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +0 -57
- package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +0 -10
- package/lib/typescript-reporter/profile/TypeScriptPerformance.js +0 -34
- package/lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts +0 -5
- package/lib/typescript-reporter/reporter/ControlledCompilerHost.js +0 -14
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +0 -214
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +0 -5
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +0 -29
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +0 -5
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +0 -71
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +0 -8
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +0 -156
- package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +0 -4
- package/lib/typescript-reporter/reporter/TypeScriptReporter.js +0 -396
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +0 -4
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +0 -14
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.d.ts +0 -1
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +0 -11
- package/lib/utils/array/flatten.d.ts +0 -2
- package/lib/utils/array/flatten.js +0 -6
- package/lib/utils/array/intersect.d.ts +0 -2
- package/lib/utils/array/intersect.js +0 -6
- package/lib/utils/array/substract.d.ts +0 -2
- package/lib/utils/array/substract.js +0 -6
- package/lib/utils/array/unique.d.ts +0 -2
- package/lib/utils/array/unique.js +0 -6
- package/lib/watch/WatchFileSystem.js +0 -2
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tapAfterEnvironmentToPatchWatching = void 0;
|
|
4
|
-
const
|
|
4
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
5
|
+
const inclusive_node_watch_file_system_1 = require("../watch/inclusive-node-watch-file-system");
|
|
5
6
|
function tapAfterEnvironmentToPatchWatching(compiler, state) {
|
|
7
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
6
8
|
compiler.hooks.afterEnvironment.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
7
9
|
const watchFileSystem = compiler.watchFileSystem;
|
|
8
10
|
if (watchFileSystem) {
|
|
11
|
+
debug("Overwriting webpack's watch file system.");
|
|
9
12
|
// wrap original watch file system
|
|
10
|
-
compiler.watchFileSystem = new
|
|
13
|
+
compiler.watchFileSystem = new inclusive_node_watch_file_system_1.InclusiveNodeWatchFileSystem(
|
|
11
14
|
// we use some internals here
|
|
12
15
|
watchFileSystem, compiler, state);
|
|
13
16
|
}
|
|
17
|
+
else {
|
|
18
|
+
debug('No watch file system found - plugin may not work correctly.');
|
|
19
|
+
}
|
|
14
20
|
});
|
|
15
21
|
}
|
|
16
22
|
exports.tapAfterEnvironmentToPatchWatching = tapAfterEnvironmentToPatchWatching;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
4
|
+
declare function tapDoneToAsyncGetIssues(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
+
export { tapDoneToAsyncGetIssues };
|
|
@@ -14,31 +14,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.tapDoneToAsyncGetIssues = void 0;
|
|
16
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const stats_formatter_1 = require("../formatter/stats-formatter");
|
|
18
|
+
const webpack_formatter_1 = require("../formatter/webpack-formatter");
|
|
19
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
20
|
+
const issue_webpack_error_1 = require("../issue/issue-webpack-error");
|
|
21
|
+
const plugin_hooks_1 = require("../plugin-hooks");
|
|
22
|
+
const is_pending_1 = require("../utils/async/is-pending");
|
|
23
|
+
const wait_1 = require("../utils/async/wait");
|
|
24
|
+
function tapDoneToAsyncGetIssues(compiler, config, state) {
|
|
25
|
+
const hooks = (0, plugin_hooks_1.getPluginHooks)(compiler);
|
|
26
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
24
27
|
compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', (stats) => __awaiter(this, void 0, void 0, function* () {
|
|
25
28
|
if (stats.compilation.compiler !== compiler) {
|
|
26
29
|
// run only for the compiler that the plugin was registered for
|
|
27
30
|
return;
|
|
28
31
|
}
|
|
29
|
-
const reportPromise = state.reportPromise;
|
|
30
32
|
const issuesPromise = state.issuesPromise;
|
|
31
33
|
let issues;
|
|
32
34
|
try {
|
|
33
|
-
if (yield
|
|
35
|
+
if (yield (0, is_pending_1.isPending)(issuesPromise)) {
|
|
34
36
|
hooks.waiting.call(stats.compilation);
|
|
35
|
-
|
|
37
|
+
config.logger.log(chalk_1.default.cyan('Type-checking in progress...'));
|
|
36
38
|
}
|
|
37
39
|
else {
|
|
38
40
|
// wait 10ms to log issues after webpack stats
|
|
39
|
-
yield wait_1.
|
|
41
|
+
yield (0, wait_1.wait)(10);
|
|
40
42
|
}
|
|
41
43
|
issues = yield issuesPromise;
|
|
44
|
+
debug('Got issues from getIssuesWorker.', issues === null || issues === void 0 ? void 0 : issues.length);
|
|
42
45
|
}
|
|
43
46
|
catch (error) {
|
|
44
47
|
hooks.error.call(error, stats.compilation);
|
|
@@ -48,27 +51,25 @@ function tapDoneToAsyncGetIssues(compiler, configuration, state) {
|
|
|
48
51
|
// some error has been thrown or it was canceled
|
|
49
52
|
return;
|
|
50
53
|
}
|
|
51
|
-
if (reportPromise !== state.reportPromise) {
|
|
52
|
-
// there is a newer report - ignore this one
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
54
|
// filter list of issues by provided issue predicate
|
|
56
|
-
issues = issues.filter(
|
|
55
|
+
issues = issues.filter(config.issue.predicate);
|
|
57
56
|
// modify list of issues in the plugin hooks
|
|
58
57
|
issues = hooks.issues.call(issues, stats.compilation);
|
|
59
|
-
const formatter =
|
|
58
|
+
const formatter = (0, webpack_formatter_1.createWebpackFormatter)(config.formatter);
|
|
60
59
|
if (issues.length) {
|
|
61
60
|
// follow webpack's approach - one process.write to stderr with all errors and warnings
|
|
62
|
-
|
|
61
|
+
config.logger.error(issues.map((issue) => formatter(issue)).join('\n'));
|
|
62
|
+
// print stats of the compilation
|
|
63
|
+
config.logger.log((0, stats_formatter_1.statsFormatter)(issues, stats));
|
|
63
64
|
}
|
|
64
65
|
else {
|
|
65
|
-
|
|
66
|
+
config.logger.log(chalk_1.default.green('No errors found.'));
|
|
66
67
|
}
|
|
67
68
|
// report issues to webpack-dev-server, if it's listening
|
|
68
69
|
// skip reporting if there are no issues, to avoid an extra hot reload
|
|
69
70
|
if (issues.length && state.webpackDevServerDoneTap) {
|
|
70
71
|
issues.forEach((issue) => {
|
|
71
|
-
const error = new
|
|
72
|
+
const error = new issue_webpack_error_1.IssueWebpackError(config.formatter(issue), issue);
|
|
72
73
|
if (issue.severity === 'warning') {
|
|
73
74
|
stats.compilation.warnings.push(error);
|
|
74
75
|
}
|
|
@@ -76,11 +77,9 @@ function tapDoneToAsyncGetIssues(compiler, configuration, state) {
|
|
|
76
77
|
stats.compilation.errors.push(error);
|
|
77
78
|
}
|
|
78
79
|
});
|
|
80
|
+
debug('Sending issues to the webpack-dev-server.');
|
|
79
81
|
state.webpackDevServerDoneTap.fn(stats);
|
|
80
82
|
}
|
|
81
|
-
if (stats.startTime) {
|
|
82
|
-
configuration.logger.infrastructure.log(`Time: ${Math.round(Date.now() - stats.startTime).toString()} ms`);
|
|
83
|
-
}
|
|
84
83
|
}));
|
|
85
84
|
}
|
|
86
85
|
exports.tapDoneToAsyncGetIssues = tapDoneToAsyncGetIssues;
|
|
@@ -4,21 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.tapErrorToLogMessage = void 0;
|
|
7
|
-
const pluginHooks_1 = require("./pluginHooks");
|
|
8
|
-
const RpcIpcMessagePortClosedError_1 = require("../rpc/rpc-ipc/error/RpcIpcMessagePortClosedError");
|
|
9
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const plugin_hooks_1 = require("../plugin-hooks");
|
|
9
|
+
const rpc_1 = require("../rpc");
|
|
10
|
+
function tapErrorToLogMessage(compiler, config) {
|
|
11
|
+
const hooks = (0, plugin_hooks_1.getPluginHooks)(compiler);
|
|
12
12
|
hooks.error.tap('ForkTsCheckerWebpackPlugin', (error) => {
|
|
13
|
-
|
|
14
|
-
if (error instanceof
|
|
13
|
+
config.logger.error(String(error));
|
|
14
|
+
if (error instanceof rpc_1.RpcExitError) {
|
|
15
15
|
if (error.signal === 'SIGINT') {
|
|
16
|
-
|
|
16
|
+
config.logger.error(chalk_1.default.red('Issues checking service interrupted - If running in a docker container, this may be caused ' +
|
|
17
17
|
"by the container running out of memory. If so, try increasing the container's memory limit " +
|
|
18
18
|
'or lowering the `memoryLimit` value in the ForkTsCheckerWebpackPlugin configuration.'));
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
|
|
21
|
+
config.logger.error(chalk_1.default.red('Issues checking service aborted - probably out of memory. ' +
|
|
22
22
|
'Check the `memoryLimit` option in the ForkTsCheckerWebpackPlugin configuration.\n' +
|
|
23
23
|
"If increasing the memory doesn't solve the issue, it's most probably a bug in the TypeScript."));
|
|
24
24
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
4
|
+
import type { RpcWorker } from '../rpc';
|
|
5
|
+
import type { GetDependenciesWorker } from '../typescript/worker/get-dependencies-worker';
|
|
6
|
+
import type { GetIssuesWorker } from '../typescript/worker/get-issues-worker';
|
|
7
|
+
declare function tapStartToRunWorkers(compiler: webpack.Compiler, getIssuesWorker: RpcWorker<GetIssuesWorker>, getDependenciesWorker: RpcWorker<GetDependenciesWorker>, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
|
|
8
|
+
export { tapStartToRunWorkers };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.tapStartToRunWorkers = void 0;
|
|
13
|
+
const files_change_1 = require("../files-change");
|
|
14
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
15
|
+
const plugin_hooks_1 = require("../plugin-hooks");
|
|
16
|
+
const plugin_pools_1 = require("../plugin-pools");
|
|
17
|
+
const intercept_done_to_get_dev_server_tap_1 = require("./intercept-done-to-get-dev-server-tap");
|
|
18
|
+
const tap_after_compile_to_get_issues_1 = require("./tap-after-compile-to-get-issues");
|
|
19
|
+
const tap_done_to_async_get_issues_1 = require("./tap-done-to-async-get-issues");
|
|
20
|
+
function tapStartToRunWorkers(compiler, getIssuesWorker, getDependenciesWorker, config, state) {
|
|
21
|
+
const hooks = (0, plugin_hooks_1.getPluginHooks)(compiler);
|
|
22
|
+
const { log, debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
23
|
+
compiler.hooks.run.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
24
|
+
if (!state.initialized) {
|
|
25
|
+
debug('Initializing plugin for single run (not async).');
|
|
26
|
+
state.initialized = true;
|
|
27
|
+
state.watching = false;
|
|
28
|
+
(0, tap_after_compile_to_get_issues_1.tapAfterCompileToGetIssues)(compiler, config, state);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
compiler.hooks.watchRun.tap('ForkTsCheckerWebpackPlugin', () => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (!state.initialized) {
|
|
33
|
+
state.initialized = true;
|
|
34
|
+
state.watching = true;
|
|
35
|
+
if (config.async) {
|
|
36
|
+
debug('Initializing plugin for watch run (async).');
|
|
37
|
+
(0, tap_done_to_async_get_issues_1.tapDoneToAsyncGetIssues)(compiler, config, state);
|
|
38
|
+
(0, intercept_done_to_get_dev_server_tap_1.interceptDoneToGetDevServerTap)(compiler, config, state);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
debug('Initializing plugin for watch run (not async).');
|
|
42
|
+
(0, tap_after_compile_to_get_issues_1.tapAfterCompileToGetIssues)(compiler, config, state);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
compiler.hooks.compilation.tap('ForkTsCheckerWebpackPlugin', (compilation) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
if (compilation.compiler !== compiler) {
|
|
48
|
+
// run only for the compiler that the plugin was registered for
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const iteration = ++state.iteration;
|
|
52
|
+
let change = {};
|
|
53
|
+
if (state.watching) {
|
|
54
|
+
change = (0, files_change_1.consumeFilesChange)(compiler);
|
|
55
|
+
log([
|
|
56
|
+
'Calling reporter service for incremental check.',
|
|
57
|
+
` Changed files: ${JSON.stringify(change.changedFiles)}`,
|
|
58
|
+
` Deleted files: ${JSON.stringify(change.deletedFiles)}`,
|
|
59
|
+
].join('\n'));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
log('Calling reporter service for single check.');
|
|
63
|
+
}
|
|
64
|
+
change = yield hooks.start.promise(change, compilation);
|
|
65
|
+
debug(`Submitting the getIssuesWorker to the pool, iteration ${iteration}.`);
|
|
66
|
+
state.issuesPromise = plugin_pools_1.issuesPool.submit(() => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
try {
|
|
68
|
+
debug(`Running the getIssuesWorker, iteration ${iteration}.`);
|
|
69
|
+
return yield getIssuesWorker(change, state.watching);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
hooks.error.call(error, compilation);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
debug(`The getIssuesWorker finished its job, iteration ${iteration}.`);
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
debug(`Submitting the getDependenciesWorker to the pool, iteration ${iteration}.`);
|
|
80
|
+
state.dependenciesPromise = plugin_pools_1.dependenciesPool.submit(() => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
try {
|
|
82
|
+
debug(`Running the getDependenciesWorker, iteration ${iteration}.`);
|
|
83
|
+
return yield getDependenciesWorker(change);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
hooks.error.call(error, compilation);
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
debug(`The getDependenciesWorker finished its job, iteration ${iteration}.`);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
exports.tapStartToRunWorkers = tapStartToRunWorkers;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
3
|
+
import type { RpcWorker } from '../rpc';
|
|
4
|
+
declare function tapStopToTerminateWorkers(compiler: webpack.Compiler, getIssuesWorker: RpcWorker, getDependenciesWorker: RpcWorker, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
+
export { tapStopToTerminateWorkers };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tapStopToTerminateWorkers = void 0;
|
|
4
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
5
|
+
function tapStopToTerminateWorkers(compiler, getIssuesWorker, getDependenciesWorker, state) {
|
|
6
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
7
|
+
const terminateWorkers = () => {
|
|
8
|
+
debug('Compiler is going to close - terminating workers...');
|
|
9
|
+
getIssuesWorker.terminate();
|
|
10
|
+
getDependenciesWorker.terminate();
|
|
11
|
+
};
|
|
12
|
+
compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
13
|
+
terminateWorkers();
|
|
14
|
+
});
|
|
15
|
+
compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
16
|
+
if (!state.watching) {
|
|
17
|
+
terminateWorkers();
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
compiler.hooks.failed.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
21
|
+
if (!state.watching) {
|
|
22
|
+
terminateWorkers();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.tapStopToTerminateWorkers = tapStopToTerminateWorkers;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ForkTsCheckerWebpackPlugin } from './
|
|
1
|
+
import { ForkTsCheckerWebpackPlugin } from './plugin';
|
|
2
2
|
export = ForkTsCheckerWebpackPlugin;
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
module.exports =
|
|
2
|
+
const plugin_1 = require("./plugin");
|
|
3
|
+
module.exports = plugin_1.ForkTsCheckerWebpackPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
export interface InfrastructureLogger {
|
|
3
|
+
log(...args: unknown[]): void;
|
|
4
|
+
debug(...args: unknown[]): void;
|
|
5
|
+
error(...args: unknown[]): void;
|
|
6
|
+
warn(...args: unknown[]): void;
|
|
7
|
+
info(...args: unknown[]): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function getInfrastructureLogger(compiler: webpack.Compiler): InfrastructureLogger;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInfrastructureLogger = void 0;
|
|
4
|
+
function getInfrastructureLogger(compiler) {
|
|
5
|
+
const logger = compiler.getInfrastructureLogger('ForkTsCheckerWebpackPlugin');
|
|
6
|
+
return {
|
|
7
|
+
log: logger.log.bind(logger),
|
|
8
|
+
debug: logger.debug.bind(logger),
|
|
9
|
+
error: logger.error.bind(logger),
|
|
10
|
+
warn: logger.warn.bind(logger),
|
|
11
|
+
info: logger.info.bind(logger),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.getInfrastructureLogger = getInfrastructureLogger;
|
package/lib/issue/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './issue';
|
|
2
|
+
export * from './issue-severity';
|
|
3
|
+
export * from './issue-location';
|
package/lib/issue/index.js
CHANGED
|
@@ -10,6 +10,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./
|
|
14
|
-
__exportStar(require("./
|
|
15
|
-
__exportStar(require("./
|
|
13
|
+
__exportStar(require("./issue"), exports);
|
|
14
|
+
__exportStar(require("./issue-severity"), exports);
|
|
15
|
+
__exportStar(require("./issue-location"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { IssueOptions } from './issue-options';
|
|
3
|
+
import type { IssuePredicate } from './issue-predicate';
|
|
4
|
+
interface IssueConfig {
|
|
5
|
+
predicate: IssuePredicate;
|
|
6
|
+
}
|
|
7
|
+
declare function createIssueConfig(compiler: webpack.Compiler, options: IssueOptions | undefined): IssueConfig;
|
|
8
|
+
export { IssueConfig, createIssueConfig };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIssueConfig = void 0;
|
|
4
|
+
const issue_match_1 = require("./issue-match");
|
|
5
|
+
const issue_predicate_1 = require("./issue-predicate");
|
|
6
|
+
function createIssuePredicateFromOption(context, option) {
|
|
7
|
+
if (Array.isArray(option)) {
|
|
8
|
+
return (0, issue_predicate_1.composeIssuePredicates)(option.map((option) => typeof option === 'function' ? option : (0, issue_match_1.createIssuePredicateFromIssueMatch)(context, option)));
|
|
9
|
+
}
|
|
10
|
+
return typeof option === 'function'
|
|
11
|
+
? option
|
|
12
|
+
: (0, issue_match_1.createIssuePredicateFromIssueMatch)(context, option);
|
|
13
|
+
}
|
|
14
|
+
function createIssueConfig(compiler, options) {
|
|
15
|
+
const context = compiler.options.context || process.cwd();
|
|
16
|
+
if (!options) {
|
|
17
|
+
options = {};
|
|
18
|
+
}
|
|
19
|
+
const include = options.include
|
|
20
|
+
? createIssuePredicateFromOption(context, options.include)
|
|
21
|
+
: (0, issue_predicate_1.createTrivialIssuePredicate)(true);
|
|
22
|
+
const exclude = options.exclude
|
|
23
|
+
? createIssuePredicateFromOption(context, options.exclude)
|
|
24
|
+
: (0, issue_predicate_1.createTrivialIssuePredicate)(false);
|
|
25
|
+
return {
|
|
26
|
+
predicate: (issue) => include(issue) && !exclude(issue),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createIssueConfig = createIssueConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatIssueLocation = exports.compareIssueLocations = void 0;
|
|
4
|
-
const
|
|
4
|
+
const issue_position_1 = require("./issue-position");
|
|
5
5
|
function compareIssueLocations(locationA, locationB) {
|
|
6
6
|
if (locationA === locationB) {
|
|
7
7
|
return 0;
|
|
@@ -12,8 +12,8 @@ function compareIssueLocations(locationA, locationB) {
|
|
|
12
12
|
if (!locationB) {
|
|
13
13
|
return 1;
|
|
14
14
|
}
|
|
15
|
-
return (
|
|
16
|
-
|
|
15
|
+
return ((0, issue_position_1.compareIssuePositions)(locationA.start, locationB.start) ||
|
|
16
|
+
(0, issue_position_1.compareIssuePositions)(locationA.end, locationB.end));
|
|
17
17
|
}
|
|
18
18
|
exports.compareIssueLocations = compareIssueLocations;
|
|
19
19
|
function formatIssueLocation({ start, end }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { IssuePredicate } from './issue-predicate';
|
|
2
|
+
import type { Issue } from './index';
|
|
3
3
|
declare type IssueMatch = Partial<Pick<Issue, 'severity' | 'code' | 'file'>>;
|
|
4
4
|
declare function createIssuePredicateFromIssueMatch(context: string, match: IssueMatch): IssuePredicate;
|
|
5
5
|
export { IssueMatch, createIssuePredicateFromIssueMatch };
|
|
@@ -4,16 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createIssuePredicateFromIssueMatch = void 0;
|
|
7
|
-
const minimatch_1 = __importDefault(require("minimatch"));
|
|
8
7
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const
|
|
8
|
+
const minimatch_1 = __importDefault(require("minimatch"));
|
|
9
|
+
const forward_slash_1 = require("../utils/path/forward-slash");
|
|
10
10
|
function createIssuePredicateFromIssueMatch(context, match) {
|
|
11
11
|
return (issue) => {
|
|
12
12
|
const matchesSeverity = !match.severity || match.severity === issue.severity;
|
|
13
13
|
const matchesCode = !match.code || match.code === issue.code;
|
|
14
14
|
const matchesFile = !issue.file ||
|
|
15
15
|
(!!issue.file &&
|
|
16
|
-
(!match.file || minimatch_1.default(
|
|
16
|
+
(!match.file || (0, minimatch_1.default)((0, forward_slash_1.forwardSlash)(path_1.default.relative(context, issue.file)), match.file)));
|
|
17
17
|
return matchesSeverity && matchesCode && matchesFile;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IssueMatch } from './
|
|
2
|
-
import { IssuePredicate } from './
|
|
1
|
+
import type { IssueMatch } from './issue-match';
|
|
2
|
+
import type { IssuePredicate } from './issue-predicate';
|
|
3
3
|
declare type IssuePredicateOption = IssuePredicate | IssueMatch | (IssuePredicate | IssueMatch)[];
|
|
4
4
|
interface IssueOptions {
|
|
5
5
|
include?: IssuePredicateOption;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue } from './index';
|
|
1
|
+
import type { Issue } from './index';
|
|
2
2
|
declare type IssuePredicate = (issue: Issue) => boolean;
|
|
3
3
|
declare function createTrivialIssuePredicate(result: boolean): IssuePredicate;
|
|
4
4
|
declare function composeIssuePredicates(predicates: IssuePredicate[]): IssuePredicate;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IssueWebpackError = void 0;
|
|
7
|
-
const webpack_1 = __importDefault(require("webpack"));
|
|
8
|
-
const IssueLocation_1 = require("./IssueLocation");
|
|
9
|
-
const relativeToContext_1 = require("../utils/path/relativeToContext");
|
|
10
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
9
|
+
const relative_to_context_1 = require("../utils/path/relative-to-context");
|
|
10
|
+
const issue_location_1 = require("./issue-location");
|
|
11
11
|
class IssueWebpackError extends webpack_1.default.WebpackError {
|
|
12
12
|
constructor(message, issue) {
|
|
13
13
|
super(message);
|
|
@@ -17,9 +17,9 @@ class IssueWebpackError extends webpack_1.default.WebpackError {
|
|
|
17
17
|
// should be a NormalModule instance.
|
|
18
18
|
// to avoid such a dependency, we do a workaround - error.file will contain formatted location instead
|
|
19
19
|
if (issue.file) {
|
|
20
|
-
this.file =
|
|
20
|
+
this.file = (0, relative_to_context_1.relativeToContext)(issue.file, process.cwd());
|
|
21
21
|
if (issue.location) {
|
|
22
|
-
this.file += ` ${chalk_1.default.green.bold(
|
|
22
|
+
this.file += ` ${chalk_1.default.green.bold((0, issue_location_1.formatIssueLocation)(issue.location))}`;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
Error.captureStackTrace(this, this.constructor);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { IssueLocation } from './issue-location';
|
|
2
|
+
import type { IssueSeverity } from './issue-severity';
|
|
3
3
|
interface Issue {
|
|
4
4
|
severity: IssueSeverity;
|
|
5
5
|
code: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deduplicateAndSortIssues = exports.isIssue = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const issue_location_1 = require("./issue-location");
|
|
5
|
+
const issue_severity_1 = require("./issue-severity");
|
|
6
6
|
function isIssue(value) {
|
|
7
7
|
return (!!value &&
|
|
8
8
|
typeof value === 'object' &&
|
|
9
|
-
|
|
9
|
+
(0, issue_severity_1.isIssueSeverity)(value.severity) &&
|
|
10
10
|
!!value.code &&
|
|
11
11
|
!!value.message);
|
|
12
12
|
}
|
|
@@ -24,9 +24,9 @@ function compareStrings(stringA, stringB) {
|
|
|
24
24
|
return stringA.toString().localeCompare(stringB.toString());
|
|
25
25
|
}
|
|
26
26
|
function compareIssues(issueA, issueB) {
|
|
27
|
-
return (
|
|
27
|
+
return ((0, issue_severity_1.compareIssueSeverities)(issueA.severity, issueB.severity) ||
|
|
28
28
|
compareStrings(issueA.file, issueB.file) ||
|
|
29
|
-
|
|
29
|
+
(0, issue_location_1.compareIssueLocations)(issueA.location, issueB.location) ||
|
|
30
30
|
compareStrings(issueA.code, issueB.code) ||
|
|
31
31
|
compareStrings(issueA.message, issueB.message) ||
|
|
32
32
|
0 /* EqualTo */);
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { FormatterConfig } from './formatter';
|
|
3
|
+
import type { IssueConfig } from './issue/issue-config';
|
|
4
|
+
import type { Logger } from './logger';
|
|
5
|
+
import type { ForkTsCheckerWebpackPluginOptions } from './plugin-options';
|
|
6
|
+
import type { TypeScriptWorkerConfig } from './typescript/type-script-worker-config';
|
|
7
|
+
interface ForkTsCheckerWebpackPluginConfig {
|
|
8
|
+
async: boolean;
|
|
9
|
+
typescript: TypeScriptWorkerConfig;
|
|
10
|
+
issue: IssueConfig;
|
|
11
|
+
formatter: FormatterConfig;
|
|
12
|
+
logger: Logger;
|
|
13
|
+
devServer: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function createPluginConfig(compiler: webpack.Compiler, options?: ForkTsCheckerWebpackPluginOptions): ForkTsCheckerWebpackPluginConfig;
|
|
16
|
+
export { ForkTsCheckerWebpackPluginConfig, createPluginConfig };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPluginConfig = void 0;
|
|
4
|
+
const formatter_1 = require("./formatter");
|
|
5
|
+
const issue_config_1 = require("./issue/issue-config");
|
|
6
|
+
const type_script_worker_config_1 = require("./typescript/type-script-worker-config");
|
|
7
|
+
function createPluginConfig(compiler, options = {}) {
|
|
8
|
+
return {
|
|
9
|
+
async: options.async === undefined ? compiler.options.mode === 'development' : options.async,
|
|
10
|
+
typescript: (0, type_script_worker_config_1.createTypeScriptWorkerConfig)(compiler, options.typescript),
|
|
11
|
+
issue: (0, issue_config_1.createIssueConfig)(compiler, options.issue),
|
|
12
|
+
formatter: (0, formatter_1.createFormatterConfig)(options.formatter),
|
|
13
|
+
logger: options.logger || console,
|
|
14
|
+
devServer: options.devServer !== false,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.createPluginConfig = createPluginConfig;
|