New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hardhat.config.js paths object should allow for array fields #776
Comments
Actually, ideally, if they could be any type, it would be even better. |
Can you tell us more about what you are trying to do? |
I basically want user to set multiple path for artifact and deployments, see : wighawag/hardhat-deploy#34 So instead of having the following in
I need to add the paths to a different field:
Actually thinking about it the deployments object could be set on the network config, like that
But this is just an example. Basically there are use case where paths need to be arrays and potentially objects. |
Can you share the stack trace where it fails at runtime? If I'm understanding correctly, this shouldn't happen (I mean, fields other than the "predefined" ones shouldn't be used in any way.) |
i forgot what was the exact error, I ll see if I can get it again, but looking at the code here : https://github.com/nomiclabs/buidler/blob/0183504555c2aed2e3ea7e63b6ddeb656ce7d4f7/packages/buidler-core/src/internal/core/config/config-resolution.ts#L95 |
Oh, I see. I'm not sure what the right solution is here. I guess we could stop resolving the other entries from |
Another scenario for this is for monorepos where I have contracts spread out across individual packages. I want to leverage waffle test config setting "compilerAllowedPaths" but it doesn't look like it's supported. I basically want something like this: paths: { or paths: { |
Just to add my use case as well. I want to keep all test dependency contracts in a separate folder so this is required to be able to use deploy plugin with a custom folder only for given contracts. |
More than one year later, is there any news about this? |
…ve changed (multi sig wallet owners). I had no choice to copy the multisig contract to this solution as there is no way to setup hardhat to have multiple sources from different project solutions/folders. This is an ongoing issue: NomicFoundation/hardhat#776
I'm in the same situation as @bricedenice59. Is there a workaround for this issue while it's not resolved? I would really appreciate some advice here. Thank you!! |
Would also really appreciate this feature! |
Any news on this issue? |
Any news on this? I would really need this feature, as I have an hardhat repo with some contracts, but I also have another hardhat repo with other contracts that is a submodule of the 1st one. I would like to deploy the contracts all together but I cannot because I can only set 1 single path for each kind (1 artifacts, 1 sources etc) |
Joining in. We're approaching 3 year anniversary for this issue (: Also, I don't see how this is a breaking change: old behavior can easily be supported. Allow strings or arrays. |
@lekevicius I know it's hard to see how this is a breaking change, but assume you are a plugin author that uses the Then Hardhat updates to a new patch/minor version and suddenly That being said:
Hopefully that makes sense, happy to answer any questions about this. |
Hello @fvictorio, do you have an example I can look at to do this? Is it |
Something like this should work: const glob = require("glob");
const { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } = require("hardhat/builtin-tasks/task-names");
const path = require("path");
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, hre, runSuper) => {
const paths = await runSuper();
const otherDirectoryGlob = path.join(hre.config.paths.root, "more-contracts", "**", "*.sol");
const otherPaths = glob.sync(otherDirectoryGlob);
return [...paths, ...otherPaths];
}); |
thank you |
For my plugin, I would like path config to be arrays.
Unfortunately, while buidler allow the types to be arrays, it fails at runtime because builder attempt to read them as string
The text was updated successfully, but these errors were encountered: