The Asset packagist package acts as a bridge between Composer and the popular NPM and Bower repositories, which catalog thousands of useful front-end and JavaScript packages. This allows developers to easily pull in packages like DropZoneJS and many others without requiring local Node.js to be installed.
Read more: https://lightning.acquia.com/blog/round-your-front-end-javascript-libraries-composer
Guardr is a Drupal distribution with a combination of modules and settings to enhance a Drupal application's security and availability to meet enterprise security requirements. This project leverages Guardr's package management and module configuration.
A Drupal core patch has been included to add support for "Sub-profiles".
See: https://www.drupal.org/node/1356276
The Mediacurrent Rain base install profile includes many of the most common packages pre-configured for rapid site development and optional content features.
Setting up a DDEV-Local environment
$ git clone [email protected]:mediacurrent/nys_nysenate_gov.git
If you haven't already, install composer:
- On MacOS
brew install composer
- Otherwise, see instructions here https://getcomposer.org/
If you haven't already, configure your local DDEV environment with a machine token from Pantheon. This will allow you to pull the database locally with a simple command.
See the DDEV Pantheon provider documentation for instructions.
- Switch to the repository path:
$ cd nys_nysenate_gov
- Switch to the “develop” branch:
$ git checkout develop
- Install composer dependencies:
$ composer install
- Connect ddev to Pantheon:
$ ddev auth ssh
- Duplicate the local settings file:
cp web/sites/example.settings.local.php web/sites/default/settings.local.php
- This makes the file available for making changes locally, should they be needed.
- Start the environment:
$ ddev start
- Download a database backup from the production/live environment:
$ ddev pull pantheon --skip-files
- Confirm that the site is loaded properly:
$ ddev drush st
- If this does not indicate a working site, proceed to the troubleshooting section.
Confirm you can browse to https://nysenate.ddev.site.
- Ensure ddev has started without errors. Correct errors before proceeding.
- Use
ddev drush uli
to login to your local installation.
- The settings.local.php file contains settings for customizing the development environment. This disables Drupal's built in caching and additionally activates sites/development.services.yml for further customizing the development environment.
- Use Composer to add 3rd party dependencies and patches.
- Write custom modules, themes etc. to the ./web/ directory.
- Run
ddev drush cex
to export Drupal configuration to the profile/profilename/config/sync folder. - Make sure to run
ddev composer install
and thenddev drush deploy
after pulling the latest from thedevelop
branch. This will install the latest PHP dependencies and update/import the latest config into your database.
- Project Drupal Theme Guide
- DDEV-Local Documentation
- This repository created from Composer template for Drupal projects which has some addition information on usage.
- Using Composer with Drupal.
- Due to the amount of content, there are some tips on how to get the site to re-index without timing out:
- If you have changes to search API configuration run
drush search-api-reset-tracker
- Check
admin/config/search/search-api/index/core_search
to make sure that the tracking info has been reset if not, click the button that says "track info" - you may need to do this a couple times to run all the way through. - Run
drush sapi-i
to re-index and watch for any errors. - If the re-index times out you can pick it back up where it left off by running
drush sapi-i
again.
If a branch is created off of main
with the naming convention feature/JIRA-1234
, upon creating a pull request,
a Github Action will run doing a composer build and a build of the front end assets. The assets will be pushed to Pantheon
and a multi-dev environment will be created. As long as the pull request is open, you may continue to push changes to the
feature branch and the multi-dev environment will be updated. Note, it can take up to 2.5 hours for a multi-dev environment
to be created.