Repository navigation
fix(cli): make clean-api-docs delete only the files it generated - #1624
Merged
sserrata merged 2 commits intoOct 9, 2026
Merged
Conversation
lenamonj
marked this pull request as draft
September 8, 2026 01:23
lenamonj
force-pushed
the
clean-api-docs-generated-only
branch
from
September 10, 2026 10:37
ae1933c to
5686e71
Compare
lenamonj
marked this pull request as ready for review
September 10, 2026 10:37
|
Visit the preview URL for this PR (updated for commit 5686e71): (expires Fri, 16 Oct 2026 17:03:01 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
📸 Visual Diff ReportSnapshot comparison against https://docusaurus-openapi.tryingpan.dev/
✅ No visual regressions detected. Updated at 2026-10-09T17:09:04.442Z · run 34467005148 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
clean-api-docsremoved every*.jsonin the output directory exceptversions.json, and removedschemas/recursively. A hand-authored_category_.jsonin either place went with the generated files.The globs are now derived from
EXTERNALIZABLE_COMPONENTS, the setgen-api-docsexternalizes, so the command matches the names it writes rather than every*.jsonin the directory. Insideschemas/it removes the generated pages and props withunlinkSync, so the empty check that follows sees the result, then removes the directory only if nothing is left in it.Motivation and Context
#811 and #829 settled that
clean-api-docsshould remove whatgen-api-docsgenerated, for a file it was missing. This is the same rule in the other direction.How Has This Been Tested?
New
src/index.test.tsruns the CLI action against a temporary site. Two cases fail onmain, where the_category_.jsonin the output directory and the one underschemas/are both deleted, and pass here. Two more hold the line the other way: every generated file is still removed, andschemas/still goes when nothing else is left in it.yarn testis 122 passing across 11 suites.yarn lintaborts oncypress/.eslintrc.js: Environment key "cypress/globals" is unknownbefore it reads a file, on pristinemainas well;eslintandprettier --checkon the changed files are clean.Types of changes
Checklist