[PR #6185] fix: use package export for @opentui/solid to support monorepos #11770

Open
opened 2026-02-16 18:16:42 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6185

State: open
Merged: No


Why

When running typecheck in a bun/npm workspace monorepo, it failed with:

error TS2307: Cannot find module '../node_modules/@opentui/solid/scripts/solid-plugin' 
or its corresponding type declarations.

Summary

  • Changed ../node_modules/@opentui/solid/scripts/solid-plugin@opentui/solid/bun-plugin
  • Fixes module resolution in monorepo setups where dependencies are hoisted

Problem

The hardcoded relative path breaks when:

# Expected (single repo)
packages/opencode/node_modules/@opentui/solid/  ✓

# Actual (monorepo with hoisting)
packages/opencode/node_modules/@opentui/solid/  ✗ (doesn't exist)
node_modules/@opentui/solid/                     ✓ (hoisted here)

Solution

Use the proper package export which @opentui/solid already provides:

"exports": {
  "./bun-plugin": {
    "types": "./scripts/solid-plugin.d.ts",
    "import": "./scripts/solid-plugin.ts"
  }
}

Test Plan

  • Verified package exports ./bun-plugin
  • Tested in monorepo environment
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6185 **State:** open **Merged:** No --- ## Why When running typecheck in a bun/npm workspace monorepo, it failed with: ``` error TS2307: Cannot find module '../node_modules/@opentui/solid/scripts/solid-plugin' or its corresponding type declarations. ``` ## Summary - Changed `../node_modules/@opentui/solid/scripts/solid-plugin` → `@opentui/solid/bun-plugin` - Fixes module resolution in monorepo setups where dependencies are hoisted ## Problem The hardcoded relative path breaks when: ``` # Expected (single repo) packages/opencode/node_modules/@opentui/solid/ ✓ # Actual (monorepo with hoisting) packages/opencode/node_modules/@opentui/solid/ ✗ (doesn't exist) node_modules/@opentui/solid/ ✓ (hoisted here) ``` ## Solution Use the proper package export which `@opentui/solid` already provides: ```json "exports": { "./bun-plugin": { "types": "./scripts/solid-plugin.d.ts", "import": "./scripts/solid-plugin.ts" } } ``` ## Test Plan - [x] Verified package exports `./bun-plugin` - [x] Tested in monorepo environment
yindo added the pull-request label 2026-02-16 18:16:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11770