Skip to content

typekey/plugin-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugin-example-diagnostics

A reference plugin for the RNA Browser plugin system. Exercises every public host API so you can verify your build of the host has the plugin SDK wired correctly.

What it shows

  • State Inspector — live JSON of species, selectedRegion, selectedRNA, channels, favorites, history, highlightRegions.
  • Navigation testerhost.navigate({ chr, start, end }) and host.navigate({ transcriptId }).
  • Highlight testerhost.highlight.add/remove/clear.
  • Storage tester — namespaced host.storage.get/set/remove/keys/clear.
  • Host infohost.info (pluginId, version, apiVersion, permissions).

Install

  1. Drag the prebuilt plugin-example-diagnostics-<version>.rbp (see Build) into the RBrowser Plugin Store panel — or use Plugin Store → ⚙ → Install from local file… and pick the .rbp.
  2. Toggle to Enabled; the panel mounts on the right side.

Build

This plugin is built with @rbrowser/plugin-sdk (npm) and its companion CLI.

# 1. install deps (React, @rbrowser/plugin-sdk)
npm install

# 2. build the ESM bundle  →  dist/index.js (~150 KB)
npm run build

# 3. pack into a single .rbp  →  dist/plugin-example-diagnostics-<version>.rbp
npm run pack

npm run pack runs vite build then invokes the SDK CLI (rbrowser-plugin pack), which reads manifest.json + dist/index.js and writes the .rbp archive.

Author a new plugin

  1. Add @rbrowser/plugin-sdk as a dependency.
  2. export default definePlugin({ activate?, render, deactivate? }).
  3. npm run pack to produce a .rbp, drag-install it via Plugin Store.

Your plugin receives a host: RBrowserHost from the loader — never construct your own. See the SDK README on npm for the full host API and CLI reference.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages