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

Investigate CLI wrapper that uses Bun instead of Node #34

Open
strogonoff opened this issue Jan 25, 2025 · 1 comment
Open

Investigate CLI wrapper that uses Bun instead of Node #34

strogonoff opened this issue Jan 25, 2025 · 1 comment

Comments

@strogonoff
Copy link
Contributor

strogonoff commented Jan 25, 2025

Currently, anafero-cli wraps anafero through npx & NodeJS. We could possibly do this with Bun.

The wrapper is generally straightforward, except the part of compiling & running adapters.

Currently, Node-based wrapper uses:

  • Isomorphic Git for fetching adapter code (it should work with Bun, since it’s vanilla JS)
  • esbuild for compiling adapters (which should work with Bun, but it’s uncertain)
  • Node’s VM to execute them (Bun may(?) provide something equivalent)

See dependencies.mts for Node-based implementation.

@strogonoff strogonoff self-assigned this Jan 25, 2025
@strogonoff
Copy link
Contributor Author

strogonoff commented Jan 25, 2025

@ronaldtse From my preliminary research, Bun does not seem to have a way of creating & running a module from a string in a given context. There may be other potential way (e.g., a dynamic import at runtime, which I didn’t get to work in Node).

Note that we need 1) to run some code that was compiled at runtime 2) in some specific context (allow it to import certain things).

@strogonoff strogonoff removed their assignment Jan 25, 2025
@strogonoff strogonoff changed the title Investigate CLI wrapper that uses bun Investigate CLI wrapper that uses Bun instead of Node Jan 25, 2025
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