feat: add code-only tests and enhance CLI sync command with seeding option

Introduced a new test suite for code-only applications, validating app creation, database sync behavior, and seeding functionality. Enhanced the CLI sync command to include a seeding option, allowing for explicit seeding during database synchronization. Added error handling for unresolved config files in the run command.
This commit is contained in:
dswbx
2025-09-24 16:23:16 +02:00
parent 832eb6ac31
commit 1128ac500d
5 changed files with 151 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ import {
SecretSchema,
setPath,
mark,
$console,
} from "bknd/utils";
import { DebugLogger } from "core/utils/DebugLogger";
import { Guard } from "auth/authorize/Guard";
@@ -126,7 +127,7 @@ export class ModuleManager {
constructor(
protected readonly connection: Connection,
protected options?: Partial<ModuleManagerOptions>,
public options?: Partial<ModuleManagerOptions>,
) {
this.modules = {} as Modules;
this.emgr = new EventManager({ ...ModuleManagerEvents });
@@ -330,9 +331,8 @@ export class ModuleManager {
ctx.flags.sync_required = false;
this.logger.log("db sync requested");
// sync db
await ctx.em.schema().sync({ force: true, drop: options?.drop });
state.synced = true;
// sync db hint
$console.warn("a database sync is required");
}
if (ctx.flags.ctx_reload_required) {