Skip to content

Commit 623de1f

Browse files
docs(web/guides): document wheels upgrade apply verb across upgrade guides
Fixes #3045 Signed-off-by: wheels-bot[bot] <wheels-bot[bot]@users.noreply.github.com> Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent a6df6be commit 623de1f

4 files changed

Lines changed: 73 additions & 20 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Docs: upgrade guide, release-channels, and 3x-to-4x migration guide updated to document `wheels upgrade apply` as the framework-swap verb alongside `wheels upgrade check` (#3045)

‎web/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/upgrade.mdx‎

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
---
22
title: "Upgrade"
3-
description: wheels upgrade check — scan an existing project for known breaking changes against the current release (or a pinned target), without touching any files.
3+
description: wheels upgrade — check for breaking changes before upgrading (check), or swap vendor/wheels/ from the CLI bundle (apply).
44
type: reference
55
sidebar:
66
order: 10
77
---
88

99
import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components';
1010

11-
`wheels upgrade` is a **read-only scanner**. It compares the framework version installed in `vendor/wheels/` against a target release, then greps the project for patterns that are known to break between major versions. It does **not** swap out `vendor/wheels/`, edit `box.json`, rewrite your code, or install anything. That part of the upgrade happens through your package manager — the CLI just tells you what will be waiting for you on the other side.
11+
`wheels upgrade` has two verbs. `wheels upgrade check` is a **read-only scanner** — it compares the framework version installed in `vendor/wheels/` against a target release, then greps the project for patterns that are known to break between major versions. `wheels upgrade apply` performs the actual framework swap, replacing `vendor/wheels/` with the copy bundled inside the installed CLI. Neither verb edits `box.json`, rewrites your code, or installs packages.
1212

1313
**You'll use this for:**
1414

15-
- Previewing a major-version bump (2 → 3, 3 → 4) before you pull the trigger.
16-
- Confirming an upgrade is "clean" — same major version, no code changes expected.
17-
- Pinning the scan to a specific target with `--to=<version>` when you're not chasing the latest release.
15+
- Previewing a major-version bump (2 → 3, 3 → 4) before you pull the trigger — `check`.
16+
- Confirming an upgrade is "clean" — same major version, no code changes expected — `check`.
17+
- Pinning the scan to a specific target with `--to=<version>` when you're not chasing the latest release — `check`.
18+
- Swapping `vendor/wheels/` from the CLI bundle without a manual zip dance — `apply`.
1819

1920
### Synopsis
2021

2122
``` title="Synopsis"
2223
wheels upgrade check [--to=<version>] [--format=json] [--strict]
24+
wheels upgrade apply [--to=<version>] [--nobackup]
2325
```
2426

25-
Calling `wheels upgrade` with no subcommand (or any subcommand other than `check`) prints usage and exits. The only verb the command currently understands is `check`.
27+
Calling `wheels upgrade` with no subcommand prints concise usage listing both verbs and exits 0.
2628

2729
### What it does
2830

@@ -45,16 +47,14 @@ None that the command enforces — but in practice:
4547
- **Run your tests.** Rerun the test suite after the framework swap, not after this command — `wheels upgrade check` does not exercise anything, it only greps.
4648
- **Internet access** is required when you don't pass `--to=`. The command fetches the latest release tag from GitHub.
4749

48-
### Flags
50+
### Flags — `check`
4951

5052
| Flag | Description |
5153
|---|---|
5254
| `--to=<version>` | Target version to scan against (e.g. `--to=4.0.0`). When omitted, the command queries GitHub for the latest release tag. If the GitHub call fails and no `--to=` is given, the command aborts. |
5355
| `--format=json` | Emit a single machine-readable JSON report instead of the human output — for CI pipelines. Breaking findings (and advisory findings when `--strict` is set) still exit non-zero. |
5456
| `--strict` | Escalate advisory findings (the "Recommended Improvements" section) to the same hard-fail path as breaking findings. The command throws `Wheels.UpgradeCheckFailed` and exits non-zero so CI can gate on opt-in convention changes. Without this flag, advisories are reported but never fail the check. Mirrors Django's `--fail-level WARNING` / Mix's `--warnings-as-errors`. |
5557

56-
That is the complete flag surface. The command does not accept `--force`, `--dry-run`, `--check`, `--backup`, or any apply-style switch — there is nothing to apply.
57-
5858
### Example
5959

6060
```bash title="illustrative"
@@ -124,25 +124,76 @@ Each grep scan covers the file types relevant to that check (`.cfc` and `.cfm` f
124124
The scanner catches the patterns that are most commonly missed during a major upgrade — it is not a full migration checklist. Read the release notes for the target version alongside the scan output.
125125
</Aside>
126126

127+
### `wheels upgrade apply`
128+
129+
`wheels upgrade apply` replaces the app's `vendor/wheels/` with the copy of the framework bundled inside the installed CLI binary. Before any file is touched, the command announces the plan — printing the reserved backup path and the exact one-liner to recover if the swap is interrupted:
130+
131+
```text title="illustrative — pre-swap announcement"
132+
Backing up vendor/wheels -> vendor/wheels.bak-20260611-141502
133+
If this is interrupted, restore with:
134+
rm -rf "/path/to/app/vendor/wheels" && mv "/path/to/app/vendor/wheels.bak-20260611-141502" "/path/to/app/vendor/wheels"
135+
```
136+
137+
After the swap, it reports the version transition and backup location:
138+
139+
```text title="illustrative — swap summary"
140+
3.5.1 -> 4.0.2
141+
Backed up to: vendor/wheels.bak-20260611-141502
142+
```
143+
144+
Safety checks run before any mutation:
145+
- Source (CLI-bundled) and target (`vendor/wheels/`) must each sniff as a valid Wheels framework directory — a generic `box.json` is not sufficient.
146+
- The command refuses to run inside the Wheels repo checkout itself (source = target).
147+
- The command refuses outside a Wheels app (no `vendor/wheels/`).
148+
149+
#### Flags — `apply`
150+
151+
| Flag | Description |
152+
|---|---|
153+
| `--to=<version>` | Assert that the CLI's bundled framework is exactly this version. Errors if the bundled version does not match — `--to` on `apply` is a safety assertion, not a download trigger. Use `wheels upgrade check --to=<version>` to scan before applying. |
154+
| `--nobackup` | Skip the backup. The old `vendor/wheels/` is deleted before the new copy is placed. Useful when disk space is a concern or you have your own rollback strategy (git). |
155+
156+
#### Example
157+
158+
```bash title="typical upgrade sequence"
159+
wheels upgrade check # scan for breaking changes first
160+
wheels upgrade apply # swap vendor/wheels/ with automatic backup
161+
```
162+
163+
```bash title="no-backup apply"
164+
wheels upgrade apply --nobackup
165+
```
166+
127167
### What gets updated
128168

129-
Nothing. The scanner is read-only. To actually move to a new release:
169+
**`check` verb:** Nothing — the scanner is read-only.
130170

131-
- **Homebrew:** `brew upgrade wheels` — replaces the `wheels` CLI binary.
132-
- **Project `vendor/wheels/`:** swap the directory manually, or regenerate the app skeleton against the new release and port your `app/` into it.
171+
**`apply` verb:** `vendor/wheels/` is replaced with the framework bundled in the installed CLI. By default, the old copy is moved to a timestamped `vendor/wheels.bak-*` directory before the swap, so recovery is a single `mv`.
133172

134-
Framework upgrades live outside the CLI by design. `wheels upgrade check` is the safety net you run before and after.
173+
To also update the CLI binary itself:
174+
- **Homebrew:** `brew upgrade wheels`
175+
- **Scoop:** `scoop update wheels`
176+
177+
After each CLI upgrade, run `wheels upgrade apply` to update your app's vendored framework copy.
135178

136179
### Rollback
137180

138-
Because the command writes no files, there is nothing to roll back. If you proceed with the actual upgrade and it goes sideways, the standard git recovery applies to your project:
181+
**`check` verb:** Because the command writes no files, there is nothing to roll back.
139182

140-
```bash title="illustrative"
183+
**`apply` verb:** The old `vendor/wheels/` is moved to a timestamped backup before the swap. The pre-swap announcement prints the exact recovery command — copy it before the swap completes if you want it on hand:
184+
185+
```bash title="recovery — from pre-swap announcement"
186+
rm -rf "/path/to/app/vendor/wheels" && mv "/path/to/app/vendor/wheels.bak-20260611-141502" "/path/to/app/vendor/wheels"
187+
```
188+
189+
If you passed `--nobackup`, recover from git instead:
190+
191+
```bash title="git restore"
141192
git restore vendor/wheels/
142193
git clean -fd vendor/wheels/
143194
```
144195

145-
Or revert the commit that introduced the new `vendor/wheels/` tree. The CLI binary itself is managed by your package manager — `brew` keeps the previous cellar around for `brew switch`-style rollback.
196+
Or revert the commit that recorded the new `vendor/wheels/` tree. The CLI binary itself is managed by your package manager — `brew` keeps the previous cellar around for `brew switch`-style rollback.
146197

147198
### Related commands
148199

‎web/sites/guides/src/content/docs/v4-0-0/start-here/release-channels.mdx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ scoop install wheels
196196
If you want an existing app to follow the channel switch:
197197

198198
```bash title="inside the app"
199-
wheels upgrade check --to=<version>
199+
wheels upgrade check --to=<version> # scan for breaking changes first
200+
wheels upgrade apply # swap vendor/wheels/ from the CLI bundle (creates backup)
200201
```
201202

202-
…or just re-scaffold the app's `vendor/wheels/` from a fresh `wheels new`.
203+
…or re-scaffold the app's `vendor/wheels/` from a fresh `wheels new`.
203204

204205
## When to pick which
205206

‎web/sites/guides/src/content/docs/v4-0-0/upgrading/3x-to-4x.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ The CommandBox-based `wheels-cli` module (invoked as `box wheels upgrade`, `box
386386

387387
```bash title="your shell"
388388
brew install wheels-dev/wheels/wheels
389-
wheels upgrade check
390-
brew upgrade wheels
389+
wheels upgrade check # scan for breaking changes
390+
wheels upgrade apply # swap vendor/wheels/ from the CLI bundle (creates backup)
391391
```
392392

393393
Homebrew 5.1+ asks you to trust third-party taps on first use — run `brew trust wheels-dev/wheels` once if prompted.

0 commit comments

Comments
 (0)