Skip to content

Commit

Permalink
Upgrade dependencies & drop Node 16 (#343)
Browse files Browse the repository at this point in the history
* Upgrade dependencies

* Drop Node 16

* Fix lint dependency

* Fix docs

* Actually fix linting
  • Loading branch information
turt2live authored Oct 11, 2023
1 parent c46efe7 commit 244bf76
Show file tree
Hide file tree
Showing 6 changed files with 1,637 additions and 1,008 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
build:
strategy:
matrix:
node: [ 16, 18, 20 ]
node: [ 18, 20 ]
name: 'Build Node ${{ matrix.node }}'
runs-on: ubuntu-latest
steps:
Expand All @@ -38,7 +38,7 @@ jobs:
build-docs:
strategy:
matrix:
node: [ 16, 18, 20 ]
node: [ 18, 20 ]
name: 'Build Docs Node ${{ matrix.node }}'
runs-on: ubuntu-latest
steps:
Expand All @@ -52,7 +52,7 @@ jobs:
tests:
strategy:
matrix:
node: [ 16, 18, 20 ]
node: [ 18, 20 ]
name: 'Tests Node ${{ matrix.node }}'
runs-on: ubuntu-latest
steps:
Expand Down
57 changes: 29 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"keywords": [
"matrix",
Expand All @@ -52,49 +52,50 @@
],
"dependencies": {
"@matrix-org/matrix-sdk-crypto-nodejs": "0.1.0-beta.6",
"@types/express": "^4.17.13",
"@types/express": "^4.17.19",
"another-json": "^0.2.0",
"async-lock": "^1.3.2",
"async-lock": "^1.4.0",
"chalk": "^4",
"express": "^4.18.1",
"express": "^4.18.2",
"glob-to-regexp": "^0.4.1",
"hash.js": "^1.1.7",
"html-to-text": "^8.2.0",
"html-to-text": "^9.0.5",
"htmlencode": "^0.0.4",
"lowdb": "^1",
"lru-cache": "^7.10.1",
"mkdirp": "^1.0.4",
"lru-cache": "^10.0.1",
"mkdirp": "^3.0.1",
"morgan": "^1.10.0",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"sanitize-html": "^2.8.0"
"sanitize-html": "^2.11.0"
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/eslint-parser": "^7.18.2",
"@babel/eslint-plugin": "^7.17.7",
"@types/async-lock": "^1.3.0",
"@types/expect": "^24.3.0",
"@types/jest": "^27.5.1",
"@types/lowdb": "^1.0.11",
"@types/mocha": "^8",
"@types/node": "^16",
"@types/simple-mock": "^0.8.2",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"@babel/core": "^7.23.0",
"@babel/eslint-parser": "^7.22.15",
"@babel/eslint-plugin": "^7.22.10",
"@types/async-lock": "^1.4.0",
"@types/jest": "^29.5.5",
"@types/lowdb": "^1.0.12",
"@types/mocha": "^10.0.2",
"@types/node": "18",
"@types/sanitize-html": "^2.9.2",
"@types/simple-mock": "^0.8.3",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"better-docs": "^2.7.2",
"eslint": "^8.16.0",
"eslint": "^8.51.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-matrix-org": "^0.5.2",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-matrix-org": "^0.5",
"get-port": "^5",
"jest": "^28.1.0",
"jsdoc": "^3.6.10",
"matrix-mock-request": "^2.1.0",
"jest": "^29.7.0",
"jsdoc": "^4.0.2",
"matrix-mock-request": "^2.6.0",
"simple-mock": "^0.8.0",
"taffydb": "^2.7.3",
"tmp": "^0.2.1",
"ts-jest": "^28.0.3",
"typescript": "^4.7.2"
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"jest": {
"preset": "ts-jest",
Expand Down
4 changes: 2 additions & 2 deletions src/appservice/Appservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class Appservice extends EventEmitter {

private app = express();
private appServer: any;
private intentsCache: LRU<string, Intent>;
private intentsCache: LRU.LRUCache<string, Intent>;
private eventProcessors: { [eventType: string]: IPreprocessor[] } = {};
private pendingTransactions: { [txnId: string]: Promise<any> } = {};

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

this.intentsCache = new LRU({
this.intentsCache = new LRU.LRUCache({
max: options.intentOptions.maxCached,
ttl: options.intentOptions.maxAgeMs,
});
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/ProfileCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type CacheKey = `${string}@${string | '<none>'}`;
* @category Utilities
*/
export class ProfileCache {
private cache: LRU<CacheKey, MatrixProfile>;
private cache: LRU.LRUCache<CacheKey, MatrixProfile>;

/**
* Creates a new profile cache.
Expand All @@ -22,7 +22,7 @@ export class ProfileCache {
* @param {MatrixClient} client The client to use to get profile updates.
*/
constructor(maxEntries: number, maxAgeMs: number, private client: MatrixClient) {
this.cache = new LRU({
this.cache = new LRU.LRUCache({
max: maxEntries,
ttl: maxAgeMs,
});
Expand Down
2 changes: 1 addition & 1 deletion test/appservice/IntentTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ describe('Intent', () => {
let storage: IAppserviceStorageProvider;
let cryptoStorage: IAppserviceCryptoStorageProvider;
let options: IAppserviceOptions;
let intent: Intent;
let intent: Intent; // eslint-disable-line @typescript-eslint/no-unused-vars

beforeEach(() => {
storage = new MemoryStorageProvider();
Expand Down
Loading

0 comments on commit 244bf76

Please sign in to comment.