Code Monkey home page Code Monkey logo

ddev-drupal-contrib's Introduction

DDEV integration for developing Drupal contrib projects. As a general philosophy, your contributed module is the center of the universe. The codebase layout (see image below) and commands in this project match the Gitlab CI approach from the Drupal Association.

Install

  1. If you haven't already, install Docker and DDEV
  2. git clone your contrib module
  3. cd [contrib module directory]
  4. Configure DDEV for Drupal 10 using ddev config --project-name=[contrib module] --project-type=drupal10 --docroot=web --create-docroot --php-version=8.1 or select these options when prompted using ddev config
  5. Run ddev get ddev/ddev-drupal-contrib.

Commands

This project provides the following DDEV container commands.

  • ddev poser.
    • Edits composer.json so that drupal/core-recommended becomes a dev dependency.
    • Runs composer install AND yarn install so that dependencies are available.
    • Note: it is perfectly acceptable to skip this command and edit the require-dev of composer.json by hand.
  • ddev symlink-project. This symlinks the top level files of your project into web/modules/custom so that Drupal finds your module. This command runs automatically on every ddev start. See codebase image below.
  • ddev phpunit. Run phpunit tests on the web/modules/custom directory.
  • ddev nightwatch. Run nightwatch tests on the web/modules/custom directory.
  • ddev phpcs. Run phpcs on the web/modules/custom directory.
  • ddev eslint. Run eslint on the js files in the web/modules/custom directory.
  • ddev stylelint. Run stylelint on the css files in the web/modules/custom directory.

Codebase layout

Folder tree

Misc

  • Optional: Install Chrome service for FunctionalJavascript and Nightwatch tests.
  • Optional. Commit the changes .ddev after this plugin installs. This saves other users from having to install this integration. Rerun the ddev get in order to update the commands from this project.
  • This project reads your project_type from DDEV and fetches adds the corresponding version of drupal/core-recommended to composer.json. if you are doing something non-standard with project_type, don't use ddev poser command.
  • This project should work for any contrib project, including those that haven't opted into Gitlab CI. One advantage of that is that failures in CI are more likely to be reproducible locally when using this integration.
  • If you add/remove a root file or directory, re-symlink root files via EITHER of these methods
    • ddev restart
    • ddev symlink-project
  • cweagans/composer-patches:^1 is added by ddev poser so feel free to configure any patches that your project needs.

Troubleshooting

"Error: unknown command":

The commands from this addon are available when the project type a valid drupal type. Below, is an example .ddev/config.yaml for a Drupal 10 project.

type: drupal10

Contributed and maintained by @weitzman

ddev-drupal-contrib's People

Contributors

kreynen avatar pcambra avatar tyler36 avatar weitzman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.