Closed DanHulton closed 5 months ago
I believe this most likely has to do with my use of @golevelup/nestjs-discovery
and how it discovers metadata of each class. I'll see if I can reproduce the functionality away from nest-commander
and report it to that library, or adjust my use if necessary
@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
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