|
| 1 | +# update-tasty |
| 2 | + |
| 3 | +Update the `@tenphi/tasty` dependency to the latest published version (or a specific version if provided by the user), install it, migrate any breaking changes, and add a changeset. |
| 4 | + |
| 5 | +## Steps |
| 6 | + |
| 7 | +### 1. Determine Versions |
| 8 | + |
| 9 | +- Read the current `@tenphi/tasty` version from `package.json` (`dependencies["@tenphi/tasty"]`). Strip any semver range prefix (`^`, `~`, `>=`, etc.) to get the exact installed version. |
| 10 | +- Resolve the **target version**: |
| 11 | + - If the user provided a version string (e.g. `1.2.0` or `2.0.0-snapshot.abc123`), use it. |
| 12 | + - Otherwise, run `npm view @tenphi/tasty version` to get the latest stable version. |
| 13 | +- If current version equals the target version, report "already up to date" and stop. |
| 14 | + |
| 15 | +### 2. Update `package.json` |
| 16 | + |
| 17 | +- In `package.json`, set `dependencies["@tenphi/tasty"]` to the exact target version (no semver range prefix — the package is pinned to an exact version). |
| 18 | +- Do **not** modify any other field. |
| 19 | + |
| 20 | +### 3. Install |
| 21 | + |
| 22 | +Run: |
| 23 | + |
| 24 | +``` |
| 25 | +pnpm install |
| 26 | +``` |
| 27 | + |
| 28 | +### 4. Check for Dev Snapshot |
| 29 | + |
| 30 | +Determine whether the target version is a pre-release/snapshot by checking if its version string contains a hyphen (e.g. `2.0.0-snapshot.abc123`, `2.0.0-beta.1`). If it **is** a snapshot, skip steps 5–6 (changelog and changelog-driven migration only) and go directly to step 7. **Do not** skip step 7: snapshot upgrades still need a full TypeScript compile check. |
| 31 | + |
| 32 | +### 5. Read the Changelog |
| 33 | + |
| 34 | +Fetch the changelog from: |
| 35 | + |
| 36 | +``` |
| 37 | +https://raw.githubusercontent.com/tenphi/tasty/refs/heads/main/CHANGELOG.md |
| 38 | +``` |
| 39 | + |
| 40 | +Parse all changelog entries **strictly between** the current (old) version and the target (new) version — inclusive of the target, exclusive of the old. Collect only entries for the versions in that range. |
| 41 | + |
| 42 | +### 6. Perform Migration |
| 43 | + |
| 44 | +Analyze the collected changelog entries. Perform **only migrations that are relevant to `@cube-dev/ui-kit`** — i.e. changes to the runtime tasty API, style syntax, tokens, and modifiers used in this codebase. Skip anything related to: |
| 45 | + |
| 46 | +- Zero-runtime / `tastyStatic` / Babel plugin / Next.js / Turbopack |
| 47 | +- SSR entry points (`@tenphi/tasty/ssr`) |
| 48 | +- Build, packaging, or internal test infrastructure of the `tasty` package itself |
| 49 | + |
| 50 | +For each relevant breaking change or recommended migration in the changelog, scan the codebase and apply the necessary updates. Common migration patterns to watch for (not limited to these): |
| 51 | + |
| 52 | +| Change | What to look for | What to do | |
| 53 | +|--------|------------------|------------| |
| 54 | +| Preset modifier syntax: space-separated → slash-separated (e.g. `h2 strong` → `h2 / strong`) | `preset="…"` props and `preset:` style keys with two space-separated words | Replace with slash-separated form | |
| 55 | +| Recipe separator: `\|` → `/` | `recipe="…"` values using `\|` | Replace with `/` | |
| 56 | +| Font CSS custom property rename: `--font` → `--font-sans`, `--monospace-font` → `--font-mono` | Direct CSS variable references | Update references | |
| 57 | +| `lh` unit removed | Uses of `lh` as a custom unit in style props | Replace with native CSS `lh` | |
| 58 | +| `--line-height` / `--font-size` CSS variables removed from presets | Direct references to those custom properties | Remove or replace | |
| 59 | +| Color companion variable suffix: `-rgb` → `-oklch` | Uses of `--*-rgb` companion variables | Update to `--*-oklch` | |
| 60 | + |
| 61 | +If a migration requires widespread search-and-replace, use targeted search tools to find all occurrences before modifying. |
| 62 | + |
| 63 | +### 7. Verify TypeScript |
| 64 | + |
| 65 | +**Always run this step** after installing the new `@tenphi/tasty` version (whether or not steps 5–6 were skipped for a snapshot). Snapshot and pre-release builds are especially likely to surface type-breaking API changes. |
| 66 | + |
| 67 | +Verify that TypeScript compiles: |
| 68 | + |
| 69 | +``` |
| 70 | +pnpm tsc --noEmit 2>&1 | head -50 |
| 71 | +``` |
| 72 | + |
| 73 | +Fix any type errors introduced by the upgrade. |
| 74 | + |
| 75 | +### 8. Add Changeset |
| 76 | + |
| 77 | +Follow the `add-changeset` command conventions: |
| 78 | + |
| 79 | +- Place the changeset file in `.changeset/` with a descriptive kebab-case name (e.g. `tasty-1-2-0-update.md`). |
| 80 | +- **Version bump rule:** |
| 81 | + - `patch` if only bug fixes and no breaking changes for ui-kit consumers. |
| 82 | + - `minor` if new features or breaking/noticeable changes are introduced. |
| 83 | +- **Content guidelines:** |
| 84 | + - Lead with the tasty version update (e.g. "Update `@tenphi/tasty` to `X.Y.Z`"). |
| 85 | + - List only the tasty changes that are **relevant to ui-kit** (runtime API, style syntax, tokens, component behavior). Do **not** mention zero-runtime, static, SSR, build, or packaging changes from the tasty changelog. |
| 86 | + - For snapshots: just note the version bump with no changelog details. |
| 87 | + - If migrations were applied, briefly describe what was changed in the ui-kit codebase. |
| 88 | + - Keep it concise and user-focused. |
| 89 | + |
| 90 | +Changeset format: |
| 91 | + |
| 92 | +```md |
| 93 | +--- |
| 94 | +"@cube-dev/ui-kit": minor |
| 95 | +--- |
| 96 | + |
| 97 | +Update `@tenphi/tasty` to `X.Y.Z`. |
| 98 | + |
| 99 | +- Describe relevant tasty change 1 |
| 100 | +- Describe relevant tasty change 2 |
| 101 | + |
| 102 | +Migrated: brief description of what was changed in this codebase. |
| 103 | +``` |
| 104 | + |
| 105 | +### 9. Commit |
| 106 | + |
| 107 | +Read the commit-changes rule. Create a single commit with a message like: |
| 108 | + |
| 109 | +``` |
| 110 | +chore(tasty): update to X.Y.Z |
| 111 | +``` |
| 112 | + |
| 113 | +If migrations were applied, the commit message may reflect that: |
| 114 | + |
| 115 | +``` |
| 116 | +chore(tasty): update to X.Y.Z and migrate breaking changes |
| 117 | +``` |
0 commit comments