wpdas / near-social-local-viewer

A CLI tool that allows you to run and test your Near Social Widgets locally using just your preferred code editor and your default browser.
MIT License
12 stars 1 forks source link

Allow custom gateways #3

Open elliotBraem opened 1 year ago

elliotBraem commented 1 year ago

This is a really great tool -- I'd like to use it, but I have my own gateway that has some custom changes to the VM, and I need these changes in the VM for my widgets to work. So it would be great if I could hook this up to my own dist.

What if the useEffects in the Viewer were moved into a Provider and I could just import that for a dedicated "testing" page in my project?

Does this make sense? Wanted to ask before I tried it as development is moving fast.

elliotBraem commented 1 year ago

I did some experimenting and set up a monorepo with the gateway, vm, widgets, and your tool. This is how I imagine bOS development could work?

Check it out: core

pnpm install, then pnpm run dev This will open the gateway at localhost:3000 and the widgets at localhost:3001

All I've done is modify your tool's package to use "near-social-vm": "workspace:*" package instead... so it all works the same, just uses my version of the VM instead. If you click and view the "Everything" widget, this one uses the custom Masonry and Type keywords. (The multiple widget feature is awesome btw)

Although it works, if you compare Everything in the Tool's Viewer vs my gateway's viewer, you'll notice that the Masonry behaves different because of the container. So would still be cool if I could reference my own dist... what do you think we can do?

frol commented 1 year ago

I fear that backends with custom VM is a bit concerning direction as it will split the ecosystem.

Nevertheless, dev tools should be flexible to allow exploration, so this proposal sounds reasonable to me.