Winston: Update typescript definitions to 3.0.0-*

Created on 25 Jan 2018  Â·  24Comments  Â·  Source: winstonjs/winston

Not sure if this is maintained by you but the typescript definitions for RC don't yet exist ,
if this is maintained here could you bring these up to date

feature request

Most helpful comment

Typings have been merged and will be included in the next RC (if we do another one) and the final 3.0 release! Please start using them when you can and let me know if I missed anything. Thanks!

All 24 comments

It's a work in progress, should be done soon... can follow the conversation here:
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20418

@DABH would be fine adding them to the repository itself so they can be closely aligned on versioning.

Now that I have access I'll bring the typings over here. I'll add the ones for 3.x; also, it might be nice (though not necessary) to bring the 2.x typings over as well, so everything's out of DefinitelyTyped.

This would definitely be the preferred route

Hey @DABH what's the status?

@nolazybits I'm meeting with @indexzero on Friday and will discuss getting this integrated -- know this has been delayed for a while but expect some updates hopefully this weekend!

logform PR is opened (https://github.com/winstonjs/logform/pull/15); PRs for winston-transport and winston should come soon. Feel free to review/+1 as appropriate.

logform typings got merged in, winston-transport are now in PR (https://github.com/winstonjs/winston-transport/pull/9). Now that the dependencies are done, just need to finish up the actual winston typings... coming soon!

winston-transport typings merged... incidentally if anyone wants to start using/testing the logform / winston-transport typings in their apps that would be much appreciated, it's possible I've missed things. Still working on winston typings but will post an update when I have one

1287

(this depends on https://github.com/winstonjs/winston-transport/pull/11 which isn't merged yet as of writing this, but you can download that revision manually)

Anyone who wants to help test/debug this scores some Internet points ;) Otherwise I'll test things as best I can and hopefully get this merged in soon. There may be problems with what's written, as well as missing things.

I chose to exclude any deprecated methods, since people who are bleeding edge enough to use Typescript surely wouldn't want to use any deprecated methods ;)

Typings have been merged and will be included in the next RC (if we do another one) and the final 3.0 release! Please start using them when you can and let me know if I missed anything. Thanks!

Hi, thank you @DABH. I've just added the latest winston RC as dependency to my project and I'd be glad to use the TS definitions. Is a new RC expected before the final 3.0 or should I take definitions directly from github?

@sveyret The TS defs should be in the latest RC (RC6). Let me know if you don’t see them! I don’t expect them to change significantly between now and the final 3.0 release near the end of the month.

@DABH actually, I don't see this latest RC6 at all… Neither in github releases nor with npm. I tried to install winston@next, but I only have RC5, so I tried [email protected] but the version wasn't found.

My apologies -- we are putting in a few more fixes before pushing RC6 (I suspect it will go out this Friday morning). Meanwhile if you use winston@master you'll get them (a little uglier in your package.json I know...). Sorry about that, thanks for bringing this up!

Thank you for the info. I think I'd better wait for Friday (morning for which continent? :wink:) If it's not ready this week-end, I'll get the branch directly from git.

Aiming for around pushing in around 11 hours but stay tuned ; )

A bit delayed?

Indeed... @indexzero ?

Perhaps just use master for now, it's quite similar to what will be the upcoming official 3.0 release...

Hi @DABH ,
Thank you for your work. I finally installed the master on my project.
I am using the default logger, and the LeveledLogMethod are not defined for it on index.d.ts. As you can see here, npm level methods are concatenated to the listed methods which are added to default winston object.
Btw, even if I don't use them, there also seem that methods handleExceptions and unhandleExceptions are neither defined on the default logger, nor on other ones.
Would you like me to open new issues for that?

I also noticed that there is a new http level (between info and verbose) for npm…

I sent a pull request #1323 to correct this. I did not dare to add (un)handleExceptions because I don't use them and therefore am not sure of me.

Thanks @sveyret for your contribution. We merged #1323 . I've opened #1330 which should address your comments on .(un)handleException. .(un)handleException is a deprecated API so I'm only including the defs for the equivalent non-deprecated .exception.(un)handle. Hope that makes sense. If there is any vocal support for having the deprecated ones in the TS defs I'm open to adding them.

Thank you for merging this change. Your comment on .(un)handleException completely makes sense to me. There is no need to use them if they are deprecated.

Was this page helpful?
0 / 5 - 0 ratings