Skip to content

Commit 7693f32

Browse files
authored
docs: bump to Rspress@2.0.0-beta.13 and add llms.txt (#3834)
1 parent de350f3 commit 7693f32

File tree

12 files changed

+1228
-1182
lines changed

12 files changed

+1228
-1182
lines changed

apps/website-new/docs/en/guide/framework/modernjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export default Index;
486486

487487
If the current project only needs to load MF in CSR, you can set `ssr: false` to help with progressive migration.
488488

489-
```title='modern.config.ts'
489+
```ts title='modern.config.ts'
490490
import { appTools, defineConfig } from '@modern-js/app-tools';
491491
import { moduleFederationPlugin } from '@module-federation/modern-js';
492492

apps/website-new/docs/en/practice/frameworks/next/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build
169169

170170
`.env` can be set as well, but can be unreliable in setting `NEXT_PRIVATE_LOCAL_WEBPACK` in time.
171171

172-
```.env title=".env"
172+
```ini title=".env"
173173
NEXT_PRIVATE_LOCAL_WEBPACK=true
174174
```
175175

apps/website-new/docs/zh/guide/framework/modernjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ export default Index;
488488

489489
如果当前项目仅需要在 CSR 加载 MF ,那么可以设置 `ssr: false` 来帮助渐进式迁移。
490490

491-
```title='modern.config.ts'
491+
```ts title='modern.config.ts'
492492
import { appTools, defineConfig } from '@modern-js/app-tools';
493493
import { moduleFederationPlugin } from '@module-federation/modern-js';
494494

apps/website-new/docs/zh/practice/frameworks/next/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build
164164

165165
`.env` 也可以设置,但及时设置 `NEXT_PRIVATE_LOCAL_WEBPACK` 可能不可靠。
166166

167-
```.env title=".env"
167+
```ini title=".env"
168168
NEXT_PRIVATE_LOCAL_WEBPACK=true
169169
```
170170

apps/website-new/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
},
1010
"dependencies": {
1111
"framer-motion": "^10.0.0",
12-
"rspress": "1.34.1",
12+
"rspress": "2.0.0-beta.13",
1313
"tailwindcss": "^3.2.7",
1414
"video-react": "^0.16.0",
1515
"xgplayer": "^3.0.16",
1616
"rspress-plugin-annotation-words": "0.0.1",
17-
"@module-federation/error-codes": "workspace:*"
17+
"@rsbuild/plugin-sass": "^1.3.2",
18+
"@module-federation/error-codes": "workspace:*",
19+
"@rspress/plugin-llms": "2.0.0-beta.13"
1820
},
1921
"devDependencies": {
2022
"@types/node": "^20"

apps/website-new/rspress.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as path from 'path';
22
import { defineConfig } from 'rspress/config';
33
import { moduleFederationPluginOverview } from './src/moduleFederationPluginOverview';
44
import { pluginAnnotationWords } from 'rspress-plugin-annotation-words';
5+
import { pluginSass } from '@rsbuild/plugin-sass';
6+
import { pluginLlms } from '@rspress/plugin-llms';
57

68
const getNavbar = (lang: string) => {
79
const cn = lang === 'zh';
@@ -81,15 +83,16 @@ export default defineConfig({
8183
pluginAnnotationWords({
8284
wordsMapPath: 'words-map.json',
8385
}),
86+
pluginLlms(),
8487
],
8588
builderConfig: {
86-
plugins: [moduleFederationPluginOverview],
89+
plugins: [moduleFederationPluginOverview, pluginSass()],
8790
tools: {
8891
postcss: (config, { addPlugins }) => {
8992
addPlugins([require('tailwindcss/nesting'), require('tailwindcss')]);
9093
},
9194
},
92-
source: {
95+
resolve: {
9396
alias: {
9497
'@site': path.resolve(__dirname),
9598
'@components': path.join(__dirname, 'src/components'),

apps/website-new/src/components/AnnouncementVideo.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from 'react';
1+
import { useEffect, useLayoutEffect, useState } from 'react';
22
import { useI18n } from '../../theme/i18n';
33
import Player from 'xgplayer';
44
import 'xgplayer/dist/index.min.css';
@@ -31,13 +31,17 @@ export default function AnnouncementVideo(props: {
3131
};
3232
}
3333

34-
const [divWidth, setDivWidth] = useState(window.innerWidth);
34+
const [divWidth, setDivWidth] = useState(0);
3535

3636
// 更新宽度的函数
3737
const updateWidth = () => {
3838
setDivWidth(window.innerWidth);
3939
};
4040

41+
useLayoutEffect(() => {
42+
updateWidth();
43+
}, []);
44+
4145
useEffect(() => {
4246
window.addEventListener('resize', updateWidth);
4347

apps/website-new/theme/components/HomeFeature/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function HomeFeature({ features }: { features: Feature[] }) {
5252
}
5353
}}
5454
>
55-
<div className="flex-center">
55+
<div className="flex justify-center items-center">
5656
<div className="w-12 h-12 text-3xl text-center">{icon}</div>
5757
</div>
5858
<h2 className="font-bold text-center">{title}</h2>

apps/website-new/theme/components/HomeFooter/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function HomeFooter() {
8787
</div>
8888
))}
8989
</div>
90-
<div className="flex flex-center">
90+
<div className="flex justify-center items-center">
9191
<h2 className="font-normal text-sm text-gray-600 dark:text-light-600 py-4">
9292
© {new Date().getFullYear()} Module Federation core team. All Rights
9393
Reserved.

apps/website-new/theme/components/HomeHero/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ export function HomeHero({ hero }: { hero: Hero }) {
5050
<Button
5151
className="pl-2 pr-2"
5252
type="a"
53-
text={action.text}
5453
href={normalizeHrefInRuntime(action.link)}
5554
theme={action.theme}
56-
/>
55+
>
56+
{action.text}
57+
</Button>
5758
</div>
5859
))}
5960
</div>
6061
</div>
6162

6263
{hasImage ? (
63-
<div className="modern-doc-home-hero-image m-auto flex-center md:none lg:flex order-1 md:order-2">
64+
<div className="modern-doc-home-hero-image m-auto justify-center items-center md:none lg:flex order-1 md:order-2">
6465
<div className={styles.imgMask}></div>
6566
<img src="/svg.svg" alt={hero.image?.alt} />
6667
</div>

apps/website-new/theme/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import Theme from 'rspress/theme';
21
import { HomeLayout } from './pages';
32
import './index.css';
43

5-
// eslint-disable-next-line import/export
4+
export { HomeLayout };
65
export * from 'rspress/theme';
7-
8-
export default {
9-
...Theme,
10-
HomeLayout,
11-
};

0 commit comments

Comments
 (0)