You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case the the child overrides all properties on the parent, so c exists but not b. But if I use the child and add use a cli option like --a.b 2 they are merged and both c and b exists on the object. Is there any reason that it behaves differently?
The way we use extends is that on the server we keep some secrets in the one config file and then we have the rest of the config open in a git repo, so it's easy for users to see our full setup. But we have a couple of clashing namespaces that get overruled.
Or is it a better way to do that?
Best
Peter
The text was updated successfully, but these errors were encountered:
Hey Peter 👋 thanks for the kind words. I honestly haven't used the extends functionality that much personally 😆
In general we could use a bit of an overall of how our dot notation functionality works ... it's buggy. I think that your example should be equivalent to:
--a.b 1 --a.c 2
I think I'd be open to a patch that corrects this behavior ... I don't think I'll have many cycles to add the functionality myself anytime soon unfortunately (so if anyone reads this and wants to contribute, your patch would be greatly appreciated).
@soulgalore just a thought, I might make this a configuration option (and default to the current behavior) ... for folks who are using this to build tools that except a configuration file (like a nycrc.json, or eslint.json) the merging might be a surprise?
Yes I see. It is not super important for me, I can have a go at a PR when I get back after vacation in the middle of August. At the moment we override with ENV instead, that works fine good for us.
Hi! First I've been a using yargs for many years in sitspeed.io and it works really great. Thanks a lot!
Lately I've started using
extends
to extend other configurations and I have a question. Let me show an example:parent.json
child.json
In my case the the child overrides all properties on the parent, so c exists but not b. But if I use the child and add use a cli option like
--a.b 2
they are merged and both c and b exists on the object. Is there any reason that it behaves differently?The way we use extends is that on the server we keep some secrets in the one config file and then we have the rest of the config open in a git repo, so it's easy for users to see our full setup. But we have a couple of clashing namespaces that get overruled.
Or is it a better way to do that?
Best
Peter
The text was updated successfully, but these errors were encountered: