-
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
base: main
Are you sure you want to change the base?
Conversation
ae2682c
to
417d553
Compare
417d553
to
bcab832
Compare
lib/utils/streams.js
Outdated
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.
Changes here related to TransformOptions
are not ideal but they were causing an error when emitting declarations via npm run build:types
.
Error was:
lib/utils/streams.js:1:1 - error TS9006: Declaration emit for this file requires using private name '_IReadable' from module '"/Users/andrewchou/GitHub/digidem/styled-map-package/node_modules/@types/readable-stream/index"'. An explicit type annotation may unblock declaration emit.
1 import { Readable, Writable, Transform } from 'readable-stream'
@@ -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
"files": [ | ||
"bin", | ||
"dist", | ||
"lib", | ||
"map-viewer" | ||
], |
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.
not sure about including map-viewer
. anything else to include here otherwise?
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./lib/index.js" | ||
}, | ||
"./reader.js": { | ||
"types": "./dist/reader.d.ts", | ||
"import": "./lib/reader.js" | ||
}, | ||
"./writer.js": { | ||
"types": "./dist/writer.d.ts", | ||
"import": "./lib/writer.js" | ||
}, | ||
"./server.js": { | ||
"types": "./dist/server.d.ts", | ||
"import": "./lib/server.js" | ||
}, | ||
"./style-downloader.js": { | ||
"types": "./dist/style-downloader.d.ts", | ||
"import": "./lib/style-downloader.js" | ||
}, | ||
"./tile-downloader.js": { | ||
"types": "./dist/tile-downloader.d.ts", | ||
"import": "./lib/tile-downloader.js" | ||
}, | ||
"./download.js": { | ||
"types": "./dist/download.d.ts", | ||
"import": "./lib/download.js" | ||
} |
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.
changes here informed by publint, which is generally a super helpful tool that i've become reliant on
Mainly:
.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.