refactor(issue): split 839-line issue.js by feature group#35
Merged
Conversation
issue.js shrinks to a router that wires the issue command to three feature modules: bin/commands/issue/ ├── crud.js list / view / create / edit / delete ├── comment.js comment add / list / edit / delete ├── link.js remote-link list / add / update / delete └── shared.js readDescriptionFile (used by crud and comment) No behavior change — same CLI surface, same flags, same help text. All 251 tests pass and `jira issue --help` / `comment --help` / `remote-link --help` render identically.
|
🎉 This PR is included in version 2.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
bin/commands/issue.js(839 lines) into a thin router (18 lines) plus three feature modules underbin/commands/issue/.register(command, factory)function that owns its own subcommand registration plus the action handlers.Why
The single 839-line file had grown 18 async handlers across 3 unrelated feature areas, making it hard to navigate and review. Splitting by feature group improves cohesion without inflating the public surface — same CLI, same flags, same help text, same tests.
Non-changes (intentional)
tests/commands/issue.test.jsexercise the public command tree and pass unmodified.Test plan
npm test— 251 tests pass (unchanged frommain)npm run lint— cleannode bin/index.js issue --helprenders identically (verified locally)node bin/index.js issue comment --helprenders identicallynode bin/index.js issue remote-link --helprenders identically