-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Class inheritance does not extend all functionality #942
Comments
I believe this most likely has to do with my use of |
@jmcdo29 any ideas how to do it ? |
Hmm, I was not able to reproduce this functionality in an e2e test I created for this issue. Can someone provide me a minimum reproduction |
I just encountered this issue. I have a base class with I have a command that inherits that base class. This command then has subcommands that also inherit the base class. Diagram:
The issue here is really sub-commands and how they operate in Here is a It sounds like updates in the Solutions that should work:
Some additional
@jmcdo29 We could update the I think the Oddly enough, |
Is there an existing issue for this?
Current behavior
If you want to have a "parent command class" for global options, a common logging config, shared functions or constructor behaviour, it does not work as expected. Basic class functionality works, i.e. if you create a protected
logger
instance, that works, and shared functions work as expected, but trying to create an@Options
definition that would be "global" among Commands that inherit this class does not work.Minimum reproduction code
base-command.ts:
test-command.ts
:Expected behavior
When running this code with the
--common=something
flag set, I would expect to see{'common': 'something'}
in the logged options, but instead, the logged object is empty.Package
nest-commander
nest-commander-schematics
nest-commander-testing
Package version
3.7.1
Node.js version
18.16.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: