Repository navigation
fix(plugin-devkit): fail check when the manifest.renderer entry is missing - #1468
Conversation
…ssing pi-plugin check verified that the files named by main, ui.panel, and contributes.views exist, but not manifest.renderer. The SDK validator only checks the spelling (relative, .js/.mjs), so a plugin whose renderer module was missing passed check and pack produced a .piplug that host-core then refused at install with "PLUGIN_INVALID: renderer entry missing". Report renderer.missing when the entry is not a file in the plugin directory, the same rule host-core's validate_renderer applies. pack runs check first, so it now refuses such a package too. An absolute or ".." spelling was already refused by validateManifest; the new test pins that as well. Fixes vastsa#1464
muzimu217
left a comment
There was a problem hiding this comment.
Verified locally on macOS (worktree off current main): pnpm --filter @pi-desktop/plugin-devkit exec vitest run check → 8/8 pass, including the new renderer-entry test.
The fix restores the documented invariant for renderer entries ("check reproduces every rule the installer enforces, so check passing implies install will pass" — 10-plugin-devex.md §5–§6), which is exactly what #1464 reported broken. Placement mirrors the installer rule ordering (right after the ui.panel check, after validateManifest has already refused absolute/.. spellings), the message names the declared entry the same way panel.missing does, and the test's four branches are the right ones — missing file, a directory wearing the entry's name, the present case, and the escaping path as a negative control pinned to manifest.invalid. Docs updated in both languages on both spec surfaces.
Nothing blocking. One merge-order note: this PR and #1467 both edit 10-plugin-devex.md and 04-e2e-test-plan.md — whoever merges second rebases.
…/pr1468-renderer-entry-landing
|
Thanks for the concrete reproduction and the minimal checker fix. On the updated candidate, the devkit suite passed (52/52), and a CLI repro confirmed that a missing |
…ntry-check fix(plugin-devkit): fail check when the manifest.renderer entry is missing
Summary
pi-plugin checkverified the files named bymain,ui.panel, andcontributes.views, but notmanifest.renderer. A plugin whose renderer module was missing passedcheck,packproduced a.piplug, and host-core then refused the package at install withPLUGIN_INVALID: renderer entry missing: <entry>. This is the same "passes check, cannot install" class as #943.checknow reportsrenderer.missing, sopackrefuses the package too.Fixes #1464
Root cause
check()(packages/plugin-devkit/src/check.ts:191-230on779e16d9c) has existence checks formain,ui.panel, and view entries only.manifestRendererError(packages/plugin-sdk/src/index.ts:2113) validates the spelling only (relative path,.js/.mjs).validate_renderer,crates/host-core/src/plugins/renderer.rs:59-71, called frommanifest.rs:76, and covered byrenderer.rs:175.Change
check.tsadds arenderer.missingerror (manifest.renderer "<entry>" does not exist) when the entry is not a file in the plugin directory. It reusesfileExists, which requiresisFile(), so a directory named like a module is refused, as host-core does (renderer.rs:182)...spelling is already refused byvalidateManifestbefore this point (manifest.invalid), and symlinks are already refused by the package walk. The new test pins the..case.packrunscheckfirst (pack.ts:124), so it refuses the package with no change of its own.Production diff: +10 in
check.ts; the rest is one test (+31) and spec text.Specs / E2E docs
docs/spec/07-plugins/10-plugin-devex.md(en + zh-CN):manifest.rendereris added to the list of referenced filescheckrequires.06-delivery/04-e2e-test-plan.mdE2E-022C steps and expected results (en + zh-CN) cover deleting the renderer entry.Evidence
Tested commit
1b6f8a33f(fix/devkit-renderer-entry-check), based on main779e16d9c.pnpm check:pr-basepasses. Environment: Linux x64, Node 22.23.fails a manifest.renderer entry that does not exist, as the installer does (#1464):renderer.missing;../renderer/index.mjsis refused asmanifest.invalid.779e16d9c(ok: truefor the missing file) and passes with the fix.pnpm --filter @pi-desktop/plugin-devkit test: 50 passed (main: 49).examples/plugins/ui-slots-labwithrenderer/index.mjsdeleted:examples/plugins/*and both bundled plugins still check with 0 errors.pnpm build:js,pnpm --filter @pi-desktop/desktop typecheck,pnpm lint,node scripts/check-architecture.mjs, andpnpm check:agent-policy: pass.pnpm -r --if-present test: every package suite passes. Theapps/desktopfailures are unrelated to the devkit and also occur without this change (chat-error-message.test.mjshas a cancelled nested subtest on main; the*-user-pathtests need an installed Electron binary;plugin-websocket/jev-api-key-checkpass when run alone).pnpm docs:check: pass.git diff --check: clean.validate_rendererand its existing test.This PR and the #1463 PR both edit
check.ts,check.test.ts, and the same two spec files. The hunks do not overlap:git merge-treeof the two branches is clean.