Skip to content

Commit

Permalink
After hook for single node, fixes StoneCypher/fsl#698
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed Jul 7, 2024
1 parent 76daa94 commit f820f8d
Show file tree
Hide file tree
Showing 44 changed files with 545 additions and 201 deletions.
32 changes: 31 additions & 1 deletion CHANGELOG.long.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

1157 merges; 201 releases
1159 merges; 201 releases



Expand All @@ -18,6 +18,36 @@ Published tags:



 

 

## [Untagged] - 7/6/2024 12:45:09 PM

Commit [76daa940129b760f10032250ac482974ce1a9339](https://github.com/StoneCypher/jssm/commit/76daa940129b760f10032250ac482974ce1a9339)

Author: `John Haugeland <stonecypher@gmail.com>`

* suppressing tweet since that hasn't worked since elon anyway




&nbsp;

&nbsp;

## [Untagged] - 7/6/2024 12:35:59 PM

Commit [6fe0e82f5d442504e97061e739bbacc1e110740a](https://github.com/StoneCypher/jssm/commit/6fe0e82f5d442504e97061e739bbacc1e110740a)

Author: `John Haugeland <stonecypher@gmail.com>`

* jest bugs forced upgrade to jest which starts at node 14. since 14's two years out of service, i guess i'm okay with no longer testing 11-13.




&nbsp;

&nbsp;
Expand Down
69 changes: 32 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

1157 merges; 201 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)
1159 merges; 201 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)



Expand All @@ -18,6 +18,36 @@ Published tags:



&nbsp;

&nbsp;

## [Untagged] - 7/6/2024 12:45:09 PM

