fork-ts-checker-webpack-plugin 6.3.5 → 7.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -103
- package/lib/ForkTsCheckerWebpackPlugin.d.ts +11 -12
- package/lib/ForkTsCheckerWebpackPlugin.js +29 -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 +4 -4
- package/lib/ForkTsCheckerWebpackPluginState.js +1 -0
- package/lib/error/OperationCanceledError.js +1 -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 +1 -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 +1 -0
- package/lib/hooks/tapAfterCompileToGetIssues.d.ts +3 -3
- package/lib/hooks/tapAfterCompileToGetIssues.js +2 -1
- package/lib/hooks/tapAfterEnvironmentToPatchWatching.d.ts +2 -2
- package/lib/hooks/tapAfterEnvironmentToPatchWatching.js +4 -1
- package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +3 -3
- package/lib/hooks/tapDoneToAsyncGetIssues.js +3 -2
- package/lib/hooks/tapErrorToLogMessage.d.ts +2 -2
- package/lib/hooks/tapErrorToLogMessage.js +4 -3
- package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +4 -4
- package/lib/hooks/tapStartToConnectAndRunReporter.js +16 -11
- package/lib/hooks/tapStopToDisconnectReporter.d.ts +3 -3
- package/lib/hooks/tapStopToDisconnectReporter.js +1 -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/profile/Performance.js +1 -0
- package/lib/reporter/AggregatedReporter.d.ts +1 -1
- package/lib/reporter/AggregatedReporter.js +5 -4
- package/lib/reporter/FilesChange.d.ts +1 -1
- package/lib/reporter/FilesChange.js +2 -1
- package/lib/reporter/Report.d.ts +2 -2
- package/lib/reporter/Reporter.d.ts +3 -3
- package/lib/reporter/index.js +17 -7
- package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +2 -2
- package/lib/reporter/reporter-rpc/ReporterRpcClient.js +7 -4
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +8 -5
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.js +3 -0
- package/lib/reporter/reporter-rpc/ReporterRpcService.d.ts +2 -2
- package/lib/reporter/reporter-rpc/ReporterRpcService.js +5 -2
- package/lib/rpc/RpcClient.d.ts +2 -2
- package/lib/rpc/RpcClient.js +2 -1
- package/lib/rpc/RpcMessage.d.ts +1 -1
- package/lib/rpc/RpcMessage.js +3 -0
- package/lib/rpc/RpcMessageChannel.d.ts +1 -1
- package/lib/rpc/RpcMessageChannel.js +1 -0
- package/lib/rpc/RpcService.d.ts +2 -2
- package/lib/rpc/RpcService.js +1 -0
- package/lib/rpc/error/RpcMessagePortClosedError.js +1 -0
- package/lib/rpc/error/RpcRemoteError.js +1 -0
- package/lib/rpc/index.js +17 -7
- package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.d.ts +1 -1
- package/lib/rpc/rpc-ipc/RpcIpcMessageChannel.js +1 -0
- package/lib/rpc/rpc-ipc/RpcIpcMessagePort.d.ts +2 -2
- package/lib/rpc/rpc-ipc/RpcIpcMessagePort.js +1 -0
- package/lib/rpc/rpc-ipc/error/RpcIpcMessagePortClosedError.js +1 -0
- package/lib/rpc/rpc-ipc/index.js +12 -5
- package/lib/typescript-reporter/TypeScriptConfigurationOverwrite.d.ts +1 -1
- package/lib/typescript-reporter/TypeScriptReporterConfiguration.d.ts +5 -5
- package/lib/typescript-reporter/TypeScriptReporterConfiguration.js +2 -0
- package/lib/typescript-reporter/TypeScriptReporterOptions.d.ts +4 -5
- package/lib/typescript-reporter/TypeScriptSupport.d.ts +1 -1
- package/lib/typescript-reporter/TypeScriptSupport.js +26 -11
- package/lib/typescript-reporter/extension/TypeScriptEmbeddedExtension.d.ts +1 -1
- package/lib/typescript-reporter/extension/TypeScriptEmbeddedExtension.js +2 -1
- package/lib/typescript-reporter/extension/TypeScriptExtension.d.ts +2 -2
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +2 -2
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.js +4 -3
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +1 -1
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionConfiguration.js +1 -0
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.d.ts +1 -1
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtensionSupport.js +1 -0
- package/lib/typescript-reporter/extension/vue/types/vue__compiler-sfc.d.ts +0 -1
- package/lib/typescript-reporter/file-system/FileSystem.d.ts +1 -1
- package/lib/typescript-reporter/file-system/MemFileSystem.d.ts +1 -1
- package/lib/typescript-reporter/file-system/MemFileSystem.js +2 -0
- package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +1 -1
- package/lib/typescript-reporter/file-system/PassiveFileSystem.js +1 -0
- package/lib/typescript-reporter/file-system/RealFileSystem.d.ts +1 -1
- package/lib/typescript-reporter/file-system/RealFileSystem.js +2 -0
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.d.ts +1 -1
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +17 -5
- package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +1 -1
- package/lib/typescript-reporter/profile/TypeScriptPerformance.js +1 -0
- package/lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts +5 -0
- package/lib/typescript-reporter/reporter/ControlledCompilerHost.js +14 -0
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts +1 -1
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +7 -18
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +2 -2
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +1 -0
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +2 -2
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +1 -0
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +2 -2
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +8 -2
- package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +2 -2
- package/lib/typescript-reporter/reporter/TypeScriptReporter.js +42 -18
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.d.ts +2 -2
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcClient.js +1 -0
- package/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js +2 -2
- package/lib/utils/async/pool.d.ts +1 -0
- package/lib/utils/async/pool.js +10 -0
- package/lib/utils/path/relativeToContext.d.ts +2 -0
- package/lib/utils/path/relativeToContext.js +16 -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/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/EsLintReporterOptions.js +0 -2
- 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 -133
- 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 -31
- package/lib/eslint-reporter/types/eslint.js +0 -2
- package/lib/formatter/FormatterFactory.d.ts +0 -13
- package/lib/formatter/FormatterFactory.js +0 -18
- package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
- package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
|
@@ -1,12 +1,25 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.createIssuesFromTsDiagnostics = void 0;
|
|
10
23
|
const os = __importStar(require("os"));
|
|
11
24
|
const issue_1 = require("../../issue");
|
|
12
25
|
function createIssueFromTsDiagnostic(typescript, diagnostic) {
|
|
@@ -15,8 +28,8 @@ function createIssueFromTsDiagnostic(typescript, diagnostic) {
|
|
|
15
28
|
if (diagnostic.file) {
|
|
16
29
|
file = diagnostic.file.fileName;
|
|
17
30
|
if (diagnostic.start && diagnostic.length) {
|
|
18
|
-
const { line: startLine, character: startCharacter
|
|
19
|
-
const { line: endLine, character: endCharacter
|
|
31
|
+
const { line: startLine, character: startCharacter } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
|
32
|
+
const { line: endLine, character: endCharacter } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start + diagnostic.length);
|
|
20
33
|
location = {
|
|
21
34
|
start: {
|
|
22
35
|
line: startLine + 1,
|
|
@@ -30,7 +43,6 @@ function createIssueFromTsDiagnostic(typescript, diagnostic) {
|
|
|
30
43
|
}
|
|
31
44
|
}
|
|
32
45
|
return {
|
|
33
|
-
origin: 'typescript',
|
|
34
46
|
code: 'TS' + String(diagnostic.code),
|
|
35
47
|
// we don't handle Suggestion and Message diagnostics
|
|
36
48
|
severity: diagnostic.category === 0 ? 'warning' : 'error',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectTypeScriptPerformance = void 0;
|
|
3
4
|
function getTypeScriptPerformance(typescript) {
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
return typescript.performance;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as ts from 'typescript';
|
|
2
|
+
import type { TypeScriptHostExtension } from '../extension/TypeScriptExtension';
|
|
3
|
+
import type { ControlledTypeScriptSystem } from './ControlledTypeScriptSystem';
|
|
4
|
+
declare function createControlledCompilerHost(typescript: typeof ts, parsedCommandLine: ts.ParsedCommandLine, system: ControlledTypeScriptSystem, hostExtensions?: TypeScriptHostExtension[]): ts.CompilerHost;
|
|
5
|
+
export { createControlledCompilerHost };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createControlledCompilerHost = void 0;
|
|
4
|
+
function createControlledCompilerHost(typescript, parsedCommandLine, system, hostExtensions = []) {
|
|
5
|
+
const baseCompilerHost = typescript.createCompilerHost(parsedCommandLine.options);
|
|
6
|
+
let controlledCompilerHost = Object.assign(Object.assign({}, baseCompilerHost), { fileExists: system.fileExists, readFile: system.readFile, directoryExists: system.directoryExists, getDirectories: system.getDirectories, realpath: system.realpath });
|
|
7
|
+
hostExtensions.forEach((hostExtension) => {
|
|
8
|
+
if (hostExtension.extendCompilerHost) {
|
|
9
|
+
controlledCompilerHost = hostExtension.extendCompilerHost(controlledCompilerHost, parsedCommandLine);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return controlledCompilerHost;
|
|
13
|
+
}
|
|
14
|
+
exports.createControlledCompilerHost = createControlledCompilerHost;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
import { FilesMatch } from '../../reporter';
|
|
2
|
+
import type { FilesMatch } from '../../reporter';
|
|
3
3
|
interface ControlledTypeScriptSystem extends ts.System {
|
|
4
4
|
invokeFileCreated(path: string): void;
|
|
5
5
|
invokeFileChanged(path: string): void;
|
|
@@ -12,11 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createControlledTypeScriptSystem = void 0;
|
|
15
16
|
const path_1 = require("path");
|
|
16
|
-
const PassiveFileSystem_1 = require("../file-system/PassiveFileSystem");
|
|
17
17
|
const forwardSlash_1 = __importDefault(require("../../utils/path/forwardSlash"));
|
|
18
|
-
const RealFileSystem_1 = require("../file-system/RealFileSystem");
|
|
19
18
|
const MemFileSystem_1 = require("../file-system/MemFileSystem");
|
|
19
|
+
const PassiveFileSystem_1 = require("../file-system/PassiveFileSystem");
|
|
20
|
+
const RealFileSystem_1 = require("../file-system/RealFileSystem");
|
|
20
21
|
function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
21
22
|
let artifacts = {
|
|
22
23
|
files: [],
|
|
@@ -95,18 +96,9 @@ function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
|
95
96
|
artifacts.extensions.some((extension) => path.endsWith(extension)));
|
|
96
97
|
}
|
|
97
98
|
function getReadFileSystem(path) {
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const stats = passiveFileSystem.readStats(path);
|
|
102
|
-
if (stats === null || stats === void 0 ? void 0 : stats.isFile()) {
|
|
103
|
-
const content = passiveFileSystem.readFile(path);
|
|
104
|
-
if (content) {
|
|
105
|
-
memFileSystem.writeFile(path, content);
|
|
106
|
-
memFileSystem.updateTimes(path, stats.atime, stats.mtime);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
99
|
+
if (!isInitialRun &&
|
|
100
|
+
(mode === 'readonly' || mode === 'write-tsbuildinfo') &&
|
|
101
|
+
isArtifact(path)) {
|
|
110
102
|
return memFileSystem;
|
|
111
103
|
}
|
|
112
104
|
return passiveFileSystem;
|
|
@@ -118,10 +110,7 @@ function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
|
118
110
|
}
|
|
119
111
|
return passiveFileSystem;
|
|
120
112
|
}
|
|
121
|
-
const controlledSystem = Object.assign(Object.assign({}, typescript.sys), { useCaseSensitiveFileNames: caseSensitive,
|
|
122
|
-
return getReadFileSystem(path).realPath(path);
|
|
123
|
-
},
|
|
124
|
-
fileExists(path) {
|
|
113
|
+
const controlledSystem = Object.assign(Object.assign({}, typescript.sys), { useCaseSensitiveFileNames: caseSensitive, fileExists(path) {
|
|
125
114
|
const stats = getReadFileSystem(path).readStats(path);
|
|
126
115
|
return !!stats && stats.isFile();
|
|
127
116
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
import { TypeScriptHostExtension } from '../extension/TypeScriptExtension';
|
|
3
|
-
import { ControlledTypeScriptSystem } from './ControlledTypeScriptSystem';
|
|
2
|
+
import type { TypeScriptHostExtension } from '../extension/TypeScriptExtension';
|
|
3
|
+
import type { ControlledTypeScriptSystem } from './ControlledTypeScriptSystem';
|
|
4
4
|
declare function createControlledWatchCompilerHost<TProgram extends ts.BuilderProgram>(typescript: typeof ts, parsedCommandLine: ts.ParsedCommandLine, system: ControlledTypeScriptSystem, createProgram?: ts.CreateProgram<TProgram>, reportDiagnostic?: ts.DiagnosticReporter, reportWatchStatus?: ts.WatchStatusReporter, afterProgramCreate?: (program: TProgram) => void, hostExtensions?: TypeScriptHostExtension[]): ts.WatchCompilerHostOfFilesAndCompilerOptions<TProgram>;
|
|
5
5
|
export { createControlledWatchCompilerHost };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createControlledWatchCompilerHost = void 0;
|
|
3
4
|
function createControlledWatchCompilerHost(typescript, parsedCommandLine, system, createProgram, reportDiagnostic, reportWatchStatus, afterProgramCreate, hostExtensions = []) {
|
|
4
5
|
const baseWatchCompilerHost = typescript.createWatchCompilerHost(parsedCommandLine.fileNames, parsedCommandLine.options, system, createProgram, reportDiagnostic, reportWatchStatus, parsedCommandLine.projectReferences);
|
|
5
6
|
let controlledWatchCompilerHost = Object.assign(Object.assign({}, baseWatchCompilerHost), { createProgram(rootNames, options, compilerHost, oldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
import { TypeScriptHostExtension } from '../extension/TypeScriptExtension';
|
|
3
|
-
import { ControlledTypeScriptSystem } from './ControlledTypeScriptSystem';
|
|
2
|
+
import type { TypeScriptHostExtension } from '../extension/TypeScriptExtension';
|
|
3
|
+
import type { ControlledTypeScriptSystem } from './ControlledTypeScriptSystem';
|
|
4
4
|
declare function createControlledWatchSolutionBuilderHost<TProgram extends ts.BuilderProgram>(typescript: typeof ts, parsedCommandLine: ts.ParsedCommandLine, system: ControlledTypeScriptSystem, createProgram?: ts.CreateProgram<TProgram>, reportDiagnostic?: ts.DiagnosticReporter, reportWatchStatus?: ts.WatchStatusReporter, reportSolutionBuilderStatus?: (diagnostic: ts.Diagnostic) => void, afterProgramCreate?: (program: TProgram) => void, afterProgramEmitAndDiagnostics?: (program: TProgram) => void, hostExtensions?: TypeScriptHostExtension[]): ts.SolutionBuilderWithWatchHost<TProgram>;
|
|
5
5
|
export { createControlledWatchSolutionBuilderHost };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createControlledWatchSolutionBuilderHost = void 0;
|
|
3
4
|
const ControlledWatchCompilerHost_1 = require("./ControlledWatchCompilerHost");
|
|
4
5
|
function createControlledWatchSolutionBuilderHost(typescript, parsedCommandLine, system, createProgram, reportDiagnostic, reportWatchStatus, reportSolutionBuilderStatus, afterProgramCreate, afterProgramEmitAndDiagnostics, hostExtensions = []) {
|
|
5
6
|
const controlledWatchCompilerHost = ControlledWatchCompilerHost_1.createControlledWatchCompilerHost(typescript, parsedCommandLine, system, createProgram, reportDiagnostic, reportWatchStatus, afterProgramCreate, hostExtensions);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { FilesMatch } from '../../reporter';
|
|
3
|
+
import type { TypeScriptConfigurationOverwrite } from '../TypeScriptConfigurationOverwrite';
|
|
4
4
|
declare function parseTypeScriptConfiguration(typescript: typeof ts, configFileName: string, configFileContext: string, configOverwriteJSON: TypeScriptConfigurationOverwrite, parseConfigFileHost: ts.ParseConfigFileHost): ts.ParsedCommandLine;
|
|
5
5
|
declare function getDependenciesFromTypeScriptConfiguration(typescript: typeof ts, parsedConfiguration: ts.ParsedCommandLine, configFileContext: string, parseConfigFileHost: ts.ParseConfigFileHost, processedConfigFiles?: string[]): FilesMatch;
|
|
6
6
|
export declare function isIncrementalCompilation(options: ts.CompilerOptions): boolean;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getArtifactsFromTypeScriptConfiguration = exports.getDependenciesFromTypeScriptConfiguration = exports.parseTypeScriptConfiguration = exports.isIncrementalCompilation = void 0;
|
|
3
7
|
const path_1 = require("path");
|
|
8
|
+
const forwardSlash_1 = __importDefault(require("../../utils/path/forwardSlash"));
|
|
4
9
|
function parseTypeScriptConfiguration(typescript, configFileName, configFileContext, configOverwriteJSON, parseConfigFileHost) {
|
|
5
|
-
const
|
|
10
|
+
const configFilePath = forwardSlash_1.default(configFileName);
|
|
11
|
+
const parsedConfigFileJSON = typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
6
12
|
const overwrittenConfigFileJSON = Object.assign(Object.assign(Object.assign({}, (parsedConfigFileJSON.config || {})), configOverwriteJSON), { compilerOptions: Object.assign(Object.assign({}, ((parsedConfigFileJSON.config || {}).compilerOptions || {})), (configOverwriteJSON.compilerOptions || {})) });
|
|
7
13
|
const parsedConfigFile = typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, configFileContext);
|
|
8
|
-
return Object.assign(Object.assign({}, parsedConfigFile), { options: Object.assign(Object.assign({}, parsedConfigFile.options), { configFilePath:
|
|
14
|
+
return Object.assign(Object.assign({}, parsedConfigFile), { options: Object.assign(Object.assign({}, parsedConfigFile.options), { configFilePath: configFilePath }), errors: parsedConfigFileJSON.error ? [parsedConfigFileJSON.error] : parsedConfigFile.errors });
|
|
9
15
|
}
|
|
10
16
|
exports.parseTypeScriptConfiguration = parseTypeScriptConfiguration;
|
|
11
17
|
function getDependenciesFromTypeScriptConfiguration(typescript, parsedConfiguration, configFileContext, parseConfigFileHost, processedConfigFiles = []) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Reporter } from '../../reporter';
|
|
2
|
-
import { TypeScriptReporterConfiguration } from '../TypeScriptReporterConfiguration';
|
|
1
|
+
import type { Reporter } from '../../reporter';
|
|
2
|
+
import type { TypeScriptReporterConfiguration } from '../TypeScriptReporterConfiguration';
|
|
3
3
|
declare function createTypeScriptReporter(configuration: TypeScriptReporterConfiguration): Reporter;
|
|
4
4
|
export { createTypeScriptReporter };
|
|
@@ -12,23 +12,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createTypeScriptReporter = void 0;
|
|
15
16
|
const path_1 = __importDefault(require("path"));
|
|
17
|
+
const Performance_1 = require("../../profile/Performance");
|
|
18
|
+
const TypeScriptVueExtension_1 = require("../extension/vue/TypeScriptVueExtension");
|
|
16
19
|
const TypeScriptIssueFactory_1 = require("../issue/TypeScriptIssueFactory");
|
|
20
|
+
const TypeScriptPerformance_1 = require("../profile/TypeScriptPerformance");
|
|
21
|
+
const ControlledCompilerHost_1 = require("./ControlledCompilerHost");
|
|
22
|
+
const ControlledTypeScriptSystem_1 = require("./ControlledTypeScriptSystem");
|
|
17
23
|
const ControlledWatchCompilerHost_1 = require("./ControlledWatchCompilerHost");
|
|
18
|
-
const TypeScriptVueExtension_1 = require("../extension/vue/TypeScriptVueExtension");
|
|
19
24
|
const ControlledWatchSolutionBuilderHost_1 = require("./ControlledWatchSolutionBuilderHost");
|
|
20
|
-
const ControlledTypeScriptSystem_1 = require("./ControlledTypeScriptSystem");
|
|
21
25
|
const TypeScriptConfigurationParser_1 = require("./TypeScriptConfigurationParser");
|
|
22
|
-
const Performance_1 = require("../../profile/Performance");
|
|
23
|
-
const TypeScriptPerformance_1 = require("../profile/TypeScriptPerformance");
|
|
24
26
|
function createTypeScriptReporter(configuration) {
|
|
25
27
|
let parsedConfiguration;
|
|
26
28
|
let parseConfigurationDiagnostics = [];
|
|
27
29
|
let dependencies;
|
|
28
30
|
let artifacts;
|
|
29
31
|
let configurationChanged = false;
|
|
32
|
+
let compilerHost;
|
|
30
33
|
let watchCompilerHost;
|
|
31
34
|
let watchSolutionBuilderHost;
|
|
35
|
+
let program;
|
|
32
36
|
let watchProgram;
|
|
33
37
|
let solutionBuilder;
|
|
34
38
|
let shouldUpdateRootFiles = false;
|
|
@@ -51,26 +55,26 @@ function createTypeScriptReporter(configuration) {
|
|
|
51
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
56
|
return typescript.tracing;
|
|
53
57
|
}
|
|
54
|
-
function
|
|
58
|
+
function getDiagnosticsOfProgram(program) {
|
|
55
59
|
const diagnostics = [];
|
|
56
60
|
if (configuration.diagnosticOptions.syntactic) {
|
|
57
61
|
performance.markStart('Syntactic Diagnostics');
|
|
58
|
-
diagnostics.push(...
|
|
62
|
+
diagnostics.push(...program.getSyntacticDiagnostics());
|
|
59
63
|
performance.markEnd('Syntactic Diagnostics');
|
|
60
64
|
}
|
|
61
65
|
if (configuration.diagnosticOptions.global) {
|
|
62
66
|
performance.markStart('Global Diagnostics');
|
|
63
|
-
diagnostics.push(...
|
|
67
|
+
diagnostics.push(...program.getGlobalDiagnostics());
|
|
64
68
|
performance.markEnd('Global Diagnostics');
|
|
65
69
|
}
|
|
66
70
|
if (configuration.diagnosticOptions.semantic) {
|
|
67
71
|
performance.markStart('Semantic Diagnostics');
|
|
68
|
-
diagnostics.push(...
|
|
72
|
+
diagnostics.push(...program.getSemanticDiagnostics());
|
|
69
73
|
performance.markEnd('Semantic Diagnostics');
|
|
70
74
|
}
|
|
71
75
|
if (configuration.diagnosticOptions.declaration) {
|
|
72
76
|
performance.markStart('Declaration Diagnostics');
|
|
73
|
-
diagnostics.push(...
|
|
77
|
+
diagnostics.push(...program.getDeclarationDiagnostics());
|
|
74
78
|
performance.markEnd('Declaration Diagnostics');
|
|
75
79
|
}
|
|
76
80
|
return diagnostics;
|
|
@@ -167,7 +171,7 @@ function createTypeScriptReporter(configuration) {
|
|
|
167
171
|
}
|
|
168
172
|
}
|
|
169
173
|
return {
|
|
170
|
-
getReport: ({ changedFiles = [], deletedFiles = [] }) => __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
getReport: ({ changedFiles = [], deletedFiles = [] }, watching) => __awaiter(this, void 0, void 0, function* () {
|
|
171
175
|
// clear cache to be ready for next iteration and to free memory
|
|
172
176
|
system.clearCache();
|
|
173
177
|
if ([...changedFiles, ...deletedFiles]
|
|
@@ -177,20 +181,23 @@ function createTypeScriptReporter(configuration) {
|
|
|
177
181
|
parsedConfiguration = undefined;
|
|
178
182
|
dependencies = undefined;
|
|
179
183
|
artifacts = undefined;
|
|
184
|
+
compilerHost = undefined;
|
|
180
185
|
watchCompilerHost = undefined;
|
|
181
186
|
watchSolutionBuilderHost = undefined;
|
|
187
|
+
program = undefined;
|
|
182
188
|
watchProgram = undefined;
|
|
183
189
|
solutionBuilder = undefined;
|
|
184
190
|
diagnosticsPerProject.clear();
|
|
185
191
|
configurationChanged = true;
|
|
186
192
|
}
|
|
187
193
|
else {
|
|
188
|
-
const
|
|
194
|
+
const previousParsedConfiguration = parsedConfiguration;
|
|
189
195
|
[parsedConfiguration, parseConfigurationDiagnostics] = parseConfiguration();
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
//
|
|
196
|
+
if (previousParsedConfiguration &&
|
|
197
|
+
JSON.stringify(previousParsedConfiguration.fileNames) !==
|
|
198
|
+
JSON.stringify(parsedConfiguration.fileNames)) {
|
|
199
|
+
// root files changed - we need to recompute dependencies and artifacts
|
|
200
|
+
dependencies = getDependencies();
|
|
194
201
|
artifacts = getArtifacts();
|
|
195
202
|
shouldUpdateRootFiles = true;
|
|
196
203
|
}
|
|
@@ -254,7 +261,7 @@ function createTypeScriptReporter(configuration) {
|
|
|
254
261
|
return typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
255
262
|
}, undefined, undefined, undefined, undefined, (builderProgram) => {
|
|
256
263
|
const projectName = getProjectNameOfBuilderProgram(builderProgram);
|
|
257
|
-
const diagnostics =
|
|
264
|
+
const diagnostics = getDiagnosticsOfProgram(builderProgram);
|
|
258
265
|
// update diagnostics
|
|
259
266
|
diagnosticsPerProject.set(projectName, diagnostics);
|
|
260
267
|
// emit .tsbuildinfo file if needed
|
|
@@ -276,7 +283,7 @@ function createTypeScriptReporter(configuration) {
|
|
|
276
283
|
performance.markEnd('Build Solutions');
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
|
-
else {
|
|
286
|
+
else if (watching) {
|
|
280
287
|
// watch compiler case
|
|
281
288
|
// ensure watch compiler host exists
|
|
282
289
|
if (!watchCompilerHost) {
|
|
@@ -288,7 +295,7 @@ function createTypeScriptReporter(configuration) {
|
|
|
288
295
|
return typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
289
296
|
}, undefined, undefined, (builderProgram) => {
|
|
290
297
|
const projectName = getProjectNameOfBuilderProgram(builderProgram);
|
|
291
|
-
const diagnostics =
|
|
298
|
+
const diagnostics = getDiagnosticsOfProgram(builderProgram);
|
|
292
299
|
// update diagnostics
|
|
293
300
|
diagnosticsPerProject.set(projectName, diagnostics);
|
|
294
301
|
// emit .tsbuildinfo file if needed
|
|
@@ -310,6 +317,23 @@ function createTypeScriptReporter(configuration) {
|
|
|
310
317
|
shouldUpdateRootFiles = false;
|
|
311
318
|
}
|
|
312
319
|
}
|
|
320
|
+
else {
|
|
321
|
+
if (!compilerHost) {
|
|
322
|
+
compilerHost = ControlledCompilerHost_1.createControlledCompilerHost(typescript, parsedConfiguration, system, extensions);
|
|
323
|
+
}
|
|
324
|
+
if (!program) {
|
|
325
|
+
program = typescript.createProgram({
|
|
326
|
+
rootNames: parsedConfiguration.fileNames,
|
|
327
|
+
options: parsedConfiguration.options,
|
|
328
|
+
projectReferences: parsedConfiguration.projectReferences,
|
|
329
|
+
host: compilerHost,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
const diagnostics = getDiagnosticsOfProgram(program);
|
|
333
|
+
const projectName = getConfigFilePathFromCompilerOptions(program.getCompilerOptions());
|
|
334
|
+
// update diagnostics
|
|
335
|
+
diagnosticsPerProject.set(projectName, diagnostics);
|
|
336
|
+
}
|
|
313
337
|
changedFiles.forEach((changedFile) => {
|
|
314
338
|
if (system) {
|
|
315
339
|
system.invokeFileChanged(changedFile);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ReporterRpcClient } from '../../reporter';
|
|
2
|
+
import type { TypeScriptReporterConfiguration } from '../TypeScriptReporterConfiguration';
|
|
3
3
|
declare function createTypeScriptReporterRpcClient(configuration: TypeScriptReporterConfiguration): ReporterRpcClient;
|
|
4
4
|
export { createTypeScriptReporterRpcClient };
|
|
@@ -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.createTypeScriptReporterRpcClient = void 0;
|
|
6
7
|
const path_1 = __importDefault(require("path"));
|
|
7
8
|
const reporter_1 = require("../../reporter");
|
|
8
9
|
const rpc_ipc_1 = require("../../rpc/rpc-ipc");
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const process_1 = __importDefault(require("process"));
|
|
7
|
-
const TypeScriptReporter_1 = require("./TypeScriptReporter");
|
|
8
|
-
const rpc_ipc_1 = require("../../rpc/rpc-ipc");
|
|
9
7
|
const reporter_1 = require("../../reporter");
|
|
8
|
+
const rpc_ipc_1 = require("../../rpc/rpc-ipc");
|
|
9
|
+
const TypeScriptReporter_1 = require("./TypeScriptReporter");
|
|
10
10
|
const service = reporter_1.registerReporterRpcService(rpc_ipc_1.createRpcIpcMessagePort(process_1.default), TypeScriptReporter_1.createTypeScriptReporter);
|
|
11
11
|
service.open();
|
package/lib/utils/async/pool.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createPool = void 0;
|
|
12
13
|
function createPool(size) {
|
|
13
14
|
let pendingPromises = [];
|
|
14
15
|
const pool = {
|
|
@@ -39,6 +40,15 @@ function createPool(size) {
|
|
|
39
40
|
get pending() {
|
|
40
41
|
return pendingPromises.length;
|
|
41
42
|
},
|
|
43
|
+
get drained() {
|
|
44
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
45
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
while (pendingPromises.length > 0) {
|
|
47
|
+
yield Promise.race(pendingPromises).catch(() => undefined);
|
|
48
|
+
}
|
|
49
|
+
resolve(undefined);
|
|
50
|
+
}));
|
|
51
|
+
},
|
|
42
52
|
};
|
|
43
53
|
return pool;
|
|
44
54
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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.relativeToContext = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const forwardSlash_1 = __importDefault(require("./forwardSlash"));
|
|
9
|
+
function relativeToContext(file, context) {
|
|
10
|
+
let fileInContext = forwardSlash_1.default(path_1.default.relative(context, file));
|
|
11
|
+
if (!fileInContext.startsWith('../')) {
|
|
12
|
+
fileInContext = './' + fileInContext;
|
|
13
|
+
}
|
|
14
|
+
return fileInContext;
|
|
15
|
+
}
|
|
16
|
+
exports.relativeToContext = relativeToContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { FSWatcher } from 'chokidar';
|
|
2
|
+
import type { Compiler } from 'webpack';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
+
import type { WatchFileSystem } from './WatchFileSystem';
|
|
5
5
|
declare class InclusiveNodeWatchFileSystem implements WatchFileSystem {
|
|
6
6
|
private watchFileSystem;
|
|
7
7
|
private compiler;
|
|
@@ -10,6 +10,6 @@ declare class InclusiveNodeWatchFileSystem implements WatchFileSystem {
|
|
|
10
10
|
readonly dirsWatchers: Map<string, FSWatcher | undefined>;
|
|
11
11
|
constructor(watchFileSystem: WatchFileSystem, compiler: Compiler, pluginState: ForkTsCheckerWebpackPluginState);
|
|
12
12
|
private paused;
|
|
13
|
-
watch
|
|
13
|
+
watch: WatchFileSystem['watch'];
|
|
14
14
|
}
|
|
15
15
|
export { InclusiveNodeWatchFileSystem };
|