Skip to content

Add serverless SDK plugin catalog and WebUI plugin market - #305

Open
BernardXiong wants to merge 2 commits into
RT-Thread:masterfrom
BernardXiong:feature/sdk-plugin-index
Open

BernardXiong wants to merge 2 commits into
RT-Thread:masterfrom
BernardXiong:feature/sdk-plugin-index

Conversation

@BernardXiong

Copy link
Copy Markdown
Member

Summary

Add a serverless SDK plugin catalog so Env can discover, download and install plugin releases published as plain JSON indexes, and expose the catalog in the WebUI plugin market.

Changes

SDK plugin catalog

  • Add plugins/sdk_index.py to read SDK JSON indexes, resolve a release compatible with the local plugin ABI, and verify the release asset over HTTPS with checksum validation.
  • Keep explicitly configured HTTP markets working, and keep the unsigned-install consent flow intact.
  • Extend plugins/market.py so SDK catalogs take precedence over the legacy market list when both are configured.
  • Wire the new catalog into cmds/cmd_plugin.py so env plugin search/install/upgrade see SDK-published plugins.

WebUI

  • Show the SDK catalog in the WebUI plugin market (plugins/webui/server.py and the frontend).
  • Allow plugin frames to open popups (allow-popups / allow-popups-to-escape-sandbox), so plugin pages can reach external documentation and tools.
  • Add dedicated favicon / apple touch icon assets and package them via MANIFEST.in.
  • Rebuild the committed WebUI static bundle.

Tests and documentation

  • Add plugins/tests/test_sdk_index.py, plugins/tests/test_sdk_index_webui.py and an e2e spec covering catalog validation, release redirects, checksums, ABI resolution, install/upgrade behavior and desktop/mobile catalog workflows.
  • Add .github/workflows/plugin-tests.yml running Python regression tests on Linux and Windows, plus frontend type-check, unit and Chromium e2e tests.
  • Document the SDK index structure, market precedence, safe downloads and serverless publication in plugins/README.md and plugins/README.zh-CN.md.

Test plan

  • python -m pytest tests plugins/tests -q
  • python -m plugins.epack.build_epack followed by the packaging assertions in CI.
  • Frontend: npm run typecheck, npm test, npm run build, npm run test:e2e -- sdk-market.spec.ts webui.spec.ts.
  • The same steps run in .github/workflows/plugin-tests.yml.

Impact

  • Plugin discovery now reads an additional SDK catalog source; existing explicit HTTP markets are unchanged.
  • WebUI plugin frames gain popup capability, and the page icon changes.
  • No change to the Env version metadata.

The page icon was an inline base64 1x1 transparent PNG placeholder, so
the browser tab and the installed WebUI showed no icon at all.

Replace it with a dedicated SVG/ICO icon set and an apple touch icon.
The icons live in frontend/public so vite copies them into the built
static directory, and MANIFEST.in now packages *.ico, *.svg and
frontend/public.

Impact: only the WebUI page icon and the packaged resources change, no
runtime logic is involved.
Plugin views embedded in an iframe were sandboxed with allow-scripts
only, so window.open() and target="_blank" links were silently blocked
and plugin pages could not reach external documentation or tools.

Extend the sandbox flags with allow-popups and
allow-popups-to-escape-sandbox so a plugin can launch a new window that
is not trapped in the frame sandbox. The built static bundle is rebuilt
accordingly.

Impact: applies to every plugin rendered in the WebUI plugin view.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant