fix: restore removed export paths for backward compat with older test runners#8029
fix: restore removed export paths for backward compat with older test runners#8029
Conversation
…exports for backward compatibility
|
There was a problem hiding this comment.
Pull request overview
Restores legacy internal export paths (hardhat/internal/coverage and hardhat/internal/gas-analytics) to maintain backward compatibility with older Hardhat test runner plugins, by reintroducing wrapper exports around the new hook handler logic.
Changes:
- Extracted gas-analytics test hook logic into reusable exported functions.
- Added backward-compatible helper wrappers and an internal export entrypoint for gas-analytics.
- Re-added
./internal/coverageand./internal/gas-analyticsexport paths inpackage.json.
Reviewed changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| v-next/hardhat/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.ts | Refactors hook logic into exported helper functions reused by legacy wrappers. |
| v-next/hardhat/src/internal/builtin-plugins/gas-analytics/helpers.ts | Adds backward-compat wrapper helpers that resolve the HRE and delegate to extracted logic. |
| v-next/hardhat/src/internal/builtin-plugins/gas-analytics/exports.ts | Provides a stable internal export surface for legacy imports. |
| v-next/hardhat/package.json | Restores internal export paths to point at the new wrapper entrypoints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Not sure this needs a changeset, @alcuadrado, since it's going out in the same release as the original PR. Wdyt? |
|
Not needed |
PR #8001 removed the
hardhat/internal/coverageandhardhat/internal/gas-analyticsexport paths, breaking users who upgradehardhatbut keep older versions ofhardhat-mochaorhardhat-node-test-runner. This restores those exports as thin wrappers around shared logic extracted from the new hook handlers.