Conversation
🦋 Changeset detectedLatest commit: 4bca5d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe changeset introduces a patch update to the 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/cjs-to-esm.ts`:
- Around line 30-34: The wrapper currently unconditionally sets enumerable: true
for each re-export (in the loop over Object.getOwnPropertyNames(ns)), which
changes non-enumerable source properties like __esModule; fix by reading the
original descriptor via Object.getOwnPropertyDescriptor(ns, k) and use its
enumerable (and configurable) value when calling Object.defineProperty on mod,
and preserve getter/value semantics by either copying the descriptor (but
replacing its get to forward into ns[k] if necessary) or by setting enumerable:
descriptor.enumerable and configurable: descriptor.configurable while keeping a
forwarding getter that returns ns[k]; reference symbols: mod, ns, k,
Object.getOwnPropertyNames, Object.getOwnPropertyDescriptor.
- Around line 22-27: The loop incorrectly skips properties with null/undefined
values due to the guard if (ns[k] == null) continue; which causes modules with
declared-but-uninitialized exports to be misclassified as default-only; remove
that null-check so the iteration always marks hasNamed = true for any property
from Object.getOwnPropertyNames(ns) (except the special keys "__esModule" and
"module.exports") and preserve the existing try/catch and the early return when
ns.__esModule is truthy; update the block around hasNamed, ns, k, and the
__esModule check accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47371a17-6fcc-4c4b-a57e-e68981bf5d75
📒 Files selected for processing (2)
.changeset/shaky-lilies-enter.mdsrc/cjs-to-esm.ts
No description provided.