Skip to content

fix: handle windows paths in umd-to-esm#103

Merged
9romise merged 2 commits intonpmx-dev:mainfrom
RYGRIT:fix/plugin-umd-to-esm-clean
Apr 13, 2026
Merged

fix: handle windows paths in umd-to-esm#103
9romise merged 2 commits intonpmx-dev:mainfrom
RYGRIT:fix/plugin-umd-to-esm-clean

Conversation

@RYGRIT
Copy link
Copy Markdown
Collaborator

@RYGRIT RYGRIT commented Apr 10, 2026

The previous replacement only matched /umd/, so Windows paths were not converted to the ESM entry. This caused the built language server to load the wrong jsonc-parser bundle and fail at startup.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8a2c8b43-59d5-413b-8f2f-e30705472692

📥 Commits

Reviewing files that changed from the base of the PR and between a269e87 and 5ca8f8c.

📒 Files selected for processing (1)
  • plugins/umd-to-esm.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/umd-to-esm.ts

📝 Walkthrough

Walkthrough

The plugin’s UMD→ESM path rewriting was refactored to use a new exported helper toEsmPath(resolvedModulePath: string) that replaces the /umd/ segment via a cross‑platform regex (/[/\\]umd[/\\]/) and maps it to esm. Module resolution now computes resolvedModulePath with require.resolve(source) and derives id from toEsmPath(...) instead of an inline string replace. createRequire now uses importer ?? import.meta.url as its argument.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the core issue being fixed: handling Windows paths in the UMD-to-ESM conversion by using cross-platform regex matching instead of hardcoded forward slashes.

✏️ 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 700d15a1-4a58-46fe-af70-cd185d24a28f

📥 Commits

Reviewing files that changed from the base of the PR and between 0d92ae7 and a269e87.

📒 Files selected for processing (1)
  • plugins/umd-to-esm.ts

Comment thread plugins/umd-to-esm.ts Outdated
@9romise 9romise added this pull request to the merge queue Apr 13, 2026
Merged via the queue into npmx-dev:main with commit 780b4a3 Apr 13, 2026
8 checks passed
@RYGRIT RYGRIT deleted the fix/plugin-umd-to-esm-clean branch April 13, 2026 09:45
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.

2 participants