Description
Describe the bug
When creating a new project using the danet
CLI and selecting "in-memory" as the database provider, the generated DatabaseModule
still references PostgresService
, which does not exist in the project, causing a runtime error.
To Reproduce
Steps to reproduce the behavior:
- Run the following command:
danet new danet-in-memory
- Select "in-memory" as the database provider.
- After project creation, check the file
src/database/module.ts
. - The file contains an import and injection for
PostgresService
, which does not exist. - Running the application results in the following error:
ERROR: src/database/postgres.service.ts File not found. Please check the file path
Expected behavior
When selecting "in-memory" as the database provider, the generated DatabaseModule
should correctly use an in-memory repository instead of referencing PostgresService
.
Screenshots
N/A
Desktop (please complete the following information):
- OS: MacOS Ventura
- Deno: 2.2.4
- v8: 13.4.114.11-rusty
- Typescript: 5.7.3
- Danet CLI Version: 0.10.0
Smartphone (please complete the following information, if applicable):
N/A
Additional context
The TodoModule
correctly references InMemoryTodoRepository
, but DatabaseModule
does not reflect the selected database provider. It still attempts to import and inject PostgresService
, leading to a missing file error.
Possible fix: Adjust the CLI project generator to properly configure the DatabaseModule
based on the selected database provider.