open-scd icon indicating copy to clipboard operation
open-scd copied to clipboard

Update the plugin loading functionality so it uses core's API

Open juancho0202 opened this issue 10 months ago • 0 comments

Currently we are supporting both the legacy API for plugins and core's API for the same thing. We only want to support core's API.

Legacy API:

export type Plugin = {
  name: string;
  src: string;
  icon?: string;
  default?: boolean;
  kind: PluginKind;
  requireDoc?: boolean;
  position?: MenuPosition;
  installed: boolean;
  official?: boolean;
  content?: TemplateResult;
};

Core's API:

export type Plugin = {
  name: string;
  translations?: Record<(typeof targetLocales)[number], string>;
  src: string;
  icon: string;
  requireDoc?: boolean;
  active?: boolean;
  position: 'top' | 'middle' | 'bottom';
};
export type PluginSet = { menu: Plugin[]; editor: Plugin[] };

Acceptance criteria:

  • Legacy Plugin API is removed
  • All current code that relies on that legacy API is updated and uses Core's API (including plugins.js which has the list of official plugins)
  • Plugins should continue working exactly the same as before

juancho0202 avatar Apr 11 '24 08:04 juancho0202