Skip to content

Conversation

@aweiss-dev
Copy link
Member

@aweiss-dev aweiss-dev commented Dec 21, 2025

TaskWPB-22420 [Web] General maintenance ticket for PR merges

PR Summary: Nx Monorepo Migration

Overview

This PR migrates the wire-webapp repository from a standard Yarn workspace to an Nx monorepo (v22.3.3). This is a major structural refactoring that introduces Nx's build system, improved caching, and better project organisation.


Major Technical Changes

1. Nx Monorepo Setup

New Configuration Files

File Purpose
nx.json Nx workspace configuration with caching and target defaults
tsconfig.base.json Base TypeScript configuration for workspace
jest.preset.js Shared Jest preset for all projects
eslint.config.ts New flat ESLint 9+ configuration (replaces .eslintrc.js)
lint-staged.config.js Lint-staged configuration

Root Project Configuration

  • project.json - Workspace tools project with targets for:
    • Docker image building
    • Changelog generation (production/staging/rc)
    • Release automation
    • Jest cache clearing

2. Directory Restructuring

The repository structure has been reorganised to follow Nx conventions:

Before:                    After:
├── server/               ├── apps/
├── src/                 │   ├── server/
├── test/                │   └── webapp/
├── webpack.config.js     ├── libraries/ (empty, prepared for future migrations)
└── ...                  └── ...

Key Moves:

  • server/apps/server/
  • src/apps/webapp/src/
  • test/apps/webapp/test/
  • Root config files → apps/webapp/ (e.g., webpack.config.js, jest.config.ts)

3. Application Project Configurations

Webapp Application (apps/webapp/project.json)

Target Description
build Bundles webapp (depends on server:build)
test Jest unit tests with CI configuration
e2e Playwright end-to-end tests
lint ESLint (depends on stylelint and type-check)
stylelint Less/CSS linting with Prettier
type-check TypeScript type checking
check-circular Circular dependency detection
translate-* Translation extraction/merge/type generation
configure Environment config and icon generation

Server Application (apps/server/project.json)

Target Description
build TypeScript compilation + asset copying
package Full server packaging with webapp bundling
serve Nx node executor with watch mode
test Jest unit tests
type-check TypeScript type checking

4. Package Manager Upgrade

Component Before After
Yarn v4.1.1 v4.12.0
Yarn lock file server/yarn.lock Root yarn.lock (consolidated)

5. TypeScript Configuration Changes

New Files

Root tsconfig.json Changes

  • Updated to reference workspace structure
  • Added extends: "./tsconfig.base.json"

6. ESLint Migration to Flat Config (ESLint 9+)

The old .eslintrc.js has been replaced with eslint.config.ts:

Key Features:

  • Flat config format (ESLint 9+ standard)
  • Type-aware linting via TypeScript project service
  • Project-specific parser options
  • Separate rule sets for:
    • TypeScript/TSX files
    • JavaScript/JSX files
    • Test files (relaxed rules)
  • Custom header rule with dynamic year
  • Import resolver configured for apps/webapp

7. CI/CD Pipeline Updates

GitHub Workflows

All workflows in .github/workflows/ updated:

  • ci.yml - Updated for Nx commands
  • create_docker_image.yml - Docker build adjustments
  • deploy-to-test-env.yml - Deployment path updates
  • playwright-*.yml - E2E test configuration updates
  • publish.yml - Release workflow updates
  • precommit*.yml - Pre-commit workflow adjustments

Codecov Configuration

codecov.yml updated with new coverage paths:

  • coverage/apps/webapp/
  • coverage/apps/server/

Jenkinsfile

Updated to work with new Nx-based build commands.

8. Build System Changes

Webpack Configuration

9. Nx Caching and Performance

The nx.json configuration enables intelligent caching

10. Workspace Configuration

