按照规范在 store/@{作者名}/插件名/ 下创建目录
store/@{myname}/hello-world/
├── main.py
├── manifest.json
└── README.md
声明插件名称、版本、依赖和描述信息
{
"name": "hello-world",
"version": "1.0.0",
"author": "@{myname}",
"description": "我的第一个插件"
}
实现插件的初始化逻辑,注册路由或事件
class Plugin:
def init(self, app):
@app.route("/hello")
def hello():
return {"msg": "Hello, FutureOSS!"}
运行项目,访问 http://localhost:8080/hello 验证插件是否正常工作
bash start.sh
curl http://localhost:8080/hello
# → {"msg": "Hello, FutureOSS!"}
打包插件并上传到 Gitee 商店,其他人一键安装!
python tools/sign_single_plugin.py @{myname}/hello-world
# 上传到 Gitee 商店仓库