Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port: Update Docusaurus to 3.6 and enable faster builds #3990

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Fetches all commit history for a single branch. We need commit
# history for accurate "last updated" dates on each page, but fetch
# depth of 0 would fetch all branches which is slow.
# https://github.com/actions/checkout/issues/520#issuecomment-1320838255
fetch-depth: 2147483647

- name: Use Node.js LTS
uses: actions/setup-node@v3
Expand All @@ -43,7 +47,7 @@ jobs:
env:
TAR_OPTIONS: "--remove-files"
with:
path: node_modules/.cache/webpack
path: node_modules/.cache/rspack
key: cache-webpack-${{ github.base_ref || github.ref_name }}

- name: Install Dependencies
Expand Down
17 changes: 5 additions & 12 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const versionsArray = require("./versions.json");

module.exports = {
title: "Zowe Docs",
tagline:
"Combining the past and the present to build the future of Mainframe",
tagline: "Combining the past and the present to build the future of Mainframe",
url: "https://docs.zowe.org/",
baseUrl: "/",
onBrokenLinks: "warn",
Expand All @@ -18,18 +17,12 @@ module.exports = {
comments: true
}
},
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve("esbuild-loader"),
options: {
loader: "tsx",
format: isServer ? "cjs" : undefined,
target: isServer ? "node12" : "es2017",
},
}),
future: {
// https://docusaurus.io/blog/releases/3.6#docusaurus-faster
experimental_faster: true,
},
themeConfig: {
docs: {
docs: {
sidebar: {
hideable: true
}
Expand Down
6,778 changes: 4,168 additions & 2,610 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"docs:pdf:user": "npx docs-to-pdf --initialDocURLs=\"http://localhost:3000/stable/getting-started/overview,http://localhost:3000/stable/user-guide/installandconfig,http://localhost:3000/stable/troubleshoot/troubleshooting\" --contentSelector=\"article\" --paginationSelector=\".pagination-nav__link--next\" --cssStyle=\":root{--ifm-font-size-base: 60%;}\" --excludeSelectors=\".announcementBar_UUUQ,nav.navbar,.docSidebarContainer_3pwe,.docMainContainer_2pgU .col.col--3,footer.footer,.docItemContainer_2szM > .margin-vert--xl > .row > .col:first-child,.pagination-nav,.docsRating,.navbar__inner,.thin-scrollbar\" --coverImage=\"http://localhost:3000/img/zowe-icon.png\" --coverTitle=\"Zowe Documentation\" --outputPDFFilename=\"static/zowe-docs-user.pdf\" --protocolTimeout=1800000"
},
"dependencies": {
"@docusaurus/core": "^3.4.0",
"@docusaurus/plugin-client-redirects": "^3.4.0",
"@docusaurus/plugin-pwa": "^3.4.0",
"@docusaurus/preset-classic": "^3.4.0",
"@mdx-js/react": "^3.0.0",
"@docusaurus/core": "^3.6.1",
"@docusaurus/faster": "^3.6.1",
"@docusaurus/plugin-client-redirects": "^3.6.1",
"@docusaurus/plugin-pwa": "^3.6.1",
"@docusaurus/preset-classic": "^3.6.1",
"@mdx-js/react": "^3.1.0",
"clsx": "^2.1.1",
"esbuild-loader": "^4.2.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-medium-image-zoom": "^5.2.8",
"react-medium-image-zoom": "^5.2.10",
"reading-time": "^1.5.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/theme/DocItem/DocContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { MDXProvider } from "@mdx-js/react";
import {
useDoc,
useDocsVersion,
useTitleFormatter,
} from "@docusaurus/theme-common/internal";
} from "@docusaurus/plugin-content-docs/client";
import { useTitleFormatter } from "@docusaurus/theme-common/internal";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl";
import DocPaginator from "@theme/DocPaginator";
Expand Down
2 changes: 1 addition & 1 deletion src/theme/DocItem/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React from 'react';
import clsx from 'clsx';
import {useWindowSize} from '@docusaurus/theme-common';
import {useDoc} from '@docusaurus/theme-common/internal';
import {useDoc} from '@docusaurus/plugin-content-docs/client';
import DocItemPaginator from '@theme/DocItem/Paginator';
import DocVersionBanner from '@theme/DocVersionBanner';
import DocVersionBadge from '@theme/DocVersionBadge';
Expand Down
2 changes: 1 addition & 1 deletion src/theme/DocItem/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from "react";
import readingTime from "reading-time/lib/reading-time";
import { DocProvider } from "@docusaurus/theme-common/internal";
import { DocProvider } from "@docusaurus/plugin-content-docs/client";

//Components
import { DocContent } from "./DocContent";
Expand Down
3 changes: 1 addition & 2 deletions src/theme/DocVersionBanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import React from 'react';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Link from '@docusaurus/Link';
import Translate from '@docusaurus/Translate';
import {useActivePlugin, useDocVersionSuggestions} from '@docusaurus/plugin-content-docs/client';
import {useActivePlugin, useDocsVersion, useDocVersionSuggestions} from '@docusaurus/plugin-content-docs/client';
import {useDocsPreferredVersion} from '@docusaurus/theme-common';
import {useDocsVersion} from "@docusaurus/theme-common/internal";

function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/theme/MDXComponents/Tpsr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import {
useDocsVersion,
} from "@docusaurus/theme-common/internal";
} from "@docusaurus/plugin-content-docs/client";

function Tpsr() {
const { siteConfig } = useDocusaurusContext();
Expand Down
2 changes: 1 addition & 1 deletion src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useActiveDocContext,
} from '@docusaurus/plugin-content-docs/client';
import {useDocsPreferredVersion} from '@docusaurus/theme-common';
import {useDocsVersionCandidates} from '@docusaurus/theme-common/internal';
import {useDocsVersionCandidates} from '@docusaurus/plugin-content-docs/client';
import {translate} from '@docusaurus/Translate';
import {useLocation} from '@docusaurus/router';
import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';
Expand Down
Loading