Skip to content

Commit

Permalink
feat: support Docusaurus v2.0.0-beta.17, update dependencies, closes #…
Browse files Browse the repository at this point in the history
…102, closes #99

BREAKING CHANGE: the minimum supported Docusaurus version is now v2.0.0-beta17.
  • Loading branch information
cmfcmf committed Mar 4, 2022
1 parent c655088 commit 84c72c3
Show file tree
Hide file tree
Showing 9 changed files with 1,690 additions and 1,617 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
node-version: [14.x, 16.x, 17.x]
docusaurus-version:
- "v2.0.0-beta.15"
- "v2.0.0-beta.17"
- "canary"

steps:
Expand All @@ -28,7 +28,7 @@ jobs:
- run: yarn lint

- run: yarn -W add '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}'
- run: yarn --cwd packages/docusaurus-search-local add --dev '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}'
- run: yarn --cwd packages/docusaurus-search-local add --dev '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/theme-classic@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}'

- run: yarn --cwd packages/docusaurus-search-local build:server
- run: yarn --cwd packages/docusaurus-search-local build:client
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.15+
# Offline / Local Search for Docusaurus v2.0.0-beta.17+

![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.15+** that works behind your firewall.
Offline / local search for Docusaurus **v2.0.0-beta.17+** that works behind your firewall.

Feature Highlights:

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ test("dark mode is copied from <html> to <body> correctly", async ({
}
await page.goto("http://localhost:3000/");
await check("light");
await page.locator("text=🌞").click();
await page.locator("svg[class^='lightToggleIcon']").click();
await check("dark");
await page.locator("text=🌜").click();
await page.locator("svg[class^='darkToggleIcon']").click();
await check("light");
});
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.15",
"@docusaurus/preset-classic": "^2.0.0-beta.15",
"@docusaurus/core": "^2.0.0-beta.17",
"@docusaurus/preset-classic": "^2.0.0-beta.17",
"@playwright/test": "^1.17.1",
"husky": "^7.0.4",
"lerna": "^4.0.0",
Expand Down
3 changes: 2 additions & 1 deletion 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.15",
"@docusaurus/core": "^v2.0.0-beta.17",
"nodejieba": "^2.5.0"
},
"peerDependenciesMeta": {
Expand All @@ -51,6 +51,7 @@
"@docusaurus/plugin-content-blog": "^2.0.0-beta.13",
"@docusaurus/plugin-content-docs": "^2.0.0-beta.13",
"@docusaurus/plugin-content-pages": "^2.0.0-beta.13",
"@docusaurus/theme-classic": "^2.0.0-beta.17",
"@docusaurus/theme-common": "^2.0.0-beta.13",
"@docusaurus/types": "^2.0.0-beta.13",
"@types/jest": "^27.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-search-local/src/server/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function getDocusaurusTag(html: string) {
const tag = $('meta[name="docusaurus_tag"]').attr("content");
if (!tag || tag.length === 0) {
throw new Error(
"docusaurus_tag meta tag not found. This is a bug and should never happen."
"The `docusaurus_tag` meta tag could not be found. Please make sure that your page is wrapped in the `<Layout>` component (from `@theme/Layout`). If it is, then this is a bug, please report it."
);
}
return tag;
Expand Down
8 changes: 8 additions & 0 deletions packages/docusaurus-search-local/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
"module": "CommonJS",
"lib": ["ESNext", "DOM"]
},
// TODO: Currently required, otherwise we get the following type errors:
// [server] ../../node_modules/@docusaurus/plugin-content-blog/src/plugin-content-blog.d.ts(153,34): error TS2307: Cannot find module '@theme/BlogSidebar' or its corresponding type declarations.
// [server] ../../node_modules/@docusaurus/plugin-content-blog/src/plugin-content-blog.d.ts(200,34): error TS2307: Cannot find module '@theme/BlogSidebar' or its corresponding type declarations.
// [server] ../../node_modules/@docusaurus/plugin-content-blog/src/plugin-content-blog.d.ts(224,34): error TS2307: Cannot find module '@theme/BlogSidebar' or its corresponding type declarations.
// [server] ../../node_modules/@docusaurus/plugin-content-blog/src/plugin-content-blog.d.ts(243,34): error TS2307: Cannot find module '@theme/BlogSidebar' or its corresponding type declarations.
"files": [
"../../node_modules/@docusaurus/theme-classic/lib/theme-classic.d.ts"
],
"include": ["src/server/**/*"]
}
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.15",
"@docusaurus/preset-classic": "^2.0.0-beta.15",
"@docusaurus/core": "^2.0.0-beta.17",
"@docusaurus/preset-classic": "^2.0.0-beta.17",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
Expand Down
Loading

0 comments on commit 84c72c3

Please sign in to comment.