Commit [76daa940129b760f10032250ac482974ce1a9339](https://github.com/StoneCypher/jssm/commit/76daa940129b760f10032250ac482974ce1a9339)

Author: `John Haugeland <stonecypher@gmail.com>`

* suppressing tweet since that hasn't worked since elon anyway




&nbsp;

&nbsp;

## [Untagged] - 7/6/2024 12:35:59 PM

Commit [6fe0e82f5d442504e97061e739bbacc1e110740a](https://github.com/StoneCypher/jssm/commit/6fe0e82f5d442504e97061e739bbacc1e110740a)

Author: `John Haugeland <stonecypher@gmail.com>`

* jest bugs forced upgrade to jest which starts at node 14. since 14's two years out of service, i guess i'm okay with no longer testing 11-13.




&nbsp;

&nbsp;
Expand Down Expand Up @@ -153,39 +183,4 @@ Commit [04c9032fc215d1cef254ddfefb31a9ff89134a41](https://github.com/StoneCypher

Author: `John Haugeland <stonecypher@gmail.com>`

* Add node 24 (released yesterday) to CI/CD grid, fixes StoneCypher/fsl#1294




&nbsp;

&nbsp;

## [Untagged] - 4/25/2024 8:32:09 AM

Commit [f0d25647f8f375f0fb07223eb770e392c60625e2](https://github.com/StoneCypher/jssm/commit/f0d25647f8f375f0fb07223eb770e392c60625e2)

Author: `John Haugeland <stonecypher@gmail.com>`

* Add node 24 (released yesterday) to CI/CD grid




&nbsp;

&nbsp;

<a name="5__98__0" />

## [5.98.0] - 3/26/2024 8:24:29 PM

Commit [b2d953d915b12e5831a3d1ad87c5e09747787997](https://github.com/StoneCypher/jssm/commit/b2d953d915b12e5831a3d1ad87c5e09747787997)

Author: `John Haugeland <stonecypher@gmail.com>`

Merges [e642702, 9f66ad0]

* Merge pull request #568 from StoneCypher/SetInitialState
* Set initial state
* Add node 24 (released yesterday) to CI/CD grid, fixes StoneCypher/fsl#1294
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`
* Generated for version 5.98.7 at 7/6/2024, 12:35:39 PM
* Generated for version 5.99.0 at 7/6/2024, 5:40:01 PM
-->
# jssm 5.98.7
# jssm 5.99.0

Easy. Small. Fast. TS, es6, es5. Node, Browser. 100% coverage. Property
tests. Fuzz tests. Language tests for a dozen languages and emoji. Easy to
share online. Easy to embed.

Readable, useful state machines as one-liner strings.

***5,070 tests***, run 5,961 times.
***5,071 tests***, run 5,962 times.

* 5,061 specs with 100.0% coverage.
* 5,062 specs with 99.9% coverage.
* 9 fuzz tests with 12.4% coverage.

With 2,970 lines, that's about 1.7 tests per line, or 2.0 generated tests per line.
With 3,007 lines, that's about 1.7 tests per line, or 2.0 generated tests per line.

***Meet your new state machine library.***

Expand Down
10 changes: 5 additions & 5 deletions dist/deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`
* Generated for version 5.98.7 at 7/6/2024, 12:35:39 PM
* Generated for version 5.99.0 at 7/6/2024, 5:40:01 PM
-->
# jssm 5.98.7
# jssm 5.99.0

Easy. Small. Fast. TS, es6, es5. Node, Browser. 100% coverage. Property
tests. Fuzz tests. Language tests for a dozen languages and emoji. Easy to
share online. Easy to embed.

Readable, useful state machines as one-liner strings.

***5,070 tests***, run 5,961 times.
***5,071 tests***, run 5,962 times.

* 5,061 specs with 100.0% coverage.
* 5,062 specs with 99.9% coverage.
* 9 fuzz tests with 12.4% coverage.

With 2,970 lines, that's about 1.7 tests per line, or 2.0 generated tests per line.
With 3,007 lines, that's about 1.7 tests per line, or 2.0 generated tests per line.

***Meet your new state machine library.***

Expand Down
7 changes: 5 additions & 2 deletions dist/deno/jssm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { JssmGenericState, JssmGenericConfig, JssmStateConfig, JssmTransition, J
JssmMachineInternalState, JssmAllowsOverride, JssmStateDeclaration, JssmStateStyleKeyList, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslDirections, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult, JssmRng } from './jssm_types';
import { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow';
import { compile, make, wrap_parse } from './jssm_compiler';
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, sleep } from './jssm_util';
import * as constants from './jssm_constants';
declare const shapes: string[], gviz_shapes: string[], named_colors: string[];
import { version, build_time } from './version';
Expand Down Expand Up @@ -56,13 +56,15 @@ declare class Machine<mDT> {
_has_named_hooks: boolean;
_has_entry_hooks: boolean;
_has_exit_hooks: boolean;
_has_after_hooks: boolean;
_has_global_action_hooks: boolean;
_has_transition_hooks: boolean;
_has_forced_transitions: boolean;
_hooks: Map<string, HookHandler<mDT>>;
_named_hooks: Map<string, HookHandler<mDT>>;
_entry_hooks: Map<string, HookHandler<mDT>>;
_exit_hooks: Map<string, HookHandler<mDT>>;
_after_hooks: Map<string, HookHandler<mDT>>;
_global_action_hooks: Map<string, HookHandler<mDT>>;
_any_action_hook: HookHandler<mDT> | undefined;
_standard_transition_hook: HookHandler<mDT> | undefined;
Expand Down Expand Up @@ -669,6 +671,7 @@ declare class Machine<mDT> {
hook_any_transition(handler: HookHandler<mDT>): Machine<mDT>;
hook_entry(to: string, handler: HookHandler<mDT>): Machine<mDT>;
hook_exit(from: string, handler: HookHandler<mDT>): Machine<mDT>;
hook_after(from: string, handler: HookHandler<mDT>): Machine<mDT>;
post_hook(from: string, to: string, handler: HookHandler<mDT>): Machine<mDT>;
post_hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>;
post_hook_global_action(action: string, handler: HookHandler<mDT>): Machine<mDT>;
Expand Down Expand Up @@ -1135,4 +1138,4 @@ declare function is_hook_complex_result<mDT>(hr: unknown): hr is HookComplexResu
declare function is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean;
declare function abstract_hook_step<mDT>(maybe_hook: HookHandler<mDT> | undefined, hook_args: HookContext<mDT>): HookComplexResult<mDT>;
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>;
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections };
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, sleep, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections };
2 changes: 1 addition & 1 deletion dist/deno/jssm.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion dist/deno/jssm_types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ declare type ExitHook<mDT> = {
from: string;
handler: HookHandler<mDT>;
};
declare type AfterHook<mDT> = {
kind: 'after';
from: string;
handler: HookHandler<mDT>;
};
declare type PostBasicHookDescription<mDT> = {
kind: 'post hook';
from: string;
Expand Down Expand Up @@ -351,7 +356,7 @@ declare type PostExitHook<mDT> = {
from: string;
handler: PostHookHandler<mDT>;
};
declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT> | PostBasicHookDescription<mDT> | PostHookDescriptionWithAction<mDT> | PostGlobalActionHook<mDT> | PostAnyActionHook<mDT> | PostStandardTransitionHook<mDT> | PostMainTransitionHook<mDT> | PostForcedTransitionHook<mDT> | PostAnyTransitionHook<mDT> | PostEntryHook<mDT> | PostExitHook<mDT>;
declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT> | AfterHook<mDT> | PostBasicHookDescription<mDT> | PostHookDescriptionWithAction<mDT> | PostGlobalActionHook<mDT> | PostAnyActionHook<mDT> | PostStandardTransitionHook<mDT> | PostMainTransitionHook<mDT> | PostForcedTransitionHook<mDT> | PostAnyTransitionHook<mDT> | PostEntryHook<mDT> | PostExitHook<mDT>;
declare type HookComplexResult<mDT> = {
pass: boolean;
state?: StateType;
Expand Down
3 changes: 2 additions & 1 deletion dist/deno/jssm_util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ declare const unique: <T>(arr?: T[]) => T[];
*
*/
declare function find_repeated<T>(arr: T[]): [T, number][];
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32 };
declare function sleep(ms: number): Promise<unknown>;
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32, sleep };
7 changes: 5 additions & 2 deletions dist/es6/jssm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { JssmGenericState, JssmGenericConfig, JssmStateConfig, JssmTransition, J
JssmMachineInternalState, JssmAllowsOverride, JssmStateDeclaration, JssmStateStyleKeyList, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslDirections, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult, JssmRng } from './jssm_types';
import { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow';
import { compile, make, wrap_parse } from './jssm_compiler';
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, sleep } from './jssm_util';
import * as constants from './jssm_constants';
declare const shapes: string[], gviz_shapes: string[], named_colors: string[];
import { version, build_time } from './version';
Expand Down Expand Up @@ -56,13 +56,15 @@ declare class Machine<mDT> {
_has_named_hooks: boolean;
_has_entry_hooks: boolean;
_has_exit_hooks: boolean;
_has_after_hooks: boolean;
_has_global_action_hooks: boolean;
_has_transition_hooks: boolean;
_has_forced_transitions: boolean;
_hooks: Map<string, HookHandler<mDT>>;
_named_hooks: Map<string, HookHandler<mDT>>;
_entry_hooks: Map<string, HookHandler<mDT>>;
_exit_hooks: Map<string, HookHandler<mDT>>;
_after_hooks: Map<string, HookHandler<mDT>>;
_global_action_hooks: Map<string, HookHandler<mDT>>;
_any_action_hook: HookHandler<mDT> | undefined;
_standard_transition_hook: HookHandler<mDT> | undefined;
Expand Down Expand Up @@ -669,6 +671,7 @@ declare class Machine<mDT> {
hook_any_transition(handler: HookHandler<mDT>): Machine<mDT>;
hook_entry(to: string, handler: HookHandler<mDT>): Machine<mDT>;
hook_exit(from: string, handler: HookHandler<mDT>): Machine<mDT>;
hook_after(from: string, handler: HookHandler<mDT>): Machine<mDT>;
post_hook(from: string, to: string, handler: HookHandler<mDT>): Machine<mDT>;
post_hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>;
post_hook_global_action(action: string, handler: HookHandler<mDT>): Machine<mDT>;
Expand Down Expand Up @@ -1135,4 +1138,4 @@ declare function is_hook_complex_result<mDT>(hr: unknown): hr is HookComplexResu
declare function is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean;
declare function abstract_hook_step<mDT>(maybe_hook: HookHandler<mDT> | undefined, hook_args: HookContext<mDT>): HookComplexResult<mDT>;
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>;
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections };
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, sleep, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections };
Loading

0 comments on commit f820f8d

Please sign in to comment.