bump to typescript 5.6

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-03-07 14:31:44 +01:00
parent b084c30ff8
commit 31731b0a80
8 changed files with 100 additions and 53 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': minor
---
Upgraded the TypeScript version in the template to `5.8`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Internal refactor to avoid `expiry-map` dependency.
@@ -0,0 +1,15 @@
diff --git a/main.d.ts b/main.d.ts
index 6b9a8d05d61821a7e7dc831a52a9f7b505bfee42..1010bb5352d975a171a4019768ff6f6f2967c301 100644
--- a/main.d.ts
+++ b/main.d.ts
@@ -1,7 +1,7 @@
-import { ASTNode, Type, AnyType, Field } from "./lib/types";
-import { NodePath } from "./lib/node-path";
+import { ASTNode, type Type, AnyType, Field } from "./lib/types";
+import { type NodePath } from "./lib/node-path";
import { namedTypes } from "./gen/namedTypes";
-import { builders } from "./gen/builders";
+import { type builders } from "./gen/builders";
import { Visitor } from "./gen/visitor";
declare const astNodesAreEquivalent: {
(a: any, b: any, problemPath?: any): boolean;
+4 -2
View File
@@ -103,7 +103,9 @@
"@material-ui/pickers@^3.3.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch"
"jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch",
"ast-types@^0.14.1": "patch:ast-types@npm%3A0.14.2#./.yarn/patches/ast-types-npm-0.14.2-43c4ac4b0d.patch",
"ast-types@0.14.2": "patch:ast-types@npm%3A0.14.2#./.yarn/patches/ast-types-npm-0.14.2-43c4ac4b0d.patch"
},
"dependencies": {
"@backstage/errors": "workspace:^",
@@ -145,7 +147,7 @@
"sloc": "^0.3.1",
"sort-package-json": "^2.8.0",
"typedoc": "^0.27.6",
"typescript": "~5.2.0"
"typescript": "~5.6.0"
},
"packageManager": "yarn@3.8.1",
"engines": {
@@ -36,7 +36,7 @@
"@playwright/test": "^1.32.3",
"node-gyp": "^10.0.0",
"prettier": "^2.3.2",
"typescript": "~5.4.0"
"typescript": "~5.8.0"
},
"resolutions": {
"@types/react": "^18",
-1
View File
@@ -79,7 +79,6 @@
"@mui/utils": "^5.14.15",
"classnames": "^2.3.1",
"dataloader": "^2.0.0",
"expiry-map": "^2.0.0",
"history": "^5.0.0",
"lodash": "^4.17.21",
"pluralize": "^8.0.0",
@@ -28,7 +28,6 @@ import {
} from '@backstage/plugin-catalog-react';
import { durationToMilliseconds, HumanDuration } from '@backstage/types';
import DataLoader from 'dataloader';
import ExpiryMap from 'expiry-map';
import ObservableImpl from 'zen-observable';
import {
createDefaultRenderer,
@@ -149,6 +148,45 @@ interface CacheEntry {
entity: Entity | undefined;
}
// Simply expory map for the data loader, which only expects a map that implements set, get, and delete and clear
export class ExpiryMap<K, V> extends Map<K, V> {
#ttlMs: number;
#timestamps: Map<K, number> = new Map();
constructor(ttlMs: number) {
super();
this.#ttlMs = ttlMs;
}
set(key: K, value: V) {
const result = super.set(key, value);
this.#timestamps.set(key, Date.now());
return result;
}
get(key: K) {
if (!this.has(key)) {
return undefined;
}
const timestamp = this.#timestamps.get(key)!;
if (Date.now() - timestamp > this.#ttlMs) {
this.delete(key);
return undefined;
}
return super.get(key);
}
delete(key: K) {
this.#timestamps.delete(key);
return super.delete(key);
}
clear() {
this.#timestamps.clear();
return super.clear();
}
}
/**
* Default implementation of the {@link @backstage/plugin-catalog-react#EntityPresentationApi}.
*
+31 -48
View File
@@ -6437,7 +6437,6 @@ __metadata:
"@types/react": ^18.0.0
classnames: ^2.3.1
dataloader: ^2.0.0
expiry-map: ^2.0.0
history: ^5.0.0
lodash: ^4.17.21
pluralize: ^8.0.0
@@ -23279,7 +23278,7 @@ __metadata:
languageName: node
linkType: hard
"ast-types@npm:0.14.2, ast-types@npm:^0.14.1":
"ast-types@npm:0.14.2":
version: 0.14.2
resolution: "ast-types@npm:0.14.2"
dependencies:
@@ -23306,6 +23305,15 @@ __metadata:
languageName: node
linkType: hard
"ast-types@patch:ast-types@npm%3A0.14.2#./.yarn/patches/ast-types-npm-0.14.2-43c4ac4b0d.patch::locator=root%40workspace%3A.":
version: 0.14.2
resolution: "ast-types@patch:ast-types@npm%3A0.14.2#./.yarn/patches/ast-types-npm-0.14.2-43c4ac4b0d.patch::version=0.14.2&hash=f42322&locator=root%40workspace%3A."
dependencies:
tslib: ^2.0.1
checksum: 6266562e45466c0d79eee8de68ace0ae4d69968638910cfc153f809632b88b6a4ad44ed33ab7b1e9a3b26ee5f5472bb6be834f380ca533db4a6f8ee1675548fa
languageName: node
linkType: hard
"astral-regex@npm:^2.0.0":
version: 2.0.0
resolution: "astral-regex@npm:2.0.0"
@@ -29134,15 +29142,6 @@ __metadata:
languageName: node
linkType: hard
"expiry-map@npm:^2.0.0":
version: 2.0.0
resolution: "expiry-map@npm:2.0.0"
dependencies:
map-age-cleaner: ^0.2.0
checksum: 9be8662e1a5c1084fb6d0ddc5402658dd06101c330454062b2f5efbf1477259d272e54ec16663d7d12a93d08ed510535781c36acb214696c5bc3a690a02a7a9d
languageName: node
linkType: hard
"exponential-backoff@npm:^3.1.1":
version: 3.1.1
resolution: "exponential-backoff@npm:3.1.1"
@@ -35739,15 +35738,6 @@ __metadata:
languageName: node
linkType: hard
"map-age-cleaner@npm:^0.2.0":
version: 0.2.0
resolution: "map-age-cleaner@npm:0.2.0"
dependencies:
p-defer: ^1.0.0
checksum: 13a6810b76b0067efa7f4b0f3dc58b58b4a4b5faa4cae5a0e8d5d59eda04d7074724eee426c9b5890a1d7e14d1e2902a090587acc8e2430198e79ab1556a2dad
languageName: node
linkType: hard
"map-or-similar@npm:^1.5.0":
version: 1.5.0
resolution: "map-or-similar@npm:1.5.0"
@@ -38593,13 +38583,6 @@ __metadata:
languageName: node
linkType: hard
"p-defer@npm:^1.0.0":
version: 1.0.0
resolution: "p-defer@npm:1.0.0"
checksum: 4271b935c27987e7b6f229e5de4cdd335d808465604644cb7b4c4c95bef266735859a93b16415af8a41fd663ee9e3b97a1a2023ca9def613dba1bad2a0da0c7b
languageName: node
linkType: hard
"p-filter@npm:^2.1.0":
version: 2.1.0
resolution: "p-filter@npm:2.1.0"
@@ -42767,7 +42750,7 @@ __metadata:
sloc: ^0.3.1
sort-package-json: ^2.8.0
typedoc: ^0.27.6
typescript: ~5.2.0
typescript: ~5.6.0
languageName: unknown
linkType: soft
@@ -46019,16 +46002,6 @@ __metadata:
languageName: node
linkType: hard
"typescript@npm:~5.2.0":
version: 5.2.2
resolution: "typescript@npm:5.2.2"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c
languageName: node
linkType: hard
"typescript@npm:~5.5.0":
version: 5.5.4
resolution: "typescript@npm:5.5.4"
@@ -46039,6 +46012,16 @@ __metadata:
languageName: node
linkType: hard
"typescript@npm:~5.6.0":
version: 5.6.3
resolution: "typescript@npm:5.6.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: ba302f8822777ebefb28b554105f3e074466b671e7444ec6b75dadc008a62f46f373d9e57ceced1c433756d06c8b7dc569a7eefdf3a9573122a49205ff99021a
languageName: node
linkType: hard
"typescript@patch:typescript@5.4.2#~builtin<compat/typescript>":
version: 5.4.2
resolution: "typescript@patch:typescript@npm%3A5.4.2#~builtin<compat/typescript>::version=5.4.2&hash=5adc0c"
@@ -46049,16 +46032,6 @@ __metadata:
languageName: node
linkType: hard
"typescript@patch:typescript@~5.2.0#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=f3b441"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 0f4da2f15e6f1245e49db15801dbee52f2bbfb267e1c39225afdab5afee1a72839cd86000e65ee9d7e4dfaff12239d28beaf5ee431357fcced15fb08583d72ca
languageName: node
linkType: hard
"typescript@patch:typescript@~5.5.0#~builtin<compat/typescript>":
version: 5.5.4
resolution: "typescript@patch:typescript@npm%3A5.5.4#~builtin<compat/typescript>::version=5.5.4&hash=5adc0c"
@@ -46069,6 +46042,16 @@ __metadata:
languageName: node
linkType: hard
"typescript@patch:typescript@~5.6.0#~builtin<compat/typescript>":
version: 5.6.3
resolution: "typescript@patch:typescript@npm%3A5.6.3#~builtin<compat/typescript>::version=5.6.3&hash=5adc0c"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: ade87bce2363ee963eed0e4ca8a312ea02c81873ebd53609bc3f6dc0a57f6e61ad7e3fb8cbb7f7ab8b5081cbee801b023f7c4823ee70b1c447eae050e6c7622b
languageName: node
linkType: hard
"ua-parser-js@npm:^0.7.30":
version: 0.7.33
resolution: "ua-parser-js@npm:0.7.33"