cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
435 stars 67 forks source link

Missing dependency tslib #192

Closed hjellek closed 2 months ago

hjellek commented 11 months ago

Please describe the bug you are seeing

Installing docusaurus with pnpm (which have stricter defaults to hoisting) causes this plugin to be unable to import tslib, as it is not declared as a dependency.

Docusaurus itself correctly specifies this dependency: https://github.com/facebook/docusaurus/blob/3f09fb11a12950c9419ae38fb1b7a04ec1ec8e66/packages/docusaurus/package.json#L98

How can we best reproduce the bug?

No response

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

Docusaurus 2.4.1 docusaurus-local-search 1.1.0

Which Node.js version are you using?

No response

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

No response

Additional context

No response

mkska commented 3 months ago

@docusaurus/utils-validation is missing too from the deps.

The overrides part is there because I'm using the search-local pkg with docusaurus v3 (via).

I use this as a workaround in my package.json with pnpm (pnpm docs packageExtensions):

"pnpm": {
    "packageExtensions": {
      "@cmfcmf/docusaurus-search-local": {
        "dependencies": {
          "tslib": "*",
          "@docusaurus/utils-validation": "*"
        }
      }
    },
    "overrides": {
      "@docusaurus/core": "^3.2.1"
    }
  }
cmfcmf commented 2 months ago

Thank you, both are added now.