add mongoose orm to the stack builder (#191)

This commit is contained in:
José Alberto Gómez García
2025-05-02 15:23:04 +02:00
committed by GitHub
parent 946f3eb421
commit 437cf9a45a
15 changed files with 524 additions and 273 deletions

View File

@@ -62,6 +62,12 @@ export async function setupDatabase(config: ProjectConfig): Promise<void> {
projectDir: serverDir,
});
}
} else if (orm === "mongoose") {
await addPackageDependency({
dependencies: ["mongoose"],
devDependencies: [],
projectDir: serverDir,
});
}
if (database === "sqlite" && dbSetup === "turso") {

View File

@@ -367,6 +367,11 @@ export async function setupAuthTemplate(
PKG_ROOT,
`templates/auth/server/db/prisma/${db}`,
);
} else if (orm === "mongoose") {
authDbSrc = path.join(
PKG_ROOT,
`templates/auth/server/db/mongoose/${db}`,
)
}
if (authDbSrc && (await fs.pathExists(authDbSrc))) {
await processAndCopyFiles("**/*", authDbSrc, serverAppDir, context);