fix: allow importing packages in ESM context#158
Merged
extremeheat merged 2 commits intoextremeheat:masterfrom Aug 29, 2025
Merged
Conversation
Contributor
Author
|
@extremeheat Except for this everything works great, thank you for your awesome work 🚀 |
Contributor
Author
|
@extremeheat Could you give some feedback on this? We currently need a really ugly workaround. Do you see any downsides in this? |
86b94b0 to
f1205ae
Compare
Contributor
Author
|
Rebased |
mara004
reviewed
Aug 26, 2025
cff649e to
6581357
Compare
Contributor
Author
|
Also referenced #149 since it will fix it. |
6581357 to
18e65f4
Compare
Owner
|
Thanks for the PR! Sorry for the delay in review, I've not had the time to pull and test. All seems passing, so let's merge. |
Owner
|
With respect to the contents of the package.json, since it's an internal directory, we don't have to worry about aligning with the package.json at the root (which is intended for the pythonia side on npm and repo testing here). |
Contributor
Author
|
@extremeheat Thank you, could you maybe also create a release? |
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.
We are using your bridge to interact with locally installed packages in our monorepo, where we are forced to use ES modules. It works very well, but if the root package.json has "type": "module" (which we need), it throws an error across the bridge. With this fix (built and tested locally), the bridge works and allows imports in both commonjs (as before) and ESM contexts.
The package.json is marked as private (so can never be published) as it is shipped with the pypi package. The version also does not matter because of this, the remaining fields (mainly LICENSE) are to avoid warnings.