fix(loader): keep plugin entrypoint function-only#13
Open
vjda wants to merge 2 commits into
Open
Conversation
Keep the public plugin entrypoint limited to a default function\nexport so legacy OpenCode loader compatibility does not break.\n\n- move the lsof regex to an internal module\n- update tests to import the helper directly\n- add regression coverage for source and built exports\n\nRefs 0xCaso#12
Contributor
There was a problem hiding this comment.
Pull request overview
This PR narrows the public plugin entrypoint surface to a single default function export to preserve compatibility with OpenCode’s legacy plugin loader, while keeping the lsof parsing behavior intact.
Changes:
- Removed the named
LSOF_LISTEN_REexport fromsrc/index.tsand moved it into a new internal helper module. - Updated the
lsofparsing test to import the regex from the new internal module. - Added regression tests to assert both source and built entrypoints expose only a default function export.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/index.ts |
Stops exporting the regex from the public entrypoint; imports it internally instead. |
src/lsof.ts |
Introduces an internal module to hold LSOF_LISTEN_RE. |
test/lsof-parse.test.ts |
Updates test import to use the internal regex module. |
test/plugin-export.test.ts |
Adds regression tests for export shape (source + built). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12
This PR focuses on the compatibility fix. The original bug report and reproduction details are captured in #12.
Summary
LSOF_LISTEN_REinto an internal helper module used by runtime code and testsChanges
src/index.tssrc/lsof.tstest/lsof-parse.test.tstest/plugin-export.test.tsTest Plan
bun run typecheckbun testbun run buildNotes for Review