- cleaned up unused dependencies
- adds missing dependencies that are used in the code
- this should help us be more explicit about the dependencies a package
uses
- because of how the npm scripts were set up, we were running the full
Admin integration tests during the unit tests phase of CI
- this commit renames the majority of `test` to `test:unit` in the
package.json files, and aliases `test` to `test:unit`
- special packages like Admin have no-op'd `test:unit` scripts so we
don't end up running its tests
- if the API controller endpoint is a function, we early return as we
expect the function to handle the response but we still ended up
calculating the headers beforehand, only to be thrown away
- this commit moves the header fetching code down in the flow so it's
only executed when needed
- this doesn't really have a big effect for us because 99% of our
controllers follow the object pattern
refs https://github.com/TryGhost/Toolbox/issues/363
- this API framework is standalone and should be pulled out into a
separate package so we can define its boundaries more clearly, and
promote better testing of smaller parts