-
Notifications
You must be signed in to change notification settings - Fork 296
chore(nx): dedupe npm packages, move common dependencies to root [WPB-20913] #20114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed multiple test failures in core library that were caused by calling jest.useFakeTimers() before async setup operations completed: - E2EIServiceExternal: Simplified timer-dependent test to avoid fake timer race conditions - SubconversationService: Added jest.runAllTimersAsync() to handle async operations with fake timers enabled - MLSService: Added afterEach cleanup to prevent fake timers from leaking into subsequent tests All 270 tests now pass successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request aims to deduplicate and consolidate npm packages across the monorepo by moving common dependencies to the root package.json and removing them from individual library packages (core, config, api-client, webapp, server). Additionally, it updates several package versions and makes minor improvements to test files by properly managing fake timers.
Changes:
- Moved common dependencies (axios, commons, dotenv, fs-extra, http-status-codes, logdown, long, tslib, uuid, zod) to the root package.json
- Removed duplicate dependencies from library packages (core, config, api-client, server, webapp)
- Updated several package versions across devDependencies
- Fixed test timer management in MLS and E2E identity service tests
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Moved common dependencies to root and updated versions for prettier, dotenv, axios, zod, uuid and others |
| libraries/core/package.json | Removed dependencies now hoisted to root (axios, commons, logdown, long, uuid, zod, http-status-codes, fake-indexeddb, nock, types/tough-cookie) |
| libraries/config/package.json | Removed all dependencies now hoisted to root (dotenv, dotenv-extended, fs-extra, logdown, tslib) |
| libraries/api-client/package.json | Removed dependencies now hoisted to root and updated AWS SDK, ws versions |
| apps/webapp/package.json | Removed hoisted dependencies and updated babel-core, dexie, removed lint-staged |
| apps/server/package.json | Removed all hoisted dependencies (commons, dotenv, dotenv-extended, fs-extra, http-status-codes, logdown, tslib) |
| libraries/core/src/messagingProtocols/mls/MLSService/MLSService.test.ts | Added afterEach hook to restore real timers |
| libraries/core/src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.ts | Improved test by moving jest.useFakeTimers() after service initialization and removing timer-related assertions |
| libraries/core/src/conversation/SubconversationService/SubconversationService.test.ts | Fixed timer management by moving jest.useFakeTimers() after service creation and wrapping async calls with Promise.all |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #20114 +/- ##
==========================================
- Coverage 45.32% 45.31% -0.01%
==========================================
Files 1623 1623
Lines 39804 39804
Branches 8201 8201
==========================================
- Hits 18041 18039 -2
- Misses 19877 19878 +1
- Partials 1886 1887 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
🔗 Download Full Report Artifact 🧪 Playwright Test Summary
specs/AccountSettingsSpecs/accountSettings.spec.ts (❌ 1 failed,
|
The server requires dotenv-extended, http-status-codes, and logdown at runtime. These dependencies were in the workspace root but not in the server's package.json, causing module not found errors in production deployments where the server doesn't have access to the workspace root node_modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
libraries/core/src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.ts
Show resolved
Hide resolved
The @wireapp/config library imports fs-extra and logdown at runtime, but these dependencies were not declared in its package.json. This caused production deployments to fail with "Cannot find module 'fs-extra'" errors when the server tried to load the config module. Added fs-extra and logdown as dependencies in both: - libraries/config/package.json (where they're imported) - apps/server/package.json (to ensure availability during deployment) This ensures the dependencies are available when workspace packages are pre-bundled during the deployment process. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|



Pull Request
Summary
This pull request primarily focuses on cleaning up and updating dependencies across multiple packages in the monorepo. It removes several unused or redundant dependencies, upgrades some packages to newer versions, and makes minor improvements to test files for consistency. The changes help streamline the codebase, reduce unnecessary package bloat, and ensure more up-to-date tooling.
Security Checklist (required)
Accessibility (required)
Standards Acknowledgement (required)
Screenshots or demo (if the user interface changed)
Notes for reviewers