From 699426da2e034e228c4e2b4f10b95c23e453a31d Mon Sep 17 00:00:00 2001 From: nd0ut Date: Fri, 28 Oct 2022 11:35:04 +0400 Subject: [PATCH 1/3] fix(upload-client): revert back missing react-native export field --- packages/upload-client/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/upload-client/package.json b/packages/upload-client/package.json index 212d87a75..67980994d 100644 --- a/packages/upload-client/package.json +++ b/packages/upload-client/package.json @@ -5,6 +5,7 @@ "type": "module", "module": "./dist/index.node.js", "browser": "./dist/index.browser.js", + "react-native": "./dist/index.react-native.js", "types": "./dist/types.d.ts", "exports": { ".": { From 16e7f730dfc0c14ff775bd3f9f45e0174f596858 Mon Sep 17 00:00:00 2001 From: nd0ut Date: Fri, 28 Oct 2022 11:36:55 +0400 Subject: [PATCH 2/3] chore: rename `types.d.ts` to `index.d.ts` --- packages/api-client-utils/package.json | 4 ++-- packages/rest-client/package.json | 10 +++++----- packages/upload-client/package.json | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/api-client-utils/package.json b/packages/api-client-utils/package.json index 8e7b9c158..35f11b635 100644 --- a/packages/api-client-utils/package.json +++ b/packages/api-client-utils/package.json @@ -5,7 +5,7 @@ "main": "dist/index.browser.js", "module": "dist/index.browser.js", "browser": "dist/index.browser.js", - "types": "dist/types.d.ts", + "types": "dist/index.d.ts", "sideEffects": false, "files": [ "dist/*" @@ -15,7 +15,7 @@ "test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js", "prebuild": "npm run clean", "build": "npm run build:types && npm run build:compile", - "build:types": "dts-bundle-generator --project tsconfig.dts.json -o dist/types.d.ts src/index.ts", + "build:types": "dts-bundle-generator --project tsconfig.dts.json -o dist/index.d.ts src/index.ts", "build:compile": "rollup -c" }, "repository": { diff --git a/packages/rest-client/package.json b/packages/rest-client/package.json index 573aa6b63..fa8149c7a 100644 --- a/packages/rest-client/package.json +++ b/packages/rest-client/package.json @@ -5,20 +5,20 @@ "type": "module", "module": "./dist/index.node.js", "browser": "./dist/index.browser.js", - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "node": "./dist/index.node.js", "browser": "./dist/index.browser.js", "default": "./dist/index.browser.js" }, "./browser": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/index.browser.js" }, "./node": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/index.node.js" } }, @@ -30,7 +30,7 @@ "test:production": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js", "prebuild": "npm run clean", "build": "npm run build:types && npm run build:compile", - "build:types": "dts-bundle-generator --project tsconfig.dts.json -o dist/types.d.ts src/index.ts", + "build:types": "dts-bundle-generator --project tsconfig.dts.json -o dist/index.d.ts src/index.ts", "build:compile": "rollup -c" }, "repository": { diff --git a/packages/upload-client/package.json b/packages/upload-client/package.json index 67980994d..14abe396b 100644 --- a/packages/upload-client/package.json +++ b/packages/upload-client/package.json @@ -6,24 +6,24 @@ "module": "./dist/index.node.js", "browser": "./dist/index.browser.js", "react-native": "./dist/index.react-native.js", - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "node": "./dist/index.node.js", "browser": "./dist/index.browser.js", "default": "./dist/index.browser.js" }, "./browser": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/index.browser.js" }, "./node": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/index.node.js" }, "./react-native": { - "types": "./dist/types.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/index.react-native.js" } }, @@ -41,7 +41,7 @@ "test:jest": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js", "prebuild": "npm run clean", "build": "npm run build:types && npm run build:compile", - "build:types": "dts-bundle-generator --project tsconfig.dts.json -o dist/types.d.ts src/index.ts", + "build:types": "dts-bundle-generator --project tsconfig.dts.json -o dist/index.d.ts src/index.ts", "build:compile": "rollup -c" }, "repository": { From 4bbf19f1fcacc13b7e32007393bb83bd4c3d989a Mon Sep 17 00:00:00 2001 From: nd0ut Date: Fri, 28 Oct 2022 12:04:47 +0400 Subject: [PATCH 3/3] chore: delay addons/conversion tests --- .../src/api/addons/addonExecutionStatus.test.ts | 5 +++-- .../conversion/documentConversionJobStatus.test.ts | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/rest-client/src/api/addons/addonExecutionStatus.test.ts b/packages/rest-client/src/api/addons/addonExecutionStatus.test.ts index 220943f88..9b7e2bfca 100644 --- a/packages/rest-client/src/api/addons/addonExecutionStatus.test.ts +++ b/packages/rest-client/src/api/addons/addonExecutionStatus.test.ts @@ -6,6 +6,7 @@ import { AddonName } from '../../types/AddonName' import { executeAddon } from './executeAddon' import { ADDONS_UUID } from '../../../test/fixtures' import { copyFileToLocalStorage } from '../file/copyFileToLocalStorage' +import { delay } from '@uploadcare/api-client-utils' describe('addonExecutionStatus', () => { it('should work', async () => { @@ -13,7 +14,7 @@ describe('addonExecutionStatus', () => { { source: ADDONS_UUID, store: false }, testSettings ) - + await delay(1000) const { requestId } = await executeAddon( { addonName: AddonName.AWS_REKOGNITION_DETECT_LABELS, @@ -21,7 +22,7 @@ describe('addonExecutionStatus', () => { }, testSettings ) - + await delay(1000) const response = await addonExecutionStatus( { addonName: AddonName.AWS_REKOGNITION_DETECT_LABELS, diff --git a/packages/rest-client/src/api/conversion/documentConversionJobStatus.test.ts b/packages/rest-client/src/api/conversion/documentConversionJobStatus.test.ts index 4dfe4089d..8c0e38ad9 100644 --- a/packages/rest-client/src/api/conversion/documentConversionJobStatus.test.ts +++ b/packages/rest-client/src/api/conversion/documentConversionJobStatus.test.ts @@ -31,13 +31,11 @@ describe('documentConversionJobStatus', () => { }, testSettings ) - expect( - [ - ConversionStatus.PENDING, - ConversionStatus.PROCESSING, - ConversionStatus.FINISHED - ].includes(response.status) - ).toBeTruthy() + expect([ + ConversionStatus.PENDING, + ConversionStatus.PROCESSING, + ConversionStatus.FINISHED + ]).toContain(response.status) }) it('should throw error if non-200 status received', async () => {