diff --git a/ExperienceBuilderDemo.php b/ExperienceBuilderDemo.php deleted file mode 120000 index a2499e20748a63cb5e6b54413fa07973237cd01d..0000000000000000000000000000000000000000 --- a/ExperienceBuilderDemo.php +++ /dev/null @@ -1 +0,0 @@ -project_template/ExperienceBuilderDemo.php \ No newline at end of file diff --git a/project_template/ExperienceBuilderDemo.php b/project_template/ExperienceBuilderDemo.php deleted file mode 100644 index dce40ccd707cd4c2336cbb0c40e78a0e67fb7f7f..0000000000000000000000000000000000000000 --- a/project_template/ExperienceBuilderDemo.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -declare(strict_types=1); - -use Composer\DependencyResolver\Operation\UpdateOperation; -use Composer\Installer\PackageEvent; -use Symfony\Component\Process\Process; - -/** - * Uninstalls Experience Builder whenever Composer attempts to update it. - * - * Experience Builder currently has no update path, which means anyone who has - * it installed in demo mode could theoretically, suddenly break their site if - * Experience Builder ships a breaking change. To prevent that scenario, this - * plugin will uninstall Experience Builder and delete all of its data before - * the Composer package is updated. - */ -final class ExperienceBuilderDemo { - - /** - * Uninstalls Experience Builder before it is updated. - * - * @param \Composer\Installer\PackageEvent $event - * The event object. - */ - public static function onPackageUpdate(PackageEvent $event): void { - $operation = $event->getOperation(); - - // We only need to uninstall XB if we're updating it from any version less - // than 1.0.0-beta1. - if ($operation instanceof UpdateOperation) { - $from = $operation->getInitialPackage(); - - if ($from->getName() === 'drupal/experience_builder' && version_compare($from->getVersion(), '1.0.0-beta1', '<')) { - $config = $event->getComposer()->getConfig(); - $drush = $config->get('bin-dir') . '/drush'; - assert(is_executable($drush)); - - $run_drush = function(array $command) use ($drush): Process { - $process = new Process([$drush, ...$command]); - return $process->mustRun(); - }; - - // Ensure that Drupal is installed and has a database connection; otherwise, - // there's nothing to do. - $output = $run_drush(['core:status', '--field=db-status']) - ->getOutput(); - $output = trim($output); - if (empty($output)) { - return; - } - $io = $event->getIO(); - $io->write('<comment>Uninstalling Experience Builder because it is being updated from an unstable version.</>'); - - // Ask Drush if Experience Builder is installed. If it isn't, there's - // nothing we need to do. - $output = $run_drush(['pm:list', '--type=module', '--field=status', '--filter=experience_builder']) - ->getOutput(); - if (trim($output) === 'Disabled') { - return; - } - // Delete all xb_page entities and uninstall XB. - $run_drush(['entity:delete', 'xb_page']); - $run_drush(['pm:uninstall', 'experience_builder', '--yes']); - - $project_root = dirname($config->getConfigSource()->getName()); - $io->write("<bg=blue;fg=white>Successfully uninstalled Experience Builder. You can reinstall the demo by running the following command:\n$drush recipe $project_root/recipes/xb_demo</>"); - } - } - } - -} diff --git a/project_template/recipes/xb_demo/content/xb_page.yml b/project_template/recipes/xb_demo/content/xb_page.yml deleted file mode 100644 index 5e989e6d79b496770f960af01d9b6d9e45ff6bc3..0000000000000000000000000000000000000000 --- a/project_template/recipes/xb_demo/content/xb_page.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This file is scaffolded into XB's `content` directory, which will -# allow the contributed Default Content module to import it when XB -# ss installed. This should be moved into the `drupal_cms_starter` -# recipe when XB is a production dependency of Drupal CMS. -_meta: - version: '1.0' - entity_type: xb_page - uuid: 20354d7a-e4fe-47af-8ff6-187bca92f3f7 - default_langcode: en -default: - status: - - - value: true - owner: - - - target_id: 1 - title: - - - value: Experience Builder - components: - - tree: '{"a548b48d-58a8-4077-aa04-da9405a6f418": []}' - props: '{}' - path: - - - alias: /xb-demo - langcode: en - created: - - - value: 1735191284 - revision_translation_affected: - - - value: true diff --git a/project_template/recipes/xb_demo/recipe.yml b/project_template/recipes/xb_demo/recipe.yml deleted file mode 100644 index b4360ba7a1c933d6913d4f4a22c5d4c2be358b5c..0000000000000000000000000000000000000000 --- a/project_template/recipes/xb_demo/recipe.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Experience Builder -type: Drupal CMS -description: A read-only demonstration of the next-generation Experience Builder for Drupal. -install: - - experience_builder -config: - import: - experience_builder: - - image.style.xb_avatar - actions: - experience_builder.settings: - simpleConfigUpdate: - demo_mode: true - # Disable all components XB generated during installation. Some components - # have two- or three-part identifiers, so we need to disable those - # separately. - experience_builder.component.*.*: - disable: [] - experience_builder.component.*.*.*: - disable: [] - # Re-enable the components provided by Drupal CMS. - experience_builder.component.sdc.drupal_cms_olivero.*: - enable: []