@coda-console/protocol 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/package.json +1 -1
- package/schemas/plugin/plugin.json +8 -0
package/README.md
CHANGED
|
@@ -37,6 +37,12 @@ const { root } = await readWorkflow(source, 'deploy');
|
|
|
37
37
|
|
|
38
38
|
`TYPES` 是 Coda 自己的类型(`contributes` 的键),`SCHEMAS` 是全部 schema(按文件名)。
|
|
39
39
|
|
|
40
|
+
## 插件的后端通道
|
|
41
|
+
|
|
42
|
+
插件清单可以声明 `"coda": { "channels": ["preview"] }`,限定只在预览版后端安装和更新。允许的通道是 `stable`(正式版)和 `preview`(预览版);数组非空、不重复。不写 `channels` 的插件不限制通道。
|
|
43
|
+
|
|
44
|
+
宿主按每台目标后端自己的安装记录判断,不按 Mac / iPhone 客户端版本判断;没有通道记录的后端不满足显式限制。商店和直接从 npm、Git 安装执行同一限制。这是 Coda 的安装约束,不改变 npm 包的公开性,也不能约束不认识该字段的旧宿主。
|
|
45
|
+
|
|
40
46
|
## 项目中的多选选项
|
|
41
47
|
|
|
42
48
|
设置的 `items.anyOf` 选项可附带 `workflowKind`(`check`、`premerge`、`deploy`、`preview`、`release`)。全局设置显示全部选项;项目设置只显示该项目有的流程类别,未写此字段的选项始终显示。宿主负责按项目提供可选项,流程执行时仍需按运行的提交判断可用操作。
|
package/package.json
CHANGED
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
"id": {"$ref": "common.json#/$defs/id", "description": "插件 ID:小写字母、数字和「-」,以字母开头,至多 40 个字符;不写就用 name"},
|
|
9
9
|
"name": {"type": "string"},
|
|
10
10
|
"categories": {"description": "分类:文本的数组,第一个是插件页里归的类", "type": "array", "items": {"type": "string"}},
|
|
11
|
+
"coda": {
|
|
12
|
+
"description": "Coda 宿主的安装要求;不写 channels 就不限制后端通道",
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"channels": {"description": "允许安装和更新的后端通道:stable(正式版)、preview(预览版);以目标后端的安装记录为准,没有通道记录不满足限制", "type": "array", "minItems": 1, "uniqueItems": true, "items": {"enum": ["stable", "preview"]}}
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
},
|
|
11
19
|
"main": {"description": "插件宿主运行的模块:插件目录里的 .js 或 .mjs 文件", "type": "string", "pattern": "\\.m?js$", "x-file": {"type": "file"}},
|
|
12
20
|
"activationEvents": {"description": "宿主什么时候加载 main:onStartupFinished(后端一启动),不重复", "type": "array", "items": {"enum": ["onStartupFinished"]}, "uniqueItems": true},
|
|
13
21
|
"extensionDependencies": {"description": "需要先装的插件的 ID,不重复", "type": "array", "items": {"$ref": "common.json#/$defs/id"}, "uniqueItems": true},
|