Skip to content

fix: inline definePlugin to remove runtime dependency on repterm-api#27

Closed
cnbailian wants to merge 1 commit into
mainfrom
cnbailian/fix-repterm-api-dep
Closed

fix: inline definePlugin to remove runtime dependency on repterm-api#27
cnbailian wants to merge 1 commit into
mainfrom
cnbailian/fix-repterm-api-dep

Conversation

@cnbailian

Copy link
Copy Markdown
Collaborator

Summary

  • Inline the definePlugin function (trivial: return { name, setup }) directly into repterm, eliminating the runtime import from repterm-api
  • Change all repterm-api imports to import type (erased at compile time, no runtime module resolution)
  • repterm-api stays in dependencies for TypeScript type resolution but is no longer needed at runtime

Problem

When repterm is installed via symlink/link outside its monorepo, bun resolves import ... from 'repterm-api' from the symlink target path rather than the node_modules location. This causes:

Cannot find package 'repterm-api' from '.../node_modules/repterm/src/plugin/index.ts'

Test plan

  • bun run build:repterm succeeds
  • Compiled dist/plugin/index.js has no runtime import from repterm-api
  • CI build/lint/test pass
  • After merge, trigger release workflow to publish to npm

🤖 Generated with Claude Code

When repterm is installed via symlink/link outside its monorepo,
bun resolves imports from the symlink target path rather than the
node_modules location. This causes 'Cannot find package repterm-api'
errors because repterm-api isn't in the symlink target's resolution
path.

Fix by inlining the trivial definePlugin function and changing all
repterm-api imports to type-only (erased at compile time). The
repterm-api package remains in dependencies for TypeScript type
resolution but is no longer needed at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cnbailian cnbailian closed this Mar 6, 2026
@cnbailian cnbailian deleted the cnbailian/fix-repterm-api-dep branch March 6, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant