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

Get curated extensions from create-eth repository #40

Merged
merged 7 commits into from
Dec 25, 2024

Conversation

damianmarti
Copy link
Member

scaffold-eth/create-eth#155 should be merged before merging this.

Copy link

vercel bot commented Nov 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
scaffoldeth-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 25, 2024 6:42am

Copy link
Member

@carletex carletex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this Damu!

This is getting the data on the client everytime for every user. I don't think we need that here.

Let's get the data from the server (getStaticProps). Same as 3rdparty extensions + leave the 6hours cache.

@damianmarti
Copy link
Member Author

Thanks for this Damu!

This is getting the data on the client everytime for every user. I don't think we need that here.

Let's get the data from the server (getStaticProps). Same as 3rdparty extensions + leave the 6hours cache.

Thanks for the review!!

Changed this and I changed to use installCommand from JSON or to use the default one if it's not set.

Fixed a bug with the branch too, the installCommands from https://scaffoldeth.io/extensions are not showing the branch name when needed.

@damianmarti damianmarti requested a review from carletex November 21, 2024 13:28
Copy link
Collaborator

@Pabl0cks Pabl0cks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this Damu!! Adding extensions will be much smoother now ♥

Should we use this PR to filter out external extensions uploaded to bg app (/builds) that may be duplicated as curated? Or create a new PR instead?

Something like this could do the job:

const formattedExtensions = data
      .filter((ext: any) => !ext.branch.includes("scaffold-eth/create-eth-extensions"))
      .map((ext: any) => {
        const githubUrlParts = ext.branch.split("/");
        const githubUsername = githubUrlParts[3];
        const repoName = githubUrlParts[4];

        let installCommand = `npx create-eth@latest -e ${githubUsername}/${repoName}`;

        if (githubUrlParts.length > 5) {
          const branch = githubUrlParts[6];
          installCommand = `${installCommand}:${branch}`;
        }

        return {
          name: ext.name,
          description: ext.desc,
          github: ext.branch,
          installCommand,
          builder: ext.builder,
          coBuilders: ext.coBuilders || [],
          youtube: ext.videoUrl || null,
        };
      });

@damianmarti
Copy link
Member Author

Thanks for tackling this Damu!! Adding extensions will be much smoother now ♥

Should we use this PR to filter out external extensions uploaded to bg app (/builds) that may be duplicated as curated? Or create a new PR instead?

Something like this could do the job:

const formattedExtensions = data
      .filter((ext: any) => !ext.branch.includes("scaffold-eth/create-eth-extensions"))
      .map((ext: any) => {
        const githubUrlParts = ext.branch.split("/");
        const githubUsername = githubUrlParts[3];
        const repoName = githubUrlParts[4];

        let installCommand = `npx create-eth@latest -e ${githubUsername}/${repoName}`;

        if (githubUrlParts.length > 5) {
          const branch = githubUrlParts[6];
          installCommand = `${installCommand}:${branch}`;
        }

        return {
          name: ext.name,
          description: ext.desc,
          github: ext.branch,
          installCommand,
          builder: ext.builder,
          coBuilders: ext.coBuilders || [],
          youtube: ext.videoUrl || null,
        };
      });

Maybe we can do it after merging this PR.

Copy link
Collaborator

@Pabl0cks Pabl0cks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me! 🙌

@damianmarti
Copy link
Member Author

@Pabl0cks @carletex scaffold-eth/create-eth#155 is merged now (and published to create-eth), can we merge this?

@technophile-04
Copy link
Collaborator

Thanks @damianmarti and all for testing nd review 🙌

Just pushed a small tweak at e6f84c4 so that we take in consideration the version if provided by crated extension json and extensionFlagValue for constructing installCommand since it will be the actual truth for sure as discussed in scaffold-eth/create-eth#161

@technophile-04 technophile-04 merged commit b5170c3 into main Dec 25, 2024
3 checks passed
@technophile-04 technophile-04 deleted the curated-extensions-from-create-eth branch December 25, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants