Description
Part of #277
Covers commits eb6969d and c25dcde, which rename the distribution, module and directory to selenium-devtools-py / selenium_devtools, plus the work adding packages/backend/src/server.ts.
Why the naming changed
devtools-selenium and @wdio/selenium-devtools differ only in word order, which reads as a typo rather than a family. Naming by language gives one predictable shape across registries: @wdio/selenium-devtools on npm, selenium-devtools-py on PyPI, selenium-devtools-java on Maven if that happens. The distribution carries the language marker and the import does not, following kafka-python, redis-py and elasticsearch-py.
Why the backend needed a new entry
node packages/backend/dist/index.js imported a module and exited 0 without serving, and npx @wdio/devtools-backend failed with "could not determine executable to run". Both of the Python adapter's spawn tiers were therefore dead, and enable() could not start a dashboard at all.
The cause is not the two-entry build. show-trace.ts imports start from index.ts, which makes index a shared module whose body tsup hoists into dist/chunk-*.js; there import.meta.url is the chunk's own path and can never equal process.argv[1], so index's "start if run directly" guard was dead in every build ever produced. show-trace.js works for the inverted reason: nothing imports it, so a leaf entry keeps its body in its own output file.
src/server.tsis a leaf CLI entry with a shebang, exposed as thedevtools-backendbin, accepting--port,--hostnameand--help. It needs no guard.src/server-args.tsholds the argv parsing, becauseserver.tsstarts a server as its module body and a test cannot import that.- The dead guard and its
node:urlimport are deleted rather than repaired. server.tsprints its own listening line. The Python adapter scraped Fastify's logger for the bound port, which would have broken iflogger: trueever changed.dev:appwas watchingdist/index.js, an entry that could not start.
Acceptance criteria
- pip name, import name and directory agree
-
node dist/server.jsandnpx @wdio/devtools-backendboth serve -
enable()starts a backend with no environment variables set - The dead guard is deleted, not repaired
- Changeset added, and the backend pin points at the version that carries the bin
- Full vitest, python tests, typecheck and lint green
Activity
[-]Rename to selenium-devtools-py and give the backend a runnable CLI entry[/-][+]Land the Python adapter (live mode), the naming, and the backend CLI entry[/+]