Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate vscode-dependent code from vscode-independent code #41

Open
hediet opened this issue May 28, 2024 · 0 comments
Open

Separate vscode-dependent code from vscode-independent code #41

hediet opened this issue May 28, 2024 · 0 comments

Comments

@hediet
Copy link
Member

hediet commented May 28, 2024

Currently, the project has exactly one runtime-dependency to VS Code:

export function toVsCodeChatMessages(messages: ChatMessage[]) {
const vscode = require('vscode');

(which currently breaks esbuild, see #40)

I recommend to use https://nodejs.org/api/packages.html#exports and to have a main entry point (import { render } from '@vscode/prompt-tsx';) and a vscode-specific part (import { toVsCodeChatMessages } from '@vscode/prompt-tsx/vscode';).

That way, you communicate that by default the main export has no runtime dependency on vscode (and thus, that the library is safe to use in traditional test-runners).

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

No branches or pull requests

1 participant