Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ee/packages/federation-matrix/babel.config.js

This file was deleted.

6 changes: 1 addition & 5 deletions ee/packages/federation-matrix/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import type { Config } from 'jest';

export default {
preset: server.preset,
transformIgnorePatterns: [
'<rootDir>/node_modules/@babel',
'<rootDir>/node_modules/@jest',
'/node_modules/(?!marked|@testing-library/)',
],
transformIgnorePatterns: ['<rootDir>/node_modules/@babel', '<rootDir>/node_modules/@jest', '/node_modules/(?!marked|@testing-library/)'],
// Exclude integration/e2e tests from unit test runs
testPathIgnorePatterns: ['<rootDir>/tests/end-to-end/'],
} satisfies Config;
13 changes: 4 additions & 9 deletions ee/packages/federation-matrix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
],
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.build.json",
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "jest",
"test:integration": "./tests/scripts/run-integration-tests.sh",
"test:federation": "jest --config jest.config.federation.ts",
"testunit": "jest",
"typecheck": "tsc --noEmit --skipLibCheck"
"typecheck": "tsc --noEmit"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the package.json file to see current state
cat ee/packages/federation-matrix/package.json | head -30

# Also check if there's a tsconfig.json in that directory
echo "---"
echo "Looking for tsconfig.json:"
ls -la ee/packages/federation-matrix/ | grep -i tsconfig

Repository: RocketChat/Rocket.Chat

Length of output: 1212


🏁 Script executed:

#!/bin/bash
# Search for skipLibCheck in the repository
rg "skipLibCheck" --type json

Repository: RocketChat/Rocket.Chat

Length of output: 1773


🏁 Script executed:

#!/bin/bash
# Navigate to the federation-matrix package and run typecheck
cd ee/packages/federation-matrix

# Time the typecheck
echo "Running typecheck..."
timeout 30 time npm run typecheck 2>&1 || {
  EXIT_CODE=$?
  if [ $EXIT_CODE -eq 124 ]; then
    echo "Typecheck timed out after 30 seconds"
  else
    echo "Typecheck exited with code: $EXIT_CODE"
  fi
}

Repository: RocketChat/Rocket.Chat

Length of output: 164


Add --skipLibCheck to match repository pattern.

This package's typecheck script lacks --skipLibCheck, which is used across the repository (presence, network-broker, stream-hub-service, queue-worker, meteor, and others). Skipping type checking of third-party declaration files reduces compile time. Update the script to "typecheck": "tsc --noEmit --skipLibCheck" for consistency and improved performance.

🤖 Prompt for AI Agents
In ee/packages/federation-matrix/package.json around line 19, the "typecheck"
script is missing the repository-standard --skipLibCheck flag; update the script
to include --skipLibCheck so it becomes tsc --noEmit --skipLibCheck to skip
third-party declaration checks and match other packages.

},
"dependencies": {
"@rocket.chat/core-services": "workspace:^",
Expand All @@ -38,16 +38,11 @@
"tweetnacl": "^1.0.3"
},
"devDependencies": {
"@babel/cli": "~7.28.3",
"@babel/core": "~7.28.5",
"@babel/preset-env": "~7.28.5",
"@babel/preset-typescript": "~7.27.1",
"@rocket.chat/ddp-client": "workspace:^",
"@rocket.chat/eslint-config": "workspace:^",
"@types/emojione": "^2.2.9",
"@types/node": "~22.16.5",
"@types/sanitize-html": "~2.16.0",
"babel-jest": "~30.2.0",
"eslint": "~8.45.0",
"jest": "~30.2.0",
"jest-qase-reporter": "^2.1.4",
Expand Down
6 changes: 3 additions & 3 deletions ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ import { SynapseClient } from '../helper/synapse-client';
expect(pendingInvitation).not.toBeUndefined();

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
rid = pendingInvitation?.rid!;
rid = pendingInvitation!.rid!;

await acceptRoomInvite(rid, rc1AdminRequestConfig);
}, 15000);
Expand Down Expand Up @@ -1644,7 +1644,7 @@ import { SynapseClient } from '../helper/synapse-client';
expect(pendingInvitation).not.toBeUndefined();

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
rid = pendingInvitation?.rid!;
rid = pendingInvitation!.rid!;
}, 15000);

it('should allow RC user to reject the invite and remove the subscription', async () => {
Expand Down Expand Up @@ -1678,7 +1678,7 @@ import { SynapseClient } from '../helper/synapse-client';
expect(pendingInvitation).not.toBeUndefined();

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
rid = pendingInvitation?.rid!;
rid = pendingInvitation!.rid!;

// hs1 revokes the invitation by kicking the invited user
await hs1AdminApp.matrixClient.kick(matrixRoomId, federationConfig.rc1.adminMatrixUserId, 'Invitation revoked');
Expand Down
9 changes: 3 additions & 6 deletions ee/packages/federation-matrix/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"skipLibCheck": true,
"outDir": "./dist",
"isolatedModules": true,
"allowJs": false,
"checkJs": false,
"esModuleInterop": true
"declaration": true,
},
"include": [
"src/**/*.ts"
Expand All @@ -18,4 +15,4 @@
"**/*.test.ts",
"../../../../**/*",
]
}
}
5 changes: 1 addition & 4 deletions ee/packages/federation-matrix/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"extends": "@rocket.chat/tsconfig/server.json",
"compilerOptions": {
"rootDir": "./src",
"strictPropertyInitialization": false,
"skipLibCheck": true,
"experimentalDecorators": true,
"declaration": true,
"rootDir": "./src",
"outDir": "./dist"
},
"files": ["./src/index.ts"]
}
55 changes: 1 addition & 54 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -587,33 +587,6 @@ __metadata:
languageName: node
linkType: hard

