- rm -r structs # TODO: Make the human-types compile
- if [ "$4" = "true" ]; then
- tsc
- else
- tsc --types node --typeRoots .
- cd ..
- if [ -x "$(which node)" ]; then
- NODE_V="$(node --version)"
- if [ "${NODE_V:1:2}" -gt 14 ]; then
- rm -f liblightningjs.wasm
- ln -s $WASM_FILE liblightningjs.wasm
- node ts/test/node.mjs
- fi
+ for F in structs/*; do
+ cat imports.mts.part | grep -v " $(basename -s .mts $F)[ ,]" | cat - $F > $F.tmp
+ mv $F.tmp $F
+ done
+ rm imports.mts.part
+ tsc --types node --typeRoots .
+ cp ../$WASM_FILE liblightningjs.wasm
+ cp ../README.md README.md
+ 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