Skip to content

Commit 244bf76

Browse files
authored
Upgrade dependencies & drop Node 16 (#343)
* Upgrade dependencies * Drop Node 16 * Fix lint dependency * Fix docs * Actually fix linting
1 parent c46efe7 commit 244bf76

File tree

6 files changed

+1637
-1008
lines changed

6 files changed

+1637
-1008
lines changed

.github/workflows/static_analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
build:
2424
strategy:
2525
matrix:
26-
node: [ 16, 18, 20 ]
26+
node: [ 18, 20 ]
2727
name: 'Build Node ${{ matrix.node }}'
2828
runs-on: ubuntu-latest
2929
steps:
@@ -38,7 +38,7 @@ jobs:
3838
build-docs:
3939
strategy:
4040
matrix:
41-
node: [ 16, 18, 20 ]
41+
node: [ 18, 20 ]
4242
name: 'Build Docs Node ${{ matrix.node }}'
4343
runs-on: ubuntu-latest
4444
steps:
@@ -52,7 +52,7 @@ jobs:
5252
tests:
5353
strategy:
5454
matrix:
55-
node: [ 16, 18, 20 ]
55+
node: [ 18, 20 ]
5656
name: 'Tests Node ${{ matrix.node }}'
5757
runs-on: ubuntu-latest
5858
steps:

package.json

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"main": "./lib/index.js",
2929
"typings": "./lib/index.d.ts",
3030
"engines": {
31-
"node": ">=16.0.0"
31+
"node": ">=18.0.0"
3232
},
3333
"keywords": [
3434
"matrix",
@@ -52,49 +52,50 @@
5252
],
5353
"dependencies": {
5454
"@matrix-org/matrix-sdk-crypto-nodejs": "0.1.0-beta.6",
55-
"@types/express": "^4.17.13",
55+
"@types/express": "^4.17.19",
5656
"another-json": "^0.2.0",
57-
"async-lock": "^1.3.2",
57+
"async-lock": "^1.4.0",
5858
"chalk": "^4",
59-
"express": "^4.18.1",
59+
"express": "^4.18.2",
6060
"glob-to-regexp": "^0.4.1",
6161
"hash.js": "^1.1.7",
62-
"html-to-text": "^8.2.0",
62+
"html-to-text": "^9.0.5",
6363
"htmlencode": "^0.0.4",
6464
"lowdb": "^1",
65-
"lru-cache": "^7.10.1",
66-
"mkdirp": "^1.0.4",
65+
"lru-cache": "^10.0.1",
66+
"mkdirp": "^3.0.1",
6767
"morgan": "^1.10.0",
6868
"request": "^2.88.2",
6969
"request-promise": "^4.2.6",
70-
"sanitize-html": "^2.8.0"
70+
"sanitize-html": "^2.11.0"
7171
},
7272
"devDependencies": {
73-
"@babel/core": "^7.18.2",
74-
"@babel/eslint-parser": "^7.18.2",
75-
"@babel/eslint-plugin": "^7.17.7",
76-
"@types/async-lock": "^1.3.0",
77-
"@types/expect": "^24.3.0",
78-
"@types/jest": "^27.5.1",
79-
"@types/lowdb": "^1.0.11",
80-
"@types/mocha": "^8",
81-
"@types/node": "^16",
82-
"@types/simple-mock": "^0.8.2",
83-
"@typescript-eslint/eslint-plugin": "^5.26.0",
84-
"@typescript-eslint/parser": "^5.26.0",
73+
"@babel/core": "^7.23.0",
74+
"@babel/eslint-parser": "^7.22.15",
75+
"@babel/eslint-plugin": "^7.22.10",
76+
"@types/async-lock": "^1.4.0",
77+
"@types/jest": "^29.5.5",
78+
"@types/lowdb": "^1.0.12",
79+
"@types/mocha": "^10.0.2",
80+
"@types/node": "18",
81+
"@types/sanitize-html": "^2.9.2",
82+
"@types/simple-mock": "^0.8.3",
83+
"@typescript-eslint/eslint-plugin": "^6.7.5",
84+
"@typescript-eslint/parser": "^6.7.5",
8585
"better-docs": "^2.7.2",
86-
"eslint": "^8.16.0",
86+
"eslint": "^8.51.0",
8787
"eslint-config-google": "^0.14.0",
88-
"eslint-plugin-import": "^2.26.0",
89-
"eslint-plugin-matrix-org": "^0.5.2",
88+
"eslint-plugin-import": "^2.28.1",
89+
"eslint-plugin-matrix-org": "^0.5",
9090
"get-port": "^5",
91-
"jest": "^28.1.0",
92-
"jsdoc": "^3.6.10",
93-
"matrix-mock-request": "^2.1.0",
91+
"jest": "^29.7.0",
92+
"jsdoc": "^4.0.2",
93+
"matrix-mock-request": "^2.6.0",
9494
"simple-mock": "^0.8.0",
95+
"taffydb": "^2.7.3",
9596
"tmp": "^0.2.1",
96-
"ts-jest": "^28.0.3",
97-
"typescript": "^4.7.2"
97+
"ts-jest": "^29.1.1",
98+
"typescript": "^5.2.2"
9899
},
99100
"jest": {
100101
"preset": "ts-jest",

src/appservice/Appservice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class Appservice extends EventEmitter {
234234

235235
private app = express();
236236
private appServer: any;
237-
private intentsCache: LRU<string, Intent>;
237+
private intentsCache: LRU.LRUCache<string, Intent>;
238238
private eventProcessors: { [eventType: string]: IPreprocessor[] } = {};
239239
private pendingTransactions: { [txnId: string]: Promise<any> } = {};
240240

@@ -251,7 +251,7 @@ export class Appservice extends EventEmitter {
251251
if (!options.intentOptions.maxAgeMs) options.intentOptions.maxAgeMs = 60 * 60 * 1000;
252252
if (!options.intentOptions.maxCached) options.intentOptions.maxCached = 10000;
253253

254-
this.intentsCache = new LRU({
254+
this.intentsCache = new LRU.LRUCache({
255255
max: options.intentOptions.maxCached,
256256
ttl: options.intentOptions.maxAgeMs,
257257
});

src/helpers/ProfileCache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type CacheKey = `${string}@${string | '<none>'}`;
1313
* @category Utilities
1414
*/
1515
export class ProfileCache {
16-
private cache: LRU<CacheKey, MatrixProfile>;
16+
private cache: LRU.LRUCache<CacheKey, MatrixProfile>;
1717

1818
/**
1919
* Creates a new profile cache.
@@ -22,7 +22,7 @@ export class ProfileCache {
2222
* @param {MatrixClient} client The client to use to get profile updates.
2323
*/
2424
constructor(maxEntries: number, maxAgeMs: number, private client: MatrixClient) {
25-
this.cache = new LRU({
25+
this.cache = new LRU.LRUCache({
2626
max: maxEntries,
2727
ttl: maxAgeMs,
2828
});

test/appservice/IntentTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ describe('Intent', () => {
11331133
let storage: IAppserviceStorageProvider;
11341134
let cryptoStorage: IAppserviceCryptoStorageProvider;
11351135
let options: IAppserviceOptions;
1136-
let intent: Intent;
1136+
let intent: Intent; // eslint-disable-line @typescript-eslint/no-unused-vars
11371137

11381138
beforeEach(() => {
11391139
storage = new MemoryStorageProvider();

0 commit comments

Comments
 (0)