fix(cli): describe what e2e init changes in existing files
Merged
SA
18d ago+26+26+01234567890123456789-2-2-0123456789
What and why
e2e init --helpsaid it scaffolds "without touching existing files", but a rerun adds a missinge2edev dependency andtest:e2escript topackage.json, appends missing.gitignoreentries, and creates a missing example test. The help now says the config and test files stay as they are, andpackage.jsonand.gitignoreget only what they lack (packages/e2e/src/cli/index.ts:465).- The "Re-running init" reference said "no packages are added" for an existing config, which read as covering
e2eitself. It now separates the engine and gateway packages a kept config skips from the dependency, script, and ignore entries init still adds (docs/reference/cli.mdx). - Text only, plus a test for the re-run behavior the text now describes.
initbehaves the same.
Issue
Fixes #1368
Verified
Ran it locally: yes
- Built CLI (
packages/e2e/dist/cli/bin.js) on the issue's fixture, a directory with{"name":"example-project","private":true,"type":"module"}aspackage.jsonandexport default { targets: [] };ase2e.config.js. Rane2e init --help, thenE2E_TELEMETRY_DISABLED=1 e2e init --yes --gateway none --skills none --mcp none. Main is the same build withindex.tsfrom0d3e403c, the only code file this PR changes.
| main | this branch |
|---|---|
Scaffold a project without touching existing files: an ESM package.json, ... | Scaffold a project: an ESM package.json, ... An existing config and test files stay as they are; an existing package.json gets only the missing dependencies and scripts, and .gitignore only the missing entries. |
Both builds print the same run, which is what the new text describes:
▲ Exists, not touching: e2e.config.js
● Add dev dependencies: e2e@^0.21.3
● Add scripts: test:e2e (e2e run)
◆ Updated package.json
◆ Created tests/example.e2e.js
◆ Updated .gitignore (10 entries)
e2e.config.js hashes the same before and after on both.
- Rerun with an existing
tests/example.e2e.jsand"e2e": "1.2.3"indevDependencies: printsExists, not touching: tests/example.e2e.js, keeps the file and the1.2.3pin, and adds only the script. - New unit test in
tests/unit/cli-init.test.tspins that re-run: an existing config plus"e2e": "1.2.3"inpackage.jsongets only thetest:e2escript, no engine or gateway packages, and the pin stays. It fails ifaddDependenciesoverwrites existing entries or an existing config picks engine packages.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. - Breaking change: title carries
!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md). - Docs updated in the same PR: the
docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. - Contract change: emitted
.d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures. - Engine contract change (
e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.
🤖 Generated with Claude Code