fix(collab): dedupe yjs so @pcbjam/shared + standalone link ONE instance
Two pnpm workspaces (root globs pcbjam-shared; pcbjam/web has it too) each install yjs, so shared's collab code (kicad-y) and the app's yjs were two physical copies → a Y.Map rejects the other instance's Y types ('Unexpected content type'). resolve.dedupe:['yjs'] in vite + vitest forces a single copy. Not a test-only artifact: the same two copies bundle into the editor and would break collab on doc seed. Full standalone suite now 55/55 (was 47/55).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fe0bec9909
commit
269449da46
2 changed files with 10 additions and 0 deletions
|
|
@ -7,6 +7,11 @@ import { defineConfig } from "vitest/config";
|
|||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: { "@": path.resolve(__dirname, "./src") },
|
||||
// @pcbjam/shared lives in a second pnpm workspace, so without this its `yjs`
|
||||
// and the standalone's `yjs` resolve to two physical copies → a Y.Map from
|
||||
// one instance rejects Y types from the other ("Unexpected content type").
|
||||
// Force a single yjs (it's a shared mutable singleton — instanceof-checked).
|
||||
dedupe: ["yjs"],
|
||||
},
|
||||
test: {
|
||||
environment: "node",
|
||||
|
|
|
|||
Loading…
Reference in a new issue