PaloAltoNetworks / docusaurus-openapi-docs

🦝 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.tryingpan.dev
MIT License
561 stars 193 forks source link

clean-api-docs command does not delete sidebar.ts file #811

Closed iqplus closed 3 weeks ago

iqplus commented 1 month ago

Describe the bug

When i run the gen-api-docs command, it correctly creates the docs and the sidebar.ts file. When i run the clean-api-docs command, it correctly deletes the docs but it does not delete the sidebar.ts file.

Expected behavior

Running the clean-api-docs command should also delete the sidebar.ts file.

Current behavior

The sidebar.ts file remains after executing the clean-api-docs command.

If I change the sidebar extension to .js and run the clean-api-docs, it deletes it correctly.

Context

  1. Run yarn docusaurus gen-api-docs all to generate documentation and the sidebar.ts.
  2. Run yarn docusaurus clean-api-docs all.
  3. Notice that the sidebar.ts file is not deleted.

Context

These is how i have the plugin configured:

      'docusaurus-plugin-openapi-docs',
      {
        id: 'openapi-docs',
        docsPluginId: 'openapi-docs-plugin',
        config: {
          api: {
            specPath: 'https://yaml-file-url',
            outputDir: 'docs/api-rest',
            showSchemas: true,
            sidebarOptions: {
              groupPathsBy: "tag",
              categoryLinkSource: "tag"
            },
          }
        },
      },

I would like to periodically update the specPath URL and automate the documentation regeneration process by using the following script:

yarn docusaurus clean-api-docs all
yarn docusaurus gen-api-docs all

If the clean-api-docs works correctly, it would avoid me deleting the sidebar.ts manually before running the docusaurus gen-api-docs.

Thanks for the help on this! :) Awesome project.

Your Environment

Plugin Version: 3.0.0-beta.10 Docusaurus Version: 3.2.1 Node.js Version: 18.13.0

  "dependencies": {
    "@docusaurus/core": "3.2.1",
    "@docusaurus/plugin-content-docs": "^3.2.1",
    "@docusaurus/preset-classic": "^3.2.1",
    "@mdx-js/react": "^3.0.0",
    "clsx": "^2.0.0",
    "prism-react-renderer": "^2.3.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "docusaurus-plugin-openapi-docs": "3.0.0-beta.10",
    "docusaurus-theme-openapi-docs": "3.0.0-beta.10"
  }