feat(cjs-to-esm): context-local variables → import.meta.*#399
Open
AugustinMauroy wants to merge 5 commits intowip/cjs-to-esmfrom
Open
feat(cjs-to-esm): context-local variables → import.meta.*#399AugustinMauroy wants to merge 5 commits intowip/cjs-to-esmfrom
import.meta.*#399AugustinMauroy wants to merge 5 commits intowip/cjs-to-esmfrom
Conversation
import.meta.*
avivkeller
approved these changes
Mar 21, 2026
Member
There was a problem hiding this comment.
I don't understand this one. This looks like CJS, but it isn't transformed.
Member
Author
There was a problem hiding this comment.
oh I didn't recall why I was requiring this test
maybe we can remove it
Member
|
Why did CI not run on this PR? O.o |
Member
Author
not main base I think |
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Member
Author
|
added jsdocs ! |
brunocroh
reviewed
Mar 22, 2026
Co-Authored-By: Bruno Rodrigues <swe@brunocroh.com>
Member
Author
thanks ! |
JakobJingleheimer
approved these changes
Mar 24, 2026
Comment on lines
+71
to
+75
| if (result) { | ||
| edits.push(result.replace('import.meta.main')); | ||
| } else { | ||
| edits.push(node.replace('import.meta.main')); | ||
| } |
Member
There was a problem hiding this comment.
nit: it's a little difficult to quickly see how these lines are different. I think this would both help with that and DRY things up a tiny bit
Suggested change
| if (result) { | |
| edits.push(result.replace('import.meta.main')); | |
| } else { | |
| edits.push(node.replace('import.meta.main')); | |
| } | |
| edits.push((result || node).replace('import.meta.main')); |
or if result is just potentially nullish
Suggested change
| if (result) { | |
| edits.push(result.replace('import.meta.main')); | |
| } else { | |
| edits.push(node.replace('import.meta.main')); | |
| } | |
| edits.push((result ?? node).replace('import.meta.main')); |
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.
close #348
Note
the base is
feature/cjs-to-esm