Skip to content

Strict check for plugin version mismatch #9342

@chris48s

Description

@chris48s

Have you read the Contributing Guidelines on issues?

Description

In https://github.com/facebook/docusaurus/blob/v2.4.3/packages/docusaurus/src/server/siteMetadata.ts#L75-L92 there is a check which logs an error if @Docusaurus plugins are out of sync with @docusaurus/core

This logs a message, but it is not a hard error.

I would like the ability to run something like

  • docusaurus check or
  • docusaurus build --strict

which throws an exception or otherwise exits with a non-zero exit code if the plugin versions are mis-matched with core.

Has this been requested on Canny?

No response

Motivation

This would be useful as a CI check to help users correctly upgrade docusaurus packages using automated tools like dependabot.

API design

I've suggested

  • docusaurus check or
  • docusaurus build --strict

but open to other ideas.. --strict-plugins?

Have you tried building it?

I have not tried building this as a plugin. At the moment, my proposed workaround for this on a repo where we are using docusaurus is https://github.com/badges/shields/pull/9608/files but parsing the output like this will be brittle.

Maybe this could be a plugin, but it feels like something that conceptually lives in core. The comment in https://github.com/facebook/docusaurus/blob/v2.4.3/packages/docusaurus/src/server/siteMetadata.ts#L75-L92 suggests this would be reasonable.

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apprenticeIssues that are good candidates to be handled by a Docusaurus apprentice / traineefeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions