hospital-sdk icon indicating copy to clipboard operation
hospital-sdk copied to clipboard

Packages referencing each other?

Open amaury1093 opened this issue 5 years ago • 1 comments

The example given in the code is too simplistic.

How may I achieve the following?

// packages/scheduler/package.json
{
  "dependencies": {
    "@hospital-sdk/doctor": "^0.1.0"
  }
}

// packages/scheduler/src/scheduler.ts
import { Doctor } from '@hospital-sdk/doctor';

function notifyDoctor(doctor: Doctor);

If I run yarn build with this setup, the lib/ folder inside packages/schedule will look like:

lib/
  - scheduler/
    - scheduler.js
  - doctor/
    - doctor.js

amaury1093 avatar Dec 05 '19 15:12 amaury1093

@amaurym For this, you will need to use TypeScript's references feature.

See the Ultimate Guide to TypeScript Monorepos article.

PaulRBerg avatar Jun 03 '23 19:06 PaulRBerg