bindings: typecheck the declarations the package ships

This commit is contained in:
funkpower
2026-09-19 18:57:24 -04:00
parent 48600bd90c
commit e9d22ee1fa
3 changed files with 50 additions and 0 deletions
+11
View File
@@ -44,6 +44,17 @@ done
mv "$out/node/catena.js" "$out/node/catena.cjs"
mv "$out/node/catena.d.ts" "$out/node/catena.d.cts"
# The declarations are hand-written, so nothing but a type checker would
# notice them going wrong. Skipped where TypeScript is not installed rather
# than made a dependency of building at all.
if [ -x node_modules/.bin/tsc ]; then
node_modules/.bin/tsc --noEmit --strict --target es2022 --module es2022 \
--moduleResolution bundler typecheck.ts
echo "declarations typecheck"
else
echo "skipped typecheck: npm install --no-save typescript" >&2
fi
sed "s/@VERSION@/$version/" package.json.in >"$out/package.json"
cp README.md "$out/README.md"
cp ../LICENSE "$out/LICENSE"