Skip to content

Comments

chore: update remaining files#151

Merged
DaxServer merged 1 commit intomainfrom
update
Sep 7, 2025
Merged

chore: update remaining files#151
DaxServer merged 1 commit intomainfrom
update

Conversation

@DaxServer
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Enabled CORS on Project API endpoints.
    • Added database middleware to Project API for more reliable database access.
  • Removals

    • Removed Wikibase Entities API endpoints from the server.
  • Refactor

    • Reorganized imports and minor syntax cleanups across backend files with no behavioral changes.
  • Tests

    • Updated test setups and formatting; removed an obsolete Wikibase Entities API test suite. No impact on runtime behavior.
  • Chores

    • Updated TypeScript configuration (rootDir) without user-facing changes.

Walkthrough

Adds databasePlugin and CORS middleware to projectRoutes. Removes wikibaseEntitiesApi from app wiring. Updates tsconfig base with rootDir. Remaining changes are import reorders and minor arrow-function formatting across APIs, services, utilities, and tests. One test suite (wikibase entities) is deleted.

Changes

Cohort / File(s) Summary
Project router setup
backend/src/api/project/index.ts
Extends projectRoutes to use errorHandlerPlugin, databasePlugin, and cors(). Minor mapping style change.
App wiring
backend/src/index.ts
Unregisters wikibaseEntitiesApi from the Elysia app; minor formatting tweak.
Project API endpoints (imports/style)
backend/src/api/project/import.ts, backend/src/api/project/project.create.ts, backend/src/api/project/project.delete.ts, backend/src/api/project/project.get-all.ts, backend/src/api/project/project.get.ts, backend/src/api/project/project.import-file.ts, backend/src/api/project/project.wikibase.ts
Reorder imports; add UUIDPattern import in wikibase; arrow-function parameter formatting; no logic changes.
Meta projects API (imports/style)
backend/src/api/_meta_projects.ts
Import reordering; arrow-function parameter formatting; no logic changes.
Plugins (imports only)
backend/src/plugins/database.ts, backend/src/plugins/error-handler.ts, backend/src/plugins/wikibase.ts
Import reordering; no behavior changes.
Services (imports/style only)
backend/src/services/constraint-validation.service.ts, backend/src/services/nodemw-wikibase.service.ts, backend/src/services/wikibase-api.service.ts, backend/src/services/wikibase-config.service.ts
Reorganized imports and type-only imports; arrow-function formatting; no runtime changes.
Utilities and types (imports/style)
backend/src/utils/duckdb-types.ts, backend/src/utils/wikibase-error-handler.ts, backend/src/types/error-handler.ts
Import reordering; minor arrow-function formatting; no behavior changes.
API tests — project/meta (imports/style)
backend/tests/api/_meta_projects.test.ts, backend/tests/api/project/import-file.test.ts, backend/tests/api/project/import.test.ts, backend/tests/api/project/project.create.test.ts, backend/tests/api/project/project.delete.test.ts, backend/tests/api/project/project.get-all.test.ts, backend/tests/api/project/project.get.test.ts, backend/tests/api/project/project.import-file.test.ts, backend/tests/api/project/project.wikibase.test.ts
Reordered imports; added treaty/DB helper imports where needed; arrow-function formatting; no test logic changes.
API tests — wikibase
backend/tests/api/wikibase/entities.test.ts
Entire file removed (wikibase entities API tests).
Service tests (imports/style)
backend/tests/services/nodemw-wikibase.service.test.ts, backend/tests/services/wikibase-api.service.test.ts, backend/tests/services/wikibase-config.service.test.ts
Import reordering; type-only imports; arrow-function formatting; no logic changes.
Misc tests (imports only)
backend/tests/api/wikibase/instances.test.ts, backend/tests/db.test.ts, backend/tests/error-handler.test.ts, backend/tests/wikibase-error-handler.test.ts
Reordered bun:test and named imports; no behavior changes.
TypeScript config
tsconfig.base.json
Adds compilerOptions.rootDir set to ".".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor C as Client
  participant E as Elysia App
  participant PR as projectRoutes
  participant EH as errorHandlerPlugin
  participant DB as databasePlugin
  participant CORS as cors()
  participant H as Route Handler

  C->>E: HTTP request /api/project/...
  E->>PR: Route dispatch
  activate PR
  PR->>EH: onRequest/onError context
  PR->>DB: attach DB connection to context
  PR->>CORS: apply CORS headers
  PR->>H: invoke handler with ctx (db, request)
  H-->>PR: response or throws
  PR-->>E: response (EH handles errors)
  E-->>C: HTTP response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9033ee4 and 860203d.

📒 Files selected for processing (39)
  • backend/src/api/_meta_projects.ts (2 hunks)
  • backend/src/api/project/import.ts (1 hunks)
  • backend/src/api/project/index.ts (3 hunks)
  • backend/src/api/project/project.create.ts (1 hunks)
  • backend/src/api/project/project.delete.ts (1 hunks)
  • backend/src/api/project/project.get-all.ts (1 hunks)
  • backend/src/api/project/project.get.ts (1 hunks)
  • backend/src/api/project/project.import-file.ts (1 hunks)
  • backend/src/api/project/project.wikibase.ts (3 hunks)
  • backend/src/index.ts (1 hunks)
  • backend/src/plugins/database.ts (1 hunks)
  • backend/src/plugins/error-handler.ts (1 hunks)
  • backend/src/plugins/wikibase.ts (1 hunks)
  • backend/src/services/__tests__/constraint-validation.service.test.ts (1 hunks)
  • backend/src/services/constraint-validation.service.ts (4 hunks)
  • backend/src/services/nodemw-wikibase.service.ts (1 hunks)
  • backend/src/services/wikibase-api.service.ts (1 hunks)
  • backend/src/services/wikibase-config.service.ts (3 hunks)
  • backend/src/types/error-handler.ts (1 hunks)
  • backend/src/utils/duckdb-types.ts (2 hunks)
  • backend/src/utils/wikibase-error-handler.ts (2 hunks)
  • backend/tests/api/_meta_projects.test.ts (2 hunks)
  • backend/tests/api/project/import-file.test.ts (2 hunks)
  • backend/tests/api/project/import.test.ts (2 hunks)
  • backend/tests/api/project/project.create.test.ts (1 hunks)
  • backend/tests/api/project/project.delete.test.ts (1 hunks)
  • backend/tests/api/project/project.get-all.test.ts (2 hunks)
  • backend/tests/api/project/project.get.test.ts (3 hunks)
  • backend/tests/api/project/project.import-file.test.ts (4 hunks)
  • backend/tests/api/project/project.wikibase.test.ts (1 hunks)
  • backend/tests/api/wikibase/entities.test.ts (0 hunks)
  • backend/tests/api/wikibase/instances.test.ts (1 hunks)
  • backend/tests/db.test.ts (1 hunks)
  • backend/tests/error-handler.test.ts (1 hunks)
  • backend/tests/services/nodemw-wikibase.service.test.ts (2 hunks)
  • backend/tests/services/wikibase-api.service.test.ts (2 hunks)
  • backend/tests/services/wikibase-config.service.test.ts (4 hunks)
  • backend/tests/wikibase-error-handler.test.ts (1 hunks)
  • tsconfig.base.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@DaxServer DaxServer merged commit 61d02d8 into main Sep 7, 2025
2 of 5 checks passed
@DaxServer DaxServer deleted the update branch September 7, 2025 13:19
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