@modern-js/main-doc 0.0.0-next-1686280308754 → 0.0.0-next-1686301875577

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,6 +1,6 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-1686280308754
3
+ ## 0.0.0-next-1686301875577
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -9,7 +9,7 @@
9
9
  chore: publishConfig 增加 provenance 配置
10
10
 
11
11
  - Updated dependencies [7e6fb5fc16]
12
- - @modern-js/builder-doc@0.0.0-next-1686280308754
12
+ - @modern-js/builder-doc@0.0.0-next-1686301875577
13
13
 
14
14
  ## 2.22.1
15
15
 
@@ -1,16 +1,37 @@
1
1
  - **Type:** `string | Object`
2
2
  - **Default:** `null`
3
3
 
4
- When this option is configured, the development environment will start a global proxy, similar to [Fiddler](https://www.telerik.com/fiddler), [Charles](https://www.charlesproxy.com/) and other web proxy debugging tools, which can be used to view, modify HTTP/HTTPS requests, responses, and can also be used as a proxy server.
4
+ This option is used to configure a global proxy based on [whistle](https://wproxy.org/whistle/) in the development environment, which can be used to view and modify HTTP/HTTPS requests, responses, and can also be used as a proxy server.
5
5
 
6
- :::tip
7
- Using this option requires advance installation `@modern-js/plugin-proxy`.
6
+ ### Register Plugin
8
7
 
9
- :::
8
+ Before using this option, you need to install and register the `@modern-js/plugin-proxy` plugin:
9
+
10
+ ```bash
11
+ # npm
12
+ npm add @modern-js/plugin-proxy -D
13
+
14
+ #yarn
15
+ yarn add @modern-js/plugin-proxy -D
16
+
17
+ #pnpm
18
+ pnpm add @modern-js/plugin-proxy -D
19
+ ```
20
+
21
+ After the installation, please register the plugin in the `modern.config.ts` file:
22
+
23
+ ```ts title="modern.config.ts"
24
+ import appTools, { defineConfig } from '@modern-js/app-tools';
25
+ import proxyPlugin from '@modern-js/plugin-proxy';
10
26
 
11
- ### Object
27
+ export default defineConfig({
28
+ plugins: [appTools(), proxyPlugin()],
29
+ });
30
+ ```
12
31
 
13
- Using this option requires that the value of `Object` be installed in advance, the `key` of the object corresponds to the matching `pattern`, and the `value` of the object corresponds to the matching `target`.
32
+ ### Object Type
33
+
34
+ When the value of `dev.proxy` is object type, the `key` of the object corresponds to the matching `pattern`, and the `value` of the object corresponds to the matching `target`.
14
35
 
15
36
  Example:
16
37
 
@@ -26,9 +47,11 @@ export default defineConfig({
26
47
  });
27
48
  ```
28
49
 
29
- ### String
50
+ Please refer to [whistle - Matching Patterns](https://wproxy.org/whistle/pattern.html) for detailed usage.
51
+
52
+ ### String Type
30
53
 
31
- When the value is `string`, it can be used to specify a separate proxy file, for example:
54
+ When the value of `dev.proxy` is string type, it can be used to specify a separate proxy file, for example:
32
55
 
33
56
  ```ts title="modern.config.ts"
34
57
  export default defineConfig({
@@ -47,10 +70,7 @@ module.exports = {
47
70
  };
48
71
  ```
49
72
 
50
- :::info
51
- Modern.js global proxy implementation is based on [whistle](https://wproxy.org/whistle/), for more matching patterns, please refer to: [Matching Patterns](https://wproxy.org/whistle/pattern.html)
52
-
53
- :::
73
+ ### Start Proxy
54
74
 
55
75
  Execute `dev`, when the prompt is as follows, the proxy server starts successfully:
56
76
 
@@ -68,7 +88,7 @@ Access the `localhost:8899` to view the Network and configure proxy rules on the
68
88
 
69
89
  ![proxy UI](https://lf3-static.bytednsdoc.com/obj/eden-cn/aphqeh7uhohpquloj/modern-js/docs/dev-proxy.png)
70
90
 
71
- :::caution Caution
91
+ :::info
72
92
  The https agent automatically installs the certificate to obtain root privileges. Please enter the password as prompted. ** The password is only used when the certificate is trusted and will not be leaked or used for other links **.
73
93
 
74
94
  :::
@@ -80,7 +80,6 @@ For example, if you are using pnpm, you can update the Rspack version with `over
80
80
  "overrides": {
81
81
  "@rspack/core": "nightly",
82
82
  "@rspack/dev-client": "nightly",
83
- "@rspack/dev-middleware": "nightly",
84
83
  "@rspack/plugin-html": "nightly"
85
84
  }
86
85
  }
@@ -1,14 +1,37 @@
1
1
  - **类型:** `string | Object`
2
2
  - **默认值:** `null`
3
3
 
4
- 配置该选项后,开发环境时会启动全局代理,类似 [Fiddler](https://www.telerik.com/fiddler), [Charles](https://www.charlesproxy.com/) web 代理调试工具,可以用来查看、修改 HTTP/HTTPS 请求、响应、也可以用作代理服务器。
4
+ 该选项用于在开发环境下启用基于 [whistle](https://wproxy.org/whistle/) 的全局代理,可以用来查看、修改 HTTP/HTTPS 请求、响应、也可以用作代理服务器。
5
5
 
6
- :::tip 提示
7
- 使用该选项需要提前安装 `@modern-js/plugin-proxy`。
6
+ ### 注册插件
8
7
 
9
- :::
8
+ 使用该选项前,你需要提前安装和注册 `@modern-js/plugin-proxy` 插件:
9
+
10
+ ```bash
11
+ # npm
12
+ npm add @modern-js/plugin-proxy -D
13
+
14
+ # yarn
15
+ yarn add @modern-js/plugin-proxy -D
16
+
17
+ # pnpm
18
+ pnpm add @modern-js/plugin-proxy -D
19
+ ```
20
+
21
+ 安装完成后,在 `modern.config.ts` 文件中注册插件:
22
+
23
+ ```ts title="modern.config.ts"
24
+ import appTools, { defineConfig } from '@modern-js/app-tools';
25
+ import proxyPlugin from '@modern-js/plugin-proxy';
26
+
27
+ export default defineConfig({
28
+ plugins: [appTools(), proxyPlugin()],
29
+ });
30
+ ```
10
31
 
11
- 值为 `Object` 时,对象的 `key` 对应匹配的 `pattern`,对象的 `value` 对应匹配的 `target`。
32
+ ### Object 类型
33
+
34
+ `dev.proxy` 的值为 `Object` 时,对象的 `key` 对应匹配的 `pattern`,对象的 `value` 对应匹配的 `target`。
12
35
 
13
36
  例如:
14
37
 
@@ -24,7 +47,11 @@ export default defineConfig({
24
47
  });
25
48
  ```
26
49
 
27
- 值为 `string` 时, 可以用来指定单独的代理文件,例如:
50
+ 请参考 [whistle - 匹配模式](https://wproxy.org/whistle/pattern.html) 来了解详细用法。
51
+
52
+ ### String 类型
53
+
54
+ `dev.proxy` 的值为 `string` 时, 可以用来指定单独的代理文件,例如:
28
55
 
29
56
  ```ts title="modern.config.ts"
30
57
  export default defineConfig({
@@ -43,10 +70,7 @@ module.exports = {
43
70
  };
44
71
  ```
45
72
 
46
- :::info
47
- Modern.js 全局代理实现底层基于 [whistle](https://wproxy.org/whistle/), 更多匹配模式请参考: [匹配模式](https://wproxy.org/whistle/pattern.html)
48
-
49
- :::
73
+ ### 启动代理
50
74
 
51
75
  执行 `dev`, 提示如下时,即代理服务器启动成功:
52
76
 
@@ -64,7 +88,7 @@ Modern.js 全局代理实现底层基于 [whistle](https://wproxy.org/whistle/),
64
88
 
65
89
  ![proxy ui 界面](https://lf3-static.bytednsdoc.com/obj/eden-cn/aphqeh7uhohpquloj/modern-js/docs/dev-proxy.png)
66
90
 
67
- :::caution 注意
91
+ :::info
68
92
  https 代理自动安装证书需要获取 root 权限, 请根据提示输入密码即可。**密码仅在信任证书时使用,不会泄漏或者用于其他环节**。
69
93
 
70
94
  :::
@@ -81,7 +81,6 @@ import appTools, { defineConfig } from '@modern-js/app-tools';
81
81
  "overrides": {
82
82
  "@rspack/core": "nightly",
83
83
  "@rspack/dev-client": "nightly",
84
- "@rspack/dev-middleware": "nightly",
85
84
  "@rspack/plugin-html": "nightly"
86
85
  }
87
86
  }
package/package.json CHANGED
@@ -15,14 +15,14 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1686280308754",
18
+ "version": "0.0.0-next-1686301875577",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "peerDependencies": {
25
- "@modern-js/builder-doc": "0.0.0-next-1686280308754"
25
+ "@modern-js/builder-doc": "0.0.0-next-1686301875577"
26
26
  },
27
27
  "devDependencies": {
28
28
  "classnames": "^2",
@@ -34,9 +34,9 @@
34
34
  "fs-extra": "^10",
35
35
  "@types/node": "^16",
36
36
  "@types/fs-extra": "^9",
37
- "@modern-js/builder-doc": "0.0.0-next-1686280308754",
38
- "@modern-js/doc-tools": "0.0.0-next-1686280308754",
39
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1686280308754"
37
+ "@modern-js/builder-doc": "0.0.0-next-1686301875577",
38
+ "@modern-js/doc-tools": "0.0.0-next-1686301875577",
39
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1686301875577"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "modern dev",