"@babel/cli@npm:~7.28.3":
version: 7.28.3
resolution: "@babel/cli@npm:7.28.3"
dependencies:
"@jridgewell/trace-mapping": "npm:^0.3.28"
"@nicolo-ribaudo/chokidar-2": "npm:2.1.8-no-fsevents.3"
chokidar: "npm:^3.6.0"
commander: "npm:^6.2.0"
convert-source-map: "npm:^2.0.0"
fs-readdir-recursive: "npm:^1.1.0"
glob: "npm:^7.2.0"
make-dir: "npm:^2.1.0"
slash: "npm:^2.0.0"
peerDependencies:
"@babel/core": ^7.0.0-0
dependenciesMeta:
"@nicolo-ribaudo/chokidar-2":
optional: true
chokidar:
optional: true
bin:
babel: ./bin/babel.js
babel-external-helpers: ./bin/babel-external-helpers.js
checksum: 10/abde275866845bf0c86c090e23373e747da12e49776a879d7e5b4e55528e8a8ccc341b2e3f908d5bb3632b19c663000dca1ac5495d8805f5ce63e037b64e2b85
languageName: node
linkType: hard

"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.25.7, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.27.1":
version: 7.27.1
resolution: "@babel/code-frame@npm:7.27.1"
Expand Down Expand Up @@ -5104,13 +5077,6 @@ __metadata:
languageName: node
linkType: hard

"@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3":
version: 2.1.8-no-fsevents.3
resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3"
checksum: 10/c6e83af3b5051a3f6562649ff8fe37de9934a4cc02138678ed1badbd13ed3334f7ae5f63f2bbc3432210f6b245f082ac97e9b2afe0c13730c9838b295658c185
languageName: node
linkType: hard

"@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1":
version: 5.1.1-v1
resolution: "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1"
Expand Down Expand Up @@ -8486,10 +8452,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rocket.chat/federation-matrix@workspace:ee/packages/federation-matrix"
dependencies:
"@babel/cli": "npm:~7.28.3"
"@babel/core": "npm:~7.28.5"
"@babel/preset-env": "npm:~7.28.5"
"@babel/preset-typescript": "npm:~7.27.1"
"@rocket.chat/core-services": "workspace:^"
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/ddp-client": "workspace:^"
Expand All @@ -8504,7 +8466,6 @@ __metadata:
"@types/emojione": "npm:^2.2.9"
"@types/node": "npm:~22.16.5"
"@types/sanitize-html": "npm:~2.16.0"
babel-jest: "npm:~30.2.0"
emojione: "npm:^4.5.0"
eslint: "npm:~8.45.0"
jest: "npm:~30.2.0"
Expand Down Expand Up @@ -18181,7 +18142,7 @@ __metadata:
languageName: node
linkType: hard

"commander@npm:^6.1.0, commander@npm:^6.2.0":
"commander@npm:^6.1.0":
version: 6.2.1
resolution: "commander@npm:6.2.1"
checksum: 10/25b88c2efd0380c84f7844b39cf18510da7bfc5013692d68cdc65f764a1c34e6c8a36ea6d72b6620e3710a930cf8fab2695bdec2bf7107a0f4fa30a3ef3b7d0e
Expand Down Expand Up @@ -22407,13 +22368,6 @@ __metadata:
languageName: node
linkType: hard

"fs-readdir-recursive@npm:^1.1.0":
version: 1.1.0
resolution: "fs-readdir-recursive@npm:1.1.0"
checksum: 10/d5e3fd8456b8e5d57a43f169a9eaf65c70fa82c4a22f1d4361cdba4ea5e61c60c5c2b4ac481ea137a4d43b2b99b3ea2fae95ac2730255c4206d61af645866c3a
languageName: node
linkType: hard

"fs.realpath@npm:^1.0.0":
version: 1.0.0
resolution: "fs.realpath@npm:1.0.0"
Expand Down Expand Up @@ -33641,13 +33595,6 @@ __metadata:
languageName: node
linkType: hard

"slash@npm:^2.0.0":
version: 2.0.0
resolution: "slash@npm:2.0.0"
checksum: 10/512d4350735375bd11647233cb0e2f93beca6f53441015eea241fe784d8068281c3987fbaa93e7ef1c38df68d9c60013045c92837423c69115297d6169aa85e6
languageName: node
linkType: hard

"slash@npm:^3.0.0":
version: 3.0.0
resolution: "slash@npm:3.0.0"
Expand Down
Loading