Repository navigation
Resolve WebdriverIO services, local runner and community reporters - #2309
Merged
Merged
Conversation
WebdriverIO loads every runner, framework, reporter and service name through initializePlugin: scoped names are imported as is, other names as @wdio/<name>-<type> and then wdio-<name>-<type>. The plugin skipped `runner: 'local'` and `services`, and always mapped reporters to the @wdio/ scope, so @wdio/local-runner and service packages were reported unused, and a community reporter such as `obsidian` was reported unused next to an unlisted @wdio/obsidian-reporter that does not exist. Pick the community package when it is the one declared in package.json.
commit: |
WebdriverIO imports @wdio/<name>-<type> and falls back to wdio-<name>-<type> when that is not installed. Ask the resolver the same question from the config file's directory instead of reading the workspace and root manifests, so core keeps crediting the declared package, also in ancestor workspaces.
WebdriverIO uses the local runner when `runner` is not set, so a config without it needs @wdio/local-runner.
webpro
approved these changes
Nov 11, 2026
webpro
left a comment
Member
There was a problem hiding this comment.
Thanks! I pushed two commits on top:
- The plugin now picks the community package when it resolves and the
@wdio/one doesn't, asinitializePlugindoes, instead of readingpackage.jsonitself. Core already owns the declared dependencies and credits them in ancestor workspaces too. A package hoisted to the root resolves from a child workspace as well, so the separate workspace fixture is gone. runnerdefaults tolocal, so@wdio/local-runneris no longer reported unused whenrunnerisn't set.
Member
|
ð This pull request is included in v6.45.1. See Release 6.45.1 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebdriverIO loads the runner, framework, reporters and services through
initializePlugin: a scoped name is imported as is, any other name as@wdio/<name>-<type>and thenwdio-<name>-<type>. The plugin skippedrunner: 'local'andservices, and always used the@wdio/scope for reporters. So@wdio/local-runnerand service packages are reported unused, and withreporters: ['obsidian'](wdio-obsidian-service's setup) Knip reportswdio-obsidian-reporterunused next to an unlisted@wdio/obsidian-reporter, which doesn't exist. Projects work around it inignoreDependencies, e.g. ansible/vscode-ansible.All four now go through the same lookup. The
wdio-package is picked only when it's declared in the workspace's or the root package.json and the@wdio/one isn't. Plugin classes, objects and absolute paths are skipped.The existing fixture now has a local runner, two services and a community reporter, and a new workspace fixture declares the community packages in the root package.json; both tests fail with only the plugin source reverted. On saberzero1/motions with its wdio
ignoreDependenciesremoved, and on flowing-abyss/obsidian-tabbed withwebdriver-io.configpointed at itstests/e2econfigs in place of the ignores, the unused@wdio/local-runner,wdio-obsidian-reporterand the unlisted@wdio/obsidian-reporterare gone (plus@wdio/appium-servicein the second), and nothing else changes.