You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm hitting a situation where TS is finding the sqlite3 typings in this package instead of using the sqlite3 typings included in its own package. Is it still necessary to vendor the sqlite3 typings here?
It looks like I do this so I can use the types in my own code. I'll need to investigate how safe it is to remove, as I'd be importing sqlite3 as a dev dep here
Ok, so the reason why it's like that is because I don't want sqlite3 to be a direct dependency of the project, but I still need the types for my own code. I did try to remove the dev dep and tried using a direct sqlite3 reference, but I couldn't get the project to compile properly.
As a compromise, I've copied the types from the sqlite3 project itself. If you have alternative solutions, please open a PR.
Activity
theogravity commentedon Nov 1, 2023
I'm not sure. I'll have to look into it. I did it for reasons that I no longer remember.
benallfree commentedon Nov 1, 2023
https://github.com/TryGhost/node-sqlite3/blob/master/lib/sqlite3.d.ts
theogravity commentedon Nov 1, 2023
Must be new since my defs came from the @types repo according to the comments in the typed file
theogravity commentedon Nov 1, 2023
It looks like I do this so I can use the types in my own code. I'll need to investigate how safe it is to remove, as I'd be importing sqlite3 as a dev dep here
theogravity commentedon Nov 1, 2023
Ok, so the reason why it's like that is because I don't want sqlite3 to be a direct dependency of the project, but I still need the types for my own code. I did try to remove the dev dep and tried using a direct sqlite3 reference, but I couldn't get the project to compile properly.
As a compromise, I've copied the types from the sqlite3 project itself. If you have alternative solutions, please open a PR.
benallfree commentedon Nov 2, 2023
How about
peerDependencies
?https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependencies
theogravity commentedon Nov 2, 2023
That would require the end-user to install it, and again, I don't want it to be a requirement on any side.
benallfree commentedon Nov 2, 2023
I'm sorry, I understand the issue now. You want to keep this with zero dependencies.
Can you say more? Would you like me to take a look?
theogravity commentedon Nov 2, 2023
I tried removing the vendor file completely and only use the dev dep / typescript reference but had issues with typescript trying to compile.
Feel free to experiment to see if you can get it to build and retain type info.