From 15cc3d20995d53de8f3852265d03a33a1470c24e Mon Sep 17 00:00:00 2001 From: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Date: Tue, 8 Feb 2022 15:19:22 -0500 Subject: [PATCH] Update TypeScript version. (#4463) * Update TypeScript version. This makes the TypeScript version match across other codebases, to facilitate better code sharing. * Fix TS errors after update. Co-authored-by: Dimitri Mitropoulos --- package-lock.json | 6 +++--- package.json | 2 +- packages/insomnia-app/app/account/crypt.ts | 3 +++ .../ui/components/export-requests/request-row.tsx | 1 - packages/insomnia-app/package-lock.json | 9 ++++----- packages/insomnia-app/package.json | 2 +- packages/insomnia-common/package-lock.json | 14 +++++++++++--- packages/insomnia-common/package.json | 1 + packages/insomnia-components/package-lock.json | 6 +++--- packages/insomnia-components/package.json | 2 +- packages/insomnia-config/package-lock.json | 12 +++++++++--- packages/insomnia-config/package.json | 1 + tsconfig.base.json | 1 + 13 files changed, 39 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 597254533..4dc79ddf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16815,9 +16815,9 @@ } }, "typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index 403957eee..d24d69272 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "rimraf": "^3.0.2", "ts-jest": "^26.5.6", "type-fest": "^1.0.2", - "typescript": "^4.2.3" + "typescript": "^4.5.5" }, "dependencies": { "immer": "^9.0.6" diff --git a/packages/insomnia-app/app/account/crypt.ts b/packages/insomnia-app/app/account/crypt.ts index 10dba2280..ce7c9e01b 100644 --- a/packages/insomnia-app/app/account/crypt.ts +++ b/packages/insomnia-app/app/account/crypt.ts @@ -269,6 +269,9 @@ export async function generateKeyPairJWK() { true, ['encrypt', 'decrypt'], ); + if (!pair.publicKey || !pair.privateKey) { + throw new Error('Unexpected error generating a keypair.'); + } return { publicKey: await subtle.exportKey('jwk', pair.publicKey), privateKey: await subtle.exportKey('jwk', pair.privateKey), diff --git a/packages/insomnia-app/app/ui/components/export-requests/request-row.tsx b/packages/insomnia-app/app/ui/components/export-requests/request-row.tsx index 4cf6110f3..8d66fb4e2 100644 --- a/packages/insomnia-app/app/ui/components/export-requests/request-row.tsx +++ b/packages/insomnia-app/app/ui/components/export-requests/request-row.tsx @@ -35,7 +35,6 @@ export class RequestRow extends PureComponent { {isGrpc ? ( ) : ( - // @ts-expect-error -- TSCONVERSION )} {request.name} diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index ced626009..4178ebf33 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -8124,8 +8124,7 @@ "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "optional": true + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" }, "binary-search-tree": { "version": "0.2.5", @@ -22816,9 +22815,9 @@ } }, "typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "uc.micro": { diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 3dc918a4b..c5f7cbb47 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -254,7 +254,7 @@ "ts-node": "^9.1.1", "tsconfig-paths": "^3.9.0", "type-fest": "^1.0.2", - "typescript": "4.2.3", + "typescript": "^4.5.5", "url-loader": "^1.1.2", "val-loader": "^2.1.2", "webpack": "^4.44.1", diff --git a/packages/insomnia-common/package-lock.json b/packages/insomnia-common/package-lock.json index ed9539519..87cc6167c 100644 --- a/packages/insomnia-common/package-lock.json +++ b/packages/insomnia-common/package-lock.json @@ -307,9 +307,9 @@ "dev": true }, "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "typescript-json-schema": { @@ -325,6 +325,14 @@ "ts-node": "^9.1.1", "typescript": "~4.2.3", "yargs": "^16.2.0" + }, + "dependencies": { + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true + } } }, "uri-js": { diff --git a/packages/insomnia-common/package.json b/packages/insomnia-common/package.json index 74a8c66db..0b1bbf6ee 100644 --- a/packages/insomnia-common/package.json +++ b/packages/insomnia-common/package.json @@ -27,6 +27,7 @@ "devDependencies": { "ajv": "^8.6.2", "type-fest": "^1.0.2", + "typescript": "^4.5.5", "typescript-json-schema": "^0.50.1" } } diff --git a/packages/insomnia-components/package-lock.json b/packages/insomnia-components/package-lock.json index 72e77d1d8..4d4fe3862 100644 --- a/packages/insomnia-components/package-lock.json +++ b/packages/insomnia-components/package-lock.json @@ -25539,9 +25539,9 @@ } }, "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "typescript-plugin-styled-components": { diff --git a/packages/insomnia-components/package.json b/packages/insomnia-components/package.json index 2d336c1b0..1c9a0d649 100644 --- a/packages/insomnia-components/package.json +++ b/packages/insomnia-components/package.json @@ -65,7 +65,7 @@ "styled-components": "^4.4.1", "ts-loader": "^8.2.0", "type-fest": "^1.0.2", - "typescript": "^4.2.3", + "typescript": "^4.5.5", "typescript-plugin-styled-components": "^1.5.0", "webpack": "^4.44.1", "webpack-cli": "^3.3.11", diff --git a/packages/insomnia-config/package-lock.json b/packages/insomnia-config/package-lock.json index 08509f8c9..36cbd01e5 100644 --- a/packages/insomnia-config/package-lock.json +++ b/packages/insomnia-config/package-lock.json @@ -4506,9 +4506,9 @@ } }, "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "typescript-json-schema": { @@ -4539,6 +4539,12 @@ "source-map-support": "^0.5.17", "yn": "3.1.1" } + }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true } } }, diff --git a/packages/insomnia-config/package.json b/packages/insomnia-config/package.json index 6e23da021..264f455cc 100644 --- a/packages/insomnia-config/package.json +++ b/packages/insomnia-config/package.json @@ -35,6 +35,7 @@ "devDependencies": { "jest": "^26.6.3", "ts-node": "^10.2.1", + "typescript": "^4.5.5", "typescript-json-schema": "^0.50.1" } } diff --git a/tsconfig.base.json b/tsconfig.base.json index 178ee276d..0325377a1 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -3,6 +3,7 @@ "allowSyntheticDefaultImports": true, "allowUnreachableCode": false, "allowUnusedLabels": false, + "useUnknownInCatchVariables": false, "allowJs": true, "checkJs": true, "declaration": true,