-
Notifications
You must be signed in to change notification settings - Fork 1
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: include type definitions when publishing #21
Conversation
ae2682c
to
417d553
Compare
417d553
to
bcab832
Compare
@@ -80,6 +89,7 @@ | |||
"png-stream": "^1.0.5", | |||
"prettier": "^3.3.3", | |||
"random-bytes-readable-stream": "^3.0.0", | |||
"rimraf": "^4.4.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinned to v4 since >= v5 removes support for node 18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks for this! Removing TransformOptions
to satisfy typescript bothered me, so I fixed that with 31213d0
I don't agree with the change to add .js
to exports. Most modules I have used that define exports do not include an extension, including node modules (e.g. fs/promises
), and I think it leads to some confusion because it suggests a file is being imported. The file extension is required by ESM when importing a local file, but that is a different thing.
nice! I tried something almost similar to that before and it didn't work. glad you fixed it.
Yeah that makes sense. Reverted via 2df05b9 |
One last thing to potentially resolve: what's the best way to expose the types exported from EDIT 1: Hm looks like because of this, I may need to update this PR to emit source files too... EDIT 2: Seems like I could get around this by adding another export, but not really sure if that's "proper": "./types": {
"types": "./dist/types.d.ts"
} |
you can add this line to
Then you can do: import type { SMPStyle } from 'styled-map-package' You could do the same in any of the other export entry points. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
Awesome, seems to work! (see 05084f9) |
Mainly:
BREAKING CHANGE: renames the exports to include theEDIT: reverted.js
suffix at the end, which I believe is generally recommended/idiomatic. Not strictly necessary for us to do so open to reverting that change if preferredShould introduce
noUncheckedIndexedAccess
in the tsconfig as a follow-up but it will lead to errors that will require code changes outside the scope of this PR.