ts-checker-rspack-plugin 1.1.5 → 1.1.6

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
@@ -222,6 +222,22 @@ setting "generateTrace" compiler option. This is an instruction from [microsoft/
222
222
 
223
223
  You must both set "incremental": true in your `tsconfig.json` (under `compilerOptions`) and also specify mode: 'write-references' in `TsCheckerRspackPlugin` settings.
224
224
 
225
+ ## Vue components
226
+
227
+ To enable typecheck in `.vue` files, use the custom TypeScript wrapper [`@esctn/vue-tsc-api`](https://www.npmjs.com/package/@esctn/vue-tsc-api). It works on top of [`vue-tsc`](https://www.npmjs.com/package/vue-tsc) — a popular CLI tool for type-checking Vue 3 code.
228
+
229
+ ```bash
230
+ npm add @esctn/vue-tsc-api -D
231
+ ```
232
+
233
+ ```js
234
+ new TsCheckerRspackPlugin({
235
+ typescript: {
236
+ typescriptPath: '@esctn/vue-tsc-api',
237
+ },
238
+ });
239
+ ```
240
+
225
241
  ## License
226
242
 
227
243
  MIT License
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.statsFormatter = void 0;
7
7
  const picocolors_1 = __importDefault(require("picocolors"));
8
- // mimics webpack's stats summary formatter
8
+ // mimics Rspack's stats summary formatter
9
9
  function statsFormatter(issues, stats) {
10
10
  const errorsNumber = issues.filter((issue) => issue.severity === 'error').length;
11
11
  const warningsNumber = issues.filter((issue) => issue.severity === 'warning').length;
@@ -16,13 +16,15 @@ function statsFormatter(issues, stats) {
16
16
  ? picocolors_1.default.bold(picocolors_1.default.yellow(`${warningsNumber} ${warningsNumber === 1 ? 'warning' : 'warnings'}`))
17
17
  : '';
18
18
  const timeFormatted = stats.startTime ? Math.round(Date.now() - stats.startTime) : 0;
19
+ if (!errorsFormatted && !warningsFormatted) {
20
+ return picocolors_1.default.green(`[type-check] no errors found in ${timeFormatted} ms`);
21
+ }
19
22
  return [
20
- 'Found ',
23
+ '[type-check] found ',
21
24
  errorsFormatted,
22
25
  errorsFormatted && warningsFormatted ? ' and ' : '',
23
26
  warningsFormatted,
24
27
  timeFormatted ? ` in ${timeFormatted} ms` : '',
25
- '.',
26
28
  ].join('');
27
29
  }
28
30
  exports.statsFormatter = statsFormatter;
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.tapDoneToAsyncGetIssues = void 0;
7
7
  const picocolors_1 = __importDefault(require("picocolors"));
8
- ;
9
8
  const stats_formatter_1 = require("../formatter/stats-formatter");
10
9
  const webpack_formatter_1 = require("../formatter/webpack-formatter");
11
10
  const infrastructure_logger_1 = require("../infrastructure-logger");
@@ -26,7 +25,7 @@ function tapDoneToAsyncGetIssues(compiler, config, state) {
26
25
  try {
27
26
  if (await (0, is_pending_1.isPending)(issuesPromise)) {
28
27
  hooks.waiting.call(stats.compilation);
29
- config.logger.log(picocolors_1.default.cyan('Type-checking in progress...'));
28
+ config.logger.log(picocolors_1.default.cyan('[type-check] in progress...'));
30
29
  }
31
30
  else {
32
31
  // wait 10ms to log issues after webpack stats
@@ -52,12 +51,9 @@ function tapDoneToAsyncGetIssues(compiler, config, state) {
52
51
  if (issues.length) {
53
52
  // follow webpack's approach - one process.write to stderr with all errors and warnings
54
53
  config.logger.error(issues.map((issue) => formatter(issue)).join('\n'));
55
- // print stats of the compilation
56
- config.logger.log((0, stats_formatter_1.statsFormatter)(issues, stats));
57
- }
58
- else {
59
- config.logger.log(picocolors_1.default.green('No TypeScript errors found.'));
60
54
  }
55
+ // print stats of the compilation
56
+ config.logger.log((0, stats_formatter_1.statsFormatter)(issues, stats));
61
57
  // report issues to dev-server (overlay), if it's listening
62
58
  // skip reporting if there are no issues, to avoid an extra hot reload
63
59
  if (issues.length && state.DevServerDoneTap) {
@@ -17,12 +17,12 @@ function tapErrorToLogMessage(compiler, config) {
17
17
  config.logger.error(String(error));
18
18
  if (error instanceof rpc_1.RpcExitError) {
19
19
  if (error.signal === 'SIGINT') {
20
- config.logger.error(picocolors_1.default.red('Issues checking service interrupted - If running in a docker container, this may be caused ' +
20
+ config.logger.error(picocolors_1.default.red('[type-check] Issues checking service interrupted - If running in a docker container, this may be caused ' +
21
21
  "by the container running out of memory. If so, try increasing the container's memory limit " +
22
22
  'or lowering the `memoryLimit` value in the TsCheckerRspackPlugin configuration.'));
23
23
  }
24
24
  else {
25
- config.logger.error(picocolors_1.default.red('Issues checking service aborted - probably out of memory. ' +
25
+ config.logger.error(picocolors_1.default.red('[type-check] Issues checking service aborted - probably out of memory. ' +
26
26
  'Check the `memoryLimit` option in the TsCheckerRspackPlugin configuration.\n' +
27
27
  "If increasing the memory doesn't solve the issue, it's most probably a bug in the TypeScript."));
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-checker-rspack-plugin",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "rspack",
@@ -37,7 +37,7 @@
37
37
  "@rspack/lite-tapable": "^1.0.1",
38
38
  "chokidar": "^3.6.0",
39
39
  "is-glob": "^4.0.3",
40
- "memfs": "^4.28.0",
40
+ "memfs": "^4.47.0",
41
41
  "minimatch": "^9.0.5",
42
42
  "picocolors": "^1.1.1"
43
43
  },
@@ -52,13 +52,13 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@jest/console": "^27.5.1",
55
- "@rspack/core": "^1.4.11",
55
+ "@rspack/core": "^1.5.8",
56
56
  "@types/babel__code-frame": "^7.0.6",
57
57
  "@types/is-glob": "^4.0.4",
58
58
  "@types/jest": "^27.5.2",
59
59
  "@types/mock-fs": "^4.13.4",
60
60
  "@types/node": "^16.18.126",
61
- "cross-env": "^10.0.0",
61
+ "cross-env": "^10.1.0",
62
62
  "husky": "^7.0.4",
63
63
  "jest": "^27.5.1",
64
64
  "jest-circus": "^27.5.1",
@@ -71,9 +71,6 @@
71
71
  "ts-jest": "^27.1.5",
72
72
  "typescript": "^4.9.5"
73
73
  },
74
- "engines": {
75
- "node": ">=16.0.0"
76
- },
77
74
  "publishConfig": {
78
75
  "access": "public",
79
76
  "registry": "https://registry.npmjs.org/"