Overview
Proton WebClients is a Yarn 4 monorepo containing multiple web applications and shared packages. The workspace structure enables efficient dependency management and code sharing across projects.Workspace Structure
The monorepo is organized into the following workspace categories:Directory Layout
- applications/ - Web applications (Mail, Drive, Calendar, Pass, etc.)
- packages/ - Shared libraries and utilities
- packages/wasm/ - WebAssembly modules
- tests/ - Test utilities and configurations
- vendor/ - Third-party dependencies
Managing Dependencies
Installing Dependencies
Install all dependencies for the entire monorepo:Yarn 4 uses the
node_modules linker strategy as configured in .yarnrc.yml.Adding Dependencies
- To Workspace Root
- To Specific Package
- Dev Dependencies
Add a dependency to the root workspace:
Removing Dependencies
Workspace Commands
List Workspaces
List all workspaces in the monorepo:Run Commands in Workspaces
- Single Workspace
- All Workspaces
Run a script in a specific workspace:Examples:
Workspace Naming
Workspace names follow these conventions:
- Applications:
proton-<app-name>(e.g.,proton-mail,proton-drive) - Packages:
@proton/<package-name>(e.g.,@proton/shared,@proton/components)
Common Workspace Packages
Core Packages
| Package | Description |
|---|---|
@proton/shared | Shared utilities and business logic |
@proton/components | React component library |
@proton/pack | Build tooling (webpack configuration) |
@proton/i18n | Internationalization utilities |
@proton/crypto | Cryptography utilities |
@proton/styles | Shared styles and themes |
@proton/icons | Icon library |
Application Packages
| Package | Application |
|---|---|
proton-mail | Proton Mail |
proton-calendar | Proton Calendar |
proton-drive | Proton Drive |
proton-pass | Proton Pass |
proton-account | Account settings |
proton-vpn-settings | VPN settings |
Version Management
Requirements
Manual Versioning
Version an application manually from the root folder:Turbo Configuration
The monorepo uses Turbo for task orchestration and caching:Troubleshooting
Dependency resolution issues
Dependency resolution issues
Clear the cache and reinstall:
Workspace not found
Workspace not found
Verify the workspace name:Check that the package exists in the correct directory.
Version conflicts
Version conflicts
Check for dependency version mismatches:Review
resolutions in root package.json for pinned versions.Best Practices
Use Workspace Protocol
Always use
workspace:^ for internal package dependenciesRun from Root
Execute workspace commands from the monorepo root directory
Check Dependencies
Use
yarn why to understand dependency resolutionLeverage Turbo
Take advantage of Turbo’s caching for faster builds