refactor: extract shared configs & federation packages; rename log/server-utils

- Create @lifeforge/configs package with shared client/module Vite configs
  and the `@` path alias resolver extracted from client/vite.config.ts
- Create @lifeforge/federation package with module loading, federation
  provider, and route utilities moved out of the client app
- Rename packages/lifeforge-log → packages/log
- Rename packages/lifeforge-server-utils → packages/server-utils
- Update all imports, tsconfig references, Dockerfiles, and workspace
  scripts to reflect the new package names and locations
This commit is contained in:
melvinchia3636
2026-06-08 20:03:58 +08:00
parent 67440a8443
commit e9776c3fd6
93 changed files with 778 additions and 563 deletions

View File

@@ -0,0 +1,16 @@
import { createForgeProxy } from '@lifeforge/shared'
import type { ProxyTree } from '@lifeforge/shared'
import type { ModuleConfig } from '../interfaces/module_config.types'
/**
* Wraps a module configuration and automatically appends a type-safe `forgeAPI` proxy client
* resolved dynamically from the module's contract.
*/
export default function createForgeModuleClient<T extends ModuleConfig>(
config: T
): T & { forgeAPI: T['contract'] extends undefined ? undefined : ProxyTree<T['contract']> } {
return {
...config,
forgeAPI: config.contract ? (createForgeProxy(config.contract) as any) : undefined
} as any
}