From b370eff4f3252bf1f9e7b249f5f76c6c3dc0d609 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Mon, 11 Aug 2025 15:56:33 -0400 Subject: [PATCH] feat(electron): added plugin specific tools to ui --- build-python/meson.build | 1 + electron/bridge.py | 11 +- electron/index.html | 154 ++++++ electron/main-refactored.js | 5 +- electron/main/ipc-handlers.js | 85 +++- electron/renderer-refactored.js | 6 + electron/renderer/dom-manager.js | 38 +- electron/renderer/event-handlers.js | 27 +- electron/renderer/plugin-operations.js | 509 +++++++++++++++++++ electron/styles.css | 218 ++++++++- fourdst/cli/plugin/diff.py | 116 ++--- fourdst/cli/plugin/extract.py | 77 +-- fourdst/cli/plugin/init.py | 183 ++----- fourdst/cli/plugin/pack.py | 101 ++-- fourdst/cli/plugin/validate.py | 57 +-- fourdst/core/plugin.py | 649 +++++++++++++++++++++++++ subprojects/libplugin.wrap | 2 +- 17 files changed, 1834 insertions(+), 405 deletions(-) create mode 100644 electron/renderer/plugin-operations.js create mode 100644 fourdst/core/plugin.py diff --git a/build-python/meson.build b/build-python/meson.build index 3ebe8ee..5f50198 100644 --- a/build-python/meson.build +++ b/build-python/meson.build @@ -107,6 +107,7 @@ py_installation.install_sources( meson.project_source_root() + '/fourdst/core/platform.py', meson.project_source_root() + '/fourdst/core/utils.py', meson.project_source_root() + '/fourdst/core/keys.py', + meson.project_source_root() + '/fourdst/core/plugin.py', ), subdir: 'fourdst/core' ) diff --git a/electron/bridge.py b/electron/bridge.py index 1652629..a9ecfb5 100644 --- a/electron/bridge.py +++ b/electron/bridge.py @@ -34,7 +34,7 @@ class FourdstEncoder(json.JSONEncoder): project_root = Path(__file__).resolve().parent.parent sys.path.insert(0, str(project_root)) -from fourdst.core import bundle, keys +from fourdst.core import bundle, keys, plugin def main(): # Use stderr for all logging to avoid interfering with JSON output on stdout @@ -74,9 +74,18 @@ def main(): 'sync_remotes', 'get_remote_sources', 'add_remote_source', 'remove_remote_source' ] + plugin_commands = [ + 'parse_cpp_interface', 'generate_plugin_project', 'validate_bundle_directory', + 'pack_bundle_directory', 'extract_plugin_from_bundle', 'compare_plugin_sources', + 'validate_plugin_project' + ] + if command in key_commands: func = getattr(keys, command) module_name = "keys" + elif command in plugin_commands: + func = getattr(plugin, command) + module_name = "plugin" else: func = getattr(bundle, command) module_name = "bundle" diff --git a/electron/index.html b/electron/index.html index 2517be9..58581af 100644 --- a/electron/index.html +++ b/electron/index.html @@ -63,6 +63,16 @@ + + + @@ -480,6 +490,150 @@ + + +