jssm 5.74.0 → 5.76.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.
@@ -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
+ };
@@ -15,13 +15,19 @@ module.exports = {
15
15
 
16
16
  coverageThreshold : {
17
17
  global : {
18
- branches : 1,
19
- functions : 1,
20
- lines : 1,
21
- statements : 1,
18
+ branches : 0,
19
+ functions : 0,
20
+ lines : 0,
21
+ statements : 0,
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/stoch', outputFile: 'metrics.json', fullOutput: false }],
30
+ // ['jest-json-reporter2', { outputDir: './coverage/stoch', outputFile: 'extended-metrics.json', fullOutput: true }],
31
+ ]
26
32
 
27
33
  };
package/jssm_types.d.ts CHANGED
@@ -1,19 +1,22 @@
1
1
  declare type StateType = string;
2
2
  declare type JssmSuccess = {
3
3
  success: true;
4
- };
4
+ }; /** Composite type indicating success as part of a result */
5
5
  declare type JssmFailure = {
6
6
  success: false;
7
7
  error: any;
8
- };
8
+ }; /** Composite type indicating an error, and why, as part of a result */
9
9
  declare type JssmIncomplete = {
10
10
  success: 'incomplete';
11
- };
12
- declare type JssmResult = JssmSuccess | JssmFailure | JssmIncomplete;
11
+ }; /** Composite type indicating that a result isn't finished */
12
+ declare type JssmResult = JssmSuccess | JssmFailure | JssmIncomplete; /** Composite type composing whether or not a result was successful */
13
13
  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,7 +255,7 @@ declare type HookComplexResult<mDT> = {
252
255
  state?: StateType;
253
256
  data?: mDT;
254
257
  };
255
- 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 */
256
259
  declare type HookContext<mDT> = {
257
260
  data: mDT;
258
261
  };
@@ -261,4 +264,4 @@ declare type PostHookHandler<mDT> = (hook_context: HookContext<mDT>) => void;
261
264
  declare type JssmErrorExtendedInfo = {
262
265
  requested_state?: StateType | undefined;
263
266
  };
264
- 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
- export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name };
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.74.0",
3
+ "version": "5.76.0",
4
4
  "engines": {
5
5
  "node": ">=10.0.0"
6
6
  },
@@ -28,15 +28,12 @@
28
28
  "browser": "dist/jssm.es5.iife.js",
29
29
  "types": "./jssm.d.ts",
30
30
  "scripts": {
31
- "jest-spec": "jest -c jest-spec.config.js --color --verbose",
32
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",
33
34
  "jest": "npm run jest-spec",
34
- "jjest": "npm run jest-spec && npm run jest-stoch",
35
35
  "test": "npm run make && npm run jest",
36
- "rmgenerated": "rm -f src/ts/jssm-dot.ts && rm -f src/ts/version.ts && rm -f *.d.ts",
37
- "removedir": "rm -rf dist && rm -rf docs",
38
- "createdir": "mkdir dist && mkdir docs",
39
- "clean": "npm run removedir && npm run rmgenerated && npm run createdir",
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 ..",
40
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",
41
38
  "make_cjs": "rollup -c",
42
39
  "make_iife": "rollup -c rollup.config.iife.js",
@@ -47,7 +44,7 @@
47
44
  "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
45
  "vet": "npm run eslint && npm run audit",
49
46
  "benny": "node ./src/buildjs/benchmark.js",
50
- "build": "npm run vet && npm run test && npm run site && npm run changelog && npm run docs && npm run readme",
47
+ "build": "npm run vet && npm run test && npm run site && npm run changelog && npm run docs && npm run cloc && npm run readme",
51
48
  "clean_bench": "npm run test && npm run benny",
52
49
  "qbuild": "npm run test",
53
50
  "ci_build": "npm run vet && npm run test",
@@ -55,8 +52,9 @@
55
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",
56
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",
57
54
  "site": "cp src/site/* docs/ && cp -r src/assets docs/assets/",
58
- "docs": "typedoc src/ts/jssm.ts --options typedoc-options.js",
59
- "readme": "rm ./README.md && node ./src/buildjs/make_readme.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",
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",
57
+ "readme": "rm -f ./README.md && node ./src/buildjs/make_readme.js",
60
58
  "changelog": "rm -f CHANGELOG.md && rm -f ./src/doc_md/CHANGELOG.md && better_git_changelog -b && cp CHANGELOG.* ./src/doc_md/"
61
59
  },
62
60
  "repository": {
@@ -107,9 +105,10 @@
107
105
  "@rollup/plugin-node-resolve": "^13.3.0",
108
106
  "@rollup/plugin-replace": "^4.0.0",
109
107
  "@types/jest": "^27.0.2",
110
- "@typescript-eslint/eslint-plugin": "^4.13.0",
111
- "@typescript-eslint/parser": "^4.13.0",
108
+ "@typescript-eslint/eslint-plugin": "^5.30.4",
109
+ "@typescript-eslint/parser": "^5.30.4",
112
110
  "benny": "^3.7.1",
111
+ "cloc": "^2.9.0",
113
112
  "coveralls": "^3.0.11",
114
113
  "eslint": "^7.32.0",
115
114
  "eslint-plugin-fp": "^2.3.0",
@@ -127,12 +126,14 @@
127
126
  "terser": "^5.13.1",
128
127
  "text_audit": "^0.9.3",
129
128
  "ts-jest": "^27.0.7",
130
- "typedoc": "^0.22.15",
131
- "typescript": "^4.6.4"
129
+ "typedoc": "^0.22.18",
130
+ "typescript": "^4.7.4",
131
+ "xml2js": "^0.4.23"
132
132
  },
133
133
  "dependencies": {
134
- "circular_buffer_js": "^1.10.0",
135
134
  "better_git_changelog": "^1.6.1",
136
- "reduce-to-639-1": "^1.0.4"
135
+ "circular_buffer_js": "^1.10.0",
136
+ "reduce-to-639-1": "^1.0.4",
137
+ "typedoc-plugin-missing-exports": "^0.23.0"
137
138
  }
138
139
  }