CodeFoodPixels / node-promise-mysql

A wrapper for mysqljs/mysql that wraps function calls with Bluebird promises.
MIT License
338 stars 64 forks source link

chore(package): Move two dependencies to devDeps #108

Closed enapupe closed 5 years ago

enapupe commented 5 years ago

Hi, it seems you have two dependencies listed NOT as devDependencies. This is causing my lambda (serverless) package to copy types other unrelated stuff. I hope this PR doesn't have any side-effects and can be released as a patch very soon.

Thanks!

CodeFoodPixels commented 5 years ago

@move-zig Can you have a look at this? I'm unsure about the types stuff

If I remember correctly, we need them because our type file uses them.

move-zig commented 5 years ago

@lukeb-uk that's what I remember too. Here is the pull request that moved them from devDependencies to dependencies: #71

@enapupe what exactly is getting pulled in? More than @types/mysql and @types/bluebird?

enapupe commented 5 years ago

I think the only relevant question is: Do you expose anything on this library's API that's typed by any of the two packages touched on the pr?

In other words, as a developer consuming node-promise-mysql, am I going to be directly consuming an API which types come from @types/mysql and @types/bluebird? Or are these types used only internally for development and are not exposed on the final API?

Also, on the specific motivation behind this PR: I can circumvent this issue with a simple ignore rule so it's not a big deal.

move-zig commented 5 years ago

A developer consuming node-promise-mysql would indeed directly consume the types in @types/bluebird and @types/mysql.

enapupe commented 5 years ago

Ok, just out of curiosity, could you reference a line that exposes it? Many thanks

move-zig commented 5 years ago

https://github.com/lukeb-uk/node-promise-mysql/blob/master/index.d.ts line 3:

export function createConnection(connectionUri: string | mysql.ConnectionConfig): Bluebird<Connection>;

A developer calling createConnection might pass in an object of type mysql.ConnectionConfig (from @types/mysql) and would expect back a bluebird-type promise (described in @types/bluebird).

enapupe commented 5 years ago

Doh, I had forgotten about the .d.ts file! Many thanks