CodeVetter · Repo Unpack · Extension points
webdriverio/webdriverio
Extension is built into both user configuration and package internals. Name-based plugin loading supports official and community packages, while service activation distinguishes launcher and worker responsibilities. Command barrels and protocol descriptor tables construct client APIs. Custom locators, framework adapters, reporters, automation drivers, and compiler plugins provide additional integration seams.
- initializePlugin resolves scoped or absolute imports first, then @wdio/<name>-<type>, then wdio-<name>-<type>, and throws an actionable error when no candidate loads.
- Services accept existing hook objects, classes, or package names; package launcher exports run in the parent, and shouldLoad(config, caps) can prevent a package from being imported into workers.
- Browser and element commands enter their scopes through export barrels; applyScopePrototype enumerates those exports and excludes names listed in IGNORED_COMMAND_FILE_EXPORTS.
- addCommand and overwriteCommand are propagated across multiremote instances; runner session replacement also preserves custom and overwritten commands registered against the preliminary stub.
- addLocatorStrategyHandler stores named functions in a strategies Map, rejects duplicate names, and propagates registrations to multiremote constituent instances.
- automationProtocol selects the Driver factory or protocol stub; protocol getPrototype converts endpoint/method descriptor entries into command functions rather than hand-writing each HTTP method.
- Local framework adapters load through initializePlugin(config.framework, 'framework') and expose init/run behavior; reporter configuration accepts custom classes or tuples with options and supports asynchronous synchronization.
- The compiler has package-specific esbuild plugin tables, including protocol type generation, create-wdio template copying, and webdriverio external scripts; BiDi generation derives TypeScript definitions and command methods from CDDL.