Open MartinJohns opened 6 years ago
Hi, thanks for this suggestion. There is some performance concern over large command bundle, but I think there would be easy fixes like dynamic import.
Hey, I am interested to implement this feature, as I am needing it myself. Would a PR be welcome @vilic ?
@dejitaiza Hi, absolutely yes. But please also add related tests.
Hey ho,
I like your library, but something I'd like over the file-structured based hierarchy is if I could define the architecture myself when creating an instance of
CLI
. This would also be a workaround for #41 as there's no need for a pre-compiled file.I'd propose an overload for
CLI
or a new type likeInMemoryCLI
that accepts the following data structure as the second argument:To give an example, here's your structure from the "subcommands" section in the README:
And with my proposed functionality:
Or alternatively, you could create an
index.ts
in ever sub-commands folder, e.g. forcommands/foo/index.ts
:And when importing: