moonrepo / proto

A pluggable multi-language version manager.
https://moonrepo.dev/proto
MIT License
607 stars 30 forks source link

Support asdf plugins through a proto WASM plugin #539

Closed milesj closed 3 days ago

milesj commented 1 month ago

There has been multiple requests now to support (piggy-back) off of asdf, since it has a ton of plugins and support for many tools. Unfortunately, building this into proto core simply isn't feasible without rewriting it from scratch, and at that point, it's really not worth it. The other issue is that asdf is Unix only, so that means no Windows support.

However! I had a thought the other day, why not support every asdf plugin through a single proto WASM plugin, similar to how our TOML plugins work (they are WASM under the hood). For example, say you wanted to use the scala asdf plugin, it may look something like the following in proto:

# .prototools
scala = "latest"

[plugins]
scala = "https://path/to/asdf/plugin.wasm"

Easy right? But what if the proto identifier doesn't match up with the asdf plugin name? Well, just override it with configuration. For example, using the nodejs asdf plugin.

# .prototools
node = "latest"

[plugins]
node = "https://path/to/asdf/plugin.wasm"

[tools.node]
asdf-plugin = "nodejs"

We can also take this further by supporting the git repository directly.

# .prototools
[tools.node]
asdf-repository = "https://github.com/asdf-vm/asdf-nodejs.git"

Caveats

With all this being said, I have no idea if this will actually work, or if the asdf plugin APIs will match up to the proto plugin APIs. It's definitely something that needs to be prototyped to ensure it's feasible.

Requirements

Implementation

How this is implemented may require a lot of discussion, which can be had on Discord.

With that said, we can outline a few things:

milesj commented 1 month ago

/bounty $500

milesj commented 1 month ago

If this turns out to not be feasible, I'll send over a tip for the work done so far.

scshiv29-dev commented 1 month ago

/attempt #539

Algora profile Completed bounties Tech Active attempts Options
@scshiv29-dev 2 bounties from 2 projects
Java, Python,
TypeScript & more
Cancel attempt
varshith257 commented 1 month ago

I am into it @milesj

/attempt #539

Algora profile Completed bounties Tech Active attempts Options
@varshith257    3 moonrepo bounties
+ 1 bounty from 1 project
TypeScript, Go
Cancel attempt
abhishek818 commented 1 month ago

@milesj can others give it a try?? Asking since it's assigned.

varshith257 commented 1 month ago

@abhishek818 Maybe you can give an attempt after my attempt is done. I will let you know

milesj commented 1 month ago

Go for it

algora-pbc[bot] commented 1 month ago

💡 @varshith257 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

milesj commented 3 days ago