Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract types from unmock-core to a new package #357

ksaaskil opened this issue Dec 13, 2019 · 0 comments · Fixed by #358

Extract types from unmock-core to a new package #357

ksaaskil opened this issue Dec 13, 2019 · 0 comments · Fixed by #358


Copy link

@ksaaskil ksaaskil commented Dec 13, 2019

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:

  1. Copy an existing (light-weight) package such as unmock-jest to a new package called unmock-types
  2. Update package.json
  3. Update tsconfig.json and its references in the new package
  4. Remove everything from src/ except index.ts and src/__tests__/tsconfig.json
  5. Update in the project root to refer to the package
  6. Update tsconfig.test.json
  7. Add the package as a dependency in the root package.json
  8. Add the package to lint-ts and lint-ts-fix commands in package.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.

@ksaaskil ksaaskil changed the title Extract `unmock-types` from `unmock-core` Extract types from unmock-core to a new package Dec 13, 2019
@carolstran carolstran removed the help wanted label Dec 16, 2019
@ksaaskil ksaaskil added this to In progress in Unmock Road Map Dec 17, 2019
@k4m4 k4m4 closed this in #358 Dec 17, 2019
@ksaaskil ksaaskil moved this from In progress to Done in Unmock Road Map Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.