voxpelli/node-connect-pg-simple

@types/pg as dev dependency

thernstig opened this issue ยท 7 comments

Currently in https://github.com/voxpelli/node-connect-pg-simple/blob/main/package.json it has these dependencies:

  "dependencies": {
    "@types/pg": "^8.6.1",
    "pg": "^8.7.1"
  },

@types/pg should rather be a devDependency, as it makes no sense to include that in production code.

I came here to report the same issue, but decided to check first for a possible explanation.

Why was this issue closed as completed? The @types/pg dependency is still present...

@kylewillmon I cannot remember why I decided to do it. Possibly due to that having it as a production dependency means it gets shipped as part of the npm install done by projects, so they can reference types directly e.g. via JSDoc comments as TypeScript or similar. Without having to install @types/pg separately. But I assume having it separate is still wanted.

An even better solution imo would be to bundle the declaration files in this repo and ship them with the installation, as the DefinitelyTyped (@types) repo is often considered a "backup" in case projects do not have their own types. Having types in the actual main project is preferable and recommended afaik.

๐Ÿคท

In that case, I will open a PR. Thanks

The type situations around express session has been a bit messy. I think I added it as a dependency as I normally try to publish types for my modules, but for this module I haven't yet gotten to that

It was moved there in 7d20257, but I can't find a justification for doing so ๐Ÿค”

Fixed in ea4a9c1

Released as 9.0.1