Skip to content

Conversation

@tassoevan
Copy link
Contributor

@tassoevan tassoevan commented Nov 24, 2025

Proposed changes (including videos or screenshots)

It normalizes TypeScript and ESLint configurations for @rocket.chat/ui-contexts.

Issue(s)

ARCH-1888

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Updated ESLint configuration to streamline linting rules.
    • Consolidated package metadata and build scripts for better module distribution.
    • Enhanced TypeScript configuration for improved build consistency.

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

@tassoevan tassoevan added this to the 7.14.0 milestone Nov 24, 2025
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 24, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 7.14.0, but it targets 7.13.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2025

⚠️ No Changeset found

Latest commit: 1f61463

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 Nov 24, 2025

Walkthrough

Consolidates and standardizes the build configuration for the packages/ui-contexts package. Updates ESLint configuration, restructures package.json with consolidated public fields and dependencies, introduces a separate tsconfig.build.json for build-specific settings, and refines tsconfig.json to use multiple root directories.

Changes

Cohort / File(s) Summary
ESLint Configuration
packages/ui-contexts/.eslintrc.json
Removed plugin:react-hooks/recommended from extends array; simplified ignorePatterns from **/dist to dist
Package Metadata
packages/ui-contexts/package.json
Consolidated and restructured public fields (main, typings, files, scripts); unified dependencies block with @rocket.chat/password-policies; removed duplicate/legacy configuration blocks
TypeScript Build Configuration
packages/ui-contexts/tsconfig.build.json
New file added; extends base tsconfig and excludes test/spec files and Jest config
TypeScript Base Configuration
packages/ui-contexts/tsconfig.json
Updated rootDirs to include both ./src and ./; removed explicit module and outDir settings; extended include to cover ./jest.config.ts

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify package.json exports are correctly configured for both CommonJS and TypeScript consumers
  • Confirm TypeScript configuration changes do not break existing build or IDE tooling
  • Validate that the separate tsconfig.build.json properly excludes test files during production builds

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo

Poem

🐰 A rabbit hops through configs with care,
ESLint rules trimmed, TypeScript laid bare,
Package.json neat, with paths all aligned,
Build configurations perfectly designed,
From chaos to clarity—neat and pristine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(ui-contexts): Review build configuration' accurately reflects the main change: normalizing and reviewing TypeScript and ESLint configurations for the ui-contexts package.
Linked Issues check ✅ Passed The PR addresses ARCH-1888's objective to review and normalize build configuration for ui-contexts, including ESLint, TypeScript configs, and package.json manifest standardization.
Out of Scope Changes check ✅ Passed All changes are scoped to build configuration normalization: ESLint config updates, TypeScript configuration files, and package.json manifest standardization for the ui-contexts package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/ui-contexts-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

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 358MiB 346MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +176B
queue-worker-service 132MiB 132MiB -932B
ddp-streamer-service 127MiB 127MiB -24B
account-service 114MiB 114MiB -104B
stream-hub-service 111MiB 111MiB -733B
authorization-service 111MiB 111MiB -814B
presence-service 111MiB 111MiB +334B

📊 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/24 17:37 (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]
  line "authorization-service" [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]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 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]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 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]
Loading

