hospital-sdk
hospital-sdk copied to clipboard
Packages referencing each other?
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
@amaurym For this, you will need to use TypeScript's references
feature.
See the Ultimate Guide to TypeScript Monorepos article.