Vermonster / fhir-kit-client

Node.js FHIR client library
MIT License
173 stars 37 forks source link

Project Missing "json-patch" Dependency? #158

Closed mdhornet90 closed 2 years ago

mdhornet90 commented 3 years ago

Expected Behavior

Running tsc produces no errors.

Actual Behavior

Produces a host of errors, including: node_modules/fhir-kit-client/index.d.ts:2:25 - error TS2307: Cannot find module 'json-patch' or its corresponding type declarations.

Steps to Reproduce the Problem

  1. tsc

Specifications

The project includes @types/json-patch in its devDependencies section but omits json-patch from its dependencies. Is this expected?

bkaney commented 3 years ago

I'm not sure I follow, are you saying we should put @types into dependencies? They are not required during runtime...

mdhornet90 commented 3 years ago

Sorry for the delay, the workaround I had in place can't be used anymore. When I try to use this library in the context of a NestJS project, I see the following errors:

2 import { OpPatch } from 'json-patch';
                          ~~~~~~~~~~~~
node_modules/fhir-kit-client/index.d.ts:264:22 - error TS7051: Parameter has a name but no type. Did you mean 'arg0: string'?

264     requestSigner?: (string, RequestInit) => void
                         ~~~~~~
node_modules/fhir-kit-client/index.d.ts:264:30 - error TS7051: Parameter has a name but no type. Did you mean 'arg1: RequestInit'?

264     requestSigner?: (string, RequestInit) => void

It appears that index.d.ts is included in the final package and I'm not sure if it's intentional. But if it is, the fact that you have @types/json-patch included only as a devDependency seems to be causing some errors when it comes time for TS to compile the project together, and strangely type information is somehow missing for the requestSigner config property.

bkaney commented 2 years ago

I think 1.8.1 should address all these problems. LMK.