Commit ffed994
fix(packages/ui,packages/cli,packages/zpress): resolve duplicate React instances in dev server (#90)
* fix(packages/ui,packages/cli,packages/zpress): resolve duplicate React instances in dev server
pnpm's strict isolation caused consumer repos to get two React copies —
one from the consumer's peer dep and one privately installed for @zpress/cli.
Rspress's rspack resolved theme components to a different React instance,
triggering "Invalid hook call" errors and preventing the dev server from loading.
- Add react/react-dom resolve aliases in Rspress builder config
- Move react from dependencies to peerDependencies in @zpress/cli
- Align React peer version in @zpress/kit to ^19.2.5
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(packages/ui): alias react to package directory, not entry file
Rspack uses prefix matching for aliases, so aliasing react to its entry
file (index.js) would break subpath imports like react/jsx-runtime.
Resolve to the package directory instead via react/package.json dirname.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(packages/cli): restore react as direct dependency for ink ecosystem
ink-gradient and other ink transitive deps import react directly.
With pnpm's strict isolation, moving react to peerDependencies breaks
these transitive imports on Vercel. Keep react in dependencies for
runtime resolution; the webpack alias in @zpress/ui handles browser
deduplication independently.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(repo,packages/ui): resolve pnpm strict isolation failures for ink-gradient and react alias
- Add packageExtensions for ink-gradient to declare react as a peer dep
(ink-gradient imports react without declaring it, breaking pnpm strict mode)
- Resolve react alias from @zpress/ui's own context (import.meta.url)
instead of project root, which may not have react as a direct dependency
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(examples/simple): update config to current sections schema
Replace removed keys (link, from, prefix, titleFrom) with their
current equivalents (path, include).
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c02525c commit ffed994
File tree
6 files changed
+48
-55
lines changed- .changeset
- examples/simple
- packages
- ui/src
- zpress
6 files changed
+48
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
| |||
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
133 | 147 | | |
134 | 148 | | |
135 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments