auth0 / express-jwt

connect/express middleware that validates a JsonWebToken (JWT) and set the req.user with the attributes
MIT License
4.49k stars 444 forks source link

Move @types/jsonwebtoken to devDependencies #324

Open bickelj opened 1 year ago

bickelj commented 1 year ago

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

This prevents dependencies (the usual non-dev dependencies) in downstream TypeScript projects from getting polluted with compile-time-only @types. It should fix https://github.com/auth0/express-jwt/issues/323 without impacting anything else. The build succeeds and passes.

References

https://github.com/auth0/express-jwt/issues/323

Testing

  1. Create a TypeScript project that uses express-jwt in production dependencies and @types/jsonwebtoken in devDependencies.
  2. npm install. Note that there are now @types in prod dependencies by examining package-lock.json.
  3. Try the same again with the changes and note that fewer @types arrive in prod.

Checklist

felixmosh commented 1 year ago

Any update on this one?

bickelj commented 1 year ago

@felixmosh :shrug:

I see I only did 2 of 4 tasks, but I don't know what documentation or tests would need to change, which is why I left them undone.