Skip to content

Commit

Permalink
refactor: replaces handlebars - render/smcat (#216)
Browse files Browse the repository at this point in the history
## Description

- replaces the smcat reporter with a 'hand' render instead of a
handlebars one

## Motivation and Context

Phasing handlebars usage (because: (1) it's a 3rd party dependency we
don't strictly need, so should installed package size and 3rd party
package maintenance (2) handlebars seems unmaintained (or at least: very
sparsely, with last update 1y ago), so wise to move away from it before
the ecosystem moves on too far and/ or security issues become apparent.

Incidentally - the 'unpacked' version of state-machine-cat _itself_ also
shrank with ~8kb with this PR.


## How Has This Been Tested?

- [x] automated non-regression tests

## 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)

## Checklist

- [x] 📖

  - My change doesn't require a documentation update, or ...
  - it _does_ and I have updated it

- [x] ⚖️
- The contribution will be subject to [The MIT license](../LICENSE), and
I'm OK with that.
  - The contribution is my own original work.
  - I am ok with the stuff in [**CONTRIBUTING.md**](./CONTRIBUTING.md).
  • Loading branch information
sverweij authored Oct 6, 2024
1 parent d0a4fa5 commit 77cf6f9
Show file tree
Hide file tree
Showing 25 changed files with 784 additions and 733 deletions.
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ src/cli/attributes-parser.mjs
src/parse/smcat/smcat-parser.mjs
src/render/dot/dot.states.template.cjs
src/render/dot/dot.template.cjs
src/render/smcat/smcat.template.cjs
dist/render/dot/dot.states.template.cjs
dist/render/dot/dot.template.cjs
dist/render/smcat/smcat.template.cjs
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ GENERATED_BASE_SOURCES=src/parse/smcat/smcat-parser.mjs \
src/parse/smcat-ast.schema.mts \
src/render/dot/dot.states.template.cjs \
src/render/dot/dot.template.cjs \
src/render/smcat/smcat.template.cjs \
src/version.mts

EXTRA_GENERATED_CLI_SOURCES=src/cli/attributes-parser.mjs
Expand Down Expand Up @@ -73,7 +72,6 @@ docs: $(GENERATED_SOURCES)

templates-dist:
cp src/render/dot/*.template.cjs dist/render/dot/.
cp src/render/smcat/*.template.cjs dist/render/smcat/.

dist:
mkdir -p $@
Expand Down
2 changes: 1 addition & 1 deletion dist/render/index-node.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/index.mjs

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

115 changes: 115 additions & 0 deletions dist/render/smcat.mjs

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

75 changes: 0 additions & 75 deletions dist/render/smcat/index.mjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/render/smcat/smcat.template.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<meta name="google-site-verification" content="K0j5zueKp7lYKMR7WihmcTJbLpHxBOpaXZEI_s0nHTw" />
<link rel="canonical" href="https://state-machine-cat.js.org">
<script nonce="known-inline-script">let LOG = false;</script>
<script src="smcat-online-interpreter.min.js" type="module" defer integrity="sha512-jW00R6aQpO/8HlgIBHby+zWnUNKDEBCKgZmQDMy7sWZAnnQ+0+OKOQs5Besk+eRZh+MO9AaM1Rd1nMm3j0SiqQ=="></script>
<script src="smcat-online-interpreter.min.js" type="module" defer integrity="sha512-jdNbtWWWhJ8wz5bEXGe/K9IgoWaOgoR6w6gp70yRFpknrcCXKL8cL4IJ7rrrnhTkcDmBrPHT0PgxPIdfo+UfnA=="></script>
<script defer src="https://code.getmdl.io/1.3.0/material.min.js" async></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DCPVBY7NNV"></script>
<script nonce="known-inline-script">
Expand Down
2 changes: 1 addition & 1 deletion docs/inpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
src="state-machine-cat-inpage.min.js"
type="module"
defer
integrity="sha512-YYgQmVg4m0xE8e7kXnumFlKAXEnr3pKqygJA9EF5Qqs1bwFY4s7tBTwUg29Hh5+wAhyf6fok2kBpFhc8w55GBg=="
integrity="sha512-i2uUTmLQJGBVkyCHeO6Al53bVN7hOT7PVyfuxpZoTeQLm7llcuT7CVpHM/V/rwnRsD7yjMxs4d8FWuKTwlXmyw=="
></script>
<style>
body { font-family: sans-serif; margin: 0 auto; max-width: 799px;
Expand Down
Loading

0 comments on commit 77cf6f9

Please sign in to comment.