mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 08:52:21 +00:00
fix(build): pin package manager guard
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@
|
||||
"lint:oxlint": "oxlint --type-aware --tsconfig ./tsconfig.oxlint.json ./src ./convex ./packages/clawhub/src ./packages/clawhub-admin/src ./packages/schema/src",
|
||||
"llms:check": "bun scripts/generate-llms-txt.ts --check",
|
||||
"llms:generate": "bun scripts/generate-llms-txt.ts",
|
||||
"preinstall": "bunx only-allow bun",
|
||||
"preinstall": "bunx --bun only-allow@1.2.2 bun",
|
||||
"preview": "bun --bun vite preview",
|
||||
"proof:publish": "node scripts/ui-proof-publish.mjs",
|
||||
"proof:ui": "node scripts/ui-proof.mjs",
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/* @vitest-environment node */
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const repoRoot = process.cwd();
|
||||
const packageJson = JSON.parse(readFileSync(join(repoRoot, "package.json"), "utf8")) as {
|
||||
scripts?: Record<string, string>;
|
||||
devDependencies?: Record<string, string>;
|
||||
};
|
||||
const lockfile = readFileSync(join(repoRoot, "bun.lock"), "utf8");
|
||||
|
||||
describe("package configuration", () => {
|
||||
it("pins the preinstall package-manager guard to its declared version", () => {
|
||||
const preinstall = packageJson.scripts?.preinstall ?? "";
|
||||
const match = preinstall.match(/^bunx --bun only-allow@(\d+\.\d+\.\d+) bun$/);
|
||||
|
||||
const version = packageJson.devDependencies?.["only-allow"];
|
||||
|
||||
expect(match?.[1]).toBe(version);
|
||||
expect(lockfile).toContain(`"only-allow": ["only-allow@${version}"`);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user