Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Yolo mode activated! #205

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Yolo mode activated! #205

wants to merge 1 commit into from

Conversation

moltam89
Copy link

Hey guys,

This is kind of the continuation of #167, however I took a completely different approach.
My gut feeling tells me that there should be an easy way to turn any scaffold-eth-2branch into an extension.

This new approach works like this:

  1. Clone scaffold-eth-2 into this repo and switch to the branch we want to create the extension from
  2. yarn create-extension-yolo scaffold-eth-2 {commitHash}
    commitHash is the the last commit which exists in scaffold-eth-2
    This command collects all the modified files since commitHash and creates an extension called scaffold-eth-2
  3. yarn cli -e scaffold-eth-2 --dev --skip yo --yolo
    This command clones scaffold-eth-2, resets it to commitHash and copies the files from the extension.
    Alternatively we can push the extension to github and use yarn cli -e moltam89/UniswapX-extension-yolo --skip yo --yolo

In case of my UniswapX branch the process would look like this:

yarn build:dev
Runs the build script

git clone -b UniswapX https://github.com/moltam89/scaffold-eth-2
Clones moltam89/scaffold-eth-2/UniswapX

yarn create-extension-yolo scaffold-eth-2 beefe9dcd2743aaab3be5b85652b6c2f16162601
Creates the extension

yarn cli -e scaffold-eth-2 --dev --skip yo --yolo
or
yarn cli -e moltam89/UniswapX-extension-yolo --skip yo --yolo
Spins up the instance

Notes:

  • Since currently the main branch of scaffold-eth-2 is used, only hardhat is supported.
  • I don't mean to merge this PR (there are lots of code duplications), this is more like a look at this idea PR.

Cheers,
Tamas

@rin-st
Copy link
Member

rin-st commented Feb 1, 2025

So as I understand template/args files are ignored when using this approach? All needed files should be rewritten fully by extension developer? And also, we can't restrict to change any files, right?


I think let's wait until #175 will be merged, it will (hopefully) solve checkpoints 1-3 from #167 and then we can create PR regarding FaucetButton.

@moltam89
Copy link
Author

moltam89 commented Feb 2, 2025

Yeah, there are no template/args files, no restrictions and actually there is no extension development either, we can turn scaffold-eth-2 branches into extensions with a single command.

We can wait until #175 is merged, but I don’t think it will change the outcome of this PR.

@technophile-04
Copy link
Collaborator

Thanks @moltam89! Just making sure I get the objective and overall working right here. So this commands allow creating extension from SE-2 fork.

The way it works is:

  1. User provides the commit hash (SE-2 main branch commit hash) after which the user started workign on fork.
  2. We treat that commit hash as "base SE-2" and copy the new added files from that commit hash

DId I get it correct?

I think this makes sense! And been thinking of adding something similar to create-extension cli.

The create-extension cli works very similar to above steps. Just the difference is:

  1. it requires npx create-eth@latest repo to create extension from
  2. Instead of relying on user passed commit hash it assumes the "initial commit" as base commit by create-eth and then starts copying files from that commit.

So conclusion I think lets add this feature as flag to create-extension cli I think hopfully it should be simple since almost all things (file copying, giving template files warning etc.) are already handled create-extensions .

The CLI API might look like this:

yarn create-extension {projectName} --from-scaffold-eth {commitHash}

What do you think?

@moltam89
Copy link
Author

Hi @technophile-04 ,

DId I get it correct?

Yeah, it works as you described it.

The CLI API might look like this:
yarn create-extension {projectName} --from-scaffold-eth {commitHash}

Sounds good to me.

I was planning to make this work for foundry as well, right now only hardhat is supported.
I'll get back to you, I'll probably need a few weeks.

Thanks,
Tam

@technophile-04 technophile-04 marked this pull request as draft March 5, 2025 07:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants