Don't abort composer install when polymer:init can't run#78
Conversation
The Composer plugin scaffolds project files on initial install by shelling out to `polymer polymer:init`. When Polymer is pulled in as a transitive dependency (e.g. an extension package such as polymer-drupal building in CI), there is no Polymer project to initialize and `bin/polymer` exits with "Could not find .polymer directory", which the plugin rethrew as a fatal "Installation aborted" — breaking composer install entirely. Scaffolding is a convenience, not a hard requirement of installing the library, so log a warning and continue instead of aborting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request modifies the Composer plugin to gracefully handle failures during Polymer project initialization by displaying a warning instead of throwing an exception and aborting the installation. The reviewer suggested an improvement to check for the existence of a .polymer directory before running the initialization command, which would silently skip the process and avoid noisy warning output in transitive dependency contexts.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Check for a .polymer directory before attempting initialization so transitive-dependency installs skip silently instead of printing scaffolding output and a failed-command warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
The Composer plugin scaffolds project files on initial install by running
vendor/bin/polymer polymer:init. When Polymer is pulled in as a transitive dependency — e.g. an extension package likepolymer-drupal/polymer-pantheon-drupalbuilding in CI — there is no Polymer project to initialize, sobin/polymerexits with "Could not find .polymer directory". The plugin rethrew that as a fatalInstallation aborted due to error, breakingcomposer installoutright (this is currently red on digitalpolygon/polymer-drupal#28 and polymer-pantheon-drupal#35).Scaffolding is a convenience, not a precondition for installing the library, so the plugin now logs a warning and continues instead of aborting the whole install.
Why this surfaced now
With contrib/core moving to the normal
vendor/location (PWT-115), installing Polymer no longer auto-creates a.polymer/directory, so the post-installpolymer:initreliably fails in non-project contexts — which then aborted dependency installs.Testing
0.xand they re-resolvedigitalpolygon/polymer:0.x-dev.🤖 Generated with Claude Code