fork-ts-checker-webpack-plugin 7.1.0 → 7.1.1
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/lib/plugin.js +1 -1
- package/lib/typescript/worker/get-dependencies-worker.d.ts +1 -1
- package/lib/typescript/worker/get-dependencies-worker.js +2 -5
- package/lib/typescript/worker/get-issues-worker.d.ts +1 -1
- package/lib/typescript/worker/get-issues-worker.js +14 -9
- package/lib/typescript/worker/lib/config.d.ts +2 -0
- package/lib/typescript/worker/lib/config.js +7 -1
- package/package.json +1 -1
package/lib/plugin.js
CHANGED
|
@@ -70,7 +70,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
|
70
70
|
/**
|
|
71
71
|
* Current version of the plugin
|
|
72
72
|
*/
|
|
73
|
-
ForkTsCheckerWebpackPlugin.version = '7.1.
|
|
73
|
+
ForkTsCheckerWebpackPlugin.version = '7.1.1'; // will be replaced by the @semantic-release/exec
|
|
74
74
|
/**
|
|
75
75
|
* Default pools for the plugin concurrency limit
|
|
76
76
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FilesChange } from '../../files-change';
|
|
2
2
|
import type { FilesMatch } from '../../files-match';
|
|
3
|
-
declare const getDependenciesWorker: (
|
|
3
|
+
declare const getDependenciesWorker: (change: FilesChange) => FilesMatch;
|
|
4
4
|
export declare type GetDependenciesWorker = typeof getDependenciesWorker;
|
|
5
5
|
export {};
|
|
@@ -4,15 +4,12 @@ const rpc_1 = require("../../rpc");
|
|
|
4
4
|
const config_1 = require("./lib/config");
|
|
5
5
|
const dependencies_1 = require("./lib/dependencies");
|
|
6
6
|
const system_1 = require("./lib/system");
|
|
7
|
-
const getDependenciesWorker = (
|
|
7
|
+
const getDependenciesWorker = (change) => {
|
|
8
8
|
system_1.system.invalidateCache();
|
|
9
|
-
if ((0, config_1.didConfigFileChanged)(
|
|
9
|
+
if ((0, config_1.didConfigFileChanged)(change) || (0, config_1.didDependenciesProbablyChanged)((0, dependencies_1.getDependencies)(), change)) {
|
|
10
10
|
(0, config_1.invalidateConfig)();
|
|
11
11
|
(0, dependencies_1.invalidateDependencies)();
|
|
12
12
|
}
|
|
13
|
-
else if ((0, config_1.didRootFilesChanged)()) {
|
|
14
|
-
(0, dependencies_1.invalidateDependencies)();
|
|
15
|
-
}
|
|
16
13
|
return (0, dependencies_1.getDependencies)();
|
|
17
14
|
};
|
|
18
15
|
(0, rpc_1.exposeRpc)(getDependenciesWorker);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FilesChange } from '../../files-change';
|
|
2
2
|
import type { Issue } from '../../issue';
|
|
3
|
-
declare const getIssuesWorker: (
|
|
3
|
+
declare const getIssuesWorker: (change: FilesChange, watching: boolean) => Promise<Issue[]>;
|
|
4
4
|
export declare type GetIssuesWorker = typeof getIssuesWorker;
|
|
5
5
|
export {};
|
|
@@ -22,11 +22,12 @@ const system_1 = require("./lib/system");
|
|
|
22
22
|
const tracing_1 = require("./lib/tracing");
|
|
23
23
|
const tsbuildinfo_1 = require("./lib/tsbuildinfo");
|
|
24
24
|
const worker_config_1 = require("./lib/worker-config");
|
|
25
|
-
const getIssuesWorker = (
|
|
25
|
+
const getIssuesWorker = (change, watching) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
var _a, _b;
|
|
26
27
|
system_1.system.invalidateCache();
|
|
27
|
-
(0,
|
|
28
|
-
if ((0, config_1.didConfigFileChanged)({ changedFiles, deletedFiles })) {
|
|
28
|
+
if ((0, config_1.didConfigFileChanged)(change)) {
|
|
29
29
|
(0, config_1.invalidateConfig)();
|
|
30
|
+
(0, dependencies_1.invalidateDependencies)();
|
|
30
31
|
(0, artifacts_1.invalidateArtifacts)();
|
|
31
32
|
(0, diagnostics_1.invalidateDiagnostics)();
|
|
32
33
|
(0, program_1.invalidateProgram)(true);
|
|
@@ -34,10 +35,14 @@ const getIssuesWorker = ({ changedFiles = [], deletedFiles = [] }, watching) =>
|
|
|
34
35
|
(0, solution_builder_1.invalidateSolutionBuilder)(true);
|
|
35
36
|
(0, tsbuildinfo_1.invalidateTsBuildInfo)();
|
|
36
37
|
}
|
|
37
|
-
else if ((0, config_1.
|
|
38
|
+
else if ((0, config_1.didDependenciesProbablyChanged)((0, dependencies_1.getDependencies)(), change)) {
|
|
39
|
+
(0, config_1.invalidateConfig)();
|
|
40
|
+
(0, dependencies_1.invalidateDependencies)();
|
|
38
41
|
(0, artifacts_1.invalidateArtifacts)();
|
|
39
|
-
(0,
|
|
40
|
-
|
|
42
|
+
if ((0, config_1.didRootFilesChanged)()) {
|
|
43
|
+
(0, watch_program_1.invalidateWatchProgramRootFileNames)();
|
|
44
|
+
(0, solution_builder_1.invalidateSolutionBuilder)();
|
|
45
|
+
}
|
|
41
46
|
}
|
|
42
47
|
(0, artifacts_1.registerArtifacts)();
|
|
43
48
|
(0, performance_1.enablePerformanceIfNeeded)();
|
|
@@ -57,11 +62,11 @@ const getIssuesWorker = ({ changedFiles = [], deletedFiles = [] }, watching) =>
|
|
|
57
62
|
(0, program_1.useProgram)();
|
|
58
63
|
}
|
|
59
64
|
// simulate file system events
|
|
60
|
-
changedFiles.forEach((changedFile) => {
|
|
65
|
+
(_a = change.changedFiles) === null || _a === void 0 ? void 0 : _a.forEach((changedFile) => {
|
|
61
66
|
system_1.system === null || system_1.system === void 0 ? void 0 : system_1.system.invokeFileChanged(changedFile);
|
|
62
67
|
});
|
|
63
|
-
deletedFiles.forEach((
|
|
64
|
-
system_1.system === null || system_1.system === void 0 ? void 0 : system_1.system.invokeFileDeleted(
|
|
68
|
+
(_b = change.deletedFiles) === null || _b === void 0 ? void 0 : _b.forEach((deletedFile) => {
|
|
69
|
+
system_1.system === null || system_1.system === void 0 ? void 0 : system_1.system.invokeFileDeleted(deletedFile);
|
|
65
70
|
});
|
|
66
71
|
// wait for all queued events to be processed
|
|
67
72
|
yield system_1.system.waitForQueued();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
2
|
import type { FilesChange } from '../../../files-change';
|
|
3
|
+
import type { FilesMatch } from '../../../files-match';
|
|
3
4
|
import type { Issue } from '../../../issue';
|
|
4
5
|
export declare function parseConfig(configFileName: string, configFileContext: string): ts.ParsedCommandLine;
|
|
5
6
|
export declare function getParseConfigIssues(): Issue[];
|
|
@@ -10,4 +11,5 @@ export declare function getConfigFilePathFromCompilerOptions(compilerOptions: ts
|
|
|
10
11
|
export declare function getConfigFilePathFromProgram(program: ts.Program): string;
|
|
11
12
|
export declare function getConfigFilePathFromBuilderProgram(builderProgram: ts.BuilderProgram): string;
|
|
12
13
|
export declare function didConfigFileChanged({ changedFiles, deletedFiles }: FilesChange): boolean;
|
|
14
|
+
export declare function didDependenciesProbablyChanged(dependencies: FilesMatch, { changedFiles, deletedFiles }: FilesChange): boolean;
|
|
13
15
|
export declare function didRootFilesChanged(): boolean | undefined;
|
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.didRootFilesChanged = exports.didConfigFileChanged = exports.getConfigFilePathFromBuilderProgram = exports.getConfigFilePathFromProgram = exports.getConfigFilePathFromCompilerOptions = exports.invalidateConfig = exports.parseNextConfig = exports.getParsedConfig = exports.getParseConfigIssues = exports.parseConfig = void 0;
|
|
22
|
+
exports.didRootFilesChanged = exports.didDependenciesProbablyChanged = exports.didConfigFileChanged = exports.getConfigFilePathFromBuilderProgram = exports.getConfigFilePathFromProgram = exports.getConfigFilePathFromCompilerOptions = exports.invalidateConfig = exports.parseNextConfig = exports.getParsedConfig = exports.getParseConfigIssues = exports.parseConfig = void 0;
|
|
23
23
|
const path = __importStar(require("path"));
|
|
24
24
|
const forward_slash_1 = require("../../../utils/path/forward-slash");
|
|
25
25
|
const diagnostics_1 = require("./diagnostics");
|
|
@@ -124,6 +124,12 @@ function didConfigFileChanged({ changedFiles = [], deletedFiles = [] }) {
|
|
|
124
124
|
.includes(path.normalize(worker_config_1.config.configFile));
|
|
125
125
|
}
|
|
126
126
|
exports.didConfigFileChanged = didConfigFileChanged;
|
|
127
|
+
function didDependenciesProbablyChanged(dependencies, { changedFiles = [], deletedFiles = [] }) {
|
|
128
|
+
const didSomeDependencyHasBeenAdded = changedFiles.some((changeFile) => !dependencies.files.includes(changeFile));
|
|
129
|
+
const didSomeDependencyHasBeenDeleted = deletedFiles.some((deletedFile) => dependencies.files.includes(deletedFile));
|
|
130
|
+
return didSomeDependencyHasBeenAdded || didSomeDependencyHasBeenDeleted;
|
|
131
|
+
}
|
|
132
|
+
exports.didDependenciesProbablyChanged = didDependenciesProbablyChanged;
|
|
127
133
|
function didRootFilesChanged() {
|
|
128
134
|
const [prevConfig, nextConfig] = parseNextConfig();
|
|
129
135
|
return (prevConfig && JSON.stringify(prevConfig.fileNames) !== JSON.stringify(nextConfig.fileNames));
|