Skip to content

Conversation

@admdly
Copy link
Contributor

@admdly admdly commented Dec 23, 2025

This pull request reorganizes the codebase to improve clarity and maintainability, primarily by moving feature modules and platform interfaces to more descriptive directories. It also updates related documentation and configuration files to reflect these changes, and makes minor workflow and script command adjustments.

Moved platform-related code from `src/platform` to `src/lib` and service modules from `src/*` to `src/services/*` for improved organization and separation of concerns. Updated all imports and references throughout the codebase and tests to reflect the new structure.
Moved and renamed test files to improve organization, grouping mocks and adapters under `test/mocks` and `test/lib/adapters/node`. Updated import paths in affected test files. Adjusted Vitest configuration to match new test locations and exclude Node.js adapter tests from Cloudflare Workers environment. Added integration test for app and removed obsolete README.
Corrected references to application logic and setup script paths in README files to reflect the updated directory structure under src/services.
Copilot AI review requested due to automatic review settings December 23, 2025 23:45
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 23, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api-worker ef4fb64 Commit Preview URL

Branch Preview URL
Dec 23 2025, 11:47 PM

Removes version comments from actions/checkout and actions/setup-node steps for clarity. Changes test command from 'npm test' to 'npm run test:all' to run all tests in the CI workflow.
@admdly admdly force-pushed the refactor/platform-structure branch from ee96bb5 to ef4fb64 Compare December 23, 2025 23:46
@admdly admdly changed the title Refactor and general clean up General refactor and clean up Dec 23, 2025
@admdly admdly merged commit b3c4974 into main Dec 23, 2025
4 checks passed
@admdly admdly deleted the refactor/platform-structure branch December 23, 2025 23:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request reorganizes the codebase by moving service modules to a more descriptive src/services/ directory structure and refactoring the platform abstraction layer to src/lib/. The refactoring improves code organization and maintainability while preserving functionality.

  • Relocates service modules (versions, releases, central-alerts) from src/ to src/services/
  • Moves platform interfaces and adapters from src/platform/ to src/lib/
  • Renames test fixtures directory to test mocks for better clarity
  • Updates all import paths, configuration files, and documentation to reflect the new structure

Reviewed changes

Copilot reviewed 29 out of 48 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wrangler.jsonc Updates main entry point to new app location
vitest.node.config.ts Updates test paths for node adapter tests
vitest.config.ts Updates exclusion paths for node tests
test/utils/test-types.ts Updates import paths for service interfaces
test/utils/d1-mock.ts Updates import paths for central alerts interfaces
test/services/versions/v1/*.test.ts Updates import paths to new service and mock locations
test/services/releases/v1/index.test.ts Updates import paths for services and mocks
test/services/central-alerts/v1/*.test.ts Updates import paths and improves type casting
test/node/README.md Removes outdated Node.js testing documentation
test/mocks/*.ts Moves and consolidates mock data files with updated imports
test/mocks/README.md Adds documentation for mock directory
test/lib/adapters/node/*.test.ts Updates import paths for lib adapters
test/integration/versions/index.test.ts Updates import paths for app and mocks
test/integration/app.test.ts Adds comprehensive integration test suite
test/app/index.test.ts Updates import path for main app
src/services/*/v1/interfaces.ts Adds service interface definitions
src/services/*/v1/index.ts Updates import paths to lib layer
src/services/*/v1/README.md Adds comprehensive service documentation
src/services/central-alerts/v1/scripts/init-db.ts Adds database initialization script
src/services/central-alerts/v1/db/init.sql Adds SQL schema for central alerts
src/services/central-alerts/v1/database.ts Updates import paths to lib interfaces
src/lib/middleware.ts Moves platform middleware with interface updates
src/lib/interfaces.ts Consolidates platform interface definitions
src/lib/context.ts Adds platform context abstraction
src/lib/adapters/node/*.ts Implements Node.js platform adapters
src/lib/adapters/cloudflare/*.ts Implements Cloudflare platform adapters
src/app/index.ts Updates main app with new import paths
package.json Updates database initialization script path
README.md Updates documentation with new directory structure
.github/workflows/ci.yml Updates test command and removes version comments

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

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