Repository navigation
v2.0.1
v2.0.1 — Fix npm plugin entrypoint
Plugin @hung319/opencode-hive 2.0.1: sửa lỗi bản 2.0.0 cài qua npm không nạp được, OpenCode báo PluginModule.LoadError: Plugin entrypoint not found. Không có thay đổi API hay breaking change.
Nguyên nhân
package.jsonkhai báo"exports": { ".": "./index.js" }, nhưngfileschỉ đóng góidist/,skills/,README.md— shimindex.jsở thư mục gốc không được publish.- Node/Bun ưu tiên
exportshơnmain, nên khi OpenCodeimport("@hung319/opencode-hive")nó tìmindex.js(không tồn tại) thay vìdist/index.js(entry thật của build).
Sửa
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./package.json": "./package.json"
}"."trỏ đúngdist/index.js(khớpmainvàtypes), thêm"./package.json"để công cụ đọc metadata không bị exports map chặn.- Shim
packages/opencode-hive/index.js(export { default } from './dist/index.js') vẫn giữ nguyên cho chế độ load plugin theo thư mục (.opencode/plugins/...).
Verify
npm pack→ tarball chứapackage/dist/index.js+package/package.json; cài tarball vào project sạch:
import('@hung319/opencode-hive')→ OK,id: "opencode-hive", cósetup.- OpenCode v2.1.3: log
loading plugin ... entrypoint=.../dist/index.js, plugin nạp thành công (không còn lỗi entrypoint).
Upgrade
- Cấu hình giữ nguyên:
"plugins": ["@hung319/opencode-hive"]. - Cập nhật qua
opencode plugin update(hoặc xoá cache plugin cũ) để nhận 2.0.1.