Skip to content

refactor: remove unused exported functions from core modules#921

Merged
aaight merged 1 commit intodevfrom
feature/remove-unused-exports
Mar 16, 2026
Merged

refactor: remove unused exported functions from core modules#921
aaight merged 1 commit intodevfrom
feature/remove-unused-exports

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 16, 2026

Summary

Removes dead exports from 6 source files to reduce the public API surface to match actual usage patterns.

  • src/github/client.ts: Removed getAuthenticatedUser() standalone function, addIssueCommentReaction(), addReviewCommentReaction(), branchExists() methods, and GitHubReactionContent type (none were called outside this file)
  • src/trello/client.ts: Removed export keyword from getTrelloCredentials() — function kept for internal use by getClient() and trelloFetch()
  • src/trello/types.ts: Removed dead re-export line for TrelloCard, TrelloComment, TrelloAttachment; TrelloCredentials interface retained
  • src/pm/lifecycle.ts: Removed export keyword from extractPRTitle() — function kept for internal use by handleSuccess()
  • src/config/env.ts: Removed loadEnvConfig() and its getEnvOrThrow() helper; loadEnvConfigSafe() and getEnvOrDefault() preserved
  • src/triggers/shared/backlog-check.ts: Removed deprecated isBacklogEmpty() function (marked @deprecated, zero external callers); isPipelineAtCapacity() unaffected

Test files updated:

  • tests/unit/github/client.test.ts: Removed branchExists, addIssueCommentReaction, addReviewCommentReaction, getAuthenticatedUser describe blocks and mock entries
  • tests/helpers/sharedMocks.ts: Removed addIssueCommentReaction, addReviewCommentReaction, branchExists from mockGithubClient
  • tests/unit/pm/lifecycle.test.ts: Removed extractPRTitle import and describe block
  • tests/unit/trello/client.test.ts: Removed getTrelloCredentials import and describe block
  • tests/unit/triggers/shared/backlog-check.test.ts: Removed entire isBacklogEmpty describe block

Test plan

  • npm run typecheck passes (zero errors)
  • npm run lint passes (zero errors)
  • npm test passes (293 test files, 5438 tests)

Closes: https://trello.com/c/69b8361eabcecdb304177206

🤖 Generated with Claude Code

🕵️ claude-code · claude-sonnet-4-6 · run details

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — Clean dead-code removal. I verified every deleted export has zero external callers in src/:

  • getAuthenticatedUser(), addIssueCommentReaction(), addReviewCommentReaction(), branchExists(), GitHubReactionContent — no references outside src/github/client.ts
  • loadEnvConfig() / getEnvOrThrow() — zero callers anywhere
  • isBacklogEmpty() — zero callers, correctly deprecated
  • extractPRTitle() — only called within src/pm/lifecycle.ts (correctly made module-private)
  • getTrelloCredentials() — only called within src/trello/client.ts (correctly made module-private)
  • TrelloCard, TrelloComment, TrelloAttachment re-exports from trello/types.ts — no consumers import these types from types.ts; they import from trello/client.ts directly

Test updates are consistent with the source changes — removed test blocks correspond exactly to removed/unexported functions. The satisfies GitHubClientContract on mockGithubClient in sharedMocks.ts ensures the mock stays in sync with the real client shape, so the removal of mock methods is type-safe. All CI checks pass.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit 013add1 into dev Mar 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants