manuelmhtr / countries-and-timezones

Minimalistic library to work with countries and timezones data
MIT License
224 stars 67 forks source link

Remove dodgy JSON import in type definitions #39

Closed benj-dobs closed 2 years ago

benj-dobs commented 2 years ago

Resolves https://github.com/manuelmhtr/countries-and-timezones/issues/38.

This is technically a breaking change, because:

Ideally, we wouldn't remove the JSON import at all, but I can't find a way to get it to work nicely with Rollup. We should discuss this further before merging this, I think.

@kherock @manuelmhtr

kherock commented 2 years ago

I'll take a look at this too. I might try to make a PR upstream to rollup-plugin-dts that allows it to parse json files if resolveJsonModules is set to true. It wouldn't be a very invasive change but I'm unsure if it would be accepted since it's not recommended:

Working with .ts(x) or even .js(x) (when setting allowJs: true) does work, but is not recommended.

benj-dobs commented 2 years ago

Superseded by #40 - I don't think there's anything we need to keep from this PR.