@modern-js/main-doc 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/docs/en/apis/app/commands.mdx +1 -1
  3. package/docs/en/apis/app/hooks/api/framework/lambda.mdx +2 -2
  4. package/docs/en/apis/app/hooks/api/functions/api.mdx +3 -3
  5. package/docs/en/apis/app/hooks/api/functions/app.mdx +1 -1
  6. package/docs/en/apis/app/hooks/api/test.mdx +2 -1
  7. package/docs/en/apis/app/hooks/config/mock.mdx +1 -1
  8. package/docs/en/apis/app/hooks/config/upload.mdx +1 -1
  9. package/docs/en/apis/app/hooks/server/test.mdx +1 -1
  10. package/docs/en/apis/app/hooks/src/app.mdx +1 -1
  11. package/docs/en/apis/app/hooks/src/pages.mdx +1 -1
  12. package/docs/en/apis/app/runtime/app/define-config.mdx +1 -1
  13. package/docs/en/apis/app/runtime/core/bootstrap.mdx +2 -2
  14. package/docs/en/apis/app/runtime/core/use-loader.mdx +6 -2
  15. package/docs/en/apis/app/runtime/model/auto-actions.mdx +6 -6
  16. package/docs/en/apis/app/runtime/model/connect.mdx +2 -1
  17. package/docs/en/apis/app/runtime/model/create-app.mdx +1 -1
  18. package/docs/en/apis/app/runtime/model/handle-effect.mdx +3 -3
  19. package/docs/en/apis/app/runtime/model/model_.mdx +2 -2
  20. package/docs/en/apis/app/runtime/model/use-model.mdx +2 -2
  21. package/docs/en/apis/app/runtime/model/use-static-model.mdx +2 -2
  22. package/docs/en/apis/app/runtime/model/use-store.mdx +1 -1
  23. package/docs/en/apis/app/runtime/router/router.mdx +1 -0
  24. package/docs/en/apis/app/runtime/ssr/pre-render.mdx +2 -2
  25. package/docs/en/apis/app/runtime/testing/render.mdx +1 -1
  26. package/docs/en/components/enable-bff.mdx +2 -2
  27. package/docs/en/configure/app/html/script-loading.mdx +13 -0
  28. package/docs/en/configure/app/output/ssg.mdx +1 -1
  29. package/docs/en/configure/app/plugins.mdx +3 -3
  30. package/docs/en/configure/app/source/disable-entry-dirs.mdx +1 -1
  31. package/docs/en/configure/app/tools/swc.mdx +1 -1
  32. package/docs/en/configure/app/usage.mdx +65 -23
  33. package/docs/en/guides/advanced-features/bff/function.mdx +3 -3
  34. package/docs/en/guides/advanced-features/code-split.mdx +2 -2
  35. package/docs/en/guides/advanced-features/eslint.mdx +1 -1
  36. package/docs/en/guides/advanced-features/ssg.mdx +2 -2
  37. package/docs/en/guides/advanced-features/ssr.mdx +45 -8
  38. package/docs/en/guides/basic-features/alias.mdx +1 -1
  39. package/docs/en/guides/basic-features/env-vars.mdx +5 -5
  40. package/docs/en/guides/basic-features/html.mdx +0 -4
  41. package/docs/en/guides/basic-features/routes.mdx +48 -28
  42. package/docs/en/guides/concept/entries.mdx +3 -3
  43. package/docs/en/guides/get-started/introduction.mdx +21 -1
  44. package/docs/en/guides/get-started/quick-start.mdx +6 -23
  45. package/docs/en/guides/get-started/upgrade.mdx +7 -7
  46. package/docs/en/guides/topic-detail/framework-plugin/hook.mdx +1 -1
  47. package/docs/en/guides/topic-detail/generator/codesmith/api/json.mdx +3 -3
  48. package/docs/en/guides/topic-detail/generator/config/app.mdx +1 -1
  49. package/docs/en/guides/topic-detail/generator/config/monorepo.mdx +1 -1
  50. package/docs/en/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +1 -1
  51. package/docs/en/guides/topic-detail/model/manage-effects.mdx +2 -1
  52. package/docs/en/guides/topic-detail/model/model-communicate.mdx +1 -1
  53. package/docs/en/tutorials/foundations/introduction.mdx +0 -2
  54. package/docs/zh/apis/app/hooks/src/pages.mdx +1 -1
  55. package/docs/zh/apis/app/runtime/core/use-loader.mdx +4 -0
  56. package/docs/zh/apis/app/runtime/model/handle-effect.mdx +2 -1
  57. package/docs/zh/apis/app/runtime/model/model_.mdx +4 -2
  58. package/docs/zh/blog/updates/2022-0708-updates.md +1 -2
  59. package/docs/zh/components/enable-bff.mdx +2 -2
  60. package/docs/zh/configure/app/html/script-loading.mdx +13 -0
  61. package/docs/zh/configure/app/source/disable-entry-dirs.mdx +2 -2
  62. package/docs/zh/configure/app/usage.mdx +66 -24
  63. package/docs/zh/guides/advanced-features/ssr.mdx +74 -36
  64. package/docs/zh/guides/basic-features/html.mdx +0 -4
  65. package/docs/zh/guides/basic-features/routes.mdx +64 -24
  66. package/docs/zh/guides/concept/entries.mdx +4 -4
  67. package/docs/zh/guides/get-started/introduction.mdx +21 -1
  68. package/docs/zh/guides/get-started/upgrade.mdx +3 -3
  69. package/docs/zh/guides/topic-detail/changesets/release.mdx +2 -2
  70. package/package.json +5 -5
  71. package/src/components/SolutionCards/index.module.scss +62 -0
  72. package/src/components/SolutionCards/index.tsx +26 -0
@@ -9,7 +9,27 @@ sidebar_position: 1
9
9
 
10
10
  目前 Modern.js 包含三个解决方案,分别面向 Web 应用开发场景、npm 包开发场景和文档站开发场景:
11
11
 
12
- ![](https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/Solutions-1311.png)
12
+ import { SolutionCards } from '@site/src/components/SolutionCards';
13
+
14
+ <SolutionCards
15
+ cards={[
16
+ {
17
+ title: 'Modern.js Framework',
18
+ description: '基于 React 的渐进式 Web 开发框架',
19
+ link: 'http://modernjs.dev/',
20
+ },
21
+ {
22
+ title: 'Modern.js Module',
23
+ description: '易用、高性能的 npm 包开发方案',
24
+ link: 'http://modernjs.dev/module-tools/',
25
+ },
26
+ {
27
+ title: 'Modern.js Doc',
28
+ description: '基于 Rspack 的文档站解决方案',
29
+ link: 'http://modernjs.dev/doc-tools/zh/',
30
+ },
31
+ ]}
32
+ />
13
33
 
14
34
  作为 Modern.js 工程体系的一部分,以上每个解决方案都可以被单独使用,并且各自部署了独立的文档站点。开发者可以按需选择其中的一个或多个解决方案来使用。
15
35
 
@@ -44,7 +44,7 @@ import ReleaseNote from "@site-docs/components/release-note"
44
44
 
45
45
  对于使用 pnpm 的项目,请在**项目根目录**的 `package.json` 中添加以下配置,然后重新执行 `pnpm install`:
46
46
 
