fix(deps): migrate to lipgloss v2 (charm.land/lipgloss/v2)#93
Merged
Conversation
Lipgloss v2 renamed its module to charm.land/lipgloss/v2 and removed the global renderer: Style.Render() now always emits full ANSI, and color downsampling/stripping happens at write time via colorprofile.Writer. - Rework --color so SetColorMode sets a package colorProfile (auto -> colorprofile.Detect, always -> TrueColor, never -> NoTTY); Print and PrintTaskWithChecklist wrap the caller writer with colorprofile.Writer for styled (non-JSON) output. Behavior is preserved: auto strips when piped, always forces color, never is fully plain. - Drop github.com/muesli/termenv; promote github.com/charmbracelet/colorprofile to a direct dependency. - Rearchitect the output tests around the write-time model (helpers now always emit ANSI); add a hermetic TestMain no-color baseline and coverage for the auto/non-TTY path. Supersedes #73, which could not work: renovate appended /v2 to the old github.com path (which no longer matches the module's declared path) and its go.sum artifact step failed.
Follow-ups from review triage:
- Add a cmd/things TestMain pinning SetColorMode("never") so its styled-output
tests can't become TTY-dependent (they drive Print without going through main).
- Lock in that untrusted task content (Notes) has literal ANSI stripped under
--color=never, the safer v2 write-time behavior.
- Assert color survives always-mode on the PrintTaskWithChecklist (detail) path.
ryanlewis
added a commit
that referenced
this pull request
May 30, 2026
Release notes header for **v0.4.0**, required at the tagged commit by `.goreleaser.yaml` (`readFile ".github/releases/<tag>.md"`). Merge this, then the `v0.4.0` tag gets cut. - Headlines bash/zsh/fish **shell completions** (#94, #95). - Notes the lipgloss v2 migration (#93) and routine dep updates. - Folds in the skill-doc changes (#89). Also removes the orphaned `v0.3.2.md`: v0.3.2 was never tagged and its only change (#89) is now covered here, so we go straight from v0.3.1 → v0.4.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates
things-clifrom lipgloss v1 → v2, replacing the unmergeable renovate PR #73.Why #73 can't work (two independent reasons)
go.moddeclaresmodule charm.land/lipgloss/v2. Renovate just appended/v2to the oldgithub.com/charmbracelet/lipglosspath — which Go rejects outright (declared-path mismatch). The import must becomecharm.land/lipgloss/v2.go.sumwas never populated (renovate'sartifactsstep failed), and renovate doesn't touch the breaking API changes.The real change
v2 removes the global renderer:
lipgloss.SetColorProfile/ColorProfileare gone andStyle.Render()now always emits full-fidelity ANSI. Downsampling/stripping moved to write time viacolorprofile.Writer{Forward, Profile}. So the--colormechanism moved from render-time to write-time:internal/output/style.go— packagecolorProfilevar +detectProfile()/newWriter()helpers;SetColorModemapsauto→colorprofile.Detect,always→TrueColor,never→NoTTY.internal/output/output.go—Print/PrintTaskWithChecklistwrap the caller's writer withnewWriter()for styled (non-JSON) paths only.internal/output/style_test.go— tests assert at the writer boundary (v2 helpers always emit ANSI); hermeticTestMainno-color baseline; newauto/non-TTY coverage.go.mod/go.sum—charm.land/lipgloss/v2 v2.0.3;colorprofilepromoted to direct;github.com/muesli/termenvdropped entirely.Behavior parity (verified end-to-end on the real binary)
--colorautoalwaysneverVerification
go build ./...✅ ·go vet ./...✅ ·golangci-lint run ./...clean ✅go test -race ./...→ 240 pass ✅ ·go mod tidyno-op ✅ ·go mod verify✅/code-review); no correctness bugs in the migration. Fixes applied: hardened the newautotest againstTTY_FORCE, strengthened thealwaystest to assert color (not just decoration), de-duplicated the profile-detection expression.Notes
internal/skill/SKILL.mdand docs unaffected; Kong still enforces theauto|always|neverenum.