eibens / edcb

A build tool and task runner for Deno.
MIT License
0 stars 0 forks source link

Make options for actions reusable #54

Closed eibens closed 2 years ago

eibens commented 2 years ago

Currently, there is a lot of duplication in regards to option type definitions.

Advantages:

Disadvantages

eibens commented 2 years ago

While right now the dependencies of each action look very much like other actions, this does not have to always be the case. I think having the actions remain independent of each other is a good choice. Reuse should only happen within a particular layer of the application. The preferred architecture would be:

  1. Individual actions that do not depend on other modules, except for static dependencies (e.g. deno/std).
  2. A runner interface that wires the actions together and produces event-based output. This is the layer in which dependencies between actions are defined. Here, we redefine the option types (without dependencies) and reuse them for defining the event types.
  3. A CLI interface on top of the runner interface. It knows the names of actions in the context of the wiring and derives text-based output from the events.

Considering this architecture, this issue is redundant.