Skip to content

Fix: Fail fast when multiple themes are active in a build (fixes #3784)#3785

Merged
oliverfoster merged 2 commits intomasterfrom
issue/3784
Apr 13, 2026
Merged

Fix: Fail fast when multiple themes are active in a build (fixes #3784)#3785
oliverfoster merged 2 commits intomasterfrom
issue/3784

Conversation

@swashbuck
Copy link
Copy Markdown
Contributor

@swashbuck swashbuck commented Mar 29, 2026

Fixes #3784

Fix

  • Add a check-plugins grunt task that detects when more than one theme is active after accounting for build.excludes, build.includes, productionExcludes, and --theme CLI flag
  • Chain check-plugins from check-json via grunt.task.run() so it runs for all entry points (direct grunt, rub-cli, server-build)
  • Also register check-plugins in the build and dev task pipelines for explicit visibility

Note: Multiple menus are intentional (main menu + sub menu), so only themes are validated.

Testing

  1. Install two themes (e.g. adapt-contrib-vanilla plus a custom theme)
  2. Set _theme in config.json to the custom theme but do NOT add vanilla to build.excludes
  3. Run grunt build or rub -cF - verify the build exits with a clear error naming the conflicting themes and suggesting the fix
  4. Add the extra theme to build.excludes and re-run - verify the build proceeds normally
  5. Run with --theme=adapt-contrib-vanilla flag - verify the check is skipped (CLI flag overrides)

@oliverfoster
Copy link
Copy Markdown
Member

Multi-menu courses is intentional. Sometimes a main menu and a sub menu are different.

@swashbuck swashbuck self-assigned this Mar 29, 2026
@swashbuck swashbuck moved this from New to Assigned in adapt_framework: The TODO Board Mar 29, 2026
- Remove menu validation (multi-menu courses are intentional)
- Chain check-plugins from check-json so rub-cli also runs the check
- Respect build.includes, productionExcludes, and --theme CLI flag
@swashbuck
Copy link
Copy Markdown
Contributor Author

swashbuck commented Mar 29, 2026

Multi-menu courses is intentional. Sometimes a main menu and a sub menu are different.

Updated to only apply when multiple themes are present.

Why themes and not menus?
Both <%= theme %> and <%= menu %> default to ** in the grunt config, so both compile all installed plugins of their type. Menus have very few LESS files (typically 3-4 across all installed menus), so the heap impact is negligible. Themes can have 80+ LESS files each with deep variable/mixin dependency chains, making two themes together enough to OOM the process.

@swashbuck swashbuck moved this from Assigned to Needs Reviewing in adapt_framework: The TODO Board Mar 29, 2026
@swashbuck swashbuck changed the title Fix: Fail fast when multiple themes or menus are active in a build (fixes #3784) Fix: Fail fast when multiple themes are active in a build (fixes #3784) Mar 29, 2026
@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Apr 13, 2026

You sure you want this as a dev-only task?

@oliverfoster
Copy link
Copy Markdown
Member

Simple and old

@oliverfoster oliverfoster merged commit 09720b9 into master Apr 13, 2026
1 check passed
@oliverfoster oliverfoster deleted the issue/3784 branch April 13, 2026 09:17
@github-project-automation github-project-automation bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Apr 13, 2026
github-actions bot pushed a commit that referenced this pull request Apr 13, 2026
# [5.56.0](v5.55.2...v5.56.0) (2026-04-13)

### Chore

* Bump axios from 1.8.4 to 1.15.0 (#3794) ([e3c5b46](e3c5b46)), closes [#3794](#3794)
* Bump brace-expansion from 1.1.12 to 1.1.13 (#3792) ([3ef184a](3ef184a)), closes [#3792](#3792)
* Bump fast-xml-parser from 4.5.0 to 4.5.6 (#3793) ([785578e](785578e)), closes [#3793](#3793)
* Bump flatted from 3.2.9 to 3.4.2 (#3779) ([5d856fd](5d856fd)), closes [#3779](#3779)
* Bump handlebars from 4.7.8 to 4.7.9 (#3783) ([ef38e55](ef38e55)), closes [#3783](#3783)
* Bump lodash from 4.17.21 to 4.17.23 (#3750) ([ee264d8](ee264d8)), closes [#3750](#3750)
* Bump lodash from 4.17.23 to 4.18.1 (#3789) ([079e907](079e907)), closes [#3789](#3789)
* Bump lodash-es from 4.17.21 to 4.17.23 (#3749) ([b7d17e0](b7d17e0)), closes [#3749](#3749)
* Bump lodash-es from 4.17.23 to 4.18.1 (#3790) ([718e128](718e128)), closes [#3790](#3790)
* Bump picomatch (#3782) ([934455e](934455e)), closes [#3782](#3782)
* Bump qs from 6.14.1 to 6.14.2 (#3759) ([8e6a7e8](8e6a7e8)), closes [#3759](#3759)
* Bump rollup from 2.79.2 to 2.80.0 (#3767) ([6d3b700](6d3b700)), closes [#3767](#3767)
* Bump serialize-javascript and @rollup/plugin-terser (#3791) ([b36da6c](b36da6c)), closes [#3791](#3791)
* Bump svgo from 3.3.2 to 3.3.3 (#3770) ([5de7d51](5de7d51)), closes [#3770](#3770)
* Bump tar and npm (#3772) ([7a6981f](7a6981f)), closes [#3772](#3772)
* Bump tar and semantic-release (#3751) ([fb61128](fb61128)), closes [#3751](#3751)
* Bump underscore from 1.13.7 to 1.13.8 (#3769) ([68b9654](68b9654)), closes [#3769](#3769)
* Bump undici and @actions/http-client (#3780) ([a908d05](a908d05)), closes [#3780](#3780)

### Fix

* Bumping core to v6.73.1 automatically via 'frameworkpullrequest' Github action (#3755) ([85fc56b](85fc56b)), closes [#3755](#3755)
* Bumping core to v6.74.0 automatically via 'frameworkpullrequest' Github action (#3756) ([bc3cfbd](bc3cfbd)), closes [#3756](#3756)
* Bumping core to v6.75.0 automatically via 'frameworkpullrequest' Github action (#3763) ([d68dd7d](d68dd7d)), closes [#3763](#3763)
* Fail fast when multiple themes are active in a build (fixes #3784) (#3785) ([09720b9](09720b9)), closes [#3784](#3784) [#3785](#3785)
* Implement semantic-release-config, fix broken automated releases (fixes #3774) (#3775) ([bb20081](bb20081)), closes [#3774](#3774) [#3775](#3775)
* Treat empty includes/excludes arrays as unset (#3787) ([d05239f](d05239f)), closes [#3787](#3787)

### Update

* Bump adapt-migrations version in package-lock.json (fix #3752) ([5096e30](5096e30)), closes [#3752](#3752)
* Skip timestamp updates in development builds (fix #3706) #3764 ([827edb0](827edb0)), closes [#3706](#3706) [#3764](#3764)
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 5.56.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Recently Released

Development

Successfully merging this pull request may close these issues.

Fix: Fail fast with a clear error when multiple themes or menus are active in a build

2 participants