The package.json exports were pointing to ./src/*.ts but the published
package only includes the dist/ folder. This caused 'Cannot find module'
errors when custom tools tried to import @opencode-ai/plugin.
Changed exports from:
".": "./src/index.ts"
"./tool": "./src/tool.ts"
To:
".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" }
"./tool": { "types": "./dist/tool.d.ts", "import": "./dist/tool.js" }
35 lines
713 B
JSON
35 lines
713 B
JSON
{
|
|
"$schema": "https://json.schemastore.org/package.json",
|
|
"name": "@opencode-ai/plugin",
|
|
"version": "1.1.48",
|
|
"type": "module",
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"typecheck": "tsgo --noEmit",
|
|
"build": "tsc"
|
|
},
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/index.js"
|
|
},
|
|
"./tool": {
|
|
"types": "./dist/tool.d.ts",
|
|
"import": "./dist/tool.js"
|
|
}
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"dependencies": {
|
|
"@opencode-ai/sdk": "workspace:*",
|
|
"zod": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@tsconfig/node22": "catalog:",
|
|
"@types/node": "catalog:",
|
|
"typescript": "catalog:",
|
|
"@typescript/native-preview": "catalog:"
|
|
}
|
|
}
|