Skip to content

Commit ec8ee33

Browse files
committed
Update dependencies, require node 20
1 parent ed85fc6 commit ec8ee33

File tree

6 files changed

+2455
-1848
lines changed

6 files changed

+2455
-1848
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- name: Use Node.js
1414
uses: actions/setup-node@v3
1515
with:
16-
node-version: 16
16+
node-version: 20
1717
- run: yarn --ignore-scripts --pure-lockfile --strict-semver
1818
- run: yarn lint

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node_version: [16, 18]
13+
node_version: [20]
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Use Node.js
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
node_version: [16, 18]
27+
node_version: [20]
2828
steps:
2929
- uses: actions/checkout@v2
3030
- name: Use Node.js
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
strategy:
4040
matrix:
41-
node_version: [16, 18]
41+
node_version: [20]
4242
steps:
4343
- uses: actions/checkout@v2
4444
- name: Use Node.js

package.json

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.1.2",
44
"description": "A Matrix <--> Slack bridge",
55
"engines": {
6-
"node": ">=16 <=18"
6+
"node": ">=20"
77
},
88
"main": "app.js",
99
"scripts": {
@@ -34,63 +34,64 @@
3434
"homepage": "https://github.com/matrix-org/matrix-appservice-slack#readme",
3535
"dependencies": {
3636
"@alloc/quick-lru": "^5.2.0",
37-
"@slack/logger": "^3.0.0",
38-
"@slack/rtm-api": "^6.0.0",
37+
"@slack/logger": "^4.0.0",
38+
"@slack/rtm-api": "^6.2.1",
3939
"@slack/web-api": "^6.7.2",
4040
"Slackdown": "git+https://Half-Shot@github.com/half-shot/slackdown.git",
4141
"ajv": "^8.12.0",
42-
"axios": "^0.27.2",
43-
"classnames": "^2.3.2",
42+
"axios": "^1.6.8",
43+
"classnames": "^2.5.1",
4444
"escape-string-regexp": "^4.0.0",
45-
"https-proxy-agent": "^5.0.1",
46-
"matrix-appservice-bridge": "^8.1.2",
47-
"matrix-widget-api": "^1.1.1",
48-
"minimist": "^1.2.6",
45+
"https-proxy-agent": "^7.0.4",
46+
"matrix-appservice-bridge": "^10.1.0",
47+
"matrix-bot-sdk": "^0.7.1",
48+
"matrix-widget-api": "^1.6.0",
49+
"minimist": "^1.2.8",
4950
"nedb": "^1.8.0",
50-
"node-emoji": "^1.10.0",
51+
"node-emoji": "^2.1.3",
5152
"nunjucks": "^3.2.4",
5253
"p-queue": "^6.0.0",
53-
"pg-promise": "^10.11.1",
54-
"randomstring": "^1.2.1",
54+
"pg-promise": "^11.5.4",
55+
"randomstring": "^1.3.0",
5556
"react": "^18.2.0",
5657
"react-dom": "^18.2.0",
5758
"url-join": "^5.0.0",
58-
"uuid": "^8.3.2",
59-
"yargs": "17.5.1"
59+
"uuid": "^9.0.1",
60+
"yargs": "17.7.2"
6061
},
6162
"devDependencies": {
62-
"@tailwindcss/forms": "^0.5.3",
63-
"@tsconfig/node16": "^1.0.3",
64-
"@types/chai": "^4.2.21",
65-
"@types/js-yaml": "^4.0.2",
66-
"@types/mocha": "^9.1.1",
67-
"@types/nedb": "^1.8.12",
68-
"@types/node": "^18.6.1",
69-
"@types/node-emoji": "^1.8.1",
70-
"@types/nunjucks": "^3.1.5",
71-
"@types/randomstring": "^1.1.7",
72-
"@types/react": "^18.0.27",
73-
"@types/react-dom": "^18.0.10",
74-
"@types/uuid": "^8.3.1",
75-
"@types/yargs": "17.0.10",
76-
"@typescript-eslint/eslint-plugin": "^5.0.0",
77-
"@typescript-eslint/parser": "^5.50.0",
78-
"@vitejs/plugin-react": "^3.1.0",
79-
"autoprefixer": "^10.4.13",
63+
"@tailwindcss/forms": "^0.5.7",
64+
"@tsconfig/node16": "^16.1.1",
65+
"@types/chai": "^4.3.13",
66+
"@types/js-yaml": "^4.0.9",
67+
"@types/mocha": "^10.0.6",
68+
"@types/nedb": "^1.8.16",
69+
"@types/node": "^20.11.30",
70+
"@types/node-emoji": "^2.1.0",
71+
"@types/nunjucks": "^3.2.6",
72+
"@types/randomstring": "^1.1.12",
73+
"@types/react": "^18.2.67",
74+
"@types/react-dom": "^18.2.22",
75+
"@types/uuid": "^9.0.8",
76+
"@types/yargs": "17.0.32",
77+
"@typescript-eslint/eslint-plugin": "^7.3.1",
78+
"@typescript-eslint/parser": "^7.3.1",
79+
"@vitejs/plugin-react": "^4.2.1",
80+
"autoprefixer": "^10.4.18",
8081
"chai": "^4.3.4",
81-
"eslint": "^8.20.0",
82-
"eslint-plugin-jsdoc": "^39.3.3",
82+
"eslint": "^8.57.0",
83+
"eslint-plugin-jsdoc": "^48.2.1",
8384
"eslint-plugin-prefer-arrow": "^1.2.3",
84-
"eslint-plugin-react": "^7.32.2",
85+
"eslint-plugin-react": "^7.34.1",
8586
"eslint-plugin-react-hooks": "^4.6.0",
8687
"js-yaml": "^4.1.0",
8788
"mocha": "^10.0.0",
88-
"postcss": "^8.4.21",
89-
"prom-client": "^14.0.1",
89+
"postcss": "^8.4.36",
90+
"prom-client": "^15.1.0",
9091
"source-map-support": "^0.5.19",
91-
"tailwindcss": "^3.2.4",
92-
"ts-node": "^10.1.0",
93-
"typescript": "^4.4.3",
94-
"vite": "^4.1.1"
92+
"tailwindcss": "^3.4.1",
93+
"ts-node": "^10.9.2",
94+
"typescript": "^5.4.2",
95+
"vite": "^5.1.6"
9596
}
9697
}

