fix(bundle): preserve root output path#224
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe ChangesresolveBundleDir root path fix
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
The bug this patched was real, but the surrounding code was structurally rewritten by the Windows-support work that landed on main — resolveBundleDir now routes through a stripTrailingSeparators helper that already preserves the root path ('/' and 'C:' both return unchanged), which is why this branch shows as conflicting with nothing left to patch. Closing as already-fixed. If you'd like the credit for the gap you spotted: main has no explicit POSIX-root regression test — a one-line test PR asserting resolveBundleDir('/') === '/' against current main would be welcome. Thanks @Lexiie! |
Summary
Resubmission of #205 after the release-process hiccup closed it without merge.
resolveBundleDir('/')currently strips the trailing slash before checking whether the path is absolute. For the filesystem root path, that turns/into an empty string, so the helper resolves it againstprocess.cwd()instead of preserving/.This PR keeps the root path intact while preserving the existing behavior for ordinary trailing slashes like
/tmp/bundle/.Changes
resolveBundleDir('/')returns/.Verification
rtk vitest run src/lib/bundle.test.ts -t "root|resolveBundleDir"rtk npx eslint src/lib/bundle.ts src/lib/bundle.test.ts --fix-dry-run --format stylishrtk npx eslint src/lib/bundle.ts src/lib/bundle.test.tsrtk npm run typecheckSummary by CodeRabbit
/is no longer reduced to an empty value.