The open source coding agent.
TypeScript
Fix ESM imports for @opencode-ai/plugin (#16916)
Daxbb232247d094
diff --git a/packages/plugin/src/example.ts b/packages/plugin/src/example.tsindex 94745a37b73..1cf042fe967 100644--- a/packages/plugin/src/example.ts+++ b/packages/plugin/src/example.ts@@ -1,5 +1,5 @@-import { Plugin } from "./index"-import { tool } from "./tool"+import { Plugin } from "./index.js"+import { tool } from "./tool.js"export const ExamplePlugin: Plugin = async (ctx) => {return {diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.tsindex 76370d1d5a7..b78bcae177d 100644--- a/packages/plugin/src/index.ts+++ b/packages/plugin/src/index.ts@@ -12,10 +12,10 @@ import type {Config,} from "@opencode-ai/sdk"-import type { BunShell } from "./shell"-import { type ToolDefinition } from "./tool"+import type { BunShell } from "./shell.js"+import { type ToolDefinition } from "./tool.js"-export * from "./tool"+export * from "./tool.js"export type ProviderContext = {source: "env" | "config" | "custom" | "api"diff --git a/packages/plugin/tsconfig.json b/packages/plugin/tsconfig.jsonindex 58072c81c96..11738187831 100644--- a/packages/plugin/tsconfig.json+++ b/packages/plugin/tsconfig.json@@ -3,9 +3,9 @@"extends": "@tsconfig/node22/tsconfig.json","compilerOptions": {"outDir": "dist",- "module": "preserve",+ "module": "nodenext","declaration": true,- "moduleResolution": "bundler",+ "moduleResolution": "nodenext","lib": ["es2022", "dom", "dom.iterable"]},"include": ["src"]