Repository navigation
refactor(core): move each CLI command into its own folder (AI-assisted) - #12863
Merged
Merged
Conversation
Every command of @docusaurus/core now lives in <cmd>/<cmd>.ts, like build/build.ts and start/start.ts already did. Pure move: only import paths change, and the package exports keep the same names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
…-assisted) serve is its only user. clearPath (clear + build) and openBrowser (start + serve) are shared, so they stay in commands/utils. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slorber
added a commit
that referenced
this pull request
Nov 5, 2026
main squash-merged #12863, the bottom of this stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Motivation
Move each CLI command of
@docusaurus/coreinto its own folder as<cmd>/<cmd>.ts, likebuild/build.tsandstart/start.tsalready are. This gives each command a place for its own tests and helpers.It's a pure move: no behavior change, no new tests, no cleanup. The
@docusaurus/coreexports keep the same names.Moves in
packages/docusaurus/src/commands/:clear.ts→clear/clear.tsdeploy.ts→deploy/deploy.tsserve.ts→serve/serve.tswriteHeadingIds.ts→writeHeadingIds/writeHeadingIds.ts__tests__/writeHeadingIds.test.ts→writeHeadingIds/__tests__/writeHeadingIds.test.tswriteTranslations.ts→writeTranslations/writeTranslations.tsexternal.ts→external/external.ts. Not a real subcommand (it runs the plugins'extendCli), butsrc/index.tsexports it next to the commandsswizzle/index.ts→swizzle/swizzle.ts, with its testswizzle/__tests__/index.test.ts→swizzle.test.tsand its snapshot fileutils/listenToServer.ts→serve/listenToServer.ts, sinceserveis its only usercli.ts,__tests__/cli.test.tsand its fixtures stay at the root.utils/keeps the helpers several commands share:clearPath(clear,build) andopenBrowser(start,serve). The only other changes are the import paths.This prepares #12858, which adds a test suite for
docusaurus serve.Test Plan
git diff -M --stat mainshows only renames, plus import line changes@docusaurus/corebuild (lib/deleted first)pnpm test packages/docusaurus: no obsolete or new snapshots after the swizzle snapshot file renamedocusaurus --help,clear,write-translationsandservesmoke tested with the built CLITest links
Deploy preview: https://deploy-preview-12863--docusaurus-2.netlify.app/
(AI-assisted)
🤖 Generated with Claude Code