Skip to content

Development

The repository is a DDEV project built with ddev-drupal-contrib, whose layout and commands match drupal.org's GitLab CI.

ddev start
ddev poser
ddev symlink-project
ddev exec "cd web/core && yarn install"
ddev drush site:install standard -y
ddev drush pm:install content_deployment

Development dependencies, Drush included, go in require-dev in composer.json, edited by hand.

The test fixture modules are in tests/modules. To enable them on the development site, set $settings['extension_discovery_scan_tests'] = TRUE; in web/sites/default/settings.php, then ddev drush pm:install content_deployment_test.

Checks

Check Command
PHPUnit ddev phpunit
PHP_CodeSniffer, Drupal and DrupalPractice ddev phpcs, ddev phpcbf to fix
PHPStan ddev phpstan
CSpell ddev cspell
ESLint ddev eslint
Stylelint ddev stylelint
End to end, two sites tests/e2e/two-site.sh, see its README

Project-specific words for CSpell go in .cspell-project-words.txt.

Core versions

Run Core PHP Command
Floor ~11.3.0 8.3 ddev core-version '~11.3.0', then ddev poser --prefer-lowest --prefer-stable
Current ^11 8.3 ddev core-version ^11
Next major ^12 8.5 See below

Drupal 12 needs PHP 8.5 and, while development dependencies do not declare Drupal 12, the lenient Composer plugin, as CI's next-major job uses:

  1. Set php_version: "8.5" in .ddev/config.yaml, then ddev restart.
  2. ddev core-version '^12@beta'. Composer refuses the dependencies that do not declare Drupal 12.
  3. ddev exec 'composer global config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true && composer global require mglaman/composer-drupal-lenient'
  4. ddev exec '_LENIENT_ALLOW_LIST=config_readonly,ctools,entity_reference_revisions,paragraphs,pathauto,redirect,token,tool .ddev/commands/web/poser'
  5. Make those modules installable, as CI does: ddev exec 'cd web && find modules/contrib -regextype egrep -iregex ".*/(config_readonly|ctools|entity_reference_revisions|paragraphs|pathauto|redirect|token|tool)[a-z_]*\.info\.yml" -not -path "*/tests/*" | xargs sed -i "/\^12/! s/\(core_version_requirement\)\(.*\)/\1: ^12/"'
  6. ddev exec "cd web/core && yarn install"