47
- ```json
47
+ ```json title="package.json"
48
48
  {
49
49
  "pnpm": {
50
50
  "overrides": {
@@ -58,7 +58,7 @@ import ReleaseNote from "@site-docs/components/release-note"
58
58
 
59
59
  对于使用 Yarn 的项目,请在**项目根目录**的 `package.json` 中添加以下配置,然后重新执行 `yarn install`:
60
60
 
61
- ```json
61
+ ```json title="package.json"
62
62
  {
63
63
  "resolutions": {
64
64
  "package-name": "^1.0.0"
@@ -70,7 +70,7 @@ import ReleaseNote from "@site-docs/components/release-note"
70
70
 
71
71
  对于使用 Npm 的项目,请在**项目根目录**的 `package.json` 中添加以下配置,然后重新执行 `npm install`:
72
72
 
73
- ```json
73
+ ```json title="package.json"
74
74
  {
75
75
  "overrides": {
76
76
  "package-name": "^1.0.0"
@@ -91,7 +91,7 @@ pnpm run release
91
91
  执行该命令时,将会依次判断 Monorepo 中所有的 packages 的版本是否在 NPM 中存在,如果不存在将会执行 `publish` 命令发布。
92
92
 
93
93
  :::warning
94
- 当 Monorepo 中包之间依赖关系使用 workspace 声明时,注意不要直接在 package 对应的子目录直接执行 `npm publish` 发布 package,使用 `relesae` 命令在发布时将会自动去除 workspace 声明,确保 NPM 包发布之后可用。
94
+ 当 Monorepo 中包之间依赖关系使用 workspace 声明时,注意不要直接在 package 对应的子目录直接执行 `npm publish` 发布 package,使用 `release` 命令在发布时将会自动去除 workspace 声明,确保 NPM 包发布之后可用。
95
95
 
96
96
  :::
97
97
 
@@ -133,7 +133,7 @@ pnpm run bump -- --ignore module-2 --ignore module-3
133
133
 
134
134
  ### release 命令参数
135
135
 
136
- - `--otp` 使用 `npm token` 执行 relesae 命令发布对应包
136
+ - `--otp` 使用 `npm token` 执行 release 命令发布对应包
137
137
 
138
138
  ```bash
139
139
  pnpm run relese -- --otp <token>
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.12.0",
14
+ "version": "2.13.0",
15
15
  "publishConfig": {
16
16
  "registry": "https://registry.npmjs.org/",
17
17
  "access": "public"
18
18
  },
19
19
  "peerDependencies": {
20
- "@modern-js/builder-doc": "^2.12.0"
20
+ "@modern-js/builder-doc": "^2.13.0"
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": "2.12.0",
33
- "@modern-js/doc-tools": "2.12.0",
34
- "@modern-js/doc-plugin-auto-sidebar": "2.12.0"
32
+ "@modern-js/builder-doc": "2.13.0",
33
+ "@modern-js/doc-tools": "2.13.0",
34
+ "@modern-js/doc-plugin-auto-sidebar": "2.13.0"
35
35
  },
36
36
  "scripts": {
37
37
  "dev": "modern dev",
@@ -0,0 +1,62 @@
1
+ .root {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ justify-content: space-between;
5
+ margin: 1.5rem 0;
6
+ }
7
+
8
+ .card {
9
+ cursor: pointer;
10
+ border: 1px solid var(--modern-c-bg-soft);
11
+ background-color: var(--modern-c-bg-soft);
12
+ transition: color 0.5s, background-color 0.5s;
13
+ padding: 22px;
14
+ border-radius: 16px;
15
+ flex: 0 1 32%;
16
+ font-size: 14px;
17
+ font-weight: 500;
18
+ transition: border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
19
+
20
+ &1 {
21
+ background-color: #e9f5ff;
22
+
23
+ &:hover {
24
+ border-color: #66b9ff;
25
+ }
26
+ }
27
+
28
+ &2 {
29
+ background-color: #f3f4ff;
30
+
31
+ &:hover {
32
+ border-color: #6673ff;
33
+ }
34
+ }
35
+
36
+ &3 {
37
+ background-color: #e9ffed;
38
+
39
+ &:hover {
40
+ border-color: #52e06c;
41
+ }
42
+ }
43
+ }
44
+
45
+ .title {
46
+ font-size: 16px;
47
+ font-weight: 600;
48
+ line-height: 1.4;
49
+ letter-spacing: -0.02em;
50
+ margin: 0 0 0.75em !important;
51
+ color: #213547;
52
+ display: block;
53
+ }
54
+
55
+ .description {
56
+ font-size: 12px;
57
+ margin: 0 !important;
58
+ line-height: 1.7 !important;
59
+ color: rgba(60, 60, 60, 0.75);
60
+ font-weight: 400;
61
+ transition: color 0.5s;
62
+ }
@@ -0,0 +1,26 @@
1
+ import clsx from 'clsx';
2
+ import styles from './index.module.scss';
3
+
4
+ type Card = {
5
+ link: string;
6
+ title: string;
7
+ description: string;
8
+ };
9
+
10
+ export const SolutionCards = ({ cards }: { cards: Card[] }) => {
11
+ const classNames = [styles.card1, styles.card2, styles.card3];
12
+ const renderCards = () =>
13
+ cards.map((card, index) => (
14
+ <a
15
+ key={card.title}
16
+ href={card.link}
17
+ className={clsx([styles.card, classNames[index]])}
18
+ target="_blank"
19
+ >
20
+ <div className={styles.title}>{card.title}</div>
21
+ <div className={styles.description}>{card.description}</div>
22
+ </a>
23
+ ));
24
+
25
+ return <div className={styles.root}>{renderCards()}</div>;
26
+ };