Skip to content

Commit 1fe4fcc

Browse files
committed
Bump docusaurus to v3.9 latest
Bumping docosaurus to v3.9 along with adding the following: * Replace webpack optimizations with experimental_faster package which works with 3.9 while the webpack is breaking the builds * Replace latest setup node action with new node version 20 required by docusaurus builds * Fix broken escape characters, backslashes `\` break the build and are replaced with single quotes * Fix broken imports * Fix broken configuration and paths Signed-off-by: Martin Dekov <martin.dekov@suse.com>
1 parent f3c3aa4 commit 1fe4fcc

File tree

13 files changed

+6305
-4259
lines changed

13 files changed

+6305
-4259
lines changed

.github/workflows/pull-request.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
with:
1818
ref: ${{ github.event.pull_request.head.sha }}
1919

20-
- name: Set up Node.js 18
21-
uses: actions/setup-node@v4
20+
- name: Set up Node.js 20
21+
uses: actions/setup-node@v6
2222
with:
23-
node-version: 18
23+
node-version: 20
2424

2525
- name: Install dependencies
2626
run: |
@@ -43,10 +43,10 @@ jobs:
4343
pull-requests: write
4444
needs: prepare
4545
steps:
46-
- name: Set up Node.js 18
47-
uses: actions/setup-node@v4
46+
- name: Set up Node.js 20
47+
uses: actions/setup-node@v6
4848
with:
49-
node-version: 18
49+
node-version: 20
5050

5151
- name: Install dependencies
5252
run: |

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18-
- name: Set up Node.js 18
19-
uses: actions/setup-node@v4
18+
- name: Set up Node.js 20
19+
uses: actions/setup-node@v6
2020
with:
21-
node-version: 18
21+
node-version: 20
2222

2323
- name: Install dependencies
2424
run: |

babel.config.js

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

docs/troubleshooting/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ After you obtain a copy of the kubeconfig file, run the following script against
148148

149149
:::note
150150

151-
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
151+
You must replace `<VIP>` with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
152152

153153
:::
154154

docusaurus.config.js

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

4-
const lightCodeTheme = require('prism-react-renderer/themes/github');
5-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
4+
const {themes} = require('prism-react-renderer');
5+
const lightCodeTheme = themes.github;
6+
const darkCodeTheme = themes.dracula;
67

78
/** @type {import('@docusaurus/types').DocusaurusConfig} */
89
const config = {
910
title: "Harvester",
1011
tagline: "The open-source hyperconverged infrastructure solution for a cloud-native world",
1112
url: "https://docs.harvesterhci.io",
1213
baseUrl: "/",
13-
onBrokenLinks: "warn",
14-
onBrokenMarkdownLinks: "warn",
14+
markdown: {
15+
hooks: {
16+
onBrokenMarkdownLinks: "warn",
17+
},
18+
},
1519
favicon: "img/favicon.ico",
1620
organizationName: "harvester",
1721
projectName: "docs",
@@ -27,27 +31,9 @@ const config = {
2731
},
2832
},
2933
},
30-
webpack: {
31-
jsLoader: (isServer) => ({
32-
loader: require.resolve("swc-loader"),
33-
options: {
34-
jsc: {
35-
parser: {
36-
syntax: "typescript",
37-
tsx: true,
38-
},
39-
target: "es2019",
40-
transform: {
41-
react: {
42-
runtime: "automatic",
43-
},
44-
},
45-
},
46-
module: {
47-
type: isServer ? "commonjs" : "es6",
48-
},
49-
},
50-
}),
34+
future: {
35+
v4: true,
36+
experimental_faster: true,
5137
},
5238
themes: ["docusaurus-theme-openapi-docs"],
5339
presets: [

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@
2020
"gen-pdf-docs": "docs-to-pdf docusaurus --initialDocURLs='http://localhost:3000' --contentSelector='article' --paginationSelector='a.pagination-nav__link.pagination-nav__link--next' --excludeSelectors='.margin-vert--xl a,[class^='tocCollapsible'],.breadcrumbs,.theme-edit-this-page' --excludePaths='/v1.3/api/' --protocolTimeout=360000 --outputPDFFilename=harvester.pdf"
2121
},
2222
"dependencies": {
23-
"@docusaurus/core": "^2.4.0",
24-
"@docusaurus/plugin-client-redirects": "^2.4.0",
25-
"@docusaurus/plugin-content-blog": "^2.4.0",
26-
"@docusaurus/plugin-content-docs": "^2.4.0",
27-
"@docusaurus/plugin-content-pages": "^2.4.0",
28-
"@docusaurus/plugin-debug": "^2.4.0",
29-
"@docusaurus/preset-classic": "^2.4.0",
30-
"@mdx-js/react": "^1.6.22",
23+
"@docusaurus/core": "^3.9.0",
24+
"@docusaurus/faster": "^3.9.0",
25+
"@docusaurus/plugin-client-redirects": "^3.9.0",
26+
"@docusaurus/plugin-content-blog": "^3.9.0",
27+
"@docusaurus/plugin-content-docs": "^3.9.0",
28+
"@docusaurus/plugin-content-pages": "^3.9.0",
29+
"@docusaurus/plugin-debug": "^3.9.0",
30+
"@docusaurus/preset-classic": "^3.9.0",
31+
"@mdx-js/react": "^3.0.0",
3132
"clsx": "^1.1.1",
3233
"docs-to-pdf": "^0.6.2",
33-
"docusaurus-plugin-image-zoom": "^1.0.0",
34-
"docusaurus-plugin-openapi-docs": "^2.1.2",
35-
"docusaurus-theme-openapi-docs": "^2.1.2",
36-
"prism-react-renderer": "^1.3.1",
34+
"docusaurus-plugin-image-zoom": "^3.0.1",
35+
"docusaurus-plugin-openapi-docs": "^4.5.1",
36+
"docusaurus-theme-openapi-docs": "^4.5.1",
37+
"prism-react-renderer": "^2.4.0",
3738
"react": "^18.2.0",
3839
"react-dom": "^18.2.0",
3940
"remark-cli": "^11.0.0",

sidebars.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
// @ts-check
1313

14+
const apiSidebar = require("./docs/api/sidebar.ts");
15+
1416
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
1517
const sidebars = {
1618
docs: [{ type: 'autogenerated', dirName: '.' }],
@@ -24,7 +26,7 @@ const sidebars = {
2426
description:
2527
"This is the API doc of the Harvester server. The APIs are broken down into the categories below:",
2628
},
27-
items: require("./docs/api/sidebar.js"),
29+
items: apiSidebar.default || apiSidebar,
2830
},
2931
],
3032
};

src/theme/DocVersionBanner/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import Translate from '@docusaurus/Translate';
77
import {
88
useActivePlugin,
99
useDocVersionSuggestions,
10+
useDocsVersion,
11+
useDocsPreferredVersion,
1012
} from '@docusaurus/plugin-content-docs/client';
1113
import {ThemeClassNames} from '@docusaurus/theme-common';
12-
import {
13-
useDocsPreferredVersion,
14-
useDocsVersion,
15-
} from '@docusaurus/theme-common/internal';
1614
function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
1715
return (
1816
<Translate

versioned_docs/version-v1.4/troubleshooting/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ After you obtain a copy of the kubeconfig file, run the following script against
148148

149149
:::note
150150

151-
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
151+
You must replace `<VIP>` with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
152152

153153
:::
154154

versioned_docs/version-v1.5/troubleshooting/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ After you obtain a copy of the kubeconfig file, run the following script against
146146

147147
:::note
148148

149-
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
149+
You must replace `<VIP>` with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
150150

151151
:::
152152

0 commit comments

Comments
 (0)