diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 276caab5c..5e258233a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,8 @@ on: env: COMPOSER_MEMORY_LIMIT: -1 + COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}} + SYMFONY_DEPRECATIONS_HELPER: 'disabled=1' SIMPLETEST_DB: sqlite://tmp/site.sqlite SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" @@ -21,9 +23,15 @@ jobs: matrix: php-versions: ['8.3'] - drupal-release: ['alpha', 'beta', 'dev'] - composer-channel: ['stable', 'snapshot'] - + drupal-release: ['stable'] + composer-channel: ['stable'] + include: + - php-versions: '8.3' + drupal-release: dev + composer-channel: stable + - php-versions: '8.3' + drupal-release: stable + composer-channel: snapshot steps: - name: Dump matrix context env: @@ -77,8 +85,8 @@ jobs: composer --verbose require --no-update drupal/core-composer-scaffold:^11@${{ matrix.drupal-release }} composer --verbose require --no-update drupal/core-recommended:^11@${{ matrix.drupal-release }} composer --verbose require --no-update --dev drupal/core-dev:^11@${{ matrix.drupal-release }} - # Remove the line below once the package is out of `alpha`. - [[ ${{ matrix.drupal-release }} == 'beta' ]] && composer require chi-teck/drupal-code-generator:^4@alpha + # Remove the line below once the package is out of `alpha`. + [[ ${{ matrix.drupal-release }} == 'beta' ]] && composer require chi-teck/drupal-code-generator:^4@alpha composer --verbose update - name: Install site diff --git a/.gitignore b/.gitignore index 466935400..e3a295311 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,8 @@ /web/profiles/contrib/ /web/libraries/ -# Ignore sensitive information. -/web/sites/*/settings.php +# Ignore sensitive information +/web/sites/*/settings.local.php # Ignore Drupal's file directory. /web/sites/*/files/ diff --git a/README.md b/README.md index 84427395b..4fc010ce1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Composer template for Drupal projects -[![CI](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml/badge.svg?branch=11.x)](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml) -![LICENSE](https://img.shields.io/github/license/drupal-composer/drupal-project) +[![CI](https://github.com/ramsalt/drupal-project/actions/workflows/ci.yml/badge.svg?branch=10.x)](https://github.com/ramsalt/drupal-project/actions/workflows/ci.yml) This project template provides a starter kit for managing your site dependencies with [Composer](https://getcomposer.org/). @@ -29,7 +28,7 @@ for your setup. Create your project: ```bash -composer create-project drupal-composer/drupal-project:11.x-dev some-dir --no-interaction +composer create-project ramsalt/drupal-project:11.x-dev some-dir --no-interaction ``` The `composer create-project` command passes ownership of all files to the @@ -48,16 +47,16 @@ composer require drupal/devel ``` By default, this project is set to install only stable releases of dependencies, -as specified by `"minimum-stability": "stable"` in `composer.json`. If you need -to use non-stable releases (e.g., `alpha`, `beta`, `RC`), you can modify the -version constraint to allow for such versions. For instance, to require a beta +as specified by `"minimum-stability": "stable"` in `composer.json`. If you need +to use non-stable releases (e.g., `alpha`, `beta`, `RC`), you can modify the +version constraint to allow for such versions. For instance, to require a beta version of a module: ```bash composer require drupal/devel:1.0.0-beta1 ``` -Alternatively, you can globally adjust the stability settings by modifying +Alternatively, you can globally adjust the stability settings by modifying `composer.json` to include the desired stability level and explicitly allow it: ```json @@ -67,7 +66,7 @@ Alternatively, you can globally adjust the stability settings by modifying } ``` -This configuration ensures that stable releases are preferred, but allows the +This configuration ensures that stable releases are preferred, but allows the installation of non-stable packages when necessary. ### Adding libraries diff --git a/composer.json b/composer.json index 784988875..1f33eeb45 100644 --- a/composer.json +++ b/composer.json @@ -1,21 +1,36 @@ { - "name": "drupal-composer/drupal-project", - "description": "Project template for Drupal 11 projects with Composer", + "name": "ramsalt/drupal-project", + "description": "Project template for Drupal 10 projects with Composer", + "type": "project", "license": "GPL-2.0-or-later", "type": "project", "authors": [ { - "name": "", + "name": "Marlon ", + "role": "" + }, + { + "name": "Stephan ", "role": "" } ], + "repositories": { + "private-packagist": { + "type": "composer", + "url": "https://repo.packagist.com/ramsalt/" + }, + "packagist.org": false + }, "require": { + "php": ">=8.3", "composer/installers": "^2.1", "cweagans/composer-patches": "^1.7", "drupal/core-composer-scaffold": "^11@alpha", "drupal/core-recommended": "^11@alpha", + "drupal/monolog": "^3.0", "drush/drush": "^13@beta", "oomphinc/composer-installers-extender": "^2.0", + "ramsalt/drupal-scaffold": "*", "vlucas/phpdotenv": "^5.1", "webflo/drupal-finder": "^1.3" }, @@ -26,17 +41,7 @@ "conflict": { "drupal/drupal": "*" }, - "repositories": [ - { - "type": "composer", - "url": "https://packages.drupal.org/8" - }, - { - "type": "composer", - "url": "https://asset-packagist.org" - } - ], - "minimum-stability": "alpha", + "minimum-stability": "dev", "prefer-stable": true, "autoload": { "classmap": [ @@ -47,6 +52,9 @@ ] }, "config": { + "platform":{ + "php": "8.3" + }, "allow-plugins": { "composer/installers": true, "cweagans/composer-patches": true, @@ -96,21 +104,44 @@ "web/modules/custom/{$name}": [ "type:drupal-custom-module" ], + "web/modules/ramsaltmedia/{$name}": [ + "type:ramsaltmedia-module" + ], "web/profiles/custom/{$name}": [ "type:drupal-custom-profile" ], "web/themes/custom/{$name}": [ "type:drupal-custom-theme" - ] - }, + ], + "web/themes/ramsaltmedia/{$name}": [ + "type:ramsaltmedia-theme" + ], "installer-types": [ "bower-asset", - "npm-asset" + "npm-asset", + "ramsaltmedia-module", + "ramsaltmedia-theme" ], + "drupal-scaffold": { + "allowed-packages": [ + "ramsalt/drupal-scaffold" + ], + "locations": { + "web-root": "web/" + }, + "file-mapping": { + "[web-root]/sites/development.services.yml": { + "mode": "replace", + "path": "web/core/assets/scaffold/files/development.services.yml", + "overwrite": false + } + } + }, "patchLevel": { "drupal/core": "-p2" }, - "patches": {} + "enable-patching": true, + "patches-file": "composer.patches.json" }, "scripts": { "pre-install-cmd": [ diff --git a/composer.patches.json b/composer.patches.json new file mode 100644 index 000000000..4b3fa6f39 --- /dev/null +++ b/composer.patches.json @@ -0,0 +1,3 @@ +{ + "patches": {} +} diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php index 0ccdb8564..b42759a67 100644 --- a/scripts/composer/ScriptHandler.php +++ b/scripts/composer/ScriptHandler.php @@ -13,7 +13,6 @@ use Drupal\Core\Site\SettingsEditor; use DrupalFinder\DrupalFinderComposerRuntime; use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Filesystem\Path; class ScriptHandler { @@ -48,7 +47,7 @@ public static function createRequiredFiles(Event $event) { require_once $drupalRoot . '/core/includes/install.inc'; new Settings([]); $settings['settings']['config_sync_directory'] = (object) [ - 'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot), + 'value' => '../config/sync', 'required' => TRUE, ]; SettingsEditor::rewrite($drupalRoot . '/sites/default/settings.php', $settings);