Skip to content

Conversation

@tassoevan
Copy link
Contributor

@tassoevan tassoevan commented Dec 17, 2025

Proposed changes (including videos or screenshots)

This pull request cleans up and simplifies the build and configuration setup for the federation-matrix package, focusing on removing unnecessary Babel dependencies, improving TypeScript and ESLint configurations, and making small code style adjustments in tests. The main goals are to streamline the development workflow and reduce maintenance overhead.

Build and configuration cleanup:

  • Removed the unused Babel configuration file babel.config.js and all related Babel dependencies from package.json, as the project now relies solely on TypeScript for transpilation. [1] [2]
  • Updated TypeScript configuration in tsconfig.build.json and tsconfig.json to better separate build output and declarations, and to clarify root directories and output paths. [1] [2]

Development workflow improvements:

  • Updated package.json scripts to use the build-specific TypeScript config for the dev script, and broadened ESLint commands to lint the entire project rather than just the src directory. Also removed skipLibCheck from the typecheck script for stricter type checking.

Testing and code style:

  • Simplified transformIgnorePatterns in jest.config.ts for readability.
  • Minor code style adjustments in room.spec.ts tests by removing unnecessary optional chaining before non-null assertions. [1] [2] [3]

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Streamlined build configuration and removed unnecessary build dependencies for improved maintainability.
    • Updated TypeScript build settings and output configuration.
    • Simplified development and linting scripts for consistency.
    • Enhanced type checking and test assertion handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 17, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

⚠️ No Changeset found

Latest commit: 38a0c23

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

This PR removes Babel build configuration from the federation-matrix package, restructures TypeScript configuration into separate build and source configs, updates build and lint scripts to reflect new paths, removes Babel-related devDependencies, adjusts Jest config formatting, and updates test assertions to use non-null assertions instead of optional chaining.

Changes

Cohort / File(s) Change Summary
Babel Configuration Removal
babel.config.js
Deleted the Babel configuration export containing @babel/preset-env and @babel/preset-typescript presets.
TypeScript Configuration Restructuring
tsconfig.json, tsconfig.build.json
Split TypeScript configuration: tsconfig.json now only sets rootDir, removing outDir and declaration generation; tsconfig.build.json newly inherits from tsconfig.json and adds outDir="./dist" and declaration=true, while removing noEmit, skipLibCheck, allowJs, checkJs, and esModuleInterop.
Build Configuration & Dependencies
package.json
Updated scripts: dev now uses tsconfig.build.json, lint targets "." instead of "src", typecheck removes --skipLibCheck flag. Removed devDependencies: @babel/cli, @babel/core, @babel/preset-env, @babel/preset-typescript, and babel-jest.
Jest Configuration Formatting
jest.config.ts
Reformatted transformIgnorePatterns from multi-line to single-line array structure with identical contents.
Test Null-Safety Updates
tests/end-to-end/room.spec.ts
Replaced optional chaining with non-null assertions across three locations: changed pendingInvitation?.rid! to pendingInvitation!.rid!.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • TypeScript configuration split logic: Verify that the separation of build (tsconfig.build.json) and source (tsconfig.json) configs maintains correct compilation behavior and output directory handling.
  • Script path changes: Confirm that linting now correctly targets the root directory and all necessary files are included.
  • Null-assertion changes in tests: Review that replacing optional chaining with non-null assertions in room.spec.ts is safe and the pendingInvitation object is guaranteed to be defined at those call sites.
  • Babel dependency removal impact: Ensure no downstream tooling or build processes depend on the removed Babel packages.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo
  • sampaiodiego

Poem

🐰 A rabbit hops through TypeScript lands,
Babel's gone—no more transpiling strands,
tsconfig splits with careful care,
Non-null assertions, declarations fair!
Build scripts cleaned, dependencies shed,
Federation-matrix's config, freshly fed! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(federation-matrix): Review build configuration' directly and accurately reflects the main changeset, which comprehensively updates build and configuration files for the federation-matrix package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/federation-matrix-build-configuration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 358MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +603B
queue-worker-service 132MiB 132MiB -686B
ddp-streamer-service 126MiB 126MiB +610B
account-service 113MiB 113MiB -1.2KiB
stream-hub-service 110MiB 110MiB -293B
presence-service 110MiB 110MiB -1008B
authorization-service 110MiB 110MiB -442B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 01:40", "12/18 02:09 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 24 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37858
  • Baseline: develop
  • Timestamp: 2025-12-18 02:09:32 UTC
  • Historical data points: 24

Updated: Thu, 18 Dec 2025 02:09:32 GMT

@tassoevan tassoevan force-pushed the chore/federation-matrix-build-configuration branch from 546b178 to 38a0c23 Compare December 18, 2025 01:51
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.63%. Comparing base (cb7c338) to head (38a0c23).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37858   +/-   ##
========================================
  Coverage    67.62%   67.63%           
========================================
  Files         3463     3463           
  Lines       113693   113693           
  Branches     20902    20902           
========================================
+ Hits         76885    76895   +10     
+ Misses       34675    34666    -9     
+ Partials      2133     2132    -1     
Flag Coverage Δ
e2e 57.23% <ø> (+0.01%) ⬆️
e2e-api 42.66% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tassoevan tassoevan added this to the 7.14.0 milestone Dec 18, 2025
@tassoevan tassoevan requested a review from a team December 18, 2025 06:25
@tassoevan tassoevan marked this pull request as ready for review December 18, 2025 06:25
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cb7c338 and 38a0c23.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (6)
  • ee/packages/federation-matrix/babel.config.js (0 hunks)
  • ee/packages/federation-matrix/jest.config.ts (1 hunks)
  • ee/packages/federation-matrix/package.json (1 hunks)
  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts (3 hunks)
  • ee/packages/federation-matrix/tsconfig.build.json (2 hunks)
  • ee/packages/federation-matrix/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (1)
  • ee/packages/federation-matrix/babel.config.js
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
  • ee/packages/federation-matrix/jest.config.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
🧠 Learnings (19)
📓 Common learnings
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37357
File: ee/packages/federation-matrix/src/setup.ts:103-120
Timestamp: 2025-11-05T21:04:35.787Z
Learning: In Rocket.Chat's federation-matrix setup (ee/packages/federation-matrix/src/setup.ts and apps/meteor/ee/server/startup/federation.ts), configureFederationMatrixSettings does not need to be called before setupFederationMatrix. The SDK's init() establishes infrastructure (database, event handlers, APIs) first, and the configuration can be applied later via settings watchers before actual federation events are processed. The config only matters when events actually occur, at which point all infrastructure is already configured.
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
📚 Learning: 2025-12-09T20:01:00.324Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37532
File: ee/packages/federation-matrix/src/FederationMatrix.ts:920-927
Timestamp: 2025-12-09T20:01:00.324Z
Learning: When reviewing federation invite handling in Rocket.Chat (specifically under ee/packages/federation-matrix), understand that rejecting an invite via federationSDK.rejectInvite() triggers an event-driven cleanup: a leave event is emitted and handled by handleLeave() in ee/packages/federation-matrix/src/events/member.ts, which calls Room.performUserRemoval() to remove the subscription. Do not add explicit cleanup in the reject branch of handleInvite(); rely on the existing leave-event flow for cleanup. If making changes, ensure this invariant remains and that any related paths still funnel cleanup through the leave event to avoid duplicate or missing removals.

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
  • ee/packages/federation-matrix/jest.config.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.

Applied to files:

  • ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • ee/packages/federation-matrix/jest.config.ts
  • ee/packages/federation-matrix/tsconfig.build.json
  • ee/packages/federation-matrix/tsconfig.json
  • ee/packages/federation-matrix/package.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • ee/packages/federation-matrix/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • ee/packages/federation-matrix/jest.config.ts
  • ee/packages/federation-matrix/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • ee/packages/federation-matrix/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • ee/packages/federation-matrix/jest.config.ts
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • ee/packages/federation-matrix/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests

