Extract Robo commands into shared gizra/drupal-robo package - #1065
Merged
Merged
Conversation
Move the Robo command traits to the gizra/drupal-robo package (pulled via a VCS repository) so updates are shared across projects. RoboFile now supplies project config through ProjectConfigTrait getters instead of the INSTALLED_LANGUAGES constant. BootstrapTrait stays here as the new-project scaffolder and is updated to use the config getters. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AronNovak
approved these changes
Sep 11, 2026
AronNovak
left a comment
Member
There was a problem hiding this comment.
It's a pending improvement for a while, nice! 👍 How we would do per-project overrides? Can we just have a trait in the derived project to override some parts?
# Conflicts: # robo-components/DeploymentTrait.php
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extracts the Robo command traits from this repo into the new standalone package gizra/drupal-robo (tagged
v1.0.0), so every project pulls fixes and improvements from one place withcomposer update gizra/drupal-robo.The package is pulled via a Composer VCS repository (no Packagist), so there is nothing to publish — a later move to Packagist would just drop the
repositoriesentry.Changes here
vcsrepository andgizra/drupal-robo: ^1.0torequire-dev.ProjectConfigTraitand supply the three project-specific values (getThemeName(),getGithubProject(),getInstalledLanguages()); theINSTALLED_LANGUAGESconstant is gone.BootstrapTraitstays (it scaffolds new projects from this template) and is updated to usegetThemeBasePath()/getDeploySyncExcludes().RoboComponents\autoloads from both the package (src/) and the localrobo-components/(BootstrapTrait) — Composer merges PSR-4 paths for the same namespace.How it was parameterized
Project-specific values that used to be hardcoded static properties now come from
ProjectConfigTraitgetters. Three are required (theme name, github project, installed languages); the rest (getThemeBasePath(),getAdminUser(),getPoFilesPath(),getDeploySyncExcludes()) ship with defaults and are only overridden when a project diverges.Verification
ddev robo list— all commands enumerate (projectbootstrap:project+ packagetheme:compile,deploy:*,locale:*,pantheon:*,security:*,update:modules,phpcs, …), no fatals.phpcsonRoboFile.php+robo-components/BootstrapTrait.php— clean.phpstanonRoboFile.php+robo-components/— no errors.Follow-up (not in this PR)
ddev phpcsno longer sniffsrobo-components/(the package dropped that path). BootstrapTrait was linted manually here; agetPhpcsPaths()getter could restore automatic coverage if wanted.