fork-ts-checker-webpack-plugin 8.0.0 → 9.0.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/README.md CHANGED
@@ -23,10 +23,11 @@
23
23
 
24
24
  ## Installation
25
25
 
26
- This plugin requires **Node.js >=12.13.0+**, **Webpack ^5.11.0**, **TypeScript ^3.6.0**
26
+ This plugin requires **Node.js >=14.0.0+**, **Webpack ^5.11.0**, **TypeScript ^3.6.0**
27
27
 
28
28
  * If you depend on **TypeScript 2.1 - 2.6.2**, please use [version 4](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v4.1.4) of the plugin.
29
29
  * If you depend on **Webpack 4**, **TypeScript 2.7 - 3.5.3** or **ESLint** feature, please use [version 6](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v6.2.6) of the plugin.
30
+ * If you depend on **Node.js 12**, please use [version 8](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v8.0.0) of the plugin.
30
31
  * If you need Vue.js support, please use [version 6](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v6.5.2) of ths plugin
31
32
 
32
33
  ```sh
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
3
  import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
4
4
  declare function interceptDoneToGetDevServerTap(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
3
  import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
4
4
  declare function tapAfterCompileToAddDependencies(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
3
  import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
4
4
  declare function tapAfterCompileToGetIssues(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
3
3
  declare function tapAfterEnvironmentToPatchWatching(compiler: webpack.Compiler, state: ForkTsCheckerWebpackPluginState): void;
4
4
  export { tapAfterEnvironmentToPatchWatching };
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
3
  import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
4
4
  declare function tapDoneToAsyncGetIssues(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
3
3
  declare function tapErrorToLogMessage(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig): void;
4
4
  export { tapErrorToLogMessage };
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
3
3
  import type { RpcWorker } from '../rpc';
4
4
  declare function tapStopToTerminateWorkers(compiler: webpack.Compiler, getIssuesWorker: RpcWorker, getDependenciesWorker: RpcWorker, state: ForkTsCheckerWebpackPluginState): void;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  export interface InfrastructureLogger {
3
3
  log(...args: unknown[]): void;
4
4
  debug(...args: unknown[]): void;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { IssueOptions } from './issue-options';
3
3
  import type { IssuePredicate } from './issue-predicate';
4
4
  interface IssueConfig {
@@ -1,4 +1,4 @@
1
- import webpack from 'webpack';
1
+ import * as webpack from 'webpack';
2
2
  import type { FormatterPathType } from '../formatter';
3
3
  import type { Issue } from './issue';
4
4
  declare class IssueWebpackError extends webpack.WebpackError {
@@ -1,4 +1,23 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
2
21
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
23
  };
@@ -6,11 +25,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
25
  exports.IssueWebpackError = void 0;
7
26
  const path_1 = __importDefault(require("path"));
8
27
  const chalk_1 = __importDefault(require("chalk"));
9
- const webpack_1 = __importDefault(require("webpack"));
28
+ const webpack = __importStar(require("webpack"));
10
29
  const forward_slash_1 = require("../utils/path/forward-slash");
11
30
  const relative_to_context_1 = require("../utils/path/relative-to-context");
12
31
  const issue_location_1 = require("./issue-location");
13
- class IssueWebpackError extends webpack_1.default.WebpackError {
32
+ class IssueWebpackError extends webpack.WebpackError {
14
33
  constructor(message, pathType, issue) {
15
34
  super(message);
16
35
  this.issue = issue;
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { FormatterConfig } from './formatter';
3
3
  import type { IssueConfig } from './issue/issue-config';
4
4
  import type { Logger } from './logger';
package/lib/plugin.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { ForkTsCheckerWebpackPluginOptions } from './plugin-options';
3
3
  declare class ForkTsCheckerWebpackPlugin {
4
4
  /**
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 = '8.0.0'; // will be replaced by the @semantic-release/exec
73
+ ForkTsCheckerWebpackPlugin.version = '9.0.1'; // will be replaced by the @semantic-release/exec
74
74
  /**
75
75
  * Default pools for the plugin concurrency limit
76
76
  */
@@ -1,4 +1,4 @@
1
- import type webpack from 'webpack';
1
+ import type * as webpack from 'webpack';
2
2
  import type { TypeScriptConfigOverwrite } from './type-script-config-overwrite';
3
3
  import type { TypeScriptDiagnosticsOptions } from './type-script-diagnostics-options';
4
4
  import type { TypeScriptWorkerOptions } from './type-script-worker-options';
@@ -43,17 +43,32 @@ function invalidateDiagnostics() {
43
43
  exports.invalidateDiagnostics = invalidateDiagnostics;
44
44
  function getDiagnosticsOfProgram(program) {
45
45
  const programDiagnostics = [];
46
- if (worker_config_1.config.diagnosticOptions.syntactic) {
47
- programDiagnostics.push(...program.getSyntacticDiagnostics());
48
- }
49
- if (worker_config_1.config.diagnosticOptions.global) {
50
- programDiagnostics.push(...program.getGlobalDiagnostics());
51
- }
52
- if (worker_config_1.config.diagnosticOptions.semantic) {
53
- programDiagnostics.push(...program.getSemanticDiagnostics());
46
+ try {
47
+ if (worker_config_1.config.diagnosticOptions.syntactic) {
48
+ programDiagnostics.push(...program.getSyntacticDiagnostics());
49
+ }
50
+ if (worker_config_1.config.diagnosticOptions.global) {
51
+ programDiagnostics.push(...program.getGlobalDiagnostics());
52
+ }
53
+ if (worker_config_1.config.diagnosticOptions.semantic) {
54
+ programDiagnostics.push(...program.getSemanticDiagnostics());
55
+ }
56
+ if (worker_config_1.config.diagnosticOptions.declaration) {
57
+ programDiagnostics.push(...program.getDeclarationDiagnostics());
58
+ }
54
59
  }
55
- if (worker_config_1.config.diagnosticOptions.declaration) {
56
- programDiagnostics.push(...program.getDeclarationDiagnostics());
60
+ catch (e) {
61
+ if (e instanceof Error) {
62
+ programDiagnostics.push({
63
+ code: 1,
64
+ category: 1,
65
+ messageText: `TSC compiler crashed: ${e.message}
66
+ ${e.stack}`,
67
+ file: undefined,
68
+ start: undefined,
69
+ length: undefined,
70
+ });
71
+ }
57
72
  }
58
73
  return programDiagnostics;
59
74
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { EventEmitter } from 'events';
3
- import type webpack from 'webpack';
3
+ import type * as webpack from 'webpack';
4
4
  interface Watchpack extends EventEmitter {
5
5
  _onChange(item: string, mtime: number, file: string, type?: string): void;
6
6
  _onRemove(item: string, 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": "8.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "webpack",