How wireapp/wire-web-packages works
Project type and purpose
• This is a monorepo of TypeScript-based npm libraries maintained by Wire’s web team.
• It uses Lerna and Yarn Workspaces to organize dozens of packages (API clients, UI components, utilities, tooling).
• Purpose: provide reusable building blocks (connectivity, core logic, UI, storage engines, utilities, internal tools) for Wire’s web applications and third-party developers.
File structure
• Top-level files: lerna.json, package.json, yarnrc.yml, .github CI workflows, tsconfig.json.
• ‘packages/’: each subfolder is an independent npm module.
• Configuration packages: eslint-config, prettier-config
• Core libraries: core, commons, priority-queue, promise-queue, store-engine and its engines (dexie, fs, bro-fs, sqleet, web-storage), api-client, cli-client
• UI kit: react-ui-kit, storybook config
• Bots: bot-api, changelog-bot
• Internal tools: copy-config, license-collector, telemetry, webapp-events, certificate-check
• Build/test: each package has its own tsconfig.json, jest.config.js or jasmine.json, build scripts.
• CI: workflows for linting, testing, publishing.
README for additional insights
• It enumerates all published packages grouped by domain (Bots, Commons, Configuration, Connectivity, Encoding, Tools, UI).
• It prescribes Yarn + Lerna to bootstrap and test, and a standardized release process.
Main components and relationships
a. Components
1) Monorepo root (Lerna/Yarn Workspaces orchestrator)
2) Package groups (by domain):
• Configuration (eslint/prettier)
• Core logic (core, commons, priority-queue, promise-queue, store-engine family)
• Connectivity (api-client, cli-client)
• UI (react-ui-kit)
• Bots (bot-api, changelog-bot)
• Internal tools (copy-config, license-collector, telemetry, webapp-events, certificate-check)
3) Build/test/CI subsystem
4) External systems: npm registry, GitHub Actions, Storybook UI
b. Relationships & interactions
• The monorepo root configures workspaces and dependency graph.
• Core logic packages have minimal mutual dependencies:
• commons is a low-level utility used by many others
• store-engine and its engines provide storage abstractions used by core
• core implements domain services (account, auth, conversation) on top of store-engine
• Connectivity packages depend on core and commons for building client SDKs:
• api-client uses core services and HTTP layer to expose REST/WS APIs
• cli-client is a thin CLI wrapper over api-client + core-crypto
• UI kit depends on commons (utilities) and optionally on core messages/types to render UI components.
• Bots sit atop api-client to implement specific automation scenarios.
• Internal tools are standalone CLIs or libraries for code-gen, license collection, telemetry embed.
• CI orchestrates build/test/publish across all packages, using GitHub Actions, Husky, Prettier, ESLint, Jest/ Jasmine.
Architectural patterns and design principles
• Monorepo with explicit domain grouping
• Strict boundary between layers: utilities → core → connectivity → UI/tools → bots
• Each package is small, single-responsibility, with its own test suite and build config
• Dependency inversion: higher-level packages (bots, UI) depend on abstractions in lower layers (core, commons)
• Workspace tooling: Lerna for versioning, Yarn Workspaces for fast installs