jacerider / neo_alchemist
Component creation and management.
Package info
github.com/jacerider/neo_alchemist
Type:drupal-module
pkg:composer/jacerider/neo_alchemist
Requires
- drupal/core: ^10.3 || ^11
- jacerider/neo: ^1
- jacerider/neo_tooltip: ^1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-develop
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.23
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.130
- 1.0.129
- 1.0.128
- 1.0.127
- 1.0.126
- 1.0.125
- 1.0.124
- 1.0.123
- 1.0.122
- 1.0.121
- 1.0.120
- 1.0.119
- 1.0.118
- 1.0.117
- 1.0.116
- 1.0.115
- 1.0.114
- 1.0.113
- 1.0.112
- 1.0.111
- 1.0.110
- 1.0.109
- 1.0.108
- 1.0.107
- 1.0.106
- 1.0.105
- 1.0.104
- 1.0.103
- 1.0.102
- 1.0.101
- 1.0.100
- 1.0.99
- 1.0.98
- 1.0.97
- 1.0.96
- 1.0.95
- 1.0.94
- 1.0.93
- 1.0.92
- 1.0.91
- 1.0.90
- 1.0.89
- 1.0.88
- 1.0.87
- 1.0.86
- 1.0.85
- 1.0.84
- 1.0.83
- 1.0.82
- 1.0.81
- 1.0.80
- 1.0.79
- 1.0.78
- 1.0.77
- 1.0.76
- 1.0.75
- 1.0.74
- 1.0.73
- 1.0.72
- 1.0.71
- 1.0.70
- 1.0.69
- 1.0.68
- 1.0.67
- 1.0.66
- 1.0.65
- 1.0.64
- 1.0.63
- 1.0.62
- 1.0.61
- 1.0.60
- 1.0.59
- 1.0.58
- 1.0.57
- 1.0.56
- 1.0.55
- 1.0.54
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-10-15 20:09:21 UTC
README
Provides component creation and management utilizing Drupal single directory components.
For a developer's map of the module internals — the neo_component entity, the
ComponentShape/prop-def plugin system, the render pipeline, services, and extension
points — see ARCHITECTURE.md.
For the automated tests, how to set a host site up to run them, and the fixture module they rely on, see TESTING.md.
REQUIREMENTS
This module requires the Neo suite of modules.
INSTALLATION
Install as you would normally install a contributed Drupal module. Visit https://www.drupal.org/node/1897420 for further information.
DRUSH COMMANDS
Alchemist ships introspection and verification commands to make authoring components easier — list what already exists, look up the available shapes, icons and color schemes, and confirm a component renders before shipping it.
In every command below, <id> is the SDC component id in provider:machine_name
form (e.g. front:cards_test). Run drush neo:alchemist:components to see the
valid ids. All tabular commands accept --format=json (and the other standard
Drush formats) for machine parsing.
Discover & inspect
neo:alchemist:components (alias neoa-components) — list every Neo component
(SDC with neo: true) with its provider, status, and prop/slot counts. Use it
to check whether a machine name is already taken.
drush neo:alchemist:components drush neo:alchemist:components --theme=front
neo:alchemist:info <id> (alias neoa-info) — dump one component's resolved
definition: props (authored type, title, required, examples), slots, libraries,
and status. Defaults to YAML output.
drush neo:alchemist:info front:cards_test
neo:alchemist:shapes [name] (alias neoa-shapes) — with no argument, list
every prop-def shape (heading, image, link, scheme, spacing, …). With
a name, dump that shape's schema, a paste-ready .component.yml prop snippet,
and its Twig render pattern.
drush neo:alchemist:shapes drush neo:alchemist:shapes heading
Two related lookups live in the modules that own the data:
- Icons —
drush neo:icon:list [search](Neo Icon) searches the icon names for theicon()Twig function. - Color schemes —
drush neo:color:schemes(Neo Color) lists the enabled schemes (id, label, selector, dark/colorized) to verify components against, and supplies the id forneo:alchemist:render --scheme.
Verify
neo:alchemist:validate <id> (alias neoa-validate) — statically lint a
component. Flags missing neo: true, props with no examples, unknown prop
types, {% if/for %} references to props that aren't declared, and Tailwind
class names assembled dynamically (which never compile). Exits non-zero on hard
errors.
drush neo:alchemist:validate front:cards_test
neo:alchemist:render <id> (alias neoa-render) — render a component
headlessly from its examples and report PASS/FAIL, surfacing Twig/render
errors as a message instead of a broken page. --html prints the rendered
markup; --scheme=<id> wraps the render in a color scheme selector; --live
renders the runtime path (neoIsPreview false) instead of the editor preview.
drush neo:alchemist:render front:cards_test drush neo:alchemist:render front:cards_test --html drush neo:alchemist:render front:cards_test --scheme=dark drush neo:alchemist:render front:header --live --html
neo:alchemist:audit <id> (alias neoa-audit) — render a component and check
its markup for what search engines and screen readers trip over: headings that
skip a level or start below h2 (a component sits under the page's H1), an h1 of
its own, images without alt text (or a file name for one), and headings, links
and buttons with no accessible name. It renders twice — from its examples, and
again with every optional heading prop left out, the way an editor often places
it — and names the render each issue came from. --all audits every component
(--theme=<name> narrows it). Exits non-zero when anything is found. The
component's preview page runs the same audit: an "N issues" badge in its top bar
lists them, and Show outlines the element in the preview.
drush neo:alchemist:audit front:cards_test drush neoa-audit --all --theme=front
Checks are services tagged neo_alchemist.component_audit_check, implementing
ComponentAuditCheckInterface, so another module can add its own. A check sees the
component as well as its markup, and may add a report — what the component produces, say —
which the preview page folds under the issues (the badge then reads "No issues" rather than
hiding). Likewise neo:alchemist:validate runs every service tagged
neo_alchemist.component_linter (ComponentLinterInterface), for modules that read a key
of their own from .component.yml; neo_seo checks a component's seo declaration this way.
neo:alchemist:h1-report (alias neoa-h1) — list each Alchemist page's H1s and
the component each sits in (page title when no heading in the layout is the H1
and the hidden page title is). It checks every published page whose layout the
page owns (custom or hybrid), and the most recently changed few of each locked
layout, which stand for the rest — they share the layout and differ only in their
data; the summary names what was sampled. --all checks every page, --sample=N
(default 5) sizes the samples, and --entity-type, --bundle and --limit
narrow the sweep. Each page's entity is rendered in its full view mode under a
request for its page — the layout without the header, menus, footer and blocks
around it — so a run takes seconds rather than minutes; an <h1> a block or the
theme prints outside the layout is not seen. Progress and each problem page go to
stderr as the run goes; --problems lists only pages without exactly one H1.
Save an --all report before migrating components to heading.tag and compare
it with one taken after.
drush neo:alchemist:h1-report --problems
drush neoa-h1 --all --format=csv > h1-before.csv
Capture a component thumbnail
The component listings show a thumbnail per component, and core reads it from a
thumbnail.png sitting in the component's own directory. You can produce one
from the browser instead of exporting it by hand:
- Be on a local development environment — see the gate below.
- Open the component's preview workspace at
/admin/config/neo/alchemist/preview/<id>. - Click Capture thumbnail, frame it with the Align and Width controls, then click Capture.
The PNG is written straight to <component-dir>/thumbnail.png, so it lands next
to the .component.yml, shows up in git status, and travels with the
component. No cache rebuild is needed — core picks it up on the next request.
It also becomes the fallback thumbnail for any saved component wrapping that SDC
which has no thumbnail of its own.
Because this writes into the codebase, it is offered only on a local development environment. Either signal is enough:
- the Neo dev server is running (
npm start), or - the dev config split is enabled —
$config['config_split.config_split.dev']['status'] = TRUE;in the gitignoredsettings.local.php.
The split is the steadier of the two: it holds for the whole environment,
whereas the dev-server signal comes and goes with npm start.
Where neither holds the button is absent and the endpoint refuses the write.
Where one holds but the component directory is not writable by the web server,
the button renders disabled and names the directory — chmod it.
TWIG EVENTS
Sometimes a component needs to allow mouse events to be able to be triggered while in the management interface (tabs, accordions, etc.). To tell Alchemist about this, the following can be added in twig to the element that needs to be exposed:
Basic event
A simple event that will just allow mouse interfaction with an element.
<div {% if neoIsPreview %} data-event {% endif %} >
Toggle event
For elements that can be toggled. This is ideal for an accordion that allows multiple elements to be visible at once and each one can be shown or hidden.
<div {% if neoIsPreview %} data-event='{"action": "toggle"}' {% endif %} >
Grouped event
For elements that belong together. This is ideal for tabs or accordion elements that only allow a single visible element. The group name can be any string but should be unique per grouping.
<div {% if neoIsPreview %} data-event='{"group": "tabs"}' {% endif %} >