ts-checker-rspack-plugin 1.2.6 → 1.3.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 +15 -0
- package/lib/files-change.d.ts +2 -1
- package/lib/files-match.d.ts +1 -1
- package/lib/formatter/code-frame-formatter.d.ts +3 -2
- package/lib/formatter/formatter-config.d.ts +2 -1
- package/lib/formatter/formatter-options.d.ts +1 -1
- package/lib/formatter/formatter.d.ts +1 -1
- package/lib/getDependenciesWorker.js +2 -2
- package/lib/getIssuesWorker.js +3 -3
- package/lib/index.js +4039 -904
- package/lib/index.js.LICENSE.txt +13 -0
- package/lib/issue/issue-config.d.ts +2 -1
- package/lib/issue/issue-location.d.ts +2 -1
- package/lib/issue/issue-match.d.ts +2 -1
- package/lib/issue/issue-options.d.ts +1 -1
- package/lib/issue/issue-position.d.ts +2 -1
- package/lib/issue/issue-predicate.d.ts +2 -1
- package/lib/issue/issue.d.ts +2 -1
- package/lib/logger.d.ts +1 -1
- package/lib/plugin-config.d.ts +2 -1
- package/lib/plugin-hooks.d.ts +2 -1
- package/lib/plugin-options.d.ts +1 -1
- package/lib/plugin-state.d.ts +2 -1
- package/lib/plugin.d.ts +5 -5
- package/lib/rpc/index.d.ts +3 -2
- package/lib/rpc/rpc-worker.d.ts +2 -1
- package/lib/rpc/types.d.ts +1 -1
- package/lib/typescript/type-script-config-overwrite.d.ts +1 -1
- package/lib/typescript/type-script-diagnostics-options.d.ts +1 -1
- package/lib/typescript/type-script-worker-config.d.ts +2 -1
- package/lib/typescript/type-script-worker-options.d.ts +1 -1
- package/lib/utils/async/pool.d.ts +2 -1
- package/lib/watch/watch-file-system.d.ts +1 -1
- package/package.json +36 -36
package/README.md
CHANGED
|
@@ -245,6 +245,21 @@ setting "generateTrace" compiler option. This is an instruction from [microsoft/
|
|
|
245
245
|
6. Open `types.json` in an editor
|
|
246
246
|
7. When you see a type ID in the tracing output, go-to-line {id} to find data about that type
|
|
247
247
|
|
|
248
|
+
## Performance optimization
|
|
249
|
+
|
|
250
|
+
This plugin delegates type checking to TypeScript, so overall performance is mostly determined by `tsc` itself.
|
|
251
|
+
|
|
252
|
+
If you need faster type checks, start by optimizing your TypeScript setup using the [official TypeScript performance guide](https://github.com/microsoft/TypeScript/wiki/Performance).
|
|
253
|
+
|
|
254
|
+
For example, properly configuring the `include` and `exclude` scopes in `tsconfig.json` can significantly reduce unnecessary type checking and improve TypeScript performance:
|
|
255
|
+
|
|
256
|
+
```json title="tsconfig.json"
|
|
257
|
+
{
|
|
258
|
+
"include": ["src"],
|
|
259
|
+
"exclude": ["**/node_modules", "**/.*/"]
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
248
263
|
## Enabling incremental mode
|
|
249
264
|
|
|
250
265
|
TypeScript's "incremental" mode speeds up initial cold-start typechecks keeping an on-disk cache.
|
package/lib/files-change.d.ts
CHANGED
|
@@ -14,4 +14,5 @@ declare function clearFilesChange(compiler: rspack.Compiler): void;
|
|
|
14
14
|
* @returns Files change that represents all subsequent changes as a one event
|
|
15
15
|
*/
|
|
16
16
|
declare function aggregateFilesChanges(changes: FilesChange[]): FilesChange;
|
|
17
|
-
export {
|
|
17
|
+
export { getFilesChange, consumeFilesChange, updateFilesChange, clearFilesChange, aggregateFilesChanges, };
|
|
18
|
+
export type { FilesChange };
|
package/lib/files-match.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Formatter } from './formatter';
|
|
2
|
-
import { BabelCodeFrameOptions } from './types/babel__code-frame';
|
|
2
|
+
import type { BabelCodeFrameOptions } from './types/babel__code-frame';
|
|
3
3
|
declare function createCodeFrameFormatter(options?: BabelCodeFrameOptions): Formatter;
|
|
4
|
-
export { createCodeFrameFormatter
|
|
4
|
+
export { createCodeFrameFormatter };
|
|
5
|
+
export type { BabelCodeFrameOptions };
|
|
@@ -5,4 +5,5 @@ type FormatterConfig = {
|
|
|
5
5
|
pathType: FormatterPathType;
|
|
6
6
|
};
|
|
7
7
|
declare function createFormatterConfig(options: FormatterOptions | undefined): FormatterConfig;
|
|
8
|
-
export {
|
|
8
|
+
export { createFormatterConfig };
|
|
9
|
+
export type { FormatterConfig };
|
|
@@ -11,4 +11,4 @@ type CodeframeFormatterOptions = {
|
|
|
11
11
|
options?: BabelCodeFrameOptions;
|
|
12
12
|
};
|
|
13
13
|
type FormatterOptions = undefined | FormatterType | BasicFormatterOptions | CodeframeFormatterOptions | Formatter;
|
|
14
|
-
export { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions };
|
|
14
|
+
export type { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions, };
|
|
@@ -485,7 +485,7 @@ function normalizeAndResolvePath(path) {
|
|
|
485
485
|
let normalizedPath = realFileSystem.normalizePath(path);
|
|
486
486
|
try {
|
|
487
487
|
normalizedPath = realFileSystem.realPath(normalizedPath);
|
|
488
|
-
} catch
|
|
488
|
+
} catch {}
|
|
489
489
|
return normalizedPath;
|
|
490
490
|
}
|
|
491
491
|
function isArtifact(path) {
|
|
@@ -663,7 +663,7 @@ const get_dependencies_worker_getDependenciesWorker = (change)=>{
|
|
|
663
663
|
return getDependencies();
|
|
664
664
|
};
|
|
665
665
|
exposeRpc(get_dependencies_worker_getDependenciesWorker);
|
|
666
|
-
for(var
|
|
666
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
667
667
|
Object.defineProperty(exports, '__esModule', {
|
|
668
668
|
value: true
|
|
669
669
|
});
|
package/lib/getIssuesWorker.js
CHANGED
|
@@ -600,7 +600,7 @@ function normalizeAndResolvePath(path) {
|
|
|
600
600
|
let normalizedPath = realFileSystem.normalizePath(path);
|
|
601
601
|
try {
|
|
602
602
|
normalizedPath = realFileSystem.realPath(normalizedPath);
|
|
603
|
-
} catch
|
|
603
|
+
} catch {}
|
|
604
604
|
return normalizedPath;
|
|
605
605
|
}
|
|
606
606
|
function isArtifact(path) {
|
|
@@ -756,7 +756,7 @@ function invalidateTsBuildInfo() {
|
|
|
756
756
|
const tsBuildInfoPath = typescript.getTsBuildInfoEmitOutputFilePath(parsedConfig.options);
|
|
757
757
|
if (tsBuildInfoPath) try {
|
|
758
758
|
system.deleteFile(tsBuildInfoPath);
|
|
759
|
-
} catch
|
|
759
|
+
} catch {}
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
function emitTsBuildInfoIfNeeded(builderProgram) {
|
|
@@ -1119,7 +1119,7 @@ const getIssuesWorker = async (change, watching, defaultSeverity)=>{
|
|
|
1119
1119
|
return issues;
|
|
1120
1120
|
};
|
|
1121
1121
|
exposeRpc(getIssuesWorker);
|
|
1122
|
-
for(var
|
|
1122
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
1123
1123
|
Object.defineProperty(exports, '__esModule', {
|
|
1124
1124
|
value: true
|
|
1125
1125
|
});
|