Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Plugin developers and AI assistants lack visibility into libraries automatically injected by the FDO host (plugin_host.html and PluginPage.jsx). This causes developers to miss available functionality and re-implement existing features.

Changes

Type Definitions (src/index.ts)

Added complete TypeScript interfaces for injected libraries:

  • Notyf - NotyfConstructor, Notyf, NotyfOptions, NotyfNotification
  • Highlight.js - HighlightJS, HighlightResult
  • ACE Editor - AceAjax.Ace, AceAjax.Editor, AceAjax.EditSession

Window helpers already had types; now library globals are also typed.

Documentation

  • docs/INJECTED_LIBRARIES.md - API reference for all injected CSS/JS libraries and window helpers with examples
  • docs/QUICK_REFERENCE.md - Quick lookup for common patterns
  • examples/07-injected-libraries-demo.ts - Live demo of all injected functionality

Libraries Documented

CSS: Pure CSS, Highlight.js, Notyf
JavaScript: FontAwesome, Split Grid, Highlight.js, Notyf, ACE Editor, Goober
Window Helpers: createBackendReq, waitForElement, executeInjectedScript, addGlobalEventListener, removeGlobalEventListener, applyClassToSelector

Example Usage

import { FDO_SDK } from "@anikitenko/fdo-sdk";

export default class MyPlugin extends FDO_SDK {
    render(): string {
        return `
            <button class="pure-button" onclick="notify()">Click Me</button>
            <script>
                const notyf = new Notyf(); // TypeScript now knows this exists
                function notify() {
                    notyf.success('Action completed!');
                }
            </script>
        `;
    }
}

Developers now get IntelliSense for all injected globals and can reference docs to discover available functionality.

Original prompt

So I want you to checkout main branch from https://github.com/anikitenko/fdo and review: plugin_host.html which is responsible for displaying render of plugin and checkout PluginPage.jsx... why I asked that - because currently it's not obvious to use those "helper" things for plugin developers and also AI coding assistants.. and I need some kind of unified approach... so what can you get from plugin_host.html:

  1. JS files imported in a "standard" way so some of them could use window., some of them
  2. CSS imports some libraries that could be useful in developing plugin

What can you get from PluginPage.jsx:

  1. See how actual plugins code is executed and what is inserted before the actual plugins code

As an outcome, I want to have everything in SDK so it would be more than helpful for developers to know what additional libraries are injected and utilize them in order to even improve the development experience


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 11, 2025 15:49
…raries

Co-authored-by: anikitenko <12380460+anikitenko@users.noreply.github.com>
Co-authored-by: anikitenko <12380460+anikitenko@users.noreply.github.com>
Copilot AI changed the title [WIP] Review plugin_host.html and PluginPage.jsx for unified approach Add TypeScript definitions and documentation for injected plugin libraries Nov 11, 2025
Copilot AI requested a review from anikitenko November 11, 2025 15:55
@anikitenko anikitenko marked this pull request as ready for review November 11, 2025 16:02
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.78% 485/496
🟢 Branches 93.64% 206/220
🟢 Functions 100% 158/158
🟢 Lines 97.76% 480/491

Test suite run success

403 tests passing in 31 suites.

Report generated by 🧪jest coverage report action from 543fe71

@anikitenko anikitenko merged commit 59bd1a7 into main Nov 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants