The current stc commit command requires the user to manually find and type the number of an open issue. This process can be slow and prone to typos. We can significantly improve the user experience by integrating directly with the GitHub API.
Proposed User Experience (UX):
- The prompt
? Esta mudança afeta alguma issue aberta? should be changed to a confirm type (Yes/No).
- If the user answers No, the process finishes as it does today.
- If the user answers Yes:
- The tool will automatically call the GitHub API to fetch a list of all open issues for the current repository.
- The user will be presented with a searchable list of these issues (e.g.,
#123: Fix login button).
- The user can select the relevant issue from the list.
- After selecting an issue, the user will be prompted to choose a keyword (e.g.,
closes, fixes, resolves).
- The tool will then automatically construct the correct footer for the commit message (e.g.,
closes #123).
Technical Requirements:
- GitHub API Integration: Use a library like
@octokit/rest to communicate with the GitHub API.
- Repo Detection: The tool needs to automatically detect the repository owner and name from the local Git configuration (e.g.,
git remote get-url origin).
- Authentication: Implement a way to handle GitHub API authentication, likely by looking for a Personal Access Token (PAT) in an environment variable (
GITHUB_TOKEN) or a configuration file.
- UI Prompts: Use
inquirer to implement the new confirm and list prompts.
The current
stc commitcommand requires the user to manually find and type the number of an open issue. This process can be slow and prone to typos. We can significantly improve the user experience by integrating directly with the GitHub API.Proposed User Experience (UX):
? Esta mudança afeta alguma issue aberta?should be changed to aconfirmtype (Yes/No).#123: Fix login button).closes,fixes,resolves).closes #123).Technical Requirements:
@octokit/restto communicate with the GitHub API.git remote get-url origin).GITHUB_TOKEN) or a configuration file.inquirerto implement the newconfirmandlistprompts.