Local development¶
Tagify ships a DDEV configuration built on the
DDEV Drupal Contrib add-on. The
module repository is the DDEV project: Drupal core and the development
dependencies are installed next to it, in web/ and vendor/, and the module
is symlinked into web/modules/custom/tagify.
Set up¶
- Install DDEV with a Docker provider.
-
Clone the repository and enter it. Use a folder outside any other Drupal site.
git clone git@git.drupal.org:project/tagify.git cd tagify -
Start DDEV.
ddev start -
Install Drupal core and the development dependencies.
ddev poserbuilds a temporary Composer file with Drupal core added, socomposer.jsonstays as it is.ddev poser -
Symlink the module into the Drupal site.
ddev symlink-project -
Install Drupal with the Umami demo profile and enable Tagify. Umami adds articles with a Tags field and sample terms, so you can try the Tagify widget right away.
ddev drush site:install demo_umami -y ddev drush pm:enable -y tagify -
Log in.
ddev drush user:login
Push your work to a merge request from the issue queue.
Run the checks¶
The same checks run in GitLab CI.
| Check | Command |
|---|---|
| Coding standards | ddev phpcs |
| Fix coding standards | ddev phpcbf |
| Static analysis | ddev phpstan |
| Unit tests | ddev phpunit web/modules/custom/tagify/tests/src/Unit |
| Kernel tests | ddev phpunit web/modules/custom/tagify/tests/src/Kernel |
| One test class or method | ddev phpunit --filter <name> |
phpcs and phpstan read the module's phpcs.xml.dist and phpstan.neon.
The setup has no browser, so FunctionalJavascript tests only run in GitLab CI. To run them locally, add the Selenium Standalone Chrome add-on to your copy.
Change the Drupal core version¶
The add-on installs the latest Drupal 11 by default. To test another version,
create .ddev/config.local.yaml, which Git ignores:
web_environment:
- DRUPAL_CORE=^10.3
Then run ddev restart and ddev poser. If Composer rejects the core version
because of the PHP version, also set php_version in
.ddev/config.local.yaml.
After you add or remove a file in the module root¶
Run ddev symlink-project again, so the new file is linked into the site.
Update the add-on¶
ddev add-on get ddev/ddev-drupal-contrib
ddev restart
ddev poser
ddev symlink-project
Commit the changed files in .ddev/.
Scaffold files
composer.json tells the Drupal core scaffold to skip .gitattributes
and .editorconfig, so ddev poser keeps Tagify's own .gitattributes.
This setting only applies inside this repository. Sites that install
Tagify do not read it.