Genez-io/genezio

[Bug fix]: At deployment, exclude source code files that are not used

andreia-oca opened this issue · 2 comments

Describe your task

This task is a bug fix.

Steps to reproduce the bug:

  1. Clone any genezio example - e.g. the typescript getting started example[1].
  2. Create a new .ts file on the server side and write something that generates a typescript error in it - for example:
export class TaskService {
    constructor() {
        this.fail(); // this method is not declared, so it will fail
    }
}
  1. Run genezio deploy.
  2. The process will fail:
Bundling your code...
|  [2023-10-23T14:36:33.672Z] DEBUG: The bundling process has started for file ./task.ts...
[2023-10-23T14:36:33.947Z] DEBUG: Typechecking Typescript files...
bug.ts(3,14): error TS2339: Property 'fail' does not exist on type 'TaskService'.

Typescript compilation failed.

This is not the expected behavior.

The deployment process should successfully end because the newly created file/class is not included in the genezio.yaml, hence it shouldn't be part of the deployment bundle.

[1] https://github.com/Genez-io/genezio-examples/tree/main/typescript/getting-started

I would also like to work on this issue @andreia-oca .

That's great, feel free to work on it.