Skip to content

feat: allow other plugins to be composed with build#41

Merged
gakonst merged 1 commit intofoundry-rs:developfrom
tynes:feat/run-super
May 31, 2022
Merged

feat: allow other plugins to be composed with build#41
gakonst merged 1 commit intofoundry-rs:developfrom
tynes:feat/run-super

Conversation

@tynes
Copy link
Copy Markdown
Collaborator

@tynes tynes commented May 30, 2022

Call runSuper after compiling so that other plugins that hook into the compile task are still called.
I discovered that hardhat/typechain was not being ran with this plugin and I believe that this is the solution.
Need to test locally to be sure. Note that calling runSuper here does not invoke the hardhat compiler
toolchain. Two additional functions are added that I believe should be part of the IArtifacts interface but are not.
Both of them are noops here, attempting to implement them would require a much larger change. Without them,
there is a function is not defined error.

Also delete some dead code in the constructor of ForgeArtifacts

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 30, 2022

🦋 Changeset detected

Latest commit: 141cbf0

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

This PR includes changesets to release 1 package
Name Type
@foundry-rs/hardhat-forge 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

@tynes
Copy link
Copy Markdown
Collaborator Author

tynes commented May 30, 2022

I am observing this sort of working with typechain, it requires a hack for hardhat compile. artifactPaths.length === 0 is always true in the link below so I am able to get around that by setting externalArtifacts in the config. Ideally this plugin could generate the correct artifact paths so typechain just works but that would require some additional digging to figure out why its not.

https://github.com/dethcrypto/TypeChain/blob/fd4cd05f911d77d490d4968270d27a9ecc074c60/packages/hardhat/src/index.ts#L50

typechain should work with hardhat typechain as it sets a value that forces the build and gets past the check in the above link

@tynes tynes force-pushed the feat/run-super branch from 877c922 to d7c992a Compare May 31, 2022 17:39
Call `runSuper` after compiling so that other
plugins that hook into the `compile` task
are still called. This will not work 100%
with plugins that depend on the values that
are returned by the actual hardhat compile task.
@tynes tynes force-pushed the feat/run-super branch from afb305f to 141cbf0 Compare May 31, 2022 17:58
@tynes tynes marked this pull request as ready for review May 31, 2022 17:59
@gakonst gakonst merged commit 64750ac into foundry-rs:develop May 31, 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.

2 participants