From 5766b1caa7acee17b20342b8ca9b40ef1574134b Mon Sep 17 00:00:00 2001 From: mikebender Date: Thu, 30 Jul 2026 13:02:35 -0400 Subject: [PATCH] feat: Add `loader` as a field to `JsPlugin` - Add a loader field which can contain JSON data for loading the plugin --- src/deephaven/plugin/js.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/deephaven/plugin/js.py b/src/deephaven/plugin/js.py index 055f9bf..b373d36 100644 --- a/src/deephaven/plugin/js.py +++ b/src/deephaven/plugin/js.py @@ -4,6 +4,17 @@ from . import Plugin +JsonValue = typing.Union[ + None, + bool, + int, + float, + str, + typing.List["JsonValue"], + typing.Dict[str, "JsonValue"], +] +"""A JSON node; any value that can be represented in JSON.""" + class JsPlugin(Plugin): """ @@ -46,5 +57,13 @@ def main(self) -> str: """ pass + @property + def loader(self) -> typing.Optional[JsonValue]: + """ + The optional JS plugin loader configuration. When not None, will be included as the "loader" field for + the manifest entry in "js-plugins/manifest.json". Defaults to None. + """ + return None + def __str__(self) -> str: return f"{self.name}@{self.version}"