stripe-node
stripe-node copied to clipboard
Put @types/node as an optional peerDependency
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)