@modern-js/main-doc 2.54.3 → 2.54.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -123,19 +123,46 @@ When Rspack is enabled for building through dev / build, the current version of
123
123
 
124
124
  You can override Rspack to a specific version using the capbilities provided by package managers such as pnpm, yarn, npm.
125
125
 
126
- For example, if you are using pnpm, you can update the Rspack version with `overrides` as shown below:
126
+ For example, if you are using pnpm, you can override the Rspack version with `overrides`. Assume that the version of Rspack needs to be specified as 0.7.5:
127
127
 
128
128
  ```json title=package.json
129
129
  {
130
130
  "pnpm": {
131
131
  "overrides": {
132
- "@rspack/core": "nightly",
133
- "@rspack/plugin-react-refresh": "nightly",
132
+ "@rspack/binding": "0.7.5",
133
+ "@rspack/core": "0.7.5",
134
+ "@rspack/plugin-react-refresh": "0.7.5"
134
135
  }
135
136
  }
136
137
  }
137
138
  ```
138
139
 
140
+ If you need to use the nightly/canary version of Rspack, the package name of the nightly/canary version of Rspack will be released after adding the `-canary` suffix, and needs to be modified to:
141
+
142
+ ```json title=package.json
143
+ {
144
+ "pnpm": {
145
+ "overrides": {
146
+ "@rspack/binding": "npm:@rspack/binding-canary@nightly",
147
+ "@rspack/core": "npm:@rspack/core-canary@nightly",
148
+ "@rspack/plugin-react-refresh": "npm:@rspack/plugin-react-refresh-canary@nightly"
149
+ },
150
+ "peerDependencyRules": {
151
+ "allowAny": [
152
+ "@rspack/*"
153
+ ]
154
+ }
155
+ }
156
+ }
157
+ ```
158
+
159
+ Rspack provides [install-rspack](https://github.com/rspack-contrib/install-rspack) tooling to quickly override versions:
160
+
161
+ ```sh
162
+ npx install-rspack --version nightly # nightly npm tag
163
+ npx install-rspack --version 0.7.5-canary-d614005-20240625082730 # A specific canary version
164
+ ```
165
+
139
166
  :::tip What is Rspack Nightly Version
140
167
  The Rspack nightly build fully replicates the full release build for catching errors early.
141
168
  Usually it is available and any errors that arise will fixed promptly.
@@ -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.
@@ -122,19 +122,46 @@ export default defineConfig<'rspack'>({
122
122
 
123
123
  可以使用 pnpm / yarn / npm 等包管理工具自带的依赖升级功能来将 Rspack 强制升级到指定版本。
124
124
 
125
- 以 pnpm 为例,可通过 `overrides` 以下依赖更新 Rspack 版本:
125
+ 以 pnpm 为例,可通过 `overrides` 修改内置的 Rspack 版本。假设需要指定 Rspack 的版本为 0.7.5:
126
126
 
127
127
  ```json title=package.json
128
128
  {
129
129
  "pnpm": {
130
130
  "overrides": {
131
- "@rspack/core": "nightly",
132
- "@rspack/plugin-react-refresh": "nightly",
131
+ "@rspack/binding": "0.7.5",
132
+ "@rspack/core": "0.7.5",
133
+ "@rspack/plugin-react-refresh": "0.7.5"
133
134
  }
134
135
  }
135
136
  }
136
137
  ```
137
138
 
139
+ 如果需要使用 Rspack 的 nightly/canary 版本,Rspack 的 nightly/canary 版本的包名会在增加 `-canary` 后缀之后发布,需要修改为:
140
+
141
+ ```json title=package.json
142
+ {
143
+ "pnpm": {
144
+ "overrides": {
145
+ "@rspack/binding": "npm:@rspack/binding-canary@nightly",
146
+ "@rspack/core": "npm:@rspack/core-canary@nightly",
147
+ "@rspack/plugin-react-refresh": "npm:@rspack/plugin-react-refresh@nightly"
148
+ },
149
+ "peerDependencyRules": {
150
+ "allowAny": [
151
+ "@rspack/*"
152
+ ]
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ Rspack 提供了 [install-rspack](https://github.com/rspack-contrib/install-rspack) 工具来快速修改 Rspack 版本:
159
+
160
+ ```sh
161
+ npx install-rspack --version nightly # nightly npm tag
162
+ npx install-rspack --version 0.7.5-canary-d614005-20240625082730 # A specific canary version
163
+ ```
164
+
138
165
  :::tip Nightly 版本介绍
139
166
  每天,Rspack 会自动构建基于最新代码的 nightly 版本,用于测试和及早发现错误。
140
167
  通常情况下,这些版本是可用的。如果发现问题,我们会及时进行修复。但如果 Rspack 有一些 breaking change、需要 Modern.js 同步修改代码,那么我们建议等待下一个 Modern.js 版本再进行更新。
@@ -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": "2.54.3",
18
+ "version": "2.54.5",
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": "2.54.3"
25
+ "@modern-js/sandpack-react": "2.54.5"
26
26
  },
27
27
  "peerDependencies": {
28
- "@modern-js/builder-doc": "^2.54.3"
28
+ "@modern-js/builder-doc": "^2.54.5"
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/doc-plugin-auto-sidebar": "2.54.3",
43
- "@modern-js/builder-doc": "2.54.3"
42
+ "@modern-js/doc-plugin-auto-sidebar": "2.54.5",
43
+ "@modern-js/builder-doc": "2.54.5"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "rspress dev",