fork-ts-checker-webpack-plugin 7.0.0-alpha.10 → 7.0.0-alpha.14
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 +11 -9
- 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} +0 -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} +2 -2
- 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} +1 -1
- package/lib/formatter/{Formatter.js → formatter-options.js} +0 -0
- package/lib/formatter/{Formatter.d.ts → formatter.d.ts} +0 -0
- 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/{WebpackFormatter.d.ts → webpack-formatter.d.ts} +1 -1
- package/lib/formatter/{WebpackFormatter.js → webpack-formatter.js} +2 -2
- 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} +1 -1
- 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} +20 -21
- 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 +15 -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} +1 -1
- package/lib/issue/{IssueMatch.js → issue-match.js} +2 -2
- 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} +0 -0
- 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} +4 -4
- 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} +6 -6
- 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/{ForkTsCheckerWebpackPluginOptions.json → plugin-options.json} +7 -43
- package/lib/{hooks/pluginPools.d.ts → plugin-pools.d.ts} +1 -1
- package/lib/{hooks/pluginPools.js → plugin-pools.js} +1 -1
- package/lib/{ForkTsCheckerWebpackPluginState.d.ts → plugin-state.d.ts} +4 -5
- package/lib/{ForkTsCheckerWebpackPluginState.js → plugin-state.js} +4 -5
- package/lib/{ForkTsCheckerWebpackPlugin.d.ts → plugin.d.ts} +3 -3
- 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} +0 -0
- package/lib/{typescript-reporter/extension/TypeScriptExtension.d.ts → typescript/extension/type-script-extension.d.ts} +1 -1
- 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} +2 -2
- 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} +8 -8
- package/lib/typescript/type-script-worker-config.d.ts +22 -0
- package/lib/{typescript-reporter/TypeScriptReporterConfiguration.js → typescript/type-script-worker-config.js} +5 -5
- package/lib/{typescript-reporter/TypeScriptReporterOptions.d.ts → typescript/type-script-worker-options.d.ts} +6 -6
- 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 +76 -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 +14 -0
- package/lib/typescript/worker/lib/config.js +111 -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/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} +1 -2
- 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 +32 -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 +49 -0
- package/lib/{typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts → typescript/worker/lib/system.d.ts} +4 -6
- package/lib/typescript/worker/lib/system.js +206 -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} +6 -6
- package/lib/watch/{InclusiveNodeWatchFileSystem.js → inclusive-node-watch-file-system.js} +43 -11
- package/lib/watch/{WatchFileSystem.d.ts → watch-file-system.d.ts} +1 -1
- package/lib/{typescript-reporter/TypeScriptDiagnosticsOptions.js → watch/watch-file-system.js} +0 -0
- package/package.json +1 -1
- package/lib/ForkTsCheckerWebpackPlugin.js +0 -64
- package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +0 -15
- package/lib/ForkTsCheckerWebpackPluginConfiguration.js +0 -17
- package/lib/ForkTsCheckerWebpackPluginOptions.d.ts +0 -12
- 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 -130
- package/lib/hooks/tapStopToDisconnectReporter.d.ts +0 -5
- package/lib/hooks/tapStopToDisconnectReporter.js +0 -30
- 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 -85
- 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/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 -83
- 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 -181
- 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 -218
- 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 -51
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +0 -8
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +0 -142
- package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +0 -4
- package/lib/typescript-reporter/reporter/TypeScriptReporter.js +0 -376
- 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
|
@@ -7,7 +7,8 @@ exports.InclusiveNodeWatchFileSystem = void 0;
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const chokidar_1 = __importDefault(require("chokidar"));
|
|
9
9
|
const minimatch_1 = __importDefault(require("minimatch"));
|
|
10
|
-
const
|
|
10
|
+
const files_change_1 = require("../files-change");
|
|
11
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
11
12
|
const BUILTIN_IGNORED_DIRS = ['node_modules', '.git', '.yarn', '.pnp'];
|
|
12
13
|
function createIsIgnored(ignored, excluded) {
|
|
13
14
|
const ignoredPatterns = ignored ? (Array.isArray(ignored) ? ignored : [ignored]) : [];
|
|
@@ -38,18 +39,39 @@ class InclusiveNodeWatchFileSystem {
|
|
|
38
39
|
this.paused = true;
|
|
39
40
|
this.watch = (files, dirs, missing, startTime, options, callback, callbackUndelayed) => {
|
|
40
41
|
var _a, _b, _c, _d;
|
|
41
|
-
|
|
42
|
+
const { debug } = infrastructure_logger_1.getInfrastructureLogger(this.compiler);
|
|
43
|
+
files_change_1.clearFilesChange(this.compiler);
|
|
42
44
|
const isIgnored = createIsIgnored(options === null || options === void 0 ? void 0 : options.ignored, ((_a = this.pluginState.lastDependencies) === null || _a === void 0 ? void 0 : _a.excluded) || []);
|
|
43
45
|
// use standard watch file system for files and missing
|
|
44
46
|
const standardWatcher = this.watchFileSystem.watch(files, dirs, missing, startTime, options, callback, callbackUndelayed);
|
|
45
47
|
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b.on('change', (file) => {
|
|
46
|
-
if (typeof file
|
|
47
|
-
|
|
48
|
+
if (typeof file !== 'string') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!isIgnored(file)) {
|
|
52
|
+
debug('Detected file change', file);
|
|
53
|
+
this.deletedFiles.delete(file);
|
|
54
|
+
files_change_1.updateFilesChange(this.compiler, { changedFiles: [file] });
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
debug("Detected file change but it's ignored", file);
|
|
48
58
|
}
|
|
49
59
|
});
|
|
50
60
|
(_c = this.watcher) === null || _c === void 0 ? void 0 : _c.on('remove', (file) => {
|
|
51
|
-
if (typeof file
|
|
52
|
-
|
|
61
|
+
if (typeof file !== 'string') {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (this.deletedFiles.has(file)) {
|
|
65
|
+
debug('Skipping duplicated remove event.');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!isIgnored(file)) {
|
|
69
|
+
debug('Detected file remove', file);
|
|
70
|
+
this.deletedFiles.add(file);
|
|
71
|
+
files_change_1.updateFilesChange(this.compiler, { deletedFiles: [file] });
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
debug("Detected file remove but it's ignored", file);
|
|
53
75
|
}
|
|
54
76
|
});
|
|
55
77
|
// calculate what to change
|
|
@@ -84,11 +106,13 @@ class InclusiveNodeWatchFileSystem {
|
|
|
84
106
|
const extension = path_1.extname(file);
|
|
85
107
|
const supportedExtensions = ((_a = this.pluginState.lastDependencies) === null || _a === void 0 ? void 0 : _a.extensions) || [];
|
|
86
108
|
if (!supportedExtensions.includes(extension)) {
|
|
109
|
+
debug('Detected new file add but extension is not supported', file);
|
|
87
110
|
return;
|
|
88
111
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
(
|
|
112
|
+
debug('Detected new file add', file);
|
|
113
|
+
this.deletedFiles.delete(file);
|
|
114
|
+
files_change_1.updateFilesChange(this.compiler, { changedFiles: [file] });
|
|
115
|
+
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b._onChange(dirToWatch, (stats === null || stats === void 0 ? void 0 : stats.mtimeMs) || (stats === null || stats === void 0 ? void 0 : stats.ctimeMs) || 1, file, 'rename');
|
|
92
116
|
});
|
|
93
117
|
dirWatcher.on('unlink', (file) => {
|
|
94
118
|
var _a, _b;
|
|
@@ -98,16 +122,23 @@ class InclusiveNodeWatchFileSystem {
|
|
|
98
122
|
const extension = path_1.extname(file);
|
|
99
123
|
const supportedExtensions = ((_a = this.pluginState.lastDependencies) === null || _a === void 0 ? void 0 : _a.extensions) || [];
|
|
100
124
|
if (!supportedExtensions.includes(extension)) {
|
|
125
|
+
debug('Detected new file remove but extension is not supported', file);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (this.deletedFiles.has(file)) {
|
|
129
|
+
debug('Skipping duplicated unlink event.');
|
|
101
130
|
return;
|
|
102
131
|
}
|
|
103
|
-
|
|
132
|
+
debug('Detected new file remove', file);
|
|
133
|
+
this.deletedFiles.add(file);
|
|
134
|
+
files_change_1.updateFilesChange(this.compiler, { deletedFiles: [file] });
|
|
104
135
|
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b._onRemove(dirToWatch, file, 'rename');
|
|
105
136
|
});
|
|
106
137
|
this.dirsWatchers.set(dirToWatch, dirWatcher);
|
|
107
138
|
});
|
|
108
139
|
this.paused = false;
|
|
109
140
|
return Object.assign(Object.assign({}, standardWatcher), { close: () => {
|
|
110
|
-
|
|
141
|
+
files_change_1.clearFilesChange(this.compiler);
|
|
111
142
|
if (standardWatcher) {
|
|
112
143
|
standardWatcher.close();
|
|
113
144
|
}
|
|
@@ -124,6 +155,7 @@ class InclusiveNodeWatchFileSystem {
|
|
|
124
155
|
} });
|
|
125
156
|
};
|
|
126
157
|
this.dirsWatchers = new Map();
|
|
158
|
+
this.deletedFiles = new Set();
|
|
127
159
|
}
|
|
128
160
|
get watcher() {
|
|
129
161
|
var _a;
|
package/lib/{typescript-reporter/TypeScriptDiagnosticsOptions.js → watch/watch-file-system.js}
RENAMED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ForkTsCheckerWebpackPlugin = void 0;
|
|
7
|
-
const cosmiconfig_1 = require("cosmiconfig");
|
|
8
|
-
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
9
|
-
const schema_utils_1 = require("schema-utils");
|
|
10
|
-
// type only dependency
|
|
11
|
-
// eslint-disable-next-line node/no-extraneous-import
|
|
12
|
-
const ForkTsCheckerWebpackPluginConfiguration_1 = require("./ForkTsCheckerWebpackPluginConfiguration");
|
|
13
|
-
const ForkTsCheckerWebpackPluginOptions_json_1 = __importDefault(require("./ForkTsCheckerWebpackPluginOptions.json"));
|
|
14
|
-
const ForkTsCheckerWebpackPluginState_1 = require("./ForkTsCheckerWebpackPluginState");
|
|
15
|
-
const pluginHooks_1 = require("./hooks/pluginHooks");
|
|
16
|
-
const pluginPools_1 = require("./hooks/pluginPools");
|
|
17
|
-
const tapAfterCompileToAddDependencies_1 = require("./hooks/tapAfterCompileToAddDependencies");
|
|
18
|
-
const tapAfterEnvironmentToPatchWatching_1 = require("./hooks/tapAfterEnvironmentToPatchWatching");
|
|
19
|
-
const tapErrorToLogMessage_1 = require("./hooks/tapErrorToLogMessage");
|
|
20
|
-
const tapStartToConnectAndRunReporter_1 = require("./hooks/tapStartToConnectAndRunReporter");
|
|
21
|
-
const tapStopToDisconnectReporter_1 = require("./hooks/tapStopToDisconnectReporter");
|
|
22
|
-
const TypeScriptReporterRpcClient_1 = require("./typescript-reporter/reporter/TypeScriptReporterRpcClient");
|
|
23
|
-
const TypeScriptSupport_1 = require("./typescript-reporter/TypeScriptSupport");
|
|
24
|
-
class ForkTsCheckerWebpackPlugin {
|
|
25
|
-
constructor(options = {}) {
|
|
26
|
-
const explorerSync = cosmiconfig_1.cosmiconfigSync('fork-ts-checker');
|
|
27
|
-
const { config: externalOptions } = explorerSync.search() || {};
|
|
28
|
-
// first validate options directly passed to the constructor
|
|
29
|
-
const configuration = { name: 'ForkTsCheckerWebpackPlugin' };
|
|
30
|
-
schema_utils_1.validate(ForkTsCheckerWebpackPluginOptions_json_1.default, options, configuration);
|
|
31
|
-
this.options = deepmerge_1.default(externalOptions || {}, options || {});
|
|
32
|
-
// then validate merged options
|
|
33
|
-
schema_utils_1.validate(ForkTsCheckerWebpackPluginOptions_json_1.default, this.options, configuration);
|
|
34
|
-
}
|
|
35
|
-
static getCompilerHooks(compiler) {
|
|
36
|
-
return pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
|
|
37
|
-
}
|
|
38
|
-
apply(compiler) {
|
|
39
|
-
const configuration = ForkTsCheckerWebpackPluginConfiguration_1.createForkTsCheckerWebpackPluginConfiguration(compiler, this.options);
|
|
40
|
-
const state = ForkTsCheckerWebpackPluginState_1.createForkTsCheckerWebpackPluginState();
|
|
41
|
-
TypeScriptSupport_1.assertTypeScriptSupport(configuration.typescript);
|
|
42
|
-
const issuesReporter = TypeScriptReporterRpcClient_1.createTypeScriptReporterRpcClient(configuration.typescript);
|
|
43
|
-
const dependenciesReporter = TypeScriptReporterRpcClient_1.createTypeScriptReporterRpcClient(configuration.typescript);
|
|
44
|
-
tapAfterEnvironmentToPatchWatching_1.tapAfterEnvironmentToPatchWatching(compiler, state);
|
|
45
|
-
tapStartToConnectAndRunReporter_1.tapStartToConnectAndRunReporter(compiler, issuesReporter, dependenciesReporter, configuration, state);
|
|
46
|
-
tapAfterCompileToAddDependencies_1.tapAfterCompileToAddDependencies(compiler, configuration, state);
|
|
47
|
-
tapStopToDisconnectReporter_1.tapStopToDisconnectReporter(compiler, issuesReporter, dependenciesReporter, state);
|
|
48
|
-
tapErrorToLogMessage_1.tapErrorToLogMessage(compiler, configuration);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
52
|
-
/**
|
|
53
|
-
* Current version of the plugin
|
|
54
|
-
*/
|
|
55
|
-
ForkTsCheckerWebpackPlugin.version = '7.0.0-alpha.10'; // will be replaced by the @semantic-release/exec
|
|
56
|
-
/**
|
|
57
|
-
* Default pools for the plugin concurrency limit
|
|
58
|
-
*/
|
|
59
|
-
ForkTsCheckerWebpackPlugin.issuesPool = pluginPools_1.issuesPool;
|
|
60
|
-
ForkTsCheckerWebpackPlugin.dependenciesPool = pluginPools_1.dependenciesPool;
|
|
61
|
-
/**
|
|
62
|
-
* @deprecated Use ForkTsCheckerWebpackPlugin.issuesPool instead
|
|
63
|
-
*/
|
|
64
|
-
ForkTsCheckerWebpackPlugin.pool = pluginPools_1.issuesPool;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginOptions } from './ForkTsCheckerWebpackPluginOptions';
|
|
3
|
-
import type { FormatterConfiguration } from './formatter';
|
|
4
|
-
import type { IssueConfiguration } from './issue/IssueConfiguration';
|
|
5
|
-
import type { LoggerConfiguration } from './logger/LoggerConfiguration';
|
|
6
|
-
import type { TypeScriptReporterConfiguration } from './typescript-reporter/TypeScriptReporterConfiguration';
|
|
7
|
-
interface ForkTsCheckerWebpackPluginConfiguration {
|
|
8
|
-
async: boolean;
|
|
9
|
-
typescript: TypeScriptReporterConfiguration;
|
|
10
|
-
issue: IssueConfiguration;
|
|
11
|
-
formatter: FormatterConfiguration;
|
|
12
|
-
logger: LoggerConfiguration;
|
|
13
|
-
}
|
|
14
|
-
declare function createForkTsCheckerWebpackPluginConfiguration(compiler: webpack.Compiler, options?: ForkTsCheckerWebpackPluginOptions): ForkTsCheckerWebpackPluginConfiguration;
|
|
15
|
-
export { ForkTsCheckerWebpackPluginConfiguration, createForkTsCheckerWebpackPluginConfiguration };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createForkTsCheckerWebpackPluginConfiguration = void 0;
|
|
4
|
-
const formatter_1 = require("./formatter");
|
|
5
|
-
const IssueConfiguration_1 = require("./issue/IssueConfiguration");
|
|
6
|
-
const LoggerConfiguration_1 = require("./logger/LoggerConfiguration");
|
|
7
|
-
const TypeScriptReporterConfiguration_1 = require("./typescript-reporter/TypeScriptReporterConfiguration");
|
|
8
|
-
function createForkTsCheckerWebpackPluginConfiguration(compiler, options = {}) {
|
|
9
|
-
return {
|
|
10
|
-
async: options.async === undefined ? compiler.options.mode === 'development' : options.async,
|
|
11
|
-
typescript: TypeScriptReporterConfiguration_1.createTypeScriptReporterConfiguration(compiler, options.typescript),
|
|
12
|
-
issue: IssueConfiguration_1.createIssueConfiguration(compiler, options.issue),
|
|
13
|
-
formatter: formatter_1.createFormatterConfiguration(options.formatter),
|
|
14
|
-
logger: LoggerConfiguration_1.createLoggerConfiguration(compiler, options.logger),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
exports.createForkTsCheckerWebpackPluginConfiguration = createForkTsCheckerWebpackPluginConfiguration;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FormatterOptions } from './formatter';
|
|
2
|
-
import type { IssueOptions } from './issue/IssueOptions';
|
|
3
|
-
import type LoggerOptions from './logger/LoggerOptions';
|
|
4
|
-
import type { TypeScriptReporterOptions } from './typescript-reporter/TypeScriptReporterOptions';
|
|
5
|
-
interface ForkTsCheckerWebpackPluginOptions {
|
|
6
|
-
async?: boolean;
|
|
7
|
-
typescript?: TypeScriptReporterOptions;
|
|
8
|
-
formatter?: FormatterOptions;
|
|
9
|
-
issue?: IssueOptions;
|
|
10
|
-
logger?: LoggerOptions;
|
|
11
|
-
}
|
|
12
|
-
export { ForkTsCheckerWebpackPluginOptions };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OperationCanceledError = void 0;
|
|
4
|
-
class OperationCanceledError extends Error {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.canceled = true;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.OperationCanceledError = OperationCanceledError;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Formatter } from './Formatter';
|
|
2
|
-
import type { FormatterOptions } from './FormatterOptions';
|
|
3
|
-
declare type FormatterConfiguration = Formatter;
|
|
4
|
-
declare function createFormatterConfiguration(options: FormatterOptions | undefined): FormatterConfiguration;
|
|
5
|
-
export { FormatterConfiguration, createFormatterConfiguration };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function interceptDoneToGetWebpackDevServerTap(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { interceptDoneToGetWebpackDevServerTap };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.interceptDoneToGetWebpackDevServerTap = void 0;
|
|
4
|
-
function interceptDoneToGetWebpackDevServerTap(compiler, configuration, state) {
|
|
5
|
-
// inspired by https://github.com/ypresto/fork-ts-checker-async-overlay-webpack-plugin
|
|
6
|
-
compiler.hooks.done.intercept({
|
|
7
|
-
register: (tap) => {
|
|
8
|
-
if (tap.name === 'webpack-dev-server' &&
|
|
9
|
-
tap.type === 'sync' &&
|
|
10
|
-
configuration.logger.devServer) {
|
|
11
|
-
state.webpackDevServerDoneTap = tap;
|
|
12
|
-
}
|
|
13
|
-
return tap;
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
exports.interceptDoneToGetWebpackDevServerTap = interceptDoneToGetWebpackDevServerTap;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function tapAfterCompileToAddDependencies(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { tapAfterCompileToAddDependencies };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function tapAfterCompileToGetIssues(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { tapAfterCompileToGetIssues };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function tapDoneToAsyncGetIssues(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { tapDoneToAsyncGetIssues };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
declare function tapErrorToLogMessage(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration): void;
|
|
4
|
-
export { tapErrorToLogMessage };
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
declare function tapStartToConnectAndRunReporter(compiler: webpack.Compiler, issuesReporter: ReporterRpcClient, dependenciesReporter: ReporterRpcClient, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
6
|
-
export { tapStartToConnectAndRunReporter };
|
|
@@ -1,130 +0,0 @@
|
|
|
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.tapStartToConnectAndRunReporter = void 0;
|
|
13
|
-
const OperationCanceledError_1 = require("../error/OperationCanceledError");
|
|
14
|
-
const reporter_1 = require("../reporter");
|
|
15
|
-
const interceptDoneToGetWebpackDevServerTap_1 = require("./interceptDoneToGetWebpackDevServerTap");
|
|
16
|
-
const pluginHooks_1 = require("./pluginHooks");
|
|
17
|
-
const pluginPools_1 = require("./pluginPools");
|
|
18
|
-
const tapAfterCompileToGetIssues_1 = require("./tapAfterCompileToGetIssues");
|
|
19
|
-
const tapDoneToAsyncGetIssues_1 = require("./tapDoneToAsyncGetIssues");
|
|
20
|
-
function tapStartToConnectAndRunReporter(compiler, issuesReporter, dependenciesReporter, configuration, state) {
|
|
21
|
-
const hooks = pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
|
|
22
|
-
compiler.hooks.run.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
23
|
-
if (!state.initialized) {
|
|
24
|
-
state.initialized = true;
|
|
25
|
-
state.watching = false;
|
|
26
|
-
tapAfterCompileToGetIssues_1.tapAfterCompileToGetIssues(compiler, configuration, state);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
compiler.hooks.watchRun.tap('ForkTsCheckerWebpackPlugin', () => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
if (!state.initialized) {
|
|
31
|
-
state.initialized = true;
|
|
32
|
-
state.watching = true;
|
|
33
|
-
if (configuration.async) {
|
|
34
|
-
tapDoneToAsyncGetIssues_1.tapDoneToAsyncGetIssues(compiler, configuration, state);
|
|
35
|
-
interceptDoneToGetWebpackDevServerTap_1.interceptDoneToGetWebpackDevServerTap(compiler, configuration, state);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
tapAfterCompileToGetIssues_1.tapAfterCompileToGetIssues(compiler, configuration, state);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
compiler.hooks.compilation.tap('ForkTsCheckerWebpackPlugin', (compilation) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
if (compilation.compiler !== compiler) {
|
|
44
|
-
// run only for the compiler that the plugin was registered for
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
let change = {};
|
|
48
|
-
if (state.watching) {
|
|
49
|
-
change = reporter_1.getFilesChange(compiler);
|
|
50
|
-
configuration.logger.infrastructure.log([
|
|
51
|
-
'Calling reporter service for incremental check.',
|
|
52
|
-
` Changed files: ${JSON.stringify(change.changedFiles)}`,
|
|
53
|
-
` Deleted files: ${JSON.stringify(change.deletedFiles)}`,
|
|
54
|
-
].join('\n'));
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
configuration.logger.infrastructure.log('Calling reporter service for single check.');
|
|
58
|
-
}
|
|
59
|
-
let resolveDependencies;
|
|
60
|
-
let rejectDependencies;
|
|
61
|
-
let resolveIssues;
|
|
62
|
-
let rejectIssues;
|
|
63
|
-
state.dependenciesPromise = new Promise((resolve, reject) => {
|
|
64
|
-
resolveDependencies = resolve;
|
|
65
|
-
rejectDependencies = reject;
|
|
66
|
-
});
|
|
67
|
-
state.issuesPromise = new Promise((resolve, reject) => {
|
|
68
|
-
resolveIssues = resolve;
|
|
69
|
-
rejectIssues = reject;
|
|
70
|
-
});
|
|
71
|
-
const previousIssuesReportPromise = state.issuesReportPromise;
|
|
72
|
-
const previousDependenciesReportPromise = state.dependenciesReportPromise;
|
|
73
|
-
change = yield hooks.start.promise(change, compilation);
|
|
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* () {
|
|
77
|
-
try {
|
|
78
|
-
yield issuesReporter.connect();
|
|
79
|
-
const previousReport = yield previousIssuesReportPromise;
|
|
80
|
-
if (previousReport) {
|
|
81
|
-
yield previousReport.close();
|
|
82
|
-
}
|
|
83
|
-
const report = yield issuesReporter.getReport(change, state.watching);
|
|
84
|
-
resolve(report);
|
|
85
|
-
report.getIssues().then(resolveIssues).catch(rejectIssues).finally(done);
|
|
86
|
-
}
|
|
87
|
-
catch (error) {
|
|
88
|
-
if (error instanceof OperationCanceledError_1.OperationCanceledError) {
|
|
89
|
-
hooks.canceled.call(compilation);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
hooks.error.call(error, compilation);
|
|
93
|
-
}
|
|
94
|
-
resolve(undefined);
|
|
95
|
-
resolveIssues(undefined);
|
|
96
|
-
done();
|
|
97
|
-
}
|
|
98
|
-
})));
|
|
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* () {
|
|
102
|
-
try {
|
|
103
|
-
yield dependenciesReporter.connect();
|
|
104
|
-
const previousReport = yield previousDependenciesReportPromise;
|
|
105
|
-
if (previousReport) {
|
|
106
|
-
yield previousReport.close();
|
|
107
|
-
}
|
|
108
|
-
const report = yield dependenciesReporter.getReport(change, state.watching);
|
|
109
|
-
resolve(report);
|
|
110
|
-
report
|
|
111
|
-
.getDependencies()
|
|
112
|
-
.then(resolveDependencies)
|
|
113
|
-
.catch(rejectDependencies)
|
|
114
|
-
.finally(done);
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
if (error instanceof OperationCanceledError_1.OperationCanceledError) {
|
|
118
|
-
hooks.canceled.call(compilation);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
hooks.error.call(error, compilation);
|
|
122
|
-
}
|
|
123
|
-
resolve(undefined);
|
|
124
|
-
resolveDependencies(undefined);
|
|
125
|
-
done();
|
|
126
|
-
}
|
|
127
|
-
})));
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
exports.tapStartToConnectAndRunReporter = tapStartToConnectAndRunReporter;
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
export { tapStopToDisconnectReporter };
|
|
@@ -1,30 +0,0 @@
|
|
|
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.tapStopToDisconnectReporter = void 0;
|
|
13
|
-
function tapStopToDisconnectReporter(compiler, issuesReporter, dependenciesReporter, state) {
|
|
14
|
-
compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
15
|
-
issuesReporter.disconnect();
|
|
16
|
-
dependenciesReporter.disconnect();
|
|
17
|
-
});
|
|
18
|
-
compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', () => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
if (!state.watching) {
|
|
20
|
-
yield Promise.all([issuesReporter.disconnect(), dependenciesReporter.disconnect()]);
|
|
21
|
-
}
|
|
22
|
-
}));
|
|
23
|
-
compiler.hooks.failed.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
24
|
-
if (!state.watching) {
|
|
25
|
-
issuesReporter.disconnect();
|
|
26
|
-
dependenciesReporter.disconnect();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.tapStopToDisconnectReporter = tapStopToDisconnectReporter;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { IssueOptions } from './IssueOptions';
|
|
3
|
-
import type { IssuePredicate } from './IssuePredicate';
|
|
4
|
-
interface IssueConfiguration {
|
|
5
|
-
predicate: IssuePredicate;
|
|
6
|
-
}
|
|
7
|
-
declare function createIssueConfiguration(compiler: webpack.Compiler, options: IssueOptions | undefined): IssueConfiguration;
|
|
8
|
-
export { IssueConfiguration, createIssueConfiguration };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createIssueConfiguration = void 0;
|
|
4
|
-
const IssueMatch_1 = require("./IssueMatch");
|
|
5
|
-
const IssuePredicate_1 = require("./IssuePredicate");
|
|
6
|
-
function createIssuePredicateFromOption(context, option) {
|
|
7
|
-
if (Array.isArray(option)) {
|
|
8
|
-
return IssuePredicate_1.composeIssuePredicates(option.map((option) => typeof option === 'function' ? option : IssueMatch_1.createIssuePredicateFromIssueMatch(context, option)));
|
|
9
|
-
}
|
|
10
|
-
return typeof option === 'function'
|
|
11
|
-
? option
|
|
12
|
-
: IssueMatch_1.createIssuePredicateFromIssueMatch(context, option);
|
|
13
|
-
}
|
|
14
|
-
function createIssueConfiguration(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
|
-
: IssuePredicate_1.createTrivialIssuePredicate(true);
|
|
22
|
-
const exclude = options.exclude
|
|
23
|
-
? createIssuePredicateFromOption(context, options.exclude)
|
|
24
|
-
: IssuePredicate_1.createTrivialIssuePredicate(false);
|
|
25
|
-
return {
|
|
26
|
-
predicate: (issue) => include(issue) && !exclude(issue),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
exports.createIssueConfiguration = createIssueConfiguration;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type Logger from './Logger';
|
|
3
|
-
import type LoggerOptions from './LoggerOptions';
|
|
4
|
-
interface LoggerConfiguration {
|
|
5
|
-
infrastructure: Logger;
|
|
6
|
-
issues: Logger;
|
|
7
|
-
devServer: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare function createLoggerConfiguration(compiler: webpack.Compiler, options: LoggerOptions | undefined): LoggerConfiguration;
|
|
10
|
-
export { LoggerConfiguration, createLoggerConfiguration };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLoggerConfiguration = void 0;
|
|
4
|
-
const LoggerFactory_1 = require("./LoggerFactory");
|
|
5
|
-
function createLoggerConfiguration(compiler, options) {
|
|
6
|
-
return {
|
|
7
|
-
infrastructure: LoggerFactory_1.createLogger((options && options.infrastructure) || 'webpack-infrastructure', compiler),
|
|
8
|
-
issues: LoggerFactory_1.createLogger((options && options.issues) || 'console', compiler),
|
|
9
|
-
devServer: (options === null || options === void 0 ? void 0 : options.devServer) !== false,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.createLoggerConfiguration = createLoggerConfiguration;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type Logger from './Logger';
|
|
3
|
-
declare type LoggerType = 'console' | 'webpack-infrastructure' | 'silent';
|
|
4
|
-
declare function createLogger(type: LoggerType | Logger, compiler: webpack.Compiler): Logger;
|
|
5
|
-
export { createLogger, LoggerType };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLogger = void 0;
|
|
4
|
-
const PartialLogger_1 = require("./PartialLogger");
|
|
5
|
-
const WebpackInfrastructureLogger_1 = require("./WebpackInfrastructureLogger");
|
|
6
|
-
function createLogger(type, compiler) {
|
|
7
|
-
if (typeof type !== 'string') {
|
|
8
|
-
return type;
|
|
9
|
-
}
|
|
10
|
-
switch (type) {
|
|
11
|
-
case 'webpack-infrastructure':
|
|
12
|
-
return (WebpackInfrastructureLogger_1.createWebpackInfrastructureLogger(compiler) ||
|
|
13
|
-
PartialLogger_1.createPartialLogger(['log', 'error'], console));
|
|
14
|
-
case 'silent':
|
|
15
|
-
return PartialLogger_1.createPartialLogger([], console);
|
|
16
|
-
case 'console':
|
|
17
|
-
default:
|
|
18
|
-
return console;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.createLogger = createLogger;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPartialLogger = void 0;
|
|
4
|
-
function createPartialLogger(methods, logger) {
|
|
5
|
-
return {
|
|
6
|
-
info: (message) => (methods.includes('info') ? logger.info(message) : undefined),
|
|
7
|
-
log: (message) => (methods.includes('log') ? logger.log(message) : undefined),
|
|
8
|
-
error: (message) => (methods.includes('error') ? logger.error(message) : undefined),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
exports.createPartialLogger = createPartialLogger;
|