fork-ts-checker-webpack-plugin 7.2.0 → 7.2.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/lib/system.js +16 -6
- 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.2.
|
|
73
|
+
ForkTsCheckerWebpackPlugin.version = '7.2.1'; // will be replaced by the @semantic-release/exec
|
|
74
74
|
/**
|
|
75
75
|
* Default pools for the plugin concurrency limit
|
|
76
76
|
*/
|
|
@@ -108,13 +108,13 @@ exports.system = Object.assign(Object.assign({}, typescript_1.typescript.sys), {
|
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
110
|
invokeFileCreated(path) {
|
|
111
|
-
const normalizedPath =
|
|
111
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
112
112
|
invokeFileWatchers(path, typescript_1.typescript.FileWatcherEventKind.Created);
|
|
113
113
|
invokeDirectoryWatchers(normalizedPath);
|
|
114
114
|
deletedFiles.set(normalizedPath, false);
|
|
115
115
|
},
|
|
116
116
|
invokeFileChanged(path) {
|
|
117
|
-
const normalizedPath =
|
|
117
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
118
118
|
if (deletedFiles.get(normalizedPath) || !fileWatcherCallbacksMap.has(normalizedPath)) {
|
|
119
119
|
invokeFileWatchers(path, typescript_1.typescript.FileWatcherEventKind.Created);
|
|
120
120
|
invokeDirectoryWatchers(normalizedPath);
|
|
@@ -125,7 +125,7 @@ exports.system = Object.assign(Object.assign({}, typescript_1.typescript.sys), {
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
invokeFileDeleted(path) {
|
|
128
|
-
const normalizedPath =
|
|
128
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
129
129
|
if (!deletedFiles.get(normalizedPath)) {
|
|
130
130
|
invokeFileWatchers(path, typescript_1.typescript.FileWatcherEventKind.Deleted);
|
|
131
131
|
invokeDirectoryWatchers(path);
|
|
@@ -141,7 +141,7 @@ exports.system = Object.assign(Object.assign({}, typescript_1.typescript.sys), {
|
|
|
141
141
|
artifacts = nextArtifacts;
|
|
142
142
|
} });
|
|
143
143
|
function createWatcher(watchersMap, path, callback) {
|
|
144
|
-
const normalizedPath =
|
|
144
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
145
145
|
const watchers = watchersMap.get(normalizedPath) || [];
|
|
146
146
|
const nextWatchers = [...watchers, callback];
|
|
147
147
|
watchersMap.set(normalizedPath, nextWatchers);
|
|
@@ -159,7 +159,7 @@ function createWatcher(watchersMap, path, callback) {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
function invokeFileWatchers(path, event) {
|
|
162
|
-
const normalizedPath =
|
|
162
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
163
163
|
if (normalizedPath.endsWith('.js')) {
|
|
164
164
|
// trigger relevant .d.ts file watcher - handles the case, when we have webpack watcher
|
|
165
165
|
// that points to a symlinked package
|
|
@@ -172,7 +172,7 @@ function invokeFileWatchers(path, event) {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
function invokeDirectoryWatchers(path) {
|
|
175
|
-
const normalizedPath =
|
|
175
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
176
176
|
const directory = (0, path_1.dirname)(normalizedPath);
|
|
177
177
|
if (ignoredPaths.some((ignoredPath) => (0, forward_slash_1.forwardSlash)(normalizedPath).includes(ignoredPath))) {
|
|
178
178
|
return;
|
|
@@ -189,6 +189,16 @@ function invokeDirectoryWatchers(path) {
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
+
function normalizeAndResolvePath(path) {
|
|
193
|
+
let normalizedPath = real_file_system_1.realFileSystem.normalizePath(path);
|
|
194
|
+
try {
|
|
195
|
+
normalizedPath = real_file_system_1.realFileSystem.realPath(normalizedPath);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
// ignore error - maybe file doesn't exist
|
|
199
|
+
}
|
|
200
|
+
return normalizedPath;
|
|
201
|
+
}
|
|
192
202
|
function isArtifact(path) {
|
|
193
203
|
return ((artifacts.dirs.some((dir) => path.includes(dir)) ||
|
|
194
204
|
artifacts.files.some((file) => path === file)) &&
|