定制 emulsify-ds/emulsify-drupal 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

emulsify-ds/emulsify-drupal

Composer 安装命令:

composer require emulsify-ds/emulsify-drupal

包简介

The official Drupal theme for Emulsify, with Storybook and a Vite-based build workflow for generated child themes

README 文档

README

Emulsify Design System

Emulsify Drupal

Emulsify is an open-source toolset for creating and implementing design systems on your website

Storybook, Emulsify Core 4, and a Vite-based build workflow for Drupal 11.3+

Emulsify Drupal is the official Drupal parent theme for Emulsify. It provides a Storybook component library, Emulsify Core 4 tooling, and a Vite-based build workflow for Drupal 11.3+ with Drupal 12 forward compatibility. Until Drupal 12 beta or stable recommended-project releases are available, Drupal core development branch coverage is experimental.

The current 7.x series no longer depends on stable9; Emulsify now ships its own complete template layer instead of inheriting one from a Drupal parent theme.

Documentation

docs.emulsify.info

Quick Links

  1. Installation
  2. Usage
  3. Upgrade guide
  4. Template override map
  5. Favicon generation lifecycle
  6. Optional design-token integration
  7. Release readiness checklist

Demo

  1. Storybook

How To

Generate a child theme

Emulsify Tools is required by the Emulsify Drupal parent theme. Use its Drush helper command to generate a child theme:

drush emulsify my_theme

The helper module also exposes the fully qualified command name:

drush emulsify_tools:bake my_theme

The whisk directory is the generation-only starterkit source used by both generation methods. Do not enable whisk directly; generated child themes keep emulsify as their runtime parent theme.

You can also generate the same child theme with Drupal core's standard Starterkit command from the root of your Drupal site:

php web/core/scripts/drupal generate-theme my_theme --starterkit whisk --path themes/custom

These generation methods should be treated as equivalent:

  1. They generate the theme into web/themes/custom/my_theme.
  2. They use the whisk starterkit source.
  3. They keep emulsify as the runtime parent theme for the generated theme.
  4. They preserve project.emulsify.json so Emulsify Core can identify the generated Drupal project structure.

After generation:

  1. Enable the theme:
drush theme:enable my_theme -y
drush config:set system.theme default my_theme -y
drush cr -y
  1. Install the generated theme's frontend dependencies:
cd web/themes/custom/my_theme
npm install
  1. Start the generated theme's local tooling:
npm run develop

Generated child themes use the Vite build workflow and Emulsify Core 4 scripts shipped by the whisk starterkit source.

Verify your generated child theme

Run these commands from the generated child theme directory, not from whisk:

cd web/themes/custom/my_theme
node --version
npm install
npm run build
npm run storybook-build
npm run test

Generated child themes require Node.js 24 or newer. Use npm install for the first local install, or npm ci when the generated child theme already has a committed package-lock.json.

These checks verify the expected local workflow:

  1. node --version confirms the Node.js runtime satisfies the generated theme requirement.
  2. npm install installs Emulsify Core 4 and the generated theme tooling.
  3. npm run build compiles Drupal-facing assets with the Vite build workflow.
  4. npm run storybook-build verifies the static Storybook build.
  5. npm run test verifies the generated Jest setup. It passes when no project tests exist yet.

Optional browser-based accessibility check:

npm run a11y

npm run a11y builds Storybook and runs the Emulsify Core accessibility check. Use it in local or CI environments that can run the required browser-based tooling.

Manage generated favicon packages

The generated favicon workflow is built around one portable SVG source stored in theme settings.

Emulsify Drupal owns the theme-facing parts of that workflow: the theme settings form, config defaults and schema, admin previews, frontend head tags, generated asset references in <theme>.settings, and sanitized SVG storage for config portability.

  1. Configure the package in the theme settings form for emulsify or a generated child theme.
  2. Save the theme settings form to generate or update the package during normal admin changes.
  3. Review package and portable-source diagnostics in the theme settings UI.

