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: Fixes exports to correctly export test utils #921

Merged
merged 1 commit into from Jul 20, 2022

Conversation

scalvert
Copy link
Contributor

@scalvert scalvert commented Jul 17, 2022

This change slightly adjusts the exports in this repo's package.json in order to expose the required test utilities to consumers.

While the alias provided in 529bc1f technically works for ESM consumers, it won't work for CJS consumers as that path isn't a real path on disc.

Relates to #920 and tweaks 529bc1f to use correct path.

This change slightly adjusts the exports in this repo's package.json in order to expose the required test utilities to consumers.

While it works to provide the alias within release-it@529bc1f, it's slightly confusing to consumers who expect the export to map to a real path on disc.

Relates to release-it#920 and tweaks release-it@529bc1f to use correct path.
@scalvert
Copy link
Contributor Author

cc @webpro - happy to discuss!

@scalvert
Copy link
Contributor Author

To be very clear, if we use the following path:

import { factory, runTasks } from 'release-it/test/util.js';

This will work fine for ESM consumers since that path is aliased via exports, which they will observe. It won't work for CJS consumers since that's not a real path on disc, and CJS doesn't pay attention to the exports field.

Sorry if I'm restating the obvious :)

@scalvert
Copy link
Contributor Author

@webpro just pinging on this again. Let me know if there's anything I can do to help!

@webpro webpro merged commit a5abf60 into release-it:master Jul 20, 2022
@webpro
Copy link
Collaborator

webpro commented Jul 20, 2022

Alright, let's play it safe :) Thanks @scalvert!

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.

None yet

2 participants