Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Conversation

ricellis
Copy link
Member

Checklist

  • Tick to sign-off your agreement to the Developer Certificate of Origin (DCO) 1.1
  • Added tests for code changes or test/build only changes
  • Updated the change log file (CHANGES.md|CHANGELOG.md) or test/build only changes
  • Completed the PR template below:

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

  • "No change"

Security and Privacy

  • "No change"

Testing

  • N/A build or packaging only changes

Monitoring and Logging

  • "No change"

@ricellis ricellis added this to the 4.next milestone Feb 28, 2020
@ricellis ricellis self-assigned this Feb 28, 2020
Copy link

@bessbd bessbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, +1

@ricellis ricellis merged commit 8564d08 into master Mar 2, 2020
@ricellis ricellis deleted the pin-nano-8.1 branch March 2, 2020 11:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants