[Suggestion] composer post-install-cmd that includes npm packages
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- php, playwright
- Domain
- developer-experience, testing
Research direction
Start by reviewing the pest composer.package configuration and the pestphp/pest-plugin-browser installation flow. Compare the proposed Composer and Playwright commands with the linked laravel/sail PR, then determine the approved cross-platform behavior and how installation success should be verified.
Written by the indexing model from the issue text.
Description
I'm creating a issue instead of a PR, to open it for discussion before approval
When installing pestphp/pest-plugin-browser you need to run
composer require pestphp/pest-plugin-browser --dev
npm install playwright@latest
npx playwright install
You could create a post-install-cmd in pest composer.package
that would automatically run
npx -y npm-add-script -k postinstall -v "cross-env PLAYWRIGHT_BROWSERS_PATH=0 && npx playwright install"
npm install playwright cross-env
npm install
This will include in package.json
"scripts": {
...
"postinstall": "cross-env PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install-deps && npx playwright install"
},
"devDependencies": {
...
"playwright": "^1.55.0",
},
Note: cross-env PLAYWRIGHT_BROWSERS_PATH=0 allows to playwright browsers to be installed on node_modules folder, avoiding the need of user permissions or running as sudo
this way it will work on any Operational System (because cross-env handles the envrionment variable), also it will be executed every time you run composer require pestphp/pest-plugin-browser --dev
The only thing that will be needed is to run
npx playwright install-deps
This command make sure all required dependencies for playwright are already installed
I created a PR on laravel/sail package that already address it
- Dominant language
- PHP
- Stars
- 11.7k
- Forks
- 538
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pestphp/pest
-
[Bug]: [mutate] Windows: @pest-mutate-ignore comments land on line 1 in files with LF line endings Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100