fix: remove direct third-party imports from adapters#799
Closed
fix: remove direct third-party imports from adapters#799
Conversation
Adapters in ~/.opencli/clis/ cannot resolve bare third-party packages (chalk, turndown) because Node.js module resolution walks up from the file location and never reaches the package's node_modules/. - Replace chalk with log from @jackwener/opencli/logger in 11 yollomi adapters - Re-export TurndownService from @jackwener/opencli/utils - Replace turndown import in yuanbao/ask.ts with @jackwener/opencli/utils - Add regression test: adapters must not import runtime dependencies directly Closes #792
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.opencli/clis/importchalkandturndownas bare specifiers, but Node.js module resolution can't find them outside the package treechalkwithlogfrom@jackwener/opencli/loggerin 11 yollomi adaptersTurndownServicefrom@jackwener/opencli/utilsfor adapters that need HTML→Markdownturndownimport inyuanbao/ask.tswith@jackwener/opencli/utilsDesign decision
Option B from #792 discussion: adapters should only depend on opencli's public API (
@jackwener/opencli/*), not on third-party packages directly. This is the principled fix — adapters work correctly regardless of where they're loaded from.Test plan
npm run buildpassesnpm test— all 516 tests pass.test.ts) are excluded from the check since they run inside the package treeCloses #792