Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to let plugins use a compatible version of Joi #4456

Closed
weareoutman opened this issue Mar 18, 2021 · 2 comments · Fixed by #4459
Closed

Provide a way to let plugins use a compatible version of Joi #4456

weareoutman opened this issue Mar 18, 2021 · 2 comments · Fixed by #4459
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@weareoutman
Copy link
Contributor

🚀 Feature

Provide a way to let plugins (such as my plugin) be compatible across Docusaurus versions, which both use Joi to do validation of options.

Have you read the Contributing Guidelines on issues?

yes

Motivation

Currently Joi disallows mixing different versions of joi schema, however, we cannot make sure Docusaurus and plugins use the same version of Joi if they specifies their own dependencies. Like this issue happened after a new Docusaurus version released.

Users can do a dedupe to fix this problem, but it's pretty annoying since Docusaurus releases frequently.

Another workaround maybe specifying Joi as a peer dependency in plugins, but I think it cannot always work, because Docusaurus and plugins are peers, but their own dependencies are not.

Pitch

(Please explain why this feature should be implemented and how it would be used.)

@weareoutman weareoutman added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Mar 18, 2021
@slorber
Copy link
Collaborator

slorber commented Mar 18, 2021

Hey, totally agree on this, it was on my todo list.

We'll expose this:

import { Joi } from "@docusaurus/utils-validation"

@slorber
Copy link
Collaborator

slorber commented Mar 18, 2021

PR: #4459

You'll need to require min version alpha 73 once released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants