@modern-js/main-doc 0.0.0-next-1679423474813 → 0.0.0-next-1679493992841

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,15 +1,17 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-1679423474813
3
+ ## 0.0.0-next-1679493992841
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - 92d247f1e: fix: support tools.devServer.header include string[] type, remove get & delete & apply api in hook or middleware api
8
+ fix: 支持 tools.devServer.header 包含字符串数组类型,移除 Hook 和 Middleware 中对 响应 Cookie 的获取、删除操作
7
9
  - 19e552a07: fix: main doc theme
8
10
 
9
11
  fix: 首页深色模式问题
10
12
 
11
13
  - Updated dependencies [cfdbf8033]
12
- - @modern-js/builder-doc@0.0.0-next-1679423474813
14
+ - @modern-js/builder-doc@0.0.0-next-1679493992841
13
15
 
14
16
  ## 2.9.0
15
17
 
@@ -38,9 +38,7 @@ type HookContext = {
38
38
  set: (key: string, value: string) => void;
39
39
  status: (code: number) => void;
40
40
  cookies: {
41
- get: (key: string) => string;
42
- set: (key: string, value: string) => void;
43
- delete: () => void;
41
+ set: (key: string, value: string, options?: any) => void;
44
42
  clear: () => void;
45
43
  };
46
44
  raw: (
@@ -46,11 +46,8 @@ type MiddlewareContext = {
46
46
  set: (key: string, value: string) => void;
47
47
  status: (code: number) => void;
48
48
  cookies: {
49
- get: (key: string) => string;
50
- set: (key: string, value: string) => void;
51
- delete: () => void;
49
+ set: (key: string, value: string, options?: any) => void;
52
50
  clear: () => void;
53
- apply: () => void;
54
51
  };
55
52
  raw: (
56
53
  body: string,
@@ -75,4 +75,5 @@ Visit the page `http://localhost:8080/__polyfill__` on Chrome 51 to see:
75
75
  :::caution
76
76
  This feature only works when using Modern.js built-in Web Server.
77
77
 
78
+ If you need to customize the HTML template, please refer to [HTML Template](/guides/basic-features/html.html). Manually modifying the template through html.template / tools.html will cause this feature not work.
78
79
  :::
@@ -4,7 +4,7 @@ sidebar_position: 1
4
4
 
5
5
  # Using Rspack
6
6
 
7
- import Rspack from '@modern-js/builder-doc/docs/en/shared/rspack.md';
7
+ import Rspack from '@modern-js/builder-doc/docs/en/shared/rspack-tip.mdx';
8
8
 
9
9
  <Rspack />
10
10
 
@@ -139,6 +139,8 @@ The bundle is generated to `dist/` by default, and the directory structure is as
139
139
  └── js
140
140
  ```
141
141
 
142
+ > If you want to customize the output directory, please refer to [Output Files](https://modernjs.dev/builder/en/guide/basic/output-files.html).
143
+
142
144
  ## Verify
143
145
 
144
146
  Execute `pnpm run serve` in the project to verify locally that the bundle is running correctly:
@@ -36,9 +36,7 @@ type HookContext = {
36
36
  set: (key: string, value: string) => void;
37
37
  status: (code: number) => void;
38
38
  cookies: {
39
- get: (key: string) => string;
40
- set: (key: string, value: string) => void;
41
- delete: () => void;
39
+ set: (key: string, value: string, options?: any) => void;
42
40
  clear: () => void;
43
41
  };
44
42
  raw: (
@@ -45,11 +45,8 @@ type MiddlewareContext = {
45
45
  set: (key: string, value: string) => void;
46
46
  status: (code: number) => void;
47
47
  cookies: {
48
- get: (key: string) => string;
49
- set: (key: string, value: string) => void;
50
- delete: () => void;
48
+ set: (key: string, value: string, options?: any) => void;
51
49
  clear: () => void;
52
- apply: () => void;
53
50
  };
54
51
  raw: (
55
52
  body: string,
@@ -73,4 +73,5 @@ export default defineConfig({
73
73
  :::caution 注意
74
74
  该功能只有在使用 Modern.js 内置的 Web Server 时才会生效。
75
75
 
76
+ 如果有自定义模版的需求,请参考 [HTML 模板](/guides/basic-features/html.html)。通过 `html.template` 或 `tools.html` 手动修改模版时,可能会导致该功能无法正确生效。
76
77
  :::
@@ -5,7 +5,7 @@ sidebar_position: 1
5
5
 
6
6
  # 使用 Rspack
7
7
 
8
- import Rspack from '@modern-js/builder-doc/docs/zh/shared/rspack.md';
8
+ import Rspack from '@modern-js/builder-doc/docs/zh/shared/rspack-tip.mdx';
9
9
 
10
10
  <Rspack />
11
11
 
@@ -106,6 +106,8 @@ info File sizes after production build:
106
106
  └── js
107
107
  ```
108
108
 
109
+ > 如果你需要自定义构建产物的目录,请参考 [构建产物目录](https://modernjs.dev/builder/guide/basic/output-files.html)。
110
+
109
111
  ## 本地验证
110
112
 
111
113
  在项目中执行 `pnpm run serve` 即可在本地验证构建产物是否正常运行:
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-1679423474813",
14
+ "version": "0.0.0-next-1679493992841",
15
15
  "publishConfig": {
16
16
  "registry": "https://registry.npmjs.org/",
17
17
  "access": "public"
18
18
  },
19
19
  "peerDependencies": {
20
- "@modern-js/builder-doc": "0.0.0-next-1679423474813"
20
+ "@modern-js/builder-doc": "0.0.0-next-1679493992841"
21
21
  },
22
22
  "devDependencies": {
23
23
  "classnames": "^2",
@@ -29,9 +29,9 @@
29
29
  "fs-extra": "^10",
30
30
  "@types/node": "^16",
31
31
  "@types/fs-extra": "^9",
32
- "@modern-js/builder-doc": "0.0.0-next-1679423474813",
33
- "@modern-js/doc-tools": "0.0.0-next-1679423474813",
34
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1679423474813"
32
+ "@modern-js/builder-doc": "0.0.0-next-1679493992841",
33
+ "@modern-js/doc-tools": "0.0.0-next-1679493992841",
34
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1679493992841"
35
35
  },
36
36
  "scripts": {
37
37
  "dev": "modern dev",