From 3a3fe219f2a226fbfd95646e59c45d929ecee789 Mon Sep 17 00:00:00 2001 From: Praveen N Date: Sat, 9 Dec 2023 09:06:12 +0530 Subject: [PATCH] version update --- README.md | 32 ++++++++++++++++++++++---------- package-lock.json | 9 +++++---- package.json | 3 +-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a1e5ec8..120dc77 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,25 @@ Offline Search for Docusaurus V2 ## Prerequisites -`worker_thread` is needed, suggested node version > 12.X -For older version of node use `docusaurus-lunr-search` version `2.1.0` -(`npm i docusaurus-lunr-search@2.1.0`) +- Docusaurus V2 or V3 +- Node.js >= 12.X ## How to Use ? 1. Install this package ``` +yarn add docusaurus-lunr-search +``` +In case you are using npm +``` npm i docusaurus-lunr-search --save ``` -2. Then run `npm install` to update, build, and link the packages +If npm install fails to install with error `unable to resolve dependency tree`, run `npm i --legacy-peer-deps` + +2. Some time npm fails to install `lunr` package, in that case install `lunr` package manually ``` -npm install +npm i lunr --save ``` + 3. Add the docusaurus-lunr-search plugin to your `docusaurus.config.js` ``` module.exports = { @@ -38,16 +44,20 @@ module.exports = { 4. Then build your Docusaurus project ``` +yarn build +``` +or +``` npm run build ``` + 5. Serve your application ``` -npm run serve +yarn serve ``` or - ``` -npx http-server ./build +npm run serve ``` Note: Docusaurus search information can only be generated from a production build. Local development is currently not supported. @@ -95,11 +105,13 @@ indirect children (E.g. 'grandchildren' nodes). Check this [issue #115](https://github.com/praveenn77/docusaurus-lunr-search/issues/115) for more details. ## Upgrading from docusaurus V2 to V3 -Update the `docusaurus-lunr-search` version to `3.3.0` or higher +Update the `docusaurus-lunr-search` version to `3.3.0` or higher in `package.json` file Remove `src/theme/SearchBar` folder if you swizzled it before, if the folder does not exist then ignore this step. -Do `npm install` and `npm run build` again +Do `yarn install` or `npm install` + +If npm install fails to install with error `unable to resolve dependency tree`, run `npm i --legacy-peer-deps` ## Credits diff --git a/package-lock.json b/package-lock.json index 40e88f3..88a40de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "docusaurus-lunr-search", - "version": "3.3.0", + "version": "3.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "docusaurus-lunr-search", - "version": "3.3.0", + "version": "3.3.1", "license": "MIT", "dependencies": { "autocomplete.js": "^0.37.0", @@ -19,7 +19,6 @@ "lunr-languages": "^1.4.0", "mark.js": "^8.11.1", "minimatch": "^3.0.4", - "object-assign": "^4.1.1", "rehype-parse": "^7.0.1", "to-vfile": "^6.1.0", "unified": "^9.0.0", @@ -9166,6 +9165,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -20683,7 +20683,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "peer": true }, "object-inspect": { "version": "1.12.2", diff --git a/package.json b/package.json index 35c580f..31331c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docusaurus-lunr-search", - "version": "3.3.0", + "version": "3.3.1", "description": "Offline search component for Docusaurus V2", "main": "src/index.js", "publishConfig": { @@ -50,7 +50,6 @@ "lunr-languages": "^1.4.0", "mark.js": "^8.11.1", "minimatch": "^3.0.4", - "object-assign": "^4.1.1", "rehype-parse": "^7.0.1", "to-vfile": "^6.1.0", "unified": "^9.0.0",