git » sdk » commit fb3172a

Fix cjstoesm invocation

author Stephen Paul Weber
2026-08-17 15:43:22 UTC
committer Stephen Paul Weber
2026-08-17 15:43:22 UTC
parent 87fe71bf5775c3f7b822eaec2687b84091230dd6

Fix cjstoesm invocation

Doesn't work with ts7

Makefile +3 -2
testjs.hxml +1 -1

diff --git a/Makefile b/Makefile
index 6ca4665..7854d32 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 HAXE_PATH=$$HOME/Software/haxe-4.3.1/hxnodejs/12,1,0/src
+CJSTOESM=npx -p typescript@6 -p cjstoesm cjstoesm
 
 .PHONY: all test doc hx-build-dep cpp/libborogove.dso npm/borogove-browser.js npm/borogove.js cpp playwright ci
 
@@ -36,7 +37,7 @@ npm/borogove-browser.js:
 	sed -i '/\$$hx_exports.*|| {};/d' npm/borogove-browser.js
 	sed -i 's/^$$hx_exports[^=]*=\(.*\);$$/export {\1 };/g' npm/borogove-browser.js
 	sed -i 's/"\[Symbol.asyncIterator\]"() {/[Symbol.asyncIterator]() {/g' npm/borogove-browser.js
-	cd npm && npx cjstoesm borogove-browser.js
+	cd npm && $(CJSTOESM) borogove-browser.js
 	sed -i 's/import crypto from "crypto";//g' npm/borogove-browser.js
 	awk -f optional-sqlite.awk npm/borogove-browser.js
 	mv npm/browser-no-sqlite.js npm/borogove-browser.js
@@ -52,7 +53,7 @@ npm/borogove.js:
 	sed -i 's/^$$hx_exports[^=]*=\(.*\);$$/export {\1 };/g' npm/borogove.js
 	sed -i 's/"\[Symbol.asyncIterator\]"() {/[Symbol.asyncIterator]() {/g' npm/borogove.js
 	echo "export { FractionalIndexing_between, FractionalIndexing_BASE_95_DIGITS }" >> npm/borogove.js
-	cd npm && npx cjstoesm borogove.js
+	cd npm && $(CJSTOESM) borogove.js
 	printf "\nexport class borogove_Presence {}\n" >> npm/borogove.d.ts
 
 npm: npm/borogove-browser.js npm/borogove.js borogove/persistence/IDB.js borogove/persistence/MediaStoreCache.js borogove/persistence/sqlite-worker1.mjs
diff --git a/testjs.hxml b/testjs.hxml
index 84c3dc4..8c49a45 100644
--- a/testjs.hxml
+++ b/testjs.hxml
@@ -22,5 +22,5 @@
 -w -WDeprecated
 --js .cache/test.js
 
---cmd npx cjstoesm -s true .cache/test.js
+--cmd npx -p typescript@6 -p cjstoesm cjstoesm -s true .cache/test.js
 --cmd nodejs --disable-warning=ExperimentalWarning .cache/test.js