Skip to content

Migrator 4.1.0 refuses to run: bundled compat manifest still pins the migrator at 4.0.0 #232

Description

@cratis-stagehand

Every @cratis/components.migrator@4.1.0 CLI fails its own compatibility preflight and exits before doing any work:

$ npx --package "@cratis/components.migrator@4.1.0" cratis-components-change-handler --check ./Source
Compatibility preflight failed: Bundled compatibility manifest has stale migrator package metadata.

Expected the codemod to report what it would rewrite. Instead nothing runs — this affects cratis-components-change-handler, cratis-components-button-variant-tone, and cratis-components-remove-root-namespace-imports alike, since they all share lib/compatibility.js.

Cause

compat-manifest.json bundled in the 4.1.0 tarball still carries the 4.0.0 entry:

{ "name": "@cratis/components.migrator", "role": "migrator", "version": "4.0.0",
  "releaseMajorRange": ">=4 <5", "independentRelease": false, ... }

while package.json says "version": "4.1.0". lib/compatibility.js requires exact equality:

if (packageEntry?.version !== migratorVersion || ...) {
    throw new Error('Bundled compatibility manifest has stale migrator package metadata.');
}

toolingCompatibility.migrator is >=4 <5 and passes; it is only the packages[] entry's pinned version that fails. So the manifest is not regenerated (or not re-pinned) as part of cutting a release, and the check is exact rather than range-based — which means the same breakage recurs on every future release.

@cratis/components.migrator@4.0.0 runs fine, so the workaround is to pin the older version.

Why it matters

The migrator is the tool the 3 → 4 migration guide points people at for the Dropdown onChangeChangeHandler<T> change and the Button variant/tone cleanup. Every consumer upgrading to the current Components release hits a preflight failure with no indication that an older migrator would work, so it reads as "the migration tooling is broken" rather than "pin 4.0.0". Found while migrating Cratis/Stagehand to Components 4 (Cratis/Stagehand#356); we did the 23 Dropdown call sites by hand.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions