Skip to content

fix: cli inline sourcemap parsing#2439

Merged
andrii-bodnar merged 2 commits intolingui:nextfrom
yslpn:fix/cli-inline-sourcemap-parsing
Feb 9, 2026
Merged

fix: cli inline sourcemap parsing#2439
andrii-bodnar merged 2 commits intolingui:nextfrom
yslpn:fix/cli-inline-sourcemap-parsing

Conversation

@yslpn
Copy link
Contributor

@yslpn yslpn commented Feb 8, 2026

Description

Fix inline sourcemap parsing in the CLI extractor and remove convert-source-map dep.

Changes:

  • parse inline sourcemaps directly in babel.ts;
  • use the last sourceMappingURL when multiple are present;
  • support both charset=utf-8 and charset:utf-8;
  • add tests/fixtures for both cases.

Real-world usage of charset=utf-8: https://grep.app/search?q=sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bcharset%3Dutf-8%3Bbase64

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Feb 8, 2026

@yslpn is attempting to deploy a commit to the Crowdin Team on Vercel.

A member of the Team first needs to authorize it.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.71%. Comparing base (dd43fb0) to head (805aecf).
⚠️ Report is 304 commits behind head on next.

Files with missing lines Patch % Lines
packages/cli/src/api/extractors/babel.ts 95.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             next    #2439       +/-   ##
===========================================
+ Coverage   76.66%   88.71%   +12.04%     
===========================================
  Files          81      116       +35     
  Lines        2083     3288     +1205     
  Branches      532      966      +434     
===========================================
+ Hits         1597     2917     +1320     
+ Misses        375      333       -42     
+ Partials      111       38       -73     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yslpn yslpn marked this pull request as ready for review February 8, 2026 21:52
@timofei-iatsenko
Copy link
Collaborator

Fix inline sourcemap parsing i

What was the issue beside of the charset=utf-8/charset:utf-8 deviation? Just want to have more context here

@timofei-iatsenko timofei-iatsenko self-requested a review February 9, 2026 08:09
@andrii-bodnar andrii-bodnar added this to the v6 milestone Feb 9, 2026
# Conflicts:
#	packages/cli/package.json
#	yarn.lock
@timofei-iatsenko
Copy link
Collaborator

@andrii-bodnar this one is ready

@yslpn
Copy link
Contributor Author

yslpn commented Feb 9, 2026

Fix inline sourcemap parsing i

What was the issue beside of the charset=utf-8/charset:utf-8 deviation? Just want to have more context here

When I added group capturing to the regular expression, I wanted to search for projects to see what the string looked like. Then I discovered there was another way to specify the charset.

@andrii-bodnar andrii-bodnar merged commit 0e3053c into lingui:next Feb 9, 2026
8 of 9 checks passed
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.

3 participants