Clarify non-leaf hierarchical command handlers#630
Open
AboMeezO wants to merge 5 commits into
Open
Conversation
|
@AboMeezO is attempting to deploy a commit to the Neplex Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
This PR clarifies and improves non-leaf hierarchical command handling.
A parent hierarchical command file can still define metadata/config, but executable handlers must live on leaf nodes.
src/app/commands/ └── [admin]/ ├── command.ts # non-leaf node: metadata/config is valid here └── [logs]/ └── command.ts # leaf node: executable handlers belong hereIf
[admin]/command.tsexportschatInput,message, orautocompletewhile[admin]has children, CommandKit now logs a highlighted warning, ignores those executable exports, and continues loading valid leaf routes like/admin logs.The router diagnostic remains as secondary scan feedback, but the main developer-facing fix now happens in the runtime loader.
Tests
.\node_modules\.bin\vitest.CMD run src/app/handlers/AppCommandHandler.hierarchical.test.ts src/app/router/CommandsRouter.test.tspnpm --dir packages/commandkit buildpnpm --filter test-bot buildpnpm --filter test-bot startwithPORT=54346; verified the warning appears and command loading continues, then local startup stops at invalid Discord token