fork-ts-checker-webpack-plugin 6.4.2 → 7.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -103
- package/lib/ForkTsCheckerWebpackPlugin.d.ts +11 -12
- package/lib/ForkTsCheckerWebpackPlugin.js +49 -49
- package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +6 -8
- package/lib/ForkTsCheckerWebpackPluginConfiguration.js +3 -4
- package/lib/ForkTsCheckerWebpackPluginOptions.d.ts +4 -6
- package/lib/ForkTsCheckerWebpackPluginOptions.json +73 -111
- package/lib/ForkTsCheckerWebpackPluginState.d.ts +5 -6
- package/lib/ForkTsCheckerWebpackPluginState.js +2 -2
- package/lib/{reporter/FilesChange.d.ts → files-change.d.ts} +4 -4
- package/lib/{reporter/FilesChange.js → files-change.js} +4 -3
- package/lib/{reporter/FilesMatch.d.ts → files-match.d.ts} +0 -0
- package/lib/{eslint-reporter/EsLintReporterOptions.js → files-match.js} +0 -0
- package/lib/formatter/BasicFormatter.d.ts +1 -1
- package/lib/formatter/BasicFormatter.js +1 -0
- package/lib/formatter/CodeFrameFormatter.d.ts +1 -1
- package/lib/formatter/CodeFrameFormatter.js +2 -1
- package/lib/formatter/Formatter.d.ts +1 -1
- package/lib/formatter/FormatterConfiguration.d.ts +3 -3
- package/lib/formatter/FormatterConfiguration.js +21 -2
- package/lib/formatter/FormatterOptions.d.ts +11 -6
- package/lib/formatter/WebpackFormatter.d.ts +1 -1
- package/lib/formatter/WebpackFormatter.js +6 -6
- package/lib/formatter/index.d.ts +0 -1
- package/lib/formatter/index.js +16 -8
- package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +3 -3
- package/lib/hooks/interceptDoneToGetWebpackDevServerTap.js +4 -0
- package/lib/hooks/pluginHooks.d.ts +13 -13
- package/lib/hooks/pluginHooks.js +1 -0
- package/lib/hooks/pluginPools.d.ts +4 -0
- package/lib/hooks/pluginPools.js +28 -0
- package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +3 -3
- package/lib/hooks/tapAfterCompileToAddDependencies.js +4 -0
- package/lib/hooks/tapAfterCompileToGetIssues.d.ts +3 -3
- package/lib/hooks/tapAfterCompileToGetIssues.js +5 -1
- package/lib/hooks/tapAfterEnvironmentToPatchWatching.d.ts +2 -2
- package/lib/hooks/tapAfterEnvironmentToPatchWatching.js +10 -1
- package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +3 -3
- package/lib/hooks/tapDoneToAsyncGetIssues.js +7 -7
- package/lib/hooks/tapErrorToLogMessage.d.ts +2 -2
- package/lib/hooks/tapErrorToLogMessage.js +5 -4
- package/lib/hooks/tapStartToRunWorkers.d.ts +8 -0
- package/lib/hooks/tapStartToRunWorkers.js +95 -0
- package/lib/hooks/tapStopToTerminateWorkers.d.ts +5 -0
- package/lib/hooks/tapStopToTerminateWorkers.js +26 -0
- package/lib/infrastructure-logger.d.ts +10 -0
- package/lib/infrastructure-logger.js +15 -0
- package/lib/issue/Issue.d.ts +2 -3
- package/lib/issue/Issue.js +2 -3
- package/lib/issue/IssueConfiguration.d.ts +3 -3
- package/lib/issue/IssueConfiguration.js +1 -0
- package/lib/issue/IssueLocation.d.ts +2 -2
- package/lib/issue/IssueLocation.js +17 -2
- package/lib/issue/IssueMatch.d.ts +3 -3
- package/lib/issue/IssueMatch.js +3 -3
- package/lib/issue/IssueOptions.d.ts +2 -2
- package/lib/issue/IssuePosition.js +1 -0
- package/lib/issue/IssuePredicate.d.ts +1 -1
- package/lib/issue/IssuePredicate.js +1 -0
- package/lib/issue/IssueSeverity.js +1 -0
- package/lib/issue/IssueWebpackError.d.ts +3 -3
- package/lib/issue/IssueWebpackError.js +7 -5
- package/lib/issue/index.js +13 -6
- package/lib/logger/LoggerConfiguration.d.ts +3 -3
- package/lib/logger/LoggerConfiguration.js +2 -1
- package/lib/logger/LoggerFactory.d.ts +2 -2
- package/lib/logger/LoggerFactory.js +2 -1
- package/lib/logger/LoggerOptions.d.ts +2 -2
- package/lib/logger/PartialLogger.d.ts +1 -1
- package/lib/logger/PartialLogger.js +1 -0
- package/lib/logger/WebpackInfrastructureLogger.d.ts +2 -2
- package/lib/logger/WebpackInfrastructureLogger.js +1 -0
- package/lib/{typescript-reporter → typescript}/TypeScriptConfigurationOverwrite.d.ts +1 -1
- package/lib/{typescript-reporter → typescript}/TypeScriptConfigurationOverwrite.js +0 -0
- package/lib/{typescript-reporter → typescript}/TypeScriptDiagnosticsOptions.d.ts +0 -0
- package/lib/{typescript-reporter → typescript}/TypeScriptDiagnosticsOptions.js +0 -0
- package/lib/{typescript-reporter → typescript}/TypeScriptReporterConfiguration.d.ts +5 -5
- package/lib/{typescript-reporter → typescript}/TypeScriptReporterConfiguration.js +2 -0
- package/lib/{typescript-reporter → typescript}/TypeScriptReporterOptions.d.ts +4 -5
- package/lib/{typescript-reporter → typescript}/TypeScriptReporterOptions.js +0 -0
- package/lib/{typescript-reporter → typescript}/TypeScriptSupport.d.ts +1 -1
- package/lib/{typescript-reporter → typescript}/TypeScriptSupport.js +26 -11
- package/lib/{typescript-reporter → typescript}/extension/TypeScriptEmbeddedExtension.d.ts +1 -1
- package/lib/{typescript-reporter → typescript}/extension/TypeScriptEmbeddedExtension.js +2 -1
- package/lib/{typescript-reporter → typescript}/extension/TypeScriptExtension.d.ts +2 -2
- package/lib/{typescript-reporter → typescript}/extension/TypeScriptExtension.js +0 -0
- package/lib/typescript/extension/vue/TypeScriptVueExtension.d.ts +4 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtension.js +2 -1
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +1 -1
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionConfiguration.js +1 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionOptions.d.ts +0 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionOptions.js +0 -0
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionSupport.d.ts +1 -1
- package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionSupport.js +1 -0
- 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/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 +114 -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} +2 -3
- package/lib/{eslint-reporter/types/eslint.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 +209 -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/pool.d.ts +2 -1
- package/lib/utils/async/pool.js +13 -14
- package/lib/utils/path/relativeToContext.d.ts +2 -0
- package/lib/utils/path/relativeToContext.js +16 -0
- package/lib/{rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.d.ts → utils/rpc/error.d.ts} +2 -3
- package/lib/utils/rpc/error.js +12 -0
- package/lib/utils/rpc/expose.d.ts +1 -0
- package/lib/utils/rpc/expose.js +78 -0
- package/lib/utils/rpc/index.d.ts +5 -0
- package/lib/utils/rpc/index.js +12 -0
- package/lib/utils/rpc/types.d.ts +19 -0
- package/lib/{reporter/FilesMatch.js → utils/rpc/types.js} +0 -0
- package/lib/utils/rpc/worker.d.ts +13 -0
- package/lib/utils/rpc/worker.js +79 -0
- package/lib/utils/rpc/wrap.d.ts +4 -0
- package/lib/utils/rpc/wrap.js +96 -0
- package/lib/watch/InclusiveNodeWatchFileSystem.d.ts +5 -5
- package/lib/watch/InclusiveNodeWatchFileSystem.js +90 -92
- package/lib/watch/WatchFileSystem.d.ts +5 -22
- package/package.json +50 -67
- package/CHANGELOG.md +0 -318
- package/changelog.config.js +0 -36
- package/lib/error/OperationCanceledError.d.ts +0 -4
- package/lib/error/OperationCanceledError.js +0 -9
- package/lib/eslint-reporter/EsLintReporterConfiguration.d.ts +0 -11
- package/lib/eslint-reporter/EsLintReporterConfiguration.js +0 -26
- package/lib/eslint-reporter/EsLintReporterOptions.d.ts +0 -8
- package/lib/eslint-reporter/assertEsLintSupport.d.ts +0 -3
- package/lib/eslint-reporter/assertEsLintSupport.js +0 -30
- package/lib/eslint-reporter/issue/EsLintIssueFactory.d.ts +0 -4
- package/lib/eslint-reporter/issue/EsLintIssueFactory.js +0 -32
- package/lib/eslint-reporter/reporter/EsLintReporter.d.ts +0 -4
- package/lib/eslint-reporter/reporter/EsLintReporter.js +0 -179
- package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.d.ts +0 -4
- package/lib/eslint-reporter/reporter/EsLintReporterRpcClient.js +0 -13
- package/lib/eslint-reporter/reporter/EsLintReporterRpcService.d.ts +0 -1
- package/lib/eslint-reporter/reporter/EsLintReporterRpcService.js +0 -11
- package/lib/eslint-reporter/types/eslint.d.ts +0 -37
- package/lib/formatter/FormatterFactory.d.ts +0 -13
- package/lib/formatter/FormatterFactory.js +0 -18
- package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +0 -6
- package/lib/hooks/tapStartToConnectAndRunReporter.js +0 -125
- package/lib/hooks/tapStopToDisconnectReporter.d.ts +0 -5
- package/lib/hooks/tapStopToDisconnectReporter.js +0 -29
- package/lib/profile/Performance.d.ts +0 -11
- package/lib/profile/Performance.js +0 -62
- package/lib/reporter/AggregatedReporter.d.ts +0 -6
- package/lib/reporter/AggregatedReporter.js +0 -60
- package/lib/reporter/Report.d.ts +0 -8
- package/lib/reporter/Report.js +0 -2
- package/lib/reporter/Reporter.d.ts +0 -6
- package/lib/reporter/Reporter.js +0 -2
- package/lib/reporter/index.d.ts +0 -7
- package/lib/reporter/index.js +0 -9
- package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +0 -10
- package/lib/reporter/reporter-rpc/ReporterRpcClient.js +0 -82
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +0 -10
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +0 -12
- package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +0 -9
- package/lib/reporter/reporter-rpc/ReporterRpcService.js +0 -74
- package/lib/rpc/RpcClient.d.ts +0 -10
- package/lib/rpc/RpcClient.js +0 -78
- package/lib/rpc/RpcHost.d.ts +0 -6
- package/lib/rpc/RpcHost.js +0 -2
- package/lib/rpc/RpcMessage.d.ts +0 -26
- package/lib/rpc/RpcMessage.js +0 -45
- package/lib/rpc/RpcMessageChannel.d.ts +0 -10
- package/lib/rpc/RpcMessageChannel.js +0 -49
- package/lib/rpc/RpcMessagePort.d.ts +0 -14
- package/lib/rpc/RpcMessagePort.js +0 -2
- package/lib/rpc/RpcProcedure.d.ts +0 -5
- package/lib/rpc/RpcProcedure.js +0 -2
- package/lib/rpc/RpcService.d.ts +0 -12
- package/lib/rpc/RpcService.js +0 -63
- package/lib/rpc/error/RpcMessagePortClosedError.d.ts +0 -3
- package/lib/rpc/error/RpcMessagePortClosedError.js +0 -5
- package/lib/rpc/error/RpcRemoteError.d.ts +0 -6
- package/lib/rpc/error/RpcRemoteError.js +0 -17
- package/lib/rpc/index.d.ts +0 -7
- package/lib/rpc/index.js +0 -9
- 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 -10
- package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +0 -5
- package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +0 -150
- package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +0 -12
- package/lib/rpc/rpc-ipc/index.d.ts +0 -2
- package/lib/rpc/rpc-ipc/index.js +0 -7
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +0 -4
- 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 -81
- package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +0 -9
- package/lib/typescript-reporter/file-system/PassiveFileSystem.js +0 -68
- package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +0 -8
- package/lib/typescript-reporter/file-system/RealFileSystem.js +0 -179
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +0 -4
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +0 -45
- package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +0 -10
- package/lib/typescript-reporter/profile/TypeScriptPerformance.js +0 -33
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +0 -229
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +0 -5
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +0 -28
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +0 -5
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +0 -50
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +0 -8
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +0 -136
- package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +0 -4
- package/lib/typescript-reporter/reporter/TypeScriptReporter.js +0 -352
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +0 -4
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +0 -13
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.d.ts +0 -1
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +0 -11
- package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
- package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import webpack from 'webpack';
|
|
2
|
-
import Logger from './Logger';
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type Logger from './Logger';
|
|
3
3
|
declare function createWebpackInfrastructureLogger(compiler: webpack.Compiler): Logger | undefined;
|
|
4
4
|
export { createWebpackInfrastructureLogger };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createWebpackInfrastructureLogger = void 0;
|
|
3
4
|
function isInfrastructureLoggerProvider(candidate) {
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
return !!candidate.getInfrastructureLogger;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import webpack from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { TypeScriptVueExtensionConfiguration } from './extension/vue/TypeScriptVueExtensionConfiguration';
|
|
3
|
+
import type { TypeScriptConfigurationOverwrite } from './TypeScriptConfigurationOverwrite';
|
|
4
|
+
import type { TypeScriptDiagnosticsOptions } from './TypeScriptDiagnosticsOptions';
|
|
5
|
+
import type { TypeScriptReporterOptions } from './TypeScriptReporterOptions';
|
|
6
6
|
interface TypeScriptReporterConfiguration {
|
|
7
7
|
enabled: boolean;
|
|
8
8
|
memoryLimit: number;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTypeScriptReporterConfiguration = void 0;
|
|
6
7
|
const path_1 = __importDefault(require("path"));
|
|
7
8
|
const semver_1 = __importDefault(require("semver"));
|
|
8
9
|
const TypeScriptVueExtensionConfiguration_1 = require("./extension/vue/TypeScriptVueExtensionConfiguration");
|
|
@@ -19,6 +20,7 @@ function createTypeScriptReporterConfiguration(compiler, options) {
|
|
|
19
20
|
sourceMap: false,
|
|
20
21
|
inlineSourceMap: false,
|
|
21
22
|
};
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
22
24
|
if (semver_1.default.gte(require(typescriptPath).version, '2.9.0')) {
|
|
23
25
|
defaultCompilerOptions.declarationMap = false;
|
|
24
26
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
declare type TypeScriptReporterOptions =
|
|
5
|
-
enabled?: boolean;
|
|
1
|
+
import type { TypeScriptVueExtensionOptions } from './extension/vue/TypeScriptVueExtensionOptions';
|
|
2
|
+
import type { TypeScriptConfigurationOverwrite } from './TypeScriptConfigurationOverwrite';
|
|
3
|
+
import type { TypeScriptDiagnosticsOptions } from './TypeScriptDiagnosticsOptions';
|
|
4
|
+
declare type TypeScriptReporterOptions = {
|
|
6
5
|
memoryLimit?: number;
|
|
7
6
|
configFile?: string;
|
|
8
7
|
configOverwrite?: TypeScriptConfigurationOverwrite;
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TypeScriptReporterConfiguration } from './TypeScriptReporterConfiguration';
|
|
1
|
+
import type { TypeScriptReporterConfiguration } from './TypeScriptReporterConfiguration';
|
|
2
2
|
declare function assertTypeScriptSupport(configuration: TypeScriptReporterConfiguration): void;
|
|
3
3
|
export { assertTypeScriptSupport };
|
|
@@ -1,39 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
2
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
15
|
if (mod && mod.__esModule) return mod;
|
|
4
16
|
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
6
|
-
result
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
7
19
|
return result;
|
|
8
20
|
};
|
|
9
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
23
|
};
|
|
12
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
14
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
25
|
+
exports.assertTypeScriptSupport = void 0;
|
|
15
26
|
const os_1 = __importDefault(require("os"));
|
|
27
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
28
|
+
const semver = __importStar(require("semver"));
|
|
16
29
|
const TypeScriptVueExtensionSupport_1 = require("./extension/vue/TypeScriptVueExtensionSupport");
|
|
17
30
|
function assertTypeScriptSupport(configuration) {
|
|
18
31
|
let typescriptVersion;
|
|
19
32
|
try {
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20
34
|
typescriptVersion = require(configuration.typescriptPath).version;
|
|
21
35
|
}
|
|
22
|
-
catch (error) {
|
|
36
|
+
catch (error) {
|
|
37
|
+
// silent catch
|
|
38
|
+
}
|
|
23
39
|
if (!typescriptVersion) {
|
|
24
40
|
throw new Error('When you use ForkTsCheckerWebpackPlugin with typescript reporter enabled, you must install `typescript` package.');
|
|
25
41
|
}
|
|
26
|
-
if (semver.lt(typescriptVersion, '
|
|
42
|
+
if (semver.lt(typescriptVersion, '3.6.0')) {
|
|
27
43
|
throw new Error([
|
|
28
44
|
`ForkTsCheckerWebpackPlugin cannot use the current typescript version of ${typescriptVersion}.`,
|
|
29
|
-
'The minimum required version is
|
|
45
|
+
'The minimum required version is 3.6.0.',
|
|
30
46
|
].join(os_1.default.EOL));
|
|
31
47
|
}
|
|
32
|
-
if (configuration.build && semver.lt(typescriptVersion, '3.
|
|
48
|
+
if (configuration.build && semver.lt(typescriptVersion, '3.8.0')) {
|
|
33
49
|
throw new Error([
|
|
34
|
-
`ForkTsCheckerWebpackPlugin
|
|
35
|
-
'The minimum version
|
|
36
|
-
'Consider upgrading `typescript` or disabling "build" option.',
|
|
50
|
+
`ForkTsCheckerWebpackPlugin doesn't support build option for the current typescript version of ${typescriptVersion}.`,
|
|
51
|
+
'The minimum required version is 3.8.0.',
|
|
37
52
|
].join(os_1.default.EOL));
|
|
38
53
|
}
|
|
39
54
|
if (!fs_extra_1.default.existsSync(configuration.configFile)) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTypeScriptEmbeddedExtension = void 0;
|
|
3
4
|
const path_1 = require("path");
|
|
4
5
|
/**
|
|
5
6
|
* It handles most of the logic required to process embedded TypeScript code (like in Vue components or MDX)
|
|
@@ -96,7 +97,7 @@ function createTypeScriptEmbeddedExtension({ embeddedExtensions, getEmbeddedSour
|
|
|
96
97
|
},
|
|
97
98
|
extendDependencies(dependencies) {
|
|
98
99
|
return Object.assign(Object.assign({}, dependencies), { files: dependencies.files.map((fileName) => {
|
|
99
|
-
const { embeddedExtension, embeddedFileName, extension
|
|
100
|
+
const { embeddedExtension, embeddedFileName, extension } = parsePotentiallyEmbeddedFileName(fileName);
|
|
100
101
|
if (embeddedExtensions.includes(embeddedExtension)) {
|
|
101
102
|
const embeddedSource = getCachedEmbeddedSource(embeddedFileName);
|
|
102
103
|
if (embeddedSource && embeddedSource.extension === extension) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { FilesMatch } from '../../files-match';
|
|
3
|
+
import type { Issue } from '../../issue';
|
|
4
4
|
interface TypeScriptHostExtension {
|
|
5
5
|
extendWatchSolutionBuilderHost?<TProgram extends ts.BuilderProgram, THost extends ts.SolutionBuilderWithWatchHost<TProgram>>(host: THost, parsedCommandLine?: ts.ParsedCommandLine): THost;
|
|
6
6
|
extendWatchCompilerHost?<TProgram extends ts.BuilderProgram, THost extends ts.WatchCompilerHost<TProgram>>(host: THost, parsedCommandLine?: ts.ParsedCommandLine): THost;
|
|
File without changes
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TypeScriptExtension } from '../TypeScriptExtension';
|
|
2
|
+
import type { TypeScriptVueExtensionConfiguration } from './TypeScriptVueExtensionConfiguration';
|
|
3
|
+
declare function createTypeScriptVueExtension(configuration: TypeScriptVueExtensionConfiguration): TypeScriptExtension;
|
|
4
|
+
export { createTypeScriptVueExtension };
|
|
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
exports.createTypeScriptVueExtension = void 0;
|
|
7
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const TypeScriptEmbeddedExtension_1 = require("../TypeScriptEmbeddedExtension");
|
|
8
9
|
function createTypeScriptVueExtension(configuration) {
|
|
9
10
|
function loadVueTemplateCompiler() {
|
|
10
11
|
return require(configuration.compiler);
|
package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionConfiguration.js
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTypeScriptVueExtensionConfiguration = void 0;
|
|
3
4
|
function createTypeScriptVueExtensionConfiguration(options) {
|
|
4
5
|
return Object.assign({ enabled: options === true, compiler: 'vue-template-compiler' }, (typeof options === 'object' ? options : {}));
|
|
5
6
|
}
|
package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionOptions.d.ts
RENAMED
|
File without changes
|
package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionOptions.js
RENAMED
|
File without changes
|
package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionSupport.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TypeScriptVueExtensionConfiguration } from './TypeScriptVueExtensionConfiguration';
|
|
1
|
+
import type { TypeScriptVueExtensionConfiguration } from './TypeScriptVueExtensionConfiguration';
|
|
2
2
|
declare function assertTypeScriptVueExtensionSupport(configuration: TypeScriptVueExtensionConfiguration): void;
|
|
3
3
|
export { assertTypeScriptVueExtensionSupport };
|
package/lib/{typescript-reporter → typescript}/extension/vue/TypeScriptVueExtensionSupport.js
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertTypeScriptVueExtensionSupport = void 0;
|
|
3
4
|
function assertTypeScriptVueExtensionSupport(configuration) {
|
|
4
5
|
// We need to import template compiler for vue lazily because it cannot be included it
|
|
5
6
|
// as direct dependency because it is an optional dependency of fork-ts-checker-webpack-plugin.
|
package/lib/{typescript-reporter → typescript}/extension/vue/types/vue-template-compiler.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FilesChange } from '../../files-change';
|
|
2
|
+
import type { FilesMatch } from '../../files-match';
|
|
3
|
+
declare const getDependenciesWorker: ({ changedFiles, deletedFiles, }: FilesChange) => FilesMatch;
|
|
4
|
+
export declare type GetDependenciesWorker = typeof getDependenciesWorker;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const rpc_1 = require("../../utils/rpc");
|
|
4
|
+
const config_1 = require("./lib/config");
|
|
5
|
+
const dependencies_1 = require("./lib/dependencies");
|
|
6
|
+
const system_1 = require("./lib/system");
|
|
7
|
+
const getDependenciesWorker = ({ changedFiles = [], deletedFiles = [], }) => {
|
|
8
|
+
system_1.system.invalidateCache();
|
|
9
|
+
if (config_1.didConfigFileChanged({ changedFiles, deletedFiles })) {
|
|
10
|
+
config_1.invalidateConfig();
|
|
11
|
+
dependencies_1.invalidateDependencies();
|
|
12
|
+
}
|
|
13
|
+
else if (config_1.didRootFilesChanged()) {
|
|
14
|
+
dependencies_1.invalidateDependencies();
|
|
15
|
+
}
|
|
16
|
+
return dependencies_1.getDependencies();
|
|
17
|
+
};
|
|
18
|
+
rpc_1.exposeRpc(getDependenciesWorker);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FilesChange } from '../../files-change';
|
|
2
|
+
import type { Issue } from '../../issue';
|
|
3
|
+
declare const getIssuesWorker: ({ changedFiles, deletedFiles }: FilesChange, watching: boolean) => Promise<Issue[]>;
|
|
4
|
+
export declare type GetIssuesWorker = typeof getIssuesWorker;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
const rpc_1 = require("../../utils/rpc");
|
|
13
|
+
const artifacts_1 = require("./lib/artifacts");
|
|
14
|
+
const config_1 = require("./lib/config");
|
|
15
|
+
const dependencies_1 = require("./lib/dependencies");
|
|
16
|
+
const diagnostics_1 = require("./lib/diagnostics");
|
|
17
|
+
const performance_1 = require("./lib/performance");
|
|
18
|
+
const program_1 = require("./lib/program/program");
|
|
19
|
+
const solution_builder_1 = require("./lib/program/solution-builder");
|
|
20
|
+
const watch_program_1 = require("./lib/program/watch-program");
|
|
21
|
+
const system_1 = require("./lib/system");
|
|
22
|
+
const tracing_1 = require("./lib/tracing");
|
|
23
|
+
const tsbuildinfo_1 = require("./lib/tsbuildinfo");
|
|
24
|
+
const worker_config_1 = require("./lib/worker-config");
|
|
25
|
+
const getIssuesWorker = ({ changedFiles = [], deletedFiles = [] }, watching) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
system_1.system.invalidateCache();
|
|
27
|
+
if (config_1.didConfigFileChanged({ changedFiles, deletedFiles })) {
|
|
28
|
+
config_1.invalidateConfig();
|
|
29
|
+
dependencies_1.invalidateDependencies();
|
|
30
|
+
artifacts_1.invalidateArtifacts();
|
|
31
|
+
diagnostics_1.invalidateDiagnostics();
|
|
32
|
+
program_1.invalidateProgram(true);
|
|
33
|
+
watch_program_1.invalidateWatchProgram(true);
|
|
34
|
+
solution_builder_1.invalidateSolutionBuilder(true);
|
|
35
|
+
tsbuildinfo_1.invalidateTsBuildInfo();
|
|
36
|
+
}
|
|
37
|
+
else if (config_1.didRootFilesChanged()) {
|
|
38
|
+
dependencies_1.invalidateDependencies();
|
|
39
|
+
artifacts_1.invalidateArtifacts();
|
|
40
|
+
watch_program_1.invalidateWatchProgramRootFileNames();
|
|
41
|
+
solution_builder_1.invalidateSolutionBuilder();
|
|
42
|
+
}
|
|
43
|
+
artifacts_1.registerArtifacts();
|
|
44
|
+
performance_1.enablePerformanceIfNeeded();
|
|
45
|
+
const parseConfigIssues = config_1.getParseConfigIssues();
|
|
46
|
+
if (parseConfigIssues.length) {
|
|
47
|
+
// report config parse issues and exit
|
|
48
|
+
return parseConfigIssues;
|
|
49
|
+
}
|
|
50
|
+
// use proper implementation based on the config
|
|
51
|
+
if (worker_config_1.config.build) {
|
|
52
|
+
solution_builder_1.useSolutionBuilder();
|
|
53
|
+
}
|
|
54
|
+
else if (watching) {
|
|
55
|
+
watch_program_1.useWatchProgram();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
program_1.useProgram();
|
|
59
|
+
}
|
|
60
|
+
// simulate file system events
|
|
61
|
+
changedFiles.forEach((changedFile) => {
|
|
62
|
+
system_1.system === null || system_1.system === void 0 ? void 0 : system_1.system.invokeFileChanged(changedFile);
|
|
63
|
+
});
|
|
64
|
+
deletedFiles.forEach((removedFile) => {
|
|
65
|
+
system_1.system === null || system_1.system === void 0 ? void 0 : system_1.system.invokeFileDeleted(removedFile);
|
|
66
|
+
});
|
|
67
|
+
// wait for all queued events to be processed
|
|
68
|
+
yield system_1.system.waitForQueued();
|
|
69
|
+
// retrieve all collected diagnostics as normalized issues
|
|
70
|
+
const issues = diagnostics_1.getIssues();
|
|
71
|
+
tracing_1.dumpTracingLegendIfNeeded();
|
|
72
|
+
performance_1.printPerformanceMeasuresIfNeeded();
|
|
73
|
+
performance_1.disablePerformanceIfNeeded();
|
|
74
|
+
return issues;
|
|
75
|
+
});
|
|
76
|
+
rpc_1.exposeRpc(getIssuesWorker);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.registerArtifacts = exports.invalidateArtifacts = exports.getArtifacts = void 0;
|
|
23
|
+
const path = __importStar(require("path"));
|
|
24
|
+
const config_1 = require("./config");
|
|
25
|
+
const system_1 = require("./system");
|
|
26
|
+
const tsbuildinfo_1 = require("./tsbuildinfo");
|
|
27
|
+
const typescript_1 = require("./typescript");
|
|
28
|
+
const worker_config_1 = require("./worker-config");
|
|
29
|
+
let artifacts;
|
|
30
|
+
function getArtifacts(force = false) {
|
|
31
|
+
if (!artifacts || force) {
|
|
32
|
+
const parsedConfig = config_1.getParsedConfig();
|
|
33
|
+
artifacts = getArtifactsWorker(parsedConfig, worker_config_1.config.context);
|
|
34
|
+
}
|
|
35
|
+
return artifacts;
|
|
36
|
+
}
|
|
37
|
+
exports.getArtifacts = getArtifacts;
|
|
38
|
+
function invalidateArtifacts() {
|
|
39
|
+
artifacts = undefined;
|
|
40
|
+
}
|
|
41
|
+
exports.invalidateArtifacts = invalidateArtifacts;
|
|
42
|
+
function registerArtifacts() {
|
|
43
|
+
system_1.system.setArtifacts(getArtifacts());
|
|
44
|
+
}
|
|
45
|
+
exports.registerArtifacts = registerArtifacts;
|
|
46
|
+
function getArtifactsWorker(parsedConfig, configFileContext, processedConfigFiles = []) {
|
|
47
|
+
const files = new Set();
|
|
48
|
+
const dirs = new Set();
|
|
49
|
+
if (parsedConfig.fileNames.length > 0) {
|
|
50
|
+
if (parsedConfig.options.outFile) {
|
|
51
|
+
files.add(path.resolve(configFileContext, parsedConfig.options.outFile));
|
|
52
|
+
}
|
|
53
|
+
const tsBuildInfoPath = tsbuildinfo_1.getTsBuildInfoEmitPath(parsedConfig.options);
|
|
54
|
+
if (tsBuildInfoPath) {
|
|
55
|
+
files.add(path.resolve(configFileContext, tsBuildInfoPath));
|
|
56
|
+
}
|
|
57
|
+
if (parsedConfig.options.outDir) {
|
|
58
|
+
dirs.add(path.resolve(configFileContext, parsedConfig.options.outDir));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (const projectReference of parsedConfig.projectReferences || []) {
|
|
62
|
+
const configFile = typescript_1.typescript.resolveProjectReferencePath(projectReference);
|
|
63
|
+
if (processedConfigFiles.includes(configFile)) {
|
|
64
|
+
// handle circular dependencies
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const parsedConfiguration = config_1.parseConfig(configFile, path.dirname(configFile));
|
|
68
|
+
const childArtifacts = getArtifactsWorker(parsedConfiguration, configFileContext, [
|
|
69
|
+
...processedConfigFiles,
|
|
70
|
+
configFile,
|
|
71
|
+
]);
|
|
72
|
+
childArtifacts.files.forEach((file) => {
|
|
73
|
+
files.add(file);
|
|
74
|
+
});
|
|
75
|
+
childArtifacts.dirs.forEach((dir) => {
|
|
76
|
+
dirs.add(dir);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const extensions = [
|
|
80
|
+
typescript_1.typescript.Extension.Dts,
|
|
81
|
+
typescript_1.typescript.Extension.Js,
|
|
82
|
+
typescript_1.typescript.Extension.TsBuildInfo,
|
|
83
|
+
];
|
|
84
|
+
return {
|
|
85
|
+
files: Array.from(files).map((file) => path.normalize(file)),
|
|
86
|
+
dirs: Array.from(dirs).map((dir) => path.normalize(dir)),
|
|
87
|
+
excluded: [],
|
|
88
|
+
extensions,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as ts from 'typescript';
|
|
2
|
+
import type { FilesChange } from '../../../files-change';
|
|
3
|
+
import type { Issue } from '../../../issue';
|
|
4
|
+
import type { TypeScriptConfigurationOverwrite } from '../../TypeScriptConfigurationOverwrite';
|
|
5
|
+
export declare function parseConfig(configFileName: string, configFileContext: string, configOverwriteJSON?: TypeScriptConfigurationOverwrite): ts.ParsedCommandLine;
|
|
6
|
+
export declare function getParseConfigIssues(): Issue[];
|
|
7
|
+
export declare function getParsedConfig(force?: boolean): ts.ParsedCommandLine;
|
|
8
|
+
export declare function parseNextConfig(): readonly [ts.ParsedCommandLine | undefined, ts.ParsedCommandLine];
|
|
9
|
+
export declare function invalidateConfig(): void;
|
|
10
|
+
export declare function getConfigFilePathFromCompilerOptions(compilerOptions: ts.CompilerOptions): string;
|
|
11
|
+
export declare function getConfigFilePathFromProgram(program: ts.Program): string;
|
|
12
|
+
export declare function getConfigFilePathFromBuilderProgram(builderProgram: ts.BuilderProgram): string;
|
|
13
|
+
export declare function didConfigFileChanged({ changedFiles, deletedFiles }: FilesChange): boolean;
|
|
14
|
+
export declare function didRootFilesChanged(): boolean | undefined;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.didRootFilesChanged = exports.didConfigFileChanged = exports.getConfigFilePathFromBuilderProgram = exports.getConfigFilePathFromProgram = exports.getConfigFilePathFromCompilerOptions = exports.invalidateConfig = exports.parseNextConfig = exports.getParsedConfig = exports.getParseConfigIssues = exports.parseConfig = void 0;
|
|
26
|
+
const path = __importStar(require("path"));
|
|
27
|
+
const forwardSlash_1 = __importDefault(require("../../../utils/path/forwardSlash"));
|
|
28
|
+
const diagnostics_1 = require("./diagnostics");
|
|
29
|
+
const extensions_1 = require("./extensions");
|
|
30
|
+
const system_1 = require("./system");
|
|
31
|
+
const typescript_1 = require("./typescript");
|
|
32
|
+
const worker_config_1 = require("./worker-config");
|
|
33
|
+
let parsedConfig;
|
|
34
|
+
let parseConfigDiagnostics = [];
|
|
35
|
+
// initialize ParseConfigFileHost
|
|
36
|
+
let parseConfigFileHost = Object.assign(Object.assign({}, system_1.system), { onUnRecoverableConfigFileDiagnostic: (diagnostic) => {
|
|
37
|
+
parseConfigDiagnostics.push(diagnostic);
|
|
38
|
+
} });
|
|
39
|
+
for (const extension of extensions_1.extensions) {
|
|
40
|
+
if (extension.extendParseConfigFileHost) {
|
|
41
|
+
parseConfigFileHost = extension.extendParseConfigFileHost(parseConfigFileHost);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function parseConfig(configFileName, configFileContext, configOverwriteJSON = {}) {
|
|
45
|
+
const configFilePath = forwardSlash_1.default(configFileName);
|
|
46
|
+
const parsedConfigFileJSON = typescript_1.typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
47
|
+
const overwrittenConfigFileJSON = Object.assign(Object.assign(Object.assign({}, (parsedConfigFileJSON.config || {})), configOverwriteJSON), { compilerOptions: Object.assign(Object.assign({}, ((parsedConfigFileJSON.config || {}).compilerOptions || {})), (configOverwriteJSON.compilerOptions || {})) });
|
|
48
|
+
const parsedConfigFile = typescript_1.typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, configFileContext);
|
|
49
|
+
return Object.assign(Object.assign({}, parsedConfigFile), { options: Object.assign(Object.assign({}, parsedConfigFile.options), { configFilePath: configFilePath }), errors: parsedConfigFileJSON.error ? [parsedConfigFileJSON.error] : parsedConfigFile.errors });
|
|
50
|
+
}
|
|
51
|
+
exports.parseConfig = parseConfig;
|
|
52
|
+
function getParseConfigIssues() {
|
|
53
|
+
const issues = diagnostics_1.createIssuesFromDiagnostics(parseConfigDiagnostics);
|
|
54
|
+
issues.forEach((issue) => {
|
|
55
|
+
if (!issue.file) {
|
|
56
|
+
issue.file = worker_config_1.config.configFile;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return issues;
|
|
60
|
+
}
|
|
61
|
+
exports.getParseConfigIssues = getParseConfigIssues;
|
|
62
|
+
function getParsedConfig(force = false) {
|
|
63
|
+
if (!parsedConfig || force) {
|
|
64
|
+
parseConfigDiagnostics = [];
|
|
65
|
+
parsedConfig = parseConfig(worker_config_1.config.configFile, worker_config_1.config.context, worker_config_1.config.configOverwrite);
|
|
66
|
+
const configFilePath = forwardSlash_1.default(worker_config_1.config.configFile);
|
|
67
|
+
const parsedConfigFileJSON = typescript_1.typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
68
|
+
const overwrittenConfigFileJSON = Object.assign(Object.assign(Object.assign({}, (parsedConfigFileJSON.config || {})), worker_config_1.config.configOverwrite), { compilerOptions: Object.assign(Object.assign({}, ((parsedConfigFileJSON.config || {}).compilerOptions || {})), (worker_config_1.config.configOverwrite.compilerOptions || {})) });
|
|
69
|
+
parsedConfig = typescript_1.typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, worker_config_1.config.context);
|
|
70
|
+
parsedConfig.options.configFilePath = configFilePath;
|
|
71
|
+
parsedConfig.errors = parsedConfigFileJSON.error
|
|
72
|
+
? [parsedConfigFileJSON.error]
|
|
73
|
+
: parsedConfig.errors;
|
|
74
|
+
if (parsedConfig.errors) {
|
|
75
|
+
parseConfigDiagnostics.push(...parsedConfig.errors);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return parsedConfig;
|
|
79
|
+
}
|
|
80
|
+
exports.getParsedConfig = getParsedConfig;
|
|
81
|
+
function parseNextConfig() {
|
|
82
|
+
const prevParsedConfig = parsedConfig;
|
|
83
|
+
const nextParsedConfig = getParsedConfig(true);
|
|
84
|
+
return [prevParsedConfig, nextParsedConfig];
|
|
85
|
+
}
|
|
86
|
+
exports.parseNextConfig = parseNextConfig;
|
|
87
|
+
function invalidateConfig() {
|
|
88
|
+
parsedConfig = undefined;
|
|
89
|
+
parseConfigDiagnostics = [];
|
|
90
|
+
}
|
|
91
|
+
exports.invalidateConfig = invalidateConfig;
|
|
92
|
+
function getConfigFilePathFromCompilerOptions(compilerOptions) {
|
|
93
|
+
return compilerOptions.configFilePath;
|
|
94
|
+
}
|
|
95
|
+
exports.getConfigFilePathFromCompilerOptions = getConfigFilePathFromCompilerOptions;
|
|
96
|
+
function getConfigFilePathFromProgram(program) {
|
|
97
|
+
return getConfigFilePathFromCompilerOptions(program.getCompilerOptions());
|
|
98
|
+
}
|
|
99
|
+
exports.getConfigFilePathFromProgram = getConfigFilePathFromProgram;
|
|
100
|
+
function getConfigFilePathFromBuilderProgram(builderProgram) {
|
|
101
|
+
return getConfigFilePathFromCompilerOptions(builderProgram.getProgram().getCompilerOptions());
|
|
102
|
+
}
|
|
103
|
+
exports.getConfigFilePathFromBuilderProgram = getConfigFilePathFromBuilderProgram;
|
|
104
|
+
function didConfigFileChanged({ changedFiles = [], deletedFiles = [] }) {
|
|
105
|
+
return [...changedFiles, ...deletedFiles]
|
|
106
|
+
.map((file) => path.normalize(file))
|
|
107
|
+
.includes(path.normalize(worker_config_1.config.configFile));
|
|
108
|
+
}
|
|
109
|
+
exports.didConfigFileChanged = didConfigFileChanged;
|
|
110
|
+
function didRootFilesChanged() {
|
|
111
|
+
const [prevConfig, nextConfig] = parseNextConfig();
|
|
112
|
+
return (prevConfig && JSON.stringify(prevConfig.fileNames) !== JSON.stringify(nextConfig.fileNames));
|
|
113
|
+
}
|
|
114
|
+
exports.didRootFilesChanged = didRootFilesChanged;
|