Fix @purduehackers/time/react
exports
#14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TIL after publishing
v0.6.0
that TypeScript didn't supportexports
inpackage.json
until very recently, and many projects wouldn't be able to use@purduehackers/time/react
without upgrading TypeScript and changingmoduleResolution
tonodenext
orbundler
in their tsconfig.I missed this during local testing because I tested it with
create-next-app
, which setmoduleResolution
tobundler
by default. But it started breaking on some of my older projects, and in one of them when I setmoduleResolution
tobundler
, it broke another package that had exported its types incorrectly & didn't work withbundler
🤦♂️This PR attempts to make
@purduehackers/time/react
compatible with whatevermoduleResolution
your heart desires. Thank you to this article for the help.It works when testing locally so I'm going to merge, but I'm not sure if it'll break again on some of my older projects. If it's broken I'll fix it. The great thing about writing a PR that nobody will read for an npm package that nobody will use is that I can just break shit and cut a new release whenever I want!