diff --git a/CHANGELOG.md b/CHANGELOG.md index b4ba494..0d13bfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 platform); its stubs still return `ErrNVMWindowsNotImplemented` so callers can detect and skip. Per-manager cleanup behavior is documented in - `docs/managers.md#post-upgrade-cleanup`. Closes #40. + `docs/managers.md#post-upgrade-cleanup`. ### Added (continued) - YAML config file support (`internal/config`): the documented schema @@ -669,6 +669,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 dependencies line listed `gjson` and `yaml.v3` as "planned but not yet in go.mod" — `yaml.v3` is in go.mod (used by the config subsystem), `gjson` was never added. Closes #54. +- Post-upgrade cleanup docs inaccuracies introduced alongside PR + #56 / issue #41: `CHANGELOG.md`'s "Native mutation commands" + bullet cited `#40` (an unrelated `chore(ci): gitignore` + issue) — the citation is dropped (the preceding bullet + already closes #41). `docs/managers.md` described a + fabricated nvm-windows-specific cleanup-suppression note + that doesn't exist in the code — replaced with the real + behavior: the cleanup prompt still runs against nvm-windows, + each `Uninstall()` surfaces `ErrNVMWindowsNotImplemented` + via the generic per-candidate failure line, and the + `ForcePerVersion` downgrade (from #58) kicks in so even + `--cleanup` / `--yes` / `cleanup.auto: true` fall back to + y/N per candidate. The "Manager not on PATH" failure mode + was described as "cleanup is skipped; upgrade still + completes" — corrected to match `detector.ResolveManager`'s + `ErrNoManager` abort, which fails the entire upgrade + command before install/migrate/cleanup. README's + "Phase 7 ✅" line was reconciled with + `docs/managers.md`'s "Phase 7 in progress" banner: + README now uses "Phase 7 🔧 (in progress)" and notes that + cleanup + mutation have shipped while distribution + packaging (#17 / #18) is the remaining Phase 7 work. + Closes #60. ## [0.0.0] - 2024-07-01 diff --git a/README.md b/README.md index 0925773..f81be2d 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ This is the **v1.0.0 development line**. See `CHANGELOG.md` for what's done. | Version | Status | Notes | |---|---|---| -| v1.0.0 | 🛠 in development | Phase 1 ✅ — 8/8 managers detected. Phase 2 ✅ — `nodeup check` with nodejs.org/dist/index.json fetch + TTL cache. Phase 3 ✅ — package snapshot/restore + migration report. Phase 4 ✅ — end-to-end `nodeup upgrade`. Phase 5 ✅ — YAML config file + `config` subcommands (show / get / set / init). Phase 6 ✅ — cross-platform polish: `QuotePath` for paths with spaces, interrupted-upgrade sentinel + replay, system-node classifier with warnings. Phase 7 ✅ — post-upgrade cleanup prompt (`--cleanup` / `--cleanup-version` / `--no-cleanup` / `cleanup.auto` / `cleanup.prompt`) plus native mutation commands for all 7 supported managers. Distribution (GoReleaser + brew/scoop taps + npm wrapper) is also Phase 7 — see issues #17 and #18. | +| v1.0.0 | 🛠 in development | Phase 1 ✅ — 8/8 managers detected. Phase 2 ✅ — `nodeup check` with nodejs.org/dist/index.json fetch + TTL cache. Phase 3 ✅ — package snapshot/restore + migration report. Phase 4 ✅ — end-to-end `nodeup upgrade`. Phase 5 ✅ — YAML config file + `config` subcommands (show / get / set / init). Phase 6 ✅ — cross-platform polish: `QuotePath` for paths with spaces, interrupted-upgrade sentinel + replay, system-node classifier with warnings. Phase 7 🔧 (in progress) — post-upgrade cleanup prompt (`--cleanup` / `--cleanup-version` / `--no-cleanup` / `cleanup.auto` / `cleanup.prompt`) plus native mutation commands for all 7 supported managers have shipped. Distribution packaging (GoReleaser + brew/scoop taps + npm wrapper) is the remaining Phase 7 work — see issues #17 and #18. | Phase 1 is the **detection surface** — every manager is recognized and the version + installed-list reads return real data (PRs #1–#8). Subsequent diff --git a/docs/managers.md b/docs/managers.md index 531a283..79bbf77 100644 --- a/docs/managers.md +++ b/docs/managers.md @@ -77,7 +77,7 @@ bin dir (e.g., `fnm env --use-on-cd | source`, or add points at a binary inside the manager's data dir, nodeup's next run will classify it as `manager` and proceed without warning. -> _Status: Phase 7 in progress — post-upgrade cleanup + native mutation commands per manager._ +> _Status: Phase 7 in progress — post-upgrade cleanup prompt and per-manager native mutation commands have shipped (PR #56 / issue #41). Distribution packaging (GoReleaser, brew/scoop taps, npm wrapper) is the remaining Phase 7 work — see issues #17 and #18. README's "Phase 7 ✅" line refers to the cleanup/mutation work, not the distribution work._ ## Post-upgrade cleanup @@ -147,18 +147,26 @@ Precedence (highest first): | **mise** | `mise install node@` | `mise uninstall node@` | `mise current node` | `SetDefault` writes to `~/.config/mise/config.toml` via `mise use --global`. | | **n** | `n install ` | `n uninstall ` | `n current` (n ≥ 8) | `SetDefault` is a no-op (n auto-uses the latest install). | | **nodenv** | `nodenv install ` | `nodenv uninstall ` | `nodenv version` (treats `system` as "unknown") | SetDefault writes to `~/.nodenv/version`. | -| **nvm-windows**| **unsupported** | **unsupported** | returns `ErrNVMWindowsNotImplemented` | `nvm-windows` doesn't expose a CLI for install/uninstall — the upgrade command leaves the install list alone and prints a clear note. | - -For nvm-windows, the upgrade proceeds normally but the cleanup -prompt is suppressed with a note: "nvm-windows cleanup is not yet -implemented — leave the old versions in place or remove them -manually via `nvm uninstall ` from an elevated shell." +| **nvm-windows**| **unsupported** | **unsupported** | returns `ErrNVMWindowsNotImplemented` | `nvm-windows` doesn't expose a CLI for install/uninstall — `Install`/`Uninstall`/`Use`/`SetDefault`/`GlobalNpmPrefix` all return `ErrNVMWindowsNotImplemented`; the upgrade command leaves the install list alone, and the cleanup prompt runs but each per-version attempt surfaces that sentinel. | + +For nvm-windows, the cleanup prompt **still runs** — it just +operates against a manager whose `Uninstall()` returns +`ErrNVMWindowsNotImplemented` for every candidate. Each +per-version `Uninstall()` call surfaces that sentinel via the +generic `"Failed to delete %s: %v"` line, so the user sees one +failure per version and can remove them manually via `nvm +uninstall ` from an elevated shell. Because `Current()` also +returns the sentinel, the `ForcePerVersion` downgrade (see #58) +kicks in — even `--cleanup` / `--yes` / `cleanup.auto: true` will +prompt y/N for each candidate instead of mass-deleting. ### Failure modes -- **Manager not on PATH** — the cleanup step is skipped entirely; - the upgrade itself still completes (Install/SetDefault will - have already failed loudly if the manager wasn't there). +- **Manager not on PATH** — `detector.ResolveManager` returns + `ErrNoManager`, and the entire upgrade command aborts before + reaching install/migrate/cleanup. There's no "cleanup-only + skipped" path; if the upgrade returns, the cleanup either + ran or was opted out of via `--no-cleanup`. - **Uninstall fails** (permission denied, currently-active version, locked file, ...) — we record the failure and continue with the next candidate. The summary at the end lists both