Statistics (last 7 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-37598
  • Baseline: develop
  • Timestamp: 2025-11-24 17:37:29 UTC
  • Historical data points: 7

Updated: Mon, 24 Nov 2025 17:37:30 GMT

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.84%. Comparing base (6f8dc11) to head (1f61463).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37598   +/-   ##
========================================
  Coverage    68.84%   68.84%           
========================================
  Files         3361     3361           
  Lines       114342   114342           
  Branches     20619    20619           
========================================
+ Hits         78714    78715    +1     
- Misses       33530    33537    +7     
+ Partials      2098     2090    -8     
Flag Coverage Δ
e2e 57.35% <ø> (-0.02%) ⬇️
e2e-api 42.21% <ø> (ø)

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 marked this pull request as ready for review November 24, 2025 18:45
@tassoevan tassoevan requested a review from a team as a code owner November 24, 2025 18:45
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: 0

🧹 Nitpick comments (1)
packages/ui-contexts/package.json (1)

10-17: Consolidate duplicate test scripts.

Both "test" and "testunit" scripts on lines 15–16 are identical (both run "jest"). Typically, one script name suffices unless there is a semantic distinction (e.g., unit tests vs. integration tests). Having duplicate scripts can cause confusion during maintenance.

Consider removing one script or clarifying their purpose if they serve different test suites. If there is no distinction, keep only "test".

📜 Review details

Configuration used: CodeRabbit 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 6f8dc11 and 1f61463.

📒 Files selected for processing (4)
  • packages/ui-contexts/.eslintrc.json (1 hunks)
  • packages/ui-contexts/package.json (2 hunks)
  • packages/ui-contexts/tsconfig.build.json (1 hunks)
  • packages/ui-contexts/tsconfig.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
📚 Learning: 2025-11-24T17:08:17.039Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.039Z
Learning: Applies to **/*.spec.ts : Use `.spec.ts` extension for test files (e.g., `login.spec.ts`)

Applied to files:

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

Applied to files:

  • packages/ui-contexts/tsconfig.build.json
  • packages/ui-contexts/tsconfig.json
📚 Learning: 2025-11-24T17:08:17.039Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.039Z
Learning: Applies to **/*.{ts,tsx,js} : Avoid code comments in the implementation

Applied to files:

  • packages/ui-contexts/tsconfig.json
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

Applied to files:

  • packages/ui-contexts/package.json
🔇 Additional comments (7)
packages/ui-contexts/.eslintrc.json (2)

2-2: Verify that removing react-hooks ESLint recommendation is intentional.

The package is React-based and includes eslint-plugin-react-hooks in devDependencies. Removing "plugin:react-hooks/recommended" disables critical ESLint rules for React Hook compliance (e.g., dependency array validation, hook call conditions). This should be an active, deliberate decision.

Can you confirm that this removal is intentional and that the package does not need these hook-related lint rules?


3-3: Verify that ignorePatterns scope change does not miss nested dist directories.

The ignorePatterns changed from "**/dist" (recursive, matches all dist directories) to "dist" (top-level only). If this package has nested directories with dist folders, they will no longer be ignored by ESLint.

Please verify that there are no nested dist directories in this package that should be ignored, or update the pattern to **/dist if recursive matching is needed.

packages/ui-contexts/tsconfig.json (2)

4-4: Clarify the purpose of rootDirs including both source and root directories.

Using rootDirs with both "./src" and "./" is unconventional. The rootDirs option is primarily for output mapping; for source organization, a single rootDir pointing to "./src" is typical. Including "./" (root) alongside "./src" may cause unexpected module resolution behavior or allow imports from unintended locations.

Can you explain the intent behind this rootDirs configuration? If the goal is to allow imports from both src and root, consider whether this is the desired module resolution behavior, or if a simpler single rootDir would suffice.


7-7: Move jest.config.ts inclusion to build-time configuration, not main TypeScript config.

The jest.config.ts should not typically be included in the main project's TypeScript compilation (include array). Test configuration files are usually only type-checked during development or as part of tooling, not bundled as part of the project. The new tsconfig.build.json file already excludes this file, which is correct for production builds, but including it here in the main tsconfig may cause unexpected behavior.

Please verify whether jest.config.ts should be in the main tsconfig.json or if it should be excluded here (and only handled separately during development/testing).

packages/ui-contexts/tsconfig.build.json (1)

1-4: Build configuration properly excludes test artifacts; however, verify against parent tsconfig patterns.

The new build configuration correctly excludes test files (.spec.ts, .spec.tsx) and jest configuration. However, since this extends tsconfig.json, it inherits the jest.config.ts inclusion from the parent config and then explicitly excludes it here—a redundant pattern. This becomes consistent only if jest.config.ts is also removed from the main tsconfig.json.

Please verify that the parent tsconfig.json is updated to exclude or remove jest.config.ts from its include array, or confirm that the dual inclusion/exclusion is intentional for your build workflow.

packages/ui-contexts/package.json (2)

4-9: Contradictory package configuration: marked private but declares public package fields.

The package is marked "private": true on line 4, yet lines 5–9 add public package fields (main, typings, files). Private packages in monorepos typically do not need these fields, as they are not published to npm. If this package is intended to remain private (not published), these fields are unnecessary. If it will be published, remove or update the "private" flag.

Please clarify the publication intent: Is this package private to the monorepo, or should it be published to npm?


11-12: Verify that build and dev scripts correctly reference the new tsconfig.build.json.

The build script (line 11) uses -p tsconfig.build.json to reference the new build-specific configuration, which correctly excludes test files. The dev script (line 12) uses watch mode with the same config. Confirm that this aligns with your monorepo's build expectations and that the TypeScript configuration chain (base → build) works as intended.

Run a build to verify that the build output is generated correctly in ./dist and contains only production code (no test files or jest config).

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Nov 25, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 25, 2025
@ggazzo ggazzo merged commit ccc06a1 into develop Nov 25, 2025
92 of 94 checks passed
@ggazzo ggazzo deleted the chore/ui-contexts-build-configuration branch November 25, 2025 14:48
@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