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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import webpack from 'webpack';
|
|
2
|
-
import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
3
|
-
import { ReporterRpcClient } from '../reporter';
|
|
4
|
-
declare function tapStopToDisconnectReporter(compiler: webpack.Compiler,
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
3
|
+
import type { ReporterRpcClient } from '../reporter';
|
|
4
|
+
declare function tapStopToDisconnectReporter(compiler: webpack.Compiler, issuesReporter: ReporterRpcClient, dependenciesReporter: ReporterRpcClient, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
5
|
export { tapStopToDisconnectReporter };
|
|
@@ -9,18 +9,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
12
|
+
exports.tapStopToDisconnectReporter = void 0;
|
|
13
|
+
function tapStopToDisconnectReporter(compiler, issuesReporter, dependenciesReporter, state) {
|
|
13
14
|
compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
14
|
-
|
|
15
|
+
issuesReporter.disconnect();
|
|
16
|
+
dependenciesReporter.disconnect();
|
|
15
17
|
});
|
|
16
18
|
compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', () => __awaiter(this, void 0, void 0, function* () {
|
|
17
19
|
if (!state.watching) {
|
|
18
|
-
yield
|
|
20
|
+
yield Promise.all([issuesReporter.disconnect(), dependenciesReporter.disconnect()]);
|
|
19
21
|
}
|
|
20
22
|
}));
|
|
21
23
|
compiler.hooks.failed.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
22
24
|
if (!state.watching) {
|
|
23
|
-
|
|
25
|
+
issuesReporter.disconnect();
|
|
26
|
+
dependenciesReporter.disconnect();
|
|
24
27
|
}
|
|
25
28
|
});
|
|
26
29
|
}
|
package/lib/issue/Issue.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { IssueLocation } from './IssueLocation';
|
|
2
|
+
import type { IssueSeverity } from './IssueSeverity';
|
|
3
3
|
interface Issue {
|
|
4
|
-
origin: string;
|
|
5
4
|
severity: IssueSeverity;
|
|
6
5
|
code: string;
|
|
7
6
|
message: string;
|
package/lib/issue/Issue.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.deduplicateAndSortIssues = exports.isIssue = void 0;
|
|
4
4
|
const IssueLocation_1 = require("./IssueLocation");
|
|
5
|
+
const IssueSeverity_1 = require("./IssueSeverity");
|
|
5
6
|
function isIssue(value) {
|
|
6
7
|
return (!!value &&
|
|
7
8
|
typeof value === 'object' &&
|
|
8
|
-
!!value.origin &&
|
|
9
9
|
IssueSeverity_1.isIssueSeverity(value.severity) &&
|
|
10
10
|
!!value.code &&
|
|
11
11
|
!!value.message);
|
|
@@ -25,7 +25,6 @@ function compareStrings(stringA, stringB) {
|
|
|
25
25
|
}
|
|
26
26
|
function compareIssues(issueA, issueB) {
|
|
27
27
|
return (IssueSeverity_1.compareIssueSeverities(issueA.severity, issueB.severity) ||
|
|
28
|
-
compareStrings(issueA.origin, issueB.origin) ||
|
|
29
28
|
compareStrings(issueA.file, issueB.file) ||
|
|
30
29
|
IssueLocation_1.compareIssueLocations(issueA.location, issueB.location) ||
|
|
31
30
|
compareStrings(issueA.code, issueB.code) ||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import webpack from 'webpack';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { IssueOptions } from './IssueOptions';
|
|
3
|
+
import type { IssuePredicate } from './IssuePredicate';
|
|
4
4
|
interface IssueConfiguration {
|
|
5
5
|
predicate: IssuePredicate;
|
|
6
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIssueConfiguration = void 0;
|
|
3
4
|
const IssueMatch_1 = require("./IssueMatch");
|
|
4
5
|
const IssuePredicate_1 = require("./IssuePredicate");
|
|
5
6
|
function createIssuePredicateFromOption(context, option) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IssuePosition } from './IssuePosition';
|
|
1
|
+
import type { IssuePosition } from './IssuePosition';
|
|
2
2
|
interface IssueLocation {
|
|
3
3
|
start: IssuePosition;
|
|
4
4
|
end: IssuePosition;
|
|
5
5
|
}
|
|
6
6
|
declare function compareIssueLocations(locationA?: IssueLocation, locationB?: IssueLocation): number;
|
|
7
|
-
declare function formatIssueLocation(
|
|
7
|
+
declare function formatIssueLocation({ start, end }: IssueLocation): string;
|
|
8
8
|
export { IssueLocation, compareIssueLocations, formatIssueLocation };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatIssueLocation = exports.compareIssueLocations = void 0;
|
|
3
4
|
const IssuePosition_1 = require("./IssuePosition");
|
|
4
5
|
function compareIssueLocations(locationA, locationB) {
|
|
5
6
|
if (locationA === locationB) {
|
|
@@ -15,7 +16,21 @@ function compareIssueLocations(locationA, locationB) {
|
|
|
15
16
|
IssuePosition_1.compareIssuePositions(locationA.end, locationB.end));
|
|
16
17
|
}
|
|
17
18
|
exports.compareIssueLocations = compareIssueLocations;
|
|
18
|
-
function formatIssueLocation(
|
|
19
|
-
|
|
19
|
+
function formatIssueLocation({ start, end }) {
|
|
20
|
+
if (!end.line || start.line === end.line) {
|
|
21
|
+
// the same line
|
|
22
|
+
if (!end.column || start.column === end.column) {
|
|
23
|
+
// the same column
|
|
24
|
+
return `${start.line}:${start.column}`;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// different column
|
|
28
|
+
return `${start.line}:${start.column}-${end.column}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// different lines
|
|
33
|
+
return `${start.line}:${start.column}-${end.line}:${end.column}`;
|
|
34
|
+
}
|
|
20
35
|
}
|
|
21
36
|
exports.formatIssueLocation = formatIssueLocation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
declare type IssueMatch = Partial<Pick<Issue, '
|
|
1
|
+
import type { IssuePredicate } from './IssuePredicate';
|
|
2
|
+
import type { Issue } from './index';
|
|
3
|
+
declare type IssueMatch = Partial<Pick<Issue, 'severity' | 'code' | 'file'>>;
|
|
4
4
|
declare function createIssuePredicateFromIssueMatch(context: string, match: IssueMatch): IssuePredicate;
|
|
5
5
|
export { IssueMatch, createIssuePredicateFromIssueMatch };
|
package/lib/issue/IssueMatch.js
CHANGED
|
@@ -3,18 +3,18 @@ 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.createIssuePredicateFromIssueMatch = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const minimatch_1 = __importDefault(require("minimatch"));
|
|
8
9
|
const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
|
|
9
10
|
function createIssuePredicateFromIssueMatch(context, match) {
|
|
10
11
|
return (issue) => {
|
|
11
|
-
const matchesOrigin = !match.origin || match.origin === issue.origin;
|
|
12
12
|
const matchesSeverity = !match.severity || match.severity === issue.severity;
|
|
13
13
|
const matchesCode = !match.code || match.code === issue.code;
|
|
14
14
|
const matchesFile = !issue.file ||
|
|
15
15
|
(!!issue.file &&
|
|
16
16
|
(!match.file || minimatch_1.default(forwardSlash_1.default(path_1.default.relative(context, issue.file)), match.file)));
|
|
17
|
-
return
|
|
17
|
+
return matchesSeverity && matchesCode && matchesFile;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
exports.createIssuePredicateFromIssueMatch = createIssuePredicateFromIssueMatch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IssueMatch } from './IssueMatch';
|
|
2
|
-
import { IssuePredicate } from './IssuePredicate';
|
|
1
|
+
import type { IssueMatch } from './IssueMatch';
|
|
2
|
+
import type { IssuePredicate } from './IssuePredicate';
|
|
3
3
|
declare type IssuePredicateOption = IssuePredicate | IssueMatch | (IssuePredicate | IssueMatch)[];
|
|
4
4
|
interface IssueOptions {
|
|
5
5
|
include?: IssuePredicateOption;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue } from './index';
|
|
1
|
+
import type { Issue } from './index';
|
|
2
2
|
declare type IssuePredicate = (issue: Issue) => boolean;
|
|
3
3
|
declare function createTrivialIssuePredicate(result: boolean): IssuePredicate;
|
|
4
4
|
declare function composeIssuePredicates(predicates: IssuePredicate[]): IssuePredicate;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import webpack from 'webpack';
|
|
2
|
+
import type { Issue } from './Issue';
|
|
3
|
+
declare class IssueWebpackError extends webpack.WebpackError {
|
|
3
4
|
readonly issue: Issue;
|
|
4
5
|
readonly hideStack = true;
|
|
5
|
-
readonly file: string | undefined;
|
|
6
6
|
constructor(message: string, issue: Issue);
|
|
7
7
|
}
|
|
8
8
|
export { IssueWebpackError };
|
|
@@ -3,10 +3,12 @@ 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.IssueWebpackError = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
9
|
+
const relativeToContext_1 = require("../utils/path/relativeToContext");
|
|
7
10
|
const IssueLocation_1 = require("./IssueLocation");
|
|
8
|
-
|
|
9
|
-
class IssueWebpackError extends Error {
|
|
11
|
+
class IssueWebpackError extends webpack_1.default.WebpackError {
|
|
10
12
|
constructor(message, issue) {
|
|
11
13
|
super(message);
|
|
12
14
|
this.issue = issue;
|
|
@@ -15,9 +17,9 @@ class IssueWebpackError extends Error {
|
|
|
15
17
|
// should be a NormalModule instance.
|
|
16
18
|
// to avoid such a dependency, we do a workaround - error.file will contain formatted location instead
|
|
17
19
|
if (issue.file) {
|
|
18
|
-
this.file =
|
|
20
|
+
this.file = relativeToContext_1.relativeToContext(issue.file, process.cwd());
|
|
19
21
|
if (issue.location) {
|
|
20
|
-
this.file +=
|
|
22
|
+
this.file += ` ${chalk_1.default.green.bold(IssueLocation_1.formatIssueLocation(issue.location))}`;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
Error.captureStackTrace(this, this.constructor);
|
package/lib/issue/index.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
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
|
-
|
|
13
|
+
__exportStar(require("./Issue"), exports);
|
|
14
|
+
__exportStar(require("./IssueSeverity"), exports);
|
|
15
|
+
__exportStar(require("./IssueLocation"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Logger from './Logger';
|
|
3
|
-
import
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type Logger from './Logger';
|
|
3
|
+
import type LoggerOptions from './LoggerOptions';
|
|
4
4
|
interface LoggerConfiguration {
|
|
5
5
|
infrastructure: Logger;
|
|
6
6
|
issues: Logger;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createLoggerConfiguration = void 0;
|
|
3
4
|
const LoggerFactory_1 = require("./LoggerFactory");
|
|
4
5
|
function createLoggerConfiguration(compiler, options) {
|
|
5
6
|
return {
|
|
6
|
-
infrastructure: LoggerFactory_1.createLogger((options && options.infrastructure) || '
|
|
7
|
+
infrastructure: LoggerFactory_1.createLogger((options && options.infrastructure) || 'webpack-infrastructure', compiler),
|
|
7
8
|
issues: LoggerFactory_1.createLogger((options && options.issues) || 'console', compiler),
|
|
8
9
|
devServer: (options === null || options === void 0 ? void 0 : options.devServer) !== false,
|
|
9
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
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 type LoggerType = 'console' | 'webpack-infrastructure' | 'silent';
|
|
4
4
|
declare function createLogger(type: LoggerType | Logger, compiler: webpack.Compiler): Logger;
|
|
5
5
|
export { createLogger, LoggerType };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.createLogger = void 0;
|
|
4
4
|
const PartialLogger_1 = require("./PartialLogger");
|
|
5
|
+
const WebpackInfrastructureLogger_1 = require("./WebpackInfrastructureLogger");
|
|
5
6
|
function createLogger(type, compiler) {
|
|
6
7
|
if (typeof type !== 'string') {
|
|
7
8
|
return type;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type Logger from './Logger';
|
|
2
|
+
import type { LoggerType } from './LoggerFactory';
|
|
3
3
|
declare type LoggerOptions = {
|
|
4
4
|
infrastructure?: LoggerType | Logger;
|
|
5
5
|
issues?: LoggerType | Logger;
|
|
@@ -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;
|
|
@@ -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.createAggregatedReporter = void 0;
|
|
12
13
|
const OperationCanceledError_1 = require("../error/OperationCanceledError");
|
|
13
14
|
const FilesChange_1 = require("./FilesChange");
|
|
14
15
|
/**
|
|
@@ -23,7 +24,7 @@ function createAggregatedReporter(reporter) {
|
|
|
23
24
|
let resolvePending;
|
|
24
25
|
pendingPromise = new Promise((resolve) => {
|
|
25
26
|
resolvePending = () => {
|
|
26
|
-
resolve();
|
|
27
|
+
resolve(undefined);
|
|
27
28
|
pendingPromise = undefined;
|
|
28
29
|
};
|
|
29
30
|
});
|
|
@@ -3,11 +3,12 @@ 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.aggregateFilesChanges = exports.clearFilesChange = exports.updateFilesChange = exports.getFilesChange = void 0;
|
|
6
7
|
const substract_1 = __importDefault(require("../utils/array/substract"));
|
|
7
8
|
const unique_1 = __importDefault(require("../utils/array/unique"));
|
|
8
9
|
const compilerFilesChangeMap = new WeakMap();
|
|
9
10
|
function getFilesChange(compiler) {
|
|
10
|
-
return compilerFilesChangeMap.get(compiler) || {};
|
|
11
|
+
return compilerFilesChangeMap.get(compiler) || { changedFiles: [], deletedFiles: [] };
|
|
11
12
|
}
|
|
12
13
|
exports.getFilesChange = getFilesChange;
|
|
13
14
|
function updateFilesChange(compiler, change) {
|
|
File without changes
|
package/lib/reporter/Report.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Issue } from '../issue';
|
|
2
|
+
import type { FilesMatch } from './FilesMatch';
|
|
3
3
|
interface Report {
|
|
4
|
-
getDependencies(): Promise<
|
|
4
|
+
getDependencies(): Promise<FilesMatch>;
|
|
5
5
|
getIssues(): Promise<Issue[]>;
|
|
6
6
|
close(): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilesChange } from './FilesChange';
|
|
2
|
-
import { Report } from './Report';
|
|
1
|
+
import type { FilesChange } from './FilesChange';
|
|
2
|
+
import type { Report } from './Report';
|
|
3
3
|
interface Reporter {
|
|
4
4
|
getReport(change: FilesChange, watching: boolean): Promise<Report>;
|
|
5
5
|
}
|
package/lib/reporter/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export * from './Report';
|
|
|
2
2
|
export * from './Reporter';
|
|
3
3
|
export * from './AggregatedReporter';
|
|
4
4
|
export * from './FilesChange';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './FilesMatch';
|
|
6
6
|
export * from './reporter-rpc/ReporterRpcClient';
|
|
7
7
|
export * from './reporter-rpc/ReporterRpcService';
|
package/lib/reporter/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("./Report"), exports);
|
|
14
|
+
__exportStar(require("./Reporter"), exports);
|
|
15
|
+
__exportStar(require("./AggregatedReporter"), exports);
|
|
16
|
+
__exportStar(require("./FilesChange"), exports);
|
|
17
|
+
__exportStar(require("./FilesMatch"), exports);
|
|
18
|
+
__exportStar(require("./reporter-rpc/ReporterRpcClient"), exports);
|
|
19
|
+
__exportStar(require("./reporter-rpc/ReporterRpcService"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { RpcMessageChannel } from '../../rpc';
|
|
2
|
+
import type { Reporter } from '../Reporter';
|
|
3
3
|
interface ReporterRpcClient extends Reporter {
|
|
4
4
|
isConnected: () => boolean;
|
|
5
5
|
connect: () => Promise<void>;
|
|
@@ -12,9 +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.composeReporterRpcClients = exports.createReporterRpcClient = void 0;
|
|
15
16
|
const rpc_1 = require("../../rpc");
|
|
16
|
-
const ReporterRpcProcedure_1 = require("./ReporterRpcProcedure");
|
|
17
17
|
const flatten_1 = __importDefault(require("../../utils/array/flatten"));
|
|
18
|
+
const ReporterRpcProcedure_1 = require("./ReporterRpcProcedure");
|
|
19
|
+
// suppressing because it will be removed anyway
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
18
21
|
function createReporterRpcClient(channel, configuration) {
|
|
19
22
|
const rpcClient = rpc_1.createRpcClient(channel.clientPort);
|
|
20
23
|
return {
|
|
@@ -24,8 +27,17 @@ function createReporterRpcClient(channel, configuration) {
|
|
|
24
27
|
yield channel.open();
|
|
25
28
|
}
|
|
26
29
|
if (!rpcClient.isConnected()) {
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
try {
|
|
31
|
+
yield rpcClient.connect();
|
|
32
|
+
yield rpcClient.dispatchCall(ReporterRpcProcedure_1.configure, configuration);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
// connect or configure was not successful -
|
|
36
|
+
// close the reporter and re-throw an error
|
|
37
|
+
yield rpcClient.disconnect();
|
|
38
|
+
yield channel.close();
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
29
41
|
}
|
|
30
42
|
}),
|
|
31
43
|
disconnect: () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -62,8 +74,9 @@ function composeReporterRpcClients(clients) {
|
|
|
62
74
|
getDependencies: () => Promise.all(reports.map((report) => report.getDependencies())).then((dependencies) => dependencies.reduce((mergedDependencies, singleDependencies) => ({
|
|
63
75
|
files: Array.from(new Set([...mergedDependencies.files, ...singleDependencies.files])),
|
|
64
76
|
dirs: Array.from(new Set([...mergedDependencies.dirs, ...singleDependencies.dirs])),
|
|
77
|
+
excluded: Array.from(new Set([...mergedDependencies.excluded, ...singleDependencies.excluded])),
|
|
65
78
|
extensions: Array.from(new Set([...mergedDependencies.extensions, ...singleDependencies.extensions])),
|
|
66
|
-
}), { files: [], dirs: [], extensions: [] })),
|
|
79
|
+
}), { files: [], dirs: [], excluded: [], extensions: [] })),
|
|
67
80
|
getIssues: () => Promise.all(reports.map((report) => report.getIssues())).then((issues) => flatten_1.default(issues)),
|
|
68
81
|
close: () => Promise.all(reports.map((report) => report.close())).then(() => undefined),
|
|
69
82
|
})),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { Issue } from '../../issue';
|
|
2
|
+
import type { RpcProcedure } from '../../rpc';
|
|
3
|
+
import type { FilesChange } from '../FilesChange';
|
|
4
|
+
import type { FilesMatch } from '../FilesMatch';
|
|
5
5
|
declare const configure: RpcProcedure<object, void>;
|
|
6
6
|
declare const getReport: RpcProcedure<{
|
|
7
7
|
change: FilesChange;
|
|
8
8
|
watching: boolean;
|
|
9
9
|
}, void>;
|
|
10
|
-
declare const getDependencies: RpcProcedure<void,
|
|
10
|
+
declare const getDependencies: RpcProcedure<void, FilesMatch>;
|
|
11
11
|
declare const getIssues: RpcProcedure<void, Issue[]>;
|
|
12
12
|
declare const closeReport: RpcProcedure<void, void>;
|
|
13
13
|
export { configure, getReport, getDependencies, getIssues, closeReport };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.closeReport = exports.getIssues = exports.getDependencies = exports.getReport = exports.configure = void 0;
|
|
4
|
+
// suppressing because it will be removed anyway
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
3
6
|
const configure = 'configure';
|
|
4
7
|
exports.configure = configure;
|
|
5
8
|
const getReport = 'getReport';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { RpcMessagePort } from '../../rpc';
|
|
2
|
+
import type { Reporter } from '../Reporter';
|
|
3
3
|
interface ReporterRpcService {
|
|
4
4
|
isOpen: () => boolean;
|
|
5
5
|
open: () => Promise<void>;
|
|
@@ -9,8 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.registerReporterRpcService = void 0;
|
|
12
13
|
const rpc_1 = require("../../rpc");
|
|
13
14
|
const ReporterRpcProcedure_1 = require("./ReporterRpcProcedure");
|
|
15
|
+
// suppressing because it will be removed anyway
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
14
17
|
function registerReporterRpcService(servicePort, reporterFactory) {
|
|
15
18
|
const rpcService = rpc_1.createRpcService(servicePort);
|
|
16
19
|
let reporterRegistered = false;
|
package/lib/rpc/RpcClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { RpcMessagePort } from './RpcMessagePort';
|
|
2
|
+
import type { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
|
|
3
3
|
interface RpcClient {
|
|
4
4
|
readonly isConnected: () => boolean;
|
|
5
5
|
readonly connect: () => Promise<void>;
|
package/lib/rpc/RpcClient.js
CHANGED
|
@@ -9,8 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
12
|
+
exports.createRpcClient = void 0;
|
|
13
13
|
const RpcRemoteError_1 = require("./error/RpcRemoteError");
|
|
14
|
+
const RpcMessage_1 = require("./RpcMessage");
|
|
14
15
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
15
16
|
function createRpcClient(port) {
|
|
16
17
|
let callIndex = 0;
|
package/lib/rpc/RpcMessage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
|
|
1
|
+
import type { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure';
|
|
2
2
|
interface RpcMessage<TType extends string = string, TProcedure extends RpcProcedure = RpcProcedure, TPayload = unknown> {
|
|
3
3
|
rpc: true;
|
|
4
4
|
type: TType;
|