refactor: Co-locate server artifacts under apps/server/
Move drizzle/, dist/, and coverage/ into apps/server/ so all server-specific artifacts live alongside the source they belong to. - git mv drizzle/ → apps/server/drizzle/ - drizzle.config.ts: out → ./apps/server/drizzle - tsconfig.json: outDir → ./apps/server/dist, exclude drizzle dir - package.json: main/bin/clean point to apps/server/dist/ - vitest.config.ts: reportsDirectory → ./apps/server/coverage - .gitignore: add coverage/ entry - ensure-schema.ts: update getMigrationsPath() for new layout - docs/database-migrations.md: update drizzle/ references
This commit is contained in:
@@ -20,10 +20,10 @@ const log = createModuleLogger('db');
|
||||
*/
|
||||
function getMigrationsPath(): string {
|
||||
const currentDir = dirname(fileURLToPath(import.meta.url));
|
||||
// In dev (tsx): apps/server/db/ — need 3 levels up to workspace root
|
||||
// In dist (tsc): dist/db/ — need 2 levels up to workspace root
|
||||
const upThree = join(currentDir, '..', '..', '..', 'drizzle');
|
||||
if (existsSync(upThree)) return upThree;
|
||||
// Dev: apps/server/db/ → 1 up → apps/server/drizzle/
|
||||
// Dist: apps/server/dist/db/ → 2 up → apps/server/drizzle/
|
||||
const upOne = join(currentDir, '..', 'drizzle');
|
||||
if (existsSync(upOne)) return upOne;
|
||||
return join(currentDir, '..', '..', 'drizzle');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user