From b6783c37f32bb74ac54d5399b22873d0624669af Mon Sep 17 00:00:00 2001 From: John Haugeland Date: Fri, 24 Apr 2020 13:21:01 -0700 Subject: [PATCH] Apparently the .d.ts wasn't exposed --- README.md | 34 ++++++++++++++-------------------- package.json | 3 ++- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index b5937c8b..ff782aa2 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,26 @@ # jssm -Wouldn't it be nice if your state machines were simple and readable? +Wouldn't it be nice if your Javascript state machines were simple and readable? -```fsl -Green => Yellow => Red => Green; -[Red Yellow Green] ~> Off -> Red; -``` - -What if that were easy to render visually? +```javascript +import { sm } from 'jssm'; -![](https://raw.githubusercontent.com/StoneCypher/jssm/master/src/assets/doc%20light%20unstyled.png) +const Machine = sm` + Green => Yellow => Red => Green; + [Red Yellow Green] ~> Off -> Red; +`; -And what if that in turn were easy to style? +console.log( Machine.state() ); // 'Green' -```fsl -arrange [Green Yellow]; - -state Red : { background-color: pink; corners: rounded; }; -state Yellow : { background-color: #ffb; corners: rounded; }; -state Green : { background-color: lightgreen; corners: rounded; }; +Machine.transition('Yellow'); // true +console.log( Machine.state() ); // 'Yellow' -state Off : { - background-color : steelblue; - text-color : white; - shape : octagon; -}; +Machine.transition('Blue'); // false +console.log( Machine.state() ); // 'Yellow' ``` +What if that were easy to render visually, with styling? + ![](https://raw.githubusercontent.com/StoneCypher/jssm/master/src/assets/doc%20light%20styled.png) diff --git a/package.json b/package.json index 2b33be3e..d2b60a7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jssm", - "version": "5.32.16", + "version": "5.32.17", "engines": { "node": ">=6.0.0" }, @@ -19,6 +19,7 @@ "description": "A Javascript finite state machine (FSM) with a terse DSL and a simple API. Well tested, and typed with Flowtype. MIT License.", "main": "dist/jssm.es5.cjs.js", "module": "dist/es6/jssm.js", + "types": "dist/jssm.d.ts", "scripts": { "test": "npm run make && npm run justtest", "rmgenerated": "rm -f src/js/jssm-dot.ts && rm -f src/js/version.ts && rm -f *.d.ts",