-
Notifications
You must be signed in to change notification settings - Fork 76
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
Create a plugin system #1776
Comments
Regarding refs, should we be opinionated and only support installing from tags? Or too opinionated? For upgrades, we should probably support version selection such that one could upgrade inside v22 without getting v23. |
Can we also explore for the js-stellar-sdk what the narrative is. e.g. I'm a js-stellar-sdk user, I'm importing it into my project, what's the shortest path / narrative I expect to get generated bindings that are compatible with my js-stellar-sdk in my current project. Then, what if I have 3 projects, some are using different versions of js-stellar-sdk, how do I navigate that? I'm asking that question because in some ways a plugin system makes the experience of the binding generation again CLI adjacent, which presents similar problems of making sure you're using the right version vs being SDK adjacent where if you could generate with the sdk itself, somehow, then you'd naturally use a compatible version. The best narrative for 👆🏻 may be to try and bundle it very close to or inside SDKs, although I realise there are mixed views on that. |
I think that'd be too restrictive. I'd rather go with 2 options: refs or no ref at all (this case would always update to HEAD on the main branch). I wonder if we should keep the
I think keeping bindings close to the sdk is good move, tbh. And we can expose that to the cli via this plugin system. Let's say we move TS bindings to Installing globally could lead to mismatching versions, but I don't think we should try to solve that at all. Maybe one thing we can do is adding |
Another option is to install bindings into the local directories But, are we building a plugin empire around something that doesn't need to be. If a user has the js-stellar-sdk installed in a project, is there a way to invoke a binary that is within it with a one-liner npx command? |
Yes, that can work. But then we go back to square one, which is discoverability. Maybe all we should do is adding $ stellar plugin list
🔎 View on GitHub: https://github.com/search?q=topic%3Astellar-cli-plugin&type=repositories
name: lightsail-network/stellar-contract-bindings
description: generate language bindings for Stellar Soroban smart contracts.
url: https://github.com/lightsail-network/stellar-contract-bindings |
Maybe we're thinking about this the reverse way. I was thinking about this from the perspective of "I'm a stellar-cli user, how do I know I can generate bindings, how do I discover bindings I can generate." But, bindings are all about the SDK. It's all about helping developers use an SDK more efficiently, more effectively, to interact with a contract. So a user sitting there with the SDK shouldn't even need to know about the CLI, not really. They will know about the CLI, but that coupling is actually incidental. The story is more like "I'm an SDK user, how do I know I can generate bindings for a contract that use the SDK." |
@fnando I know you mentioned you were planning to experiment with prototyping this. Another thing we could do is, once we have the prototype, experiment with what the docs would look like for telling people how to generate bindings. I think doing some of those changes might help us to validate what the developer experience will look like. |
stellar plugin list [--installed]
: list plugins by using Github search(
--installed
will show installed plugins only)stellar plugin add [SOURCE]
: install a plugin.SOURCE
can be a localdirectory, a git url (e.g.
https://github.com/user/repo.git#ref
), or aGithub
user/repo#ref
.stellar plugin remove PLUGIN
: remove a plugin.stellar plugin update
: update all plugins; must respect git refs.Plugin structure
A plugin is a directory that has a
bin/
directory andmanifest.toml
file.For now, only
stellar contract bindings [TYPE]
plugins will be supported. Forinstance, if you want to generate bindings for Ruby, you could have an
executable binary as
bin/stellar-contract-bindings-ruby
in your repository.The manifest:
Reference output
The text was updated successfully, but these errors were encountered: