Skip to content

Commit 3fed4f5

Browse files
yutingyemeta-codesync[bot]
authored andcommitted
Fix website dependency updates and Dependabot grouping (#1631)
Summary: Pull Request resolved: #1631 Several generated Dependabot updates cannot be landed independently. prism-react-renderer 2 changes its theme import API, nth-check 3 is ESM-only while the website dependency tree still has CommonJS consumers, and docusaurus-plugin-internaldocs-fb 1.20.0 hard-depends on Docusaurus 2 theme-mermaid while the site uses Docusaurus 3. The recently added TypeScript 7 dependency is also unused. Apply the compatible updates together: synchronize the official Docusaurus packages at 3.10.2, migrate the Prism theme imports, keep the internal-docs plugin at 1.19.2, retain nth-check 2.1.1 as an exact transitive resolution, update the Algolia client, and remove TypeScript. Remove the obsolete gray-matter patch because the updated Docusaurus graph no longer installs that package. Configure Dependabot to group official Docusaurus packages separately, leave major upgrades in individual PRs for manual migration, and exclude the known-incompatible internal-docs plugin release. The existing frozen install and production website build remain the general compatibility checks for future updates. Reviewed By: jeongseok-meta Differential Revision: D117426152 fbshipit-source-id: 3c86aa6fda383d405b186cf74d0a775d4f077c55
1 parent b0c1916 commit 3fed4f5

5 files changed

Lines changed: 372 additions & 522 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,26 @@ updates:
99
schedule:
1010
interval: "weekly"
1111
groups:
12+
# Docusaurus requires all official packages to use the same version.
13+
docusaurus:
14+
patterns:
15+
- "@docusaurus/*"
16+
update-types:
17+
- "minor"
18+
- "patch"
1219
website-dependencies:
20+
# Keep major upgrades separate because they can require source changes.
1321
patterns:
1422
- "*"
23+
exclude-patterns:
24+
- "@docusaurus/*"
25+
- "docusaurus-plugin-internaldocs-fb"
1526
update-types:
1627
- "minor"
1728
- "patch"
29+
ignore:
30+
# Version 1.20.0 pins @docusaurus/theme-mermaid 2.4.3 and is
31+
# incompatible with Docusaurus 3.
32+
- dependency-name: "docusaurus-plugin-internaldocs-fb"
33+
versions:
34+
- "1.20.0"

‎momentum/website/docusaurus.config.js‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
const lightCodeTheme = require('prism-react-renderer/themes/github');
9-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
8+
const {themes} = require('prism-react-renderer');
109
const {fbContent, fbInternalOnly} = require('docusaurus-plugin-internaldocs-fb/internal');
1110

1211
// With JSDoc @type annotations, IDEs can provide config autocompletion
@@ -17,7 +16,11 @@ const {fbContent, fbInternalOnly} = require('docusaurus-plugin-internaldocs-fb/i
1716
url: 'https://facebookresearch.github.io',
1817
baseUrl: '/momentum/',
1918
onBrokenLinks: 'throw',
20-
onBrokenMarkdownLinks: 'throw',
19+
markdown: {
20+
hooks: {
21+
onBrokenMarkdownLinks: 'throw',
22+
},
23+
},
2124
favicon: 'img/favicon.ico',
2225
organizationName: 'facebookresearch',
2326
projectName: 'momentum',
@@ -175,8 +178,8 @@ const {fbContent, fbInternalOnly} = require('docusaurus-plugin-internaldocs-fb/i
175178
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc. Built with Docusaurus.`,
176179
},
177180
prism: {
178-
theme: lightCodeTheme,
179-
darkTheme: darkCodeTheme,
181+
theme: themes.github,
182+
darkTheme: themes.dracula,
180183
},
181184
}),
182185
});

‎momentum/website/package.json‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,28 @@
2323
"postinstall": "patch-package --error-on-fail"
2424
},
2525
"dependencies": {
26-
"@algolia/client-search": "^5.56.0",
27-
"@docusaurus/core": "^3.2.1",
28-
"@docusaurus/preset-classic": "^3.2.1",
29-
"@docusaurus/theme-classic": "^3.2.1",
26+
"@algolia/client-search": "^5.57.0",
27+
"@docusaurus/core": "3.10.2",
28+
"@docusaurus/preset-classic": "3.10.2",
29+
"@docusaurus/theme-classic": "3.10.2",
3030
"@mdx-js/react": "^3.0.1",
3131
"clsx": "^2.1.1",
32-
"docusaurus-plugin-internaldocs-fb": "^1.19.2",
33-
"nth-check": ">=2.0.1",
34-
"prism-react-renderer": "<2.0.0",
32+
"docusaurus-plugin-internaldocs-fb": "1.19.2",
33+
"prism-react-renderer": "^2.4.1",
3534
"react": "^18.2.0",
3635
"react-dom": "^18.2.0",
37-
"react-loadable": "^5.5.0",
38-
"typescript": "^7.0.2"
36+
"react-loadable": "^5.5.0"
3937
},
4038
"resolutions": {
4139
"**/path-to-regexp": "^3.3.0",
4240
"dompurify": ">=3.4.0",
4341
"**/minimatch": "^3.1.4",
4442
"**/serialize-javascript": ">=7.0.5",
45-
"**/nth-check": ">=2.0.1",
43+
"**/nth-check": "2.1.1",
4644
"**/webpack-dev-server": ">=5.2.1",
4745
"**/on-headers": ">=1.1.0",
4846
"**/image-size": "2.0.2",
4947
"**/js-yaml": "^4.3.1",
50-
"**/gray-matter": ">=4.0.3",
5148
"**/node-forge": ">=1.4.0",
5249
"@docsearch/react": "^4.6.3",
5350
"@docusaurus/**/mdast-util-to-hast": "13.2.1",
@@ -74,7 +71,7 @@
7471
]
7572
},
7673
"engines": {
77-
"node": ">=16",
74+
"node": ">=20",
7875
"npm": "use yarn instead",
7976
"yarn": ">=1.22.0 <2"
8077
},

‎momentum/website/patches/gray-matter+4.0.3.patch‎

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

0 commit comments

Comments
 (0)