Skip to content

fix: source map integrity. - #98

Merged
knightedcodemonkey merged 3 commits into
mainfrom
bananas
Jan 3, 2026
Merged

fix: source map integrity.#98
knightedcodemonkey merged 3 commits into
mainfrom
bananas

Conversation

@knightedcodemonkey

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 3, 2026 04:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes source map integrity by implementing source map composition when rewriting module specifiers and file extensions. The changes ensure that source maps are properly preserved and updated through the transformation process, maintaining the mapping back to original TypeScript source files.

Key Changes:

  • Implemented source map composition using @jridgewell libraries to merge rewrite maps with existing TypeScript compiler maps
  • Added proper handling for both JavaScript source maps and TypeScript declaration maps
  • Ensured source map files are renamed alongside their corresponding output files and sourceMappingURL comments are kept in sync

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/resolver.js Core implementation of source map loading, composition, and sourceMappingURL updating for both .js and .d.ts files
test/unit.js Unit tests verifying source map handling for .js and .d.ts rewrites, including cases with and without existing maps
test/integration.js Integration tests validating end-to-end source map composition through the build process, with helper functions for position tracking
test/fixtures/sourcemaps/* Test fixture with TypeScript project configured to generate source maps and declaration maps
test/fixtures/nomaps/* Test fixture with TypeScript project configured without source maps to verify no maps are created when inputs lack them
package.json Version bump to 4.0.0-rc.3 and added dependencies for source map manipulation (magic-string, @jridgewell packages) and upgraded @knighted/module to rc version with source map support
package-lock.json Lock file updates for new and upgraded dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/resolver.js Outdated
Comment thread src/resolver.js Outdated
Comment thread src/resolver.js Outdated
@codecov

codecov Bot commented Jan 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.33775% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.63%. Comparing base (1838b7c) to head (3e92cd8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/resolver.js 99.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   93.21%   93.63%   +0.41%     
==========================================
  Files           4        4              
  Lines        1902     2041     +139     
==========================================
+ Hits         1773     1911     +138     
- Misses        129      130       +1     

☔ 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.

@knightedcodemonkey
knightedcodemonkey merged commit e22d54a into main Jan 3, 2026
6 checks passed
@knightedcodemonkey
knightedcodemonkey deleted the bananas branch January 3, 2026 15:26
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