https://github.com/fourkitchens/sous-drupal-project
A starter project for Sous a Drupal distribution with a theme based on Emulsify Design System
https://github.com/fourkitchens/sous-drupal-project
Last synced: about 1 year ago
JSON representation
A starter project for Sous a Drupal distribution with a theme based on Emulsify Design System
- Host: GitHub
- URL: https://github.com/fourkitchens/sous-drupal-project
- Owner: fourkitchens
- Created: 2019-10-31T17:22:57.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T23:45:38.000Z (about 2 years ago)
- Last Synced: 2024-05-03T07:29:40.708Z (about 2 years ago)
- Language: PHP
- Homepage:
- Size: 4.56 MB
- Stars: 9
- Watchers: 15
- Forks: 7
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[](https://app.circleci.com/github/fourkitchens/sous-drupal-project/pipelines)
[](https://github.com/semantic-release/semantic-release)

# Sous Project
A starter kit for your Drupal project that simplifies your project setup with [Emulsify](https://www.emulsify.info/). This starter kit includes a small set
of contrib modules, a bundle of basic configuration, and a starter theme generated by [EmulsifyCLI](https://docs.emulsify.info/supporting-projects/emulsify-cli).
## 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](docs/features.md).
# Installation
## Dependencies and Requirements
* [PHP ^8.3](http://www.php.net/)
* [Lando ^3.6](https://docs.devwithlando.io/)
* [Node 20.x (we recommend nvm)](https://github.com/nvm-sh/nvm)
* [Composer 2.x](https://getcomposer.org/)
Without these you will have difficulty installing this project.
Use this command below and replace `PROJECT_NAME` with your chosen project name.
```
composer create-project fourkitchens/sous-drupal-project [PROJECT-NAME]
```
Note that by default, the project will use DDEV. If you would like to use Lando, use the "Contribute without create project" steps below.
You will be prompted to select the version of Sous you want to install. The main versions are:
1. Sous with Layout Builder
2. Sous with Paragraphs
Both of these versions include Emulsify as the default theme in addition to a Gin admin and our recommended security, performance and admin modules.
# Important last step: Unpacking
Recipe dependencies need to be unpacked to the root composer.json file. This feature is currently under development in Drupal core. In the meantime, you will need to run this command for every recipe in web/recipes:
```
php /usr/local/bin/composer unpack "$recipe_full_package_name
```
Eg: `php /usr/local/bin/composer unpack fourkitchens/sous-layout-builder`
This will move all of the dependencies into the root and remove that recipe from web/recipes.
# Working with Emulsify
The [Emulsify](https://emulsify.info/) 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 `. 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
```
2. These branches are protected on GitHub
3. A personal access token was created for CircleCI.
4. CircleCI was setup to run on this project and tag the releases
5. Commit changes following the [Conventional commit guidelines](https://www.conventionalcommits.org/en/v1.0.0/)
6. 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
```
## Contribute without create-project
To run setup + install:
1. clone repo `gh repo clone fourkitchens/sous-drupal-project [directory]`
2. `cd` to your project directory
3. copy `/.devops/environment/example.local.env` to `/.devops/environment/local.env`
4. choose environment: add `local_dev="ddev"` or `local_dev="lando"` to /.devops/environment/local.env
5. `composer install`
6. `composer run-script post-create-project-cmd` (Requires composer to be installed locally. i.e. outside lando)
## Contribute to recipes
1. Follow the steps above, and choose `[0] Default Sous (media and content types only)` option when presented with the recipe dialogue in the setup script
2. Composer require the recipe using --prefer-source. Optionally specify a branch.
3. The recipe will be added to the /recipes directory. Make changes there and push to your branch.
4. Make desired changes to sous and export config. Compare the config in the /config/default directory to the config in the recipe. You may be able to replace the config in the recipe, or you may need to apply config actions.
5. Test your recipe by running "ddev install-recipe [recipe-name]" or "lando install-recipe [recipe-name]"
[TODO] Add more information on updating recipe config and config actions.
## Current recipes in Sous
[TODO] Add recipes here.
To install recipes, use the `lando install-recipe` command. Eg. For the paragraphs version of Sous, run:
```
lando install-recipe fourkitchens/sous-paragraphs
```