TypeChain icon indicating copy to clipboard operation
TypeChain copied to clipboard

Allow specification of custom artifact glob in @typechain/hardhat

Open ckoopmann opened this issue 2 years ago • 2 comments

Currently the glob to match build artifacts for which to generate types is hardcoded here.

While the user can specify additional globs for "externalArtifacts" there is no way to disable type generation for selected contracts/artifacts. One example where this is a problem is, if the user has multiple contracts with the same name which leads to Duplicate Identifier typescript errors.

Adding an optional config parameter to change the hardcoded glob (with the current pattern as the default) would fix this issue.

ckoopmann avatar Jun 22 '22 07:06 ckoopmann

Fwiw: I'd be more than happy to implement this, if it's deemed a desirable feature. As far as I can see it should be done in just a few lines of code.

ckoopmann avatar Jun 23 '22 04:06 ckoopmann

Went ahead and implemented this in https://github.com/dethcrypto/TypeChain/pull/735

ckoopmann avatar Jun 29 '22 07:06 ckoopmann