-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(types): Add types for node modules and various fixing #470
Conversation
Co-authored-by: Carter Snook <cartersnook04@gmail.com>
…o fix/update-types
This really shouldn't do anything differently, but it no longer hangs whenever I bundle types. Not sure if anyone else has this problem but, ehhhh...
|
||
for (let i = 0; i < filesToCat.length; i++) { | ||
const name = filesToCat[i]; | ||
fileContents.push("// " + name + "\n\n" + (await file(resolve(import.meta.dir, name)).text()) + "\n"); |
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.
This was intentionally loading the files in parallel instead of one at a time.
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.
Ah, that makes a bit more sense. Should I just revert this then?
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.
Yeah
fix(types): fix types for stream, timers and util modules
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.
Can you add partial types for net
? (#516)
@@ -0,0 +1,18 @@ | |||
|
|||
declare module 'tty' { |
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.
this one isn't actually implemented
we should do it, but let's not put it in types until it works
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js) | ||
*/ | ||
declare module 'string_decoder' { | ||
class StringDecoder { |
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.
oh man I hope nobody uses this
its going to be so slow
going to merge this then comment out tty one no need to keep it waiting longer |
This PR includes the following changes:
__dirname
and__filename
are now typed, but deprecated to point people to use importentries()
,keys()
, andvalues()
are typed inHeaders
stream()
is typed inBlob
process.isBun
is typedAdded Module Types (listed here, mainly from @types/node)
assert
assert.doesNotMatch
is typed, but is not defined in the polyfillbuffer
toJSON
)new Buffer()
andBuffer.slice
be kept?constants
crypto
domain
events
http
https
os
Platform
,Architecture
andSignals
, not sure whether to have them global, put them in a NodeJS namespace or a BunJS namespaceos
needs to have a better polyfill, since none of the functions seem to give proper informationpunycode
process
querystring
stream
string_decoder
sys
timers
tty
url
util
zlib
supports-color
Missing Buffer methods