feat(appgui): 添加应用GUI界面支持及包类型管理

新增appgui API用于绘制顶部和底部状态栏,提供一致的UI界面
在package.json中添加type字段区分应用和API包类型
更新安装程序以使用新的appgui界面
修改pkg程序以支持根据包类型安装到不同目录
添加appgui使用文档和演示程序
This commit is contained in:
2025-09-12 17:10:44 +08:00
parent 429b98ab00
commit 0bb365cadb
7 changed files with 346 additions and 33 deletions

View File

@@ -52,10 +52,33 @@ The package.json file contains metadata about your package. Here's an example:
- **version**: The package version (semantic versioning recommended)
- **author**: Your name or username
- **description**: A short description of what the package does
- **type**: The type of your package ("app" for applications, "api" for libraries)
- **main**: The main Lua file to load
- **dependencies**: Other packages your package depends on
- **exports**: Functions or variables to export for other programs to use
== Package Type Field ==
The `type` field in package.json determines where your package files will be installed:
- **app**: Files will be installed in the `/app` directory (default behavior)
- **api**: Files will be installed in the `/leonos/apis` directory
Example of a package.json with type field:
>>color yellow
{
"name": "example-api",
"version": "1.0.0",
"author": "Your Name",
"description": "An example API package",
"type": "api",
"main": "example-api.lua",
"dependencies": {},
"exports": {}
}
>>color white
== Writing Package Code ==
Edit the `<package_name>.lua` file to add your code. Here's a simple example: