@clipbus/plugin-sdk 0.8.1 → 0.8.2
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/dist/validate/index.cjs +5 -1
- package/dist/validate/index.js +5 -1
- package/docs/manifest.md +2 -0
- package/package.json +1 -1
package/dist/validate/index.cjs
CHANGED
|
@@ -286,7 +286,11 @@ function validateManifest(manifest, options = {}) {
|
|
|
286
286
|
issues.push(issue("missingRuntimeEntry", `Missing runtime entry: ${nodeEntry}`));
|
|
287
287
|
}
|
|
288
288
|
const uiRootAbs = import_node_path.default.resolve(rootDir, uiRoot);
|
|
289
|
-
|
|
289
|
+
const declaresUISurface = renderers.length > 0 || asRecordArray(raw["actions"]).some((a) => {
|
|
290
|
+
const entry = asString(a["uiEntry"])?.trim();
|
|
291
|
+
return entry !== void 0 && entry.length > 0;
|
|
292
|
+
});
|
|
293
|
+
if (declaresUISurface && !(0, import_node_fs.existsSync)(uiRootAbs)) {
|
|
290
294
|
issues.push(issue("missingUIRoot", `Missing UI root: ${uiRoot}`));
|
|
291
295
|
}
|
|
292
296
|
for (const renderer of renderers) {
|
package/dist/validate/index.js
CHANGED
|
@@ -251,7 +251,11 @@ function validateManifest(manifest, options = {}) {
|
|
|
251
251
|
issues.push(issue("missingRuntimeEntry", `Missing runtime entry: ${nodeEntry}`));
|
|
252
252
|
}
|
|
253
253
|
const uiRootAbs = path.resolve(rootDir, uiRoot);
|
|
254
|
-
|
|
254
|
+
const declaresUISurface = renderers.length > 0 || asRecordArray(raw["actions"]).some((a) => {
|
|
255
|
+
const entry = asString(a["uiEntry"])?.trim();
|
|
256
|
+
return entry !== void 0 && entry.length > 0;
|
|
257
|
+
});
|
|
258
|
+
if (declaresUISurface && !existsSync(uiRootAbs)) {
|
|
255
259
|
issues.push(issue("missingUIRoot", `Missing UI root: ${uiRoot}`));
|
|
256
260
|
}
|
|
257
261
|
for (const renderer of renderers) {
|
package/docs/manifest.md
CHANGED
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
| `runtime.nodeEntry` | `string` | 是 | Node runtime 入口(编译后 `.cjs`) |
|
|
48
48
|
| `runtime.uiRoot` | `string` | 是 | UI 根目录;所有 `uiEntry` 相对此目录 |
|
|
49
49
|
|
|
50
|
+
> **关于 `uiRoot` 目录存在性**:`uiRoot` 是必填*声明*,但其指向目录(如 `dist/ui`)只在插件声明 UI 面时才需在磁盘存在——即有任意 `attachmentRenderers`,或任意带 `uiEntry` 的 `action`。纯 auto-run-action 插件(无 renderer / detector / action uiEntry)构建后无需产出 `dist/ui`,`clipbus-validate-manifest --runtime` 与宿主加载期都不会因其缺失而失败。
|
|
51
|
+
|
|
50
52
|
---
|
|
51
53
|
|
|
52
54
|
## `permissions`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipbus/plugin-sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Typed SDK for authoring Clipbus plugins — runtime (Node.js) and UI (WebView) helpers generated from the Clipbus plugin wire contract.",
|
|
6
6
|
"keywords": [
|