release: WRNexusJS 0.5.10
This commit is contained in:
@@ -16,11 +16,19 @@ import {
|
||||
type ThemeConfig,
|
||||
type MobileConfig,
|
||||
type PwaConfig,
|
||||
type NavigationConfig,
|
||||
} from "@wrnexus/styles";
|
||||
import { uiComponentsDir, uiCssPath } from "@wrnexus/ui";
|
||||
import { renderSchemasScript, type ObjectSchema, type SchemaDescriptor } from "@wrnexus/validation";
|
||||
import { loadLocales, resolveI18n, type I18nConfig } from "@wrnexus/i18n";
|
||||
import { applyMigrations, migrate, setDb, registerDb } from "@wrnexus/db";
|
||||
import {
|
||||
applyMigrations,
|
||||
loadMigrations,
|
||||
migrate,
|
||||
setDb,
|
||||
registerDb,
|
||||
registerLazyDb,
|
||||
} from "@wrnexus/db";
|
||||
import { connectFromConfig } from "@wrnexus/db/connect";
|
||||
import { configureStorage, type StorageConfig } from "@wrnexus/uploader";
|
||||
import { realtimeBusFromConfig } from "./realtime-bus.ts";
|
||||
@@ -76,6 +84,7 @@ export interface ServeOptions {
|
||||
plugins?: PluginInput;
|
||||
observability?: ObservabilityConfig;
|
||||
tenancy?: TenancyConfig;
|
||||
navigation?: NavigationConfig;
|
||||
}
|
||||
|
||||
export interface RunningServer {
|
||||
@@ -217,6 +226,7 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
|
||||
plugins: configuredPlugins,
|
||||
observability: opts.observability,
|
||||
tenancy: opts.tenancy,
|
||||
navigation: opts.navigation,
|
||||
};
|
||||
|
||||
await pluginRunner.configure(pluginConfig);
|
||||
@@ -304,8 +314,14 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
|
||||
}
|
||||
};
|
||||
if (opts.db) await connectAndMigrate(null, opts.db);
|
||||
for (const [name, cfg] of Object.entries(opts.databases ?? {}))
|
||||
await connectAndMigrate(name, cfg);
|
||||
for (const [name, cfg] of Object.entries(opts.databases ?? {})) {
|
||||
const migrationDir = join(appDir, "db", name, "migrations");
|
||||
const hasMigrations =
|
||||
loadMigrations(migrationDir).length > 0 ||
|
||||
resolvePackageMigrations(pluginContributions.migrations, name).length > 0;
|
||||
if (hasMigrations) await connectAndMigrate(name, cfg);
|
||||
else registerLazyDb(name, () => connectFromConfig(cfg, appRoot));
|
||||
}
|
||||
|
||||
// File-upload storage: build a driver per configured store (local dir / S3).
|
||||
// Relative local dirs resolve against the app root; served/served-back below.
|
||||
@@ -358,6 +374,7 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
|
||||
security: opts.security,
|
||||
observability: opts.observability,
|
||||
tenancy: opts.tenancy,
|
||||
navigation: opts.navigation,
|
||||
clientRuntimes: pluginContributions.clientRuntimes,
|
||||
hub,
|
||||
realtimeBus: realtimeBusFromConfig(opts.realtime),
|
||||
|
||||
Reference in New Issue
Block a user