Skip to content

Commit bc96b80

Browse files
jbromathymikee
andauthored
feat: add compatibility with @rspress/core@2.0.0-rc.3 (#91)
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
1 parent 4cc0afa commit bc96b80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1767
-1787
lines changed

packages/preset/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@
4242
},
4343
"dependencies": {
4444
"@callstack/rspress-theme": "workspace:*",
45-
"@rspress/plugin-llms": "2.0.0-beta.35",
46-
"@rspress/plugin-sitemap": "2.0.0-beta.35",
45+
"@rspress/plugin-llms": "2.0.0-rc.3",
46+
"@rspress/plugin-sitemap": "2.0.0-rc.3",
4747
"@vercel/analytics": "^1.5.0",
4848
"rsbuild-plugin-open-graph": "^1.0.2",
4949
"zod": "^3.23.8"
5050
},
5151
"peerDependencies": {
52-
"@rspress/core": "2.0.0-beta.35"
52+
"@rspress/core": "2.0.0-rc.3"
5353
},
5454
"devDependencies": {
5555
"@microsoft/api-extractor": "^7.52.8",
5656
"@rslib/core": "^0.10.5",
57-
"@rspress/core": "2.0.0-beta.35",
57+
"@rspress/core": "2.0.0-rc.3",
5858
"@types/node": "^22",
59-
"typescript": "^5.8.3"
59+
"typescript": "^5.9.3"
6060
}
6161
}

packages/preset/src/preset.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const CALLSTACK_BASE_URL = 'https://www.callstack.com';
1414
const CALLSTACK_CONTACT_URL = 'https://www.callstack.com/contact';
1515

1616
type SupportedSocialLinks = Exclude<
17-
Parameters<typeof SocialLinksComponent>[0]['socialLinks'][number]['icon'],
17+
NonNullable<
18+
Parameters<typeof SocialLinksComponent>[0]['socialLinks']
19+
>[number]['icon'],
1820
{ svg: string }
1921
>;
2022
type Socials = Partial<Record<SupportedSocialLinks, string>>;
@@ -139,7 +141,6 @@ const createPreset = (config: PresetConfig): UserConfig => {
139141
},
140142
editLink: {
141143
docRepoBaseUrl: docs.editUrl,
142-
text: 'Edit this page on GitHub',
143144
},
144145
socialLinks: createSocialLinks(docs.socials),
145146
},

packages/tester/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
"preview": "rspress preview"
1212
},
1313
"dependencies": {
14-
"@rspress/core": "^2.0.0-beta.35",
14+
"@rspress/core": "^2.0.0-rc.3",
1515
"@callstack/rspress-preset": "workspace:*",
1616
"@callstack/rspress-theme": "workspace:*"
1717
},
1818
"devDependencies": {
1919
"@types/node": "^22",
20-
"@types/react": "^19"
20+
"@types/react": "^19.2.0"
2121
}
2222
}

packages/tester/rspress.config.ts

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,63 @@
11
import * as path from 'node:path';
22
import { withCallstackPreset } from '@callstack/rspress-preset';
3+
import { pluginCallstackTheme } from '@callstack/rspress-theme/plugin';
4+
import { defineConfig } from '@rspress/core';
35

