@rsbuild/plugin-type-check 0.4.14 → 0.5.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/dist/index.d.ts +1 -1
- package/dist/index.js +4 -9
- package/dist/index.mjs +6 -10
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { RsbuildPlugin } from '@rsbuild/core';
|
|
|
2
2
|
import { ChainedConfig } from '@rsbuild/shared';
|
|
3
3
|
import ForkTSCheckerPlugin from 'fork-ts-checker-webpack-plugin';
|
|
4
4
|
|
|
5
|
-
type ForkTsCheckerOptions = ConstructorParameters<typeof ForkTSCheckerPlugin>[0]
|
|
5
|
+
type ForkTsCheckerOptions = NonNullable<ConstructorParameters<typeof ForkTSCheckerPlugin>[0]>;
|
|
6
6
|
type PluginTypeCheckerOptions = {
|
|
7
7
|
/**
|
|
8
8
|
* Whether to enable TypeScript type checking.
|
package/dist/index.js
CHANGED
|
@@ -79,10 +79,8 @@ var pluginTypeCheck = (options = {}) => {
|
|
|
79
79
|
typescriptPath
|
|
80
80
|
},
|
|
81
81
|
issue: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{ file: "**/node_modules/**/*" }
|
|
85
|
-
]
|
|
82
|
+
// ignore types errors from node_modules
|
|
83
|
+
exclude: [({ file = "" }) => import_shared.NODE_MODULES_REGEX.test(file)]
|
|
86
84
|
},
|
|
87
85
|
logger: {
|
|
88
86
|
log() {
|
|
@@ -97,11 +95,8 @@ var pluginTypeCheck = (options = {}) => {
|
|
|
97
95
|
options: forkTsCheckerOptions,
|
|
98
96
|
mergeFn: import_shared.deepmerge
|
|
99
97
|
});
|
|
100
|
-
if (
|
|
101
|
-
import_core.logger.info("
|
|
102
|
-
import_core.logger.info(
|
|
103
|
-
"Ts checker is running slowly and will block builds until it is complete, please be patient and wait."
|
|
104
|
-
);
|
|
98
|
+
if (isProd) {
|
|
99
|
+
import_core.logger.info("Type checker is enabled. It may take some time.");
|
|
105
100
|
}
|
|
106
101
|
chain.plugin(import_shared.CHAIN_ID.PLUGIN.TS_CHECKER).use(ForkTsCheckerWebpackPlugin, [typeCheckerOptions]);
|
|
107
102
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
9
9
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
// ../../node_modules/.pnpm/@modern-js+module-tools@2.48.
|
|
12
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.48.2/node_modules/@modern-js/module-tools/shims/esm.js
|
|
13
13
|
import { fileURLToPath } from "url";
|
|
14
14
|
import path from "path";
|
|
15
15
|
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
fse,
|
|
20
20
|
CHAIN_ID,
|
|
21
21
|
deepmerge,
|
|
22
|
+
NODE_MODULES_REGEX,
|
|
22
23
|
mergeChainedOptions
|
|
23
24
|
} from "@rsbuild/shared";
|
|
24
25
|
var pluginTypeCheck = (options = {}) => {
|
|
@@ -65,10 +66,8 @@ var pluginTypeCheck = (options = {}) => {
|
|
|
65
66
|
typescriptPath
|
|
66
67
|
},
|
|
67
68
|
issue: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
{ file: "**/node_modules/**/*" }
|
|
71
|
-
]
|
|
69
|
+
// ignore types errors from node_modules
|
|
70
|
+
exclude: [({ file = "" }) => NODE_MODULES_REGEX.test(file)]
|
|
72
71
|
},
|
|
73
72
|
logger: {
|
|
74
73
|
log() {
|
|
@@ -83,11 +82,8 @@ var pluginTypeCheck = (options = {}) => {
|
|
|
83
82
|
options: forkTsCheckerOptions,
|
|
84
83
|
mergeFn: deepmerge
|
|
85
84
|
});
|
|
86
|
-
if (
|
|
87
|
-
logger.info("
|
|
88
|
-
logger.info(
|
|
89
|
-
"Ts checker is running slowly and will block builds until it is complete, please be patient and wait."
|
|
90
|
-
);
|
|
85
|
+
if (isProd) {
|
|
86
|
+
logger.info("Type checker is enabled. It may take some time.");
|
|
91
87
|
}
|
|
92
88
|
chain.plugin(CHAIN_ID.PLUGIN.TS_CHECKER).use(ForkTsCheckerWebpackPlugin, [typeCheckerOptions]);
|
|
93
89
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-type-check",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "TS checker plugin of Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"webpack": "^5.89.0",
|
|
27
27
|
"fork-ts-checker-webpack-plugin": "9.0.2",
|
|
28
|
-
"@rsbuild/shared": "0.
|
|
28
|
+
"@rsbuild/shared": "0.5.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.4.2",
|
|
32
|
-
"@rsbuild/core": "0.
|
|
33
|
-
"@scripts/test-helper": "0.
|
|
32
|
+
"@rsbuild/core": "0.5.0",
|
|
33
|
+
"@scripts/test-helper": "0.5.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@rsbuild/core": "^0.
|
|
36
|
+
"@rsbuild/core": "^0.5.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public",
|