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 CHANGED
@@ -4,7 +4,7 @@
4
4
  <p>Webpack plugin that runs TypeScript type checker on a separate process.</p>
5
5
 
6
6
  [![npm version](https://img.shields.io/npm/v/fork-ts-checker-webpack-plugin.svg)](https://www.npmjs.com/package/fork-ts-checker-webpack-plugin)
7
- [![build status](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/workflows/CI/CD/badge.svg?branch=master&event=push)](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/actions?query=branch%3Amaster+event%3Apush)
7
+ [![build status](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/workflows/CI/CD/badge.svg?branch=main&event=push)](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/actions?query=branch%3Amain+event%3Apush)
8
8
  [![downloads](http://img.shields.io/npm/dm/fork-ts-checker-webpack-plugin.svg)](https://npmjs.org/package/fork-ts-checker-webpack-plugin)
9
9
  [![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
10
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](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.1'; // will be replaced by the @semantic-release/exec
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/master/packages/babel-code-frame, https://babeljs.io
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) => pattern instanceof RegExp
14
- ? (path) => pattern.test(path)
15
- : (path) => minimatch_1.default(path, pattern));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fork-ts-checker-webpack-plugin",
3
- "version": "6.2.1",
3
+ "version": "6.2.5",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "fast",