Skip to content

fix: overwrite prompt, option parsing, workflow and epilogue issues - #187

Merged
Pavel Feldman (pavelfeldman) merged 3 commits into
microsoft:mainfrom
pavelfeldman:fix-cli-issues
Nov 6, 2026
Merged

Pavel Feldman (pavelfeldman) merged 3 commits into
microsoft:mainfrom
pavelfeldman:fix-cli-issues

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Fixes the open create-playwright bug reports filed in microsoft/playwright.

Issue Fix
Fixes microsoft/playwright#43951 Interactive runs ask "Override it?" again before replacing existing files. createFiles compared relative paths against absolute ones (regression from #172, unreleased).
Fixes microsoft/playwright#43953 Conflicts are checked before anything is installed, paths are reported relative to the cwd, and the --force option the error message refers to now exists. Files whose content is unchanged are not conflicts, so re-running with the same options succeeds.
Fixes microsoft/playwright#43955 --lang accepts js/ts/JavaScript/TypeScript in any case; --browser accepts comma-separated lists. Unknown values for both are rejected with a commander error.
Fixes microsoft/playwright#43950 The generated workflow installs only the selected browsers.
Fixes microsoft/playwright#43952 cache: "npm" is only emitted for npm with a package-lock.json; actions/setup-node fails when the lock file is missing (pnpm, Yarn, package-lock=false).
Fixes microsoft/playwright#43954 .gitignore entries match whole lines, with or without leading/trailing slashes (node_modules_cache/ no longer counts as node_modules/, playwright-report/ is not duplicated).
Fixes microsoft/playwright#43957 --test-dir is escaped in playwright.config and tsconfig.json, and template values are inserted with a replacer function so $& patterns are not expanded.
Fixes microsoft/playwright#43956 The closing message suggests an enabled --project and omits the example command/file with --no-examples.

Not addressed here (feature requests): microsoft/playwright#43958, microsoft/playwright#43959, microsoft/playwright#43960, microsoft/playwright#43961.

CI

  • Node.js 22 is the main version; Node.js 24 and 26 jobs run with continue-on-error. Node.js 20 is dropped from the CI matrix and the publish workflow (engines in package.json is unchanged).
  • Branch protection still lists the build (20.x, …) jobs as required, so it needs updating to the 22.x jobs.

Testing

  • New regression tests for each fix in tests/generator.spec.ts (in-process, incl. the interactive override prompt) and tests/integration.spec.ts.
  • npx tsc --noEmit passes; npx playwright test --project npm passes locally except the two example-run tests, which need sudo for playwright install-deps on my machine (same on main). pnpm/Yarn projects are covered by CI.
  • Manually verified the interactive override prompt under a pty.

- Ask before overriding existing files in interactive mode again; the
  check compared relative paths against absolute ones (regression from microsoft#172).
- Check for conflicting files before installing anything, skip files whose
  content is unchanged, report paths relative to the cwd and add the
  `--force` option the error message refers to.
- Accept `--lang JavaScript`/`javascript`/`JS`, comma-separated `--browser`
  lists, and reject unknown values for both.
- Install only the selected browsers in the generated workflow.
- Only use `cache: "npm"` in the workflow for npm with a package-lock.json;
  actions/setup-node fails without a lock file.
- Match whole `.gitignore` lines, with or without leading/trailing slashes.
- Escape `--test-dir` in the generated config and tsconfig.json, and do not
  expand `$&`-style patterns in template values.
- Only suggest an enabled project and existing files in the closing message.

Fixes microsoft/playwright#43950
Fixes microsoft/playwright#43951
Fixes microsoft/playwright#43952
Fixes microsoft/playwright#43953
Fixes microsoft/playwright#43954
Fixes microsoft/playwright#43955
Fixes microsoft/playwright#43956
Fixes microsoft/playwright#43957
Templates are checked out with CRLF on Windows runners. Also mark the
tests that download browsers as slow, like the current directory test.
Node.js 24 and 26 jobs keep running but no longer fail the workflow.
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 25bec07 into microsoft:main Nov 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment