From 4f8eade3592d704fd0d9f968aeca4810dc710a5c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 17 Jan 2022 22:27:50 +0000 Subject: [PATCH] [TS] Unify Web and Node.JS output so it can be universal --- genbindings.sh | 19 ++++++--------- ts/test/index.html | 6 ++--- ts/test/node.mjs | 7 ++++-- ts/test/tests.mts | 14 ++++++++--- typescript_strings.py | 57 ++++++++++++++++++++++++++----------------- 5 files changed, 62 insertions(+), 41 deletions(-) diff --git a/genbindings.sh b/genbindings.sh index 128a3afb..7fc10bc9 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -6,6 +6,7 @@ usage() { echo "debug should either be true, false, or leaks" echo "debug of leaks turns on leak tracking on an optimized release bianry" echo "android_web should either be true or false and indicates if we build for android (Java) or web (WASM)" + echo "Note that web currently generates the same results as !web (ie Node.JS)" exit 1 } [ "$1" = "" ] && usage @@ -219,17 +220,13 @@ else mv $F.tmp $F done rm imports.mts.part - if [ "$4" = "true" ]; then - tsc - else - tsc --types node --typeRoots . - cp ../$WASM_FILE liblightningjs.wasm - echo Ready to publish! - if [ -x "$(which node)" ]; then - NODE_V="$(node --version)" - if [ "${NODE_V:1:2}" -gt 14 ]; then - node test/node.mjs - fi + tsc --types node --typeRoots . + cp ../$WASM_FILE liblightningjs.wasm + echo Ready to publish! + if [ -x "$(which node)" ]; then + NODE_V="$(node --version)" + if [ "${NODE_V:1:2}" -gt 14 ]; then + node test/node.mjs fi fi fi diff --git a/ts/test/index.html b/ts/test/index.html index 3fc55a6d..60fd523c 100644 --- a/ts/test/index.html +++ b/ts/test/index.html @@ -7,10 +7,10 @@ var test_runner;