brianc / node-postgres

PostgreSQL client for node.js.
https://node-postgres.com
MIT License
12.06k stars 1.21k forks source link

Merge TypeScript declarations into repo #1796

Open andywer opened 5 years ago

andywer commented 5 years ago

First of all big kudos out for this great piece of software! I don't know what I would do without it.

Now considering the recent growth of TypeScript usage across the JS / node eco system and the revival of static typing in general: Would you consider a PR that merges the definitely-typed TS declarations into the main repo?

Background

Let me know what you think :)

Happy holidays!

vitaly-t commented 5 years ago

@andywer In the meantime, if proper use of TypeScript is a priority in your project, consider pg-promise, which ships with embedded TypeScript support.

kibertoad commented 5 years ago

To point out a precedent: knex.js did exactly that for 0.16.x version. It doesn't mean that same necessarily makes sense for node-postgres as well, but it might :)

sehrope commented 5 years ago

+1 to adding type definitions into the main repo. A lot more pleasant when there's updates across major versions to have the types updated in tandem.

There aren't many public API changes to pg (yes it's that awesome!) so I doubt it'd be much of a maintenance burden but I'd be happy to contribute to keeping things in sync and reviewing any potential changes.

bendrucker commented 5 years ago

You may find this helpful:

https://github.com/sindresorhus/typescript-definition-style-guide

I was specifically interested in the testing recommendations:

https://github.com/sindresorhus/typescript-definition-style-guide#testing

Maintaining types is usually doable for a maintainer that doesn't use types day to day. But I do think having some form of testing consideration should be mandatory for including types in repos. Separate types have no implied guarantee of fitness for every version but I would be uncomfortable including source code in the repo that's untested.

zuohuadong commented 5 years ago

typescript +1

iamkhush commented 1 year ago

Submitting a PR to that beast of definitely typed monorepo is a nightmare

I would like to re-iterate this . I recently managed to merge a types/pg pr and it was indeed a very slow process. The main maintainers are no longer active it seems.