Skip to content

fix: declare optional peer types#606

Open
cyphercodes wants to merge 1 commit into
unjs:mainfrom
cyphercodes:fix-optional-peer-types
Open

fix: declare optional peer types#606
cyphercodes wants to merge 1 commit into
unjs:mainfrom
cyphercodes:fix-optional-peer-types

Conversation

@cyphercodes
Copy link
Copy Markdown

@cyphercodes cyphercodes commented Jun 6, 2026

Summary

Adds the bundler/runtime packages referenced by unplugin's generated declaration files as optional peer dependencies, including the existing Bun type package.

This lets strict package managers surface the optional type packages instead of leaving consumers with unresolved imports from dist/index.d.mts.

Fixes #605

Test plan

  • pnpm run typecheck
  • pnpm run lint
  • pnpm test
  • git diff --check

Summary by CodeRabbit

  • Chores
    • Updated dependency configuration to designate several dependencies as optional peer dependencies
    • Reorganized dependency catalog management to better reflect optional vs. required dependency relationships

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 6, 2026

Wondering what really moved? Review this PR in Change Stack to inspect semantic changes, definitions, and references.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78c333ff-45b8-4afc-9195-1da73bb3a216

📥 Commits

Reviewing files that changed from the base of the PR and between 94dadfe and 983064a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

Updated dependency configurations to mark build tool types as optional peer dependencies. peerDependenciesMeta in package.json declares build tool peers as optional, and bun-types-no-globals and esbuild are relocated from the dev catalog to the peer catalog in both pnpm-workspace.yaml and referenced in package.json devDependencies and resolutions.

Changes

Optional Peer Dependencies for Build Tools

Layer / File(s) Summary
Mark build tools as optional peer dependencies
package.json, pnpm-workspace.yaml
peerDependenciesMeta entry marks @farmfe/core, @rspack/core, bun-types-no-globals, esbuild, rolldown, rollup, unloader, vite, and webpack as optional. bun-types-no-globals and esbuild are moved from catalogs.dev to catalogs.dev.peer in pnpm-workspace.yaml and referenced via catalog:peer in package.json devDependencies and esbuild resolutions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hopping through dependencies with care so deep,
Build tool types now marked as optional peer,
No stricter resolver's frown will make us weep,
Types cascade down when dev deps appear,
A cleaner config makes the vision clear! 🔧

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: declaring optional peer types for bundler/runtime packages referenced in declaration files.
Linked Issues check ✅ Passed The PR directly addresses issue #605 by declaring bundler/runtime packages (rollup, vite, webpack, esbuild, bun-types-no-globals, rolldown, unloader, @farmfe/core, @rspack/core) as optional peer dependencies in package.json and pnpm-workspace.yaml.
Out of Scope Changes check ✅ Passed All changes are scoped to dependency configuration: marking peer dependencies as optional and relocating catalog entries in pnpm-workspace.yaml, directly aligned with resolving type resolution issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing optional peer

1 participant