Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing module type in package #558

Merged
merged 9 commits into from
Dec 26, 2023
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
npm install
git config --global user.email "stonecypher@users.noreply.github.com"
git config --global user.name "John Haugeland through Github Actions"
node ./src/buildjs/verify_version_bump.js
node ./src/buildjs/verify_version_bump.cjs



Expand Down
149 changes: 145 additions & 4 deletions CHANGELOG.long.md

Large diffs are not rendered by default.

75 changes: 34 additions & 41 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`



* Generated for version 5.90.1 at 10/25/2023, 12:53:01 PM
* Generated for version 5.91.0 at 12/26/2023, 1:35:39 PM

-->
# jssm 5.90.1
# jssm 5.91.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
Expand Down
4 changes: 2 additions & 2 deletions dist/deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`



* Generated for version 5.90.1 at 10/25/2023, 12:53:01 PM
* Generated for version 5.91.0 at 12/26/2023, 1:35:39 PM

-->
# jssm 5.90.1
# jssm 5.91.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
Expand Down
2 changes: 1 addition & 1 deletion dist/deno/jssm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es6/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const version = "5.90.1", build_time = 1698263492649;
const version = "5.91.0", build_time = 1703626449533;
export { version, build_time };
2 changes: 1 addition & 1 deletion dist/jssm.es5.cjs.js → dist/jssm.es5.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jssm.es5.iife.js → dist/jssm.es5.iife.cjs

Large diffs are not rendered by default.

22,427 changes: 22,427 additions & 0 deletions dist/jssm.es5.iife.nonmin.cjs

Large diffs are not rendered by default.

22,422 changes: 22,422 additions & 0 deletions dist/jssm.es5.nonmin.cjs

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions docs/docs/classes/jssm.Machine.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/docs/classes/jssm_error.JssmError.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/docs/modules/jssm.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/docs/modules/jssm_constants.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/docs/modules/jssm_types._internal_.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/modules/jssm_types.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/docs/modules/jssm_util.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/docs/modules/version.html

Large diffs are not rendered by default.

