fork-ts-checker-webpack-plugin 6.2.1 → 6.2.5
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 +1 -2
- package/lib/ForkTsCheckerWebpackPlugin.js +1 -1
- package/lib/formatter/types/babel__code-frame.js +1 -1
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +5 -0
- package/lib/watch/InclusiveNodeWatchFileSystem.js +16 -3
- package/lib/watch/WatchFileSystem.d.ts +1 -1
- package/package.json +1 -1
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.5'; // 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
|
|
@@ -10,9 +10,22 @@ const minimatch_1 = __importDefault(require("minimatch"));
|
|
|
10
10
|
const BUILTIN_IGNORED_DIRS = ['node_modules', '.git', '.yarn', '.pnp'];
|
|
11
11
|
function createIsIgnored(ignored) {
|
|
12
12
|
const ignoredPatterns = ignored ? (Array.isArray(ignored) ? ignored : [ignored]) : [];
|
|
13
|
-
const ignoredFunctions = ignoredPatterns.map((pattern) =>
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const ignoredFunctions = ignoredPatterns.map((pattern) => {
|
|
14
|
+
// ensure patterns are valid - see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/594
|
|
15
|
+
if (typeof pattern === 'string') {
|
|
16
|
+
return (path) => minimatch_1.default(path, pattern);
|
|
17
|
+
}
|
|
18
|
+
else if (typeof pattern === 'function') {
|
|
19
|
+
return pattern;
|
|
20
|
+
}
|
|
21
|
+
else if (pattern instanceof RegExp) {
|
|
22
|
+
return (path) => pattern.test(path);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// fallback to no-ignore function
|
|
26
|
+
return () => false;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
16
29
|
ignoredFunctions.push((path) => BUILTIN_IGNORED_DIRS.some((ignoredDir) => path.includes(`/${ignoredDir}/`)));
|
|
17
30
|
return function isIgnored(path) {
|
|
18
31
|
return ignoredFunctions.some((ignoredFunction) => ignoredFunction(path));
|
|
@@ -4,7 +4,7 @@ interface WatchFileSystemOptions {
|
|
|
4
4
|
aggregateTimeout: number;
|
|
5
5
|
poll: boolean;
|
|
6
6
|
followSymlinks: boolean;
|
|
7
|
-
ignored: string | RegExp | (string | RegExp)[];
|
|
7
|
+
ignored: string | RegExp | Function | (string | RegExp | Function)[];
|
|
8
8
|
}
|
|
9
9
|
interface Watchpack extends EventEmitter {
|
|
10
10
|
_onChange(item: string, mtime: number, file: string, type?: string): void;
|