Closed ChristopherDedominici closed 3 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
hardhat | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 17, 2024 10:54pm |
Latest commit: fa7a2bf443d722f9fc47194b167a9675ac2eba00
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@alcuadrado @schaable should we export the function "getHardhatVersion" outside of the hh-utils package so I can use it here too? Do you think that this function could be used in multiple places a part from here?
@alcuadrado @schaable should we export the function "getHardhatVersion" outside of the hh-utils package so I can use it here too? Do you think that this function could be used in multiple places a part from here?
I thought about this when I was working on the utils. It is also useful for the User-Agent
header in the request
module, but I didn't add it because the implementation was not trivial. Here, you can read the closest package.json
relative to import.meta.url
to get the version. However, if you run the same code within hardhat-utils
, you'll get the version of that package. You'd need to navigate up the node_modules
structure, find Hardhat, and return its version. Alternatively, you could accept the file URL relative to the package.json
as a parameter, but at that point, it is not that different from what you have in this PR. We may want to add this as a utility within the Hardhat package itself.
Task description
This PR should be merged first.
CHANGES: