Skip to content

Commit 0bc2561

Browse files
authored
chore: upgrade rspress & use @callstack/rspress-preset (#570)
* chore: upgrade rspress & use preset * chore: changeset
1 parent 7db5dbc commit 0bc2561

File tree

8 files changed

+298
-1257
lines changed

8 files changed

+298
-1257
lines changed

.changeset/long-rockets-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'rock-docs': patch
3+
---
4+
5+
Use `@callstack/rspress-preset` & upgrade `@rspress/core` to 2.0.0-beta.32 &

pnpm-lock.yaml

Lines changed: 257 additions & 1192 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
"preview": "rspress preview"
99
},
1010
"dependencies": {
11-
"@callstack/rspress-theme": "^0.3.1",
12-
"@rspress/plugin-llms": "2.0.0-beta.21",
13-
"rsbuild-plugin-open-graph": "^1.0.2",
14-
"rspress": "2.0.0-beta.21",
15-
"rspress-plugin-sitemap": "^1.1.2",
16-
"rspress-plugin-vercel-analytics": "^0.3.0"
11+
"@rspress/core": "2.0.0-beta.32",
12+
"@callstack/rspress-preset": "~0.4.1"
1713
},
1814
"devDependencies": {
1915
"@types/node": "^18.11.17",

website/rspress.config.ts

Lines changed: 29 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,32 @@
1-
import * as path from 'node:path';
2-
import { pluginCallstackTheme } from '@callstack/rspress-theme/plugin';
3-
import { pluginLlms } from '@rspress/plugin-llms';
4-
import { pluginOpenGraph } from 'rsbuild-plugin-open-graph';
5-
import { defineConfig } from 'rspress/config';
6-
import pluginSitemap from 'rspress-plugin-sitemap';
7-
import vercelPluginAnalytics from 'rspress-plugin-vercel-analytics';
1+
import path from 'node:path';
2+
import url from 'node:url';
3+
import { withCallstackPreset } from '@callstack/rspress-preset';
4+
import { defineConfig, type RspressPlugin } from '@rspress/core';
85

9-
export default defineConfig({
10-
root: path.join(__dirname, 'src'),
11-
title: 'Rock',
12-
icon: '/logo.svg',
13-
outDir: 'build',
14-
route: {
15-
cleanUrls: true,
16-
},
17-
logo: {
18-
light: '/logo-light.svg',
19-
dark: '/logo-dark.svg',
20-
},
21-
builderConfig: {
22-
plugins: [
23-
pluginOpenGraph({
24-
title: 'Rock',
25-
type: 'website',
26-
url: 'https://rockjs.dev',
27-
image: 'https://rockjs.dev/og-image.jpg',
28-
description:
29-
'Easy to adopt. Simple to scale. Built for flexibility from day one',
30-
twitter: {
31-
site: '@rockjs_dev',
32-
card: 'summary_large_image',
33-
},
34-
}),
35-
],
36-
},
37-
themeConfig: {
38-
socialLinks: [
39-
{
40-
icon: 'github',
41-
mode: 'link',
42-
content: 'https://github.com/callstack/rock',
6+
const __filename = url.fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
9+
export default withCallstackPreset(
10+
{
11+
context: __dirname,
12+
docs: {
13+
title: 'Rock',
14+
description:
15+
'Easy to adopt. Simple to scale. Built for flexibility from day one',
16+
editUrl: 'https://github.com/callstack/rock/edit/main/website/src',
17+
icon: '/logo.svg',
18+
logoLight: '/logo-light.svg',
19+
logoDark: '/logo-dark.svg',
20+
ogImage: '/og-image.jpg',
21+
rootDir: 'src',
22+
rootUrl: 'https://rockjs.dev',
23+
socials: {
24+
github: 'https://github.com/callstack/rock',
25+
x: 'https://x.com/rockjs_dev',
4326
},
44-
],
27+
},
4528
},
46-
globalStyles: path.join(__dirname, 'theme/styles.css'),
47-
plugins: [
48-
pluginCallstackTheme(),
49-
// @ts-expect-error outdated @rspress/shared declared as dependency
50-
vercelPluginAnalytics(),
51-
pluginLlms({
52-
exclude: ({ page }) => page.routePath.includes('404'),
53-
}),
54-
// @ts-expect-error outdated @rspress/shared declared as dependency
55-
pluginSitemap({ domain: 'https://rockjs.dev' }),
56-
],
57-
});
29+
defineConfig({
30+
outDir: 'build',
31+
}),
32+
);

website/src/docs/brownfield/android.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PackageManagerTabs } from 'rspress/theme';
1+
import { PackageManagerTabs } from '@theme';
22

33
# Integrating with Android Apps
44

website/src/docs/brownfield/ios.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PackageManagerTabs } from 'rspress/theme';
1+
import { PackageManagerTabs } from '@theme';
22

33
# Integrating with iOS Apps
44

website/src/docs/getting-started/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PackageManagerTabs } from 'rspress/theme';
1+
import { PackageManagerTabs } from '@theme';
22

33
# Quick start
44

website/src/docs/getting-started/migrating-from-community-cli.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PackageManagerTabs } from 'rspress/theme';
1+
import { PackageManagerTabs } from '@theme';
22

33
# Migrating from Community CLI
44

@@ -172,4 +172,4 @@ If you prefer to do it manually or encounter any issues, follow the steps below.
172172
github-token: ${{ secrets.GITHUB_TOKEN }}
173173
```
174174
175-
For more setup options see [GitHub Actions configuration](../remote-cache/github-actions/configuration.md)
175+
For more setup options see [GitHub Actions configuration](../github-actions/configuration.md)

0 commit comments

Comments
 (0)