feat: multi-package loading with base framework support

- Add RuntimeOptions.basePackages for loading framework packages before game package
- Add ScriptEngine.loadPackages() for multi-package module merging
- LuaDardoScriptEngine merges modules from all packages, game overrides framework
- PackageActivationController loads base packages first, then game package
- GamePackageManifest parses optional 'base' field
- Update docs: README, quick-start, lua-package-format, architecture
- Update all test mocks with loadPackages() implementation
This commit is contained in:
gem
2026-06-10 00:04:00 +08:00
parent 0d4fbd030c
commit 8ddc3be3a7
13 changed files with 255 additions and 7 deletions

View File

@@ -1,7 +1,14 @@
class RuntimeOptions {
const RuntimeOptions({this.runtimeLuaRoot = defaultRuntimeLuaRoot});
const RuntimeOptions({
this.runtimeLuaRoot = defaultRuntimeLuaRoot,
this.basePackages = const [],
});
static const defaultRuntimeLuaRoot = 'assets/runtime/lua';
final String runtimeLuaRoot;
// 框架包 gameId 列表,按顺序先于游戏包加载。
// 后加载的同名模块覆盖先加载的。
final List<String> basePackages;
}