Skip to content

feat(plugin): detect and log mixin collisions across packages (#2245)#2262

Merged
bpamiri merged 2 commits intodevelopfrom
claude/elegant-nobel-a7fe79
Apr 23, 2026
Merged

feat(plugin): detect and log mixin collisions across packages (#2245)#2262
bpamiri merged 2 commits intodevelopfrom
claude/elegant-nobel-a7fe79

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 23, 2026

Summary

  • Close #2245. PackageLoader now tracks which package registered each method per target and records a collision when another package or legacy plugin overwrites it — previously silent via StructAppend.
  • New provides.overrides array in package.json lets a package declare intentional overrides; acknowledged overrides log at info level instead of warning.
  • Global.cfc.$loadPackages stitches the runtime collisions (intra-package and cross-system) into application.wheels.mixinCollisions with a source tag so the existing plugins.cfm view + debug page surface both kinds.
  • wheels doctor gains a static manifest+CFC scan (regex-based; runtime in PackageLoader remains authoritative) that surfaces collisions pre-boot.
  • Follow-ups filed: #2260 (regex scan blind spots), #2261 (doctor --verbose dump).

Test plan

  • bash tools/test-local.sh — Lucee 7 + SQLite, 3306 pass / 0 fail / 0 error (+6 new PackageLoader mixin-collision specs)
  • bash tools/test-cli-local.sh388 pass / 0 fail (+4 new DoctorSpec collision specs)
  • Manually verified fixture layout under vendor/wheels/tests/_assets/packages_collision/ — isolated from the shared fixtures path so it doesn't pollute other PackageLoader specs.
  • Recommended: re-run compat matrix (Adobe CF + Lucee 6) once CI picks up the branch — no engine-specific idioms were introduced but the private $recordCollision helper uses the same patterns already validated for Plugins.cfc.

Acceptance against #2245

  • Two packages both providing $sharedHelper → both load, warning logged, collision listed
  • Single package → no warnings (baseline regression guard)
  • Package + legacy plugin collision → tagged source: "cross" with both names
  • Acknowledged override via provides.overridesacknowledged: true, info log instead of warning
  • Surfaced in wheels doctor output

Closes #2245. PackageLoader now tracks which package registered each
method per target and records a collision when another package
overwrites it. Cross-system collisions (legacy plugin overwritten by a
package) are detected while merging package mixins into the application
mixins struct. Packages can acknowledge an intentional override via
provides.overrides in package.json; acknowledged overrides log at info
level instead of warning. wheels doctor gains a static manifest+CFC
scan that surfaces collisions pre-boot.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Apr 23, 2026
- Rename PackageLoader.$methodProviders() public getter to
  getMethodProviders() so the method name no longer shadows the
  variables.$methodProviders storage struct on Adobe CF, which keys
  function declarations in the same variables scope.
- Wrap `for (var target in expanded)` in listToArray() — Adobe CF's
  for...in on a comma-delimited string iterates characters (or errors)
  rather than list elements, silently zeroing the Doctor scan for
  packages declaring provides.mixins: "global".
- Broaden Doctor's public-function regex: the return type and access
  modifier are both optional now, catching `public function foo()` and
  implicit-public `function foo()`. `private` is explicitly filtered.
- Skip the cross-system collision warning in Global.$loadPackages when
  the pre-existing entry has no attributable plugin provider — avoids a
  misleading "migrate the plugin" recommendation when the prior entry
  came from something other than a legacy plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit 53373d2 into develop Apr 23, 2026
3 of 8 checks passed
@bpamiri bpamiri deleted the claude/elegant-nobel-a7fe79 branch April 23, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

packages: detect and log mixin collisions across packages

1 participant