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

Br setup typechain #36

Merged
merged 4 commits into from
Feb 3, 2022
Merged

Conversation

brossetti1
Copy link
Contributor

setting up typechain

  • right now I am ignoring the typechain folder to prevent clutter.

instructions

after installing typechain run:

  1. npx hardhat clean
  2. npx hardhat compile

this should generate the typed files:

Screen Shot 2022-01-30 at 4 45 13 PM

Comment on lines +20 to +23
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"@types/node": "^17.0.13",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the chain and mocha types to allow the tests to understand the keywords mocha defines (descirbe, etc) - its also recommended by hardhat

@brossetti1
Copy link
Contributor Author

@codynhat one thing im noticing about this is how many dependencies it adds - dependencies this adds - anyways, food for thought i guess

Copy link
Member

@codynhat codynhat left a comment

Choose a reason for hiding this comment

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

Does the typechain/ folder include the typescript outputs? Will we include this eventually?

@brossetti1 brossetti1 force-pushed the br-setup-typechain branch 2 times, most recently from 215aa7a to b61c872 Compare February 2, 2022 18:40
@brossetti1
Copy link
Contributor Author

brossetti1 commented Feb 2, 2022

@codynhat yeah the /typechain can be included - might be good to discuss what its good for because it generates a lot of files, some of the benefits I see:

  • loading contract objects for testing through the generated models and factories
  • exporting contracts to a typescript package so they can be imported and used in any project that is trying to interact with GeoWeb

I really like the way the nouns dao has setup their repo - you can see them doing this here:

  1. see exported types
  2. they gitignore a lot of typechain contracts
  3. then they import these factories across their monorepo to interact with the deployed contracts

fyi - i also like how they do their sdk so you can carry contract addresses across repos:

addresses
loading contracts

thoughts?

I can add to the gitignore if you want to slim the files committed down. otherwise, I can include the /typechain folder

@brossetti1 brossetti1 requested a review from codynhat February 2, 2022 20:11
@Geo-Web-Project Geo-Web-Project deleted a comment from brossetti1 Feb 2, 2022
@codynhat
Copy link
Member

codynhat commented Feb 2, 2022

I like that approach. I'm in the middle of writing new tests in typescript and it would already be valuable to have these.

The nounsDAO approach looks like a good one to follow. We have a few other projects that need the contracts exported from here, so something like that would be very useful. Feel free to update the repo to be that structure. It can be on this PR or a separate one.

@codynhat
Copy link
Member

codynhat commented Feb 3, 2022

I think this will be good once #35 is merged first?

@brossetti1 brossetti1 merged commit ce8c0bc into Geo-Web-Project:main Feb 3, 2022
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.

3 participants