refactor: bump up all dependencies, rspress to 2.0.8, migrate from deprecated APIs#121
Conversation
|
thymikee
left a comment
There was a problem hiding this comment.
Code Review
Solid dependency bump PR. The rspress API migrations and biome v2 adjustments look correct. A few issues worth flagging:
1. 🔴 zod v3 → v4: z.record() key/value swap
packages/preset/src/options.ts:55 — The socials schema changed from z.record(z.string().url()) to z.record(z.union([z.url(), z.string()]), z.string()). In zod v4, z.record(keySchema, valueSchema) — so the first arg is the key schema, second is the value schema. Previously socials was Record<string, url> (name → URL). Now it's Record<url | string, string> — the value is just a plain string rather than a validated URL. If the intent was to keep validating URLs as values:
z.record(z.string(), z.url())2. 🔴 @ts-ignore-next-line is not a valid TypeScript directive
packages/theme/src/plugin/theme.ts:16 — // @ts-ignore-next-line doesn't exist in TypeScript. Valid directives are @ts-ignore or @ts-expect-error. This still suppresses the error because TS matches on the @ts-ignore substring, but the -next-line suffix is misleading. Should be just @ts-ignore or preferably @ts-expect-error.
3. 🔴 Biome includes semantics may be inverted
biome.jsonc:23 — The old config was "ignore": ["pnpm-lock.yaml"] (exclude lockfile from formatting). The new config "includes": ["**", "pnpm-lock.yaml"] means "include everything + lockfile" — which includes the lockfile in formatting, the opposite of the old behavior. Should this be "includes": ["**", "!!pnpm-lock.yaml"] with the negation pattern (like the files section uses)?
4. 🔴 CSS selector meaning changed
packages/theme/src/styles/nav.css:144 — The indentation removal changes the selector meaning:
/* Before: descendant selector (.rp-nav-screen-menu-item__left INSIDE .rp-link) */
.rp-nav-screen-menu-item.rp-link[target="_blank"]
.rp-nav-screen-menu-item__left:after {
/* After: compound selector (element matching BOTH classes) */
.rp-nav-screen-menu-item.rp-link[target="_blank"]
.rp-nav-screen-menu-item__left:after {Was this intentional or a formatting artifact?
5. 🟡 CSS variable commented out instead of removed
packages/theme/src/styles/variables.css:132 — --rp-c-text-code is commented out rather than deleted. If it's no longer needed, remove it. If temporarily disabled, a comment explaining why would help.
6. 🟡 Major version bumps worth calling out
@vercel/analyticsv1 → v2 is a peer-facing dependency — consumers may need to update their integration@types/node^22 → ^25 and TypeScript ^5 → ^6 are very large jumps — worth verifying rspress supports TS 6zod^3 → ^4 is a major bump
These should probably be mentioned in the changeset since they affect consumers.
7. ✅ Hooks fix looks correct
packages/theme/src/theme/components/announcement/index.tsx — Moving useState above the early return is the right fix (React hooks must not be called conditionally).
8. ✅ export * ordering is fine
packages/theme/src/plugin/theme.ts — The export * moved before named exports, but named exports still take precedence per ES module semantics.
Summary
This PR:
variables.cssTest plan
CI green, tester working locally.