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

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
@@ -70,7 +70,7 @@ module.exports = {
70
70
  ## Modules resolution
71
71
 
72
72
  It's very important to be aware that **this plugin uses [TypeScript](https://github.com/Microsoft/TypeScript)'s, not
73
- [webpack](https://github.com/webpack/webpack)'s modules resolution**. It means that you have to setup `tsconfig.json` correctly.
73
+ [webpack](https://github.com/webpack/webpack)'s modules resolution**. It means that you have to setup `tsconfig.json` correctly.
74
74
 
75
75
  > It's because of the performance - with TypeScript's module resolution we don't have to wait for webpack to compile files.
76
76
  >
@@ -83,7 +83,7 @@ you can place your configuration in the:
83
83
  * `"fork-ts-checker"` field in the `package.json`
84
84
  * `.fork-ts-checkerrc` file in JSON or YAML format
85
85
  * `fork-ts-checker.config.js` file exporting a JS object
86
-
86
+
87
87
  Options passed to the plugin constructor will overwrite options from the cosmiconfig (using [deepmerge](https://github.com/TehShrike/deepmerge)).
88
88
 
89
89
  | Name | Type | Default value | Description |
@@ -92,7 +92,7 @@ Options passed to the plugin constructor will overwrite options from the cosmico
92
92
  | `typescript` | `object` | `{}` | See [TypeScript options](#typescript-options). |
93
93
  | `issue` | `object` | `{}` | See [Issues options](#issues-options). |
94
94
  | `formatter` | `string` or `object` or `function` | `codeframe` | Available formatters are `basic`, `codeframe` and a custom `function`. To [configure](https://babeljs.io/docs/en/babel-code-frame#options) `codeframe` formatter, pass object: `{ type: 'codeframe', options: { <coderame options> } }`. |
95
- | `logger` | `{ log: function, error: function }` | `console` | Console-like object to print issues in `async` mode. |
95
+ | `logger` | `{ log: function, error: function }` or `webpack-infrastructure` | `console` | Console-like object to print issues in `async` mode. |
96
96
  | `devServer` | `boolean` | `true` | If set to `false`, errors will not be reported to Webpack Dev Server. |
97
97
 
98
98
  ### TypeScript options
@@ -120,7 +120,7 @@ Options for the TypeScript checker extensions (`typescript.extensions` option ob
120
120
  |----------------|-----------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
121
121
  | `vue` | `object` or `boolean` | `false` | If `true`, it enables Vue [Single File Component](https://vuejs.org/v2/guide/single-file-components.html) support. |
122
122
  | `vue.enabled` | `boolean` | `false` | Same as the `vue` option |
123
- | `vue.compiler` | `string` | `'vue-template-compiler'` | The package name of the compiler that will be used to parse `.vue` files. You can use `'nativescript-vue-template-compiler'` if you use [nativescript-vue](https://github.com/nativescript-vue/nativescript-vue) |
123
+ | `vue.compiler` | `string` | `'vue-template-compiler'` | The package name of the compiler that will be used to parse `.vue` files. You can use `'nativescript-vue-template-compiler'` if you use [nativescript-vue](https://github.com/nativescript-vue/nativescript-vue) |
124
124
 
125
125
  ### Issues options
126
126
 
@@ -184,11 +184,11 @@ To enable Vue.js support, follow these steps:
184
184
  ```sh
185
185
  # with npm
186
186
  npm install --save vue vue-class-component
187
- npm install --save-dev vue-loader ts-loader css-loader vue-template-compiler
187
+ npm install --save-dev vue-loader ts-loader css-loader vue-template-compiler
188
188
 
189
189
  # with yarn
190
190
  yarn add vue vue-class-component
191
- yarn add --dev vue-loader ts-loader css-loader vue-template-compiler
191
+ yarn add --dev vue-loader ts-loader css-loader vue-template-compiler
192
192
  ```
193
193
 
194
194
  2. Add `tsconfig.json` configuration:
@@ -311,7 +311,7 @@ class MyWebpackPlugin {
311
311
  console.log('waiting for issues');
312
312
  });
313
313
  // don't show warnings
314
- hooks.issues.tap('MyPlugin', (issues) =>
314
+ hooks.issues.tap('MyPlugin', (issues) =>
315
315
  issues.filter((issue) => issue.severity === 'error')
316
316
  );
317
317
  }
@@ -335,7 +335,7 @@ module.exports = {
335
335
  ## Typings
336
336
 
337
337
  To use the plugin typings, you have to install `@types/webpack`. It's not included by default to not collide with your
338
- existing typings (`@types/webpack` imports `@types/node`). [It's an old TypeScript issue](https://github.com/microsoft/TypeScript/issues/18588),
338
+ existing typings (`@types/webpack` imports `@types/node`). [It's an old TypeScript issue](https://github.com/microsoft/TypeScript/issues/18588),
339
339
  the alternative is to set `skipLibCheck: true` in the `compilerOptions` 😉
340
340
  ```sh
341
341
  # with npm
@@ -351,7 +351,7 @@ Starting from TypeScript 4.1.0, you can profile long type checks by
351
351
  setting "generateTrace" compiler option. This is an instruction from [microsoft/TypeScript#40063](https://github.com/microsoft/TypeScript/pull/40063):
352
352
 
353
353
  1. Set "generateTrace": "{folderName}" in your `tsconfig.json`
354
- 2. Look in the resulting folder. If you used build mode, there will be a `legend.json` telling you what went where.
354
+ 2. Look in the resulting folder. If you used build mode, there will be a `legend.json` telling you what went where.
355
355
  Otherwise, there will be `trace.json` file and `types.json` files.
356
356
  3. Navigate to [edge://tracing](edge://tracing) or [chrome://tracing](chrome://tracing) and load `trace.json`
357
357
  4. Expand Process 1 with the little triangle in the left sidebar
@@ -361,7 +361,7 @@ setting "generateTrace" compiler option. This is an instruction from [microsoft/
361
361
 
362
362
 
363
363
  ## Related projects
364
-
364
+
365
365
  * [`ts-loader`](https://github.com/TypeStrong/ts-loader) - TypeScript loader for webpack.
366
366
  * [`babel-loader`](https://github.com/babel/babel-loader) - Alternative TypeScript loader for webpack.
367
367
  * [`fork-ts-checker-notifier-webpack-plugin`](https://github.com/johnnyreilly/fork-ts-checker-notifier-webpack-plugin) - Notifies about build status using system notifications (similar to the [webpack-notifier](https://github.com/Turbo87/webpack-notifier)).
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createPluginConfig = void 0;
4
4
  const formatter_1 = require("./formatter");
5
+ const infrastructure_logger_1 = require("./infrastructure-logger");
5
6
  const issue_config_1 = require("./issue/issue-config");
6
7
  const type_script_worker_config_1 = require("./typescript/type-script-worker-config");
7
8
  function createPluginConfig(compiler, options = {}) {
@@ -10,7 +11,15 @@ function createPluginConfig(compiler, options = {}) {
10
11
  typescript: (0, type_script_worker_config_1.createTypeScriptWorkerConfig)(compiler, options.typescript),
11
12
  issue: (0, issue_config_1.createIssueConfig)(compiler, options.issue),
12
13
  formatter: (0, formatter_1.createFormatterConfig)(options.formatter),
13
- logger: options.logger || console,
14
+ logger: options.logger === 'webpack-infrastructure'
15
+ ? (() => {
16
+ const { info, error } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
17
+ return {
18
+ log: info,
19
+ error,
20
+ };
21
+ })()
22
+ : options.logger || console,
14
23
  devServer: options.devServer !== false,
15
24
  };
16
25
  }
@@ -7,7 +7,7 @@ interface ForkTsCheckerWebpackPluginOptions {
7
7
  typescript?: TypeScriptWorkerOptions;
8
8
  formatter?: FormatterOptions;
9
9
  issue?: IssueOptions;
10
- logger?: Logger;
10
+ logger?: Logger | 'webpack-infrastructure';
11
11
  devServer?: boolean;
12
12
  }
13
13
  export { ForkTsCheckerWebpackPluginOptions };
@@ -39,26 +39,18 @@
39
39
  "additionalProperties": true
40
40
  }
41
41
  },
42
- "required": [
43
- "type"
44
- ]
42
+ "required": ["type"]
45
43
  },
46
44
  "FormatterType": {
47
45
  "type": "string",
48
- "enum": [
49
- "basic",
50
- "codeframe"
51
- ]
46
+ "enum": ["basic", "codeframe"]
52
47
  },
53
48
  "IssueMatch": {
54
49
  "type": "object",
55
50
  "properties": {
56
51
  "severity": {
57
52
  "type": "string",
58
- "enum": [
59
- "error",
60
- "warning"
61
- ]
53
+ "enum": ["error", "warning"]
62
54
  },
63
55
  "code": {
64
56
  "type": "string"
@@ -95,15 +87,23 @@
95
87
  ]
96
88
  },
97
89
  "Logger": {
98
- "type": "object",
99
- "properties": {
100
- "error": {
101
- "instanceof": "Function"
90
+ "oneOf": [
91
+ {
92
+ "type": "object",
93
+ "properties": {
94
+ "error": {
95
+ "instanceof": "Function"
96
+ },
97
+ "log": {
98
+ "instanceof": "Function"
99
+ }
100
+ }
102
101
  },
103
- "log": {
104
- "instanceof": "Function"
102
+ {
103
+ "type": "string",
104
+ "enum": ["webpack-infrastructure"]
105
105
  }
106
- }
106
+ ]
107
107
  },
108
108
  "TypeScriptOptions": {
109
109
  "type": "object",
@@ -126,12 +126,7 @@
126
126
  },
127
127
  "mode": {
128
128
  "type": "string",
129
- "enum": [
130
- "readonly",
131
- "write-tsbuildinfo",
132
- "write-dts",
133
- "write-references"
134
- ],
129
+ "enum": ["readonly", "write-tsbuildinfo", "write-dts", "write-references"],
135
130
  "description": "`readonly` keeps all emitted files in memory, `write-tsbuildinfo` which writes only .tsbuildinfo files, `write-dts` writes .tsbuildinfo and type definition files, and `write-references` which writes both .tsbuildinfo and referenced projects output"
136
131
  },
137
132
  "compilerOptions": {
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.1.1'; // will be replaced by the @semantic-release/exec
73
+ ForkTsCheckerWebpackPlugin.version = '7.2.0'; // will be replaced by the @semantic-release/exec
74
74
  /**
75
75
  * Default pools for the plugin concurrency limit
76
76
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fork-ts-checker-webpack-plugin",
3
- "version": "7.1.1",
3
+ "version": "7.2.0",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "webpack",