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(types): support importing types into CJS projects #211

Open
moltar opened this issue Apr 27, 2024 · 3 comments
Open

fix(types): support importing types into CJS projects #211

moltar opened this issue Apr 27, 2024 · 3 comments

Comments

@moltar
Copy link

moltar commented Apr 27, 2024

Description

Going from 12.3.0 -> 12.3.1 introduced a breaking change (going ESM).

I had a CJS package that depended on the types from syncpack, and I cannot build it due to this change.

Suggested Solution

Option 1: Publish types separately, e.g. @syncpack/types.

Option 2: Dual publish CJS/ESM package (e.g. using tsup).

Help Needed

N/A

@moltar moltar changed the title Breaking changes ESM is a breaking change Apr 27, 2024
@JamieMason
Copy link
Owner

No worries @moltar,
I did think about this and ultimately went the way I did given syncpack is a CLI rather than a library. It's a fair point though, I'll have a think about what can be done for you, thanks!

@JamieMason JamieMason changed the title ESM is a breaking change fix(types): support importing types into CJS projects May 7, 2024
@JamieMason
Copy link
Owner

In the meantime, I just learned about https://github.com/unjs/jiti which might serve as a workaround.

@moltar
Copy link
Author

moltar commented May 11, 2024

Jiti is a great project. But I think because it uses require, it wouldn't benefit my case, as I am actually just interested in the types. I use these types to build up a config object programmatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants