Repository navigation
fix(plugin): export only plugin function for opencode loader compatibility #2760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c4de58f
fix(plugin): export only plugin function for opencode loader compatib…
van3hardy d88c8bc
test(opencode): assert built entry exports only the plugin function
van3hardy 9bb0dfb
test(opencode): assert built entry is a working plugin, not just an e…
van3hardy 62c2d49
test(opencode): assert init does not call shell and root plugin tools
van3hardy 8eab8f0
test(opencode): guard plugin.tool existence before shape assertion
van3hardy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root entry now correctly exports only the default plugin, but the automated checks never import
.opencode/dist/index.jsand assert that its export namespace is exactly a function-valueddefault.tests/scripts/build-opencode.test.jsverifies that the build succeeds and artifacts exist, while the hook suite importsdist/plugins/ecc-hooks.jsdirectly. A temporary named string export still let the existing build test pass while the compiled-entry export-shape check failed. Add a post-build assertion forObject.keys(module) === ["default"]andtypeof module.default === "function"so a future named export cannot silently restore the legacy-loader failure.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Artifacts
Executable built OpenCode entry export-shape checker
Base build fails the OpenCode loader export-shape check
PR head build has default-only entry and focused suites pass
Simulated named export passes existing test but fails entry-shape check
Disposable regression source restored and worktrees removed