fix(plugin): validate provides.mixins targets against allowlist#2256
Merged
fix(plugin): validate provides.mixins targets against allowlist#2256
Conversation
PackageLoader silently accepted unknown mixin targets: a typo like "controler" or an unsupported name like "view" produced zero mixin injection, so the package appeared loaded but its methods never reached the target. Added $validateMixinTargets() to reject unknown targets up front with a clear error naming the unknown entry and the full allowlist. Dropped the silent-noop "view" target from the basecoat and hotwire manifests (controller mixins already surface in views via variables scope) and aligned the CLAUDE.md provides.mixins description with the actual allowlist. Refs #2247 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 23, 2026
3 tasks
bpamiri
added a commit
that referenced
this pull request
Apr 24, 2026
) Extends the #2256 allowlist check to per-method mixin metadata overrides in $collectMixins. A typo like `function foo() mixin="controler" {}` is no longer silent — the package is recorded in failedPackages with an error naming the package, method, unknown target, and the allowlist. $validateMixinTargets gains an optional methodName context param; the per-method call happens in a validation pre-pass so a typo on method N cannot leave methods 1..N-1 half-registered in variables.mixins. Closes #2257.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$validateMixinTargets()toPackageLoaderso packages declaring unknown mixin targets fail to load with a clear error instead of silently producing zero injection. Valid targets come from the existingvariables.mixableComponentsallowlist plus the special valuesglobalandnone."view"target frompackages/basecoat/package.jsonandpackages/hotwire/package.json. Controller mixins already surface in views because Wheels views execute in the controller's variables scope, so helper availability is unchanged.provides.mixinsdescription inCLAUDE.mdwith the real allowlist and notes thatviewis not a valid target.invalidmixinandinvalidmixinviewtest fixtures plus a newMixin target validationdescribe block inPackageLoaderSpec.cfc(4 cases).Closes #2247.
Before → after behavior
"mixins": "controler"(typo)failedPackageswith error naming the unknown target"mixins": "controller,view"controllermixes;viewsilently ignoredfailedPackages(view not in allowlist)"mixins": "none"or"global"Test plan
develop(2 of 4 fail because validator does not exist)bash tools/test-local.sh→ 3300 pass / 0 fail / 0 error (Lucee 7 + SQLite)basecoatandhotwirestill load when copied intovendor/(manual smoke)Follow-ups (tracked as separate issues)
mixinmetadata override in$collectMixins(same typo-swallowing problem, narrower scope).packages/basecoat/CLAUDE.mdandpackages/hotwire/CLAUDE.mdstill claim mixins reach "view scope" directly; inaccurate but runtime-correct. Docs-only cleanup.🤖 Generated with Claude Code