Skip to content

Project Structure Refactoring #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 2, 2025

Conversation

mikechu-optimizely
Copy link
Collaborator

Overview

This PR reorganizes the project structure to improve code organization, maintainability, and discoverability. The changes focus on logical grouping of related functionality and clearer separation of concerns.

Changes

Directory Structure Updates

  • Moved abstraction classes to core/interfaces/

    • Better reflects their role as core interfaces
    • Separates interfaces from utility functions
  • Elevated config/ to root level

    • Makes configuration more discoverable
    • Reflects its importance in the system
  • Created utils/helpers/ directory

    • Groups helper functions logically
    • Improves code organization
  • Removed empty types/ directory

    • Will be reintroduced in future TypeScript migration

Import Path Updates

  • Updated all import paths to reflect new structure
  • Removed legacy references to _helpers_ directory
  • Fixed relative paths in all affected files

Impact

  • No functional changes
  • Improved code organization
  • Better separation of concerns
  • More intuitive directory structure
  • Easier navigation of the codebase

Testing

The changes are purely structural - all functionality remains the same. However, thorough testing of all CDN adapters is recommended to ensure no import paths were missed.

- Move coreLogic.js to core/providers/
- Move optimizely provider files to core/providers/
- Move event listeners to core/providers/events/

Part of the project restructure to improve code organization and maintainability.
- Move all CDN adapters to src/adapters/
- Move shared adapter helpers to src/adapters/base/
- Remove old cdn-adapters directory

Part of the project restructure to improve code organization and maintainability.
- Move config files to utils/config/
- Move logger to utils/logging/
- Move abstraction helpers and classes to utils/
- Remove old _helpers_ and _config_ directories

Part of the project restructure to improve code organization and maintainability.
- Move API router and handlers to src/core/api/
- Remove old _api_ directory

Part of the project restructure to improve code organization and maintainability.
- Update import paths in abstraction classes
- Update import paths in config files
- Update import paths in logging
- Update import paths in helpers

Adjust imports to match new directory structure.
- Update import paths in all CDN adapters (Akamai, Cloudflare, CloudFront, Fastly, Vercel)
- Update import paths in KV interfaces
- Update import paths in adapter entry files

Adjust imports to match new directory structure.
- Update import paths in API handlers and router
- Update import paths in providers (core logic, optimizely provider)
- Update import paths in event listeners
- Update import paths in user profile service

Adjust imports to match new directory structure.
- Update import paths in index.js
- Update import paths in cloudfront/index.entry.js
- Update import paths in vercel/index.entry.js

Finalize import path updates to match new directory structure.
- Move abstraction classes to core/interfaces/
- Elevate config/ to root level
- Group helpers in utils/helpers/
- Remove empty types/ directory
- Update import paths
- Rename project to 'Optimizely Edge Agent'
- Add comprehensive project structure documentation
- Remove 'Hybrid Edge Serverless' references
- Update architecture descriptions
@mikechu-optimizely mikechu-optimizely merged commit 0746b43 into main Jan 2, 2025
1 check passed
@mikechu-optimizely mikechu-optimizely deleted the feature/project-restructure branch January 2, 2025 22:51
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