stripe-node icon indicating copy to clipboard operation
stripe-node copied to clipboard

Put @types/node as an optional peerDependency

Open QuentinLemCode opened this issue 1 year ago • 1 comments
trafficstars

Hello

This PR put @types/node as an optional peerDependency.

There was already previous attempt to move it to "devDependency" in order to avoid the size overhead of node types for Javascript project or even production builds. https://github.com/stripe/stripe-node/issues/1274

However, this would cause issue because the Typescript compiler wouldn't provide correct error types.

In this PR, the @types/node library as been put in devDependencies and in optional peerDependencies.

This allow :

  • To have the node types available when developing on the stripe-node library
  • To provide correct type error for typescript project using stripe-node (assuming project already have @types/node installed)
  • To remove the @types/node dependency for javascript project (reducing size overhead)

QuentinLemCode avatar Sep 05 '24 13:09 QuentinLemCode