[#690] Reclassified trait-specific composer dependencies as optional.#691
Conversation
WalkthroughTrait-specific Composer dependencies were moved into ChangesDependency reclassification and docs
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@composer.json`:
- Around line 52-57: The suggest entry for dmore/behat-chrome-extension is too
generic; update its description to name the actual consumer like the other
entries do. In composer.json, tighten the text around the `@javascript` Chrome
DevTools support so it points to the specific trait or step group that uses it,
making it clear when this package is needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 218b628e-8cac-4ad8-9f79-7fd9194620f0
📒 Files selected for processing (4)
CONTRIBUTING.mdMIGRATION.mdREADME.mdcomposer.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
=======================================
Coverage 97.29% 97.29%
=======================================
Files 52 52
Lines 4439 4439
=======================================
Hits 4319 4319
Misses 120 120 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #690
Summary
The
requiresection ofcomposer.jsonis trimmed to only what every consumer needs regardless of which traits they use -php,behat/behat, andbehat/mink. Four trait-specific packages (drupal/drupal-extension,lullabot/mink-selenium2-driver,dmore/behat-chrome-extension,softcreatr/jsonpath) move torequire-dev(so this library's own test suite still exercises them) plussuggestentries that tell consumers when each one is needed. Theconflictondrupal/drupal-extension: <6is preserved unchanged. This is a breaking change for consumers relying on transitive installation, so it is documented inMIGRATION.mdas a batched change for the next major release. A newCONTRIBUTING.md"Dependency policy" section codifies the rule going forward, a new README "Optional dependencies" note tells consumers what to add, andscripts/provision.shis updated so the library's own fixture site keeps installing the now-optional packages it needs to run the full Behat suite.Changes
composer.json: reclassifieddrupal/drupal-extension,lullabot/mink-selenium2-driver,dmore/behat-chrome-extension, andsoftcreatr/jsonpathfromrequireintorequire-dev+suggest; keptphp,behat/behat,behat/minkinrequire; preserved the existingconflictondrupal/drupal-extension: <6.scripts/provision.sh: the fixture-site Composer merge now pulls the module'ssuggestpackages (the trait-specific runtime deps that leftrequire) into the fixture'srequire-dev, sodocs.phpand every Behat scenario - which run againstbuild/vendor- still resolve. Derived fromsuggestviaarray_intersect_keyrather than a hardcoded list, so it stays correct as the policy adds future optional deps.MIGRATION.md: added a breaking-change entry mapping each demoted package to the trait(s) that need it. The two@javascriptdrivers are presented as interchangeable - install eitherlullabot/mink-selenium2-driver(Selenium/WebDriver) ordmore/behat-chrome-extension(selenium-less headless Chrome); both run the full@javascriptsuite and both are exercised by CI.CONTRIBUTING.md: added a "Dependency policy" section stating that trait-specific packages go inrequire-dev+suggest, never inrequire, and that demotions are batched into major releases.README.md: added an "Optional dependencies" section listing per-trait package requirements for consumers.The demoted packages are safe to omit at runtime:
dmore/behat-chrome-extensionhas zero code references (it is a Behat extension configured entirely inbehat.yml), andlullabot/mink-selenium2-driveris only referenced ininstanceofbranch guards, which PHP evaluates asfalseagainst a missing class rather than fatally erroring. This mirrors the existingjustinrainbow/json-schemaprecedent, which has beensuggest-only all along.Before / After
Reclassified trait-specific Composer dependencies as optional:
composer.jsonnow keeps onlyphp,behat/behat, andbehat/minkinrequire, movesdrupal/drupal-extension,lullabot/mink-selenium2-driver,dmore/behat-chrome-extension, andsoftcreatr/jsonpathtorequire-dev, and expandssuggestwith trait/step-specific guidance (while keeping the existingdrupal/drupal-extension: <6conflict unchanged).Documented the change as a breaking dependency demotion in
MIGRATION.md, added a “Dependency policy” section toCONTRIBUTING.mddescribing howrequirevsrequire-dev/suggestshould be managed going forward, and updatedREADME.mdwith an “Optional dependencies” section that instructs consumers to add the suggested packages needed for Drupal traits (drupal/drupal-extension),JsonTrait(softcreatr/jsonpathplusjustinrainbow/json-schema), and@javascriptscenarios (including a Mink driver). Updatedscripts/provision.shso the fixture-site Composer merge pulls in trait-scoped optional deps fromrequire-dev+suggest.CONTRIBUTING.md’s step-formatting guideline (e.g., avoiding regex-based step definition rules) remains intact; no Critical step-definition rule violations were found related to these documentation changes.