Skip to content
Snippets Groups Projects
Commit cc199e55 authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3498517 by phenaproxima, dries, pameeela, tim.plunkett: Remove the XB...

Issue #3498517 by phenaproxima, dries, pameeela, tim.plunkett: Remove the XB demo from the 1.0.x branch
parent d8e6041d
No related branches found
No related tags found
1 merge request!411Issue #3498517: Remove the XB demo from the 1.0.x branch
Pipeline #390941 passed
Showing with 0 additions and 285 deletions
...@@ -99,10 +99,6 @@ ...@@ -99,10 +99,6 @@
"starter": { "starter": {
"type": "path", "type": "path",
"url": "recipes/drupal_cms_starter" "url": "recipes/drupal_cms_starter"
},
"xb_demo": {
"type": "path",
"url": "project_template/recipes/drupal_cms_xb_demo"
} }
}, },
"require-dev": { "require-dev": {
......
'$schema': 'https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json'
name: Heading
description: A heading element
props:
type: object
required:
- text
- element
properties:
text:
type: string
title: Text
description: The heading text.
examples: ['A heading element']
element:
type: string
title: Element
description: The HTML element to use.
examples: [h1, h2, h3, h4, h5, h6]
enum:
- h1
- h2
- h3
- h4
- h5
- h6
.heading {
margin-block-end: var(--sp2-5);
/* Default to H2 */
letter-spacing: -0.02em;
font-size: 2.25rem;
font-weight: 800;
line-height: var(--sp3);
&.heading--h1 {
letter-spacing: -0.02em;
font-size: 3.75rem;
font-weight: 800;
line-height: var(--sp4);
}
&.heading--h3 {
letter-spacing: -0.01em;
font-size: 1.5rem;
font-weight: 800;
line-height: var(--line-height-base);
}
&.heading--h4 {
letter-spacing: 0.09em;
font-size: 1.3125rem;
font-weight: 700;
line-height: var(--line-height-base);
}
&.heading--h5 {
letter-spacing: 0.12em;
font-size: var(--font-size-base);
font-weight: 700;
line-height: var(--line-height-base);
text-transform: uppercase;
}
&.heading--h6 {
letter-spacing: 0.2em;
font-size: var(--font-size-s);
font-weight: 600;
line-height: var(--line-height-s);
text-transform: uppercase;
}
@media (min-width: 43.75rem) {
/* @todo grid-column: 3 / 10; */
}
}
{%
set classes = [
'heading',
'heading--' ~ element|clean_class,
]
%}
<{{ element }}{{ attributes.addClass(classes) }}>{{ text }}</{{ element }}>
drupal_cms_olivero/components/heading/thumbnail.png

246 KiB

...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
"drupal": { "drupal": {
"type": "composer", "type": "composer",
"url": "https://packages.drupal.org/8" "url": "https://packages.drupal.org/8"
},
"xb_demo": {
"type": "path",
"url": "recipes/drupal_cms_xb_demo"
} }
}, },
"require": { "require": {
...@@ -35,7 +31,6 @@ ...@@ -35,7 +31,6 @@
"drupal/drupal_cms_person": "*", "drupal/drupal_cms_person": "*",
"drupal/drupal_cms_project": "*", "drupal/drupal_cms_project": "*",
"drupal/drupal_cms_seo_tools": "*", "drupal/drupal_cms_seo_tools": "*",
"drupal/drupal_cms_xb_demo": "@dev",
"drush/drush": "^13" "drush/drush": "^13"
}, },
"conflict": { "conflict": {
...@@ -48,7 +43,6 @@ ...@@ -48,7 +43,6 @@
"composer/installers": true, "composer/installers": true,
"drupal/core-composer-scaffold": true, "drupal/core-composer-scaffold": true,
"drupal/core-project-message": true, "drupal/core-project-message": true,
"drupal/drupal_cms_xb_demo": true,
"php-http/discovery": true "php-http/discovery": true
}, },
"sort-packages": true, "sort-packages": true,
......
{
"name": "drupal/drupal_cms_xb_demo",
"type": "composer-plugin",
"description": "A read-only demonstration of the next-generation Experience Builder for Drupal.",
"require": {
"composer-plugin-api": "^2",
"drupal/experience_builder": "0.x-dev",
"drush/drush": "^13"
},
"autoload": {
"classmap": ["src/"]
},
"extra": {
"class": "Drupal\\XbDemo\\Plugin",
"plugin-optional": true
},
"version": "dev-main"
}
# 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
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: []
<?php
declare(strict_types=1);
namespace Drupal\XbDemo;
use Composer\Composer;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\InstalledVersions;
use Composer\Installer\PackageEvent;
use Composer\Installer\PackageEvents;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
use Composer\Semver\VersionParser;
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 Plugin implements PluginInterface, EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array {
return [
PackageEvents::PRE_PACKAGE_UPDATE => 'onPackageUpdate',
];
}
/**
* Uninstalls Experience Builder before it is updated.
*
* @param \Composer\Installer\PackageEvent $event
* The event object.
*/
public 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', '<')) {
$drush = $event->getComposer()->getConfig()->get('bin-dir') . '/drush';
assert(is_executable($drush));
$io = $event->getIO();
$io->write('Uninstalling Experience Builder because it is being updated from an unstable version.');
$this->uninstallXb(function (array $command) use ($drush): Process {
$process = new Process([$drush, ...$command]);
return $process->mustRun();
});
$io->write('Successfully uninstalled Experience Builder. You can reinstall the demo by running the following command:');
$io->write("$drush recipe " . InstalledVersions::getInstallPath('drupal/drupal_cms_xb_demo'));
}
}
}
/**
* Deletes all of Experience Builder's data and uninstalls it.
*
* @param callable $drush
* A callable that runs Drush. Accepts an array of command-line arguments
* and options, and returns a Process object that has run successfully.
*/
private function uninstallXb(callable $drush): void {
// Ensure that Drupal is installed and has a database connection; otherwise,
// there's nothing to do.
$output = $drush(['core:status', '--field=db-status'])->getOutput();
$output = trim($output);
if (empty($output)) {
return;
}
// Ask Drush if Experience Builder is installed.
$output = $drush([
'pm:list',
'--type=module',
'--field=status',
'--filter=experience_builder',
])->getOutput();
if (trim($output) === 'Enabled') {
// Delete all xb_page entities and uninstall XB.
$drush(['entity:delete', 'xb_page']);
$drush(['pm:uninstall', 'experience_builder', '--yes']);
}
}
/**
* {@inheritdoc}
*/
public function activate(Composer $composer, IOInterface $io): void {
}
/**
* {@inheritdoc}
*/
public function deactivate(Composer $composer, IOInterface $io): void {
}
/**
* {@inheritdoc}
*/
public function uninstall(Composer $composer, IOInterface $io): void {
}
}
...@@ -54,7 +54,6 @@ config: ...@@ -54,7 +54,6 @@ config:
package_manager.settings: package_manager.settings:
simpleConfigUpdate: simpleConfigUpdate:
additional_trusted_composer_plugins: additional_trusted_composer_plugins:
- drupal/drupal_cms_xb_demo
# This is indirectly added by `drupal/core-dev`. # This is indirectly added by `drupal/core-dev`.
- tbachert/spi - tbachert/spi
project_browser.admin_settings: project_browser.admin_settings:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment