@modern-js/module-tools-docs 2.54.1 → 2.54.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @modern-js/module-tools-docs
2
2
 
3
+ ## 2.54.3
4
+
5
+ ### Patch Changes
6
+
7
+ - aee1898: docs: remove module tools test doc
8
+
9
+ docs: 移除模块工程方案测试相关文档
10
+
11
+ ## 2.54.2
12
+
3
13
  ## 2.54.1
4
14
 
5
15
  ### Patch Changes
@@ -45,7 +45,6 @@ The `modern new` command is used to start the microgenerator functionality, whic
45
45
 
46
46
  The following features can currently be enabled.
47
47
 
48
- - Testing support
49
48
  - Storybook V7
50
49
  - Tailwind CSS support
51
50
  - Modern.js Runtime API
@@ -5,4 +5,3 @@ Here is a list of all frequently asked questions about Modern.js Module.
5
5
  - [General FAQ](./basic.mdx)
6
6
  - [Build FAQ](./build.mdx)
7
7
  - [Storybook FAQ](./storybook.mdx)
8
- - [Test FAQ](./test.mdx)
package/docs/en/index.md CHANGED
@@ -29,8 +29,8 @@ features:
29
29
  - title: 'Storybook: The community popular UI development tool'
30
30
  details: Integrated with Storybook, you can use it to debug UI.
31
31
  icon: 📦
32
- - title: 'Jest: Delightful Testing Framework'
33
- details: Jest integration makes it easier to test code。
32
+ - title: 'Lint: Code Formatting'
33
+ details: Built-in ESLint rules for rich scenarios.
34
34
  icon: 📐
35
35
  ---
36
36
  # index
@@ -45,7 +45,6 @@ Options:
45
45
 
46
46
  目前可以开启的功能有:
47
47
 
48
- - Test 测试
49
48
  - Storybook V7
50
49
  - Tailwind CSS 支持
51
50
  - Modern.js Runtime API
@@ -5,4 +5,3 @@
5
5
  - [通用类问题](./basic.mdx)
6
6
  - [构建相关问题](./build.mdx)
7
7
  - [Storybook 相关问题](./storybook.mdx)
8
- - [测试相关问题](./test.mdx)
package/docs/zh/index.md CHANGED
@@ -29,8 +29,8 @@ features:
29
29
  - title: 'Storybook: 社区流行的 UI 开发工具'
30
30
  details: 集成了 Storybook,你可以使用它调试 UI。
31
31
  icon: 📦
32
- - title: 'Jest: 令人愉快的测试框架'
33
- details: 集成了 Jest,使得代码测试更加容易。
32
+ - title: 'Lint: 代码格式化'
33
+ details: 丰富场景的内置 ESLint 规则。
34
34
  icon: 📐
35
35
  ---
36
36
  # index
package/package.json CHANGED
@@ -9,14 +9,14 @@
9
9
  "directory": "packages/document/module-doc"
10
10
  },
11
11
  "license": "MIT",
12
- "version": "2.54.1",
12
+ "version": "2.54.3",
13
13
  "main": "index.js",
14
14
  "devDependencies": {
15
15
  "react": "^18.2.0",
16
16
  "react-dom": "^18.2.0",
17
17
  "rspress": "1.18.2",
18
18
  "@rspress/shared": "1.18.2",
19
- "@modern-js/doc-plugin-auto-sidebar": "2.54.1"
19
+ "@modern-js/doc-plugin-auto-sidebar": "2.54.3"
20
20
  },
