Skip to content

Commit

Permalink
refactor(render): adds new handlebars-free dot reporter (#217)
Browse files Browse the repository at this point in the history
## Description

- adds a 'hand built' `dot` rendition (`ndot`)
- updates the `dot` rendition (see below for details)

... with the goal of phasing out the handlebars one. That itself will be
done in a separate PR _after_ a last release _with_ the handelbars
renderer in it (it itself got a bit of an overhaul and if we need to
roll back I'd rather roll back to this updated handlebars versioned

Steps:
- [x] add a new `ndot` render module
- [x] expand the render tests & fixtures for `dot` with the ones used
for other render modules as well
- use these tests & fixtures to build the `ndot` render module
  - [x] non-hierarchical states
  - [x] non-hierarchical transitions
  - [x] non-hierarchical notes
  - [x] hierarchical/ composite states
  - [x] hierarchical transitions
  - [x] self transitions on composite states
- [x] explicitly _internal_ and _external_ self transitions on composite
states
  - [x] hierarchical notes (states)
- [x] hierarchical notes (transitions) --> these are now rendered
_inside_ the containing state (addresses #213)
  - [x] parallel states (if not already covered in composite states)
  - [x] edge cases
  - [x] corner cases
- When 100% covered:
  - [ ] ~~remove the `dot` module~~ separate PR
  - [ ] ~~rename the `ndot` module to `dot`~~ separate PR
- [ ] ~~move `handlebars` to a devDependency, so it isn't shipped
anymore (we still use it in the site generation)~~ separate PR

There's also some changes to the `dot` rendition. Most of that is moving
around white space & line ends, some of it is swapping the order of
attributes (either for consistency of readability) and some of it is to
make implicit attributes explicit (which makes writing & testing easier
and thus more reliable).

## Motivation and Context

- reduces the number of dependencies
- handlebars hasn't seen updates in a pretty long time => _if_ there's
ever going to be a security vulnerability in it a speedy fix might take
a minute
- the shipped handlebars templates & dependencies are not small - can
likely do a bit better even not considering the bundled 3rd party code

## How Has This Been Tested?

- [x] green ci
- [x] additional automated non-regression tests (>300 of them ...)


## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation only change
- [x] Refactor (non-breaking change which fixes an issue without
changing functionality)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
  • Loading branch information
sverweij authored Dec 20, 2024
1 parent ab885a8 commit 0915a11
Show file tree
Hide file tree
Showing 503 changed files with 12,438 additions and 1,214 deletions.
2 changes: 1 addition & 1 deletion dist/cli/normalize.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dist/options.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions dist/parse/parser-helpers.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/parse/smcat-ast.schema.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/parse/smcat/smcat-parser.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions dist/render/dot/counter.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion dist/render/dot/dot.states.template.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/render/dot/dot.template.cjs

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions dist/render/dot/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions dist/render/dot/state-transformers.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions dist/render/dot/transition-transformers.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/render/dot/utl.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/render/index-node.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions dist/render/ndot/attributebuilder.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0915a11

Please sign in to comment.