This guide will help you set up the WebdriverIO Desktop & Mobile monorepo for development.
Before you begin, ensure you have the following installed:
-
Node.js: Version 24 LTS
node --version # Should be v24.x -
pnpm: Version 10.27.0 or higher
npm install -g pnpm pnpm --version # Should be 10.27.0+ -
Git: For version control
git --version
git clone https://github.com/webdriverio/desktop-mobile.git
cd desktop-mobilepnpm installThis will:
- Install all root-level dependencies
- Install dependencies for all packages
- Link workspace packages together
- Set up Git hooks with Husky
pnpm turbo buildThis builds all packages in the correct dependency order using Turborepo's intelligent caching.
pnpm testThis runs tests for all packages and ensures everything is working correctly.
# Build all packages
pnpm turbo build
# Build a specific package
pnpm --filter @wdio/electron-service build
pnpm --filter @wdio/tauri-service build
# Clean and rebuild
pnpm clean
pnpm turbo build# Run all tests
pnpm test
# Run tests with coverage
pnpm test:coverage
# Run tests for specific package
pnpm --filter @wdio/electron-service test
# Run tests in watch mode
pnpm --filter @wdio/electron-service vitest# Lint all packages
pnpm lint
# Lint and auto-fix
pnpm lint:fix
# Format code
pnpm format
# Type check all packages
pnpm typecheck# Watch mode for all packages
pnpm dev
# Watch mode for specific package
pnpm --filter wdio-electron-service devdesktop-mobile/
├── .github/
│ └── workflows/ # CI/CD workflows
├── packages/ # All packages
│ ├── electron-service/ # Electron WDIO service
│ ├── tauri-service/ # Tauri WDIO service
│ ├── tauri-plugin/ # Tauri v2 plugin (Rust + JS)
│ ├── electron-cdp-bridge/ # Chrome DevTools Protocol bridge
│ ├── native-utils/ # Cross-platform utilities
│ ├── native-types/ # Shared TypeScript type definitions
│ ├── native-spy/ # Spy utilities for mocking
│ └── bundler/ # Build tooling
├── fixtures/ # Test fixtures and example apps
│ ├── e2e-apps/ # E2E test applications
│ │ ├── electron-*/ # Electron E2E apps
│ │ └── tauri/ # Tauri E2E app
│ └── package-tests/ # Package test fixtures
│ └── tauri-app/ # Tauri package test app
├── e2e/ # E2E test scenarios
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
├── package.json # Root package.json
├── pnpm-workspace.yaml # Workspace configuration
├── turbo.json # Turborepo configuration
├── tsconfig.base.json # Base TypeScript config
└── vitest.config.ts # Vitest configuration
See package-structure.md for detailed guidelines.
Quick steps:
- Create package directory:
packages/my-package/ - Copy structure from
packages/electron-service/ - Update
package.jsonwith your package details - Implement your code in
src/ - Add tests in
test/ - Build:
pnpm --filter @wdio/my-package build(use thenamefrom package.json) - Test:
pnpm --filter @wdio/my-package test
# Add dependency to specific package
pnpm --filter @wdio/electron-service add some-package
# Add dev dependency
pnpm --filter @wdio/electron-service add -D some-dev-package
# Add workspace dependency
pnpm --filter @wdio/electron-service add @wdio/native-utils@workspace:*Common dependencies are managed through pnpm's catalog feature in pnpm-workspace.yaml.
To use a catalog dependency:
{
"devDependencies": {
"typescript": "catalog:default",
"vitest": "catalog:default"
}
}The project uses three catalogs to test against different versions of key dependencies:
| Catalog | Purpose |
|---|---|
default |
Stable production versions — the reliable baseline |
next |
Latest/nightly versions — validates upcoming compatibility |
minimum |
Lowest supported versions — ensures backward compatibility |
pnpm catalog:default # Switch all packages to stable versions
pnpm catalog:next # Switch all packages to latest/nightly versions
pnpm catalog:minimum # Switch all packages to lowest supported versions# Update all catalogs and dependencies interactively
pnpm update:dependencies
# Update the Tauri version across packages (npm + Cargo.toml)
pnpm update:tauri
# Preview catalog changes without applying them
pnpm catalog:update:dry
# Target a specific catalog
pnpm catalog:update --default
pnpm catalog:update --next
pnpm catalog:update --minimumThe update process shows available updates, lets you select which to apply, updates pnpm-workspace.yaml, then runs pnpm install.
Turborepo caches task outputs to speed up subsequent runs.
The local cache is stored in .turbo/ and is automatically used.
# Clear Turborepo cache
pnpm clean:cache
# Force rebuild (bypass cache)
pnpm turbo build --force# Clean all build artifacts and caches
pnpm clean
# Clean just the Turbo cache
pnpm clean:cache# Run the same checks as CI
pnpm lint
pnpm typecheck
pnpm test
pnpm turbo build# Update all catalogs and dependencies interactively
pnpm update:dependencies
# Update the Tauri version across packages (npm + Cargo.toml)
pnpm update:tauriTry cleaning and reinstalling:
pnpm clean
pnpm install
pnpm turbo buildRebuild the project:
pnpm turbo build --forceMake sure packages are built:
pnpm turbo build
pnpm testReinstall Husky:
pnpm prepareRecommended extensions:
- ESLint: Microsoft ESLint extension
- Biome: Biome formatter
- TypeScript and JavaScript Language Features: Built-in
Workspace settings (.vscode/settings.json):
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
}
}For working with Tauri packages and plugins:
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install Tauri CLI:
cargo install tauri-cli # or npm install -g @tauri-apps/cli -
Build Tauri Plugin:
cd packages/tauri-plugin cargo build -
Build Tauri Test Apps:
cd fixtures/e2e-apps/tauri pnpm tauri build
See the Tauri Plugin README for detailed setup instructions.
- Read package-structure.md for package conventions
- Read CONTRIBUTING.md for contribution guidelines
- Read AGENTS.md for AI assistant context and coding standards
- Explore the Electron service implementation in
packages/electron-service/ - Explore the Tauri service implementation in
packages/tauri-service/ - See Tauri Plugin README for Tauri plugin setup
This project uses Agent OS for AI-assisted development. The AGENTS.md file contains context for AI tools like Claude Code, Cursor, and others.
Available slash commands (Claude Code):
/discover-standards- Extract patterns from the codebase into documented standards/inject-standards- Inject standards into context for consistent AI assistance/shape-spec- Enhanced spec shaping with standards awareness
- Issues: Report bugs or request features on GitHub Issues
- Discussions: Ask questions on GitHub Discussions
- WebdriverIO: See WebdriverIO documentation