From c146979429ca70c86f68df2ee0a0017157393c21 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 8 Jan 2021 16:23:42 -0600 Subject: [PATCH 1/2] upgrade typescript --- package.json | 2 +- tsconfig.json | 49 ++++++++++++++++++++++++++++--------------------- yarn.lock | 8 ++++---- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 0e90a58a..3efaf11f 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "redux": "^4.0.5", "redux-logger": "^3.0.6", "redux-saga": "^1.1.3", - "typescript": "~3.9.7", + "typescript": "~4.1.3", "web-vitals": "^1.0.1", "xterm": "^4.9.0", "xterm-addon-fit": "^0.4.0", diff --git a/tsconfig.json b/tsconfig.json index 298c6c5a..b6f8d898 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,30 @@ { - "compilerOptions": { - "target": "es2018", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react", - "downlevelIteration": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src", "test"] + "compilerOptions": { + "target": "es2018", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "downlevelIteration": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noFallthroughCasesInSwitch": true + }, + "include": [ + "src", + "test" + ] } diff --git a/yarn.lock b/yarn.lock index 1da8b3a5..7e7af3ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12070,10 +12070,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@~3.9.7: - version "3.9.7" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" - integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== +typescript@~4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" + integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" From 7fc5142924538e488886b0b33710e3408c4480bd Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 8 Jan 2021 17:27:47 -0600 Subject: [PATCH 2/2] fix use of private type in i18n --- src/components/Notification.tsx | 5 ++--- src/reducers/notification.ts | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/Notification.tsx b/src/components/Notification.tsx index 8775285c..7f87cb3f 100644 --- a/src/components/Notification.tsx +++ b/src/components/Notification.tsx @@ -2,8 +2,7 @@ // Copyright (c) 2020 The Pybricks Authors import { IconName, Intent, Toast } from '@blueprintjs/core'; -import { WithI18nProps, withI18n } from '@shopify/react-i18n'; -import { PrimitiveReplacementDictionary } from '@shopify/react-i18n/dist/src/types'; +import { Replacements, WithI18nProps, withI18n } from '@shopify/react-i18n'; import React from 'react'; import { connect } from 'react-redux'; import { Action, Dispatch } from '../actions'; @@ -22,7 +21,7 @@ interface OwnProps { level: NotificationLevel; message?: string; messageId?: MessageId; - replacements?: PrimitiveReplacementDictionary; + replacements?: Replacements; helpUrl?: string; action?: MessageAction; } diff --git a/src/reducers/notification.ts b/src/reducers/notification.ts index d956a4e5..a2cd255e 100644 --- a/src/reducers/notification.ts +++ b/src/reducers/notification.ts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2020 The Pybricks Authors -import { PrimitiveReplacementDictionary } from '@shopify/react-i18n/dist/src/types'; +import { Replacements } from '@shopify/react-i18n'; import { Reducer } from 'react'; import { combineReducers } from 'redux'; import { Action } from '../actions'; @@ -45,7 +45,7 @@ export interface Notification { readonly level: Level; readonly message?: string; readonly messageId?: MessageId; - readonly replacements?: PrimitiveReplacementDictionary; + readonly replacements?: Replacements; readonly helpUrl?: string; readonly action?: MessageAction; } @@ -58,7 +58,7 @@ function append( state: NotificationList, level: Level, messageId: MessageId, - replacements?: PrimitiveReplacementDictionary, + replacements?: Replacements, helpUrl?: string, action?: MessageAction, ): NotificationList {