Commit Graph

9 Commits

Author SHA1 Message Date
Hannah Wolfe
0695f74a65 Fixed some type issues with the api framework
- fixes a bunch of red squiggly lines due to type issues
- this in turn makes it slightly easier to read the API pipeline code
2022-08-23 14:49:29 +01:00
Daniel Lockyer
f51226e5fb Organized package dependencies
- 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
2022-08-18 11:55:49 +02:00
Daniel Lockyer
54aa9f016b Fixed full Admin test suite running during unit tests
- 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
2022-08-15 15:34:52 +02:00
Daniel Lockyer
8574bcd30a Refactored api-framework to use optional chaining
- this makes the code more readable and succinct
2022-08-12 10:16:01 +02:00
Daniel Lockyer
8247242610 Added tests to HTTP module of api-framework
- this file was mostly just missing tests for the other content
  disposition types, which are easily added
- bumps coverage of this file to 100%
2022-08-12 10:16:01 +02:00
Daniel Lockyer
c017174c9a Lazily executed calculating headers in API framework
- 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
2022-08-12 10:16:01 +02:00
Daniel Lockyer
537714cb6c Moved API documentation to api-framework README
- it's better suited here given this package is now the API framework
2022-08-11 17:44:59 +02:00
Daniel Lockyer
348924d431 Updated API framework debug and test names
- these tests have moved from `core/` so the names are no longer
  relevant
2022-08-11 17:44:59 +02:00
Daniel Lockyer
687e68d5de Extracted shared API framework to separate package
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
2022-08-11 17:44:59 +02:00