A system of utilities based on the premise that unidirectional dependencies can be beneficial to structure and modularity in software
Switch branches/tags
Nothing to show
Clone or download
grahamdyson dogfooding and harnesses updated for/to version that use packages bin
versions of javascript-analyzer, processors and renderer...
which now use call-with-process-standard-streams instead of call-when-process-entry-point
#13
#17
Latest commit 05b9358 Dec 11, 2018

README.md

Eunice Gitter chat

DevSnicket Eunice is based on the premise that unidirectional dependencies can be beneficial to structure and modularity in software. Euince's approach isn't limited to direct dependencies, but includes indirect dependencies as well.

try out Eunice on Eunice 🐶🥫 (created with) Build Status

Stacks

Fundamental to Eunince is the act of defining stacks. When its indended that an item is to be dependent upon another item, the first item is placed above the second item in a stack. When items are indended to be independent of each other they can be placed at the same level in a stack.

In some programming languages there are implied stacks, such as the order of functions in a file or the order of files in a project.

Scale

The approach of defining stacks can be applied at all scales of software and across boundaries, from individual files, functions or classes, to multiple, large codebases in different languages, frameworks and runtimes.

Stages

Eunice includes the stages shown below. Transitions are made between the stages using YAML. An explanation of the YAML and stages follows.

YAML

To give Euince composability within and between stages, a common data format for structure and dependency is described using YAML.

What's supported in the YAML is specified here.

Analyzers

Analyzers are implemented to create the YAML files (e.g. from source code in a specific language, or using a specific framework).

An analyzer exists for JavaScript with support for many of the language's features.

NPM Git GitHub Build Status Coverage Status

try out JavaScript → YAML

Processors

NPM Git GitHub Build Status Coverage Status

YAML files generated by analyzers can then be optionally post-processed which includes combining the output of different analyzers. Currently there are processors written in JavaScript to:

(* not available in test harnesses)

Processors can be run from the command line and (example) from test harnesses through a plug-in discovery system.

Renderer

NPM Git GitHub Build Status Coverage Status

To visualise and explorer what's in the YAML files, and to statistically measure how well they match the intended structure, a SVG renderer has been implemented. The renderer doesn't use lines between items to show dependencies and instead marks items with counts for each dependency type:

  • matches stack (green down arrow)
  • does not match stack (red up arrow)
  • is not independent (red horizontal arrow).

Dependency counts appear for both sides of the dependency, the dependent item and the item depended upon. When there are multiple counts a summary of all counts is rendered at the bottom. [1].

scenario svg scenario svg scenario svg
upper depends
upon lower
lower depends
upon upper
interdependent
(stacked)
independent first depends
upon second
interdependent
(not stacked)[1]

Dependencies within an item are also summarised and rendered inside the item box, below the identifer text.

scenario svg scenario svg scenario svg
parent depends
upon item
item depends
upon parent
first item
depends upon
second item
(not stacked)

Items and sub-item can also be opened by clicking/tapping on their box. Opening an item will show its contents and breadcrumb links for where it is in the hierarchy.

root > grandparent

try out JavaScript → YAML → SVG

Supporting DevSnicket packages

The following DevSnicket NPM packages support the JavaScript analyzer, processors and renderer.

  • Eunice specific
    • Call with process standard streams NPM Git GitHub Build Status
    • Dependency and structure NPM Git GitHub Build Status Coverage Status
    • Run tests from file system NPM Git GitHub Build Status
    • Test harnesses NPM Git GitHub Build Status
  • Plug-in Discovery Git GitHub
    • Create repository factory function NPM
    • CommonJS Babel plug-in NPM