fork-ts-checker-webpack-plugin 6.2.0 → 6.2.4
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
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<p>Webpack plugin that runs TypeScript type checker on a separate process.</p>
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/fork-ts-checker-webpack-plugin)
|
|
7
|
-
[](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/actions?query=branch%3Amain+event%3Apush)
|
|
8
8
|
[](https://npmjs.org/package/fork-ts-checker-webpack-plugin)
|
|
9
9
|
[](http://commitizen.github.io/cz-cli/)
|
|
10
10
|
[](https://github.com/prettier/prettier)
|
|
@@ -70,7 +70,6 @@ module.exports = {
|
|
|
70
70
|
|
|
71
71
|
It's very important to be aware that **this plugin uses [TypeScript](https://github.com/Microsoft/TypeScript)'s, not
|
|
72
72
|
[webpack](https://github.com/webpack/webpack)'s modules resolution**. It means that you have to setup `tsconfig.json` correctly.
|
|
73
|
-
For example if you set `files: ['./src/index.ts']` in `tsconfig.json`, this plugin will check only `index.ts` for errors.
|
|
74
73
|
|
|
75
74
|
> It's because of the performance - with TypeScript's module resolution we don't have to wait for webpack to compile files.
|
|
76
75
|
>
|
|
@@ -65,7 +65,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
|
65
65
|
/**
|
|
66
66
|
* Current version of the plugin
|
|
67
67
|
*/
|
|
68
|
-
ForkTsCheckerWebpackPlugin.version = '6.2.
|
|
68
|
+
ForkTsCheckerWebpackPlugin.version = '6.2.4'; // will be replaced by the @semantic-release/exec
|
|
69
69
|
/**
|
|
70
70
|
* Default pool for the plugin concurrency limit
|
|
71
71
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Base on the type definitions for @babel/code-frame 7.0
|
|
3
|
-
// Project: https://github.com/babel/babel/tree/
|
|
3
|
+
// Project: https://github.com/babel/babel/tree/main/packages/babel-code-frame, https://babeljs.io
|
|
4
4
|
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
|
|
5
5
|
// Forbes Lindesay <https://github.com/ForbesLindesay>
|
|
6
6
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
@@ -51,6 +51,11 @@ function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
|
51
51
|
}
|
|
52
52
|
function invokeFileWatchers(path, event) {
|
|
53
53
|
const normalizedPath = realFileSystem.normalizePath(path);
|
|
54
|
+
if (normalizedPath.endsWith('.js')) {
|
|
55
|
+
// trigger relevant .d.ts file watcher - handles the case, when we have webpack watcher
|
|
56
|
+
// that points to a symlinked package
|
|
57
|
+
invokeFileWatchers(normalizedPath.slice(0, -3) + '.d.ts', event);
|
|
58
|
+
}
|
|
54
59
|
const fileWatcherCallbacks = fileWatcherCallbacksMap.get(normalizedPath);
|
|
55
60
|
if (fileWatcherCallbacks) {
|
|
56
61
|
// typescript expects normalized paths with posix forward slash
|
|
@@ -6,9 +6,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const chokidar_1 = __importDefault(require("chokidar"));
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const reporter_1 = require("../reporter");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const minimatch_1 = __importDefault(require("minimatch"));
|
|
10
|
+
const BUILTIN_IGNORED_DIRS = ['node_modules', '.git', '.yarn', '.pnp'];
|
|
11
|
+
function createIsIgnored(ignored) {
|
|
12
|
+
const ignoredPatterns = ignored ? (Array.isArray(ignored) ? ignored : [ignored]) : [];
|
|
13
|
+
const ignoredFunctions = ignoredPatterns
|
|
14
|
+
// sanitize patterns - see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/594
|
|
15
|
+
.filter((pattern) => typeof pattern === 'string' || pattern instanceof RegExp)
|
|
16
|
+
.map((pattern) => pattern instanceof RegExp
|
|
17
|
+
? (path) => pattern.test(path)
|
|
18
|
+
: (path) => minimatch_1.default(path, pattern));
|
|
19
|
+
ignoredFunctions.push((path) => BUILTIN_IGNORED_DIRS.some((ignoredDir) => path.includes(`/${ignoredDir}/`)));
|
|
20
|
+
return function isIgnored(path) {
|
|
21
|
+
return ignoredFunctions.some((ignoredFunction) => ignoredFunction(path));
|
|
22
|
+
};
|
|
12
23
|
}
|
|
13
24
|
class InclusiveNodeWatchFileSystem {
|
|
14
25
|
constructor(watchFileSystem, compiler, pluginState) {
|
|
@@ -25,6 +36,7 @@ class InclusiveNodeWatchFileSystem {
|
|
|
25
36
|
watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) {
|
|
26
37
|
var _a, _b, _c;
|
|
27
38
|
reporter_1.clearFilesChange(this.compiler);
|
|
39
|
+
const isIgnored = createIsIgnored(options === null || options === void 0 ? void 0 : options.ignored);
|
|
28
40
|
// use standard watch file system for files and missing
|
|
29
41
|
const standardWatcher = this.watchFileSystem.watch(files, dirs, missing, startTime, options, callback, callbackUndelayed);
|
|
30
42
|
(_a = this.watcher) === null || _a === void 0 ? void 0 : _a.on('change', (file) => {
|