Applied to files:

  • ee/packages/federation-matrix/tsconfig.build.json
  • ee/packages/federation-matrix/package.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use `.spec.ts` extension for test files (e.g., `login.spec.ts`)

Applied to files:

  • ee/packages/federation-matrix/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • ee/packages/federation-matrix/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Store commonly used locators in variables/constants for reuse

Applied to files:

  • ee/packages/federation-matrix/tsconfig.build.json
📚 Learning: 2025-11-05T21:04:35.787Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37357
File: ee/packages/federation-matrix/src/setup.ts:103-120
Timestamp: 2025-11-05T21:04:35.787Z
Learning: In Rocket.Chat's federation-matrix setup (ee/packages/federation-matrix/src/setup.ts and apps/meteor/ee/server/startup/federation.ts), configureFederationMatrixSettings does not need to be called before setupFederationMatrix. The SDK's init() establishes infrastructure (database, event handlers, APIs) first, and the configuration can be applied later via settings watchers before actual federation events are processed. The config only matters when events actually occur, at which point all infrastructure is already configured.

Applied to files:

  • ee/packages/federation-matrix/package.json
🔇 Additional comments (9)
ee/packages/federation-matrix/jest.config.ts (1)

6-6: LGTM! Formatting simplified.

The transformIgnorePatterns array has been reformatted to a single line without any functional changes. The ignored patterns remain the same.

ee/packages/federation-matrix/tsconfig.json (1)

4-4: LGTM! Clean separation of source and build configurations.

Setting rootDir to "./src" in the base config and moving declaration generation to tsconfig.build.json provides a cleaner separation between source configuration and build output settings.

ee/packages/federation-matrix/tsconfig.build.json (1)

4-6: LGTM! Build configuration properly structured.

The build-specific TypeScript configuration correctly:

  • Sets output directory to "./dist" matching package.json paths
  • Enables declaration file generation
  • Extends the base tsconfig.json for shared compiler options

This separation ensures clean build artifacts while maintaining consistent base settings.

ee/packages/federation-matrix/tests/end-to-end/room.spec.ts (3)

1608-1608: LGTM! Clearer assertion pattern.

Replacing pendingInvitation?.rid! with pendingInvitation!.rid! is appropriate here since Line 1605 already asserts that pendingInvitation is not undefined. This makes the code's expectations more explicit and consistent with the preceding test assertion.


1647-1647: LGTM! Consistent with preceding assertion.

Same pattern as Line 1608 - the non-null assertion on pendingInvitation aligns with the assertion at Line 1644 that confirms it's not undefined.


1681-1681: LGTM! Consistent assertion pattern.

Same pattern as previous occurrences - the non-null assertion on pendingInvitation is consistent with the assertion at Line 1678.

ee/packages/federation-matrix/package.json (3)

12-12: LGTM! Consistent with build configuration changes.

Updating the dev script to use tsconfig.build.json aligns with the separation of build and source configurations introduced in this PR.


13-14: LGTM! Broader linting scope.

Expanding the lint scripts to cover the entire project directory instead of just src ensures consistent code quality across all TypeScript files, including tests and configuration.


40-52: LGTM! Babel dependencies removed as intended.

The removal of all Babel-related devDependencies (@babel/cli, @babel/core, @babel/preset-env, @babel/preset-typescript, and babel-jest) aligns with the PR objective to rely solely on TypeScript for transpilation. This simplifies the build toolchain and reduces maintenance overhead.

"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.

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Dec 18, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 18, 2025
@ggazzo ggazzo merged commit 65214b6 into develop Dec 18, 2025
53 checks passed
@ggazzo ggazzo deleted the chore/federation-matrix-build-configuration branch December 18, 2025 16:54
gaolin1 pushed a commit to gaolin1/medsense.webchat that referenced this pull request Jan 6, 2026
@dougfabris dougfabris modified the milestones: 7.14.0, 8.0.0 Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants