@modern-js/main-doc 0.0.0-nightly-20240313170658 → 0.0.0-nightly-20240315170737

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.
@@ -558,6 +558,28 @@ The writing of division in Less can also be modified through configuration optio
558
558
 
559
559
  ---
560
560
 
561
+ ### New TypeScript type errors detected after upgrading Modern.js Version?
562
+
563
+ Starting from the MAJOR_VERSION.47.0 version, Modern.js has improved the checking range of Type Checker. In previous versions, the Type Checker only outputs type errors in the src directory, resulting in type errors in other directories not being correctly noticed.
564
+
565
+ In the new version, Modern.js's Type Checker aligns with the type check range of native tsc (i.e., the range defined by the `include` and `exclude` fields in `tsconfig.json`), and can fully output the type errors in the project.
566
+
567
+ If you want to maintain the previous behavior and only output type errors in the src directory, you can add the following configuration:
568
+
569
+ ```ts title="modern.config.ts"
570
+ export default {
571
+ tools: {
572
+ tsChecker: {
573
+ issue: {
574
+ include: [{ file: '**/src/**/*' }],
575
+ },
576
+ },
577
+ },
578
+ };
579
+ ```
580
+
581
+ ---
582
+
561
583
  ### Compile error ‘TypeError: Cannot delete property 'xxx' of #\<Object\>’
562
584
 
563
585
  This error indicates that a read-only configuration option was deleted during the compilation process. Normally, we do not want any operation to directly modify the incoming configuration when compiling, but it is difficult to restrict the behavior of underlying plugins (such as postcss-loader, etc). If this error occurs, please contact the builder developer and we will need to do something special with that configuration.
@@ -562,6 +562,28 @@ Less 中除法的写法也可以通过配置项来修改,详见 [Less - Math](
562
562
 
563
563
  ---
564
564
 
565
+ ### 升级 Modern.js 版本后,检查出新的 TypeScript 类型错误?
566
+
567
+ 从 MAJOR_VERSION.47.0 版本开始,Modern.js 优化了 Type Checker 的检查范围。在之前的版本中,Type Checker 只输出 src 目录的类型错误,导致其他目录的类型错误无法被正确输出。
568
+
569
+ 在新版本中,Modern.js 的 Type Checker 对齐了原生 tsc 的类型检查范围(即 tsconfig.json 的 `include` 和 `exclude` 字段定义的范围),能够完整输出项目中的类型错误。
570
+
571
+ 如果你希望保持之前的行为,只输出 src 目录的类型错误,可以添加以下配置:
572
+
573
+ ```ts title="modern.config.ts"
574
+ export default {
575
+ tools: {
576
+ tsChecker: {
577
+ issue: {
578
+ include: [{ file: '**/src/**/*' }],
579
+ },
580
+ },
581
+ },
582
+ };
583
+ ```
584
+
585
+ ---
586
+
565
587
  ### 修改配置后,报错 ‘TypeError: Cannot delete property 'xxx' of #\<Object\>’
566
588
 
567
589
  该报错表示在编译过程中对一个只读配置项进行了删除操作。通常情况下,我们不希望编译过程中的任何操作会直接对传入的配置进行修改,但难以限制底层插件(如 postcss-loader 等)的行为,如果出现该报错,请联系 Modern.js 开发者,我们需要对该配置进行单独处理。
package/package.json CHANGED
@@ -15,17 +15,17 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20240313170658",
18
+ "version": "0.0.0-nightly-20240315170737",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "dependencies": {
25
- "@modern-js/sandpack-react": "0.0.0-nightly-20240313170658"
25
+ "@modern-js/sandpack-react": "0.0.0-nightly-20240315170737"
26
26
  },
27
27
  "peerDependencies": {
28
- "@modern-js/builder-doc": "0.0.0-nightly-20240313170658"
28
+ "@modern-js/builder-doc": "0.0.0-nightly-20240315170737"
29
29
  },
30
30
  "devDependencies": {
31
31
  "classnames": "^2",
@@ -35,12 +35,12 @@
35
35
  "ts-node": "^10.9.1",
36
36
  "typescript": "^5",
37
37
  "fs-extra": "^10",
38
- "rspress": "1.14.0",
39
- "@rspress/shared": "1.14.0",
38
+ "rspress": "1.15.0",
39
+ "@rspress/shared": "1.15.0",
40
40
  "@types/node": "^16",
41
41
  "@types/fs-extra": "9.0.13",
42
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240313170658",
43
- "@modern-js/builder-doc": "0.0.0-nightly-20240313170658"
42
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240315170737",
43
+ "@modern-js/builder-doc": "0.0.0-nightly-20240315170737"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "rspress dev",