Skip to content

Commit

Permalink
Docusaurus 3.2.0 Fix (#283)
Browse files Browse the repository at this point in the history
- Updated All Plugins package.json to use docusaurus 3.2.0
- Updated `toNav` function to handle menus that now build with the role of `button` instead of `link`
- `addLeadingSlash` and `addTrailingSlash` are now being imported from `@docusaurus/utils-common`
- Omit `showLastUpdateAuthor` and `showLastUpdateTime` from PluginOptions
  • Loading branch information
Devon-White authored Apr 2, 2024
1 parent a2ef7c9 commit b1deb01
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 366 deletions.
18 changes: 13 additions & 5 deletions cypress/integration/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ function navTo(links: RegExp[], heading: RegExp) {
return false;
});

for (let link of links) {
cy.get("nav.menu")
.findByRole("link", { name: link })
.click({ force: true }); // sometimes the sidebar items get covered by the navbar in CI.
}
links.forEach((linkRegex) => {
cy.get("nav.menu").then(($menu) => {
const navElement = $menu
.find("a")
.toArray()
.find((el) => linkRegex.test(el.innerText));
if (navElement) {
cy.wrap(navElement).click({ force: true });
} else {
cy.log(`No link or button found matching regex: ${linkRegex}`);
}
});
});

cy.findByRole("heading", { name: heading, level: 1 }).should("exist");
}
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^3.0.0",
"@docusaurus/core": "^3.2.0",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
"docusaurus-preset-openapi": "^0.7.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-docusaurus-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/logger": "^3.0.0",
"@docusaurus/logger": "^3.2.0",
"commander": "^5.1.0",
"fs-extra": "^11.0.0",
"lodash": "^4.17.20",
Expand Down
13 changes: 7 additions & 6 deletions packages/docusaurus-plugin-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"watch": "tsc --watch"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0",
"@docusaurus/types": "^3.0.0",
"@docusaurus/module-type-aliases": "^3.2.0",
"@docusaurus/types": "^3.2.0",
"@types/axios": "^0.14.0",
"@types/js-yaml": "^4.0.5",
"@types/json-schema": "^7.0.9",
Expand All @@ -31,10 +31,11 @@
"utility-types": "^3.10.0"
},
"dependencies": {
"@docusaurus/mdx-loader": "^3.0.0",
"@docusaurus/plugin-content-docs": "^3.0.0",
"@docusaurus/utils": "^3.0.0",
"@docusaurus/utils-validation": "^3.0.0",
"@docusaurus/mdx-loader": "^3.2.0",
"@docusaurus/plugin-content-docs": "^3.2.0",
"@docusaurus/utils": "^3.2.0",
"@docusaurus/utils-validation": "^3.2.0",
"@docusaurus/utils-common": "^3.2.0",
"axios": "^0.26.1",
"chalk": "^4.1.2",
"clsx": "^1.2.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/docusaurus-plugin-openapi/src/docs/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ async function doProcessDocMetadata({
| "editLocalizedFiles"
| "numberPrefixParser"
| "breadcrumbs"
| "showLastUpdateTime"
| "showLastUpdateAuthor"
>;
env: DocEnv;
}): Promise<DocMetadataBase> {
Expand Down Expand Up @@ -181,6 +183,8 @@ export function processDocMetadata(args: {
| "editLocalizedFiles"
| "numberPrefixParser"
| "breadcrumbs"
| "showLastUpdateTime"
| "showLastUpdateAuthor"
>;
env: DocEnv;
}): Promise<DocMetadataBase> {
Expand Down
8 changes: 2 additions & 6 deletions packages/docusaurus-plugin-openapi/src/docs/slug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ import type {
NumberPrefixParser,
DocMetadataBase,
} from "@docusaurus/plugin-content-docs";
import {
addLeadingSlash,
addTrailingSlash,
isValidPathname,
resolvePathname,
} from "@docusaurus/utils";
import { isValidPathname, resolvePathname } from "@docusaurus/utils";
import { addLeadingSlash, addTrailingSlash } from "@docusaurus/utils-common";

import { isCategoryIndex, toCategoryIndexMatcherParam } from "./docs";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"watch": "tsc --watch"
},
"devDependencies": {
"@docusaurus/types": "^3.0.0",
"@docusaurus/types": "^3.2.0",
"@types/webpack-dev-server": "^4.7.2"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-preset-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"watch": "tsc --watch"
},
"devDependencies": {
"@docusaurus/types": "^3.0.0"
"@docusaurus/types": "^3.2.0"
},
"dependencies": {
"@docusaurus/preset-classic": "^3.0.0",
"@docusaurus/preset-classic": "^3.2.0",
"docusaurus-plugin-openapi": "^0.7.3",
"docusaurus-plugin-proxy": "^0.7.3",
"docusaurus-theme-openapi": "^0.7.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-theme-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"format:lib-next": "prettier --config ../../.prettierrc.json --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0",
"@docusaurus/types": "^3.0.0",
"@docusaurus/module-type-aliases": "^3.2.0",
"@docusaurus/types": "^3.2.0",
"@types/concurrently": "^6.3.0",
"@types/crypto-js": "^4.1.0",
"@types/lodash": "^4.14.176",
Expand All @@ -35,7 +35,7 @@
"concurrently": "^5.2.0"
},
"dependencies": {
"@docusaurus/theme-common": "^3.0.0",
"@docusaurus/theme-common": "^3.2.0",
"@mdx-js/react": "^3.0.0",
"@monaco-editor/react": "^4.3.1",
"@reduxjs/toolkit": "^1.7.1",
Expand Down
Loading

0 comments on commit b1deb01

Please sign in to comment.