Skip to content

Commit 189eeae

Browse files
committed
Fix some (Composer and other) issues in the 'xb-setup' command.
1 parent 52bafbf commit 189eeae

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

commands/host/xb-setup

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
cd "$(dirname "$0")" || exit
1111
cd ../../../
12+
set -e
13+
14+
# Route Composer commands through DDEV.
15+
alias composer="ddev composer"
1216

1317
# Flag-handling.
1418
while :; do
@@ -42,32 +46,37 @@ fi
4246
rm -rf web/modules/contrib/experience_builder
4347
mkdir -p web/modules/contrib
4448

45-
# Place the Experience Builder module via Git for development. Require
46-
# it with Composer to test its composer.json and place dependencies.
47-
git clone \
48-
git@git.drupal.org:project/experience_builder.git \
49-
web/modules/contrib/experience_builder
49+
# Allow all Composer plugins.
50+
composer config \
51+
--no-plugins \
52+
allow-plugins.\* \
53+
true
5054

5155
# Require Drush, but don't install yet for performance reasons.
52-
ddev composer \
53-
require \
56+
composer require \
5457
--no-install \
58+
--update-with-all-dependencies \
5559
--no-interaction \
5660
drush/drush
5761

58-
# Require the Experience Builder module and soft dependencies. Still don't install.
59-
ddev composer config \
62+
# Place the Experience Builder module via Git for development. Require it and its
63+
# soft dependencies with Composer to test its composer.json. Still don't install.
64+
git clone \
65+
git@git.drupal.org:project/experience_builder.git \
66+
web/modules/contrib/experience_builder
67+
composer config \
6068
repositories.xb \
6169
path \
6270
web/modules/contrib/experience_builder
63-
ddev composer require \
71+
composer require \
6472
--no-install \
73+
--update-with-all-dependencies \
6574
--no-interaction \
6675
drupal/experience_builder \
6776
drupal/metatag:^2.1
6877

6978
# Require dev dependencies. NOW install.
70-
ddev composer require \
79+
composer require \
7180
--dev \
7281
--update-with-all-dependencies \
7382
--no-interaction \
@@ -77,22 +86,19 @@ ddev composer require \
7786
league/openapi-psr7-validator:^0.22.0 \
7887
webflo/drupal-finder:^1.3.1
7988

80-
# Install Drupal and enable the Experience Builder module.
81-
ddev xb-site-install
82-
83-
# Initialize the environment.
84-
ddev start
85-
8689
# Allow test modules and themes to be installed.
8790
# shellcheck disable=SC2016
8891
printf '\n# Allow test modules and themes to be installed.\n$settings["extension_discovery_scan_tests"] = TRUE;' \
8992
>> web/sites/default/settings.ddev.php
9093

94+
# Install Drupal and enable the Experience Builder module.
95+
ddev xb-site-install
96+
9197
# Install Drupal core NPM packages.
9298
ddev exec --dir /var/www/html/web/core -- npm install
9399

94100
# Build front-end assets.
95101
ddev xb-ui-build
96102

97103
# Install DDEV Selenium Standalone Chrome
98-
ddev get ddev/ddev-selenium-standalone-chrome
104+
ddev add-on get ddev/ddev-selenium-standalone-chrome

tests/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ ddev config \
4242
ddev config --project-type=drupal --php-version=8.3 --docroot=web
4343

4444
# Create the Drupal project.
45-
ddev composer create drupal/recommended-project:^11.x-dev --no-install
45+
ddev composer create drupal/recommended-project:10.x@dev --no-install
4646

4747
# Get the add-on.
48-
ddev get ../../
48+
ddev add-on get ../../
4949

5050
# Perform one-time setup operations.
5151
ddev xb-setup
5252

5353
# Test an update.
54-
ddev get ../../
54+
ddev add-on get ../../
5555

5656
# Try to perform one-time setup operations when they've already been done.
5757
ddev xb-setup

0 commit comments

Comments
 (0)