0.0.11 • Published 4 years ago

@symbiota2/sample-plugin v0.0.11

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

Symbiota2 Backend Plugin

A Symbiota2 backend plugin needs the following key features in order to work: this repository:

  • One or more NestJS modules
  • A single NestJS module exported as the default for the package via index.ts
  • Each NestJS module is dynamic, with its imports for @symbiota/backend injected at runtime

Developing a plugin

  1. Clone this repository and add custom NestJS to src
  2. Export a single module as the default from index.ts
  3. Build the plugin project npm run build
  4. Copy the dist directory to plugins in the data directory of a Symbiota2 installation (and rename to something better than dist)
  5. Restart your Symbiota2 installation
  6. All controllers exported from the plugin's default module will be available within the Symbiota2 core back end

Symbiota2 backend plugins are built with WebPack, which bundles any dependencies from @symbiota2/backend that the plugin will use. As a result, plugins are pinned to a specific version of Symbiota2, and there is no guarantee that an update to @symbiota2/backend will render the plugin compatible without modification. For this reason, it is recommended that developers add a static, readonly S2_VERSION to their default module, and log the version in the register() method. This method is required and called each time the plugin is imported, so the plugin's Symbiota2 version will always be displayed as Symbiota2 starts up. This will help administrators track down bugs resulting from any incompatible plugins.

After a newly-built plugin has been copied to the ${APP_DATA_DIR}/plugins directory and Symbiota2 has been restarted, Symbiota2 PluginModule scans the plugin directory, searching for index.js files and importing their default exports. It is for this reason that the plugin must have a single, default export.

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago