openclaw/scripts/release-check.ts

57 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-01-18 18:46:18 +00:00
#!/usr/bin/env -S node --import tsx
2025-12-27 19:35:39 +01:00
import { execSync } from "node:child_process";
type PackFile = { path: string };
type PackResult = { files?: PackFile[] };
refactor!: IronClaw v2.0 - external OpenClaw runtime BREAKING CHANGE: Convert repository to IronClaw-only package with strict external dependency on globally installed `openclaw` runtime. ### Changes - Remove entire OpenClaw core source from repository (src/agents/*, src/acp/*, src/commands/*, and related modules) - Implement CLI delegation: non-bootstrap commands now delegate to global `openclaw` binary via external contract - Remove local OpenClaw path resolution from web app; always spawn global `openclaw` binary instead of local scripts - Rename package.json scripts: `pnpm openclaw` → `pnpm ironclaw`, `openclaw:rpc` → `ironclaw:rpc` - Update bootstrap flow to verify and install global OpenClaw when missing - Migrate web workspace/profile logic to align with OpenClaw state paths - Add migration contract tests for stream-json, session subscribe, and profile resolution behaviors - Update build/release pipeline for IronClaw-only artifacts - Update documentation for new peer + global installation model ### Architecture IronClaw is now strictly a frontend/UI/bootstrap layer: - `npx ironclaw` bootstraps OpenClaw (if missing), runs guided onboarding - IronClaw UI serves on localhost:3100 - OpenClaw Gateway runs on standard port 18789 - Communication via stable CLI contracts and Gateway WebSocket protocol only ### Migration Users must have `openclaw` installed globally: npm install -g openclaw Existing IronClaw profiles and sessions remain compatible through gateway protocol stability. Refs: bootstrap_dev_testing, ironclaw_frontend_split, strict-external-openclaw
2026-03-01 16:11:40 -08:00
const requiredPathGroups = [["dist/entry.js", "dist/entry.mjs"], "dist/build-info.json"];
2026-01-30 03:15:10 +01:00
const forbiddenPrefixes = ["dist/OpenClaw.app/"];
2025-12-27 19:35:39 +01:00
function runPackDry(): PackResult[] {
2026-01-15 07:46:51 +00:00
const raw = execSync("npm pack --dry-run --json --ignore-scripts", {
2025-12-27 19:35:39 +01:00
encoding: "utf8",
stdio: ["ignore", "pipe", "pipe"],
2026-01-28 01:35:58 +01:00
maxBuffer: 1024 * 1024 * 100,
2025-12-27 19:35:39 +01:00
});
return JSON.parse(raw) as PackResult[];
}
function main() {
const results = runPackDry();
const files = results.flatMap((entry) => entry.files ?? []);
const paths = new Set(files.map((file) => file.path));
const missing = requiredPathGroups
.flatMap((group) => {
if (Array.isArray(group)) {
return group.some((path) => paths.has(path)) ? [] : [group.join(" or ")];
}
return paths.has(group) ? [] : [group];
})
.toSorted();
2025-12-27 19:35:39 +01:00
const forbidden = [...paths].filter((path) =>
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)),
);
if (missing.length > 0 || forbidden.length > 0) {
if (missing.length > 0) {
console.error("release-check: missing files in npm pack:");
for (const path of missing) {
console.error(` - ${path}`);
}
}
if (forbidden.length > 0) {
console.error("release-check: forbidden files in npm pack:");
for (const path of forbidden) {
console.error(` - ${path}`);
}
}
process.exit(1);
}
console.log("release-check: npm pack contents look OK.");
}
main();