21
21
  "scripts": {
22
22
  "dev": "rspress dev",
@@ -1,58 +0,0 @@
1
- ---
2
- sidebar_position: 5
3
- ---
4
-
5
- # testing
6
-
7
- This chapter describes the test-related configuration
8
-
9
- :::tip
10
- You need to enable the unit testing feature with `pnpm run new` first.
11
- :::
12
-
13
- ## jest
14
-
15
- - Type: `object | Function`
16
- - Default: `{}`
17
-
18
- The configuration corresponding to [Jest](https://jestjs.io/docs/configuration), when of type `object`, can be configured with all the underlying configurations supported by Jest .
19
-
20
- ```js title="modern.config.ts"
21
- import { defineConfig } from '@modern-js/module-tools';
22
-
23
- export default defineConfig({
24
- testing: {
25
- jest: {
26
- testTimeout: 10000,
27
- },
28
- },
29
- });
30
- ```
31
-
32
- When the value is of type `Function`, the default configuration is passed as the first parameter and a new Jest configuration object needs to be returned.
33
-
34
- ```js title="modern.config.ts"
35
- import { defineConfig } from '@modern-js/module-tools';
36
-
37
- export default defineConfig({
38
- testing: {
39
- jest: options => {
40
- return {
41
- ... . options,
42
- testTimeout: 10000
43
- }
44
- }
45
- }
46
- });
47
- ```
48
-
49
- ## transformer
50
-
51
- - Type: `'babel-jest' | 'ts-jest'`
52
- - Default: `'babel-jest'`
53
-
54
- Configure the compilation tool for the source code when executing tests: [babel-jest](https://www.npmjs.com/package/babel-jest) or [ts-jest](https://github.com/kulshekhar/ts-jest). The default is `babel-jest`.
55
-
56
- :::info
57
- `babel-jest` can also compile TS files without type errors, so use `ts-jest` if you need to check the TS type when running tests.
58
- :::
@@ -1 +0,0 @@
1
-
@@ -1,11 +0,0 @@
1
- # Test FAQ
2
-
3
- import TestFAQ from '@site-docs-en/components/faq-test';
4
-
5
- <TestFAQ />
6
-
7
- ### Execute `test` command with an error `TypeError: Cannot read property 'testEnvironmentOptions' of undefined`
8
-
9
- ![jest-error](https://lf3-static.bytednsdoc.com/obj/eden-cn/shylnyhaeh7uldvivhn/jest-error-testEnvironmentOptions-of-undefined.jpeg)
10
-
11
- You can check whether other projects in Monorepo have `jest-environment-jsdom` dependencies and unify them with the overrides provided by Monorepo.
@@ -1,58 +0,0 @@
1
- ---
2
- sidebar_position: 5
3
- ---
4
-
5
- # testing
6
-
7
- 本章描述了测试相关的配置。
8
-
9
- :::tip
10
- 需要先通过 `pnpm run new` 启用 单元测试 功能。
11
- :::
12
-
13
- ## jest
14
-
15
- - 类型: `object | Function`
16
- - 默认值:`{}`
17
-
18
- 对应 [Jest](https://jestjs.io/docs/configuration) 的配置,当为 `object` 类型时,可以配置 Jest 所支持的所有底层配置 。
19
-
20
- ```js title="modern.config.ts"
21
- import { defineConfig } from '@modern-js/module-tools';
22
-
23
- export default defineConfig({
24
- testing: {
25
- jest: {
26
- testTimeout: 10000,
27
- },
28
- },
29
- });
30
- ```
31
-
32
- 值为 `Function` 类型时,默认配置作为第一个参数传入,需要返回新的 Jest 配置对象。
33
-
34
- ```js title="modern.config.ts"
35
- import { defineConfig } from '@modern-js/module-tools';
36
-
37
- export default defineConfig({
38
- testing: {
39
- jest: options => {
40
- return {
41
- ...options,
42
- testTimeout: 10000,
43
- };
44
- },
45
- },
46
- });
47
- ```
48
-
49
- ## transformer
50
-
51
- - 类型:`'babel-jest' | 'ts-jest'`
52
- - 默认值:`'babel-jest'`
53
-
54
- 配置执行测试的时候对于源码的编译工具: [babel-jest](https://www.npmjs.com/package/babel-jest) 或 [ts-jest](https://github.com/kulshekhar/ts-jest)。默认使用 `babel-jest`。
55
-
56
- :::info
57
- `babel-jest` 也可以编译 TS 文件,但不会类型报错,如果你需要跑测试的时候对 TS 类型进行校验,那么请使用 `ts-jest`。
58
- :::
@@ -1 +0,0 @@
1
-
@@ -1,11 +0,0 @@
1
- # 测试相关问题
2
-
3
- import TestFAQ from '@site-docs/components/faq-test';
4
-
5
- <TestFAQ />
6
-
7
- ## 执行 `test` 命令报错 `TypeError: Cannot read property 'testEnvironmentOptions' of undefined`
8
-
9
- ![jest-error](https://lf3-static.bytednsdoc.com/obj/eden-cn/shylnyhaeh7uldvivhn/jest-error-testEnvironmentOptions-of-undefined.jpeg)
10
-
11
- 问题原因多是存在多个版本的 `jest-environment-jsdom` 依赖,可以检查 Monorepo 中其他项目是否有 `jest-environment-jsdom` 依赖,并通过 Monorepo 提供的 overrides 能力统一依赖版本。