- PHP ^7.3
- Composer ^2.0
- Docker
- Node v11.15
- Comment out the PDO line in
mat.settings.php
. - Copy
.env.example
to.env
and provide some values for the MySQL variables. Doesn't really matter what you use, except that MYSQL_HOSTNAME should match docker-compose service name for MySQL ("database"). - Start docker-compose
docker-compose up -d --build
. - Install drupal
docker-compose exec drupal drush site-install minimal --site-name "Measure Authoring Tool" --existing-config -y
. - Clear the cache
docker-compose exec drupal drush cr
. - Visit
http://localhost:8080
to view the site. See next section for login info.
The drush site installer command generates an admin username and password. You can optionally store this, or just use drush to generate a one-time login link:
docker-compose exec drupal drush uli
. That command will generate a URL likehttp://default/user/reset/1/1581541762/VGGpYbY3vxoFuzAIuXII7K2csKjpqCN9tU4Ed-fWos8/login
.- Copy everything after
default
and past that after the site url.
- Comment out the PDO line in
mat.settings.php
. - Comment out the volumes line in
docker-compose.yml
. - Install composer dependencies
composer install
- Install theme dependencies
cd html/themes/custom/emat && npm install
- Build the theme
npm run-script build
. - Copy
.env.example
to.env
and provide some values for the MySQL variables. Doesn't really matter what you use, except that MYSQL_HOSTNAME should match docker-compose service name for MySQL ("database"). - Start docker-compose
docker-compose up -d --build
. - Run drupal installer
docker-compose exec drupal drush si
. You'll have to provide some values here for MySQL username and password, etc. - Import Drupal config
docker-compose exec drupal drush cim -y
.
The eMAT
theme uses the atomic design principle, built with patternlab. These components are
then consumed by Drupal templates. Unfortunately the base theme project that this was built on has been deprecated, so
updates to the package dependencies here is tricky. Development of theme components is still possible, but
it may be worth it to put in some time to update the underlying design system in the future.
- You'll need node v11, as specified in the prerequisites section at the top of the README.
- Navigate to the theme directory
cd html/themes/custom/emat
. - Install package dependencies
npm install
- Start pattern lab
npm start
. - Once ready, you should get a URL like
http://localhost:3000/pattern-lab/public
.
For modifying existing components, you should be able to work exclusively within patterlab, but when adding new components, you'll need to first theme the element in patternlab, and then create the corresponding Drupal template to consume that themed component.
With composer require ...
you can download new dependencies to your
installation.
composer require drupal/devel:~1.0
Follow the steps below to update your core files.
- Run
composer update drupal/core drupal/core-dev --with-dependencies
to update Drupal Core and its dependencies. - Run
git diff
to determine if any of the scaffolding files have changed. Review the files for any changes and restore any customizations to.htaccess
orrobots.txt
. - Commit everything all together in a single commit, so
html
will remain in sync with thecore
when checking out branches or runninggit bisect
. - In the event that there are non-trivial conflicts in step 2, you may wish
to perform these steps on a branch, and use
git merge
to combine the updated core files with your customized files. This facilitates the use of a three-way merge tool such as kdiff3. This setup is not necessary if your changes are simple; keeping all of your modifications at the beginning or end of the file is a good strategy to keep merges easy.
Composer recommends no. They provide argumentation against but also workrounds if a project decides to do it anyway.
The Drupal Composer Scaffold plugin can download the scaffold files (like
index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose
to not check them into your version control system (e.g. git). If that is the case for your project it might be
convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can
achieve that by registering @composer drupal:scaffold
as post-install and post-update command in your composer.json:
"scripts": {
"post-install-cmd": [
"@composer drupal:scaffold",
"..."
],
"post-update-cmd": [
"@composer drupal:scaffold",
"..."
]
},
If you need to apply patches (depending on the project being modified, a pull request is often a better solution), you can do so with the composer-patches plugin.
To add a patch to drupal module foobar insert the patches section in the extra section of composer.json:
"extra": {
"patches": {
"drupal/foobar": {
"Patch description": "URL or local path to patch"
}
}
}