feat: List members of the batch from BatchRegistry contract#33
feat: List members of the batch from BatchRegistry contract#33phipsae merged 19 commits intoBuidlGuidl:mainfrom
Conversation
Introduce a new script that scans for Ethereum address-like directories containing Next.js page components and generates a TypeScript file with an array of these addresses. This automates the process of maintaining the list of builder profiles for rendering in the application.
Modify the build script to include the execution of the new profile generation script, ensuring existing profiles are generated before building. Additionally, add a dedicated command for generating profiles directly.
Create a .gitkeep file in the generated directory to ensure it is tracked by git, allowing for future auto-generated files to be stored within it.
Add entry for existingBuilderProfiles.ts to .gitignore to prevent tracking of auto-generated files in the generated directory.
Add a new BuildersList component that fetches and displays a list of builders who have checked in, including their addresses, check-in dates, and graduation status. The component handles loading states and errors, and integrates with the existing contract functions to retrieve necessary data.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
phipsae
left a comment
There was a problem hiding this comment.
Thanks a lot for taking on one of the toughest issues!
I really like that you include the check-in date and use the graduate status.
Before diving deeper into the code, I'm not sure this will work as expected. When exactly is the script supposed to run? It needs to be triggered somehow, and the output would then need to be deployed to Vercel?
Ideally, we want this to run automatically (whenever a new page is deployed, it should be updated). Could you consider implementing it as an API route instead? Keep in mind that Vercel’s serverless environment has some limitations with fs, so file system access can be tricky.
Give it a try, and feel free to reach out if anything’s unclear.
The script runs during the build process automatically, whenever anyone runs yarn build locally or Vercel runs its build process, the script executes first. |
|
@dmystical-coder it's a nice solution! Sorry for my late response, I will give you a review tomorrow. |
There was a problem hiding this comment.
Thanks a lot for the implementation and for tackling one of our toughest issues! Well done!
Running a script beforehand is a nice approach, I haven’t considered that before. I think the generated file (as in your initial solution) could have worked just as well, but your current approach with the route is solid too.
One small improvement: could you add a link to the builders page in the main page header, so that we can access it?
I've left a few comments below.
|
Thank you for your kind words 😊. |
phipsae
left a comment
There was a problem hiding this comment.
Thanks for the changes!
Just these little comments below and then we merge :)
phipsae
left a comment
There was a problem hiding this comment.
Great, thanks a lot! Let's finally merge it :)
Description
This PR implements the feature to list all builders who have checked in to the BatchRegistry contract. It displays each builder's address, their deployed contract, check-in date, and graduation status, with links to individual profile pages when available.
Screenshots
Additional Information
CheckedInevents from the BatchRegistry contractgraduatedTokenId)Technical Approach
useScaffoldEventHistoryto fetch allCheckedInevents, then processed to get unique buildersscripts/generate-existing-profiles.js) that auto-detects existing builder profile pages during builduseMemoto efficiently process events without unnecessary recalculationsFile Changes
Added:
packages/nextjs/app/builders/page.tsx- Main page componentAdded:
packages/nextjs/scripts/generate-existing-profiles.js- Script for profile detectionAdded:
packages/nextjs/generated/.gitkeep- Ensures directory exists for generated filesModified:
packages/nextjs/package.json- Added build script integrationModified:
packages/nextjs/.gitignore- Added generated file to ignore listI have read the contributing docs (if this is your first contribution)
This is not a duplicate of any existing pull request
Related Issues
Closes #3 : List the members of the batch (read batch registry contract)
Your ENS/address:
0x119d9A1ef0D16361284a9661727b363B04B5B0c8