Skip to content

fix: restore npm plugin loading for package installs#58

Merged
sven1103-agent merged 1 commit into
mainfrom
fix/plugin-load-entrypoint
Mar 30, 2026
Merged

fix: restore npm plugin loading for package installs#58
sven1103-agent merged 1 commit into
mainfrom
fix/plugin-load-entrypoint

Conversation

@sven1103-agent

Copy link
Copy Markdown
Owner

Summary

  • add a CommonJS package entrypoint so OpenCode loaders that call the package root receive a callable plugin factory
  • keep the existing ESM source entrypoint for import-based consumers and include the compatibility wrapper in published artifacts
  • add a regression test that loads the package root via require() and verifies it initializes the plugin hooks

Testing

  • node --test test/plugin-entrypoint.test.js test/cli.test.js test/hook-enforcement.test.js
  • npm pack --json

Related

@sven1103-agent sven1103-agent merged commit c0904d1 into main Mar 30, 2026
2 checks passed
@sven1103-agent sven1103-agent deleted the fix/plugin-load-entrypoint branch March 30, 2026 16:04
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.

Plugin fails to load in OpenCode: 'Plugin export is not a function'

1 participant