[PR #1671] [CLOSED] fix: add TypeScript path mapping for workspace packages in development mode #10016

Closed
opened 2026-02-16 18:14:33 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1671
Author: @Haadka
Created: 8/7/2025
Status: Closed

Base: devHead: fix/workspace-package-resolution


📝 Commits (1)

  • 2db520f fix: add TypeScript path mapping for workspace packages

📊 Changes

1 file changed (+11 additions, -2 deletions)

View changed files

📝 packages/opencode/tsconfig.json (+11 -2)

📄 Description

Problem

On Windows 11, @opencode-ai/sdk package could not be resolved when running bun dev, causing the error:

error: Cannot find module '@opencode-ai/sdk' from 'packages/opencode/src/plugin/index.ts'

Solution

Added TypeScript path mapping to packages/opencode/tsconfig.json:

  • Added baseUrl and paths configuration
  • Maps @opencode-ai/sdk and @opencode-ai/plugin to their source TypeScript files
  • Only affects development mode with --conditions=development
  • Production builds continue to use the proper workspace package resolution

Testing

  • bun dev now starts successfully
  • Module imports resolve correctly in development
  • Production builds unaffected (uses dist/ files via package.json exports)
  • All typecheck tests pass

Changes

  • Modified packages/opencode/tsconfig.json to include path mapping for workspace packages
  • This is a development-only fix that maintains proper package abstractions

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1671 **Author:** [@Haadka](https://github.com/Haadka) **Created:** 8/7/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/workspace-package-resolution` --- ### 📝 Commits (1) - [`2db520f`](https://github.com/anomalyco/opencode/commit/2db520f1b5ac6f96e68137a907c3347685ecb845) fix: add TypeScript path mapping for workspace packages ### 📊 Changes **1 file changed** (+11 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/tsconfig.json` (+11 -2) </details> ### 📄 Description ## Problem On Windows 11, `@opencode-ai/sdk` package could not be resolved when running `bun dev`, causing the error: ``` error: Cannot find module '@opencode-ai/sdk' from 'packages/opencode/src/plugin/index.ts' ``` ## Solution Added TypeScript path mapping to `packages/opencode/tsconfig.json`: - Added `baseUrl` and `paths` configuration - Maps `@opencode-ai/sdk` and `@opencode-ai/plugin` to their source TypeScript files - Only affects development mode with `--conditions=development` - Production builds continue to use the proper workspace package resolution ## Testing - ✅ `bun dev` now starts successfully - ✅ Module imports resolve correctly in development - ✅ Production builds unaffected (uses `dist/` files via package.json exports) - ✅ All typecheck tests pass ## Changes - Modified `packages/opencode/tsconfig.json` to include path mapping for workspace packages - This is a development-only fix that maintains proper package abstractions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:33 -05:00
yindo closed this issue 2026-02-16 18:14:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10016