Root package.json Changes

  • Added Nx devDependencies (@nx/*)
  • Updated workspaces: ["apps/*"] (ready for libraries/*)
  • New scripts using Nx commands:
    • bundle:devnx build webapp --configuration=development
    • bundle:prodnx build webapp --configuration=production
    • lintnx run-many -t lint --all
    • testnx run-many -t test --all
    • type-checknx run-many -t type-check --all

11. File-Specific Changes

Deleted Files

  • .eslintrc.js - Replaced by eslint.config.ts
  • .lintstagedrc.json - Replaced by lint-staged.config.js
  • server/yarn.lock - Consolidated into root yarn.lock
  • Procfile - Moved to apps/server/
  • tsconfig.build.json - Moved/replaced by app-specific configs

New Files

  • apps/webapp/.gitignore - Webapp-specific ignores
  • apps/webapp/bin/transalations_generate_types.js - Translation type generation (moved)
  • apps/webapp/bin/translations_extract_formatter.js - Translation extraction formatter (moved)

12. Test Configuration Updates

Jest

Playwright

13. Additional Configuration Updates

File Changes
.nvmrc Node version requirement updated
.gitignore Added patterns for new structure
.prettierignore Updated ignore patterns
.elasticbeanstalk/config.yml Deployment config updated
.github/labeler.yml PR labeler updated
docs/ADRs/2025-12-29-nx-monorepo-migration.md Added an ADR describing the change

Benefits of This Migration

  1. Improved Build Performance - Nx caching prevents unnecessary rebuilds
  2. Better Project Organization - Clear separation of concerns with apps/ and libraries/
  3. Unified Tooling - Consistent commands across all projects
  4. Type-Aware Linting - ESLint with TypeScript project service
  5. Scalability - Ready for library migrations
  6. Modern ESLint - Flat config format (ESLint 9+)

Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Accessibility (required)

Standards Acknowledgement (required)


Screenshots or demo (if the user interface changed)

Notes for reviewers

  • Trade-offs:
  • Follow-ups (linked issues):
  • Linked PRs (e.g. web-packages):

iskvortsov and others added 30 commits December 4, 2025 14:42
…age view [WPB-22205] (#19844)

* chore(e2e): Updated id for for image parent element in detail view for e2e test [WPB-22205]

* Added @regression tag to wire cells test so that it runs with the regression suite
* fix: add guard on join/call buttons.

* fix: return empty cleanup method
- Install Nx dependencies
- Create nx.json with build caching configuration
- Set up default targets and inputs

[skip ci]
Preserves git history by using git mv.
No code changes, pure directory restructure.
- Configure build, serve, and test targets
- Set up TypeScript compilation with @nx/js:tsc
- Define project metadata and tags
- Create shared tsconfig.base.json at root
- Extend base config in server tsconfig
- Maintain existing compiler options
- Add nx commands for server operations
- Update build:prod to use nx run-many
- Maintain backward compatibility with existing scripts
Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 11.3.1 to 11.3.2.
- [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md)
- [Commits](jprichardson/node-fs-extra@11.3.1...11.3.2)

---
updated-dependencies:
- dependency-name: fs-extra
  dependency-version: 11.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…19849)

Bumps [@wireapp/commons](https://github.com/wireapp/wire-web-packages) from 5.4.9 to 5.4.10.
- [Commits](https://github.com/wireapp/wire-web-packages/compare/@wireapp/commons@5.4.9...@wireapp/commons@5.4.10)

---
updated-dependencies:
- dependency-name: "@wireapp/commons"
  dependency-version: 5.4.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…19850)

Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.28.0 to 4.28.1.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](browserslist/browserslist@4.28.0...4.28.1)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Server successfully migrated to Nx monorepo structure:
- Build target working
- Serve target working
- Tests passing
- Git history preserved
Preserves git history with git mv.
No code changes.
- Move resource/ directory
- Move assets/ directory
- Move test/ directory
Git history preserved.
- babel.config.js
- jest.config.ts
- playwright.config.ts
- postcss.config.js
- setupTests.js

Git history preserved.
- Extend from root tsconfig.base.json
- Update outDir to dist/apps/webapp
- Maintain all existing paths and options
- Configure webpack build with existing configs
- Set up dev server with HMR
- Configure Jest for unit tests
- Configure Playwright for E2E tests
- Add linting target
- Update DIST_PATH to point to dist/apps/webapp
- Update ROOT_PATH to point to monorepo root
- Update server config import path
- fix wrong src/ paths
- create webapp package.json with nx scripts
- Add workspace configuration
- Add nx scripts for all operations
- Add affected commands for CI optimization
- Maintain all existing dependencies
- Create shared jest.preset.js
- Update webapp jest config to use preset
- Fix module paths for monorepo structure
- Unify tsconfigs
- Unify eslint configs
- Fix all existing eslint issues
- Run eslint --fix where possible
- update .gitignore to ignore Nx cache and dist
- update nvmrc to node 24
- fix unit test runs
- move all existing scripts to use nx commands
…94] (#19846)

* feat: add aria label and also title on the close screen share icon

* feat: replace button with div and assigned role=button to it. Move inline css to styles.ts

* feat: call controls were not working using keyboard.
* runfix(countly): change url

* Update src/script/Config.ts



---------

Co-authored-by: Adrian Weiß <77456193+aweiss-dev@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Bumps [@wireapp/commons](https://github.com/wireapp/wire-web-packages) from 5.4.9 to 5.4.10.
- [Commits](https://github.com/wireapp/wire-web-packages/compare/@wireapp/commons@5.4.9...@wireapp/commons@5.4.10)

---
updated-dependencies:
- dependency-name: "@wireapp/commons"
  dependency-version: 5.4.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.28.0 to 4.28.1.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](browserslist/browserslist@4.28.0...4.28.1)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@aweiss-dev aweiss-dev requested a review from Copilot December 22, 2025 13:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@markbrockhoff
Copy link
Collaborator

markbrockhoff commented Dec 22, 2025

FYI: You'll need to update the dotenv config in playwright.config.ts in order for the tests to work again.

From

config({path: './test/e2e_tests/.env'});

to

import {resolve} from 'node:path';
 
config({path: resolve(__dirname, './test/e2e_tests/.env')});

dotenv uses the CWD as base by default which changed due to the monorepo migration. Resolving based of the dirname couples it to the file position instead. (I'd prefer to use import.meta.dirname instead, but that would require a migration to type: module in the package.json as well.

@aweiss-dev aweiss-dev marked this pull request as ready for review December 24, 2025 07:21
Copilot AI review requested due to automatic review settings December 24, 2025 07:21
@aweiss-dev aweiss-dev requested review from a team and otto-the-bot as code owners December 24, 2025 07:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings December 29, 2025 08:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@aweiss-dev aweiss-dev changed the title chore(nx): migrate to monorepo structure chore(nx): migrate to monorepo structure [WPB-22420] Dec 29, 2025
Copilot AI review requested due to automatic review settings December 29, 2025 22:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings January 5, 2026 13:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings January 5, 2026 15:39
@aweiss-dev aweiss-dev merged commit 2f3d98d into dev Jan 5, 2026
15 of 17 checks passed
@aweiss-dev aweiss-dev deleted the dev_new branch January 5, 2026 15:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants