Skip to content

fix: remove composer post-install hooks (only run for root project)#16

Merged
developersharif merged 1 commit into
mainfrom
web-widget
Apr 1, 2026
Merged

fix: remove composer post-install hooks (only run for root project)#16
developersharif merged 1 commit into
mainfrom
web-widget

Conversation

@developersharif

Copy link
Copy Markdown
Owner

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.

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>
@developersharif
developersharif merged commit 59930a6 into main Apr 1, 2026
6 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread composer.json
"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"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
}
},
"scripts": {
"install-webview": "@php scripts/install-webview-helper.php"
}
}

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