Skip to content

Conversation

ceedarcyrus
Copy link
Contributor

Summary

This PR consolidates configuration types (EdgeConfig, EdgeWorkerConfig, RepositoryConfig, OAuthCallbackHandler) from their scattered locations into a centralized packages/core/src/config-types.ts file. This improves code organization, eliminates duplication, and provides a single source of truth for configuration management across the monorepo.

Changes

New Files

  • packages/core/src/config-types.ts: Created centralized configuration types module containing:
    • RepositoryConfig: Configuration for individual repository/workspace pairs
    • EdgeWorkerConfig: Configuration for the EdgeWorker supporting multiple repositories
    • EdgeConfig: Edge configuration containing all repositories and global settings
    • OAuthCallbackHandler: OAuth callback handler type

Modified Files

  • packages/core/src/index.ts: Added exports for all configuration types
  • packages/edge-worker/src/types.ts: Removed duplicate type definitions, added re-exports from cyrus-core for backward compatibility
  • packages/edge-worker/src/index.ts: Updated to re-export types from cyrus-core
  • packages/edge-worker/src/EdgeWorker.ts: Updated imports to use types from cyrus-core
  • packages/edge-worker/src/SharedApplicationServer.ts: Updated to import OAuthCallbackHandler from cyrus-core
  • apps/cli/app.ts: Removed local EdgeConfig interface, updated imports to use types from cyrus-core

Benefits

  1. Single Source of Truth: All configuration types are now defined in one location
  2. Reduced Duplication: Eliminated 163 lines of duplicate code
  3. Better Maintainability: Changes to configuration types only need to be made in one place
  4. No Breaking Changes: Backward compatibility maintained through re-exports in cyrus-edge-worker
  5. Clean Architecture: No circular dependencies introduced; proper dependency flow maintained

Testing

Type Checking

  • cyrus-core builds and type checks successfully
  • ✅ All modified files pass TypeScript compilation
  • ✅ No new type errors introduced

Linting

  • ✅ All modified files pass linting checks
  • ✅ Code follows project formatting standards

Dependency Verification

  • ✅ No circular dependencies created
  • ✅ Proper dependency chain: cyrus-corecyrus-edge-workercyrus-cli

Build Verification

  • ✅ All affected packages build successfully
  • ✅ No breaking changes to existing functionality

Architecture

The dependency flow is now:

cyrus-core (defines types)
    ↓
cyrus-edge-worker (imports and re-exports for compatibility)
    ↓
apps/cli (consumes types)

This is a pure refactoring with no functional changes - all existing code continues to work as before.


Resolves CYPACK-179

🤖 Generated with Claude Code

ceedarcyrus and others added 2 commits October 12, 2025 15:24
Consolidates EdgeConfig, EdgeWorkerConfig, RepositoryConfig, and
OAuthCallbackHandler types into packages/core/src/config-types.ts
for centralized configuration management and better code reuse
across packages.

Changes:
- Created packages/core/src/config-types.ts with all config types
- Updated cyrus-core to export configuration types
- Updated cyrus-edge-worker to import and re-export from cyrus-core
- Updated apps/cli to import types from cyrus-core
- Removed duplicate type definitions from edge-worker and CLI

Benefits:
- Single source of truth for configuration types
- Reduced code duplication (163 lines removed)
- Better dependency management (no circular dependencies)
- Improved maintainability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The EdgeWorkerConfig and RepositoryConfig types are already
re-exported in packages/edge-worker/src/index.ts, so the duplicate
re-exports in types.ts are unnecessary.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@Connoropolous Connoropolous merged commit 9d83b42 into main Oct 12, 2025
3 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