mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 23:47:33 +00:00
Bumps vite to 8.2.2, @vitejs/plugin-react to 6.1.1 and vitest to 4.1.11 together, since plugin-react 6 requires Vite 8. vite.config.ts needed no change: none of the options it sets were dropped. Three follow-ons the bump forced: - Vitest 4 removed the poolOptions CLI flags in favour of a top-level --maxWorkers, so that is now the cap to pass when running the suite. - Vite 6's type entry carried a reference to the Node types, which is how Studio's tsconfig got them without asking. Vite 8 declares @types/node as an optional peer instead, so Studio now depends on it and lists node in its types array, as every sibling package already does. - Vitest 4's vi.fn() types as a callable-or-constructable union, so ReturnType<typeof vi.fn> no longer assigns to a plain callback prop. The affected annotations use Mock, whose default parameter is the old procedure-only shape. Test count is unchanged: 4761 tests across 428 files.
15 lines
652 B
TypeScript
15 lines
652 B
TypeScript
if (typeof globalThis.CSS === "undefined") {
|
|
(globalThis as Record<string, unknown>).CSS = {};
|
|
}
|
|
if (typeof CSS.escape !== "function") {
|
|
CSS.escape = (value: string) => value.replace(/([^\w-])/g, "\\$1");
|
|
}
|
|
|
|
// happy-dom does not implement `window.confirm`. Vitest 3 let `vi.spyOn` invent
|
|
// a missing property; Vitest 4 refuses with "can only spy on a function", so the
|
|
// environment has to supply a real one for the guard tests to replace. Declining
|
|
// is the safe default: no test calls it without stubbing a return value first.
|
|
if (typeof globalThis.confirm !== "function") {
|
|
(globalThis as Record<string, unknown>).confirm = () => false;
|
|
}
|