CoordiationCSS
Docs/Tooling/Upgrade & codemods

TOOLING · COMPLETE

Upgrade and codemods

Turn compiler deprecations into versioned source changes with exact locations, dry-run plans, safe write mode, and no evaluation of application code.

✓

Every migration names the compiler deprecation it resolves. The upgrade registry and compiler guidance therefore share one auditable contract.

01

Create a plan before writing

Terminal
npm install -D @coordiation/upgrade
coordiation-upgrade src/App.tsx --from 0.1.0 --to 1.0.0 --json

The JSON plan lists changed files, edit counts, migration IDs, line/column positions, and exact before/after text.

02

Migrate legacy negative syntax

Safe transform
hover:co--mt-4
→ hover:-co-mt-4

ui--translate-x-2
→ -ui-translate-x-2

The migration understands stacked variants, important modifiers, and custom prefixes. Canonical source is idempotent: a second run reports no edits.

03

Gate or apply the upgrade

CI and write modes
coordiation-upgrade src/App.tsx --check
coordiation-upgrade src/App.tsx --write

Check mode fails when migration is required without changing source. Write mode applies only registered safe transforms.

04

Integrate the migration engine

upgrade.mjs
import { migrateSource, planUpgrade, upgradeManifest } from "@coordiation/upgrade";

const result = migrateSource(source, { prefix: "co-" });
const plan = planUpgrade({ "App.tsx": source });

upgradeManifest declares the latest target, registered transforms, supported modes, and owned deprecations.

SAFE BOUNDARIES

Mechanical changes only

Codemods stop where application intent would be required.

  • Dynamic templates and concatenated class strings are preserved.
  • Class-like prose and unrelated strings are not rewritten.
  • Only registered safe transforms run in write mode.
  • A migration plan is evidence of edits, not proof that application behavior is correct.