Skip to content

Commit

Permalink
chore: Update to Docusaurus v2
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The minimum supported Docusaurus version is now v2.0.0.
  • Loading branch information
cmfcmf committed Dec 22, 2022
1 parent 9d30941 commit f8619b7
Show file tree
Hide file tree
Showing 8 changed files with 2,430 additions and 2,389 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x, 17.x, 18.x]
node-version: [16.x, 18.x]
docusaurus-version:
- "v2.0.0-beta.21"
- "v2.2.0"
- "canary"

steps:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Offline / Local Search for Docusaurus v2.0.0-beta.21+
# Offline / Local Search for Docusaurus v2+

![Version](https://img.shields.io/npm/v/@cmfcmf/docusaurus-search-local?style=flat-square)
![License](https://img.shields.io/npm/l/@cmfcmf/docusaurus-search-local?style=flat-square)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
![GitHub issues](https://img.shields.io/github/issues/cmfcmf/docusaurus-search-local?style=flat-square)
![GitHub last commit](https://img.shields.io/github/last-commit/cmfcmf/docusaurus-search-local?style=flat-square)

Offline / local search for Docusaurus **v2.0.0-beta.21+** that works behind your firewall.
Offline / local search for Docusaurus **v2+** that works behind your firewall.

Feature Highlights:

Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test("basic search works", async ({ page }) => {
await page.goto("http://localhost:3000/");
await search(page, "3");

await expect(page.url()).toBe("http://localhost:3000/docs/doc3");
await page.waitForURL("http://localhost:3000/docs/doc3");
await expect(page.locator('mark[data-markjs="true"]')).toHaveText("3");
});

Expand Down Expand Up @@ -67,13 +67,13 @@ test("language-based search index is used", async ({ page }) => {
await page.goto("http://localhost:3000/docs/next/d-s-l-test");

await search(page, "english");
await expect(page).toHaveURL("http://localhost:3000/docs/next/translated");
await page.waitForURL("http://localhost:3000/docs/next/translated");

// Go to a random German doc
await page.goto("http://localhost:3000/de/docs/next/d-s-l-test");

await search(page, "german");
await expect(page).toHaveURL("http://localhost:3000/de/docs/next/translated");
await page.waitForURL("http://localhost:3000/de/docs/next/translated");
});

test("dark mode is copied from <html> to <body> correctly", async ({
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"packages/*"
],
"devDependencies": {
"@docusaurus/core": "^2.0.0-beta.21",
"@docusaurus/preset-classic": "^2.0.0-beta.21",
"@docusaurus/core": "^2.2.0",
"@docusaurus/preset-classic": "^2.2.0",
"@playwright/test": "^1.17.1",
"husky": "^7.0.4",
"lerna": "^4.0.0",
Expand Down
18 changes: 9 additions & 9 deletions packages/docusaurus-search-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"mark.js": "^8.11.1"
},
"peerDependencies": {
"@docusaurus/core": "^v2.0.0-beta.21",
"@docusaurus/core": "^2.0.0",
"nodejieba": "^2.5.0"
},
"peerDependenciesMeta": {
Expand All @@ -47,13 +47,13 @@
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.8",
"@babel/preset-typescript": "^7.16.7",
"@docusaurus/module-type-aliases": "^2.0.0-beta.21",
"@docusaurus/plugin-content-blog": "^2.0.0-beta.21",
"@docusaurus/plugin-content-docs": "^2.0.0-beta.21",
"@docusaurus/plugin-content-pages": "^2.0.0-beta.21",
"@docusaurus/theme-classic": "^2.0.0-beta.21",
"@docusaurus/theme-common": "^2.0.0-beta.21",
"@docusaurus/types": "^2.0.0-beta.21",
"@docusaurus/module-type-aliases": "^2.2.0",
"@docusaurus/plugin-content-blog": "^2.2.0",
"@docusaurus/plugin-content-docs": "^2.2.0",
"@docusaurus/plugin-content-pages": "^2.2.0",
"@docusaurus/theme-classic": "^2.2.0",
"@docusaurus/theme-common": "^2.2.0",
"@docusaurus/types": "^2.2.0",
"@types/jest": "^28.1.1",
"@types/lodash": "^4.14.178",
"@types/lunr": "^2.3.3",
Expand All @@ -75,7 +75,7 @@
"prettier": "^2.5.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"typescript": "^4.5.4"
"typescript": "^4.9.4"
},
"scripts": {
"build": "concurrently --names client,server --prefix-colors blue,green yarn:build:client yarn:build:server",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-search-local/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"noUnusedParameters": true,

/* Module Resolution Options */
"moduleResolution": "node",
"moduleResolution": "nodenext",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,

Expand Down
4 changes: 2 additions & 2 deletions packages/example-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"clsx": "^1.1.1"
},
"peerDependencies": {
"@docusaurus/core": "^2.0.0-beta.21",
"@docusaurus/preset-classic": "^2.0.0-beta.21",
"@docusaurus/core": "^2.2.0",
"@docusaurus/preset-classic": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
Expand Down
Loading

0 comments on commit f8619b7

Please sign in to comment.