fix(cli): add the desktop engine an existing config imports in e2e init
What
e2e init on a project whose existing config imports @e2e-dev/desktop adds @e2e-dev/desktop and @e2e-dev/core to package.json, as it already does for the web, mobile, and Electron engines.
Why
init knew only the engines that have a scaffold preset. The desktop engine has none, so for a config that imports it, init added no engine to package.json, and npm install then left the config unable to load.
How it works
packages/e2e/scripts/write-sibling-versions.tsrecords the@e2e-dev/desktopversion indist/cli/init/sibling-versions.jsonat build time, beside the other engines.importedDependenciesinpackages/e2e/src/cli/init/config-dependencies.tscounts@e2e-dev/desktopas an engine next to the presets' engines. An import of it adds the engine at the recorded range, and@e2e-dev/corewith it.docs/reference/cli.mdxlists the Electron and desktop engines among the packagesinitadds for a config's imports. The list named web and mobile only, though main already adds Electron.AGENTS.mdsays the desktop engine counts though it has no preset.
Verified
Ran it locally: yes
Scratch project with its own git root, a package.json with e2e only, and an e2e.config.ts that imports desktop from @e2e-dev/desktop. I ran CI=1 e2e init --yes --skills none --mcp none once with main's build and once with this branch's:
| main | this PR | |
|---|---|---|
devDependencies after init | { "e2e": "*" } | { "@e2e-dev/core": "^0.25.0", "@e2e-dev/desktop": "^0.0.1", "e2e": "*" } |
The new unit test in cli-init.test.ts fails with main's config-dependencies.ts and passes with this one.
🤖 Generated with Claude Code
Summary by CodeRabbit
-
Bug Fixes
- Rerunning
e2e initon an existing config now adds the desktop engine and its required core package topackage.jsonwhen they’re imported.
- Rerunning
-
Documentation
- Clarified which engine packages
e2e initadds when checking an existing config.
- Clarified which engine packages