umpirix/sdk/js/scripts/check-package.mjs
caelum0x 4847e35451 OpenJev: open-source typed decision service
Typed decision/classification service with an in-process gte-small ONNX
embedding engine and lexical fallback, JS/Python SDKs, adapters, and the
otsone model family. Apache-2.0 (sub-packages keep their MIT licenses).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 00:12:36 +03:00

22 lines
730 B
JavaScript

// Runs publint and arethetypeswrong against a fresh `npm pack`.
//
// Done from a script rather than inline so we can drop npm's dry-run flag: when this runs inside
// `npm publish --dry-run` (via prepublishOnly), npm exports npm_config_dry_run=true, the nested
// `npm pack` inside attw then produces no tarball, and attw fails with a confusing ENOENT.
import { spawnSync } from "node:child_process";
const env = { ...process.env };
delete env.npm_config_dry_run;
for (const [cmd, args] of [
["publint", []],
["attw", ["--pack", "."]],
]) {
const result = spawnSync(cmd, args, {
stdio: "inherit",
env,
shell: process.platform === "win32",
});
if (result.status !== 0) process.exit(result.status ?? 1);
}