jssm 5.72.2 → 5.72.5
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/CHANGELOG.md +39 -41
- package/README.md +24 -1
- package/dist/es6/jssm.d.ts +10 -7
- package/dist/es6/jssm.js +102 -52
- package/dist/es6/jssm_types.d.ts +8 -3
- package/dist/es6/version.js +1 -1
- package/dist/jssm.es5.cjs.js +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/jest-spec.config.js +7 -1
- package/jssm.d.ts +10 -7
- package/jssm_types.d.ts +8 -3
- package/package.json +4 -2
package/jest-spec.config.js
CHANGED
|
@@ -22,6 +22,12 @@ module.exports = {
|
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
|
|
25
|
-
collectCoverageFrom: ["src/ts/**/{!(jssm-dot),}.{js,ts}"]
|
|
25
|
+
collectCoverageFrom: ["src/ts/**/{!(jssm-dot),}.{js,ts}"],
|
|
26
|
+
|
|
27
|
+
reporters: [
|
|
28
|
+
['default', {}],
|
|
29
|
+
['jest-json-reporter2', { outputDir: './coverage/spec', outputFile: 'metrics.json', fullOutput: false }],
|
|
30
|
+
// ['jest-json-reporter2', { outputDir: './coverage/spec', outputFile: 'extended-metrics.json', fullOutput: true }],
|
|
31
|
+
]
|
|
26
32
|
|
|
27
33
|
};
|
package/jssm.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare type StateType = string;
|
|
2
2
|
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
|
|
3
|
-
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler } from './jssm_types';
|
|
3
|
+
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types';
|
|
4
4
|
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
|
|
5
5
|
import { shapes, gviz_shapes, named_colors } from './jssm_constants';
|
|
6
6
|
import { version } from './version';
|
|
@@ -223,11 +223,11 @@ declare class Machine<mDT> {
|
|
|
223
223
|
_has_exit_hooks: boolean;
|
|
224
224
|
_has_global_action_hooks: boolean;
|
|
225
225
|
_has_transition_hooks: boolean;
|
|
226
|
-
_hooks: Map<string,
|
|
227
|
-
_named_hooks: Map<string,
|
|
228
|
-
_entry_hooks: Map<string,
|
|
229
|
-
_exit_hooks: Map<string,
|
|
230
|
-
_global_action_hooks: Map<string,
|
|
226
|
+
_hooks: Map<string, HookHandler<mDT>>;
|
|
227
|
+
_named_hooks: Map<string, HookHandler<mDT>>;
|
|
228
|
+
_entry_hooks: Map<string, HookHandler<mDT>>;
|
|
229
|
+
_exit_hooks: Map<string, HookHandler<mDT>>;
|
|
230
|
+
_global_action_hooks: Map<string, HookHandler<mDT>>;
|
|
231
231
|
_any_action_hook: HookHandler<mDT> | undefined;
|
|
232
232
|
_standard_transition_hook: HookHandler<mDT> | undefined;
|
|
233
233
|
_main_transition_hook: HookHandler<mDT> | undefined;
|
|
@@ -669,4 +669,7 @@ declare function sm<mDT>(template_strings: TemplateStringsArray, ...remainder: a
|
|
|
669
669
|
*
|
|
670
670
|
*/
|
|
671
671
|
declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
|
|
672
|
-
|
|
672
|
+
declare function is_hook_complex_result<mDT>(hr: unknown): hr is HookComplexResult<mDT>;
|
|
673
|
+
declare function is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean;
|
|
674
|
+
declare function abstract_hook_step<mDT>(maybe_hook: HookHandler<mDT> | undefined, hook_args: HookContext<mDT>): HookComplexResult<mDT>;
|
|
675
|
+
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step };
|
package/jssm_types.d.ts
CHANGED
|
@@ -198,12 +198,17 @@ declare type ExitHook<mDT> = {
|
|
|
198
198
|
handler: HookHandler<mDT>;
|
|
199
199
|
};
|
|
200
200
|
declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT>;
|
|
201
|
-
declare type
|
|
201
|
+
declare type HookComplexResult<mDT> = {
|
|
202
|
+
pass: boolean;
|
|
203
|
+
state?: StateType;
|
|
204
|
+
data?: mDT;
|
|
205
|
+
};
|
|
206
|
+
declare type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>;
|
|
202
207
|
declare type HookContext<mDT> = {
|
|
203
208
|
data: mDT;
|
|
204
209
|
};
|
|
205
|
-
declare type HookHandler<mDT> = (hook_context: HookContext<mDT>) => HookResult
|
|
210
|
+
declare type HookHandler<mDT> = (hook_context: HookContext<mDT>) => HookResult<mDT>;
|
|
206
211
|
declare type JssmErrorExtendedInfo = {
|
|
207
212
|
requested_state?: StateType | undefined;
|
|
208
213
|
};
|
|
209
|
-
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookResult };
|
|
214
|
+
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jssm",
|
|
3
|
-
"version": "5.72.
|
|
3
|
+
"version": "5.72.5",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.0.0"
|
|
6
6
|
},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"audit": "text_audit -r -t major MAJOR wasteful WASTEFUL any mixed fixme FIXME checkme CHECKME testme TESTME stochable STOCHABLE todo TODO comeback COMEBACK whargarbl WHARGARBL -g ./src/ts/**/*.{js,ts}",
|
|
48
48
|
"vet": "npm run eslint && npm run audit",
|
|
49
49
|
"benny": "node ./src/buildjs/benchmark.js",
|
|
50
|
-
"build": "npm run vet && npm run test && npm run site && npm run changelog && npm run docs",
|
|
50
|
+
"build": "npm run vet && npm run test && npm run site && npm run changelog && npm run docs && npm run readme",
|
|
51
51
|
"clean_bench": "npm run test && npm run benny",
|
|
52
52
|
"qbuild": "npm run test",
|
|
53
53
|
"ci_build": "npm run vet && npm run test",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"min_cjs": "mv dist/jssm.es5.cjs.js dist/jssm.es5.cjs.nonmin.js && terser dist/jssm.es5.cjs.nonmin.js > dist/jssm.es5.cjs.js",
|
|
57
57
|
"site": "cp src/site/* docs/ && cp -r src/assets docs/assets/",
|
|
58
58
|
"docs": "typedoc src/ts/jssm.ts --options typedoc-options.js",
|
|
59
|
+
"readme": "rm ./README.md && node ./src/buildjs/make_readme.js",
|
|
59
60
|
"changelog": "rm -f CHANGELOG.md && rm -f ./src/doc_md/CHANGELOG.md && better_git_changelog -b && cp CHANGELOG.* ./src/doc_md/"
|
|
60
61
|
},
|
|
61
62
|
"repository": {
|
|
@@ -119,6 +120,7 @@
|
|
|
119
120
|
"fast-check": "^2.12.0",
|
|
120
121
|
"glob": "^7.1.6",
|
|
121
122
|
"jest": "^27.3.1",
|
|
123
|
+
"jest-json-reporter2": "^1.1.0",
|
|
122
124
|
"pegjs": "^0.10.0",
|
|
123
125
|
"rollup": "^2.72.1",
|
|
124
126
|
"semver": "^5.7.1",
|