fix: add main field and relax peer dependency for plugin loading#15
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves OpenCode plugin loading compatibility by adjusting the package entry point metadata and loosening SDK version constraints to better match how OpenCode resolves plugins.
Changes:
- Add a
mainfield pointing to./dist/index.jsto support loaders that don’t resolveexports. - Relax
@opencode-ai/pluginpeer dependency from an exact pin to a broader compatible range. - Add a Changesets entry to publish a patch release documenting the compatibility fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Adds main entrypoint and relaxes @opencode-ai/plugin peer dependency to improve plugin loader compatibility. |
| .changeset/fix-plugin-loading.md | Documents the patch release and rationale for the loading/peer dependency adjustments. |
Comments suppressed due to low confidence (1)
package.json:12
- Since the goal is compatibility with loaders that may not honor
exports, consider also adding a top-leveltypes(ortypings) field pointing to./dist/index.d.ts. Otherwise, environments that fall back tomainmay resolve the JS entrypoint but fail to pick up the bundled TypeScript declarations.
"type": "module",
"main": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR updates the package metadata for @mcmunder/opencode-git-memory to improve OpenCode plugin entry-point resolution and loosen version constraints for the OpenCode plugin API dependency.
Changes:
- Add a
mainfield pointing to./dist/index.jsto support loaders that rely onmaininstead ofexports. - Relax
@opencode-ai/pluginpeerDependenciesfrom an exact pin to a minimum version range. - Add a changeset to publish the update as a patch release.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Adds main entry point and relaxes @opencode-ai/plugin peer dependency range. |
| .changeset/open-symbols-exist.md | Adds release note for the patch change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "peerDependencies": { | ||
| "@opencode-ai/plugin": "1.2.27", | ||
| "@opencode-ai/plugin": "^1.1.0", | ||
| "typescript": "^5" |
| "@mcmunder/opencode-git-memory": patch | ||
| --- | ||
|
|
||
| Add main field to package.json to hopefully fix plugin loading. |
Summary
mainfield topackage.jsonpointing to./dist/index.js. All other working OpenCode plugins usemainfor entry point resolution — our plugin only hadexports, which OpenCode's plugin loader may not resolve.peerDependenciesfrom exact pin@opencode-ai/plugin: "1.2.27"to>=1.1.0, matching the convention used by other plugins.