node-seeli
node-seeli copied to clipboard
simplification of command classes
Seeli is the first node package I wrote probably 10 years go and it has accumulated a bit of cruft over the years. The way I want to use it has changed over the years and some of the initial decisions on implementation are getting rather difficult to work around
- expectations around command instances are difficult to test
- The sub command interface is difficult to juggle and interferes with trying to programmatically execute a command
- The explicit use of
console.logmake it difficult to test + stub a writable destination - The config interface can cause some when loading order isn't respected
- The dynamic loading of the help command may get the wrong color / name if loaded too soon
- The attempt at deep merging of options is probably unnecessary. Most of the options are flat with the exception of flags. I most try to work around it. shallow is probably fine
If the command runner loaded classes rather than instances, many problems would be mitigated. This would probably be easier with class properties
Originally posted by @esatterwhite in https://github.com/esatterwhite/node-seeli/discussions/32