Skip to content

Commit

Permalink
chore: Upgrade TypeScript to latest version 5.7.2 in /ui
Browse files Browse the repository at this point in the history
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <[email protected]>
  • Loading branch information
peruukki committed Nov 23, 2024
1 parent ccc9aea commit 2c8e585
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@emotion/css": "^11.13.0",
"@emotion/react": "^11.13.3",
"inter-ui": "^3.19.3",
"long": "^5.2.3",
"moment": "^2.29.1",
"protobufjs": "^7.1.1",
"query-string": "^7.1.1",
Expand Down Expand Up @@ -119,7 +120,7 @@
"source-map-loader": "^3.0.0",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.2.5",
"typescript": "^4.9.5",
"typescript": "~5.7.2",
"webpack": "^5.64.4",
"webpack-dev-server": "^4.6.0",
"webpack-manifest-plugin": "^4.0.2",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/utils/timestamp.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import long from 'long';
import Long from 'long';
import { google } from '../protos';

export function toDate(ts: google.protobuf.ITimestamp) {
var seconds: number;
if (ts.seconds instanceof long) {
if (ts.seconds instanceof Long) {
seconds = ts.seconds.low
} else {
seconds = ts.seconds!;
Expand Down
16 changes: 8 additions & 8 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8266,10 +8266,10 @@ log-symbols@^4.1.0:
chalk "^4.1.0"
is-unicode-supported "^0.1.0"

long@^5.0.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61"
integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==
long@^5.0.0, long@^5.2.3:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==

loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
Expand Down Expand Up @@ -11474,10 +11474,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@^4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
typescript@~5.7.2:
version "5.7.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6"
integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==

uc.micro@^2.0.0, uc.micro@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit 2c8e585

Please sign in to comment.