fork-ts-checker-webpack-plugin 9.2.0 → 10.0.0-alpha.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 +23 -13
- package/lib/formatter/basic-formatter.js +2 -2
- package/lib/formatter/code-frame-formatter.d.ts +3 -2
- package/lib/formatter/code-frame-formatter.js +13 -3
- package/lib/formatter/formatter-config.js +2 -1
- package/lib/formatter/formatter-options.d.ts +1 -1
- package/lib/formatter/stats-formatter.js +3 -3
- package/lib/formatter/webpack-formatter.js +5 -9
- package/lib/hooks/report-issues.d.ts +8 -0
- package/lib/hooks/report-issues.js +22 -0
- package/lib/hooks/tap-after-compile-to-add-dependencies.js +3 -12
- package/lib/hooks/tap-after-compile-to-get-issues.js +6 -27
- package/lib/hooks/tap-done-to-async-get-issues.js +12 -32
- package/lib/hooks/tap-error-to-log-message.js +5 -7
- package/lib/hooks/tap-start-to-run-workers.js +12 -22
- package/lib/issue/issue-webpack-error.js +4 -11
- package/lib/plugin-options.json +4 -8
- package/lib/plugin-state.d.ts +0 -1
- package/lib/plugin.js +23 -23
- package/lib/rpc/expose-rpc.js +5 -14
- package/lib/rpc/rpc-error.js +2 -0
- package/lib/rpc/rpc-worker.d.ts +1 -1
- package/lib/rpc/rpc-worker.js +7 -7
- package/lib/rpc/wrap-rpc.js +3 -12
- package/lib/typescript/type-script-package.d.ts +4 -0
- package/lib/typescript/type-script-package.js +88 -0
- package/lib/typescript/type-script-support.js +8 -18
- package/lib/typescript/type-script-worker-config.d.ts +2 -3
- package/lib/typescript/type-script-worker-config.js +23 -2
- package/lib/typescript/type-script-worker-options.d.ts +4 -3
- package/lib/typescript/type-script-worker-options.js +4 -0
- package/lib/typescript/worker/get-dependencies-worker.js +15 -4
- package/lib/typescript/worker/get-issues-worker.d.ts +1 -1
- package/lib/typescript/worker/get-issues-worker.js +52 -64
- package/lib/typescript/worker/lib/api.d.ts +13 -0
- package/lib/typescript/worker/lib/api.js +62 -0
- package/lib/typescript/worker/lib/config.d.ts +13 -9
- package/lib/typescript/worker/lib/config.js +63 -63
- package/lib/typescript/worker/lib/dependencies.d.ts +6 -1
- package/lib/typescript/worker/lib/dependencies.js +168 -43
- package/lib/typescript/worker/lib/diagnostics.d.ts +5 -4
- package/lib/typescript/worker/lib/diagnostics.js +44 -50
- package/lib/typescript/worker/lib/in-memory-file-system.d.ts +14 -0
- package/lib/typescript/worker/lib/in-memory-file-system.js +140 -0
- package/lib/typescript/worker/lib/performance.d.ts +1 -2
- package/lib/typescript/worker/lib/performance.js +12 -19
- package/lib/typescript/worker/lib/program/program.d.ts +6 -2
- package/lib/typescript/worker/lib/program/program.js +135 -24
- package/lib/typescript/worker/lib/program/solution-builder.d.ts +3 -1
- package/lib/typescript/worker/lib/program/solution-builder.js +41 -24
- package/lib/typescript/worker/lib/typescript.d.ts +4 -2
- package/lib/typescript/worker/lib/typescript.js +69 -3
- package/lib/utils/async/abort-error.d.ts +0 -1
- package/lib/utils/async/abort-error.js +1 -1
- package/lib/utils/async/pool.d.ts +0 -1
- package/lib/utils/async/pool.js +12 -23
- package/lib/utils/deep-merge.d.ts +5 -0
- package/lib/utils/deep-merge.js +56 -0
- package/lib/utils/path/format-file-path.d.ts +3 -0
- package/lib/utils/path/format-file-path.js +15 -0
- package/lib/watch/inclusive-node-watch-file-system.d.ts +3 -0
- package/lib/watch/inclusive-node-watch-file-system.js +119 -111
- package/package.json +30 -38
- package/lib/formatter/types/babel__code-frame.d.ts +0 -21
- package/lib/formatter/types/babel__code-frame.js +0 -7
- package/lib/typescript/worker/lib/artifacts.d.ts +0 -4
- package/lib/typescript/worker/lib/artifacts.js +0 -103
- package/lib/typescript/worker/lib/emit.d.ts +0 -2
- package/lib/typescript/worker/lib/emit.js +0 -12
- package/lib/typescript/worker/lib/file-system/file-system.d.ts +0 -17
- package/lib/typescript/worker/lib/file-system/file-system.js +0 -2
- package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +0 -5
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +0 -79
- package/lib/typescript/worker/lib/file-system/passive-file-system.d.ts +0 -5
- package/lib/typescript/worker/lib/file-system/passive-file-system.js +0 -65
- package/lib/typescript/worker/lib/file-system/real-file-system.d.ts +0 -5
- package/lib/typescript/worker/lib/file-system/real-file-system.js +0 -201
- package/lib/typescript/worker/lib/host/compiler-host.d.ts +0 -2
- package/lib/typescript/worker/lib/host/compiler-host.js +0 -9
- package/lib/typescript/worker/lib/host/watch-compiler-host.d.ts +0 -2
- package/lib/typescript/worker/lib/host/watch-compiler-host.js +0 -19
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.d.ts +0 -2
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +0 -46
- package/lib/typescript/worker/lib/program/watch-program.d.ts +0 -3
- package/lib/typescript/worker/lib/program/watch-program.js +0 -50
- package/lib/typescript/worker/lib/system.d.ts +0 -19
- package/lib/typescript/worker/lib/system.js +0 -232
- package/lib/typescript/worker/lib/tracing.d.ts +0 -4
- package/lib/typescript/worker/lib/tracing.js +0 -28
- package/lib/typescript/worker/lib/tsbuildinfo.d.ts +0 -4
- package/lib/typescript/worker/lib/tsbuildinfo.js +0 -105
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type * as ts from 'typescript';
|
|
2
|
-
export declare function startTracingIfNeeded(compilerOptions: ts.CompilerOptions): void;
|
|
3
|
-
export declare function stopTracingIfNeeded(program: ts.Program | ts.BuilderProgram): void;
|
|
4
|
-
export declare function dumpTracingLegendIfNeeded(): void;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startTracingIfNeeded = startTracingIfNeeded;
|
|
4
|
-
exports.stopTracingIfNeeded = stopTracingIfNeeded;
|
|
5
|
-
exports.dumpTracingLegendIfNeeded = dumpTracingLegendIfNeeded;
|
|
6
|
-
const config_1 = require("./config");
|
|
7
|
-
const typescript_1 = require("./typescript");
|
|
8
|
-
const worker_config_1 = require("./worker-config");
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
const traceableTypescript = typescript_1.typescript;
|
|
11
|
-
function startTracingIfNeeded(compilerOptions) {
|
|
12
|
-
if (typeof compilerOptions.generateTrace === 'string' &&
|
|
13
|
-
typeof traceableTypescript.startTracing === 'function') {
|
|
14
|
-
traceableTypescript.startTracing(worker_config_1.config.build ? 'build' : 'project', compilerOptions.generateTrace, (0, config_1.getConfigFilePathFromCompilerOptions)(compilerOptions));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function stopTracingIfNeeded(program) {
|
|
18
|
-
var _a;
|
|
19
|
-
const compilerOptions = program.getCompilerOptions();
|
|
20
|
-
if (typeof compilerOptions.generateTrace === 'string' &&
|
|
21
|
-
typeof ((_a = traceableTypescript.tracing) === null || _a === void 0 ? void 0 : _a.stopTracing) === 'function') {
|
|
22
|
-
traceableTypescript.tracing.stopTracing();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function dumpTracingLegendIfNeeded() {
|
|
26
|
-
var _a;
|
|
27
|
-
(_a = traceableTypescript.tracing) === null || _a === void 0 ? void 0 : _a.dumpLegend();
|
|
28
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type * as ts from 'typescript';
|
|
2
|
-
export declare function invalidateTsBuildInfo(): void;
|
|
3
|
-
export declare function emitTsBuildInfoIfNeeded(builderProgram: ts.BuilderProgram): void;
|
|
4
|
-
export declare function getTsBuildInfoEmitPath(compilerOptions: ts.CompilerOptions): string | undefined;
|
|
@@ -1,105 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.invalidateTsBuildInfo = invalidateTsBuildInfo;
|
|
37
|
-
exports.emitTsBuildInfoIfNeeded = emitTsBuildInfoIfNeeded;
|
|
38
|
-
exports.getTsBuildInfoEmitPath = getTsBuildInfoEmitPath;
|
|
39
|
-
const path = __importStar(require("path"));
|
|
40
|
-
const config_1 = require("./config");
|
|
41
|
-
const system_1 = require("./system");
|
|
42
|
-
const typescript_1 = require("./typescript");
|
|
43
|
-
const worker_config_1 = require("./worker-config");
|
|
44
|
-
function invalidateTsBuildInfo() {
|
|
45
|
-
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
46
|
-
// try to remove outdated .tsbuildinfo file for incremental mode
|
|
47
|
-
if (typeof typescript_1.typescript.getTsBuildInfoEmitOutputFilePath === 'function' &&
|
|
48
|
-
worker_config_1.config.mode !== 'readonly' &&
|
|
49
|
-
parsedConfig.options.incremental) {
|
|
50
|
-
const tsBuildInfoPath = typescript_1.typescript.getTsBuildInfoEmitOutputFilePath(parsedConfig.options);
|
|
51
|
-
if (tsBuildInfoPath) {
|
|
52
|
-
try {
|
|
53
|
-
system_1.system.deleteFile(tsBuildInfoPath);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
// silent
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function emitTsBuildInfoIfNeeded(builderProgram) {
|
|
62
|
-
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
63
|
-
if (worker_config_1.config.mode !== 'readonly' && parsedConfig && isIncrementalEnabled(parsedConfig.options)) {
|
|
64
|
-
const program = builderProgram.getProgram();
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
-
if (typeof program.emitBuildInfo === 'function') {
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
-
program.emitBuildInfo();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function getTsBuildInfoEmitPath(compilerOptions) {
|
|
73
|
-
if (typeof typescript_1.typescript.getTsBuildInfoEmitOutputFilePath === 'function') {
|
|
74
|
-
return typescript_1.typescript.getTsBuildInfoEmitOutputFilePath(compilerOptions);
|
|
75
|
-
}
|
|
76
|
-
const removeJsonExtension = (filePath) => filePath.endsWith('.json') ? filePath.slice(0, -'.json'.length) : filePath;
|
|
77
|
-
// based on the implementation from typescript
|
|
78
|
-
const configFile = compilerOptions.configFilePath;
|
|
79
|
-
if (!isIncrementalEnabled(compilerOptions)) {
|
|
80
|
-
return undefined;
|
|
81
|
-
}
|
|
82
|
-
if (compilerOptions.tsBuildInfoFile) {
|
|
83
|
-
return compilerOptions.tsBuildInfoFile;
|
|
84
|
-
}
|
|
85
|
-
const outPath = compilerOptions.outFile || compilerOptions.out;
|
|
86
|
-
let buildInfoExtensionLess;
|
|
87
|
-
if (outPath) {
|
|
88
|
-
buildInfoExtensionLess = removeJsonExtension(outPath);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
if (!configFile) {
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
const configFileExtensionLess = removeJsonExtension(configFile);
|
|
95
|
-
buildInfoExtensionLess = compilerOptions.outDir
|
|
96
|
-
? compilerOptions.rootDir
|
|
97
|
-
? path.resolve(compilerOptions.outDir, path.relative(compilerOptions.rootDir, configFileExtensionLess))
|
|
98
|
-
: path.resolve(compilerOptions.outDir, path.basename(configFileExtensionLess))
|
|
99
|
-
: configFileExtensionLess;
|
|
100
|
-
}
|
|
101
|
-
return buildInfoExtensionLess + '.tsbuildinfo';
|
|
102
|
-
}
|
|
103
|
-
function isIncrementalEnabled(compilerOptions) {
|
|
104
|
-
return Boolean((compilerOptions.incremental || compilerOptions.composite) && !compilerOptions.outFile);
|
|
105
|
-
}
|