fix: populate source map in transformAngularFile when sourcemap option is enabled#100
Merged
Brooooooklyn merged 1 commit intomainfrom Mar 10, 2026
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1085a7c to
826d807
Compare
826d807 to
2aedad9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…n is enabled The edit-based transform pipeline never generated source maps, leaving `TransformResult.map` as `None` even when `sourcemap: true`. Add `apply_edits_with_sourcemap` that produces a source map by analyzing which original byte ranges survive in the output, and wire it into the AOT, JIT, and no-Angular-classes code paths. - Close #99 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2aedad9 to
5139974
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The edit-based transform pipeline never generated source maps, leaving
TransformResult.mapasNoneeven whensourcemap: true. Addapply_edits_with_sourcemapthat produces a source map by analyzingwhich original byte ranges survive in the output, and wire it into the
AOT, JIT, and no-Angular-classes code paths.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Adds new sourcemap-generation logic tightly coupled to the edit application algorithm; incorrect edge cases (overlapping edits, Unicode offsets) could yield wrong mappings even if output code is correct.
Overview
When
sourcemap: true,transform_angular_filenow returns a populatedTransformResult.mapfor both AOT and JIT pipelines, including the no Angular classes found fast path.This introduces
apply_edits_with_sourcemap, which reuses the existingapply_editsoutput and builds a sourcemap by mapping unchanged source segments (with UTF-16 line/column calculation) to their corresponding positions in the final output. Integration tests were added to assert sourcemap presence/shape across AOT, JIT, external templates, and default-disabled behavior.Written by Cursor Bugbot for commit 5139974. This will update automatically on new commits. Configure here.