117 changes: 111 additions & 6 deletions docs/docs/pages/CHANGELOG.long.html

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 23 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "jssm",
"version": "5.90.1",
"version": "5.91.0",
"engines": {
"node": ">=10.0.0"
},
"exports": {
"require": "./dist/jssm.es5.cjs.js",
"require": "./dist/jssm.es5.cjs",
"import": "./dist/es6/jssm.js",
"default": "./dist/jssm.es5.cjs.js",
"default": "./dist/jssm.es5.cjs",
"browser": "dist/jssm.es5.iife.js"
},
"autoupdate": {
Expand All @@ -17,52 +17,53 @@
{
"basePath": "/dist",
"files": [
"jssm.es5.cjs.js"
"jssm.es5.cjs"
]
}
]
},
"type": "module",
"description": "A Javascript finite state machine (FSM) with a terse DSL and a simple API. Most FSMs are one-liners. Fast, easy, powerful, well tested, typed with TypeScript, and visualizations. MIT License.",
"main": "dist/jssm.es5.cjs.js",
"main": "dist/jssm.es5.cjs",
"module": "dist/es6/jssm.js",
"browser": "dist/jssm.es5.iife.js",
"browser": "dist/jssm.es5.iife.cjs",
"types": "./jssm.d.ts",
"scripts": {
"jest-unicode-action": "jest unicode-actions.uspec.ts -c jest-unicode.config.js --color --verbose",
"jest-unicode-string": "jest unicode-strings.uspec.ts -c jest-unicode.config.js --color --verbose",
"jest-unicode-atom": "jest unicode-atoms.uspec.ts -c jest-unicode.config.js --color --verbose",
"jest-unicode-string-label": "jest unicode-atoms.uspec.ts -c jest-unicode.config.js --color --verbose",
"jest-unicode-atom-label": "jest unicode-atoms.uspec.ts -c jest-unicode.config.js --color --verbose",
"jest-unicode-action": "jest unicode-actions.uspec.ts -c jest-unicode.config.cjs --color --verbose",
"jest-unicode-string": "jest unicode-strings.uspec.ts -c jest-unicode.config.cjs --color --verbose",
"jest-unicode-atom": "jest unicode-atoms.uspec.ts -c jest-unicode.config.cjs --color --verbose",
"jest-unicode-string-label": "jest unicode-atoms.uspec.ts -c jest-unicode.config.cjs --color --verbose",
"jest-unicode-atom-label": "jest unicode-atoms.uspec.ts -c jest-unicode.config.cjs --color --verbose",
"jest-unicode-full-slow": "npm run jest-unicode-atom && npm run jest-unicode-string && npm run jest-unicode-atom-label && npm run jest-unicode-string-label && jest-unicode-action",
"jest-stoch": "jest -c jest-stoch.config.js --color --verbose",
"jest-dragon": "jest -c jest-dragon.config.js --color --verbose",
"jest-spec": "jest -c jest-spec.config.js --color --verbose",
"jest-stoch": "jest -c jest-stoch.config.cjs --color --verbose",
"jest-dragon": "jest -c jest-dragon.config.cjs --color --verbose",
"jest-spec": "jest -c jest-spec.config.cjs --color --verbose",
"jest": "npm run jest-stoch && npm run jest-spec",
"test": "npm run make && npm run jest",
"clean": "rm -rf dist && rm -rf docs && cd coverage && rm -rf cloc && cd .. && rm -f src/ts/fsl_parser.ts && rm -f src/ts/version.ts && rm -f *.d.ts && mkdir dist && mkdir docs && cd coverage && mkdir cloc && cd ..",
"peg": "rm -f src/ts/fsl_parser.js && pegjs src/ts/fsl_parser.peg && node src/buildjs/fixparser.js",
"peg": "rm -f src/ts/fsl_parser.js && pegjs src/ts/fsl_parser.peg && node src/buildjs/fixparser.cjs",
"make_cjs": "rollup -c",
"make_iife": "rollup -c rollup.config.iife.js",
"make_deno": "rollup -c rollup.config.deno.js && cp dist/es6/*.d.ts dist/deno",
"typescript": "tsc --build tsconfig.json && cp dist/es6/*.d.ts .",
"makever": "node src/buildjs/makever.js",
"makever": "node src/buildjs/makever.cjs",
"make": "npm run clean && npm run makever && npm run peg && npm run typescript && npm run make_iife && npm run make_deno && npm run make_cjs && npm run minify && npm run min_iife && npm run min_cjs && npm run min_deno && rm ./dist/es6/*.nonmin.js",
"eslint": "eslint --color src/ts/jssm.ts src/ts/jssm_types.ts src/ts/tests/*.ts",
"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}",
"vet": "npm run eslint && npm run audit",
"benny": "node ./src/buildjs/benchmark.js",
"benny": "node ./src/buildjs/benchmark.cjs",
"build": "npm run vet && npm run test && npm run site && npm run changelog && npm run docs && npm run cloc && npm run readme",
"clean_bench": "npm run test && npm run benny",
"qbuild": "npm run test",
"ci_build": "npm run vet && npm run test",
"minify": "mv dist/es6/fsl_parser.js dist/es6/fsl_parser.nonmin.js && terser dist/es6/fsl_parser.nonmin.js > dist/es6/fsl_parser.js",
"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",
"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",
"min_iife": "mv dist/jssm.es5.iife.js dist/jssm.es5.iife.nonmin.cjs && terser dist/jssm.es5.iife.nonmin.cjs > dist/jssm.es5.iife.cjs",
"min_cjs": "mv dist/jssm.es5.cjs.js dist/jssm.es5.nonmin.cjs && terser dist/jssm.es5.nonmin.cjs > dist/jssm.es5.cjs",
"min_deno": "terser dist/deno/jssm.deno-esm.nonmin.js > dist/deno/jssm.js",
"site": "cp src/site/* docs/ && cp -r src/assets docs/assets/",
"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",
"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",
"readme": "rm -f ./README.md && node ./src/buildjs/make_readme.js && cp README.md dist/deno",
"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.cjs",
"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.cjs",
"readme": "rm -f ./README.md && node ./src/buildjs/make_readme.cjs && cp README.md dist/deno",
"changelog": "rm -f CHANGELOG.md && rm -f ./src/doc_md/CHANGELOG.md && better_git_changelog -b && cp CHANGELOG.* ./src/doc_md/"
},
"repository": {
Expand Down Expand Up @@ -112,11 +113,11 @@
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-replace": "^4.0.0",
"@types/chalk": "^2.2.0",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^5.30.4",
"@typescript-eslint/parser": "^5.30.4",
"benny": "^3.7.1",
"chalk": "^4.1.2",
"cloc": "^2.10.0",
"eslint": "^7.32.0",
"eslint-plugin-fp": "^2.3.0",
Expand All @@ -129,6 +130,7 @@
"jest": "^27.3.1",
"jest-json-reporter2": "^1.1.0",
"pegjs": "^0.10.0",
"picocolors": "^1.0.0",
"rollup": "^2.72.1",
"semver": "^7.5.4",
"terser": "^5.14.2",
Expand Down
16 changes: 0 additions & 16 deletions src/buildjs/benchmark.js → src/buildjs/benchmark.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@ function TransitionCycleTL100Times() {



const Tl4A = sm`red 'next' => green 'next' => yellow 'next' => red; [red yellow green] ~> off -> red;`;

function ActionCycleTL100Times() {

for (let i=0; i<100; ++i) {
Tl4A.action('next');
Tl4A.action('next');
Tl4A.action('next');
}

}





const Tl4WH = sm`red => green => yellow => red; [red yellow green] ~> off -> red;`;
Tl4WH.set_hook({ from: 'red', to: 'green', handler: () => true, kind: 'hook' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ console.log(
.map(
({ name, diff }) =>
`${name}: ${diff.toFixed(2)}% ${
diff > 0 ? 'faster' : diff < 0 ? 'slower' : 'same'
diff > 0
? 'faster'
: diff < 0
? 'slower'
: 'same'
}`,
)
.join('\n')
Expand Down
37 changes: 20 additions & 17 deletions src/buildjs/cloc_report.js → src/buildjs/cloc_report.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@

const fs = require('fs'),
color = require('cli-color');

const header = s => color.yellow.bold(s),
header2 = s => color.yellow(s),
language = s => color.cyan.bold(s),
data = s => color.white.bold(s),
negative = s => color.red.bold(s),
positive = s => color.white.bold(s),
zero = s => color.xterm(241)(s),
special = s => color.green.bold(s);
const fs = require('fs');
const { readFileSync } = fs;

const pc = require('picocolors');
const { bold, yellow, blue, white, cyan, red, dim } = pc;

const header = s => bold(yellow(s));
const header2 = s => yellow(s);
const language = s => bold(cyan(s));
const data = s => bold(white(s));
const negative = s => bold(red(s));
const positive = s => bold(white(s));
const zzero = s => dim(white(s));
const special = s => bold(green(s));

const hpad_width = 2,
hpad = ' '.repeat(hpad_width),
vsep = '-',
min_head = 5;

const wt = JSON.parse( fs.readFileSync('./coverage/cloc/report_wt.json') ),
nt = JSON.parse( fs.readFileSync('./coverage/cloc/report_nt.json') );
const wt = JSON.parse( readFileSync('./coverage/cloc/report_wt.json') ),
nt = JSON.parse( readFileSync('./coverage/cloc/report_nt.json') );

const uniq = (arr) =>
arr.filter((v, i, a) =>
Expand All @@ -36,7 +39,7 @@ const banned_keys = ['SUM', 'header'],
with_tests = Object.keys(wt).filter( k => (!(banned_keys.includes(k))) ),
no_tests = Object.keys(nt).filter( k => (!(banned_keys.includes(k))) ),
all_keys = uniq( [ ... with_tests, ... no_tests ] ),
key_width = Math.max( ... all_keys.map( k => k.length ) ),
key_width = Math.max( ... all_keys.map( k => k.toLocaleString().length ) ),
wc_width = Math.max( ... with_tests.map(k => fnum(wt[k]?.code ?? 0).length ?? 0) ),
wm_width = Math.max( ... with_tests.map(k => fnum(wt[k]?.comment ?? 0).length ?? 0) ),
wf_width = Math.max( ... with_tests.map(k => fnum(wt[k]?.nFiles ?? 0).length ?? 0) ),
Expand Down Expand Up @@ -71,7 +74,7 @@ function cfnum(n = 0) {
if (typeof(n) !== 'number') { throw new TypeError('cfnum is for numbers'); }
if (n < 0) { return negative(fnum(n)); }
if (n > 0) { return positive(fnum(n)); }
if (n === 0) { return zero(fnum(n)); }
if (n === 0) { return zzero(fnum(n)); }
return special(fnum(n));
}

Expand All @@ -86,7 +89,7 @@ function szcfnum(n = 0, range_max, min = 5, dir = 'right', filler = ' ') {
t = `${filler.repeat(lp)}${f}${filler.repeat(rp)}`;
if (n < 0) { return negative(t); }
if (n > 0) { return positive(t); }
if (n === 0) { return zero(t); }
if (n === 0) { return zzero(t); }
return special(t);
}

Expand All @@ -105,7 +108,7 @@ function heading(tx, w, dir = 'center', filler = ' ') {


const bh = sized_r('', key_width), // blank header the width of the languages
tt = zero(heading('CLOC', key_width, 'right', ' ')),
tt = zzero(heading('CLOC', key_width, 'right', ' ')),
lh = header2('Lines'),
ch = header2('Cmnts'),
fh = header2('Files'),
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/buildjs/makever.js → src/buildjs/makever.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

const fs = require('fs');

const package = JSON.parse(fs.readFileSync('package.json'));
const pkg = JSON.parse(fs.readFileSync('package.json'));

fs.writeFileSync('./src/ts/version.ts', `
const version : string = "${package.version}",
const version : string = "${pkg.version}",
build_time : number = ${new Date().getTime()};

export { version, build_time };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const { execSync } = require('child_process'),
{ readFileSync } = require('fs'),
semver = require('semver');

const package = readFileSync('./package.json'),
pJson = JSON.parse(package),
const pkg = readFileSync('./package.json'),
pJson = JSON.parse(pkg),
priv_version = pJson.version;

const public_version = `${execSync('npm view jssm version')}`.trim(),
Expand Down
Loading
Loading