Emulsify Tools owns deployment-oriented Drush operations for those same settings. After configuration import or deploy, use the Emulsify Tools favicon commands to generate, inspect, or reset environment-local package files before public traffic reaches the environment. See the Emulsify Tools README for the full command documentation.

Runtime page requests never generate favicon files. If the configured package is missing, Emulsify skips favicon head tags until the theme settings form or the Emulsify Tools generate command creates the package.

Generated favicon packages require the PHP gd extension and the Imagick extension for SVG rasterization. If either extension is unavailable, the uploaded SVG can still be stored in configuration, but PNG and ICO package generation will fail until those extensions are installed.

The theme settings UI surfaces the current portable-source and package status. Portable SVG copies larger than 256 KB are flagged because very large config payloads are awkward to review and deploy.

See docs/favicon-generation.md for generated files, package location, generator limits, and deployment expectations.

Contributing

Code of Conduct

The project maintainers have adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contribution Guide

Please also follow the issue template and pull request templates provided. See below for the correct places to post issues:

  1. Emulsify Drupal
  2. Emulsify Tools Drupal Module
  3. Emulsify Twig Extensions

Committing Changes

To facilitate automatic semantic release versioning, we utilize the Conventional Changelog standard through Commitizen. Follow these steps when committing your work to ensure semantic release can version correctly.

  1. Stage your changes, ensuring they encompass exactly what you wish to change, no more.
  2. Create a Conventional Commit message, either manually or with your preferred commit helper.
  3. Your commit message will be used to create the changelog for the next version that includes that commit.

Release Readiness

Run the release guard before merging packaging, starterkit, favicon settings, or release metadata changes, and before preparing a 7.x release:

npm run release:check

Use Node.js 24.10 or newer for local release tooling.

Use npm run release:check -- --skip-smoke when you only want the static metadata, README, duplicate-script, and schema checks. The static checks verify that favicon settings stay aligned across FaviconSettings::DEFAULTS, config/install/emulsify.settings.yml, and config/schema/emulsify.schema.yml.

Author

Emulsify® is a product of Four Kitchens — We make BIG websites.

Contributors

Brian Lewis
Brian Lewis

💻 📖
Randy Oest
Randy Oest

💻 📖
Callin Mullaney
Callin Mullaney

💻 📖
Patrick Coffey
Patrick Coffey

💻 📖
Luke Herrington
Luke Herrington

💻 📖
Aaron Couch
Aaron Couch

💻 📖
Marc Berger
Marc Berger

💻 📖
James Todd
James Todd

💻 📖
Kurt Trowbridge
Kurt Trowbridge

💻 📖
Chris Martin
Chris Martin

💻 📖
Adam Erickson
Adam Erickson

💻 📖
Chris Runo
Chris Runo

💻 📖
Andy Carlberg
Andy Carlberg

💻 📖
eatsmarter-benny
eatsmarter-benny

💻 📖
Brian Perry
Brian Perry

💻 📖
Israel Shmueli
Israel Shmueli

💻 📖
John Karahalis
John Karahalis

💻 📖
Mihaic100
Mihaic100

💻 📖
Paul Sebborn
Paul Sebborn

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

emulsify-ds/emulsify-drupal 适用场景与选型建议

emulsify-ds/emulsify-drupal 是一款 基于 Twig 开发的 Composer 扩展包,目前已累计 553.21k 次下载、GitHub Stars 达 96, 最近一次更新时间为 2020 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 emulsify-ds/emulsify-drupal 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 emulsify-ds/emulsify-drupal 我们能提供哪些服务?
定制开发 / 二次开发

基于 emulsify-ds/emulsify-drupal 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 553.21k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 96
  • 点击次数: 23
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 96
  • Watchers: 19
  • Forks: 44
  • 开发语言: Twig

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2020-03-27