-
Notifications
You must be signed in to change notification settings - Fork 1
Manifest Dependencies Logo
Ling edited this page Jul 22, 2026
·
1 revision
插件契约由三个文件组成:
| 文件 | 所在位置 | 用途 |
|---|---|---|
plugin.json |
PCLX 包根目录 | 校验并加载已安装插件 |
| Mixin 配置 JSON | PCLX 包内 | 指定 Mixin 类型、required、优先级和默认匹配数 |
manifest.json |
插件发布源或 GitHub 仓库根目录 | 描述商店元数据、版本、平台包、SHA-256 和更新来源 |
完整示例:
{
"id": "example.plugin",
"name": "Example Plugin",
"version": "1.2.0",
"author": "Example",
"description": "Example PCL.Mixin plugin.",
"readmeUrl": "README.md",
"pclCoreVersion": "2026.07.1",
"entryAssembly": "lib/Example.Plugin.dll",
"mixinConfigs": [
"mixins/core.mixins.json",
"mixins/ui.mixins.json"
],
"dependencies": [
{
"id": "pcl.bridge.python",
"version": ">=1.0.0 <2.0.0"
}
],
"homepageUrl": "https://example.com/plugin",
"license": "MIT",
"logo": "assets/logo.png",
"screenshots": ["assets/screenshot-1.png"]
}关键字段:
| 字段 | 必填 | 说明 |
|---|---|---|
id |
是 | 至少两个点分段的稳定插件 ID |
name |
是 | 显示名称 |
version |
是 | 插件自己的 SemVer 版本 |
author |
建议 | 包内作者文本 |
description |
建议 | 简短说明 |
pclCoreVersion |
是 | 构建时引用的 PCL.Core BaseVersion |
entryAssembly |
是 | 包根目录下的主程序集相对路径 |
mixinConfig / mixinConfigs
|
是 | 至少声明一个 Mixin 配置 |
dependencies |
否 | 必须已安装、启用并满足版本约束的前置插件 |
readme / readmeUrl
|
否 | 内联 Markdown 或 README 地址/相对路径 |
logo |
否 | 包内安全相对路径或 HTTP/HTTPS URL |
homepageUrl、license、screenshots
|
否 | 展示元数据 |
{
"required": true,
"package": "Example.Plugin.Mixins",
"mixins": ["CoreMixin", "UiMixin"],
"priority": 1000,
"injectors": {
"defaultRequire": 1
},
"plugin": "Example.Plugin.ExampleMixinConfigPlugin"
}plugin 是可选的 IMixinConfigPlugin 类型全名,用于 ShouldApplyMixin、PreApply 和 PostApply。
依赖项只包含插件 ID 和 SemVer 约束:
{
"id": "example.bridge",
"version": ">=1.2.0 <2.0.0"
}支持 >、>=、<、<=、=,多个条件用空格或逗号分隔。空值或 * 表示任意版本。版本必须写成完整 SemVer,不要写 v1.2.0。
Core 会拒绝自依赖、重复依赖、无效 ID、无效约束、缺失或未启用的前置,以及循环依赖。依赖失败会向下游传播。
市场 manifest.json 可在顶层声明默认依赖,也可以在某个 versions[] 条目中覆盖。下载后的 plugin.json 必须与最终解析出的市场依赖一致。
-
plugin.json.logo:包内相对路径或 HTTP/HTTPS URL。 -
manifest.json.logo:绝对 URL,或相对于 Manifest 地址解析的路径。 - 市场内联插件的 Logo:相对于来源 JSON 解析。
- GitHub Topic 插件没有声明 Logo 时,使用仓库 Owner 的头像。
不要把本机绝对路径写进发布 Manifest。相对路径适合与 JSON 一起托管的静态资源。