Skip to content

Conversation

@alcuadrado
Copy link
Member

@alcuadrado alcuadrado commented Jan 30, 2026

@alcuadrado alcuadrado requested a review from Copilot January 30, 2026 15:49
@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 8bf4603

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
hardhat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new readNpmPackageRemappings hook to the Solidity plugin, enabling customization of remapping resolution for npm packages. The hook allows handlers to provide remappings from alternative sources (e.g., foundry.toml) in addition to or instead of the default remappings.txt files.

Changes:

  • Added readNpmPackageRemappings hook definition to the Solidity plugin type extensions
  • Implemented hook integration in the remapping resolution pipeline with deduplication logic
  • Updated buildDependencyGraph to accept and wire the hook manager through the resolver

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
v-next/hardhat/src/internal/builtin-plugins/solidity/type-extensions.ts Added hook definition with JSDoc documentation
v-next/hardhat/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts Implemented hook invocation, default behavior extraction, and deduplication logic
v-next/hardhat/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.ts Added remappingsReader parameter to create method
v-next/hardhat/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.ts Created wrapper function to connect hook manager to resolver
v-next/hardhat/src/internal/builtin-plugins/solidity/build-system/build-system.ts Passed hook manager to buildDependencyGraph
v-next/hardhat/src/internal/builtin-plugins/flatten/task-action.ts Passed hooks to buildDependencyGraph in flatten task
v-next/hardhat/test/internal/builtin-plugins/solidity/build-system/dependency-graph-building.ts Updated tests to provide hook manager
v-next/hardhat/test/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts Added comprehensive test coverage for hook behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant