It would be very useful to extract common types from interfaces.ts to a separate lerna package called, for example, unmock-types. Once this is done, one could remove for example unmock-core dependency from unmock-fetch and only depend on unmock-types. Types could then also be used in other projects.
What should be moved:
ISerializedRequest and ISerialzedResponse and everything they depend on
OnSerializedRequest and CreateResponse
How to create a new package:
Copy an existing (light-weight) package such as unmock-jest to a new package called unmock-types
Update package.json
Update tsconfig.json and its references in the new package
Remove everything from src/ except index.ts and src/__tests__/tsconfig.json
It would be very useful to extract common types from interfaces.ts to a separate
lerna
package called, for example,unmock-types
. Once this is done, one could remove for exampleunmock-core
dependency fromunmock-fetch
and only depend onunmock-types
. Types could then also be used in other projects.What should be moved:
ISerializedRequest
andISerialzedResponse
and everything they depend onOnSerializedRequest
andCreateResponse
How to create a new package:
unmock-jest
to a new package calledunmock-types
package.json
tsconfig.json
and itsreferences
in the new packagesrc/
exceptindex.ts
andsrc/__tests__/tsconfig.json
lint-ts
andlint-ts-fix
commands inpackage.json
Instead of copying, you can also use the
lerna
CLI's create command to create the package.For this issue, it's not required to update other packages to use the new package. That can (and should) be done in later PRs.