@@ -50,6 +50,42 @@ export default defineConfig({
5050 find : / ^ @ e l i z a o s \/ t u i \/ ( .+ ) $ / ,
5151 replacement : path . join ( monorepoRoot , "packages/tui/src/$1" ) ,
5252 } ,
53+ // Explicitly pin react/react-dom to the workspace copies in the bun-managed
54+ // flat hoisted structure. Without this, bun's module resolver can walk up
55+ // to parent directories and pick up a different react version (e.g., a
56+ // react@19.2.6 from ~/.../milaidy/node_modules when the workspace has
57+ // react@19.2.5), which breaks the React hook dispatcher interface.
58+ // These MUST come before ...baseAliases because the base config's
59+ // resolveInstalledPackageRoot("react") walks up to the parent repo and
60+ // picks up react@19.2.6, producing a wrong alias that would otherwise win.
61+ {
62+ find : / ^ r e a c t $ / ,
63+ replacement : path . join (
64+ repoRoot ,
65+ "node_modules/.bun/node_modules/react/index.js" ,
66+ ) ,
67+ } ,
68+ {
69+ find : / ^ r e a c t \/ j s x - r u n t i m e $ / ,
70+ replacement : path . join (
71+ repoRoot ,
72+ "node_modules/.bun/node_modules/react/jsx-runtime.js" ,
73+ ) ,
74+ } ,
75+ {
76+ find : / ^ r e a c t - d o m $ / ,
77+ replacement : path . join (
78+ repoRoot ,
79+ "node_modules/.bun/node_modules/react-dom/index.js" ,
80+ ) ,
81+ } ,
82+ {
83+ find : / ^ r e a c t - d o m \/ c l i e n t $ / ,
84+ replacement : path . join (
85+ repoRoot ,
86+ "node_modules/.bun/node_modules/react-dom/client.js" ,
87+ ) ,
88+ } ,
5389 ...baseAliases ,
5490 {
5591 find : / ^ @ e l i z a o s \/ v a u l t $ / ,
@@ -59,14 +95,6 @@ export default defineConfig({
5995 find : / ^ @ e l i z a o s \/ v a u l t \/ ( .+ ) $ / ,
6096 replacement : path . join ( monorepoRoot , "packages/vault/src/$1" ) ,
6197 } ,
62- {
63- find : / ^ @ e l i z a o s \/ t u i $ / ,
64- replacement : path . join ( monorepoRoot , "packages/tui/src/index.ts" ) ,
65- } ,
66- {
67- find : / ^ @ e l i z a o s \/ t u i \/ ( .+ ) $ / ,
68- replacement : path . join ( monorepoRoot , "packages/tui/src/$1" ) ,
69- } ,
7098 {
7199 find : / ^ @ e l i z a o s \/ p l u g i n - c l i $ / ,
72100 replacement : path . join (
@@ -78,22 +106,6 @@ export default defineConfig({
78106 "index.ts" ,
79107 ) ,
80108 } ,
81- {
82- find : / ^ r e a c t $ / ,
83- replacement : path . join ( repoRoot , "node_modules/react" ) ,
84- } ,
85- {
86- find : / ^ r e a c t \/ j s x - r u n t i m e $ / ,
87- replacement : path . join ( repoRoot , "node_modules/react/jsx-runtime.js" ) ,
88- } ,
89- {
90- find : / ^ r e a c t - d o m $ / ,
91- replacement : path . join ( repoRoot , "node_modules/react-dom" ) ,
92- } ,
93- {
94- find : / ^ r e a c t - d o m \/ c l i e n t $ / ,
95- replacement : path . join ( repoRoot , "node_modules/react-dom/client.js" ) ,
96- } ,
97109 ] ,
98110 } ,
99111 test : {
@@ -105,7 +117,7 @@ export default defineConfig({
105117 hookTimeout : 120_000 ,
106118 server : {
107119 deps : {
108- inline : [ / @ e l i z a o s \/ / ] ,
120+ inline : [ / @ e l i z a o s \/ / , / \/ p l u g i n s \/ p l u g i n - / ] ,
109121 } ,
110122 } ,
111123 include : [ "src/**/*.test.{ts,tsx}" , "test/**/*.test.{ts,tsx}" ] ,
0 commit comments