Skip to content

feat: add init command to scaffold config and example test#2

Open
krismuhi wants to merge 1 commit intomainfrom
feat-init-command
Open

feat: add init command to scaffold config and example test#2
krismuhi wants to merge 1 commit intomainfrom
feat-init-command

Conversation

@krismuhi
Copy link
Copy Markdown
Member

Summary

  • Adds mobilewright init CLI command that copies pre-bundled template files into the user's project directory
  • Ships mobilewright.config.ts and example.test.ts as static templates inside the npm package (templates/ dir)
  • Skips files that already exist to avoid clobbering existing work
  • Added "templates" to the files array in package.json so the directory is included in the published package

Usage

npx mobilewright init
# created  mobilewright.config.ts
# created  example.test.ts

Test plan

  • Run mobilewright init in an empty directory — both files are created
  • Run mobilewright init again — both files report skipped (already exists)
  • Verify mobilewright.config.ts matches the config example in the docs
  • Verify example.test.ts runs without errors against a connected device

Adds `mobilewright init` which copies pre-bundled template files
(mobilewright.config.ts and example.test.ts) into the user's project
directory so they can run their first test immediately after install.
Skips files that already exist to avoid clobbering existing work.
@krismuhi krismuhi force-pushed the feat-init-command branch 2 times, most recently from 4fc3a81 to 5856f79 Compare March 29, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant