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

Publish under both CJS and ESM #11

Closed
kaspar-p opened this issue May 18, 2023 · 8 comments · May be fixed by Douhgn/freeCodeCamp#1
Closed

Publish under both CJS and ESM #11

kaspar-p opened this issue May 18, 2023 · 8 comments · May be fixed by Douhgn/freeCodeCamp#1
Labels
💪 phase/solved Post is done

Comments

@kaspar-p
Copy link

For projects that use CJS, it's not possible to use this library. This is a huge usage blocker for some projects.

@blahah
Copy link
Contributor

blahah commented Jun 14, 2023

Fixed in #5 by @crutchcorn (💜 thanks).

Included in release v1.0.3

@blahah blahah closed this as completed Jun 14, 2023
@crutchcorn
Copy link
Contributor

Just as a heads up @blahah I think this issue is requesting the opposite of what my PR did 😅

Currently, as I recall, we publish ESM only, as does the Unified ecosystem.

@kaspar-p
Copy link
Author

Hm. Grumble grumble. I understand that ESM is handy and the way of the future, but there are ways to develop in ESM, and publish in both. I hoped that this could have been the resolution.

@blahah
Copy link
Contributor

blahah commented Jun 15, 2023

Ah, how silly of me. I parsed the issue wrongly. Sorry @kaspar-p (and thank you @crutchcorn for pointing it out).

Hmm, I also did not do a major version bump as I should have when publishing the ESM change.

As to the first problem - @kaspar-p , can you not just depend on the previous CJS version (v1.0.2)? There are no functional changes in the ESM update (and there won't be in the future - this is a very long-term stable module).

As to the second - @crutchcorn, thoughts about whether to unpublish and do a major bump? Unfortunately the module is widely used so it might already have caused a problem for some.

@blahah blahah reopened this Jun 15, 2023
@crutchcorn
Copy link
Contributor

I would see if you're able to unpublish and republish under a 2.0. However, I suspect NPM might disallow it 😅

@blahah
Copy link
Contributor

blahah commented Jun 15, 2023

Ah it was too late - others have already published updates depending on the new version! Lesson learned for future: don't publish when sleep deprived.

@dburles
Copy link

dburles commented Jun 20, 2023

I just read this thread after posting #12. Like I mentioned there, the solution is to publish 1.0.2 (the last CJS version) as version 1.0.4, and then just publish the ESM version as 2.0.0.

@wooorm
Copy link
Member

wooorm commented Aug 9, 2023

Solved, everything’s ESM-only now, no plans to add dual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

Successfully merging a pull request may close this issue.

5 participants