@depup/fork-ts-checker-webpack-plugin 9.1.0-depup.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/LICENSE +21 -0
- package/README.md +42 -0
- package/changes.json +54 -0
- package/lib/files-change.d.ts +17 -0
- package/lib/files-change.js +57 -0
- package/lib/files-match.d.ts +7 -0
- package/lib/files-match.js +2 -0
- package/lib/formatter/basic-formatter.d.ts +3 -0
- package/lib/formatter/basic-formatter.js +13 -0
- package/lib/formatter/code-frame-formatter.d.ts +4 -0
- package/lib/formatter/code-frame-formatter.js +29 -0
- package/lib/formatter/formatter-config.d.ts +8 -0
- package/lib/formatter/formatter-config.js +36 -0
- package/lib/formatter/formatter-options.d.ts +14 -0
- package/lib/formatter/formatter-options.js +2 -0
- package/lib/formatter/formatter.d.ts +4 -0
- package/lib/formatter/formatter.js +2 -0
- package/lib/formatter/index.d.ts +6 -0
- package/lib/formatter/index.js +22 -0
- package/lib/formatter/stats-formatter.d.ts +3 -0
- package/lib/formatter/stats-formatter.js +28 -0
- package/lib/formatter/types/babel__code-frame.d.ts +21 -0
- package/lib/formatter/types/babel__code-frame.js +7 -0
- package/lib/formatter/webpack-formatter.d.ts +3 -0
- package/lib/formatter/webpack-formatter.js +32 -0
- package/lib/hooks/intercept-done-to-get-dev-server-tap.d.ts +5 -0
- package/lib/hooks/intercept-done-to-get-dev-server-tap.js +18 -0
- package/lib/hooks/tap-after-compile-to-add-dependencies.d.ts +5 -0
- package/lib/hooks/tap-after-compile-to-add-dependencies.js +31 -0
- package/lib/hooks/tap-after-compile-to-get-issues.d.ts +5 -0
- package/lib/hooks/tap-after-compile-to-get-issues.js +52 -0
- package/lib/hooks/tap-after-environment-to-patch-watching.d.ts +4 -0
- package/lib/hooks/tap-after-environment-to-patch-watching.js +22 -0
- package/lib/hooks/tap-done-to-async-get-issues.d.ts +5 -0
- package/lib/hooks/tap-done-to-async-get-issues.js +86 -0
- package/lib/hooks/tap-error-to-log-message.d.ts +4 -0
- package/lib/hooks/tap-error-to-log-message.js +32 -0
- package/lib/hooks/tap-start-to-run-workers.d.ts +8 -0
- package/lib/hooks/tap-start-to-run-workers.js +132 -0
- package/lib/hooks/tap-stop-to-terminate-workers.d.ts +5 -0
- package/lib/hooks/tap-stop-to-terminate-workers.js +26 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/infrastructure-logger.d.ts +9 -0
- package/lib/infrastructure-logger.js +14 -0
- package/lib/issue/index.d.ts +3 -0
- package/lib/issue/index.js +19 -0
- package/lib/issue/issue-config.d.ts +8 -0
- package/lib/issue/issue-config.js +29 -0
- package/lib/issue/issue-location.d.ts +8 -0
- package/lib/issue/issue-location.js +22 -0
- package/lib/issue/issue-match.d.ts +5 -0
- package/lib/issue/issue-match.js +20 -0
- package/lib/issue/issue-options.d.ts +8 -0
- package/lib/issue/issue-options.js +2 -0
- package/lib/issue/issue-position.d.ts +6 -0
- package/lib/issue/issue-position.js +16 -0
- package/lib/issue/issue-predicate.d.ts +5 -0
- package/lib/issue/issue-predicate.js +11 -0
- package/lib/issue/issue-severity.d.ts +4 -0
- package/lib/issue/issue-severity.js +12 -0
- package/lib/issue/issue-webpack-error.d.ts +9 -0
- package/lib/issue/issue-webpack-error.js +55 -0
- package/lib/issue/issue.d.ts +12 -0
- package/lib/issue/issue.js +41 -0
- package/lib/logger.d.ts +5 -0
- package/lib/logger.js +2 -0
- package/lib/plugin-config.d.ts +16 -0
- package/lib/plugin-config.js +26 -0
- package/lib/plugin-hooks.d.ts +20 -0
- package/lib/plugin-hooks.js +45 -0
- package/lib/plugin-options.d.ts +13 -0
- package/lib/plugin-options.js +2 -0
- package/lib/plugin-options.json +197 -0
- package/lib/plugin-pools.d.ts +4 -0
- package/lib/plugin-pools.js +32 -0
- package/lib/plugin-state.d.ts +18 -0
- package/lib/plugin-state.js +17 -0
- package/lib/plugin.d.ts +28 -0
- package/lib/plugin.js +86 -0
- package/lib/rpc/expose-rpc.d.ts +1 -0
- package/lib/rpc/expose-rpc.js +78 -0
- package/lib/rpc/index.d.ts +5 -0
- package/lib/rpc/index.js +12 -0
- package/lib/rpc/rpc-error.d.ts +6 -0
- package/lib/rpc/rpc-error.js +12 -0
- package/lib/rpc/rpc-worker.d.ts +13 -0
- package/lib/rpc/rpc-worker.js +83 -0
- package/lib/rpc/types.d.ts +19 -0
- package/lib/rpc/types.js +2 -0
- package/lib/rpc/wrap-rpc.d.ts +4 -0
- package/lib/rpc/wrap-rpc.js +79 -0
- package/lib/typescript/type-script-config-overwrite.d.ts +12 -0
- package/lib/typescript/type-script-config-overwrite.js +2 -0
- package/lib/typescript/type-script-diagnostics-options.d.ts +7 -0
- package/lib/typescript/type-script-diagnostics-options.js +2 -0
- package/lib/typescript/type-script-support.d.ts +3 -0
- package/lib/typescript/type-script-support.js +67 -0
- package/lib/typescript/type-script-worker-config.d.ts +17 -0
- package/lib/typescript/type-script-worker-config.js +18 -0
- package/lib/typescript/type-script-worker-options.d.ts +14 -0
- package/lib/typescript/type-script-worker-options.js +2 -0
- package/lib/typescript/worker/get-dependencies-worker.d.ts +5 -0
- package/lib/typescript/worker/get-dependencies-worker.js +15 -0
- package/lib/typescript/worker/get-issues-worker.d.ts +5 -0
- package/lib/typescript/worker/get-issues-worker.js +80 -0
- package/lib/typescript/worker/lib/artifacts.d.ts +4 -0
- package/lib/typescript/worker/lib/artifacts.js +94 -0
- package/lib/typescript/worker/lib/config.d.ts +15 -0
- package/lib/typescript/worker/lib/config.js +135 -0
- package/lib/typescript/worker/lib/dependencies.d.ts +3 -0
- package/lib/typescript/worker/lib/dependencies.js +85 -0
- package/lib/typescript/worker/lib/diagnostics.d.ts +7 -0
- package/lib/typescript/worker/lib/diagnostics.js +112 -0
- package/lib/typescript/worker/lib/emit.d.ts +2 -0
- package/lib/typescript/worker/lib/emit.js +13 -0
- package/lib/typescript/worker/lib/file-system/file-system.d.ts +18 -0
- package/lib/typescript/worker/lib/file-system/file-system.js +2 -0
- package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +78 -0
- package/lib/typescript/worker/lib/file-system/passive-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/passive-file-system.js +65 -0
- package/lib/typescript/worker/lib/file-system/real-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/real-file-system.js +191 -0
- package/lib/typescript/worker/lib/host/compiler-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/compiler-host.js +10 -0
- package/lib/typescript/worker/lib/host/watch-compiler-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/watch-compiler-host.js +20 -0
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +47 -0
- package/lib/typescript/worker/lib/performance.d.ts +3 -0
- package/lib/typescript/worker/lib/performance.js +32 -0
- package/lib/typescript/worker/lib/program/program.d.ts +2 -0
- package/lib/typescript/worker/lib/program/program.js +37 -0
- package/lib/typescript/worker/lib/program/solution-builder.d.ts +2 -0
- package/lib/typescript/worker/lib/program/solution-builder.js +39 -0
- package/lib/typescript/worker/lib/program/watch-program.d.ts +3 -0
- package/lib/typescript/worker/lib/program/watch-program.js +51 -0
- package/lib/typescript/worker/lib/system.d.ts +19 -0
- package/lib/typescript/worker/lib/system.js +232 -0
- package/lib/typescript/worker/lib/tracing.d.ts +4 -0
- package/lib/typescript/worker/lib/tracing.js +29 -0
- package/lib/typescript/worker/lib/tsbuildinfo.d.ts +4 -0
- package/lib/typescript/worker/lib/tsbuildinfo.js +96 -0
- package/lib/typescript/worker/lib/typescript.d.ts +2 -0
- package/lib/typescript/worker/lib/typescript.js +6 -0
- package/lib/typescript/worker/lib/worker-config.d.ts +2 -0
- package/lib/typescript/worker/lib/worker-config.js +5 -0
- package/lib/utils/async/abort-error.d.ts +6 -0
- package/lib/utils/async/abort-error.js +15 -0
- package/lib/utils/async/controlled-promise.d.ts +6 -0
- package/lib/utils/async/controlled-promise.js +17 -0
- package/lib/utils/async/is-pending.d.ts +2 -0
- package/lib/utils/async/is-pending.js +10 -0
- package/lib/utils/async/pool.d.ts +10 -0
- package/lib/utils/async/pool.js +47 -0
- package/lib/utils/async/wait.d.ts +2 -0
- package/lib/utils/async/wait.js +7 -0
- package/lib/utils/path/forward-slash.d.ts +6 -0
- package/lib/utils/path/forward-slash.js +15 -0
- package/lib/utils/path/is-inside-another-path.d.ts +2 -0
- package/lib/utils/path/is-inside-another-path.js +22 -0
- package/lib/utils/path/relative-to-context.d.ts +2 -0
- package/lib/utils/path/relative-to-context.js +16 -0
- package/lib/watch/inclusive-node-watch-file-system.d.ts +15 -0
- package/lib/watch/inclusive-node-watch-file-system.js +166 -0
- package/lib/watch/watch-file-system.d.ts +16 -0
- package/lib/watch/watch-file-system.js +2 -0
- package/package.json +182 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 TypeStrong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @depup/fork-ts-checker-webpack-plugin
|
|
2
|
+
|
|
3
|
+
> Dependency-bumped version of [fork-ts-checker-webpack-plugin](https://www.npmjs.com/package/fork-ts-checker-webpack-plugin)
|
|
4
|
+
|
|
5
|
+
Generated by [DepUp](https://github.com/depup/npm) -- all production
|
|
6
|
+
dependencies bumped to latest versions.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @depup/fork-ts-checker-webpack-plugin
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Field | Value |
|
|
15
|
+
|-------|-------|
|
|
16
|
+
| Original | [fork-ts-checker-webpack-plugin](https://www.npmjs.com/package/fork-ts-checker-webpack-plugin) @ 9.1.0 |
|
|
17
|
+
| Processed | 2026-03-17 |
|
|
18
|
+
| Smoke test | failed |
|
|
19
|
+
| Deps updated | 12 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| @babel/code-frame | ^7.16.7 | ^7.29.0 |
|
|
26
|
+
| chalk | ^4.1.2 | ^5.6.2 |
|
|
27
|
+
| chokidar | ^4.0.1 | ^5.0.0 |
|
|
28
|
+
| cosmiconfig | ^8.2.0 | ^9.0.1 |
|
|
29
|
+
| deepmerge | ^4.2.2 | ^4.3.1 |
|
|
30
|
+
| fs-extra | ^10.0.0 | ^11.3.4 |
|
|
31
|
+
| memfs | ^3.4.1 | ^4.56.11 |
|
|
32
|
+
| minimatch | ^3.0.4 | ^10.2.4 |
|
|
33
|
+
| node-abort-controller | ^3.0.1 | ^3.1.1 |
|
|
34
|
+
| schema-utils | ^3.1.1 | ^4.3.3 |
|
|
35
|
+
| semver | ^7.3.5 | ^7.7.4 |
|
|
36
|
+
| tapable | ^2.2.1 | ^2.3.0 |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/fork-ts-checker-webpack-plugin
|
|
41
|
+
|
|
42
|
+
License inherited from the original package.
|
package/changes.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bumped": {
|
|
3
|
+
"@babel/code-frame": {
|
|
4
|
+
"from": "^7.16.7",
|
|
5
|
+
"to": "^7.29.0"
|
|
6
|
+
},
|
|
7
|
+
"chalk": {
|
|
8
|
+
"from": "^4.1.2",
|
|
9
|
+
"to": "^5.6.2"
|
|
10
|
+
},
|
|
11
|
+
"chokidar": {
|
|
12
|
+
"from": "^4.0.1",
|
|
13
|
+
"to": "^5.0.0"
|
|
14
|
+
},
|
|
15
|
+
"cosmiconfig": {
|
|
16
|
+
"from": "^8.2.0",
|
|
17
|
+
"to": "^9.0.1"
|
|
18
|
+
},
|
|
19
|
+
"deepmerge": {
|
|
20
|
+
"from": "^4.2.2",
|
|
21
|
+
"to": "^4.3.1"
|
|
22
|
+
},
|
|
23
|
+
"fs-extra": {
|
|
24
|
+
"from": "^10.0.0",
|
|
25
|
+
"to": "^11.3.4"
|
|
26
|
+
},
|
|
27
|
+
"memfs": {
|
|
28
|
+
"from": "^3.4.1",
|
|
29
|
+
"to": "^4.56.11"
|
|
30
|
+
},
|
|
31
|
+
"minimatch": {
|
|
32
|
+
"from": "^3.0.4",
|
|
33
|
+
"to": "^10.2.4"
|
|
34
|
+
},
|
|
35
|
+
"node-abort-controller": {
|
|
36
|
+
"from": "^3.0.1",
|
|
37
|
+
"to": "^3.1.1"
|
|
38
|
+
},
|
|
39
|
+
"schema-utils": {
|
|
40
|
+
"from": "^3.1.1",
|
|
41
|
+
"to": "^4.3.3"
|
|
42
|
+
},
|
|
43
|
+
"semver": {
|
|
44
|
+
"from": "^7.3.5",
|
|
45
|
+
"to": "^7.7.4"
|
|
46
|
+
},
|
|
47
|
+
"tapable": {
|
|
48
|
+
"from": "^2.2.1",
|
|
49
|
+
"to": "^2.3.0"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"timestamp": "2026-03-17T16:36:07.241Z",
|
|
53
|
+
"totalUpdated": 12
|
|
54
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
interface FilesChange {
|
|
3
|
+
changedFiles?: string[];
|
|
4
|
+
deletedFiles?: string[];
|
|
5
|
+
}
|
|
6
|
+
declare function getFilesChange(compiler: webpack.Compiler): FilesChange;
|
|
7
|
+
declare function consumeFilesChange(compiler: webpack.Compiler): FilesChange;
|
|
8
|
+
declare function updateFilesChange(compiler: webpack.Compiler, change: FilesChange): void;
|
|
9
|
+
declare function clearFilesChange(compiler: webpack.Compiler): void;
|
|
10
|
+
/**
|
|
11
|
+
* Computes aggregated files change based on the subsequent files changes.
|
|
12
|
+
*
|
|
13
|
+
* @param changes List of subsequent files changes
|
|
14
|
+
* @returns Files change that represents all subsequent changes as a one event
|
|
15
|
+
*/
|
|
16
|
+
declare function aggregateFilesChanges(changes: FilesChange[]): FilesChange;
|
|
17
|
+
export { FilesChange, getFilesChange, consumeFilesChange, updateFilesChange, clearFilesChange, aggregateFilesChanges, };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aggregateFilesChanges = exports.clearFilesChange = exports.updateFilesChange = exports.consumeFilesChange = exports.getFilesChange = void 0;
|
|
4
|
+
// we ignore package.json file because of https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/674
|
|
5
|
+
const IGNORED_FILES = ['package.json'];
|
|
6
|
+
const isIgnoredFile = (file) => IGNORED_FILES.some((ignoredFile) => file.endsWith(`/${ignoredFile}`) || file.endsWith(`\\${ignoredFile}`));
|
|
7
|
+
const compilerFilesChangeMap = new WeakMap();
|
|
8
|
+
function getFilesChange(compiler) {
|
|
9
|
+
const { changedFiles = [], deletedFiles = [] } = compilerFilesChangeMap.get(compiler) || {
|
|
10
|
+
changedFiles: [],
|
|
11
|
+
deletedFiles: [],
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
changedFiles: changedFiles.filter((changedFile) => !isIgnoredFile(changedFile)),
|
|
15
|
+
deletedFiles: deletedFiles.filter((deletedFile) => !isIgnoredFile(deletedFile)),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.getFilesChange = getFilesChange;
|
|
19
|
+
function consumeFilesChange(compiler) {
|
|
20
|
+
const change = getFilesChange(compiler);
|
|
21
|
+
clearFilesChange(compiler);
|
|
22
|
+
return change;
|
|
23
|
+
}
|
|
24
|
+
exports.consumeFilesChange = consumeFilesChange;
|
|
25
|
+
function updateFilesChange(compiler, change) {
|
|
26
|
+
compilerFilesChangeMap.set(compiler, aggregateFilesChanges([getFilesChange(compiler), change]));
|
|
27
|
+
}
|
|
28
|
+
exports.updateFilesChange = updateFilesChange;
|
|
29
|
+
function clearFilesChange(compiler) {
|
|
30
|
+
compilerFilesChangeMap.delete(compiler);
|
|
31
|
+
}
|
|
32
|
+
exports.clearFilesChange = clearFilesChange;
|
|
33
|
+
/**
|
|
34
|
+
* Computes aggregated files change based on the subsequent files changes.
|
|
35
|
+
*
|
|
36
|
+
* @param changes List of subsequent files changes
|
|
37
|
+
* @returns Files change that represents all subsequent changes as a one event
|
|
38
|
+
*/
|
|
39
|
+
function aggregateFilesChanges(changes) {
|
|
40
|
+
const changedFilesSet = new Set();
|
|
41
|
+
const deletedFilesSet = new Set();
|
|
42
|
+
for (const { changedFiles = [], deletedFiles = [] } of changes) {
|
|
43
|
+
for (const changedFile of changedFiles) {
|
|
44
|
+
changedFilesSet.add(changedFile);
|
|
45
|
+
deletedFilesSet.delete(changedFile);
|
|
46
|
+
}
|
|
47
|
+
for (const deletedFile of deletedFiles) {
|
|
48
|
+
changedFilesSet.delete(deletedFile);
|
|
49
|
+
deletedFilesSet.add(deletedFile);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
changedFiles: Array.from(changedFilesSet),
|
|
54
|
+
deletedFiles: Array.from(deletedFilesSet),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.aggregateFilesChanges = aggregateFilesChanges;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createBasicFormatter = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
function createBasicFormatter() {
|
|
9
|
+
return function basicFormatter(issue) {
|
|
10
|
+
return chalk_1.default.grey(issue.code + ': ') + issue.message;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.createBasicFormatter = createBasicFormatter;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createCodeFrameFormatter = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const code_frame_1 = require("@babel/code-frame");
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const basic_formatter_1 = require("./basic-formatter");
|
|
11
|
+
function createCodeFrameFormatter(options) {
|
|
12
|
+
const basicFormatter = (0, basic_formatter_1.createBasicFormatter)();
|
|
13
|
+
return function codeFrameFormatter(issue) {
|
|
14
|
+
const source = issue.file && fs_extra_1.default.existsSync(issue.file) && fs_extra_1.default.readFileSync(issue.file, 'utf-8');
|
|
15
|
+
let frame = '';
|
|
16
|
+
if (source && issue.location) {
|
|
17
|
+
frame = (0, code_frame_1.codeFrameColumns)(source, issue.location, Object.assign({ highlightCode: true }, (options || {})))
|
|
18
|
+
.split('\n')
|
|
19
|
+
.map((line) => ' ' + line)
|
|
20
|
+
.join(os_1.default.EOL);
|
|
21
|
+
}
|
|
22
|
+
const lines = [basicFormatter(issue)];
|
|
23
|
+
if (frame) {
|
|
24
|
+
lines.push(frame);
|
|
25
|
+
}
|
|
26
|
+
return lines.join(os_1.default.EOL);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createCodeFrameFormatter = createCodeFrameFormatter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Formatter, FormatterPathType } from './formatter';
|
|
2
|
+
import type { FormatterOptions } from './formatter-options';
|
|
3
|
+
type FormatterConfig = {
|
|
4
|
+
format: Formatter;
|
|
5
|
+
pathType: FormatterPathType;
|
|
6
|
+
};
|
|
7
|
+
declare function createFormatterConfig(options: FormatterOptions | undefined): FormatterConfig;
|
|
8
|
+
export { FormatterConfig, createFormatterConfig };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFormatterConfig = void 0;
|
|
4
|
+
const basic_formatter_1 = require("./basic-formatter");
|
|
5
|
+
const code_frame_formatter_1 = require("./code-frame-formatter");
|
|
6
|
+
function createFormatterConfig(options) {
|
|
7
|
+
if (typeof options === 'function') {
|
|
8
|
+
return {
|
|
9
|
+
format: options,
|
|
10
|
+
pathType: 'relative',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const type = options
|
|
14
|
+
? typeof options === 'object'
|
|
15
|
+
? options.type || 'codeframe'
|
|
16
|
+
: options
|
|
17
|
+
: 'codeframe';
|
|
18
|
+
const pathType = options && typeof options === 'object' ? options.pathType || 'relative' : 'relative';
|
|
19
|
+
if (!type || type === 'basic') {
|
|
20
|
+
return {
|
|
21
|
+
format: (0, basic_formatter_1.createBasicFormatter)(),
|
|
22
|
+
pathType,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (type === 'codeframe') {
|
|
26
|
+
const config = options && typeof options === 'object'
|
|
27
|
+
? options.options || {}
|
|
28
|
+
: {};
|
|
29
|
+
return {
|
|
30
|
+
format: (0, code_frame_formatter_1.createCodeFrameFormatter)(config),
|
|
31
|
+
pathType,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`Unknown "${type}" formatter. Available types are: "basic", "codeframe" or a custom function.`);
|
|
35
|
+
}
|
|
36
|
+
exports.createFormatterConfig = createFormatterConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Formatter, FormatterPathType } from './formatter';
|
|
2
|
+
import type { BabelCodeFrameOptions } from './types/babel__code-frame';
|
|
3
|
+
type FormatterType = 'basic' | 'codeframe';
|
|
4
|
+
type BasicFormatterOptions = {
|
|
5
|
+
type: 'basic';
|
|
6
|
+
pathType?: FormatterPathType;
|
|
7
|
+
};
|
|
8
|
+
type CodeframeFormatterOptions = {
|
|
9
|
+
type: 'codeframe';
|
|
10
|
+
pathType?: FormatterPathType;
|
|
11
|
+
options?: BabelCodeFrameOptions;
|
|
12
|
+
};
|
|
13
|
+
type FormatterOptions = undefined | FormatterType | BasicFormatterOptions | CodeframeFormatterOptions | Formatter;
|
|
14
|
+
export { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./formatter"), exports);
|
|
18
|
+
__exportStar(require("./basic-formatter"), exports);
|
|
19
|
+
__exportStar(require("./code-frame-formatter"), exports);
|
|
20
|
+
__exportStar(require("./webpack-formatter"), exports);
|
|
21
|
+
__exportStar(require("./formatter-options"), exports);
|
|
22
|
+
__exportStar(require("./formatter-config"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.statsFormatter = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
// mimics webpack's stats summary formatter
|
|
9
|
+
function statsFormatter(issues, stats) {
|
|
10
|
+
const errorsNumber = issues.filter((issue) => issue.severity === 'error').length;
|
|
11
|
+
const warningsNumber = issues.filter((issue) => issue.severity === 'warning').length;
|
|
12
|
+
const errorsFormatted = errorsNumber
|
|
13
|
+
? chalk_1.default.red.bold(`${errorsNumber} ${errorsNumber === 1 ? 'error' : 'errors'}`)
|
|
14
|
+
: '';
|
|
15
|
+
const warningsFormatted = warningsNumber
|
|
16
|
+
? chalk_1.default.yellow.bold(`${warningsNumber} ${warningsNumber === 1 ? 'warning' : 'warnings'}`)
|
|
17
|
+
: '';
|
|
18
|
+
const timeFormatted = Math.round(Date.now() - stats.startTime);
|
|
19
|
+
return [
|
|
20
|
+
'Found ',
|
|
21
|
+
errorsFormatted,
|
|
22
|
+
errorsFormatted && warningsFormatted ? ' and ' : '',
|
|
23
|
+
warningsFormatted,
|
|
24
|
+
` in ${timeFormatted} ms`,
|
|
25
|
+
'.',
|
|
26
|
+
].join('');
|
|
27
|
+
}
|
|
28
|
+
exports.statsFormatter = statsFormatter;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface BabelCodeFrameOptions {
|
|
2
|
+
/** Syntax highlight the code as JavaScript for terminals. default: false */
|
|
3
|
+
highlightCode?: boolean;
|
|
4
|
+
/** The number of lines to show above the error. default: 2 */
|
|
5
|
+
linesAbove?: number;
|
|
6
|
+
/** The number of lines to show below the error. default: 3 */
|
|
7
|
+
linesBelow?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Forcibly syntax highlight the code as JavaScript (for non-terminals);
|
|
10
|
+
* overrides highlightCode.
|
|
11
|
+
* default: false
|
|
12
|
+
*/
|
|
13
|
+
forceColor?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Pass in a string to be displayed inline (if possible) next to the
|
|
16
|
+
* highlighted location in the code. If it can't be positioned inline,
|
|
17
|
+
* it will be placed above the code frame.
|
|
18
|
+
* default: nothing
|
|
19
|
+
*/
|
|
20
|
+
message?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Base on the type definitions for @babel/code-frame 7.0
|
|
3
|
+
// Project: https://github.com/babel/babel/tree/main/packages/babel-code-frame, https://babeljs.io
|
|
4
|
+
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
|
|
5
|
+
// Forbes Lindesay <https://github.com/ForbesLindesay>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createWebpackFormatter = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const issue_1 = require("../issue");
|
|
11
|
+
const forward_slash_1 = require("../utils/path/forward-slash");
|
|
12
|
+
const relative_to_context_1 = require("../utils/path/relative-to-context");
|
|
13
|
+
function createWebpackFormatter(formatter, pathType) {
|
|
14
|
+
// mimics webpack error formatter
|
|
15
|
+
return function webpackFormatter(issue) {
|
|
16
|
+
const color = issue.severity === 'warning' ? chalk_1.default.yellow.bold : chalk_1.default.red.bold;
|
|
17
|
+
const severity = issue.severity.toUpperCase();
|
|
18
|
+
if (issue.file) {
|
|
19
|
+
let location = chalk_1.default.bold(pathType === 'absolute'
|
|
20
|
+
? (0, forward_slash_1.forwardSlash)(path_1.default.resolve(issue.file))
|
|
21
|
+
: (0, relative_to_context_1.relativeToContext)(issue.file, process.cwd()));
|
|
22
|
+
if (issue.location) {
|
|
23
|
+
location += `:${chalk_1.default.green.bold((0, issue_1.formatIssueLocation)(issue.location))}`;
|
|
24
|
+
}
|
|
25
|
+
return [`${color(severity)} in ${location}`, formatter(issue), ''].join(os_1.default.EOL);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return [`${color(severity)} in ` + formatter(issue), ''].join(os_1.default.EOL);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.createWebpackFormatter = createWebpackFormatter;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
4
|
+
declare function interceptDoneToGetDevServerTap(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
+
export { interceptDoneToGetDevServerTap };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interceptDoneToGetDevServerTap = void 0;
|
|
4
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
5
|
+
function interceptDoneToGetDevServerTap(compiler, config, state) {
|
|
6
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
7
|
+
// inspired by https://github.com/ypresto/fork-ts-checker-async-overlay-webpack-plugin
|
|
8
|
+
compiler.hooks.done.intercept({
|
|
9
|
+
register: (tap) => {
|
|
10
|
+
if (tap.name === 'webpack-dev-server' && tap.type === 'sync' && config.devServer) {
|
|
11
|
+
debug('Intercepting webpack-dev-server tap.');
|
|
12
|
+
state.webpackDevServerDoneTap = tap;
|
|
13
|
+
}
|
|
14
|
+
return tap;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.interceptDoneToGetDevServerTap = interceptDoneToGetDevServerTap;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
4
|
+
declare function tapAfterCompileToAddDependencies(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
+
export { tapAfterCompileToAddDependencies };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.tapAfterCompileToAddDependencies = void 0;
|
|
13
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
14
|
+
function tapAfterCompileToAddDependencies(compiler, config, state) {
|
|
15
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
16
|
+
compiler.hooks.afterCompile.tapPromise('ForkTsCheckerWebpackPlugin', (compilation) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
if (compilation.compiler !== compiler) {
|
|
18
|
+
// run only for the compiler that the plugin was registered for
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const dependencies = yield state.dependenciesPromise;
|
|
22
|
+
debug(`Got dependencies from the getDependenciesWorker.`, dependencies);
|
|
23
|
+
if (dependencies) {
|
|
24
|
+
state.lastDependencies = dependencies;
|
|
25
|
+
dependencies.files.forEach((file) => {
|
|
26
|
+
compilation.fileDependencies.add(file);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
exports.tapAfterCompileToAddDependencies = tapAfterCompileToAddDependencies;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
4
|
+
declare function tapAfterCompileToGetIssues(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
+
export { tapAfterCompileToGetIssues };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.tapAfterCompileToGetIssues = void 0;
|
|
13
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
14
|
+
const issue_webpack_error_1 = require("../issue/issue-webpack-error");
|
|
15
|
+
const plugin_hooks_1 = require("../plugin-hooks");
|
|
16
|
+
function tapAfterCompileToGetIssues(compiler, config, state) {
|
|
17
|
+
const hooks = (0, plugin_hooks_1.getPluginHooks)(compiler);
|
|
18
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
19
|
+
compiler.hooks.afterCompile.tapPromise('ForkTsCheckerWebpackPlugin', (compilation) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
if (compilation.compiler !== compiler) {
|
|
21
|
+
// run only for the compiler that the plugin was registered for
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let issues = [];
|
|
25
|
+
try {
|
|
26
|
+
issues = yield state.issuesPromise;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
hooks.error.call(error, compilation);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
debug('Got issues from getIssuesWorker.', issues === null || issues === void 0 ? void 0 : issues.length);
|
|
33
|
+
if (!issues) {
|
|
34
|
+
// some error has been thrown or it was canceled
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// filter list of issues by provided issue predicate
|
|
38
|
+
issues = issues.filter(config.issue.predicate);
|
|
39
|
+
// modify list of issues in the plugin hooks
|
|
40
|
+
issues = hooks.issues.call(issues, compilation);
|
|
41
|
+
issues.forEach((issue) => {
|
|
42
|
+
const error = new issue_webpack_error_1.IssueWebpackError(config.formatter.format(issue), config.formatter.pathType, issue);
|
|
43
|
+
if (issue.severity === 'warning') {
|
|
44
|
+
compilation.warnings.push(error);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
compilation.errors.push(error);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
exports.tapAfterCompileToGetIssues = tapAfterCompileToGetIssues;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
3
|
+
declare function tapAfterEnvironmentToPatchWatching(compiler: webpack.Compiler, state: ForkTsCheckerWebpackPluginState): void;
|
|
4
|
+
export { tapAfterEnvironmentToPatchWatching };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tapAfterEnvironmentToPatchWatching = void 0;
|
|
4
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
5
|
+
const inclusive_node_watch_file_system_1 = require("../watch/inclusive-node-watch-file-system");
|
|
6
|
+
function tapAfterEnvironmentToPatchWatching(compiler, state) {
|
|
7
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
8
|
+
compiler.hooks.afterEnvironment.tap('ForkTsCheckerWebpackPlugin', () => {
|
|
9
|
+
const watchFileSystem = compiler.watchFileSystem;
|
|
10
|
+
if (watchFileSystem) {
|
|
11
|
+
debug("Overwriting webpack's watch file system.");
|
|
12
|
+
// wrap original watch file system
|
|
13
|
+
compiler.watchFileSystem = new inclusive_node_watch_file_system_1.InclusiveNodeWatchFileSystem(
|
|
14
|
+
// we use some internals here
|
|
15
|
+
watchFileSystem, compiler, state);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
debug('No watch file system found - plugin may not work correctly.');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.tapAfterEnvironmentToPatchWatching = tapAfterEnvironmentToPatchWatching;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as webpack from 'webpack';
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
4
|
+
declare function tapDoneToAsyncGetIssues(compiler: webpack.Compiler, config: ForkTsCheckerWebpackPluginConfig, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
+
export { tapDoneToAsyncGetIssues };
|