mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
* feat: unify package artifact validation * fix: restrict local artifact output paths * fix: clarify package artifact module names * feat: support pnpm package artifact consumers * fix: preserve local release package installs Keep npm and Bun consumer installs as runnable release artifacts while retaining isolated validation for other packages. Simplify smoke fixtures and avoid redundant release work.
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import { spawnSync } from "node:child_process";
|
|
import { dirname, join, resolve } from "node:path";
|
|
import test from "node:test";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const scriptsDirectory = dirname(fileURLToPath(import.meta.url));
|
|
const repoRoot = resolve(scriptsDirectory, "..");
|
|
|
|
function runScript(name, args) {
|
|
return spawnSync(process.execPath, [join(scriptsDirectory, name), ...args], { cwd: repoRoot, encoding: "utf8" });
|
|
}
|
|
|
|
function assertFailsBeforeWork(result, message) {
|
|
assert.notEqual(result.status, 0);
|
|
assert.match(result.stderr, message);
|
|
assert.doesNotMatch(result.stdout, /generate:models|npm run clean/);
|
|
}
|
|
|
|
test("rejects missing option values before doing work", () => {
|
|
assertFailsBeforeWork(runScript("local-release.mjs", ["--out"]), /--out/);
|
|
assertFailsBeforeWork(runScript("pack-packages.mjs", ["--out", "--force"]), /--out/);
|
|
assertFailsBeforeWork(runScript("use-local-packages.mjs", ["--manifest", "--consumer", "target"]), /--manifest/);
|
|
});
|
|
|
|
test("rejects an unsupported package manager before doing work", () => {
|
|
assertFailsBeforeWork(
|
|
runScript("use-local-packages.mjs", ["--manifest", "missing.json", "--consumer", "target", "--package", "example", "--package-manager", "yarn"]),
|
|
/Unsupported package manager: yarn/,
|
|
);
|
|
});
|