Implementation:Microsoft Playwright Workspace
Appearance
Overview
Workspace is a build utility that manages the Playwright monorepo workspace, handling version bumps, package publishing, dependency synchronization, and alpha release management.
Description
The module provides two classes:
PWPackage-- represents a single package in the monorepo with its package.json, file lists, and publishing metadata
Workspace-- manages the collection of packages with operations including:
* Version management -- reads and sets versions across all packages * Alpha releases -- creates alpha version suffixes with timestamps * Dependency synchronization -- ensures internal package dependencies use consistent versions * Publishing -- orchestrates npm publish with proper ordering and canary/next/latest tag support * Package linking -- sets up local development linking between packages
The script supports multiple CLI commands: --get-version, --set-version, --ensure-consistent, --publish, and more.
Usage
Run as a CLI tool during development and CI for managing the monorepo workspace.
Code Reference
Source Location
utils/workspace.js (271 lines)
Class Signatures
class PWPackage {
constructor(descriptor)
// name, path, files, packageJSON, isPrivate
}
class Workspace {
constructor(rootDir, packages)
packages()
async version()
async setVersion(version)
async ensureConsistent()
async publish(options)
}
Execution
node utils/workspace.js --get-version
node utils/workspace.js --set-version 1.40.0
node utils/workspace.js --ensure-consistent
node utils/workspace.js --publish
I/O Contract
Inputs
- CLI arguments for the operation to perform
- Package.json files from all workspace packages
- Root package.json for version source of truth
Outputs
- Updated package.json files across the monorepo
- Published npm packages with appropriate tags
- Console output of version information
Related Pages
- Implementation:Microsoft_Playwright_CheckDeps -- Dependency validation
- Implementation:Microsoft_Playwright_Roll_Browser -- Browser version management
- Implementation:Microsoft_Playwright_Generate_Dotnet_Channels -- Code generation triggered by protocol changes
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment