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

[FEATURE REQUEST] Ability to add custom console command packs #4729

Open
stranger80 opened this issue Apr 16, 2024 · 3 comments
Open

[FEATURE REQUEST] Ability to add custom console command packs #4729

stranger80 opened this issue Apr 16, 2024 · 3 comments
Assignees

Comments

@stranger80
Copy link

stranger80 commented Apr 16, 2024

We would like to be able to add a set of console commands as part of our custom plugin (https://github.com/NethermindEth/zksync-remix-plugin) feature set. Ideally, we would like to be able to add a command 'module', (eg. zksync.js, ), so that in Remix console a user can type a command, eg. zksync.compile("myFile.sol"), to trigger a "Compile" feature of the custom plugin.

Is this possible via existing Remix SDK?

@yann300
Copy link
Contributor

yann300 commented Apr 17, 2024

Sure we can do something.
where would live zksync.js? would this be part of a npm module or a helper that would be located in the remix file system?

@stranger80
Copy link
Author

Actually thinking about this further, two command syntax approaches are possible:

  1. Follow the JS syntax, ie. expect the following syntax:
    <module-name>.<command>(<parameter-list>)

  2. Follow the "CLI convention", ie expect:
    <module-name> <command> <parameter1> <parameter2>...

Regarding the sourcing of the module JS file, I can imagine the following:
a) Publish the <module-name>.js as npm package and specify the package reference in the plugin descriptor
b) Publish the <module-name>.js together with plugin UI, and specify URL in the plugin descriptor
c) Put the <module-name>.js in remix workspace, following some convention (eg. /commands/module-name.js) and allow calling commands from there.

Option c) is imho the least favourable for our case, as we would like the commands to be bundled with the plugin, in a way which is transparent to the user...

@yann300
Copy link
Contributor

yann300 commented Apr 19, 2024

thanks for the details!
The module wouldn't be editable by the end user right?
solution a) could already work in some ways. If you already have such a NPM package, I would be happy to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants