Skip to content

Cleaned up custom-redirects types.ts#28822

Draft
allouis wants to merge 1 commit into
mainfrom
cleanup-redirects-types
Draft

Cleaned up custom-redirects types.ts#28822
allouis wants to merge 1 commit into
mainfrom
cleanup-redirects-types

Conversation

@allouis

@allouis allouis commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Cleans up a types.ts file that was accidentally committed during the recent custom-redirects service refactor. types.ts is an ownership-free dumping ground — it gave its two types no clear owner. This gives each type a home based on who owns it.

Changes

  • RedirectConfig → new redirect-config.ts. It's the shared domain type — the parser produces it, validation checks it, the service orchestrates it, and the store adapters persist it. No single consumer owns it, so it gets a dedicated, named home rather than living in one peer's file.
  • RedirectsStore → moved into redirects-service.ts. Its sole consumer is RedirectsService, sitting right next to the existing RedirectManagerLike interface. The consumer owns the contract; the store adapters (FileStore, S3RedirectsStore) implement it — the correct ports-and-adapters dependency direction.
  • types.ts deleted. Remaining edits just repoint imports.

Risk

Type-only change — every edit is an import type repoint or a verbatim move of an interface declaration. No runtime behaviour changed.

Testing

All touched suites pass (79 tests): redirects-service, redirect-config-parser, validation, file-store, s3-redirects-store, in-memory-store. eslint/tsc clean on the changed files.

🤖 Generated with Claude Code

- types.ts was an ownership-free dumping ground accidentally committed during the recent service refactor; it gave the two types no clear owner
- moved RedirectConfig into its own redirect-config.ts: it is the shared domain type (parser produces it, validation checks it, the service orchestrates it, adapters persist it) with no single consumer, so it gets a dedicated, named home rather than a peer's file
- moved the RedirectsStore port into redirects-service.ts next to the existing RedirectManagerLike: its sole consumer is RedirectsService, so the consumer owns the contract and adapters implement it (correct ports-and-adapters direction)
- type-only change: every other edit just repoints an import; no runtime behaviour changed
@allouis allouis self-assigned this Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f83d9aaa-b0db-44ee-a352-0f2e93166353

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-redirects-types

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

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