Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the buggy double-prompt behavior) are updated to assert the
new correct behavior; `TestCleanupPrompt_DeleteAllSkipsPerVersionPrompt`
is the explicit regression test for #76. Closes #76.
- `CLAUDE.md`: refresh the stale sections that have drifted out
of sync with the actual code and with `README.md` /
`CHANGELOG.md`. The "Known bugs (do not re-introduce)" entry
used to describe a `ManifestVersion.LTS bool` + useless
`TS string \`json:"ts"\`` fallback — but the actual code at
`internal/node/dist.go:25-62` already uses `LTSCodename *string`
with a custom `UnmarshalJSON` that handles the nodejs.org `lts`
JSON union correctly. The pre-fix shape is gone; the doc would
have misled a future contributor or AI assistant into
"fixing" something that isn't broken. The phase-status table
listed Phase 5 (Config subsystem) and Phase 6 (Cross-platform
polish) as "Not started" — both are fully implemented per the
CHANGELOG's Unreleased section and per `README.md`'s own
Project-status table, which marks Phases 1-6 done. Updated
Phases 4-6 to "Done" and Phase 7 to "In progress" (the
GoReleaser / brew / scoop / npm distribution work tracked by
#17 / #18 is genuinely outstanding). The architecture
diagram listed `internal/packages/restore.go` for `Restore`
— that file doesn't exist; `Restore` and the additional
`RestoreFromSnapshot` both live in `snapshot.go`. The
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.

## [0.0.0] - 2024-07-01

Expand Down
22 changes: 14 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ internal/node/
dist.go nodejs.org/dist/index.json client + 24h TTL cache
internal/packages/ npm global snapshot / restore / migrate (merged in PR #19)
snapshot.go Snapshot(ctx, managerName, version) → ~/.../snapshots/<mgr>-<ver>.json
restore.go Restore(ctx, managerName, version)
Restore(ctx, managerName, version)
RestoreFromSnapshot(ctx, path)
internal/platform/
platform.go DataDir(), SnapshotsDir(), CacheDir(), LockPath(), IsWindows(), …
shell.go RunShell() — all shell exec goes here
Expand All @@ -49,15 +50,20 @@ internal/ui/ (planned, not yet implemented) all user-facing output

**Platform-specific code:** Use `//go:build windows` build tags on `*_windows.go` files. Files without build tags must compile on all three OSes.

**Dependencies:** No new dependencies without a rationale line in the PR body. Core runtime deps: `cobra`, `Masterminds/semver/v3`. Planned but not yet in `go.mod`: `huh`, `bubbletea`, `lipgloss`, `gjson`, `yaml.v3`.
**Dependencies:** No new dependencies without a rationale line in the PR body. Core runtime deps: `cobra`, `Masterminds/semver/v3`, `yaml.v3`. Planned but not yet in `go.mod`: `huh`, `bubbletea`, `lipgloss` (the Charm stack for `internal/ui` — see #74).

**Manager detection order:** `--manager` flag → `~/.nodeup/config.yaml` → auto-detect (env vars → PATH → well-known dirs). `DetectAll()` returns a `Registry`; `ResolveManager(reg, preferred)` picks one or errors. When multiple managers found and no preference, the caller should use `ResolveInteractive` (not yet implemented).

**Packages to skip during migration:** `npm`, `corepack`, `npx` — these are bundled with Node and must not be migrated.

## Known bugs (do not re-introduce)

`ManifestVersion.LTS` in `internal/node/dist.go:22` is typed `bool`, but the nodejs.org API returns a union: `false` for Current releases and a string codename (e.g. `"Iron"`) for LTS releases. The fallback `TS string \`json:"ts"\`` on line 23 does not help because the real JSON key is `lts`, not `ts`. Fix requires a custom `UnmarshalJSON` or `json.RawMessage` on the `LTS` field. This is a latent bug activated by `upgrade.go` calling `FetchManifest()`. Tracked in PR #20 review.
`ManifestVersion.LTS` in `internal/node/dist.go:25-62` is now properly
typed as `LTSCodename *string` with a custom `UnmarshalJSON` that
handles the nodejs.org `lts` JSON union (Current releases have
`lts: false`, LTS releases have `lts: "<codename>"`). The pre-fix
shape (typed `bool` with a useless `TS string \`json:"ts"\`` fallback)
is gone. Don't "fix" this back to a plain `bool`.

## Commit & PR conventions

Expand Down Expand Up @@ -116,11 +122,11 @@ orchestrator.
| 1 — Detector engine | Done | merged |
| 2 — Node version API | Done | merged |
| 3 — Package snapshot/restore | Done | merged (PR #19) |
| 4 — Upgrade command + UI | In progress | `feat/upgrade/end-to-end` / PR #20 |
| 5 — Config subsystem | Not started | — |
| 6 — Cross-platform polish | Not started | — |
| 7 — Distribution packaging | Not started | |
| 8 — v1.0.0 release | Not started | |
| 4 — Upgrade command + UI | Done | merged |
| 5 — Config subsystem | Done | merged |
| 6 — Cross-platform polish | Done | merged (interrupted-upgrade sentinel, `QuotePath`, system-node classifier) |
| 7 — Distribution packaging | In progress | partial — post-upgrade cleanup prompt merged; GoReleaser/brew/scoop/npm tracked by #17 / #18 |
| 8 — v1.0.0 release | In progress | blocked on Phase 7 distribution (#17 / #18) |

## On-disk data layout

Expand Down
Loading