npm package name shoud be @types/mysql2
meixg opened this issue ยท 8 comments
npm package name shoud be @types/mysql2
, instead of types/mysql2
.
e.g. @types/node, @types/mysql
@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.
@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.
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.
@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.
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:
- The discoverability of DefinitelyTyped is nice. I personally google " DefinitelyTyped" as the first thing, or I just try to type
https://www.npmjs.com/package/@types/<package>
into the browser, often, it works. - It's slightly confusing that this package is not
https://www.npmjs.com/package/@types/mysql2
but is installed asnode_modules/@types/mysql2
. - The unified workflow for contributing to types across various projects is nice. There's also CI and other infrastructure on DefinitelyTyped so for example, I'm automatically pinged to review changes to types that I previously contributed to. It's also good that the team can make system-wide updates of tsconfig to keep things consistent. Types simply feel like a natural part of the ecosystem there.
- The large repo is a PITA. I'm not sure how bad it is today but certainly, cloning a small repo feels much easier.
In the end, I'm just happy that the types exist ๐. Just wanted to share my experience while we're discussing it.
Would be nice if this followed conventions. Thumbs up for @types/mysql2
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!
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. ๐ป