Skip to content

Support TypeScript plugins in find plugin manager via esbuild#187

Merged
abdulahmad307 merged 22 commits intomainfrom
copilot/implement-esbuild-plugin-support
Apr 20, 2026
Merged

Support TypeScript plugins in find plugin manager via esbuild#187
abdulahmad307 merged 22 commits intomainfrom
copilot/implement-esbuild-plugin-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Summary

Add the ability to load custom and built-in plugins from index.ts first (compiled at runtime with esbuild) and fall back to index.js.

Changes

  • Moved pluginManager.ts to a module pluginManager with an index.ts file export, and other files that are internal to the module - this enables unit test mocking
  • Added runtime TypeScript plugin support in pluginManager:
  • Updated dynamic import helper to support importing data: and file: URLs directly.
  • Added tests in .github/actions/find/tests/pluginManager.test.ts for:
  • Added esbuild dependency in .github/actions/find/package.json and updated lockfile.

Copilot AI and others added 2 commits April 8, 2026 17:46
Agent-Logs-Url: https://github.com/github/accessibility-scanner/sessions/874fd265-9e9f-4ac4-930d-8d26cb424035

Co-authored-by: abdulahmad307 <204748719+abdulahmad307@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/accessibility-scanner/sessions/874fd265-9e9f-4ac4-930d-8d26cb424035

Co-authored-by: abdulahmad307 <204748719+abdulahmad307@users.noreply.github.com>
Copy link
Copy Markdown

@Hopeduardo Hopeduardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thans

- change reflow to .ts file
- add temporary test scan for testing js files
- add new success path logs
- refactor code
- restructure files for testing
@abdulahmad307 abdulahmad307 force-pushed the copilot/implement-esbuild-plugin-support branch from a108816 to aefd2f4 Compare April 20, 2026 14:01
Comment thread .github/scanner-plugins/temp-test-scan/index.js Outdated
@abdulahmad307 abdulahmad307 marked this pull request as ready for review April 20, 2026 14:03
@abdulahmad307 abdulahmad307 requested a review from a team as a code owner April 20, 2026 14:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a proof-of-concept for loading TypeScript-based scanner plugins in the find GitHub Action by compiling index.ts at runtime with esbuild and falling back to index.js.

Changes:

  • Add TS plugin loading via esbuild + data: URL imports, with JS fallback.
  • Update dynamicImport to support importing data: and file: URLs directly.
  • Expand unit tests around plugin entrypoint preference/fallback behavior and add esbuild dependency.
Show a summary per file
File Description
.github/scanner-plugins/temp-test-scan/index.js Adds a new JS plugin folder (appears to be a temporary/POC plugin).
.github/scanner-plugins/reflow-scan/index.ts Formatting-only adjustments to built-in plugin code.
.github/actions/find/src/pluginManager/pluginFileLoaders.ts New TS/JS plugin loader helpers (TS loader compiles with esbuild).
.github/actions/find/src/pluginManager/types.d.ts Introduces plugin types (currently as a .d.ts).
.github/actions/find/src/pluginManager/index.ts Updates plugin discovery to prefer TS entrypoints and introduces exported plugin access for tests.
.github/actions/find/src/dynamicImport.ts Adds support for importing data:/file: URLs.
.github/actions/find/src/findForUrl.ts Updates pluginManager import to the new module path.
.github/actions/find/tests/pluginManager.test.ts Adds/updates tests for TS-vs-JS plugin loading behavior.
.github/actions/find/tests/findForUrl.test.ts Adjusts imports/types after pluginManager module changes.
.github/actions/find/package.json Adds esbuild dependency.
.github/actions/find/package-lock.json Lockfile update to include esbuild and platform packages.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Files not reviewed (1)
  • .github/actions/find/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

.github/actions/find/src/pluginManager/index.ts:12

  • types.d.ts is a declaration-only file and isn’t included by this package’s tsconfig.json (include: ["src/**/*.ts"]), so it won’t produce any runtime output in dist. Importing Plugin/PluginDefaultParams as values from ./types.d.js will therefore break at runtime/build. Move these types to a .ts module (or inline them) and import them with import type so no runtime import is emitted.
  • Files reviewed: 8/11 changed files
  • Comments generated: 6

Comment thread .github/actions/find/src/findForUrl.ts Outdated
Comment thread .github/actions/find/src/pluginManager/pluginFileLoaders.ts Outdated
Comment thread .github/actions/find/src/pluginManager/types.ts Outdated
Comment thread .github/actions/find/tests/findForUrl.test.ts Outdated
Comment thread .github/actions/find/tests/pluginManager.test.ts
Comment thread .github/scanner-plugins/temp-test-scan/index.js Outdated
Copy link
Copy Markdown
Contributor

@lindseywild lindseywild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to these comments, I think we should update the documentation as well so users know they can now use TS files when creating custom plugins, too!

Comment thread .github/actions/find/src/pluginManager/pluginFileLoaders.ts Outdated
Comment thread .github/actions/find/src/findForUrl.ts Outdated
Comment thread .github/actions/find/tests/findForUrl.test.ts Outdated
Comment thread .github/actions/find/tests/pluginManager.test.ts Outdated
Comment thread .github/scanner-plugins/temp-test-scan/index.js Outdated
@abdulahmad307 abdulahmad307 changed the title POC: support TypeScript plugins in find plugin manager via esbuild Support TypeScript plugins in find plugin manager via esbuild Apr 20, 2026
Copy link
Copy Markdown
Contributor

@lindseywild lindseywild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some docs nits, feel free to do with them what you want!

Comment thread PLUGINS.md Outdated
Comment thread PLUGINS.md Outdated
Comment thread PLUGINS.md Outdated
Comment thread .github/actions/find/src/pluginManager/index.ts Outdated
Copy link
Copy Markdown
Contributor

@lindseywild lindseywild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this! 🎉

@abdulahmad307 abdulahmad307 merged commit 0fa3e24 into main Apr 20, 2026
6 checks passed
@abdulahmad307 abdulahmad307 deleted the copilot/implement-esbuild-plugin-support branch April 20, 2026 18:48
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.

5 participants