Per our discussion and decision at the January PubSweet meeting to add types to PubSweet to share interfaces and by doing that, improve reusability (see also https://gitlab.coko.foundation/pubsweet/types), this adds support for TypeScript to pubsweet-server
.
There are no new types here, other than the automatically inferred ones. New typings will be added in separate MRs.
Nothing changes for consumers of pubsweet-server
, so this is not a breaking change.
As I'm only starting to work with TypeScript, I'd love for TS experts to comment on this setup. Specifically, there are some challenges with a cross-platform monorepo, that you've probably encountered! (e.g. pubsweet-server
's tsc also checks types for e.g. @types/testing-library__dom
, which of course fails in a DOM-less environment, unless you specifically opt out/opt in
@diversemix, @andrei.cioromila and others - thoughts welcome!
To-do:
-
Add a single TS file and make sure tests with Jest still run using TypeScript