Skip to content

Convert BFF to TypeScript #212

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 5 commits into from
Jul 31, 2025
Merged

Convert BFF to TypeScript #212

merged 5 commits into from
Jul 31, 2025

Conversation

andreaskienle
Copy link
Contributor

@andreaskienle andreaskienle commented Jul 30, 2025

This PR makes the following changes:

  • Migrated the BFF from JavaScript to TypeScript – only changed file extensions without adding types to keep it simple for now (TS errors are suppressed with @ts-ignore)
  • Added a build step to emit JavaScript files (⁠npm run build:server)
  • Changed the Dockerfile to use the slim node image, copy only the necessary files and remove dev dependencies after building
  • Upgraded node from 22 to 24 (latest LTS)

@andreaskienle andreaskienle requested a review from Copilot July 30, 2025 13:59
Copy link
Contributor

@Copilot 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 PR converts the Backend for Frontend (BFF) server from JavaScript to TypeScript to improve type safety and development experience. The migration involves adding TypeScript configuration, updating file extensions, and temporarily using @ts-ignore comments to suppress type errors during the transition.

Key changes include:

  • Added TypeScript configuration and build tooling
  • Converted all server-side JavaScript files to TypeScript (.ts extension)
  • Updated build scripts and Docker configuration for TypeScript compilation
  • Added temporary @ts-ignore comments to handle type issues during migration

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.server.json New TypeScript configuration for server-side compilation
server/routes/*.ts Route handlers converted to TypeScript with temporary type suppressions
server/plugins/*.ts Plugin files converted to TypeScript with type suppressions
server/*.ts Core server files converted to TypeScript
package.json Updated Node.js version and added TypeScript build scripts
Dockerfile Updated to use Node.js 24 and build TypeScript files
README.md Updated file references to reflect .ts extensions
Comments suppressed due to low confidence (2)

package.json:6

  • Node.js version 24 does not exist. The latest stable version is Node.js 22. Consider using "^22.0.0" instead.
    "node": "^24.0.0",

Dockerfile:21

  • The distroless image for Node.js 24 does not exist. Use 'gcr.io/distroless/nodejs22-debian12' which corresponds to the actual Node.js version.
FROM gcr.io/distroless/nodejs24-debian12 AS production

@andreaskienle andreaskienle marked this pull request as ready for review July 30, 2025 14:09
@andreaskienle andreaskienle merged commit fded6e0 into main Jul 31, 2025
5 checks passed
@andreaskienle andreaskienle deleted the fastify-typescript branch July 31, 2025 07:41
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.

3 participants