types / mysql2

Typings for https://github.com/sidorares/node-mysql2
ISC License
41 stars 23 forks source link

npm package name shoud be @types/mysql2 #26

Closed meixg closed 5 years ago

meixg commented 5 years ago

npm package name shoud be @types/mysql2, instead of types/mysql2.

e.g. @types/node, @types/mysql

unional commented 5 years ago

@types/* is used by DefinitelyTyped. This repo were used by typings in the past.

Now you are installing with npm install types/mysql2 because npm supports directly installing from github.

ryanstaniforth commented 5 years ago

@unional This issue is valid. Installing TypeScript definitions should be done from the @types npm scope. The definitions from this repo should be moved to https://github.com/DefinitelyTyped/DefinitelyTyped and this repo should be archived in my opinion.

Never-mind, I just read #13 and I now understand the issue.

borekb commented 5 years ago

I also read #13 but still don't understand 😄. For example, VSCode will suggest to install @types/mysql2 (I know it's a blind guess), maybe there's a reason I'm missing that this needs to be a separate repo but I think it would generally be easier if types were part of the standard DefinitelyTyped machinery.

blakeembrey commented 5 years ago

@borekb I think that's totally fine if all partier are willing to accept. Ultimately it's up to the authors and maintainers how they'd like to maintain the project, and unfortunately, in the past, the DefinitelyTyped mono-repo was hard to be contribute to, be involved with or follow as an unpaid contributor.

borekb commented 5 years ago

Sure, it's ultimately up to the maintainers, I just thought that maybe there's some other reason why this needs to be a separate repo instead of a folder on DefinitelyTyped, and maybe that was even true in 2017 when it was discussed in #13, I don't know.

From my point of view (having a brief experience with contributing to DefinitelyTyped several times over the past few years), I'd say this about it:

In the end, I'm just happy that the types exist 😄. Just wanted to share my experience while we're discussing it.

tlaukkan commented 5 years ago

Would be nice if this followed conventions. Thumbs up for @types/mysql2

bentong95923 commented 3 years ago

I think the maintainer should consider this matter seriously as the package name confuses so many developers (I am obviously one of them) which makes us harder to use this awesome type definition. Fixing this issue will make it so much easier to spread the love from this awesome package to the developers (by the convention command @types/somePackageWithoutTypeDef) in which I believe this is also what the maintainers want!

unional commented 3 years ago

Hi, please let me explain this again.

It is not up to us that this has to be installed through the syntax npm install types/mysql2. That is the syntax provided by npm (and yarn) as a shortcut to install packages directly from github.

This package is not published to npm under the @types scoped packaged because that is controlled by DefinitelyTyped.

The only way to make this into npm install @types/mysql2 is to migrate this to DefinitelyTyped, or the TypeScript team have time to support the distribution model what was proposed since TypeScript 2.0 lands.

As a side note, now (as of 2020), you don't really need this type definition because @sidorares have added typed definitions directly in mysql2.

I have not use mysql2 myself so I don't know about the quality of the type definition provided there,

But using the type definition from the source and improve it there is always the best option.

Cheers. 🍻