4-
export default withCallstackPreset(
6+
const isDev = process.env.NODE_ENV === 'development';
7+
8+
const themeOptions = {
9+
content: {
10+
homeBannerButtonText: 'Home Banner Button Text',
11+
homeBannerDescription: 'Home Banner Description',
12+
homeBannerHeadline: 'Home Banner Headline',
13+
outlineCTAButtonText: 'Outline CTA Button Text',
14+
outlineCTADescription: 'Outline CTA Description',
15+
outlineCTAHeadline: 'Outline CTA Headline',
16+
},
17+
};
18+
19+
const devConfig = defineConfig({
20+
root: path.join(__dirname, 'docs'),
21+
title: 'My Site',
22+
description: 'My Site Description',
23+
logo: {
24+
dark: '/logo-dark.png',
25+
light: '/logo-light.png',
26+
},
27+
themeConfig: {
28+
editLink: {
29+
docRepoBaseUrl: 'https://github.com/callstack/rspress-theme',
30+
},
31+
enableScrollToTop: false,
32+
socialLinks: [
33+
{
34+
icon: 'github',
35+
mode: 'link',
36+
content: 'https://github.com/callstack/rspress-theme',
37+
},
38+
{ icon: 'X', mode: 'link', content: 'https://x.com/repack_rn' },
39+
{
40+
icon: 'discord',
41+
mode: 'link',
42+
content: 'https://github.com/callstack/rspress-theme',
43+
},
44+
],
45+
},
46+
plugins: [pluginCallstackTheme(themeOptions)],
47+
builderConfig: {
48+
performance: {
49+
buildCache: false,
50+
},
51+
},
52+
});
53+
54+
const prodConfig = withCallstackPreset(
555
{
656
context: path.join(__dirname),
757
docs: {
858
title: 'My Site',
59+
logoDark: '/logo-dark.png',
60+
logoLight: '/logo-light.png',
961
description: 'My Site Description',
1062
editUrl: 'https://github.com/callstack/rspress-theme',
1163
rootDir: 'docs',
@@ -16,16 +68,7 @@ export default withCallstackPreset(
1668
discord: 'https://github.com/callstack/rspress-theme',
1769
},
1870
},
19-
theme: {
20-
content: {
21-
homeBannerButtonText: 'Home Banner Button Text',
22-
homeBannerDescription: 'Home Banner Description',
23-
homeBannerHeadline: 'Home Banner Headline',
24-
outlineCTAButtonText: 'Outline CTA Button Text',
25-
outlineCTADescription: 'Outline CTA Description',
26-
outlineCTAHeadline: 'Outline CTA Headline',
27-
},
28-
},
71+
theme: themeOptions,
2972
},
3073
{
3174
builderConfig: {
@@ -35,3 +78,5 @@ export default withCallstackPreset(
3578
},
3679
}
3780
);
81+
82+
export default isDev ? devConfig : prodConfig;

packages/tester/theme/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Announcement, VersionBadge } from '@callstack/rspress-theme';
2-
import { Layout as RspressLayout } from '@rspress/core/theme';
2+
import { Layout as RspressLayout } from '@rspress/core/theme-original';
33

44
const Layout = () => {
55
return (
@@ -18,4 +18,4 @@ const Layout = () => {
1818

1919
export { Layout };
2020

21-
export * from '@rspress/core/theme';
21+
export * from '@rspress/core/theme-original';

packages/theme/package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
"typecheck": "tsc --noEmit"
4646
},
4747
"peerDependencies": {
48-
"@rspress/core": "^2.0.0-beta.35",
49-
"react": "^19.0.0"
48+
"@rspress/core": "^2.0.0-rc.3",
49+
"react": "^19.2.0",
50+
"react-dom": "^19.2.0"
5051
},
5152
"devDependencies": {
5253
"@microsoft/api-extractor": "^7.52.8",
@@ -55,10 +56,12 @@
5556
"@rsbuild/plugin-sass": "^1.3.3",
5657
"@rsbuild/plugin-svgr": "^1.2.1",
5758
"@rslib/core": "^0.10.5",
58-
"@rspress/core": "^2.0.0-beta.35",
59+
"@rspress/core": "^2.0.0-rc.3",
5960
"@types/node": "^22",
60-
"@types/react": "^19",
61-
"react": "^19",
62-
"typescript": "^5.8.3"
61+
"@types/react": "^19.2.0",
62+
"@types/react-dom": "^19.2.0",
63+
"react": "^19.2.0",
64+
"react-dom": "^19.2.0",
65+
"typescript": "^5.9.3"
6366
}
6467
}
Lines changed: 3 additions & 0 deletions
Loading
104 KB
Binary file not shown.
923 Bytes
Binary file not shown.

packages/theme/src/assets/menu.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)