fork-ts-checker-webpack-plugin 7.0.0-alpha.1 → 7.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -83
- package/lib/ForkTsCheckerWebpackPlugin.d.ts +15 -11
- package/lib/ForkTsCheckerWebpackPlugin.js +30 -38
- 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 +8 -7
- package/lib/ForkTsCheckerWebpackPluginState.js +3 -1
- 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/formatter/types/babel__code-frame.js +1 -1
- 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 +6 -5
- package/lib/hooks/tapErrorToLogMessage.d.ts +2 -2
- package/lib/hooks/tapErrorToLogMessage.js +4 -3
- package/lib/hooks/tapStartToConnectAndRunReporter.d.ts +5 -5
- package/lib/hooks/tapStartToConnectAndRunReporter.js +47 -22
- package/lib/hooks/tapStopToDisconnectReporter.d.ts +4 -4
- package/lib/hooks/tapStopToDisconnectReporter.js +7 -4
- 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 +2 -1
- package/lib/reporter/FilesChange.d.ts +1 -1
- package/lib/reporter/FilesChange.js +2 -1
- package/lib/reporter/FilesMatch.d.ts +7 -0
- package/lib/{eslint-reporter/EsLintReporterOptions.js → reporter/FilesMatch.js} +0 -0
- package/lib/reporter/Report.d.ts +3 -3
- package/lib/reporter/Reporter.d.ts +2 -2
- package/lib/reporter/index.d.ts +1 -1
- package/lib/reporter/index.js +17 -7
- package/lib/reporter/reporter-rpc/ReporterRpcClient.d.ts +2 -2
- package/lib/reporter/reporter-rpc/ReporterRpcClient.js +17 -4
- package/lib/reporter/reporter-rpc/ReporterRpcProcedure.d.ts +5 -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 +3 -0
- 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 +4 -4
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.d.ts +2 -2
- package/lib/typescript-reporter/extension/vue/TypeScriptVueExtension.js +2 -1
- 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/file-system/FileSystem.d.ts +1 -1
- package/lib/typescript-reporter/file-system/MemFileSystem.d.ts +8 -0
- package/lib/typescript-reporter/file-system/MemFileSystem.js +83 -0
- package/lib/typescript-reporter/file-system/PassiveFileSystem.d.ts +3 -3
- package/lib/typescript-reporter/file-system/PassiveFileSystem.js +11 -72
- 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 +2 -2
- package/lib/typescript-reporter/issue/TypeScriptIssueFactory.js +17 -5
- package/lib/typescript-reporter/profile/TypeScriptPerformance.d.ts +2 -2
- package/lib/typescript-reporter/profile/TypeScriptPerformance.js +1 -0
- package/lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts +3 -3
- package/lib/typescript-reporter/reporter/ControlledCompilerHost.js +1 -0
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts +3 -1
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +50 -15
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.d.ts +3 -3
- package/lib/typescript-reporter/reporter/ControlledWatchCompilerHost.js +1 -0
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.d.ts +3 -3
- package/lib/typescript-reporter/reporter/ControlledWatchSolutionBuilderHost.js +2 -9
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.d.ts +7 -5
- package/lib/typescript-reporter/reporter/TypeScriptConfigurationParser.js +114 -19
- package/lib/typescript-reporter/reporter/TypeScriptReporter.d.ts +2 -2
- package/lib/typescript-reporter/reporter/TypeScriptReporter.js +24 -16
- 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 +111 -90
- package/lib/watch/WatchFileSystem.d.ts +5 -22
- package/package.json +52 -54
- 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/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 -85
- 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 -17
- package/lib/reporter/Dependencies.d.ts +0 -6
- package/lib/reporter/Dependencies.js +0 -2
- package/lib/watch/CompilerWithWatchFileSystem.d.ts +0 -6
- package/lib/watch/CompilerWithWatchFileSystem.js +0 -2
package/lib/rpc/RpcMessage.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRpcMessageKey = exports.isRpcThrowMessage = exports.isRpcReturnMessage = exports.isRpcCallMessage = exports.isRpcMessage = exports.createRpcThrow = exports.createRpcReturn = exports.createRpcCall = exports.createRpcMessage = void 0;
|
|
3
4
|
function createRpcMessage(procedure, id, type, payload, source) {
|
|
4
5
|
return {
|
|
5
6
|
rpc: true,
|
|
@@ -19,6 +20,8 @@ function createRpcReturn(procedure, index, payload) {
|
|
|
19
20
|
return createRpcMessage(procedure, index, 'return', payload);
|
|
20
21
|
}
|
|
21
22
|
exports.createRpcReturn = createRpcReturn;
|
|
23
|
+
// suppressing as it will be removed anyway
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
25
|
function createRpcThrow(procedure, index, payload) {
|
|
23
26
|
return createRpcMessage(procedure, index, 'throw', payload);
|
|
24
27
|
}
|
|
@@ -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.createRpcMessageChannel = void 0;
|
|
12
13
|
function createRpcMessageChannel(servicePort, clientPort, linkPorts, unlinkPorts) {
|
|
13
14
|
// if there is not link and unlink function provided, we assume that channel is automatically linked
|
|
14
15
|
let arePortsLinked = !linkPorts && !unlinkPorts;
|
package/lib/rpc/RpcService.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { RpcMessagePort } from './RpcMessagePort';
|
|
2
|
+
import type { RpcProcedure } from './RpcProcedure';
|
|
3
3
|
declare type RpcCallHandler<TPayload = any, TResult = any> = (payload: TPayload) => Promise<TResult>;
|
|
4
4
|
interface RpcService {
|
|
5
5
|
readonly isOpen: () => boolean;
|
package/lib/rpc/RpcService.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.createRpcService = void 0;
|
|
12
13
|
const RpcMessage_1 = require("./RpcMessage");
|
|
13
14
|
function createRpcService(port) {
|
|
14
15
|
const handlers = new Map();
|
package/lib/rpc/index.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
5
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
__exportStar(require("./RpcMessage"), exports);
|
|
14
|
+
__exportStar(require("./RpcProcedure"), exports);
|
|
15
|
+
__exportStar(require("./RpcClient"), exports);
|
|
16
|
+
__exportStar(require("./RpcHost"), exports);
|
|
17
|
+
__exportStar(require("./RpcService"), exports);
|
|
18
|
+
__exportStar(require("./RpcMessagePort"), exports);
|
|
19
|
+
__exportStar(require("./RpcMessageChannel"), exports);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRpcIpcMessageChannel = void 0;
|
|
3
4
|
const index_1 = require("../index");
|
|
4
5
|
const RpcIpcMessagePort_1 = require("./RpcIpcMessagePort");
|
|
5
6
|
function createRpcIpcMessageChannel(servicePath, memoryLimit = 2048) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { RpcMessagePort } from '../index';
|
|
2
|
+
import type { ProcessLike } from './ProcessLike';
|
|
3
3
|
declare function createRpcIpcMessagePort(process: ProcessLike): RpcMessagePort;
|
|
4
4
|
declare function createRpcIpcForkedProcessMessagePort(filePath: string, memoryLimit?: number, autoRecreate?: boolean): RpcMessagePort;
|
|
5
5
|
export { createRpcIpcMessagePort, createRpcIpcForkedProcessMessagePort };
|
|
@@ -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.createRpcIpcForkedProcessMessagePort = exports.createRpcIpcMessagePort = void 0;
|
|
12
13
|
const child_process_1 = require("child_process");
|
|
13
14
|
const RpcIpcMessagePortClosedError_1 = require("./error/RpcIpcMessagePortClosedError");
|
|
14
15
|
function createRpcIpcMessagePort(process) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcIpcMessagePortClosedError = void 0;
|
|
3
4
|
const RpcMessagePortClosedError_1 = require("../../error/RpcMessagePortClosedError");
|
|
4
5
|
class RpcIpcMessagePortClosedError extends RpcMessagePortClosedError_1.RpcMessagePortClosedError {
|
|
5
6
|
constructor(message, code, signal) {
|
package/lib/rpc/rpc-ipc/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
5
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
__exportStar(require("./RpcIpcMessagePort"), exports);
|
|
14
|
+
__exportStar(require("./RpcIpcMessageChannel"), exports);
|
|
@@ -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;
|
|
@@ -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
|
-
import * as ts from 'typescript';
|
|
2
|
-
import { Issue } from '../../issue';
|
|
3
|
-
import {
|
|
1
|
+
import type * as ts from 'typescript';
|
|
2
|
+
import type { Issue } from '../../issue';
|
|
3
|
+
import type { FilesMatch } from '../../reporter';
|
|
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;
|
|
@@ -9,7 +9,7 @@ interface TypeScriptHostExtension {
|
|
|
9
9
|
}
|
|
10
10
|
interface TypeScriptReporterExtension {
|
|
11
11
|
extendIssues?(issues: Issue[]): Issue[];
|
|
12
|
-
extendDependencies?(dependencies:
|
|
12
|
+
extendDependencies?(dependencies: FilesMatch): FilesMatch;
|
|
13
13
|
}
|
|
14
14
|
interface TypeScriptExtension extends TypeScriptHostExtension, TypeScriptReporterExtension {
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypeScriptExtension } from '../TypeScriptExtension';
|
|
2
|
-
import { TypeScriptVueExtensionConfiguration } from './TypeScriptVueExtensionConfiguration';
|
|
1
|
+
import type { TypeScriptExtension } from '../TypeScriptExtension';
|
|
2
|
+
import type { TypeScriptVueExtensionConfiguration } from './TypeScriptVueExtensionConfiguration';
|
|
3
3
|
declare function createTypeScriptVueExtension(configuration: TypeScriptVueExtensionConfiguration): TypeScriptExtension;
|
|
4
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);
|
|
@@ -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
|
}
|
|
@@ -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 };
|
|
@@ -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.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FileSystem } from './FileSystem';
|
|
2
|
+
/**
|
|
3
|
+
* It's an implementation of FileSystem interface which reads and writes to the in-memory file system.
|
|
4
|
+
*
|
|
5
|
+
* @param realFileSystem
|
|
6
|
+
*/
|
|
7
|
+
declare function createMemFileSystem(realFileSystem: FileSystem): FileSystem;
|
|
8
|
+
export { createMemFileSystem };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMemFileSystem = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const memfs_1 = require("memfs");
|
|
6
|
+
// eslint-disable-next-line node/no-unsupported-features/node-builtins
|
|
7
|
+
/**
|
|
8
|
+
* It's an implementation of FileSystem interface which reads and writes to the in-memory file system.
|
|
9
|
+
*
|
|
10
|
+
* @param realFileSystem
|
|
11
|
+
*/
|
|
12
|
+
function createMemFileSystem(realFileSystem) {
|
|
13
|
+
function exists(path) {
|
|
14
|
+
return memfs_1.fs.existsSync(realFileSystem.normalizePath(path));
|
|
15
|
+
}
|
|
16
|
+
function readStats(path) {
|
|
17
|
+
return exists(path) ? memfs_1.fs.statSync(realFileSystem.normalizePath(path)) : undefined;
|
|
18
|
+
}
|
|
19
|
+
function readFile(path, encoding) {
|
|
20
|
+
const stats = readStats(path);
|
|
21
|
+
if (stats && stats.isFile()) {
|
|
22
|
+
return memfs_1.fs
|
|
23
|
+
.readFileSync(realFileSystem.normalizePath(path), { encoding: encoding })
|
|
24
|
+
.toString();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function readDir(path) {
|
|
28
|
+
const stats = readStats(path);
|
|
29
|
+
if (stats && stats.isDirectory()) {
|
|
30
|
+
return memfs_1.fs.readdirSync(realFileSystem.normalizePath(path), {
|
|
31
|
+
withFileTypes: true,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
function createDir(path) {
|
|
37
|
+
memfs_1.fs.mkdirSync(realFileSystem.normalizePath(path), { recursive: true });
|
|
38
|
+
}
|
|
39
|
+
function writeFile(path, data) {
|
|
40
|
+
if (!exists(path_1.dirname(path))) {
|
|
41
|
+
createDir(path_1.dirname(path));
|
|
42
|
+
}
|
|
43
|
+
memfs_1.fs.writeFileSync(realFileSystem.normalizePath(path), data);
|
|
44
|
+
}
|
|
45
|
+
function deleteFile(path) {
|
|
46
|
+
if (exists(path)) {
|
|
47
|
+
memfs_1.fs.unlinkSync(realFileSystem.normalizePath(path));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function updateTimes(path, atime, mtime) {
|
|
51
|
+
if (exists(path)) {
|
|
52
|
+
memfs_1.fs.utimesSync(realFileSystem.normalizePath(path), atime, mtime);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return Object.assign(Object.assign({}, realFileSystem), { exists(path) {
|
|
56
|
+
return exists(realFileSystem.realPath(path));
|
|
57
|
+
},
|
|
58
|
+
readFile(path, encoding) {
|
|
59
|
+
return readFile(realFileSystem.realPath(path), encoding);
|
|
60
|
+
},
|
|
61
|
+
readDir(path) {
|
|
62
|
+
return readDir(realFileSystem.realPath(path));
|
|
63
|
+
},
|
|
64
|
+
readStats(path) {
|
|
65
|
+
return readStats(realFileSystem.realPath(path));
|
|
66
|
+
},
|
|
67
|
+
writeFile(path, data) {
|
|
68
|
+
writeFile(realFileSystem.realPath(path), data);
|
|
69
|
+
},
|
|
70
|
+
deleteFile(path) {
|
|
71
|
+
deleteFile(realFileSystem.realPath(path));
|
|
72
|
+
},
|
|
73
|
+
createDir(path) {
|
|
74
|
+
createDir(realFileSystem.realPath(path));
|
|
75
|
+
},
|
|
76
|
+
updateTimes(path, atime, mtime) {
|
|
77
|
+
updateTimes(realFileSystem.realPath(path), atime, mtime);
|
|
78
|
+
},
|
|
79
|
+
clearCache() {
|
|
80
|
+
realFileSystem.clearCache();
|
|
81
|
+
} });
|
|
82
|
+
}
|
|
83
|
+
exports.createMemFileSystem = createMemFileSystem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FileSystem } from './FileSystem';
|
|
1
|
+
import type { FileSystem } from './FileSystem';
|
|
2
2
|
/**
|
|
3
3
|
* It's an implementation of FileSystem interface which reads from the real file system, but write to the in-memory file system.
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param memFileSystem
|
|
6
6
|
* @param realFileSystem
|
|
7
7
|
*/
|
|
8
|
-
declare function createPassiveFileSystem(
|
|
8
|
+
declare function createPassiveFileSystem(memFileSystem: FileSystem, realFileSystem: FileSystem): FileSystem;
|
|
9
9
|
export { createPassiveFileSystem };
|
|
@@ -1,59 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const memfs_1 = require("memfs");
|
|
3
|
+
exports.createPassiveFileSystem = void 0;
|
|
5
4
|
/**
|
|
6
5
|
* It's an implementation of FileSystem interface which reads from the real file system, but write to the in-memory file system.
|
|
7
6
|
*
|
|
8
|
-
* @param
|
|
7
|
+
* @param memFileSystem
|
|
9
8
|
* @param realFileSystem
|
|
10
9
|
*/
|
|
11
|
-
function createPassiveFileSystem(
|
|
12
|
-
function normalizePath(path) {
|
|
13
|
-
return caseSensitive ? path_1.normalize(path) : path_1.normalize(path).toLowerCase();
|
|
14
|
-
}
|
|
15
|
-
function memExists(path) {
|
|
16
|
-
return memfs_1.fs.existsSync(normalizePath(path));
|
|
17
|
-
}
|
|
18
|
-
function memReadStats(path) {
|
|
19
|
-
return memExists(path) ? memfs_1.fs.statSync(normalizePath(path)) : undefined;
|
|
20
|
-
}
|
|
21
|
-
function memReadFile(path, encoding) {
|
|
22
|
-
const stats = memReadStats(path);
|
|
23
|
-
if (stats && stats.isFile()) {
|
|
24
|
-
return memfs_1.fs
|
|
25
|
-
.readFileSync(normalizePath(path), { encoding: encoding })
|
|
26
|
-
.toString();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function memReadDir(path) {
|
|
30
|
-
const stats = memReadStats(path);
|
|
31
|
-
if (stats && stats.isDirectory()) {
|
|
32
|
-
return memfs_1.fs.readdirSync(normalizePath(path), { withFileTypes: true });
|
|
33
|
-
}
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
10
|
+
function createPassiveFileSystem(memFileSystem, realFileSystem) {
|
|
36
11
|
function exists(path) {
|
|
37
|
-
return realFileSystem.exists(path) ||
|
|
12
|
+
return realFileSystem.exists(path) || memFileSystem.exists(path);
|
|
38
13
|
}
|
|
39
14
|
function readFile(path, encoding) {
|
|
40
15
|
const fsStats = realFileSystem.readStats(path);
|
|
41
|
-
const memStats =
|
|
16
|
+
const memStats = memFileSystem.readStats(path);
|
|
42
17
|
if (fsStats && memStats) {
|
|
43
18
|
return fsStats.mtimeMs > memStats.mtimeMs
|
|
44
19
|
? realFileSystem.readFile(path, encoding)
|
|
45
|
-
:
|
|
20
|
+
: memFileSystem.readFile(path, encoding);
|
|
46
21
|
}
|
|
47
22
|
else if (fsStats) {
|
|
48
23
|
return realFileSystem.readFile(path, encoding);
|
|
49
24
|
}
|
|
50
25
|
else if (memStats) {
|
|
51
|
-
return
|
|
26
|
+
return memFileSystem.readFile(path, encoding);
|
|
52
27
|
}
|
|
53
28
|
}
|
|
54
29
|
function readDir(path) {
|
|
55
30
|
const fsDirents = realFileSystem.readDir(path);
|
|
56
|
-
const memDirents =
|
|
31
|
+
const memDirents = memFileSystem.readDir(path);
|
|
57
32
|
// merge list of dirents from fs and mem
|
|
58
33
|
return fsDirents
|
|
59
34
|
.filter((fsDirent) => !memDirents.some((memDirent) => memDirent.name === fsDirent.name))
|
|
@@ -61,7 +36,7 @@ function createPassiveFileSystem(caseSensitive = false, realFileSystem) {
|
|
|
61
36
|
}
|
|
62
37
|
function readStats(path) {
|
|
63
38
|
const fsStats = realFileSystem.readStats(path);
|
|
64
|
-
const memStats =
|
|
39
|
+
const memStats = memFileSystem.readStats(path);
|
|
65
40
|
if (fsStats && memStats) {
|
|
66
41
|
return fsStats.mtimeMs > memStats.mtimeMs ? fsStats : memStats;
|
|
67
42
|
}
|
|
@@ -72,27 +47,7 @@ function createPassiveFileSystem(caseSensitive = false, realFileSystem) {
|
|
|
72
47
|
return memStats;
|
|
73
48
|
}
|
|
74
49
|
}
|
|
75
|
-
|
|
76
|
-
memfs_1.fs.mkdirSync(normalizePath(path), { recursive: true });
|
|
77
|
-
}
|
|
78
|
-
function writeFile(path, data) {
|
|
79
|
-
if (!memExists(path_1.dirname(path))) {
|
|
80
|
-
createDir(path_1.dirname(path));
|
|
81
|
-
}
|
|
82
|
-
memfs_1.fs.writeFileSync(normalizePath(path), data);
|
|
83
|
-
}
|
|
84
|
-
function deleteFile(path) {
|
|
85
|
-
if (memExists(path)) {
|
|
86
|
-
memfs_1.fs.unlinkSync(normalizePath(path));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function updateTimes(path, atime, mtime) {
|
|
90
|
-
if (memExists(path)) {
|
|
91
|
-
memfs_1.fs.utimesSync(normalizePath(path), atime, mtime);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
exists(path) {
|
|
50
|
+
return Object.assign(Object.assign({}, memFileSystem), { exists(path) {
|
|
96
51
|
return exists(realFileSystem.realPath(path));
|
|
97
52
|
},
|
|
98
53
|
readFile(path, encoding) {
|
|
@@ -107,24 +62,8 @@ function createPassiveFileSystem(caseSensitive = false, realFileSystem) {
|
|
|
107
62
|
realPath(path) {
|
|
108
63
|
return realFileSystem.realPath(path);
|
|
109
64
|
},
|
|
110
|
-
normalizePath(path) {
|
|
111
|
-
return normalizePath(path);
|
|
112
|
-
},
|
|
113
|
-
writeFile(path, data) {
|
|
114
|
-
writeFile(realFileSystem.realPath(path), data);
|
|
115
|
-
},
|
|
116
|
-
deleteFile(path) {
|
|
117
|
-
deleteFile(realFileSystem.realPath(path));
|
|
118
|
-
},
|
|
119
|
-
createDir(path) {
|
|
120
|
-
createDir(realFileSystem.realPath(path));
|
|
121
|
-
},
|
|
122
|
-
updateTimes(path, atime, mtime) {
|
|
123
|
-
updateTimes(realFileSystem.realPath(path), atime, mtime);
|
|
124
|
-
},
|
|
125
65
|
clearCache() {
|
|
126
66
|
realFileSystem.clearCache();
|
|
127
|
-
}
|
|
128
|
-
};
|
|
67
|
+
} });
|
|
129
68
|
}
|
|
130
69
|
exports.createPassiveFileSystem = createPassiveFileSystem;
|