feat: add package source compatibility controls

This commit is contained in:
gem
2026-06-10 17:54:12 +08:00
parent 6608d0a975
commit 79ee35db2f
12 changed files with 611 additions and 30 deletions

View File

@@ -20,6 +20,8 @@ It is designed for Flutter apps that want to host Lua-authored 2D games or inter
- Shared Lua helper modules under `assets/runtime/lua/`.
- Configurable Runtime Lua asset root via `RuntimeOptions.runtimeLuaRoot`.
- Multi-package loading: shared framework packages loaded once, game packages loaded on top.
- Asset, local file, and remote package repositories for bundled, development, and hot-update workflows.
- Remote package compatibility checks for Runtime version, host build, platform, and release channel.
## Example
@@ -95,6 +97,14 @@ The game manifest declares package-local scripts and shared Runtime Lua modules:
}
```
## Package loading modes
- `AssetGamePackageRepository`: bundled app assets and fallback packages.
- `FileGamePackageRepository`: local development directory, useful when large images should not be bundled into the app during iteration.
- `RemoteGamePackageRepository`: remote zip packages with sha256 verification, compatibility checks, and stable cache fallback.
Remote compatibility is configured with `RuntimeOptions.runtimeVersion`, `hostBuild`, `platform`, and `channel`.
## Runtime asset path
When used as a published package, configure: