-
Notifications
You must be signed in to change notification settings - Fork 5
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
Developing external extensions (v0.1) #57
Conversation
I got this undefined/undefined message when creating the project: ✔ 🚀 Creating a new Scaffold-ETH 2 app in test-eip with the undefined/undefined extension |
@carletex I tested it and it's working great! What should I do if I want to change something in the Header? Should I change the header inside the new test project, test it, and then change the Header.tsx.args.mjs inside the extension, and finally create a new project to check that all is ok? |
Thanks @carletex this is really nice !! And also works nicely!
yeah was thinking the same, but seems We could handle this in different PR but what we if watch the |
Thanks Damu & Shiv for testing and your feedback!
I see that you figured this out, but what was the issue? So maybe we can hint that something is wrong & stop.
Yes, it sounds ugly haha. Without this PR, you'd have to push it to your git repo to test it tho!! :/ So it's a step in the right direction haha
Yes, something like this will be great (But will also destroy your changes in the instance file haha). Maybe if we are in There are many things to figure out for the DX on extensions and I don't see a clean & easy path for it. But we can start merging PRs (that move us in the right direction) and see what we end with. The good thing is that these PRs shouldn't mess with the regular use of the tool (we need to make sure we are not breaking anything haha) |
I also tested and it's working great! Thanks! |
Even I get the same thing, but it does not exit the cli everything works fine. I think the culprit is Line 34 in 99f6005
Since when you do |
Update: renamed
Oh shit, I'm getting the same lol I thought it was failing for Damu! But it's just the undefined thing. Will fix now! |
Fixed here e4be88a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again and everything is working great!!
I think we already talked about this: when changing the file linked, the webserver watching the files does not reload it, so you have to always change the file inside the generated project if you want to see the changes live (maybe we can add this warning somewhere in the documentation later).
We can try to improve it later, but it's a great step forward to a nice extension dev workflow!!
Yes, definitely something weird going on there with symlinks haha. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to ignore externalExtensions in .prettierignore config as well:
https://github.com/scaffold-eth/create-eth/blob/main/.prettierignore#L8
It seem to format the files inside externalExtension on save
Yup yup happening to me too |
yes, me too! |
Ohh actually this is related to #45 (comment), previously were ignoring the Just pushed a small change to find the above thing at 2ff78df |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tysm @carletex !! love the logic clean and short! added a small comment but rest of all looks nice!
Also just tested it throughly, Cloning https://github.com/scaffold-eth/create-eth-extensions inside externalExtensions
dir :) and tinkring a bit, everything seems to work.
Also tested nicely normal things and extensions just to be sure we didn't break current version and it all also seems to work!
Fixed the small tweaks from Shiv + fixed the conflicts from main. |
2d1dfa7
to
d42d837
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed a minor nitpck, renaming template
to extensionName
in validateExternalExtension
at 1064ae8
Merging this!! Thanks Carlos this is really nice! and other for review!!
This PR aim is to start the conversation on how to improve the development of external extensions. (I've been discussing with Shiv some of this)
Currently, there is no easy way to develop & test external extensions: you basically have to (blindly) create it, push it to GitHub, and test. This is not an issue for small extensions where you just add some new folders/files, but it gets super messy and annoying on bigger ones.
External Extension Dev workflow
We haven't found a perfect(simple) workflow, but this is where we are at:
Let's say you want to create the
eip
extension: it adds a new /eip page + a Header link + a new script to the root package.json (I've pushed it on this PR to test)Phase 1
create-eth
repoyarn dev & yarn cli
, in the directorymy-instance
my-instance
, run the magic 3 commands (chain, deploy, start)create-eth
repo (in aextensions
folder with the name of the extension, e.g.extensions/eip
)Phase 2
This is what this PR is currently implementing (avoid having to push to GitHub, as you can test locally)
yarn dev
in theyarn cli -e eip --dev
. The--dev
is key here, so it'll create symlinks, instead of copying the filesmy-dev-instance
(theeip
is installed alongside)my-dev-instance
!)my-dev-instance
and push to github. You could have all of your dev extensions there:extensions
folder (maybe it should be calledexternalExtensions
?)We could do this in different PRs. (super important also is too have a good guide for external extension developers.. and us :D)
This PR is not in a mergeable state, but pushed it to start the discussion. Would love for you guys to test it out and give feedback. Also about the workflow itself, and think if we can improve it.