voxpelli / node-connect-pg-simple

A simple, minimal PostgreSQL session store for Express
https://www.npmjs.com/package/connect-pg-simple
MIT License
233 stars 74 forks source link

@types/pg as dev dependency #218

Closed thernstig closed 10 months ago

thernstig commented 2 years ago

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.

kylewillmon commented 10 months ago

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...

thernstig commented 10 months ago

@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.

🤷

kylewillmon commented 10 months ago

In that case, I will open a PR. Thanks

voxpelli commented 10 months ago

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

voxpelli commented 10 months ago

It was moved there in https://github.com/voxpelli/node-connect-pg-simple/commit/7d20257d150b16c27405f2155ca9a1d2f3822259, but I can't find a justification for doing so 🤔

voxpelli commented 10 months ago

Fixed in https://github.com/voxpelli/node-connect-pg-simple/commit/ea4a9c1d26f4a712a59ab198f3192894c16db963

voxpelli commented 10 months ago

Released as 9.0.1