Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: runs again in commonJS and ESM #25

Merged
merged 1 commit into from
May 7, 2023
Merged

Conversation

mheob
Copy link
Owner

@mheob mheob commented May 6, 2023

After the last fix, JavaScript files stopped working.
This is now fixed by splitting the source files into separate commonJS and ESM files.

Resolves #22
Resolves #23

Additional Notes

The following cases are working:

Test in Common JS: 'pnpm exec node foo.js':
{ name: 'pnpm', version: '8.4.0' }

Test in Common JS: 'pnpm exec node foo.cjs':
{ name: 'pnpm', version: '8.4.0' }

Test in ESM JS: 'pnpm exec node foo.mjs':
{ name: 'pnpm', version: '8.4.0' }

Test in TS: 'pnpm exec ts-node foo.ts':
{ name: 'pnpm', version: '8.4.0' }

Test in Common TS: 'pnpm exec ts-node foo.cts':
{ name: 'pnpm', version: '8.4.0' }

I am considering adding unit tests for this script (see #24).

After the last fix, javascript files stopped working.
This is now fixed by splitting the source files into separate commonJS and ESM files.

closed #22, closed #23
@mheob mheob added the bug Something isn't working label May 6, 2023
@mheob mheob marked this pull request as ready for review May 7, 2023 06:06
@kodiakhq kodiakhq bot merged commit a9b4154 into main May 7, 2023
@kodiakhq kodiakhq bot deleted the 22-23-bugs-cannot-import branch May 7, 2023 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: require("used-pm") does not return function [BUG]: Cannot import used-pm from within ESM
1 participant