cloudant / nodejs-cloudant

Cloudant Node.js client library
Apache License 2.0
255 stars 90 forks source link

Pin Nano to ~8.1.0 to prevent ts API breakage from 8.2.0 #417

Closed ricellis closed 4 years ago

ricellis commented 4 years ago

Checklist

Description

Nano 8.2 has some ts changes that break compatibility with nodejs-cloudant. It is currently an in-range update, but will break ts users, so we need to pin Nano to an older version.

1. Steps to reproduce and the simplest code sample possible to demonstrate the issue

Get latest dependencies and npm test

2. What you expected to happen

Checks to pass

3. What actually happened

types/index.d.ts:109:15 - error TS2430: Interface 'cloudant.ServerScope' incorrectly extends interface 'nano.ServerScope'.
  Types of property 'use' are incompatible.
    Type '(db: string) => DocumentScope<any>' is not assignable to type '<D>(db: string) => DocumentScope<D>'.
      Type 'DocumentScope<any>' is not assignable to type 'DocumentScope<D>'.
        Types of property 'partitionedListAsStream' are incompatible.
          Type '(partitionKey: string, params: DocumentFetchParams) => Request' is not assignable to type '(partitionKey: string, params?: DocumentFetchParams) => Request'.
            Type 'request.Request' is not assignable to type 'request.Request'. Two different types with this name exist, but they are unrelated.
              Types of property 'form' are incompatible.
                Type '{ (): FormData; (form: any): request.Request; }' is not assignable to type '{ (): FormData; (form: any): request.Request; }'. Two different types with this name exist, but they are unrelated.
                  Type 'FormData' is not assignable to type 'FormData'. Two different types with this name exist, but they are unrelated.
                    Property 'getBuffer' is missing in type 'FormData'.

109     interface ServerScope extends nano.ServerScope {
                  ~~~~~~~~~~~

types/index.d.ts:130:15 - error TS2430: Interface 'cloudant.DocumentScope<D>' incorrectly extends interface 'nano.DocumentScope<D>'.
  Types of property 'partitionedListAsStream' are incompatible.
    Type '(partitionKey: string, params: DocumentFetchParams) => Request' is not assignable to type '(partitionKey: string, params?: DocumentFetchParams) => Request'.
      Type 'request.Request' is not assignable to type 'request.Request'. Two different types with this name exist, but they are unrelated.

130     interface DocumentScope<D> extends nano.DocumentScope<D> {
                  ~~~~~~~~~~~~~

Approach

Pin to Nano ~8.1.0 patch versions.

Schema & API Changes

Security and Privacy

Testing

Monitoring and Logging