thingco / shared-frontend-libs

0 stars 0 forks source link

Split auth library into two #90

Closed DanCouper closed 2 years ago

DanCouper commented 2 years ago

This splits the authentication library into two: authentication-core and authentication-react. The external API stays the same, but it's easier to test. The former is a peer dependency of the latter.

It clears up a couple of bugs and changes the build/test system slightly. So instead of compiling to JS, it simply packages the library's TS files on publication. Effectively there is no build step.

The react library comes with a test application, it can be run using yarn start.

Tests are run using the uvu test runner rather than Jest. This produces a huge speed increase for the non-react tests. For the React tests, jsdom is required, which significantly slows things down, unfortunately, but they are still quick-ish. The react library uses testdouble for stubbing the auth callbacks.

Bugs fixed: