fix(build): verify radix presence patch before build
This commit is contained in:
parent
62ef88300a
commit
9b169f335f
2 changed files with 34 additions and 1 deletions
|
|
@ -31,7 +31,7 @@
|
||||||
"team:prove-launch-matrix": "pnpm exec vitest run --maxWorkers 1 --minWorkers 1 test/main/services/team/TeamAgentLaunchMatrix.safe-e2e.test.ts",
|
"team:prove-launch-matrix": "pnpm exec vitest run --maxWorkers 1 --minWorkers 1 test/main/services/team/TeamAgentLaunchMatrix.safe-e2e.test.ts",
|
||||||
"team:smoke-changes-real-data": "tsx scripts/team-changes-real-data-smoke.ts",
|
"team:smoke-changes-real-data": "tsx scripts/team-changes-real-data-smoke.ts",
|
||||||
"smoke:codex-runtime-install": "tsx scripts/smoke/codex-runtime-install.ts",
|
"smoke:codex-runtime-install": "tsx scripts/smoke/codex-runtime-install.ts",
|
||||||
"prebuild": "tsx scripts/fetch-pricing-data.ts && pnpm --filter agent-teams-controller build && pnpm --filter agent-teams-mcp build",
|
"prebuild": "node ./scripts/ci/verify-radix-presence-patch.mjs && tsx scripts/fetch-pricing-data.ts && pnpm --filter agent-teams-controller build && pnpm --filter agent-teams-mcp build",
|
||||||
"build": "node --max-old-space-size=8192 ./node_modules/electron-vite/bin/electron-vite.js build",
|
"build": "node --max-old-space-size=8192 ./node_modules/electron-vite/bin/electron-vite.js build",
|
||||||
"stage-runtime": "node ./scripts/stage-runtime.mjs",
|
"stage-runtime": "node ./scripts/stage-runtime.mjs",
|
||||||
"clean:runtime": "node ./scripts/stage-runtime.mjs --clean",
|
"clean:runtime": "node ./scripts/stage-runtime.mjs --clean",
|
||||||
|
|
|
||||||
33
scripts/ci/verify-radix-presence-patch.mjs
Normal file
33
scripts/ci/verify-radix-presence-patch.mjs
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { createRequire } from 'node:module';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { dirname, join } from 'node:path';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
|
const entrypointPath = require.resolve('@radix-ui/react-presence');
|
||||||
|
const packageRoot = dirname(dirname(entrypointPath));
|
||||||
|
const filesToCheck = ['dist/index.js', 'dist/index.mjs'];
|
||||||
|
|
||||||
|
const requiredMarkers = ['nodeCleanupGenerationRef', 'syncNode(null)'];
|
||||||
|
const missing = [];
|
||||||
|
|
||||||
|
for (const relativePath of filesToCheck) {
|
||||||
|
const filePath = join(packageRoot, relativePath);
|
||||||
|
const source = readFileSync(filePath, 'utf8');
|
||||||
|
const missingMarkers = requiredMarkers.filter((marker) => !source.includes(marker));
|
||||||
|
if (missingMarkers.length > 0) {
|
||||||
|
missing.push(`${relativePath}: ${missingMarkers.join(', ')}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missing.length > 0) {
|
||||||
|
console.error(
|
||||||
|
[
|
||||||
|
'@radix-ui/react-presence is installed without the local React 19 Presence patch.',
|
||||||
|
'Run `pnpm install --force` before building production artifacts.',
|
||||||
|
'',
|
||||||
|
...missing,
|
||||||
|
].join('\n')
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue