fix: remove composer post-install hooks (only run for root project)#16
Conversation
Composer does not execute library scripts when installed as a dependency. The auto-download in ProcessWebView::findBinary() handles this correctly at runtime — it triggers the installer on first WebView creation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request removes the scripts section from composer.json, including automated installation hooks and the manual install-webview command. The review feedback highlights that removing the manual command will break existing error messages in the codebase that instruct users to run it; it is recommended to retain the install-webview script or update the corresponding error messages.
| "post-install-cmd": "@php scripts/install-webview-helper.php", | ||
| "post-update-cmd": "@php scripts/install-webview-helper.php", | ||
| "install-webview": "@php scripts/install-webview-helper.php" | ||
| } |
There was a problem hiding this comment.
Removing the scripts section, specifically the install-webview command, will leave a broken instruction in src/ProcessWebView.php (line 295), which currently tells users to run composer install-webview if the binary is missing and auto-download fails. While removing the post-install-cmd and post-update-cmd hooks is appropriate for a library (as they do not execute when installed as a dependency), keeping install-webview as a manual command is helpful for developers and maintains compatibility with the existing error message. Alternatively, the error message in src/ProcessWebView.php should be updated to reflect this removal.
| } | |
| }, | |
| "scripts": { | |
| "install-webview": "@php scripts/install-webview-helper.php" | |
| } | |
| } |
Composer does not execute library scripts when installed as a dependency. The auto-download in ProcessWebView::findBinary() handles this correctly at runtime — it triggers the installer on first WebView creation.