Skip to content

Commit 6f77a6e

Browse files
chore: upgrade docusaurus from 3.2.1 to 3.7.0 (#52 by @markrickert)
To do this upgrade, I generated a brand new docusarus project with their cli tool, copied over all the relevant content to this new instance & ensured everything worked. Then deleted the primary instance’s files, copied over the upgraded instance’s files, and compared the git diffs. Turns out that there weren’t that many changes needed. The babel customization file didn’t need to be there (it’s on by default) and many of the packages listed in the package.json are no longer needed. Co-authored-by: Jamon Holmgren <[email protected]>
1 parent 376c3e8 commit 6f77a6e

File tree

5 files changed

+3531
-4721
lines changed

5 files changed

+3531
-4721
lines changed

babel.config.js

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

docusaurus.config.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

4-
import {Options} from '@docusaurus/preset-classic';
5-
import {irCode} from './src/themes/ir-code';
6-
import type {Config} from '@docusaurus/types';
7-
import type * as Preset from '@docusaurus/preset-classic';
4+
import { irCode } from './src/themes/ir-code';
5+
import type { Config } from '@docusaurus/types';
6+
import type { Options, ThemeConfig } from '@docusaurus/preset-classic';
87
import sidebars from './sidebars';
98

10-
119
const lightCodeTheme = irCode.light;
1210
const darkCodeTheme = irCode.dark;
1311

14-
const navbarItems = Object.keys(sidebars).map((sidebarId):{
15-
type:string,
16-
sidebarId:string,
17-
position:'left' | 'right',
18-
label: string,
12+
const navbarItems = Object.keys(sidebars).map((sidebarId): {
13+
type: string;
14+
sidebarId: string;
15+
position: 'left' | 'right';
16+
label: string;
1917
} => {
2018
return {
2119
type: 'docSidebar',
@@ -25,10 +23,7 @@ const navbarItems = Object.keys(sidebars).map((sidebarId):{
2523
};
2624
});
2725

28-
29-
30-
31-
const config:Config = {
26+
const config: Config = {
3227
title: 'Open Source at Infinite Red',
3328
tagline: 'Tools to supercharge your React Native development!',
3429
favicon: 'img/favicon.ico',
@@ -48,9 +43,9 @@ const config:Config = {
4843
onBrokenLinks: 'throw',
4944
onBrokenMarkdownLinks: 'throw',
5045

51-
// Even if you don't use internalization, you can use this field to set useful
52-
// metadata like html lang. For example, if your site is Chinese, you may want
53-
// to replace "en" with "zh-Hans".
46+
// Even if you don't use internationalization, you can use this field to set
47+
// useful metadata like html lang. For example, if your site is Chinese, you
48+
// may want to replace 'en' with 'zh-Hans'.
5449
i18n: {
5550
defaultLocale: 'en',
5651
locales: ['en'],
@@ -63,7 +58,7 @@ const config:Config = {
6358
presets: [
6459
[
6560
'classic',
66-
({
61+
{
6762
docs: {
6863
sidebarPath: require.resolve('./sidebars.js'),
6964
routeBasePath: '/',
@@ -75,8 +70,8 @@ const config:Config = {
7570
trackingID: 'G-H431N07LX7',
7671
anonymizeIP: true,
7772
},
78-
}) satisfies Options,
79-
] ,
73+
} satisfies Options,
74+
],
8075
],
8176

8277
themeConfig:

package.json

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,20 @@
1717
"postinstall": "node ./scripts/generate-slug.ts"
1818
},
1919
"dependencies": {
20-
"@docusaurus/core": "3.2.1",
21-
"@docusaurus/preset-classic": "3.2.1",
22-
"@docusaurus/remark-plugin-npm2yarn": "3.2.1",
20+
"@docusaurus/core": "3.7.0",
21+
"@docusaurus/preset-classic": "3.7.0",
2322
"@mdx-js/react": "^3.0.0",
24-
"brfs": "^2.0.2",
25-
"browserify-fs": "^1.0.0",
26-
"buffer": "^6.0.3",
27-
"clsx": "^1.2.1",
28-
"https-browserify": "^1.0.0",
29-
"os-browserify": "^0.3.0",
30-
"path-browserify": "^1.0.1",
31-
"prism-react-renderer": "^2.3.1",
32-
"process": "^0.11.10",
33-
"react": "^18.2.0",
34-
"react-dom": "^18.2.0",
35-
"stream-browserify": "^3.0.0",
36-
"stream-http": "^3.2.0",
37-
"util": "^0.12.5"
23+
"clsx": "^2.0.0",
24+
"prism-react-renderer": "^2.3.0",
25+
"react": "^19.0.0",
26+
"react-dom": "^19.0.0"
3827
},
3928
"devDependencies": {
40-
"@docusaurus/module-type-aliases": "3.1.1",
41-
"@docusaurus/tsconfig": "^3.0.0",
42-
"@docusaurus/types": "3.1.1",
43-
"@types/react": "^18.2.29",
44-
"typescript": "^5.2.2"
29+
"@docusaurus/module-type-aliases": "3.7.0",
30+
"@docusaurus/tsconfig": "3.7.0",
31+
"@docusaurus/types": "3.7.0",
32+
"@types/react": "^19.0.0",
33+
"typescript": "~5.6.2"
4534
},
4635
"browserslist": {
4736
"production": [
@@ -50,9 +39,9 @@
5039
"not op_mini all"
5140
],
5241
"development": [
53-
"last 1 chrome version",
54-
"last 1 firefox version",
55-
"last 1 safari version"
42+
"last 3 chrome version",
43+
"last 3 firefox version",
44+
"last 5 safari version"
5645
]
5746
},
5847
"engines": {

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"compilerOptions": {
55
"baseUrl": ".",
66
"jsx": "react",
7-
"resolveJsonModule": true,
8-
}
7+
"resolveJsonModule": true
8+
},
9+
"exclude": [".docusaurus", "build"]
910
}

0 commit comments

Comments
 (0)