Skip to content
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

Configuration doesn't inherit with extends keyword #320

Closed
IgorNovozhilov opened this issue Jul 30, 2021 · 3 comments · Fixed by #343
Closed

Configuration doesn't inherit with extends keyword #320

IgorNovozhilov opened this issue Jul 30, 2021 · 3 comments · Fixed by #343
Labels

Comments

@IgorNovozhilov
Copy link

  • Version: 7.8.0
  • Platform: linux mint

This change has broken configuration inheritance:
99436ef#diff-40d93e4e5f4b94fc8a34a87a3328651c24e855051bfcdd6944dee76f9c82b8d4L116

see: http://yargs.js.org/docs/#api-reference-configobject-extends-keyword

custom configParser doesn't provide inheritance
99436ef#diff-40d93e4e5f4b94fc8a34a87a3328651c24e855051bfcdd6944dee76f9c82b8d4R15

@IgorNovozhilov IgorNovozhilov changed the title Configuration doesn't inherit with extends Configuration doesn't inherit with extends keyword Jul 30, 2021
@calebcartwright
Copy link

@bcoe know you're very busy but would be great to get your perspective on some paths to potentially resolve this issue. Fundamentally I think there's some change/guidance needed on how extends is managed and/or exposed between yargs and yargs-parser, as I've seen this same type of challenge pop up elsewhere (e.g. mocha) with extends not working at all or only partially working.

Realize the yargs discussion would be better placed elsewhere, but mentioning here since that seems like the right place to address as opposed to trying to find a solution that works around/with the issue in c8 and other tools (however if there is a viable workaround that'll get this feature working in c8 then i'd be happy to attempt a PR)

@bcoe
Copy link
Owner

bcoe commented Dec 30, 2021

@calebcartwright yargs exposes an applyExtends helper, which can be used to configure the extension behavior.

Does this look like it would do the trick? #343

@calebcartwright
Copy link

Awesome thank you, that seems to do it! I didn't realize applyExtends had become public (though it's admittedly been a while since i checked on the similar mocha issue).

@bcoe bcoe closed this as completed in #343 Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants