jssm 5.76.2 → 5.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jssm.d.ts CHANGED
@@ -685,7 +685,7 @@ declare class Machine<mDT> {
685
685
  action(actionName: StateType, newData?: mDT): boolean;
686
686
  /********
687
687
  *
688
- * Instruct the machine to complete a transition.
688
+ * Instruct the machine to complete a transition. Synonym for {@link go}.
689
689
  *
690
690
  * ```typescript
691
691
  * const light = sm`red -> green -> yellow -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;
@@ -703,6 +703,26 @@ declare class Machine<mDT> {
703
703
  *
704
704
  */
705
705
  transition(newState: StateType, newData?: mDT): boolean;
706
+ /********
707
+ *
708
+ * Instruct the machine to complete a transition. Synonym for {@link transition}.
709
+ *
710
+ * ```typescript
711
+ * const light = sm`red -> green -> yellow -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;
712
+ *
713
+ * light.state(); // 'red'
714
+ * light.go('green'); // true
715
+ * light.state(); // 'green'
716
+ * ```
717
+ *
718
+ * @typeparam mDT The type of the machine data member; usually omitted
719
+ *
720
+ * @param newState The state to switch to
721
+ *
722
+ * @param newData The data change to insert during the transition
723
+ *
724
+ */
725
+ go(newState: StateType, newData?: mDT): boolean;
706
726
  /********
707
727
  *
708
728
  * Instruct the machine to complete a forced transition (which will reject if
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jssm",
3
- "version": "5.76.2",
3
+ "version": "5.77.0",
4
4
  "engines": {
5
5
  "node": ">=10.0.0"
6
6
  },
@@ -0,0 +1,45 @@
1
+
2
+ import nodeResolve from '@rollup/plugin-node-resolve';
3
+ import commonjs from '@rollup/plugin-commonjs';
4
+ import replace from '@rollup/plugin-replace';
5
+
6
+ const pkg = require('./package.json');
7
+
8
+
9
+
10
+
11
+ const config = {
12
+
13
+ input: 'dist/es6/jssm.js',
14
+
15
+ output: {
16
+ file : 'dist/deno/jssm.deno-esm.js',
17
+ format : 'esm',
18
+ name : 'jssm'
19
+ },
20
+
21
+ plugins : [
22
+
23
+ nodeResolve({
24
+ mainFields : ['module', 'main'],
25
+ browser : true,
26
+ extensions : [ '.js', '.json', '.ts', '.tsx' ],
27
+ preferBuiltins : false
28
+ }),
29
+
30
+ commonjs(),
31
+
32
+ replace({
33
+ preventAssignment : true,
34
+ 'process.env.NODE_ENV' : JSON.stringify( 'production' )
35
+ })
36
+
37
+ ]
38
+
39
+ };
40
+
41
+
42
+
43
+
44
+
45
+ export default config;
@@ -27,7 +27,7 @@ module.exports = {
27
27
  { title: 'Node', source: 'todo.md' },
28
28
  { title: 'Typescript', source: 'todo.md' },
29
29
  { title: 'The browser', source: 'todo.md' },
30
- { title: 'Deno', source: 'todo.md' },
30
+ // { title: 'Deno', source: 'todo.md' },
31
31
  { title: 'AWS Lambda', source: 'todo.md' },
32
32
  { title: 'SQL', source: 'todo.md' },
33
33
  ] },