Fix/v1.11.1 packaging - #27
Conversation
- ship dist/index.d.mts for the ESM entry so moduleResolution node16/nodenext no longer resolves ESM types as CJS (attw FalseCJS) - roll up declarations into a single file (rollupTypes) so the .d.mts copy has no extensionless relative imports - add ./package.json export subpath and sideEffects:false for bundler tree-shaking - narrow react peer range to ^17 || ^18 || ^19 to match the tested and documented support - declare react/react-dom/@types/react-dom as explicit devDependencies instead of relying on pnpm auto-install-peers - drop unused happy-dom (tests run on jsdom), drop declarationMap (dist-only publishes made maps dead-ends), add engines.node >=18
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Updates the library’s packaging and type-distribution setup to correctly publish an ESM-specific .d.mts declaration entry and improve compatibility with moduleResolution: node16/nodenext, while tightening metadata for bundlers and dependencies.
Changes:
- Generate a single rolled-up
dist/index.d.tsand post-build copy it todist/index.d.mts, then point ESM exports’typesto the.d.mts. - Adjust package metadata (
exportssubpath for./package.json,sideEffects: false, React peer range) and devDependencies. - Remove
declarationMapfromtsconfig.jsonand update lockfile accordingly.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Enables rollupTypes in vite-plugin-dts to produce a single bundled declaration file for reliable .d.mts copying. |
| tsconfig.json | Removes declarationMap output from TS config. |
| package.json | Publishes ESM-specific type entry via index.d.mts, adds ./package.json export, sideEffects, engines, and adjusts peers/devDeps. |
| pnpm-lock.yaml | Lockfile updates reflecting dependency graph changes (notably adding @types/react-dom, moving React deps, removing direct happy-dom). |
| CLAUDE.md | Documents the new build output artifacts and type-resolution verification expectations. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "engines": { | ||
| "node": ">=18" | ||
| }, |
Summary
dist/index.d.mtsfor the ESM entry — fixes ESM types being resolved as CJS undermoduleResolution: node16/nodenext(attw "FalseCJS")rollupTypes) so the.d.mtscopy has no extensionless relative imports"./package.json"export subpath and"sideEffects": falsefor bundler tree-shaking>=17to^17 || ^18 || ^19to match tested and documented supportreact/react-dom/@types/react-domas explicit devDependencies (previously relied on pnpm auto-install-peers), drop unusedhappy-dom, addengines.node >= 18@arethetypeswrong/cli --pack: all resolution modes green (node10 / node16 CJS / node16 ESM / bundler)요약
dist/index.d.mts추가 —moduleResolution: node16/nodenext에서 ESM 타입이 CJS로 오인되던 문제(attw "FalseCJS") 해결rollupTypes)해서.d.mts복사본에 확장자 없는 상대 import가 남지 않도록 처리"./package.json"export 서브패스와"sideEffects": false추가 (번들러 트리셰이킹 허용)>=17→^17 || ^18 || ^19로 좁혀서 실제 테스트·문서화된 지원 범위와 일치react/react-dom/@types/react-dom을 devDependencies에 명시 (기존엔 pnpm auto-install-peers에 암묵 의존), 미사용happy-dom제거,engines.node >= 18추가@arethetypeswrong/cli --pack검증: 모든 해석 모드 초록 (node10 / node16 CJS / node16 ESM / bundler)