fourkitchens/sous-drupal-project

Starter project for Sous a Drupal distribution featuring a theme based on Emulsify Design System.

5.3.0 2024-01-16 23:41 UTC

README

Sous semantic-release: angular
Sous featuring Emulsify

Sous Project

A starter kit for your Drupal project that simplifies your project setup with Emulsify. This starter kit includes a small set of contrib modules, a bundle of basic configuration, and a starter theme generated by EmulsifyCLI.

Features and Configurations

Sous not only generates a custom theme based on Emulsify, it also builds upon Drupal's default configuration to help streamline the project setup process. See the feature set documentation here.

Installation

Requirements

Without these you will have difficulty installing this project.

  1. PHP ^8.1
  2. Composer 2.x
  3. Lando ^3.6

Use this command below and replace PROJECT_NAME with your chosen project name.

composer create-project fourkitchens/sous-drupal-project [PROJECT-NAME] --no-interaction

Tweak project

  • Modify .gitignore
    • Remove the commented block at the EOF
    • Review ignored items you may need for your build and remove them

Optional Demo content and theme

Sous can optionally install some demo content and a fully styled and wired theme. Note: This should only be ran immediately after installation. It contains basic content type and media architecture changes and may affect custom configuration unexpectedly.

lando sous-demo-install

Working with Emulsify

The Emulsify theme is installed as part of this project.

Additional Tooling

This package provides some additional tooling to support the build.

Helper scripts

To use the helper script provided you will need to have npm installed. Then just run npm run <command>. For example: npm run import-data. These commands are bash scripts located in the ./scripts/sous directory and defined in package.json.

Configuration management scripts

confex

npm run confex

Export active configuration to the config directory.

confim

npm run confim

Import the configuration to the database.

import-data

npm run import-data

Import a copy of the canonical database backup into your local instance. This assumes the database backup is located in ./reference/db.sql.gz.

local-data-bak

npm run local-data-bak

Create a local database backup. Saves the backup to the ./reference directory.

rebuild

npm run rebuild

Rebuild a fresh local instance of your site. Imports the canonical database backup and imports configuration into it.

setup

npm run setup

This is run during the installation process of composer create project.

theme-build

npm run theme-build

Builds the emulsify based theme.

theme-watch

npm run theme-watch

Used for theme development.

Semantic Versioning

Setup

  1. This repo has the following named/maintenance branches:
main
x.x
x.x.x
  1. These branches are protected on GitHub
  2. A personal access token was created for CircleCI.
  3. CircleCI was setup to run on this project and tag the releases
  4. Commit changes following the Conventional commit guidelines
  5. Push your change up and verify CircleCI passes and has run on your desired branch.

Troubleshooting

  1. Your branch must be a named stable release branch in order to get a tag.
  2. Prereleases are not supported with this package because they contain a dot.

Contributing

The composer command can be adjusted to account for a new branch you're working on.

composer create-project fourkitchens/sous-drupal-project:dev-[branch-name] PROJECT_NAME --no-interaction

Contribute without create-project

  1. clone repo gh repo clone fourkitchens/sous-drupal-project [directory]
  2. cd to your project directory
  3. change the name of your project in .lando.yml
  4. lando start
  5. lando composer install
  6. composer run-script post-create-project-cmd (Requires composer to be installed locally. i.e. outside lando)
  7. lando drush config-set system.theme default theme-name -y (theme-name is the name of your project)

After running the above steps you should have a fully functioning Drupal site with a custom Emulsify theme named after your project.

Create a custom theme. (Change theme-name to your theme name.)

If you would like to generate another custom theme follow the steps below.

  1. npm ci
  2. npx emulsify init theme-name
  3. lando drush config-set system.theme default theme-name -y