@modern-js/main-doc 0.0.0-nightly-20240623170628 → 0.0.0-nightly-20240625170705
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/docs/en/apis/app/commands.mdx +0 -1
- package/docs/en/guides/deprecat.md +15 -0
- package/docs/en/guides/topic-detail/framework-plugin/introduction.mdx +0 -1
- package/docs/en/guides/topic-detail/generator/new/config.md +0 -4
- package/docs/zh/apis/app/commands.mdx +0 -1
- package/docs/zh/community/blog/v2-release-note.mdx +0 -1
- package/docs/zh/guides/deprecat.md +15 -0
- package/docs/zh/guides/topic-detail/framework-plugin/introduction.mdx +0 -1
- package/package.json +5 -5
- package/docs/en/apis/app/hooks/api/test.mdx +0 -13
- package/docs/en/apis/app/hooks/server/test.mdx +0 -15
- package/docs/en/apis/app/hooks/src/test.mdx +0 -15
- package/docs/zh/apis/app/hooks/api/test.mdx +0 -12
- package/docs/zh/apis/app/hooks/server/test.mdx +0 -14
- package/docs/zh/apis/app/hooks/src/test.mdx +0 -14
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 10
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Deprecated Functions
|
|
6
|
+
|
|
7
|
+
This article will introduce the functions that were previously supported by Modern.js, but have now been deprecated, along with the recommended alternatives.
|
|
8
|
+
|
|
9
|
+
## Creating a Monorepo using @modern-js/create
|
|
10
|
+
|
|
11
|
+
The Monorepo solution previously provided by Modern.js was implemented based on [pnpm Workspace](https://pnpm.io/workspaces) and did not offer substantial Monorepo management capabilities. In version [v2.53.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.53.0), the functionality to create Monorepo projects using `@modern-js/create` has been removed. It is recommended to directly use the Monorepo solutions provided by the community.
|
|
12
|
+
|
|
13
|
+
## Enabling the test capability with the new command
|
|
14
|
+
|
|
15
|
+
The test capability previously provided by Modern.js was a simple wrapper based on Jest, which led to issues such as unintuitive Jest configuration and more complex user configuration. In version [v2.53.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.53.0), the option to enable the test feature in application and module projects has been removed. It is recommended to directly use the testing solutions provided by the community.
|
|
@@ -38,7 +38,6 @@ $ npx modern new
|
|
|
38
38
|
❯ Enable BFF
|
|
39
39
|
Enable SSG
|
|
40
40
|
Enable Micro Frontend
|
|
41
|
-
Enable Unit Test / Integration Test
|
|
42
41
|
```
|
|
43
42
|
|
|
44
43
|
After the selection is completed, the Modern.js generator will automatically install the corresponding plugins and third-party dependencies. Upon completion of the installation, you will see:
|
|
@@ -60,8 +60,6 @@ Options:
|
|
|
60
60
|
|
|
61
61
|
- Enable Micro Frontend -- micro_frontend
|
|
62
62
|
|
|
63
|
-
- Enable Unit Test / Integration Test -- test
|
|
64
|
-
|
|
65
63
|
- Enable UA-based Polyfill Feature -- polyfill
|
|
66
64
|
|
|
67
65
|
- Enable Global Proxy -- proxy
|
|
@@ -110,8 +108,6 @@ Question: Please select the feature name.
|
|
|
110
108
|
|
|
111
109
|
Options:
|
|
112
110
|
|
|
113
|
-
- Enable Unit Test / Integration Test -- test
|
|
114
|
-
|
|
115
111
|
- Enable Tailwind CSS -- tailwindcss
|
|
116
112
|
|
|
117
113
|
- Enable Storybook -- storybook
|
|
@@ -185,7 +185,6 @@ Modern.js Module 的核心能力包括:
|
|
|
185
185
|
|
|
186
186
|
- **构建能力**:基于 esbuild 实现的构建工具,提供类型生成能力,能够高度定制构建产物。
|
|
187
187
|
- **调试能力**:基于 Storybook 调试项目,可以测试代码功能、验证构建产物可用性。
|
|
188
|
-
- **测试能力**:集成 Jest 测试能力,能够开箱即用地编写你的测试代码。
|
|
189
188
|
- **版本管理能力**:基于 Changeset 提供版本管理命令,涵盖从开发到发布的过程。
|
|
190
189
|
- **扩展能力**:提供包含丰富 Hooks 的插件机制,支持扩展调试能力,或对流程进行自定义。
|
|
191
190
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 10
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 已下线功能
|
|
6
|
+
|
|
7
|
+
本文将介绍 Modern.js 之前支持,但是现在已下线的功能及推荐替代方案。
|
|
8
|
+
|
|
9
|
+
## 使用 @modern-js/create 创建 Monorepo
|
|
10
|
+
|
|
11
|
+
Modern.js 之前提供的 Monorepo 方案是基于 [pnpm Workspace](https://pnpm.io/workspaces) 实现的,并未提供实质性的 Monorepo 管理能力。在 [v2.53.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.53.0) 版本中,移除了使用 `@modern-js/create` 创建 Monorepo 项目的功能。推荐直接使用社区提供的 Monorepo 方案。
|
|
12
|
+
|
|
13
|
+
## new 命令开启 test 能力
|
|
14
|
+
|
|
15
|
+
Modern.js 之前提供的测试能力是基于 Jest 的简单封装。该封装导致 Jest 配置不直观、用户配置更加复杂等问题。在 [v2.53.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.53.0) 版本中,移除了在应用项目和模块项目中开启 test 功能的选项。推荐直接使用社区提供的测试方案。
|
package/package.json
CHANGED
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-nightly-
|
|
18
|
+
"version": "0.0.0-nightly-20240625170705",
|
|
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-
|
|
25
|
+
"@modern-js/sandpack-react": "0.0.0-nightly-20240625170705"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@modern-js/builder-doc": "0.0.0-nightly-
|
|
28
|
+
"@modern-js/builder-doc": "0.0.0-nightly-20240625170705"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"classnames": "^2",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@rspress/shared": "1.18.2",
|
|
40
40
|
"@types/node": "^16",
|
|
41
41
|
"@types/fs-extra": "9.0.13",
|
|
42
|
-
"@modern-js/
|
|
43
|
-
"@modern-js/doc
|
|
42
|
+
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240625170705",
|
|
43
|
+
"@modern-js/builder-doc": "0.0.0-nightly-20240625170705"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"dev": "rspress dev",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: test.[tj]s
|
|
3
|
-
sidebar_position: 4
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# test.[tj]s
|
|
7
|
-
|
|
8
|
-
App's BFF test file, support for writing test cases in the `api/` directory which file with suffix `.test.[tj]s`.
|
|
9
|
-
|
|
10
|
-
:::info
|
|
11
|
-
To use unit test and integration test, you need to execute the `new` command in advance to enable the `unit test/integration test`.
|
|
12
|
-
|
|
13
|
-
:::
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: test.[tj]s
|
|
3
|
-
sidebar_position: 2
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# test.[tj]s
|
|
7
|
-
|
|
8
|
-
Custom Web Server test directory.
|
|
9
|
-
|
|
10
|
-
The application supports testing custom Web Server. You can directly create files with the suffix `.test.[tj]s` under the `server/` directory of the project to write test cases.
|
|
11
|
-
|
|
12
|
-
:::info
|
|
13
|
-
Enabling unit testing and integration testing requires running the `new` command to enable the "Unit Testing/Integration Testing" function under the project first.
|
|
14
|
-
|
|
15
|
-
:::
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: '**/*.test.[tj]sx?'
|
|
3
|
-
sidebar_position: 6
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# **/*.test.[tj]sx?
|
|
7
|
-
|
|
8
|
-
Application project test files.
|
|
9
|
-
|
|
10
|
-
The application project supports creating files with the suffix `.test.[tj]sx?` in the project source code directory (`src`) to write test cases.
|
|
11
|
-
|
|
12
|
-
:::info
|
|
13
|
-
To use unit testing and integration testing, you need to enable the "Unit Testing / Integration Testing" feature by running the `new` command in the project first.
|
|
14
|
-
|
|
15
|
-
:::
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: test.[tj]s
|
|
3
|
-
sidebar_position: 4
|
|
4
|
-
---
|
|
5
|
-
# test.[tj]s
|
|
6
|
-
|
|
7
|
-
The BFF test file of the application supports writing test cases in files with the suffix `.test.[tj]sx?` under the `api/` directory.
|
|
8
|
-
|
|
9
|
-
:::info
|
|
10
|
-
Enabling unit testing and integration testing requires running the new command to enable the "Unit Testing/Integration Testing" function under the project first.
|
|
11
|
-
|
|
12
|
-
:::
|