jssm 5.75.1 → 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/CHANGELOG.md +44 -37
- package/README.md +2 -2
- package/dist/es6/jssm-dot.js +1 -1
- package/dist/es6/jssm.d.ts +21 -1
- package/dist/es6/jssm.js +25 -2
- package/dist/es6/jssm_types.d.ts +5 -5
- package/dist/es6/jssm_util.d.ts +9 -1
- package/dist/es6/jssm_util.js +17 -1
- 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-dragon.config.js +33 -0
- package/jssm.d.ts +21 -1
- package/jssm_types.d.ts +5 -5
- package/jssm_util.d.ts +9 -1
- package/package.json +11 -8
- package/rollup.config.deno.js +45 -0
- package/typedoc-options.js +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
|
|
4
|
+
testEnvironment : 'node',
|
|
5
|
+
|
|
6
|
+
moduleFileExtensions : ['js', 'ts'],
|
|
7
|
+
coveragePathIgnorePatterns : ["/node_modules/", "/src/ts/tests/"],
|
|
8
|
+
testMatch : ['**/*.maximal.ts'],
|
|
9
|
+
|
|
10
|
+
transform : { '^.+\\.ts$': 'ts-jest' },
|
|
11
|
+
|
|
12
|
+
verbose : false,
|
|
13
|
+
collectCoverage : true,
|
|
14
|
+
coverageDirectory : "coverage/ksd/",
|
|
15
|
+
|
|
16
|
+
coverageThreshold : {
|
|
17
|
+
global : {
|
|
18
|
+
branches : 0,
|
|
19
|
+
functions : 0,
|
|
20
|
+
lines : 0,
|
|
21
|
+
statements : 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
collectCoverageFrom: ["src/ts/**/{!(jssm-dot),}.{js,ts}"],
|
|
26
|
+
|
|
27
|
+
reporters: [
|
|
28
|
+
['default', {}],
|
|
29
|
+
['jest-json-reporter2', { outputDir: './coverage/ksd', outputFile: 'metrics.json', fullOutput: false }],
|
|
30
|
+
// ['jest-json-reporter2', { outputDir: './coverage/ksd', outputFile: 'extended-metrics.json', fullOutput: true }],
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
};
|
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/jssm_types.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ declare type JssmColor = string;
|
|
|
14
14
|
declare type JssmPermitted = 'required' | 'disallowed';
|
|
15
15
|
declare type JssmPermittedOpt = 'required' | 'disallowed' | 'optional';
|
|
16
16
|
declare type JssmArrow = '->' | '<-' | '<->' | '<=->' | '<~->' | '=>' | '<=' | '<=>' | '<-=>' | '<~=>' | '~>' | '<~' | '<~>' | '<-~>' | '<=~>';
|
|
17
|
+
/**
|
|
18
|
+
* A type teaching Typescript the various supported shapes for nodes, mostly inherited from GraphViz
|
|
19
|
+
*/
|
|
17
20
|
declare type JssmShape = "box" | "polygon" | "ellipse" | "oval" | "circle" | "point" | "egg" | "triangle" | "plaintext" | "plain" | "diamond" | "trapezium" | "parallelogram" | "house" | "pentagon" | "hexagon" | "septagon" | "octagon" | "doublecircle" | "doubleoctagon" | "tripleoctagon" | "invtriangle" | "invtrapezium" | "invhouse" | "Mdiamond" | "Msquare" | "Mcircle" | "rect" | "rectangle" | "square" | "star" | "none" | "underline" | "cylinder" | "note" | "tab" | "folder" | "box3d" | "component" | "promoter" | "cds" | "terminator" | "utr" | "primersite" | "restrictionsite" | "fivepoverhang" | "threepoverhang" | "noverhang" | "assembly" | "signature" | "insulator" | "ribosite" | "rnastab" | "proteasesite" | "proteinstab" | "rpromoter" | "rarrow" | "larrow" | "lpromoter" | "record";
|
|
18
21
|
declare type JssmArrowDirection = 'left' | 'right' | 'both';
|
|
19
22
|
declare type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
|
|
@@ -252,10 +255,7 @@ declare type HookComplexResult<mDT> = {
|
|
|
252
255
|
state?: StateType;
|
|
253
256
|
data?: mDT;
|
|
254
257
|
};
|
|
255
|
-
|
|
256
|
-
* Documents whether a hook succeeded, either with a primitive or a reference to the hook complex object
|
|
257
|
-
*/
|
|
258
|
-
declare type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>;
|
|
258
|
+
declare type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>; /** Documents whether a hook succeeded, either with a primitive or a reference to the hook complex object */
|
|
259
259
|
declare type HookContext<mDT> = {
|
|
260
260
|
data: mDT;
|
|
261
261
|
};
|
|
@@ -264,4 +264,4 @@ declare type PostHookHandler<mDT> = (hook_context: HookContext<mDT>) => void;
|
|
|
264
264
|
declare type JssmErrorExtendedInfo = {
|
|
265
265
|
requested_state?: StateType | undefined;
|
|
266
266
|
};
|
|
267
|
-
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 };
|
|
267
|
+
export { JssmColor, JssmShape, 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/jssm_util.d.ts
CHANGED
|
@@ -49,4 +49,12 @@ declare const hook_name: (from: string, to: string) => string;
|
|
|
49
49
|
*
|
|
50
50
|
*/
|
|
51
51
|
declare const named_hook_name: (from: string, to: string, action: string) => string;
|
|
52
|
-
|
|
52
|
+
/*******
|
|
53
|
+
*
|
|
54
|
+
* Creates a Mulberry32 random generator. Used by the randomness test suite.
|
|
55
|
+
*
|
|
56
|
+
* Sourced from `bryc` at StackOverflow: https://stackoverflow.com/a/47593316/763127
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
declare const make_mulberry_rand: (a?: number | undefined) => () => number;
|
|
60
|
+
export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name, make_mulberry_rand };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jssm",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.77.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.0.0"
|
|
6
6
|
},
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
"browser": "dist/jssm.es5.iife.js",
|
|
29
29
|
"types": "./jssm.d.ts",
|
|
30
30
|
"scripts": {
|
|
31
|
-
"jest": "jest -c jest-stoch.config.js --color --verbose
|
|
31
|
+
"jest-stoch": "jest -c jest-stoch.config.js --color --verbose",
|
|
32
|
+
"jest-dragon": "jest -c jest-dragon.config.js --color --verbose",
|
|
33
|
+
"jest-spec": "jest -c jest-spec.config.js --color --verbose",
|
|
34
|
+
"jest": "npm run jest-spec",
|
|
32
35
|
"test": "npm run make && npm run jest",
|
|
33
36
|
"clean": "rm -rf dist && rm -rf docs && cd coverage && rm -rf cloc && cd .. && rm -f src/ts/jssm-dot.ts && rm -f src/ts/version.ts && rm -f *.d.ts && mkdir dist && mkdir docs && cd coverage && mkdir cloc && cd ..",
|
|
34
37
|
"peg": "rm -f src/ts/jssm-dot.js && pegjs src/ts/jssm-dot.peg && node src/buildjs/fixparser.js && rm src/ts/jssm-dot.js",
|
|
@@ -49,7 +52,7 @@
|
|
|
49
52
|
"min_iife": "mv dist/jssm.es5.iife.js dist/jssm.es5.iife.nonmin.js && terser dist/jssm.es5.iife.nonmin.js > dist/jssm.es5.iife.js",
|
|
50
53
|
"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",
|
|
51
54
|
"site": "cp src/site/* docs/ && cp -r src/assets docs/assets/",
|
|
52
|
-
"docs": "typedoc src/ts/jssm.ts src/ts/jssm_types.ts --options typedoc-options.js",
|
|
55
|
+
"docs": "typedoc src/ts/jssm.ts src/ts/jssm_types.ts src/ts/jssm_constants.ts src/ts/jssm_error.ts src/ts/jssm_util.ts src/ts/version.ts --options typedoc-options.js",
|
|
53
56
|
"cloc": "cloc --quiet ./src/** --exclude-list-file=./.clocignore --3 --json --out=./coverage/cloc/report_wt.json && cloc --quiet ./src/** --exclude-list-file=./.clocignore --exclude-dir=tests --3 --json --out=./coverage/cloc/report_nt.json && node ./src/buildjs/cloc_report.js",
|
|
54
57
|
"readme": "rm -f ./README.md && node ./src/buildjs/make_readme.js",
|
|
55
58
|
"changelog": "rm -f CHANGELOG.md && rm -f ./src/doc_md/CHANGELOG.md && better_git_changelog -b && cp CHANGELOG.* ./src/doc_md/"
|
|
@@ -102,10 +105,10 @@
|
|
|
102
105
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
103
106
|
"@rollup/plugin-replace": "^4.0.0",
|
|
104
107
|
"@types/jest": "^27.0.2",
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
106
|
-
"@typescript-eslint/parser": "^
|
|
108
|
+
"@typescript-eslint/eslint-plugin": "^5.30.4",
|
|
109
|
+
"@typescript-eslint/parser": "^5.30.4",
|
|
107
110
|
"benny": "^3.7.1",
|
|
108
|
-
"cloc": "^2.
|
|
111
|
+
"cloc": "^2.10.0",
|
|
109
112
|
"coveralls": "^3.0.11",
|
|
110
113
|
"eslint": "^7.32.0",
|
|
111
114
|
"eslint-plugin-fp": "^2.3.0",
|
|
@@ -123,8 +126,8 @@
|
|
|
123
126
|
"terser": "^5.13.1",
|
|
124
127
|
"text_audit": "^0.9.3",
|
|
125
128
|
"ts-jest": "^27.0.7",
|
|
126
|
-
"typedoc": "^0.22.
|
|
127
|
-
"typescript": "^4.
|
|
129
|
+
"typedoc": "^0.22.18",
|
|
130
|
+
"typescript": "^4.7.4",
|
|
128
131
|
"xml2js": "^0.4.23"
|
|
129
132
|
},
|
|
130
133
|
"dependencies": {
|
|
@@ -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;
|
package/typedoc-options.js
CHANGED
|
@@ -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
|
-
|
|
30
|
+
// { title: 'Deno', source: 'todo.md' },
|
|
31
31
|
{ title: 'AWS Lambda', source: 'todo.md' },
|
|
32
32
|
{ title: 'SQL', source: 'todo.md' },
|
|
33
33
|
] },
|