Morphir cli tools as plugins. #140
nwokafor-choongsaeng
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
A plugin architecture for adding CLI features would be a big win. A couple of thoughts:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introducing CLI tools as Plugins.
The morphir-elm cli tool provides a host of useful functionalities including commands to build a Morphir project, generate code from an existing morphir project, run test cases, gather Morphir features used in a model, etc.
This discussion introduces an idea to split-up these functionalities as their own separate but pluggable/reusable tooling.
Suggestions on ways to improve this solution, and even entirely different solutions are welcome.
The Motivation
One of the evidence of growth of Morphir is in the size of it's ecosystem and available tooling, and as it leans more into the contribution of it's open-source community it becomes important that existing tools are, as much as possible, reusable in building new tooling.
The morphir-elm cli tool currently does not support a way to run a new backend on a morphir model and this means that, for every new backend, a new cli tool would have to be created that does most of what the morphir-elm tool already does i.e.
This increases the development time, and can negatively impact the development experience of a contributor.
Tooling as a Plugin
To solve the problem of reusability, the morphir-elm cli tool can be split up into cli processing and morphir/IR processing tools. The cli processing includes CLI specific tasks, like initializing a morphir project, running a configured morphir tool, reading and writing files and sources. This idea works well in conjunction with splitting the morphir-elm npm package where the cli can be published under an npm package @morphir/cli, and the plugins (like the Scala backend) would be published as @morphir/scala-backend-plugin
Improving the developer experience
With this change, developers can build their backends following a specific guideline for building a Morphir plugin, and specify that plugin as part of the Morphir configuration
morphir.json
. Allowing the morphir-cli to use do all the generic stuff (like reading and verifying inputs) and calling the specified backend with everything it needs to work based on what was configured.Beta Was this translation helpful? Give feedback.
All reactions