Skip to content

A fast, helpful, and open-source document parser

chore: add the actual script

Clelia (Astra) Bertelli3242a7f8ca4c
diff --git a/scripts/smoke-test-musl-node.sh b/scripts/smoke-test-musl-node.sh
new file mode 100755
index 0000000..d63b480
--- /dev/null
+++ b/scripts/smoke-test-musl-node.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Smoke test for the musl Node binding, run inside node:20-alpine.
+# Assumes the build artifact has been downloaded into /work/packages/node and
+# `npx tsc` has produced dist/.
+set -eux
+
+cd /work/packages/node
+
+ls -la *.node *.so 2>/dev/null || true
+
+# Load the .node file directly first, so any dlopen / relocation error surfaces
+# verbatim. The native.ts loader silently swallows require() failures and
+# reports a generic "Failed to load native module" message, which hides the
+# real cause (missing shared lib, unresolved symbol, etc.).
+node -e '
+ const path = require("node:path");
+ const f = path.resolve("./liteparse.linux-x64-musl.node");
+ console.log("loading", f);
+ require(f);
+ console.log("raw .node loaded ok");
+'
+
+# Then run the actual smoke check through the public lib entry point.
+node -e '
+ import("./dist/lib.js").then(async ({ LiteParse }) => {
+ const p = new LiteParse({ ocrEnabled: false, quiet: true });
+ console.log("Config:", JSON.stringify(p.getConfig()));
+ console.log("Native module loaded successfully");
+ }).catch(e => { console.error(e); process.exit(1); });
+'