tellerhq / teller-connect-react

React bindings for Teller Connect
6 stars 6 forks source link

Generate type declarations on build #2

Closed andycodesstuff closed 1 year ago

andycodesstuff commented 1 year ago

At the moment the project only outputs JavaScript code and the "types" property isn't specified in the package.json as well. Trying to import the package will result in:

Could not find a declaration file for module 'teller-connect-react'. '/redacted/node_modules/teller-connect-react/dist/teller-connect-react.cjs.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/teller-connect-react` if it exists or add a new declaration (.d.ts) file containing `declare module 'teller-connect-react';`

This PR adds generation of type declarations at compile time by using the postbuild lifecycle script, leaving the build process unchanged. I also updated package.json to point to the newly generated type declarations

stevegraham commented 1 year ago

Finally somebody who knows what they are doing has shown up to save me!