fork-ts-checker-webpack-plugin 7.2.0 → 7.2.3

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 CHANGED
@@ -70,7 +70,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
70
70
  /**
71
71
  * Current version of the plugin
72
72
  */
73
- ForkTsCheckerWebpackPlugin.version = '7.2.0'; // will be replaced by the @semantic-release/exec
73
+ ForkTsCheckerWebpackPlugin.version = '7.2.3'; // 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 = real_file_system_1.realFileSystem.normalizePath(path);
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 = real_file_system_1.realFileSystem.normalizePath(path);
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 = real_file_system_1.realFileSystem.normalizePath(path);
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 = real_file_system_1.realFileSystem.normalizePath(path);
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 = real_file_system_1.realFileSystem.normalizePath(path);
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 = real_file_system_1.realFileSystem.normalizePath(path);
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)) &&
@@ -10,6 +10,8 @@ const minimatch_1 = __importDefault(require("minimatch"));
10
10
  const files_change_1 = require("../files-change");
11
11
  const infrastructure_logger_1 = require("../infrastructure-logger");
12
12
  const BUILTIN_IGNORED_DIRS = ['node_modules', '.git', '.yarn', '.pnp'];
13
+ // we ignore package.json file because of https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/674
14
+ const BUILTIN_IGNORED_FILES = ['package.json'];
13
15
  function createIsIgnored(ignored, excluded) {
14
16
  const ignoredPatterns = ignored ? (Array.isArray(ignored) ? ignored : [ignored]) : [];
15
17
  const ignoredFunctions = ignoredPatterns.map((pattern) => {
@@ -27,6 +29,7 @@ function createIsIgnored(ignored, excluded) {
27
29
  });
28
30
  ignoredFunctions.push((path) => excluded.some((excludedPath) => path.startsWith(excludedPath)));
29
31
  ignoredFunctions.push((path) => BUILTIN_IGNORED_DIRS.some((ignoredDir) => path.includes(`/${ignoredDir}/`)));
32
+ ignoredFunctions.push((path) => BUILTIN_IGNORED_FILES.some((ignoredFile) => path.endsWith(`/${ignoredFile}`)));
30
33
  return function isIgnored(path) {
31
34
  return ignoredFunctions.some((ignoredFunction) => ignoredFunction(path));
32
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fork-ts-checker-webpack-plugin",
3
- "version": "7.2.0",
3
+ "version": "7.2.3",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -63,7 +63,7 @@
63
63
  "fs-extra": "^10.0.0",
64
64
  "memfs": "^3.4.1",
65
65
  "minimatch": "^3.0.4",
66
- "schema-utils": "4.0.0",
66
+ "schema-utils": "^3.1.1",
67
67
  "semver": "^7.3.5",
68
68
  "tapable": "^2.2.1"
69
69
  },