Skip to content

fix: allow importing packages in ESM context#158

Merged
extremeheat merged 2 commits intoextremeheat:masterfrom
Killusions:fix/allow-importing-packages-in-esm-context
Aug 29, 2025
Merged

fix: allow importing packages in ESM context#158
extremeheat merged 2 commits intoextremeheat:masterfrom
Killusions:fix/allow-importing-packages-in-esm-context

Conversation

@Killusions
Copy link
Contributor

@Killusions Killusions commented Jul 9, 2025

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.

@Killusions
Copy link
Contributor Author

@extremeheat Except for this everything works great, thank you for your awesome work 🚀

@Killusions
Copy link
Contributor Author

@extremeheat Could you give some feedback on this? We currently need a really ugly workaround. Do you see any downsides in this?

@Killusions Killusions force-pushed the fix/allow-importing-packages-in-esm-context branch from 86b94b0 to f1205ae Compare August 26, 2025 12:48
@Killusions
Copy link
Contributor Author

Rebased

@Killusions Killusions force-pushed the fix/allow-importing-packages-in-esm-context branch 2 times, most recently from cff649e to 6581357 Compare August 27, 2025 10:32
@Killusions
Copy link
Contributor Author

Also referenced #149 since it will fix it.

@Killusions Killusions force-pushed the fix/allow-importing-packages-in-esm-context branch from 6581357 to 18e65f4 Compare August 27, 2025 10:36
@extremeheat
Copy link
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.

@extremeheat extremeheat merged commit 9c2ff49 into extremeheat:master Aug 29, 2025
3 checks passed
@extremeheat
Copy link
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).

@Killusions
Copy link
Contributor Author

@extremeheat Thank you, could you maybe also create a release?

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