fork-ts-checker-webpack-plugin 6.3.0 → 6.3.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
|
@@ -362,24 +362,37 @@ When we call this method with a [webpack compiler instance](https://webpack.js.o
|
|
|
362
362
|
[tapable](https://github.com/webpack/tapable) hooks where you can pass in your callbacks.
|
|
363
363
|
|
|
364
364
|
```js
|
|
365
|
-
|
|
365
|
+
// ./src/webpack/MyWebpackPlugin.js
|
|
366
366
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
367
367
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
class MyWebpackPlugin {
|
|
369
|
+
apply(compiler) {
|
|
370
|
+
const hooks = ForkTsCheckerWebpackPlugin.getCompilerHooks(compiler);
|
|
371
|
+
|
|
372
|
+
// log some message on waiting
|
|
373
|
+
hooks.waiting.tap('MyPlugin', () => {
|
|
374
|
+
console.log('waiting for issues');
|
|
375
|
+
});
|
|
376
|
+
// don't show warnings
|
|
377
|
+
hooks.issues.tap('MyPlugin', (issues) =>
|
|
378
|
+
issues.filter((issue) => issue.severity === 'error')
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
371
382
|
|
|
372
|
-
|
|
373
|
-
// **don't do this if already added through configuration**
|
|
374
|
-
new ForkTsCheckerWebpackPlugin().apply(compiler);
|
|
383
|
+
module.exports = MyWebpackPlugin;
|
|
375
384
|
|
|
376
|
-
//
|
|
377
|
-
const
|
|
385
|
+
// webpack.config.js
|
|
386
|
+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
387
|
+
const MyWebpackPlugin = require('./src/webpack/MyWebpackPlugin');
|
|
378
388
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
389
|
+
module.exports = {
|
|
390
|
+
/* ... */
|
|
391
|
+
plugins: [
|
|
392
|
+
new ForkTsCheckerWebpackPlugin(),
|
|
393
|
+
new MyWebpackPlugin()
|
|
394
|
+
]
|
|
395
|
+
};
|
|
383
396
|
```
|
|
384
397
|
|
|
385
398
|
## Typings
|
|
@@ -397,7 +410,7 @@ yarn add --dev @types/webpack
|
|
|
397
410
|
|
|
398
411
|
## Profiling types resolution
|
|
399
412
|
|
|
400
|
-
Starting from TypeScript 4.1.0
|
|
413
|
+
Starting from TypeScript 4.1.0, you can profile long type checks by
|
|
401
414
|
setting "generateTrace" compiler option. This is an instruction from [microsoft/TypeScript#40063](https://github.com/microsoft/TypeScript/pull/40063):
|
|
402
415
|
|
|
403
416
|
1. Set "generateTrace": "{folderName}" in your `tsconfig.json`
|
|
@@ -76,7 +76,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
|
76
76
|
/**
|
|
77
77
|
* Current version of the plugin
|
|
78
78
|
*/
|
|
79
|
-
ForkTsCheckerWebpackPlugin.version = '6.3.
|
|
79
|
+
ForkTsCheckerWebpackPlugin.version = '6.3.4'; // will be replaced by the @semantic-release/exec
|
|
80
80
|
/**
|
|
81
81
|
* Default pools for the plugin concurrency limit
|
|
82
82
|
*/
|
|
@@ -95,9 +95,18 @@ function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
|
95
95
|
artifacts.extensions.some((extension) => path.endsWith(extension)));
|
|
96
96
|
}
|
|
97
97
|
function getReadFileSystem(path) {
|
|
98
|
-
if (
|
|
99
|
-
(
|
|
100
|
-
|
|
98
|
+
if ((mode === 'readonly' || mode === 'write-tsbuildinfo') && isArtifact(path)) {
|
|
99
|
+
if (isInitialRun && !memFileSystem.exists(path) && passiveFileSystem.exists(path)) {
|
|
100
|
+
// copy file to memory on initial run
|
|
101
|
+
const stats = passiveFileSystem.readStats(path);
|
|
102
|
+
if (stats === null || stats === void 0 ? void 0 : stats.isFile()) {
|
|
103
|
+
const content = passiveFileSystem.readFile(path);
|
|
104
|
+
if (content) {
|
|
105
|
+
memFileSystem.writeFile(path, content);
|
|
106
|
+
memFileSystem.updateTimes(path, stats.atime, stats.mtime);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
101
110
|
return memFileSystem;
|
|
102
111
|
}
|
|
103
112
|
return passiveFileSystem;
|
|
@@ -109,7 +118,10 @@ function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
|
109
118
|
}
|
|
110
119
|
return passiveFileSystem;
|
|
111
120
|
}
|
|
112
|
-
const controlledSystem = Object.assign(Object.assign({}, typescript.sys), { useCaseSensitiveFileNames: caseSensitive,
|
|
121
|
+
const controlledSystem = Object.assign(Object.assign({}, typescript.sys), { useCaseSensitiveFileNames: caseSensitive, realpath(path) {
|
|
122
|
+
return getReadFileSystem(path).realPath(path);
|
|
123
|
+
},
|
|
124
|
+
fileExists(path) {
|
|
113
125
|
const stats = getReadFileSystem(path).readStats(path);
|
|
114
126
|
return !!stats && stats.isFile();
|
|
115
127
|
},
|
|
@@ -185,13 +185,12 @@ function createTypeScriptReporter(configuration) {
|
|
|
185
185
|
configurationChanged = true;
|
|
186
186
|
}
|
|
187
187
|
else {
|
|
188
|
-
const
|
|
188
|
+
const previousDependencies = dependencies;
|
|
189
189
|
[parsedConfiguration, parseConfigurationDiagnostics] = parseConfiguration();
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
//
|
|
194
|
-
dependencies = getDependencies();
|
|
190
|
+
dependencies = getDependencies();
|
|
191
|
+
if (previousDependencies &&
|
|
192
|
+
JSON.stringify(previousDependencies) !== JSON.stringify(dependencies)) {
|
|
193
|
+
// dependencies changed - we need to recompute artifacts
|
|
195
194
|
artifacts = getArtifacts();
|
|
196
195
|
shouldUpdateRootFiles = true;
|
|
197
196
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fork-ts-checker-webpack-plugin",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.4",
|
|
4
4
|
"description": "Runs typescript type checker and linter on separate process.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fast",
|
|
@@ -74,6 +74,20 @@
|
|
|
74
74
|
"semver": "^7.3.2",
|
|
75
75
|
"tapable": "^1.0.0"
|
|
76
76
|
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"eslint": ">= 6",
|
|
79
|
+
"typescript": ">= 2.7",
|
|
80
|
+
"webpack": ">= 4",
|
|
81
|
+
"vue-template-compiler": "*"
|
|
82
|
+
},
|
|
83
|
+
"peerDependenciesMeta": {
|
|
84
|
+
"eslint": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"vue-template-compiler": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
77
91
|
"devDependencies": {
|
|
78
92
|
"@commitlint/config-conventional": "^11.0.0",
|
|
79
93
|
"@semantic-release/commit-analyzer": "^8.0.1",
|