src/BridgedRoom.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import axios from "axios";
1818
import { Logger, Intent } from "matrix-appservice-bridge";
1919
import { SlackGhost } from "./SlackGhost";
2020
import { Main, METRIC_SENT_MESSAGES } from "./Main";
21-
import { default as substitutions, getFallbackForMissingEmoji, IMatrixToSlackResult } from "./substitutions";
21+
import { default as substitutions, IMatrixToSlackResult } from "./substitutions";
2222
import * as emoji from "node-emoji";
2323
import { ISlackMessageEvent, ISlackEvent, ISlackFile } from "./BaseSlackHandler";
2424
import { WebAPIPlatformError, WebClient } from "@slack/web-api";
@@ -306,7 +306,7 @@ export class BridgedRoom {
306306
// bot user. Search for #fix_reactions_as_bot.
307307
const res = await client.reactions.add({
308308
as_user: false,
309-
channel: this.slackChannelId,
309+
channel: this.slackChannelId!,
310310
name: emojiKeyName,
311311
timestamp: event.slackTs,
312312
});
@@ -743,7 +743,7 @@ export class BridgedRoom {
743743
return;
744744
}
745745

746-
let reactionKey = emoji.emojify(`:${message.reaction}:`, getFallbackForMissingEmoji);
746+
let reactionKey = emoji.emojify(`:${message.reaction}:`);
747747
// Element uses the default thumbsup and thumbsdown reactions with an appended variant character.
748748
if (reactionKey === '👍' || reactionKey === '👎') {
749749
reactionKey += '\ufe0f'.normalize(); // VARIATION SELECTOR-16

src/substitutions.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ const log = new Logger("substitutions");
2525
const ATTACHMENT_TYPES = ["m.audio", "m.video", "m.file", "m.image"];
2626
const PILL_REGEX = /<a href="https:\/\/matrix\.to\/#\/(#|@|\+)([^"]+)">([^<]+)<\/a>/g;
2727

28-
/**
29-
* Will return the emoji's name within ':'.
30-
* @param name The emoji's name.
31-
*/
32-
export const getFallbackForMissingEmoji = (name: string): string => (
33-
`:${name}:`
34-
);
35-
3628
interface PillItem {
3729
id: string;
3830
text: string;
@@ -74,7 +66,7 @@ class Substitutions {
7466
body = url ? body.replace(file.permalink, url) : body;
7567
}
7668

77-
body = emoji.emojify(body, getFallbackForMissingEmoji);
69+
body = emoji.emojify(body);
7870

7971
return body;
8072
}

0 commit comments

Comments
 (0)