fix(deps): update temporal-polyfill to v1 and fix CJS build#528
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe CommonJS build externalizes ChangesTemporal runtime configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/polyfill-check.test.js (1)
15-29: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider handling
execSyncexceptions fornpm ls.The
npm lscommand exits with a non-zero status if there are any peer dependency issues or missing packages anywhere in the tree. This causesexecSyncto throw an error, which will fail this test even iftemporal-polyfillis correctly installed.
Consider either reading the version directly frompackage.jsonor handling the potential exception fromexecSyncto safely parse the output.♻️ Proposed refactor to safely read the version
it('should use temporal-polyfill v1 as a direct dependency', () => { - const result = execSync('npm ls temporal-polyfill --json', {encoding: 'utf8'}); - const data = JSON.parse(result); + let result; + try { + result = execSync('npm ls temporal-polyfill --json', {encoding: 'utf8'}); + } catch (error) { + result = error.stdout?.toString() || '{}'; + } + const data = JSON.parse(result); const resolved = data.dependencies?.['temporal-polyfill'];🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/polyfill-check.test.js` around lines 15 - 29, Update the “should use temporal-polyfill v1 as a direct dependency” test to avoid failing solely because npm ls exits non-zero for unrelated dependency issues. Prefer reading temporal-polyfill’s installed package metadata directly, or catch execSync errors and safely parse any available stdout before asserting the resolved v1 version; leave the ESM import test unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/polyfill-check.test.js`:
- Around line 15-29: Update the “should use temporal-polyfill v1 as a direct
dependency” test to avoid failing solely because npm ls exits non-zero for
unrelated dependency issues. Prefer reading temporal-polyfill’s installed
package metadata directly, or catch execSync errors and safely parse any
available stdout before asserting the resolved v1 version; leave the ESM import
test unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e7c7ca44-81c0-41f3-8d26-e80e60a594a4
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
build/build-cjs.jspackage.jsontest/polyfill-check.test.js
1f3d11d to
9212175
Compare
The new
temporal-polyfillv1 release dropped CJS support, which broke the CJS build (ERR_PACKAGE_PATH_NOT_EXPORTED). I fixed it by bundling it into node-ical.cjs instead of leaving it external. rrule-temporal stays external.No user-facing changes - public API (Date objects, CJS/ESM entry points) stays the same. v1 does bring the polyfill up to the latest Temporal spec with a few DST/duration edge-case fixes upstream.
Also added tests so this doesn't regress silently again.
Summary by CodeRabbit
Bug Fixes
Tests