Skip to content

Commit 7b551f5

Browse files
authored
chore: use rspress for docs (#902)
### Summary This migrates the documentation to use rspress with callstack theme. <img width="1970" height="1992" alt="CleanShot 2025-10-24 at 05 57 44@2x" src="https://github.com/user-attachments/assets/d581dbd4-f42e-498d-8ce7-26805db835de" /> ### Test plan Run `yarn docs dev` in the repo.
1 parent 75a5754 commit 7b551f5

31 files changed

+1966
-3423
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,43 @@ on:
88
- '.github/workflows/deploy-docs.yml'
99
- 'docs/**'
1010

11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
1116
jobs:
12-
deploy-docs:
17+
build:
1318
runs-on: ubuntu-latest
1419
steps:
1520
- name: Checkout
16-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
uses: actions/checkout@08c6903 # v5.0.0
22+
with:
23+
fetch-depth: 0
1724

1825
- name: Setup
1926
uses: ./.github/actions/setup
2027

21-
- name: Cache build
22-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
23-
with:
24-
path: |
25-
docs/.next/cache
26-
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
27-
restore-keys: |
28-
${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}
29-
${{ runner.os }}-nextjs-
28+
- name: Setup Pages
29+
uses: actions/configure-pages@983d773 # v5.0.0
3030

31-
- name: Build docs
31+
- name: Build with Rspress
32+
working-directory: docs
3233
run: |
3334
yarn docs build
34-
touch docs/out/.nojekyll
3535
36-
- name: Deploy to GitHub Pages
37-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@7b1f4a7 # v4.0.0
3838
with:
39-
branch: gh-pages
40-
folder: docs/out
39+
path: docs/doc_build
4140

42-
permissions:
43-
contents: write
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
needs: build
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@d6db901 # v4.0.5

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ typings/
8484
# generated files
8585
lib/
8686
typescript/
87+
doc_build/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index c47a273839fed26bdfccc00bc90fbc1df95e43c9..bf8392629cf394717fa08cdcfeb5ce48c73f5856 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -125,7 +125,7 @@ const rsbuildPluginLlms = ({ disableSSGRef, baseRef, pageDataList, routes, title
6+
const disableSSG = disableSSGRef.current;
7+
const newPageDataList = mergeRouteMetaWithPageData(routes, pageDataList, langRef.current, include, exclude);
8+
const navList = Array.isArray(nav) ? nav.map((i)=>{
9+
- const nav = i.nav.default || i.nav;
10+
+ const nav = i.nav?.default || i.nav || [];
11+
const lang = i.lang;
12+
return nav.map((i)=>({
13+
...i,

docs/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/assets/favicon.png

10.4 KB
Loading

docs/components/Hero.module.css

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.container {
2+
margin: 0 auto;
3+
width: calc(100% - 8 * 2px);
4+
display: flex;
5+
flex-direction: column;
6+
justify-content: center;
7+
align-items: flex-start;
8+
position: relative;
9+
overflow: hidden;
10+
padding: calc(var(--rp-content-padding-y) * 1.5) 0 var(--rp-content-padding-y)
11+
0;
12+
}
13+
14+
.heroMain {
15+
display: flex;
16+
flex-direction: column;
17+
text-wrap: balance;
18+
max-width: 55%;
19+
}
20+
21+
.heroName {
22+
color: var(--rp-c-text-1);
23+
font-family: 'Alliance No.2', Arial, sans-serif;
24+
font-size: 64px;
25+
font-style: normal;
26+
font-weight: 400 !important;
27+
line-height: 1.1 !important;
28+
}
29+
30+
.featureList {
31+
display: flex;
32+
flex-wrap: wrap;
33+
align-items: stretch;
34+
display: flex;
35+
gap: 32px;
36+
width: 100%;
37+
margin-top: calc(var(--rp-content-padding-y) * 2);
38+
}
39+
40+
.feature {
41+
display: flex;
42+
flex: 1;
43+
position: relative;
44+
color: var(--rp-c-text-1);
45+
border: 1px dashed var(--rp-c-divider);
46+
border-radius: var(--rp-radius-small);
47+
flex-direction: column;
48+
align-items: flex-start;
49+
gap: 16px;
50+
padding: 32px;
51+
}
52+
53+
.featureTitle {
54+
color: var(--rp-c-text-1);
55+
font-size: 24px;
56+
font-weight: 600;
57+
line-height: 1.2;
58+
}
59+
60+
.featureDescription {
61+
flex: 1;
62+
color: var(--rp-c-text-2);
63+
font-size: 16px;
64+
line-height: 1.5;
65+
}
66+
67+
.codeBlock {
68+
position: relative;
69+
width: 100%;
70+
background-color: var(--rp-code-block-bg);
71+
color: var(--rp-code-block-color);
72+
margin: 16px 0;
73+
}
74+
75+
.codeBlock pre {
76+
padding: 18px 56px 18px 0;
77+
}

docs/components/Hero.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import styles from './Hero.module.css';
2+
import { Button } from '@callstack/rspress-theme';
3+
import { CodeBlockRuntime } from '@rspress/core/theme';
4+
import { transformerNotationHighlight } from '@shikijs/transformers';
5+
6+
export function Hero() {
7+
return (
8+
<div className="rp-relative">
9+
<div
10+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
11+
className={`rp-overflow-hidden rp-max-w-6xl ${styles.container}`}
12+
>
13+
<div className={styles.heroMain}>
14+
<h1 className={styles.heroName}>
15+
Create & build React Native libraries
16+
</h1>
17+
</div>
18+
19+
<div className={styles.featureList}>
20+
<div className={styles.feature}>
21+
<h2 className={styles.featureTitle}>Create</h2>
22+
<p className={styles.featureDescription}>
23+
Scaffold a new React Native library with everything
24+
pre-configured. Choose between templates such as Turbo Modules or
25+
Nitro Modules.
26+
</p>
27+
<div className={styles.codeBlock}>
28+
<CodeBlockRuntime
29+
lang="sh"
30+
code={`npx create-react-native-library@latest`}
31+
shikiOptions={{
32+
transformers: [transformerNotationHighlight()],
33+
}}
34+
/>
35+
</div>
36+
<Button href="/react-native-builder-bob/create">Learn more</Button>
37+
</div>
38+
39+
<div className={styles.feature}>
40+
<h2 className={styles.featureTitle}>Build</h2>
41+
<p className={styles.featureDescription}>
42+
Compile your React Native library to work with multiple tools.
43+
Support Metro, Webpack, Vite, NodeJS & more with a single build.
44+
</p>
45+
<div className={styles.codeBlock}>
46+
<CodeBlockRuntime
47+
lang="sh"
48+
code={`npx react-native-builder-bob@latest init`}
49+
shikiOptions={{
50+
transformers: [transformerNotationHighlight()],
51+
}}
52+
/>
53+
</div>
54+
<Button href="/react-native-builder-bob/build">Learn more</Button>
55+
</div>
56+
</div>
57+
</div>
58+
</div>
59+
);
60+
}

docs/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.module.css' {
2+
const classes: { [key: string]: string };
3+
export default classes;
4+
}

docs/next-env.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/next.config.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)