Skip to content

chore: remove dead code and reduce export surface#662

Open
kamilwronka wants to merge 1 commit intodevelopfrom
claude/awesome-morse
Open

chore: remove dead code and reduce export surface#662
kamilwronka wants to merge 1 commit intodevelopfrom
claude/awesome-morse

Conversation

@kamilwronka
Copy link
Copy Markdown
Contributor

@kamilwronka kamilwronka commented Apr 5, 2026

Summary

  • Delete unused respawn-auto-close-job.ts — entire file had zero imports anywhere in the codebase
  • Make getEventEffectiveStartDate and isEventActiveAt non-exported in event-activity.util.ts — only used internally within the same file
  • Remove redundant as const from mode: "insensitive" in kills.service.ts (3 occurrences) — TypeScript already infers the literal type

Why each change is safe

  1. Deleted file: Grep for all exported symbols (AUTO_CLOSE_*, RESPAWN_AUTO_CLOSE_JOB_NAME, buildRespawnAutoCloseJobId, getRespawnAutoCloseDelay) returns zero external references
  2. Reduced exports: getEventEffectiveStartDate is called by isEventActiveAt and compareEventsByActivityAndStart (both in the same file); isEventActiveAt is called by attachComputedEventActive (same file). No external consumers.
  3. Removed as const: Pure type-level change; Prisma's QueryMode accepts "insensitive" as a literal without the assertion

Touched files

  • apps/api/src/events/utils/respawn-auto-close-job.ts (deleted)
  • apps/api/src/events/utils/event-activity.util.ts (2 lines changed)
  • apps/api/src/kills/kills.service.ts (3 lines changed)

Residual risks

None — all 590 tests pass, lint clean, format clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Consolidated internal utility functions by making some utilities file-local and removing unused utilities from the event system.
    • Updated internal type handling in search filtering logic.

- Delete unused respawn-auto-close-job.ts (no imports anywhere)
- Make getEventEffectiveStartDate and isEventActiveAt non-exported
  (only used internally within event-activity.util.ts)
- Remove redundant `as const` from Prisma mode: "insensitive" literals
  in kills.service.ts (TypeScript infers the literal type automatically)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e5baf96f-f375-47c1-9aa3-c5d25d1e2d14

📥 Commits

Reviewing files that changed from the base of the PR and between f4fada0 and d4a8816.

📒 Files selected for processing (3)
  • apps/api/src/events/utils/event-activity.util.ts
  • apps/api/src/events/utils/respawn-auto-close-job.ts
  • apps/api/src/kills/kills.service.ts
💤 Files with no reviewable changes (1)
  • apps/api/src/events/utils/respawn-auto-close-job.ts

📝 Walkthrough

Walkthrough

Three files undergo refactoring: two utility functions in the event-activity utility are made non-exported, an entire respawn auto-close job utility file is deleted, and Prisma filter literals in the kills service have their type assertion syntax simplified. No functional logic is modified.

Changes

Cohort / File(s) Summary
Event Utilities Refactoring
apps/api/src/events/utils/event-activity.util.ts
Removed export keyword from getEventEffectiveStartDate and isEventActiveAt functions, making them file-local. No logic changes; other exported utilities remain unchanged.
Removed Respawn Auto-Close Job
apps/api/src/events/utils/respawn-auto-close-job.ts
Entire file deleted, removing five exported constants (AUTO_CLOSE_BUFFER_MS, AUTO_CLOSE_RESCHEDULE_DELAY_MS, AUTO_CLOSE_MAX_EXTENSIONS, AUTO_CLOSE_EVENT_END_BUFFER_MS, RESPAWN_AUTO_CLOSE_JOB_NAME) and two exported utility functions (buildRespawnAutoCloseJobId, getRespawnAutoCloseDelay).
Kills Service Query Updates
apps/api/src/kills/kills.service.ts
Simplified npcName search filter literals by removing TypeScript as const type assertions from mode: "insensitive" properties in Prisma where conditions. No exported signature changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Exports fade away like morning dew,
Unused respawn jobs bid adieu,
Type assertions shed their lengthy coat,
Cleanup changes earn this hoppy vote! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: remove dead code and reduce export surface' accurately summarizes the main changes: deleting unused files and making internal functions non-exported to reduce the public API surface.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/awesome-morse

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant