Skip to content

Feat/cleanup dead code#12

Merged
sumdahl merged 6 commits into
mainfrom
feat/cleanup-dead-code
May 13, 2026
Merged

Feat/cleanup dead code#12
sumdahl merged 6 commits into
mainfrom
feat/cleanup-dead-code

Conversation

@sumdahl

@sumdahl sumdahl commented May 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 13, 2026 05:26
@sumdahl
sumdahl merged commit fe2fb6f into main May 13, 2026
2 checks passed
@sumdahl
sumdahl deleted the feat/cleanup-dead-code branch May 13, 2026 05:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on removing dead/unused code paths and tightening up the project’s developer tooling/docs, primarily by deleting unused infrastructure, cleaning up imports/formatting, and adding lint scripts plus several task/design docs.

Changes:

  • Removed unused exports/imports and deleted an unused in-memory rate limiter implementation.
  • Refactored a few files for consistency (imports/formatting) and updated unit tests to match current entity signatures.
  • Added oxlint + lint scripts and introduced multiple new task/design markdown docs (plus a domain context document).

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/use-cases/auth/verify-email.test.ts Removes an unused ErrorCode import in the verify-email unit test.
tests/unit/use-cases/auth/me.test.ts Removes unused ErrorCode import and updates UserEntity construction to include isVerified.
tests/unit/services/token.service.test.ts Removes unused beforeAll import; keeps token service tests.
src/server/infrastructure/services/in-memory-rate-limiter.service.ts Deletes an unused in-memory rate limiter service implementation.
src/server/infrastructure/persistence/user.pg.repository.ts Removes unused isDbError import and reformats queries/entity construction for readability.
src/server/infrastructure/http/health/health.routes.ts Removes unused AppContext import and a dead healthRouter export.
src/server/infrastructure/http/auth/auth.routes.ts Removes unused requireRole import and reformats dependency destructuring.
src/server/core/use-cases/auth/me.ts Simplifies error imports to a single AppError, ErrorCode import.
src/server/core/use-cases/admin/remove-role.ts Changes execute() signature (drops requestingUserId).
package.json Adds lint / lint:fix scripts and adds oxlint dev dependency.
docs/tasks/split-route-files.md New planning doc for splitting large auth route files.
docs/tasks/setup-lint-ci.md New planning doc for adding lint + typecheck to CI.
docs/tasks/prod-addon-metrics.md New planning doc for adding Prometheus metrics.
docs/tasks/prod-addon-file-upload.md New planning doc for multipart file upload + storage abstraction.
docs/tasks/prod-addon-cursor-pagination.md New planning doc for cursor pagination in repositories/routes.
docs/tasks/prod-addon-caching.md New planning doc for cache-aside + invalidation.
docs/tasks/prod-addon-background-jobs.md New planning doc for background jobs via BullMQ.
docs/tasks/implement-soft-delete.md New planning doc for soft-deleting users.
docs/tasks/implement-audit-logging.md New planning doc for adding audit logs via repository decoration.
docs/tasks/add-second-business-domain.md New planning doc for introducing a second bounded context/domain.
docs/api-test-findings/_auth_logout.md Removes a stray one-line test finding doc.
CONTEXT.md Adds a domain/context overview + architecture invariants.
bun.lock Locks oxlint and its platform bindings.
Comments suppressed due to low confidence (1)

tests/unit/services/token.service.test.ts:8

  • This test sets process.env.JWT_* after importing TockTokenService, but token.service.ts imports env from src/server/config/env.ts, which parses/validates process.env at import time and exports a frozen env object. As a result, these process.env assignments won’t affect what TockTokenService uses, making the test configuration ineffective/non-deterministic. Set the env vars before importing the service (e.g., via dynamic import), or mock the env module so the service reads the intended test values.
import { describe, it, expect } from "bun:test";
import { TockTokenService } from "../../../src/server/infrastructure/services/token.service";
import { AppError } from "../../../src/server/core/errors";

process.env.JWT_ACCESS_SECRET = "test-access-secret-for-unit-tests-only";
process.env.JWT_REFRESH_SECRET = "test-refresh-secret-for-unit-tests-only";
process.env.JWT_ACCESS_EXPIRES_IN = "15m";
process.env.JWT_REFRESH_EXPIRES_IN = "7d";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

) {}

async execute(userId: string, roleName: string, requestingUserId: string) {
async execute(userId: string, roleName: string) {
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