Skip to content

Commit 5c1a796

Browse files
committed
Upgrade to docusaurus 3
1 parent 62119ca commit 5c1a796

23 files changed

+5038
-5078
lines changed

docusaurus.config.js

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
1-
const path = require('path');
1+
import path from 'path';
2+
import remarkNpm2Yarn from '@docusaurus/remark-plugin-npm2yarn';
23

3-
module.exports = {
4+
export default {
45
title: 'React Navigation',
56
tagline: 'Routing and navigation for your React Native apps',
67
url: 'https://reactnavigation.org/',
78
baseUrl: '/',
89
favicon: 'img/favicon.ico',
910
organizationName: 'react-navigation',
1011
projectName: 'react-navigation.github.io',
11-
scripts: [
12-
'https://buttons.github.io/buttons.js',
13-
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
14-
'/js/code-block-buttons.js',
15-
],
12+
scripts: ['/js/snack-helpers.js'],
1613
themeConfig: {
17-
announcementBar: {
18-
id: 'support_ukraine',
19-
content:
20-
'Support Ukraine 🇺🇦 <a target="_blank" rel="noopener noreferrer" href="https://opensource.facebook.com/support-ukraine"> Help Provide Humanitarian Aid to Ukraine</a>.',
21-
backgroundColor: '#e4e0f0',
22-
textColor: '#000',
23-
},
2414
prism: {
25-
theme: require('prism-react-renderer/themes/github'),
26-
darkTheme: require('prism-react-renderer/themes/dracula'),
15+
theme: require('prism-react-renderer').themes.github,
16+
darkTheme: require('prism-react-renderer').themes.dracula,
2717
},
2818
algolia: {
2919
appId: 'QCWXRU195A',
@@ -52,13 +42,6 @@ module.exports = {
5242
{
5343
type: 'docsVersionDropdown',
5444
position: 'left',
55-
dropdownActiveClassDisabled: true,
56-
dropdownItemsAfter: [
57-
{
58-
to: '/versions',
59-
label: 'All versions',
60-
},
61-
],
6245
},
6346
],
6447
},
@@ -141,7 +124,6 @@ module.exports = {
141124
},
142125
},
143126
plugins: [
144-
path.resolve(__dirname, './src/plugins/docusaurus-plugin-redirect-html'),
145127
[
146128
'@docusaurus/plugin-client-redirects',
147129
{
@@ -159,13 +141,17 @@ module.exports = {
159141
'@docusaurus/preset-classic',
160142
{
161143
docs: {
162-
docLayoutComponent: require.resolve('./src/pages/layouts/DocPage.js'),
163-
docItemComponent: require.resolve('./src/pages/layouts/DocItem.js'),
164144
editUrl:
165145
'https://github.com/react-navigation/react-navigation.github.io/edit/main/',
166-
remarkPlugins: [require('./src/plugins/remark-npm2yarn')],
167146
includeCurrentVersion: false,
168147
lastVersion: '6.x',
148+
remarkPlugins: [[remarkNpm2Yarn, { sync: true }]],
149+
},
150+
blog: {
151+
remarkPlugins: [[remarkNpm2Yarn, { sync: true }]],
152+
},
153+
pages: {
154+
remarkPlugins: [[remarkNpm2Yarn, { sync: true }]],
169155
},
170156
theme: {
171157
customCss: require.resolve('./src/css/custom.css'),

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
"fetch-sponsors": "node scripts/fetch-sponsors.js"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "2.3.1",
18-
"@docusaurus/plugin-client-redirects": "2.3.1",
19-
"@docusaurus/plugin-google-analytics": "2.3.1",
20-
"@docusaurus/preset-classic": "2.3.1",
21-
"@docusaurus/remark-plugin-npm2yarn": "2.3.1",
22-
"@octokit/graphql": "^4.8.0",
17+
"@docusaurus/core": "3.0.0",
18+
"@docusaurus/plugin-client-redirects": "3.0.0",
19+
"@docusaurus/plugin-google-analytics": "3.0.0",
20+
"@docusaurus/preset-classic": "3.0.0",
21+
"@docusaurus/remark-plugin-npm2yarn": "3.0.0",
22+
"@octokit/graphql": "^7.0.2",
2323
"@react-navigation/core": "^7.0.0-alpha.2",
2424
"escape-html": "^1.0.3",
25-
"mkdirp": "^1.0.4",
25+
"mkdirp": "^3.0.1",
2626
"netlify-plugin-cache": "^1.0.3",
27-
"prism-react-renderer": "^1.1.1",
28-
"react": "^17.0.2",
29-
"react-dom": "^17.0.2",
30-
"react-simple-code-editor": "^0.11.0"
27+
"prism-react-renderer": "^2.3.0",
28+
"react": "^18.2.0",
29+
"react-dom": "^18.2.0",
30+
"react-simple-code-editor": "^0.13.1"
3131
},
3232
"browserslist": {
3333
"production": [
@@ -42,8 +42,8 @@
4242
]
4343
},
4444
"devDependencies": {
45-
"markdownlint": "^0.27.0",
46-
"markdownlint-cli2": "^0.6.0"
45+
"markdownlint": "^0.32.1",
46+
"markdownlint-cli2": "^0.11.0"
4747
},
4848
"packageManager": "[email protected]"
4949
}

src/components/LinkingTester.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import * as React from 'react';
1+
import { useColorMode } from '@docusaurus/theme-common';
22
import { getActionFromState, getStateFromPath } from '@react-navigation/core';
3-
import escape from 'escape-html';
3+
import { Highlight, themes } from 'prism-react-renderer';
4+
import * as React from 'react';
45
import Editor from 'react-simple-code-editor';
5-
import Highlight, { defaultProps } from 'prism-react-renderer';
6-
import github from 'prism-react-renderer/themes/github';
7-
import dracula from 'prism-react-renderer/themes/dracula';
8-
import {useColorMode} from '@docusaurus/theme-common';
96
import RouteMap from './RouteMap';
107

118
const parse = (value) => eval(`(function() { return ${value}; }())`);
129

1310
function Code({ code, theme, language }) {
1411
return (
15-
<Highlight {...defaultProps} code={code} theme={theme} language={language}>
12+
<Highlight code={code} theme={theme} language={language}>
1613
{({ className, style, tokens, getLineProps, getTokenProps }) => (
1714
<pre className={className} style={{ ...style, ...styles.json }}>
1815
{tokens.map((line, i) => (
@@ -29,8 +26,8 @@ function Code({ code, theme, language }) {
2926
}
3027

3128
export default function LinkingTester() {
32-
const {colorMode} = useColorMode();
33-
const theme = colorMode === 'dark' ? dracula : github;
29+
const { colorMode } = useColorMode();
30+
const theme = colorMode === 'dark' ? themes.dracula : themes.github;
3431

3532
const [rawConfig, setRawConfig] = React.useState(
3633
`{
@@ -91,7 +88,7 @@ export default function LinkingTester() {
9188
}
9289
}}
9390
highlight={(code) => (
94-
<Highlight {...defaultProps} code={code} theme={theme} language="jsx">
91+
<Highlight code={code} theme={theme} language="jsx">
9592
{({ tokens, getLineProps, getTokenProps }) =>
9693
tokens.map((line, i) => (
9794
<div {...getLineProps({ line, key: i })}>

src/pages/help.js

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

src/pages/help.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Need help?
3+
description: Resources to get help with React Navigation.
4+
hide_table_of_contents: true
5+
---
6+
7+
# Need help?
8+
9+
If you've encountered a bug with React Navigation, please [post an issue](https://github.com/react-navigation/react-navigation/issues) and be sure to fill out the issue template.
10+
11+
If you believe there is a feature missing, please [create a feature request on Canny](https://react-navigation.canny.io/feature-requests), or if you're feeling up for the task of proposing an API for the feature, [create a discussion](https://github.com/react-navigation/react-navigation/discussions).
12+
13+
If you just need some help, try joining the `#help-react-native` channel on [Reactiflux Discord](https://www.reactiflux.com) or [post a question to StackOverflow](https://stackoverflow.com/questions/tagged/react-navigation). Also be sure to check our [troubleshooting](https://reactnavigation.org/docs/troubleshooting) page for common issues and how to fix them.

src/pages/home/BLM/index.js

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

src/pages/home/BLM/styles.module.css

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

src/pages/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import sponsors from '../data/sponsors';
88
import Splash from './home/Splash';
99
import Features from './home/Features';
1010
import Sponsors from './home/Sponsors';
11-
import BLM from './home/BLM';
1211

1312
const features = [
1413
{
@@ -49,7 +48,6 @@ function Home() {
4948
<Splash />
5049
<Features />
5150
<Sponsors />
52-
<BLM />
5351
</Layout>
5452
);
5553
}

src/pages/layouts/DocItem.js

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

src/pages/layouts/DocPage.js

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

0 commit comments

Comments
 (0)